From dd9ceb6bc387f6a725c63ea0a00bd1fa3d9333f9 Mon Sep 17 00:00:00 2001 From: Nickiel12 <35903114+Nickiel12@users.noreply.github.com> Date: Sun, 19 Jun 2022 20:21:10 -0700 Subject: [PATCH] renamed change_scene_on_hotkey --- src/main.rs | 2 +- src/modules/message_handler.rs | 5 +++-- src/modules/stream_states/stream_states_class.rs | 6 +++--- src/tests/stream_states_tests.rs | 6 +++--- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/main.rs b/src/main.rs index 78a146d..1210da6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -93,7 +93,7 @@ fn update_all(state: &StreamState, socket: &Socket) { socket.send(StateUpdate::StreamRunning(state.stream_running).to_json().to_string()); socket.send(StateUpdate::StreamSoundToggleOn(state.stream_is_muted).to_json().to_string()); socket.send(StateUpdate::ToggleComputerSoundOn(state.computer_sound_is_on).to_json().to_string()); - socket.send(StateUpdate::ChangeSceneOnChangeSlide(state.change_scene_on_change_slide_hotkey).to_json().to_string()); + socket.send(StateUpdate::ChangeSceneOnChangeSlide(state.change_scene_on_slide_hotkey).to_json().to_string()); socket.send(StateUpdate::SceneIsAugmented(state.scene_is_augmented).to_json().to_string()); socket.send(StateUpdate::TimerCanRun(state.timer_can_run).to_json().to_string()); socket.send(StateUpdate::TimerLength(state.timer_length).to_json().to_string()); diff --git a/src/modules/message_handler.rs b/src/modules/message_handler.rs index f6d863a..750010b 100644 --- a/src/modules/message_handler.rs +++ b/src/modules/message_handler.rs @@ -40,7 +40,8 @@ impl MessageHandler for StreamState { hotkey_handler.prev_slide(false); }, } - if self.change_scene_on_change_slide_hotkey { + + if self.change_scene_on_slide_hotkey { if self.timer_can_run { self.timer_finished = false; self.timer_start = SystemTime::now(); @@ -51,7 +52,7 @@ impl MessageHandler for StreamState { return (None, Some(instructions)) } else {return (None, None)} } - StateUpdate::ChangeSceneOnChangeSlide(value) => {self.change_scene_on_change_slide_hotkey = value; return (Some(update), None)}, + StateUpdate::ChangeSceneOnChangeSlide(value) => {self.change_scene_on_slide_hotkey = value; return (Some(update), None)}, StateUpdate::SceneIsAugmented(value) => { if value { let mut instructions = Vec::new(); diff --git a/src/modules/stream_states/stream_states_class.rs b/src/modules/stream_states/stream_states_class.rs index e4ac6ed..e8971b4 100644 --- a/src/modules/stream_states/stream_states_class.rs +++ b/src/modules/stream_states/stream_states_class.rs @@ -9,7 +9,7 @@ pub struct StreamState { pub stream_is_muted: bool, pub computer_sound_is_on: bool, - pub change_scene_on_change_slide_hotkey: bool, + pub change_scene_on_slide_hotkey: bool, pub scene_is_augmented: bool, pub timer_can_run: bool, @@ -32,7 +32,7 @@ impl Default for StreamState { stream_is_muted: false, computer_sound_is_on: true, - change_scene_on_change_slide_hotkey: true, + change_scene_on_slide_hotkey: true, scene_is_augmented: false, timer_can_run: true, @@ -60,7 +60,7 @@ impl StreamState { 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_change_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::TimerLength(new_val) => {self.timer_length = new_val;}, StateUpdate::TimerText(new_val) => {self.timer_text = new_val;}, diff --git a/src/tests/stream_states_tests.rs b/src/tests/stream_states_tests.rs index f2675ef..4ee2aa6 100644 --- a/src/tests/stream_states_tests.rs +++ b/src/tests/stream_states_tests.rs @@ -31,7 +31,7 @@ fn create_stream_states_class() { assert_eq!(stream_state.stream_running, false); assert_eq!(stream_state.stream_is_muted, false); assert_eq!(stream_state.computer_sound_is_on, true); - assert_eq!(stream_state.change_scene_on_change_slide_hotkey, true); + assert_eq!(stream_state.change_scene_on_slide_hotkey, true); assert_eq!(stream_state.scene_is_augmented, false); assert_eq!(stream_state.timer_text, "0.0"); @@ -119,9 +119,9 @@ fn test_updating() { stream_state.update(StateUpdate::ToggleComputerSoundOn(false)); assert_eq!(stream_state.computer_sound_is_on, false); - assert_eq!(stream_state.change_scene_on_change_slide_hotkey, true); + assert_eq!(stream_state.change_scene_on_slide_hotkey, true); stream_state.update(StateUpdate::ChangeSceneOnChangeSlide(false)); - assert_eq!(stream_state.change_scene_on_change_slide_hotkey, false); + assert_eq!(stream_state.change_scene_on_slide_hotkey, false); assert_eq!(stream_state.scene_is_augmented, false); stream_state.update(StateUpdate::SceneIsAugmented(true));