testing on linux

This commit is contained in:
Nickiel12 2022-06-19 22:03:58 -07:00
parent cdb3666ad7
commit d5061bf674
4 changed files with 16 additions and 6 deletions

View file

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

View file

@ -62,7 +62,9 @@ fn handle_instructions(mut instructions: Vec<StateUpdate>, 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);

View file

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

View file

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