diff --git a/ahk_files/pause_play_global.ahk b/ahk_files/pause_play_global.ahk index babd35e..f043787 100644 --- a/ahk_files/pause_play_global.ahk +++ b/ahk_files/pause_play_global.ahk @@ -15,7 +15,7 @@ if WinExist("ahk_exe Dopamine.exe"){ } If WinExist(A_Args[1]) ; propresenter -{ ; if propresenter isn't active, switch and send clicker forward +{ ; if propresenter isn't active, switch to it if !WinActive(A_Args[1]){ WinActivate } diff --git a/src/main.rs b/src/main.rs index 1210da6..d530084 100644 --- a/src/main.rs +++ b/src/main.rs @@ -62,7 +62,9 @@ fn handle_instructions(mut instructions: Vec, state: &mut StreamSta for i in instructions.iter_mut() { let updates = state.handle_update(i.to_owned(), &hotkeys); if updates.0.is_some() { - socket.send(updates.0.unwrap().to_json().to_string()); + let output = updates.0.unwrap().to_json().to_string(); + println!("sending: {}", output); + socket.send(output); } if updates.1.is_some() { handle_instructions(updates.1.unwrap(), state, socket, hotkeys); diff --git a/src/modules/external_interface.rs b/src/modules/external_interface.rs index 6448ed3..fc47788 100644 --- a/src/modules/external_interface.rs +++ b/src/modules/external_interface.rs @@ -1,9 +1,17 @@ use std::process::Command; use super::stream_states::{state_update::StateUpdate, enums::{SlideChange, SubScenes, Scenes}}; +#[cfg(target_os = "windows")] const AHK_FILES_FOLDER: &str = ".\\ahk_files\\"; +#[cfg(target_os = "windows")] pub const OPTIONS_PATH: &str = ".\\options.json"; + +#[cfg(target_os = "linux")] +const AHK_FILES_FOLDER: &str = "./ahk_files/"; +#[cfg(target_os = "linux")] +pub const OPTIONS_PATH: &str = "./options.json"; + /* const AHK_FILES_FOLDER: &str = "./src/ahk_files/"; pub const OPTIONS_PATH: &str = "./options.json"; @@ -122,18 +130,18 @@ impl Hotkeys { .spawn() .expect("next_slide process call failed"); } else { - println!("pretend linux is sending prosenter next: {}", self.hotkeys["general"]["clicker_backward"].as_str().unwrap()) + println!("pretend linux is sending media: {}", value) }; } pub fn toggle_media_play_pause(&self) { if cfg!(target_family = "windows") { - Command::new(String::from(AHK_FILES_FOLDER) + "music_toggle.exe") + Command::new(String::from(AHK_FILES_FOLDER) + "pause_play_global.exe") .arg(self.hotkeys["windows"]["propresenter_re"].as_str().unwrap()) .spawn() .expect("next_slide process call failed"); } else { - println!("pretend linux is sending prosenter next: {}", self.hotkeys["general"]["clicker_backward"].as_str().unwrap()) + println!("pretend linux is sending media pause") }; } } diff --git a/src/modules/message_handler.rs b/src/modules/message_handler.rs index dab5ef3..a683624 100644 --- a/src/modules/message_handler.rs +++ b/src/modules/message_handler.rs @@ -41,7 +41,7 @@ impl MessageHandler for StreamState { }, } - if self.change_scene_on_slide_hotkey && !self.current_scene.is_camera() { + if self.change_scene_on_slide_hotkey { if self.timer_can_run { self.timer_finished = false; self.timer_start = SystemTime::now();