From bfacd35cd806304480ace7e1c51b546a20cbdebd Mon Sep 17 00:00:00 2001 From: Nickiel12 <35903114+Nickiel12@users.noreply.github.com> Date: Sun, 19 Dec 2021 20:48:26 -0800 Subject: [PATCH] added to_string functions --- src/modules/stream_states/enums.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/modules/stream_states/enums.rs b/src/modules/stream_states/enums.rs index 7793630..84481dd 100644 --- a/src/modules/stream_states/enums.rs +++ b/src/modules/stream_states/enums.rs @@ -1,3 +1,5 @@ +use std::str::FromStr; + #[derive(PartialEq, Debug, Clone, Copy)] pub enum SubScenes { @@ -12,6 +14,20 @@ pub enum SubScenes { } +impl SubScenes { + pub fn to_string(&self) -> String { + match self { + SubScenes::CameraDefault => {String::from_str("Camera_Default").unwrap()}, + SubScenes::CameraWithUpperRight => {String::from_str("Camera_Top_Right").unwrap()}, + SubScenes::CameraWithLargeUpperRight => {String::from_str("Camera_Bottom_Left").unwrap()}, + SubScenes::CameraWithLowerRight => {String::from_str("Camera_Bottom_Right").unwrap()}, + SubScenes::ScreenDefault => {String::from_str("Screen_Default").unwrap()}, + SubScenes::ScreenWithUpperRight => {String::from_str("Screen_Top_Right").unwrap()}, + SubScenes::ScreenWithLowerRight => {String::from_str("Screen_Bottom_Right").unwrap()}, + } + } +} + #[derive(PartialEq, Debug, Clone, Copy)] pub enum Scenes { Camera, @@ -19,3 +35,13 @@ pub enum Scenes { Augmented } +impl Scenes { + pub fn to_string(&self) -> String { + match self { + Scenes::Camera => {String::from_str("Scene_Camera").unwrap()}, + Scenes::Screen => {String::from_str("Scene_Screen").unwrap()}, + Scenes::Augmented => {String::from_str("Augmented").unwrap()}, + } + } +} +