mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
Merge pull request #666 from jackvstrickland/dev
Add shuffle command and command handling
This commit is contained in:
commit
617b3b72b7
1 changed files with 8 additions and 0 deletions
|
@ -78,6 +78,7 @@ pub enum SpircCommand {
|
|||
VolumeUp,
|
||||
VolumeDown,
|
||||
Shutdown,
|
||||
Shuffle,
|
||||
}
|
||||
|
||||
struct SpircTaskConfig {
|
||||
|
@ -350,6 +351,9 @@ impl Spirc {
|
|||
pub fn shutdown(&self) {
|
||||
let _ = self.commands.send(SpircCommand::Shutdown);
|
||||
}
|
||||
pub fn shuffle(&self) {
|
||||
let _ = self.commands.unbounded_send(SpircCommand::Shuffle);
|
||||
}
|
||||
}
|
||||
|
||||
impl SpircTask {
|
||||
|
@ -519,6 +523,10 @@ impl SpircTask {
|
|||
rx.close()
|
||||
}
|
||||
}
|
||||
SpircCommand::Shuffle => {
|
||||
CommandSender::new(self, MessageType::kMessageTypeShuffle).send();
|
||||
self.commands.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue