Skip to content

Commit

Permalink
Add shuffle command and command handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jackvstrickland committed Mar 9, 2021
1 parent 56f1fb6 commit eb4dacb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions connect/src/spirc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ pub enum SpircCommand {
VolumeUp,
VolumeDown,
Shutdown,
Shuffle,
}

struct SpircTaskConfig {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -547,6 +551,10 @@ impl SpircTask {
self.shutdown = true;
self.commands.close();
}
SpircCommand::Shuffle => {
CommandSender::new(self, MessageType::kMessageTypeShuffle).send();
self.commands.close();
}
}
}

Expand Down

0 comments on commit eb4dacb

Please sign in to comment.