From 69ef0f5791c1030054f049e7e0991cd4b3916a6b Mon Sep 17 00:00:00 2001 From: Alula Date: Thu, 3 Sep 2020 14:04:54 +0200 Subject: [PATCH] stopping fix --- src/sound/mod.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/sound/mod.rs b/src/sound/mod.rs index 5e91661..98e01d7 100644 --- a/src/sound/mod.rs +++ b/src/sound/mod.rs @@ -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(rx: Receiver, bank: SoundBank, state = PlaybackState::Playing; } + Ok(PlaybackMessage::Stop) => { + state = PlaybackState::Stopped; + } Ok(PlaybackMessage::SaveState) => { saved_state = Some(engine.get_state()); }