Events: Add Play/Pause events.

Uses much of the existing machinery to add some more PlayMode state change events—all in all, a pretty simple change.

Closes #29.
This commit is contained in:
Kyle Simpson
2021-01-17 23:10:57 +00:00
parent cb2398f182
commit 868c44c19f
3 changed files with 21 additions and 2 deletions

View File

@@ -70,8 +70,8 @@ pub(crate) async fn runner(_interconnect: Interconnect, evt_rx: Receiver<EventMe
Mode(mode) => {
let old = state.playing;
state.playing = mode;
if old != mode && mode.is_done() {
global.fire_track_event(TrackEvent::End, i);
if old != mode {
global.fire_track_event(mode.as_track_event(), i);
}
},
Volume(vol) => {