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
630 B
Rust

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