From eb4dacbc59cddce063fa583d880b59af26e6d69e Mon Sep 17 00:00:00 2001 From: Jack Strickland Date: Tue, 9 Mar 2021 15:37:11 -0600 Subject: [PATCH] Add shuffle command and command handling --- connect/src/spirc.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/connect/src/spirc.rs b/connect/src/spirc.rs index 3153d829..e158f18e 100644 --- a/connect/src/spirc.rs +++ b/connect/src/spirc.rs @@ -75,6 +75,7 @@ pub enum SpircCommand { VolumeUp, VolumeDown, Shutdown, + Shuffle, } struct SpircTaskConfig { @@ -344,6 +345,9 @@ impl Spirc { pub fn shutdown(&self) { let _ = self.commands.unbounded_send(SpircCommand::Shutdown); } + pub fn shuffle(&self) { + let _ = self.commands.unbounded_send(SpircCommand::Shuffle); + } } impl Future for SpircTask { @@ -547,6 +551,10 @@ impl SpircTask { self.shutdown = true; self.commands.close(); } + SpircCommand::Shuffle => { + CommandSender::new(self, MessageType::kMessageTypeShuffle).send(); + self.commands.close(); + } } }