renamed enums -> senes

This commit is contained in:
Nickiel12 2022-06-24 10:02:31 -07:00
parent d5061bf674
commit 8576b6f126
9 changed files with 44 additions and 44 deletions

View file

@ -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\\";

View file

@ -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)

View file

@ -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;
}

View file

@ -1,5 +1,5 @@
use super::enums::{SubScenes, Scenes, SlideChange};
use super::scenes::{SubScenes, Scenes, SlideChange};
use serde_json::Value;

View file

@ -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)]

View file

@ -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]

View file

@ -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}};

View file

@ -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);
}