You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having issues with getting input ports. midi_in.ports(). There is no port function or port_name function on midi_in
#[tauri::command]
fn get_device_list() {
let mut midi_in = MidiInput::new("midir test input");
let midi_out = MidiOutput::new("midir test output");
let mut input = String::new();
loop {
println!("Available input ports:");
for (i, p) in midi_in.ports().iter().enumerate() {
println!("{}: {}", i, midi_in.port_name(p));
}
println!("\nAvailable output ports:");
for (i, p) in midi_out.ports().iter().enumerate() {
println!("{}: {}", i, midi_out.port_name(p));
}
// run in endless loop if "--loop" parameter is specified
match ::std::env::args().nth(1) {
Some(ref arg) if arg == "--loop" => {}
_ => break,
}
}
}
The text was updated successfully, but these errors were encountered:
It working now. Sorry, Looks like I may forgot a closing backet which was giving me an error.
Please explain what the loop is for. My thoughts is that if a new midi device was connect to computer that it would then show the new midi device, however it does not. It only show devices from the list from when the function started. To see new devices plugged in after function runs I have to run the function again
The function midi_in.ports() returns the list of devices at the time when the function is called. Of course you need to run it again to get the updated list after a device is plugged in.
If you mean that you don't see any new devices until you restart your application, then that's probably what issue #86 is about ... are you running on macOS?
Having issues with getting input ports. midi_in.ports(). There is no port function or port_name function on midi_in
The text was updated successfully, but these errors were encountered: