diff --git a/connect/src/spirc.rs b/connect/src/spirc.rs index 4fcb025a..91d86479 100644 --- a/connect/src/spirc.rs +++ b/connect/src/spirc.rs @@ -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(); + } } }