mirror of
https://github.com/Dangoware/dmp-core.git
synced 2025-04-19 13:22:54 -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 => {},
|
Default => {},
|
||||||
Test => { in_thread.send(QueueResponse::Test).unwrap() },
|
Test => { in_thread.send(QueueResponse::Test).unwrap() },
|
||||||
Play => {
|
Play => {
|
||||||
queue.player.play().unwrap();
|
match queue.player.play() {
|
||||||
in_thread.send(QueueResponse::Default).unwrap();
|
Ok(_) => in_thread.send(QueueResponse::Default).unwrap(),
|
||||||
|
Err(_) => unimplemented!()
|
||||||
|
};
|
||||||
|
|
||||||
},
|
},
|
||||||
Pause => {},
|
Pause => {},
|
||||||
SetSongs(songs) => {
|
SetSongs(songs) => {
|
||||||
|
@ -248,7 +251,10 @@ impl Controller {
|
||||||
in_thread.send(QueueResponse::Default).unwrap();
|
in_thread.send(QueueResponse::Default).unwrap();
|
||||||
},
|
},
|
||||||
Enqueue(uri) => {
|
Enqueue(uri) => {
|
||||||
|
if uri.exists().unwrap() {
|
||||||
queue.player.enqueue_next(&uri);
|
queue.player.enqueue_next(&uri);
|
||||||
|
}
|
||||||
|
|
||||||
// in_thread.send(QueueResponse::Default).unwrap();
|
// in_thread.send(QueueResponse::Default).unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -295,12 +301,12 @@ fn name() {
|
||||||
sleep(Duration::from_millis(500));
|
sleep(Duration::from_millis(500));
|
||||||
a.scan_folder("test-config/music/".to_string());
|
a.scan_folder("test-config/music/".to_string());
|
||||||
a.new_queue();
|
a.new_queue();
|
||||||
a.new_queue();
|
// a.new_queue();
|
||||||
let songs = a.get_db_songs();
|
let songs = a.get_db_songs();
|
||||||
a.enqueue(0, songs[1].location.clone());
|
a.enqueue(0, songs[4].location.clone());
|
||||||
a.enqueue(1, songs[2].location.clone());
|
// a.enqueue(1, songs[2].location.clone());
|
||||||
a.play(0).unwrap();
|
a.play(0).unwrap();
|
||||||
a.play(1).unwrap();
|
// a.play(1).unwrap();
|
||||||
|
|
||||||
sleep(Duration::from_secs(10));
|
sleep(Duration::from_secs(10));
|
||||||
}
|
}
|
Loading…
Reference in a new issue