2929ArduinoOutput::ArduinoOutput ()
3030 : GenericProcessor (" Arduino Output" ), gateIsOpen (true ), deviceSelected (false )
3131{
32+ devices = getDevices ();
3233}
3334
3435ArduinoOutput::~ArduinoOutput ()
@@ -39,10 +40,12 @@ ArduinoOutput::~ArduinoOutput()
3940
4041void ArduinoOutput::registerParameters ()
4142{
42- addCategoricalParameter (Parameter::PROCESSOR_SCOPE, " device" , " Device" , " The Arduino device to use" , getDevices () , 0 , true );
43+ addCategoricalParameter (Parameter::PROCESSOR_SCOPE, " device" , " Device" , " The Arduino device to use" , devices , 0 , true );
4344 addIntParameter (Parameter::PROCESSOR_SCOPE, " output_pin" , " Output pin" , " The Arduino pin to use" , 13 , 0 , 13 );
4445 addIntParameter (Parameter::STREAM_SCOPE, " input_line" , " Input line" , " The TTL line for triggering output" , 1 , 1 , 16 );
4546 addIntParameter (Parameter::STREAM_SCOPE, " gate_line" , " Gate line" , " The TTL line for gating the output" , 0 , 0 , 16 );
47+
48+ setDevice (devices[0 ], true );
4649}
4750
4851AudioProcessorEditor* ArduinoOutput::createEditor ()
@@ -59,13 +62,17 @@ Array<String> ArduinoOutput::getDevices()
5962
6063 for (int i = 0 ; i < devices.size (); i++)
6164 {
62- out.add (devices[i].getDevicePath ());
65+ if (devices[i].getDeviceName ().compare (0 , 7 , " Arduino" ) == 0 )
66+ {
67+ out.add (devices[i].getDevicePath ());
68+ }
69+
6370 }
6471
6572 return out;
6673}
6774
68- void ArduinoOutput::setDevice (String devName)
75+ void ArduinoOutput::setDevice (String devName, bool initializing )
6976{
7077 LOGC (" Selecting device " , devName);
7178
@@ -122,7 +129,12 @@ void ArduinoOutput::setDevice (String devName)
122129 CoreServices::sendStatusMessage ((" Arduino could not be initialized at " + devName));
123130 deviceSelected = false ;
124131 }
125- CoreServices::updateSignalChain (this );
132+
133+ if (!initializing)
134+ {
135+ CoreServices::updateSignalChain (this );
136+ }
137+
126138}
127139
128140void ArduinoOutput::updateSettings ()
0 commit comments