This commit is contained in:
Alula 2022-01-08 11:36:33 +01:00
parent 4a91448067
commit 75a1b3f9f4
No known key found for this signature in database
GPG Key ID: 3E00485503A1D8BA
1 changed files with 10 additions and 3 deletions

View File

@ -403,6 +403,12 @@ enum PlaybackStateType {
Ogg(SavedOggPlaybackState),
}
impl Default for PlaybackStateType {
fn default() -> Self {
Self::None
}
}
fn run<T>(
rx: Receiver<PlaybackMessage>,
bank: SoundBank,
@ -526,11 +532,12 @@ where
};
}
Ok(PlaybackMessage::RestoreState) => {
let mut saved_state_loc = PlaybackStateType::None;
std::mem::swap(&mut saved_state_loc, &mut saved_state);
let saved_state_loc = std::mem::take(&mut saved_state);
match saved_state_loc {
PlaybackStateType::None => {}
PlaybackStateType::None => {
state = PlaybackState::Stopped;
}
PlaybackStateType::Organya(playback_state) => {
org_engine.set_state(playback_state, &bank);