40 lines
797 B
Rust
40 lines
797 B
Rust
use std::net::IpAddr;
|
|
use std::str::FromStr;
|
|
|
|
use dsp_thomann::dsp408::DSP408;
|
|
use dsp_thomann::dsp408::types;
|
|
|
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
|
|
let host = IpAddr::from_str("192.168.49.30")?;
|
|
|
|
let mut dsp = DSP408::new(
|
|
host,
|
|
9761,
|
|
1,
|
|
)?;
|
|
|
|
println!("Connecting to DSP...");
|
|
match dsp.connect() {
|
|
Ok(_) => {
|
|
println!("Connected successfully");
|
|
}
|
|
|
|
Err(e) => {
|
|
eprintln!("Connection failed: {}", e);
|
|
return Err(Box::new(e));
|
|
}
|
|
}
|
|
println!("DSP connected.");
|
|
|
|
dsp.set_mute(types::Channel::Input(types::InputChannel::InA), true)?;
|
|
|
|
dbg!(dsp.state()?);
|
|
|
|
println!("Disconnecting...");
|
|
dsp.disconnect();
|
|
println!("Disconnected");
|
|
|
|
|
|
Ok(())
|
|
} |