From fa315fa9a37b49b716facd3af14639dbbe2844c4 Mon Sep 17 00:00:00 2001 From: Nickiel12 <35903114+Nickiel12@users.noreply.github.com> Date: Sat, 18 Dec 2021 23:33:24 -0800 Subject: [PATCH] filled out match arms for incoming buttons --- src/modules/stream_states/state_update.rs | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/modules/stream_states/state_update.rs b/src/modules/stream_states/state_update.rs index a7edc1a..2ab3ae3 100644 --- a/src/modules/stream_states/state_update.rs +++ b/src/modules/stream_states/state_update.rs @@ -7,6 +7,7 @@ pub enum StateUpdate { StreamRunning(bool), StreamIsMuted(bool), ComputerSoundIsOn(bool), + ComputerMediaDoPause(bool), ChangeSceneOnChangeSlideHotkey(bool), SceneIsAugmented(bool), TimerCanRun(bool), @@ -25,8 +26,32 @@ impl StateUpdate { "button" => { let value = &incoming_json["button"]; match value.as_str().unwrap() { + //Master Scenes "Scene_Camera" => {StateUpdate::Scene(Scenes::Camera)} + "Scene_Screen" => {StateUpdate::Scene(Scenes::Screen)} + "Augmented" => {StateUpdate::SceneIsAugmented(incoming_json["data"].as_bool().unwrap())}, + + //Slide changing behavior + "Auto_Change_To_Camera" => {StateUpdate::TimerCanRun(incoming_json["data"].as_bool().unwrap())} + "Change_With_Clicker" => {StateUpdate::ChangeSceneOnChangeSlideHotkey(incoming_json["data"].as_bool().unwrap())}, + + //Extra Toggles + "Toggle_Computer_Volume" => {StateUpdate::ComputerSoundIsOn(incoming_json["data"].as_bool().unwrap())}, + "Toggle_Stream_Volume" => {StateUpdate::StreamIsMuted(incoming_json["data"].as_bool().unwrap())}, + "Media_Pause_Play" => {StateUpdate::ComputerMediaDoPause(incoming_json["data"].as_bool().unwrap())}, + //SubScenes + "Camera_None" => {StateUpdate::SubScene(SubScenes::CameraDefault)}, + "Camera_Top_Right" => {StateUpdate::SubScene(SubScenes::CameraWithUpperRight)}, + "Camera_Bottom_Right" => {StateUpdate::SubScene(SubScenes::CameraWithLowerRight)}, + "Camera_Bottom_Left" => {StateUpdate::SubScene(SubScenes::CameraWithLargeUpperRight)}, + "Screen_None" => {StateUpdate::SubScene(SubScenes::ScreenDefault)}, + "Screen_Top_Right" => {StateUpdate::SubScene(SubScenes::ScreenWithUpperRight)}, + "Screen_Bottom_Right" => {StateUpdate::SubScene(SubScenes::ScreenWithLowerRight)}, + + //Unimplemented + "Next_Slide" | + "Prev_Slide" | _ => {panic!("trying to use a button type I don't know!")} } },