From da196dd8d8ea78ba5bb2f1dc73cdece21d51dfbd Mon Sep 17 00:00:00 2001 From: David Runge Date: Sun, 18 Mar 2018 21:00:58 +0100 Subject: classes/USBMIDIIsm.sc: Add try block, when initializing MIDIClient (might fail, when kernel module is not around, or some other obscure reason). --- classes/USBMIDIIsm.sc | 15 ++++++--------- 1 file 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, { -- cgit v1.2.3-70-g09d2