From 8576b6f12608004972fad393a1f3404ff26f2b98 Mon Sep 17 00:00:00 2001 From: Nickiel12 <35903114+Nickiel12@users.noreply.github.com> Date: Fri, 24 Jun 2022 10:02:31 -0700 Subject: [PATCH] renamed enums -> senes --- src/modules/external_interface.rs | 2 +- src/modules/message_handler.rs | 2 +- src/modules/mod.rs | 2 +- .../stream_states/{enums.rs => scenes.rs} | 0 src/modules/stream_states/state_update.rs | 2 +- .../stream_states/stream_states_class.rs | 2 +- src/tests/main_tests.rs | 2 +- src/tests/state_update_tests.rs | 2 +- src/tests/stream_states_tests.rs | 74 +++++++++---------- 9 files changed, 44 insertions(+), 44 deletions(-) rename src/modules/stream_states/{enums.rs => scenes.rs} (100%) diff --git a/src/modules/external_interface.rs b/src/modules/external_interface.rs index fc47788..50d2181 100644 --- a/src/modules/external_interface.rs +++ b/src/modules/external_interface.rs @@ -1,5 +1,5 @@ use std::process::Command; -use super::stream_states::{state_update::StateUpdate, enums::{SlideChange, SubScenes, Scenes}}; +use super::stream_states::{state_update::StateUpdate, scenes::{SlideChange, SubScenes, Scenes}}; #[cfg(target_os = "windows")] const AHK_FILES_FOLDER: &str = ".\\ahk_files\\"; diff --git a/src/modules/message_handler.rs b/src/modules/message_handler.rs index a683624..51313e8 100644 --- a/src/modules/message_handler.rs +++ b/src/modules/message_handler.rs @@ -1,6 +1,6 @@ use std::time::{SystemTime}; -use super::{stream_states::{state_update::StateUpdate, stream_states_class::StreamState, enums::{SlideChange, Scenes}}, external_interface::{Hotkeys}}; +use super::{stream_states::{state_update::StateUpdate, stream_states_class::StreamState, scenes::{SlideChange, Scenes}}, external_interface::{Hotkeys}}; pub trait MessageHandler { //the first one goes to socket, the second propogates fn handle_update(&mut self, update: StateUpdate, hotkey_handler: &Hotkeys) diff --git a/src/modules/mod.rs b/src/modules/mod.rs index d0daa7c..7829c25 100644 --- a/src/modules/mod.rs +++ b/src/modules/mod.rs @@ -6,5 +6,5 @@ pub mod external_interface; pub mod stream_states { pub mod stream_states_class; pub mod state_update; - pub mod enums; + pub mod scenes; } \ No newline at end of file diff --git a/src/modules/stream_states/enums.rs b/src/modules/stream_states/scenes.rs similarity index 100% rename from src/modules/stream_states/enums.rs rename to src/modules/stream_states/scenes.rs diff --git a/src/modules/stream_states/state_update.rs b/src/modules/stream_states/state_update.rs index fa87dc0..3d68b33 100644 --- a/src/modules/stream_states/state_update.rs +++ b/src/modules/stream_states/state_update.rs @@ -1,5 +1,5 @@ -use super::enums::{SubScenes, Scenes, SlideChange}; +use super::scenes::{SubScenes, Scenes, SlideChange}; use serde_json::Value; diff --git a/src/modules/stream_states/stream_states_class.rs b/src/modules/stream_states/stream_states_class.rs index e8971b4..cf1a025 100644 --- a/src/modules/stream_states/stream_states_class.rs +++ b/src/modules/stream_states/stream_states_class.rs @@ -1,6 +1,6 @@ use std::time::SystemTime; -use super::enums::{SubScenes, Scenes}; +use super::scenes::{SubScenes, Scenes}; use super::state_update::StateUpdate; #[derive(Debug, Clone)] diff --git a/src/tests/main_tests.rs b/src/tests/main_tests.rs index 2266115..0b6c168 100644 --- a/src/tests/main_tests.rs +++ b/src/tests/main_tests.rs @@ -1,6 +1,6 @@ use workctl::sync_flag; -use crate::modules::{stream_states::{ stream_states_class::StreamState, enums::Scenes, state_update::StateUpdate}}; +use crate::modules::{stream_states::{ stream_states_class::StreamState, scenes::Scenes, state_update::StateUpdate}}; #[test] diff --git a/src/tests/state_update_tests.rs b/src/tests/state_update_tests.rs index d485cb0..7799f95 100644 --- a/src/tests/state_update_tests.rs +++ b/src/tests/state_update_tests.rs @@ -1,4 +1,4 @@ -use crate::modules::stream_states::{state_update::StateUpdate, enums::{Scenes, SubScenes, SlideChange}}; +use crate::modules::stream_states::{state_update::StateUpdate, scenes::{Scenes, SubScenes, SlideChange}}; diff --git a/src/tests/stream_states_tests.rs b/src/tests/stream_states_tests.rs index 4ee2aa6..5d82797 100644 --- a/src/tests/stream_states_tests.rs +++ b/src/tests/stream_states_tests.rs @@ -8,18 +8,18 @@ use crate::modules::stream_states::state_update::StateUpdate; fn has_all_enums() { { let members = [ - s_s::enums::SubScenes::CameraDefault, - s_s::enums::SubScenes::CameraWithUpperRight, - s_s::enums::SubScenes::CameraWithLowerRight, - s_s::enums::SubScenes::CameraWithLargeUpperRight, + s_s::scenes::SubScenes::CameraDefault, + s_s::scenes::SubScenes::CameraWithUpperRight, + s_s::scenes::SubScenes::CameraWithLowerRight, + s_s::scenes::SubScenes::CameraWithLargeUpperRight, ]; assert_eq!(members.len(), 4); } { let members = [ - s_s::enums::SubScenes::ScreenDefault, - s_s::enums::SubScenes::ScreenWithUpperRight, - s_s::enums::SubScenes::ScreenWithLowerRight, + s_s::scenes::SubScenes::ScreenDefault, + s_s::scenes::SubScenes::ScreenWithUpperRight, + s_s::scenes::SubScenes::ScreenWithLowerRight, ]; assert_eq!(members.len(), 3); } @@ -38,56 +38,56 @@ fn create_stream_states_class() { assert_eq!(stream_state.timer_length, 15.0); assert_eq!(stream_state.timer_can_run, true); - assert_eq!(stream_state.current_scene, s_s::enums::Scenes::Camera); - assert_eq!(stream_state.camera_sub_scene, s_s::enums::SubScenes::CameraDefault); - assert_eq!(stream_state.screen_sub_scene, s_s::enums::SubScenes::ScreenDefault); + assert_eq!(stream_state.current_scene, s_s::scenes::Scenes::Camera); + assert_eq!(stream_state.camera_sub_scene, s_s::scenes::SubScenes::CameraDefault); + assert_eq!(stream_state.screen_sub_scene, s_s::scenes::SubScenes::ScreenDefault); } #[test] fn scene_correctness(){ let mut stream_state = s_s::stream_states_class::StreamState::new(); - assert_eq!(stream_state.current_scene, s_s::enums::Scenes::Camera); - assert_eq!(stream_state.camera_sub_scene, s_s::enums::SubScenes::CameraDefault); - assert_eq!(stream_state.screen_sub_scene, s_s::enums::SubScenes::ScreenDefault); + assert_eq!(stream_state.current_scene, s_s::scenes::Scenes::Camera); + assert_eq!(stream_state.camera_sub_scene, s_s::scenes::SubScenes::CameraDefault); + assert_eq!(stream_state.screen_sub_scene, s_s::scenes::SubScenes::ScreenDefault); - stream_state.update(StateUpdate::SubScene(s_s::enums::SubScenes::CameraWithUpperRight)); + stream_state.update(StateUpdate::SubScene(s_s::scenes::SubScenes::CameraWithUpperRight)); - assert_eq!(stream_state.camera_sub_scene, s_s::enums::SubScenes::CameraWithUpperRight); - assert_eq!(stream_state.screen_sub_scene, s_s::enums::SubScenes::ScreenDefault); + assert_eq!(stream_state.camera_sub_scene, s_s::scenes::SubScenes::CameraWithUpperRight); + assert_eq!(stream_state.screen_sub_scene, s_s::scenes::SubScenes::ScreenDefault); - stream_state.update(StateUpdate::SubScene(s_s::enums::SubScenes::CameraWithLargeUpperRight)); + stream_state.update(StateUpdate::SubScene(s_s::scenes::SubScenes::CameraWithLargeUpperRight)); - assert_eq!(stream_state.camera_sub_scene, s_s::enums::SubScenes::CameraWithLargeUpperRight); - assert_eq!(stream_state.screen_sub_scene, s_s::enums::SubScenes::ScreenDefault); + assert_eq!(stream_state.camera_sub_scene, s_s::scenes::SubScenes::CameraWithLargeUpperRight); + assert_eq!(stream_state.screen_sub_scene, s_s::scenes::SubScenes::ScreenDefault); - stream_state.update(StateUpdate::SubScene(s_s::enums::SubScenes::CameraWithLowerRight)); + stream_state.update(StateUpdate::SubScene(s_s::scenes::SubScenes::CameraWithLowerRight)); - assert_eq!(stream_state.camera_sub_scene, s_s::enums::SubScenes::CameraWithLowerRight); - assert_eq!(stream_state.screen_sub_scene, s_s::enums::SubScenes::ScreenDefault); + assert_eq!(stream_state.camera_sub_scene, s_s::scenes::SubScenes::CameraWithLowerRight); + assert_eq!(stream_state.screen_sub_scene, s_s::scenes::SubScenes::ScreenDefault); - stream_state.update(StateUpdate::SubScene(s_s::enums::SubScenes::ScreenDefault)); - stream_state.update(StateUpdate::Scene(s_s::enums::Scenes::Screen)); + stream_state.update(StateUpdate::SubScene(s_s::scenes::SubScenes::ScreenDefault)); + stream_state.update(StateUpdate::Scene(s_s::scenes::Scenes::Screen)); - assert_eq!(stream_state.current_scene, s_s::enums::Scenes::Screen); - assert_eq!(stream_state.screen_sub_scene, s_s::enums::SubScenes::ScreenDefault); - assert_eq!(stream_state.camera_sub_scene, s_s::enums::SubScenes::CameraWithLowerRight); + assert_eq!(stream_state.current_scene, s_s::scenes::Scenes::Screen); + assert_eq!(stream_state.screen_sub_scene, s_s::scenes::SubScenes::ScreenDefault); + assert_eq!(stream_state.camera_sub_scene, s_s::scenes::SubScenes::CameraWithLowerRight); - stream_state.update(StateUpdate::SubScene(s_s::enums::SubScenes::ScreenWithLowerRight)); + stream_state.update(StateUpdate::SubScene(s_s::scenes::SubScenes::ScreenWithLowerRight)); - assert_eq!(stream_state.screen_sub_scene, s_s::enums::SubScenes::ScreenWithLowerRight); - assert_eq!(stream_state.camera_sub_scene, s_s::enums::SubScenes::CameraWithLowerRight); + assert_eq!(stream_state.screen_sub_scene, s_s::scenes::SubScenes::ScreenWithLowerRight); + assert_eq!(stream_state.camera_sub_scene, s_s::scenes::SubScenes::CameraWithLowerRight); - stream_state.update(StateUpdate::SubScene(s_s::enums::SubScenes::ScreenWithUpperRight)); + stream_state.update(StateUpdate::SubScene(s_s::scenes::SubScenes::ScreenWithUpperRight)); - assert_eq!(stream_state.screen_sub_scene, s_s::enums::SubScenes::ScreenWithUpperRight); - assert_eq!(stream_state.camera_sub_scene, s_s::enums::SubScenes::CameraWithLowerRight); + assert_eq!(stream_state.screen_sub_scene, s_s::scenes::SubScenes::ScreenWithUpperRight); + assert_eq!(stream_state.camera_sub_scene, s_s::scenes::SubScenes::CameraWithLowerRight); - stream_state.update(StateUpdate::Scene(s_s::enums::Scenes::Augmented)); + stream_state.update(StateUpdate::Scene(s_s::scenes::Scenes::Augmented)); - assert_eq!(stream_state.current_scene, s_s::enums::Scenes::Augmented); - assert_eq!(stream_state.screen_sub_scene, s_s::enums::SubScenes::ScreenWithUpperRight); - assert_eq!(stream_state.camera_sub_scene, s_s::enums::SubScenes::CameraWithLowerRight); + assert_eq!(stream_state.current_scene, s_s::scenes::Scenes::Augmented); + assert_eq!(stream_state.screen_sub_scene, s_s::scenes::SubScenes::ScreenWithUpperRight); + assert_eq!(stream_state.camera_sub_scene, s_s::scenes::SubScenes::CameraWithLowerRight); }