renamed stream_states_class -> stream_state
This commit is contained in:
parent
81fd3bc2ce
commit
b974bc5b59
7 changed files with 9 additions and 9 deletions
|
@ -1,7 +1,7 @@
|
|||
use std::{time::Duration, thread, io::Read};
|
||||
use crossbeam_channel::unbounded;
|
||||
|
||||
use modules::{socket_handler::Socket, stream_states::stream_states_class::StreamState, message_handler::{MessageHandler}, external_interface::{Hotkeys, OPTIONS_PATH}};
|
||||
use modules::{socket_handler::Socket, stream_states::stream_state::StreamState, message_handler::{MessageHandler}, external_interface::{Hotkeys, OPTIONS_PATH}};
|
||||
use workctl::sync_flag;
|
||||
|
||||
use crate::modules::stream_states::state_update::StateUpdate;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::time::{SystemTime};
|
||||
|
||||
use super::{stream_states::{state_update::StateUpdate, stream_states_class::StreamState, scenes::{SlideChange, Scenes}}, external_interface::{Hotkeys}};
|
||||
use super::{stream_states::{state_update::StateUpdate, stream_state::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)
|
||||
|
|
|
@ -4,7 +4,7 @@ pub mod socket_handler;
|
|||
pub mod external_interface;
|
||||
|
||||
pub mod stream_states {
|
||||
pub mod stream_states_class;
|
||||
pub mod stream_state;
|
||||
pub mod state_update;
|
||||
pub mod scenes;
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
use workctl::sync_flag;
|
||||
|
||||
use crate::modules::{stream_states::{ stream_states_class::StreamState, scenes::Scenes, state_update::StateUpdate}};
|
||||
use crate::modules::{stream_states::{ stream_state::StreamState, scenes::Scenes, state_update::StateUpdate}};
|
||||
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use crate::modules::{message_handler::{MessageHandler}, stream_states::{state_update::StateUpdate, stream_states_class::StreamState}, external_interface::Hotkeys};
|
||||
use crate::modules::{message_handler::{MessageHandler}, stream_states::{state_update::StateUpdate, stream_state::StreamState}, external_interface::Hotkeys};
|
||||
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -27,7 +27,7 @@ fn has_all_enums() {
|
|||
|
||||
#[test]
|
||||
fn create_stream_states_class() {
|
||||
let stream_state = s_s::stream_states_class::StreamState::new();
|
||||
let stream_state = s_s::stream_state::StreamState::new();
|
||||
assert_eq!(stream_state.stream_running, false);
|
||||
assert_eq!(stream_state.stream_is_muted, false);
|
||||
assert_eq!(stream_state.computer_sound_is_on, true);
|
||||
|
@ -46,7 +46,7 @@ fn create_stream_states_class() {
|
|||
|
||||
#[test]
|
||||
fn scene_correctness(){
|
||||
let mut stream_state = s_s::stream_states_class::StreamState::new();
|
||||
let mut stream_state = s_s::stream_state::StreamState::new();
|
||||
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);
|
||||
|
@ -93,7 +93,7 @@ fn scene_correctness(){
|
|||
|
||||
#[test]
|
||||
fn test_updating() {
|
||||
let mut stream_state = s_s::stream_states_class::StreamState::new();
|
||||
let mut stream_state = s_s::stream_state::StreamState::new();
|
||||
|
||||
assert_eq!(stream_state.timer_can_run, true);
|
||||
stream_state.update(StateUpdate::TimerCanRun(false));
|
||||
|
@ -134,7 +134,7 @@ fn can_run_in_thread() {
|
|||
let (tx, rx) = mpsc::channel();
|
||||
|
||||
let rx_thread = thread::spawn(move || {
|
||||
let mut stream_state = s_s::stream_states_class::StreamState::new();
|
||||
let mut stream_state = s_s::stream_state::StreamState::new();
|
||||
for received in rx {
|
||||
assert_eq!(received, StateUpdate::StreamRunning(true));
|
||||
stream_state.update(received);
|
||||
|
|
Loading…
Reference in a new issue