1
0
Fork 0
mirror of https://github.com/doukutsu-rs/doukutsu-rs synced 2024-10-31 19:44:20 +00:00

stopping fix

This commit is contained in:
Alula 2020-09-03 14:04:54 +02:00
parent 510439d9ec
commit 69ef0f5791
No known key found for this signature in database
GPG key ID: 3E00485503A1D8BA

View file

@ -1,8 +1,7 @@
use std::sync::{mpsc, RwLock};
use std::sync::mpsc;
use std::sync::mpsc::{Receiver, Sender};
use bitflags::_core::time::Duration;
use cpal::Sample;
use cpal::traits::{DeviceTrait, HostTrait, StreamTrait};
use crate::engine_constants::EngineConstants;
@ -25,7 +24,7 @@ pub struct SoundManager {
current_song_id: usize,
}
static SONGS: [&'static str; 42] = [
static SONGS: [&str; 42] = [
"XXXX",
"WANPAKU",
"ANZEN",
@ -175,6 +174,9 @@ fn run<T>(rx: Receiver<PlaybackMessage>, bank: SoundBank,
state = PlaybackState::Playing;
}
Ok(PlaybackMessage::Stop) => {
state = PlaybackState::Stopped;
}
Ok(PlaybackMessage::SaveState) => {
saved_state = Some(engine.get_state());
}