1
0
Fork 0
mirror of https://github.com/doukutsu-rs/doukutsu-rs synced 2024-10-31 19:44:20 +00:00
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

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);