Skip to content

Commit

Permalink
Merge pull request #666 from jackvstrickland/dev
Browse files Browse the repository at this point in the history
Add shuffle command and command handling
  • Loading branch information
sashahilton00 authored May 1, 2021
2 parents 8973d29 + eb4dacb commit 617b3b7
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 @@ -78,6 +78,7 @@ pub enum SpircCommand {
VolumeUp,
VolumeDown,
Shutdown,
Shuffle,
}

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

Expand Down

0 comments on commit 617b3b7

Please sign in to comment.