diff --git a/src/main.rs b/src/main.rs index 51347e0..33d5915 100644 --- a/src/main.rs +++ b/src/main.rs @@ -43,7 +43,7 @@ fn main() { } println!("{:?}", args); let proj = Arc::new(Mutex::new(projector::Projector::new( - "127.0.0.1:8080", + "192.168.0.8", //"127.0.0.1:8080", "admin1", "panasonic", ))); @@ -64,14 +64,22 @@ fn main() { vec![ ( 3, - Box::new(move || { - proj1.lock().unwrap().shutter_on().unwrap(); + Box::new(move || match proj1.lock().unwrap().shutter_off() { + Ok(_) => println!("Receiving SHUTTER OFF message"), + Err(_e) => { + println!("Error receiving SHUTTER OFF message"); + "Error".to_string(); + } }), ), ( 4, - Box::new(move || { - proj2.lock().unwrap().shutter_on().unwrap(); + Box::new(move || match proj2.lock().unwrap().shutter_on() { + Ok(_) => println!("Receiving SHUTTER ON message"), + Err(_e) => { + println!("Error receiving SHUTTER ON message"); + "Error".to_string(); + } // proj2.lock().unwrap().unwrap_or((|| {})()); }), ), ], diff --git a/src/midi.rs b/src/midi.rs index cedec07..f53d474 100644 --- a/src/midi.rs +++ b/src/midi.rs @@ -50,12 +50,11 @@ pub fn connect_loop_with_callback( move |_timestamp, message, _| { // Handle MIDI messages here let (command, note, _value) = (message[0], message[1], message[2]); - println!("Received MIDI message: {:?}", message); + //println!("Received MIDI message: {:?}", message); match (command, note) { (144, 3..=4) => { for (id, f) in calls.iter() { if note == *id { - println!("match"); f(); } let mut list = vec![];