added timer pause length
cleaned match statement
This commit is contained in:
parent
8576b6f126
commit
81b09b7e42
1 changed files with 12 additions and 13 deletions
|
@ -17,6 +17,7 @@ pub struct StreamState {
|
|||
pub timer_text: String,
|
||||
pub timer_start: SystemTime,
|
||||
pub timer_finished: bool,
|
||||
pub timer_paused_length: Option<u16>,
|
||||
|
||||
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"),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue