|
|
|
@ -1,15 +1,7 @@
|
|
|
|
|
use std::env;
|
|
|
|
|
|
|
|
|
|
use anyhow::Result;
|
|
|
|
|
use obws::{
|
|
|
|
|
common::FontFlags,
|
|
|
|
|
requests::{
|
|
|
|
|
custom::source_settings::{Font, TextFt2SourceV2, SOURCE_TEXT_FT2_SOURCE_V2},
|
|
|
|
|
SourceSettings,
|
|
|
|
|
},
|
|
|
|
|
Client,
|
|
|
|
|
};
|
|
|
|
|
use rgb::RGBA8;
|
|
|
|
|
use obws::Client;
|
|
|
|
|
|
|
|
|
|
#[tokio::main]
|
|
|
|
|
async fn main() -> Result<()> {
|
|
|
|
@ -25,26 +17,8 @@ async fn main() -> Result<()> {
|
|
|
|
|
|
|
|
|
|
client.login(env::var("OBS_PASSWORD").ok()).await?;
|
|
|
|
|
|
|
|
|
|
let settings = client
|
|
|
|
|
.sources()
|
|
|
|
|
.set_source_settings::<_, serde_json::Value>(SourceSettings {
|
|
|
|
|
source_name: "TEST-1",
|
|
|
|
|
source_type: Some(SOURCE_TEXT_FT2_SOURCE_V2),
|
|
|
|
|
source_settings: &TextFt2SourceV2 {
|
|
|
|
|
color1: RGBA8::new(255, 0, 0, 255),
|
|
|
|
|
color2: RGBA8::new(0, 0, 255, 255),
|
|
|
|
|
text: "Hello world!",
|
|
|
|
|
font: Font {
|
|
|
|
|
flags: FontFlags::BOLD,
|
|
|
|
|
style: "Bold",
|
|
|
|
|
..Font::default()
|
|
|
|
|
},
|
|
|
|
|
..TextFt2SourceV2::default()
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
.await?;
|
|
|
|
|
|
|
|
|
|
println!("{:#?}", settings.source_settings);
|
|
|
|
|
let scene_list = client.scenes().get_scene_list().await?;
|
|
|
|
|
println!("{:#?}", scene_list);
|
|
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
|
}
|
|
|
|
|