diff options
author | David Runge <dave@sleepmap.de> | 2018-03-18 21:00:58 +0100 |
---|---|---|
committer | David Runge <dave@sleepmap.de> | 2018-03-18 21:00:58 +0100 |
commit | da196dd8d8ea78ba5bb2f1dc73cdece21d51dfbd (patch) | |
tree | 15500582e186cb7d160bf3b37d398753647447ec /classes | |
parent | 6a213f643bcee208afe6f1808e7ce4b634e39852 (diff) | |
download | usbmidiism-da196dd8d8ea78ba5bb2f1dc73cdece21d51dfbd.tar.gz usbmidiism-da196dd8d8ea78ba5bb2f1dc73cdece21d51dfbd.tar.bz2 usbmidiism-da196dd8d8ea78ba5bb2f1dc73cdece21d51dfbd.tar.xz usbmidiism-da196dd8d8ea78ba5bb2f1dc73cdece21d51dfbd.zip |
classes/USBMIDIIsm.sc: Add try block, when initializing MIDIClient (might fail, when kernel module is not around, or some other obscure reason).
Diffstat (limited to 'classes')
-rw-r--r-- | classes/USBMIDIIsm.sc | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/classes/USBMIDIIsm.sc b/classes/USBMIDIIsm.sc index 52e421b..63f3412 100644 --- a/classes/USBMIDIIsm.sc +++ b/classes/USBMIDIIsm.sc @@ -18,7 +18,11 @@ USBMIDIIsm{ discoverDevices{ if(MIDIClient.initialized.not,{ postln("Initializing MIDIClient..."); - MIDIClient.init(verbose: verbose); + { + MIDIClient.init(verbose: verbose); + }.try( + postln("Failed!") + ); },{ if(devices.size > 0, { postln("Resetting list of MIDI input devices."); @@ -44,7 +48,7 @@ USBMIDIIsm{ inEndPoint.device.contains("Announce")).not, { // correlate with output devices MIDIClient.destinations.do({|outEndPoint, outPortNum| - var device, state; + var device; if((inEndPoint.device == outEndPoint.device && inEndPoint.uid == outEndPoint.uid), { // available devices @@ -95,13 +99,6 @@ USBMIDIIsm{ }); } - setStates{ - arg device; - - - } - - listen{ arg listen = true; if(listen, { |