From 81b09b7e42aba1eeaa05c5f9e6aceb8c0d51473b Mon Sep 17 00:00:00 2001 From: Nickiel12 <35903114+Nickiel12@users.noreply.github.com> Date: Fri, 24 Jun 2022 11:32:58 -0700 Subject: [PATCH] added timer pause length cleaned match statement --- .../stream_states/stream_states_class.rs | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/modules/stream_states/stream_states_class.rs b/src/modules/stream_states/stream_states_class.rs index cf1a025..b311200 100644 --- a/src/modules/stream_states/stream_states_class.rs +++ b/src/modules/stream_states/stream_states_class.rs @@ -17,6 +17,7 @@ pub struct StreamState { pub timer_text: String, pub timer_start: SystemTime, pub timer_finished: bool, + pub timer_paused_length: Option, pub current_scene: Scenes, pub camera_sub_scene: SubScenes, @@ -40,6 +41,7 @@ impl Default for StreamState { timer_text: String::from("0.0"), timer_start: SystemTime::now(), timer_finished: true, + timer_paused_length: None, current_scene: Scenes::Camera, camera_sub_scene: SubScenes::CameraDefault, @@ -57,19 +59,16 @@ impl StreamState { pub fn update(&mut self, update: StateUpdate) { match update { - StateUpdate::StreamRunning(new_val) => {self.stream_running = new_val;}, - StateUpdate::StreamSoundToggleOn(new_val) => {self.stream_is_muted = new_val;}, - StateUpdate::ToggleComputerSoundOn(new_val) => {self.computer_sound_is_on = new_val;}, - StateUpdate::ChangeSceneOnChangeSlide(new_val) => {self.change_scene_on_slide_hotkey = new_val;}, - StateUpdate::TimerCanRun(new_val) => {self.timer_can_run = new_val;}, - StateUpdate::TimerLength(new_val) => {self.timer_length = new_val;}, - StateUpdate::TimerText(new_val) => {self.timer_text = new_val;}, - StateUpdate::SceneIsAugmented(new_val) => {self.scene_is_augmented = new_val;}, - StateUpdate::Scene(_) => {}, - StateUpdate::SubScene(_) => {}, - StateUpdate::ComputerMediaDoPause => {}, - StateUpdate::ChangeSlide(_value) => {panic!("Stream_states_class is not supposed to get this update type");}, - StateUpdate::UpdateClient => {}, + StateUpdate::StreamRunning(new_val) => self.stream_running = new_val, + StateUpdate::StreamSoundToggleOn(new_val) => self.stream_is_muted = new_val, + StateUpdate::ToggleComputerSoundOn(new_val) => self.computer_sound_is_on = new_val, + StateUpdate::ChangeSceneOnChangeSlide(new_val) => self.change_scene_on_slide_hotkey = new_val, + StateUpdate::TimerCanRun(new_val) => self.timer_can_run = new_val, + StateUpdate::TimerLength(new_val) => self.timer_length = new_val, + StateUpdate::TimerText(new_val) => self.timer_text = new_val, + StateUpdate::SceneIsAugmented(new_val) => self.scene_is_augmented = new_val, + StateUpdate::ChangeSlide(_value) => panic!("Stream_states_class is not supposed to get this update type"), + _ => {} } } }