You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
obws/examples/iter_scenes.rs

27 lines
615 B
Rust

use std::{env, time::Duration};
use anyhow::Result;
use obws::Client;
#[tokio::main]
async fn main() -> Result<()> {
dotenvy::dotenv().ok();
env::set_var("RUST_LOG", "obws=debug");
tracing_subscriber::fmt::init();
let client = Client::connect("localhost", 4455, env::var("OBS_PASSWORD").ok()).await?;
let scene_list = client.scenes().list().await?;
for scene in scene_list.scenes.iter().cycle() {
client
.scenes()
.set_current_program_scene(&scene.name)
.await?;
tokio::time::sleep(Duration::from_secs(1)).await;
}
Ok(())
}