I am creating a GUI for USB-MIDI audio processor. The device used to connect to computer through USB cable.
MIDI is the communication protocol. When a GUI is launched, I am creating a MIDIOutput object and calling the open() and sendMessageNow() method to send the MIDI messages.
My question is how can I know if device is attached or not or is it powered off after connecting and I can display some message to the user and stop sending the MIDI message. It’s like someone unplg the MIDI device.
Basically, I am trying to implement the Online/Offline state of the MIDI device.
Any suggestion is welcome!!!