feat: IP arg

This commit is contained in:
2024-02-05 21:34:03 +00:00
parent 80b73922ac
commit 2ee3d71e78
3 changed files with 193 additions and 1 deletions
+1
View File
@@ -7,6 +7,7 @@ edition = "2021"
[dependencies]
atem-connection-rs = { path = "../atem-connection-rs" }
clap = { version = "4.4.18", features = ["derive"] }
color-eyre = "0.5.11"
env_logger = "0.9.0"
tokio = "1.14.0"
+13 -1
View File
@@ -8,18 +8,30 @@ use atem_connection_rs::{
},
};
use clap::Parser;
use color_eyre::Report;
use tokio::time::sleep;
/// ATEM Rust Library Test App
#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
struct Args {
/// IP of the ATEM to connect to
#[arg(short, long)]
ip: String,
}
#[tokio::main]
async fn main() {
let args = Args::parse();
setup_logging().unwrap();
let switch_to_source_1 = ProgramInput::new(0, 1);
let switch_to_source_2 = ProgramInput::new(0, 2);
let mut atem = AtemSocket::new();
atem.connect("127.0.0.1".to_string(), 9910).await.ok();
atem.connect(args.ip, 9910).await.ok();
let mut tracking_id = 0;
loop {