mirror of
https://github.com/Dangoware/dango-music-player.git
synced 2025-04-19 10:02:53 -05:00
edited the Play command and the test function
This commit is contained in:
parent
e25a7bfcc8
commit
c842bf0b9c
1 changed files with 14 additions and 8 deletions
|
@ -239,8 +239,11 @@ impl Controller {
|
|||
Default => {},
|
||||
Test => { in_thread.send(QueueResponse::Test).unwrap() },
|
||||
Play => {
|
||||
queue.player.play().unwrap();
|
||||
in_thread.send(QueueResponse::Default).unwrap();
|
||||
match queue.player.play() {
|
||||
Ok(_) => in_thread.send(QueueResponse::Default).unwrap(),
|
||||
Err(_) => unimplemented!()
|
||||
};
|
||||
|
||||
},
|
||||
Pause => {},
|
||||
SetSongs(songs) => {
|
||||
|
@ -248,7 +251,10 @@ impl Controller {
|
|||
in_thread.send(QueueResponse::Default).unwrap();
|
||||
},
|
||||
Enqueue(uri) => {
|
||||
if uri.exists().unwrap() {
|
||||
queue.player.enqueue_next(&uri);
|
||||
}
|
||||
|
||||
// in_thread.send(QueueResponse::Default).unwrap();
|
||||
}
|
||||
}
|
||||
|
@ -295,12 +301,12 @@ fn name() {
|
|||
sleep(Duration::from_millis(500));
|
||||
a.scan_folder("test-config/music/".to_string());
|
||||
a.new_queue();
|
||||
a.new_queue();
|
||||
// a.new_queue();
|
||||
let songs = a.get_db_songs();
|
||||
a.enqueue(0, songs[1].location.clone());
|
||||
a.enqueue(1, songs[2].location.clone());
|
||||
a.enqueue(0, songs[4].location.clone());
|
||||
// a.enqueue(1, songs[2].location.clone());
|
||||
a.play(0).unwrap();
|
||||
a.play(1).unwrap();
|
||||
// a.play(1).unwrap();
|
||||
|
||||
sleep(Duration::from_secs(10));
|
||||
}
|
Loading…
Reference in a new issue