added timer pause length

cleaned match statement
This commit is contained in:
Nickiel12 2022-06-24 11:32:58 -07:00
parent 8576b6f126
commit 81b09b7e42

View file

@ -17,6 +17,7 @@ pub struct StreamState {
pub timer_text: String, pub timer_text: String,
pub timer_start: SystemTime, pub timer_start: SystemTime,
pub timer_finished: bool, pub timer_finished: bool,
pub timer_paused_length: Option<u16>,
pub current_scene: Scenes, pub current_scene: Scenes,
pub camera_sub_scene: SubScenes, pub camera_sub_scene: SubScenes,
@ -40,6 +41,7 @@ impl Default for StreamState {
timer_text: String::from("0.0"), timer_text: String::from("0.0"),
timer_start: SystemTime::now(), timer_start: SystemTime::now(),
timer_finished: true, timer_finished: true,
timer_paused_length: None,
current_scene: Scenes::Camera, current_scene: Scenes::Camera,
camera_sub_scene: SubScenes::CameraDefault, camera_sub_scene: SubScenes::CameraDefault,
@ -57,19 +59,16 @@ impl StreamState {
pub fn update(&mut self, update: StateUpdate) { pub fn update(&mut self, update: StateUpdate) {
match update { match update {
StateUpdate::StreamRunning(new_val) => {self.stream_running = new_val;}, StateUpdate::StreamRunning(new_val) => self.stream_running = new_val,
StateUpdate::StreamSoundToggleOn(new_val) => {self.stream_is_muted = new_val;}, StateUpdate::StreamSoundToggleOn(new_val) => self.stream_is_muted = new_val,
StateUpdate::ToggleComputerSoundOn(new_val) => {self.computer_sound_is_on = 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::ChangeSceneOnChangeSlide(new_val) => self.change_scene_on_slide_hotkey = new_val,
StateUpdate::TimerCanRun(new_val) => {self.timer_can_run = new_val;}, StateUpdate::TimerCanRun(new_val) => self.timer_can_run = new_val,
StateUpdate::TimerLength(new_val) => {self.timer_length = new_val;}, StateUpdate::TimerLength(new_val) => self.timer_length = new_val,
StateUpdate::TimerText(new_val) => {self.timer_text = new_val;}, StateUpdate::TimerText(new_val) => self.timer_text = new_val,
StateUpdate::SceneIsAugmented(new_val) => {self.scene_is_augmented = new_val;}, StateUpdate::SceneIsAugmented(new_val) => self.scene_is_augmented = new_val,
StateUpdate::Scene(_) => {}, StateUpdate::ChangeSlide(_value) => panic!("Stream_states_class is not supposed to get this update type"),
StateUpdate::SubScene(_) => {}, _ => {}
StateUpdate::ComputerMediaDoPause => {},
StateUpdate::ChangeSlide(_value) => {panic!("Stream_states_class is not supposed to get this update type");},
StateUpdate::UpdateClient => {},
} }
} }
} }