From 991849b32acf83dd14a5096540bb053d2572502a Mon Sep 17 00:00:00 2001 From: Wavy Harp Date: Sun, 7 May 2023 23:04:53 -0600 Subject: initial import currently everything is very tied to alsa and my system, for the moment you'll need to manually change the device names and maybe channels/period_size in src/main.rs, src/bin/smolguitar.rs and src/bin/loopbacker.rs, i'll fix that and add runtime period size/updater allocation soon, (and probably make a cpal backend as well so it can work on other platforms), but doing this initial commit to play around with stereo for now~ --- src/bin/test_serde.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/bin/test_serde.rs (limited to 'src/bin/test_serde.rs') diff --git a/src/bin/test_serde.rs b/src/bin/test_serde.rs new file mode 100644 index 0000000..02b42e4 --- /dev/null +++ b/src/bin/test_serde.rs @@ -0,0 +1,22 @@ +use crossterm::style::Color; +use serde::{Serialize, Deserialize}; +use serde_json::{to_string_pretty, from_str}; + +#[derive(Serialize, Deserialize, Debug)] +struct cscheme { + a: Color, + asharp: Color, + b: Color, +} + +fn main() { + let val = Color::Rgb {r: 110, g: 255, b: 220}; + let val2 = Color::AnsiValue(51); + let val3 = Color::DarkMagenta; + let scheme = cscheme {a: val, asharp: val2, b: val3}; + let json = to_string_pretty(&scheme).unwrap(); + println!("{}", json); + let result: cscheme = from_str(&json).unwrap(); + println!("{:?}", result); + //println!("{} {}", to_string_pretty +} -- cgit v1.1