@@ -99,7 +99,6 @@ void NetworkEvents::createEventChannels()
9999 TTLchan->setName (" Network Events output" );
100100 TTLchan->setDescription (" Triggers whenever \" TTL\" is received on the port." );
101101 TTLchan->setIdentifier (" external.network.ttl" );
102- // Possibly add meta data (reason for ttl event?)
103102 eventChannelArray.add (TTLchan);
104103 TTLChannel = TTLchan;
105104}
@@ -225,9 +224,9 @@ String NetworkEvents::handleSpecialMessages(const String& s)
225224 }
226225 else if (cmd.compareIgnoreCase (" TTL" ) == 0 )
227226 {
228- // Default to channel 0 and off (if no info sent)
229- int channel = 0 ;
230- bool onOff = false ;
227+ // Default to channel 0 and off (if no optional info sent)
228+ int channel = 1 ;
229+ bool onOff = 0 ;
231230 /* * Set optional parameters (name/value pairs)*/
232231 String params = s.substring (cmd.length ()).trim ();
233232 StringPairArray dict = parseNetworkMessage (params);
@@ -241,7 +240,7 @@ String NetworkEvents::handleSpecialMessages(const String& s)
241240 if (key.compareIgnoreCase (" Channel" ) == 0 )
242241 {
243242 // Make sure in range
244- if (value <= 8 && value >= 0 )
243+ if (value <= 8 && value >= 1 )
245244 {
246245 channel = value;
247246 }
@@ -265,13 +264,13 @@ String NetworkEvents::handleSpecialMessages(const String& s)
265264
266265
267266
268- return " TTL Handled" ;
267+ return " TTL Handled: Channel= " + String (channel) + " on= " + String (onOff) ;
269268 }
270269
271270 return String (" NotHandled" );
272271}
273272
274- void NetworkEvents::triggerEvent (StringTTL TTLmsg, juce::int64 timestamp)
273+ void NetworkEvents::triggerTTLEvent (StringTTL TTLmsg, juce::int64 timestamp)
275274{
276275 juce::uint8 ttlData = TTLmsg.onOff << TTLmsg.eventChannel ;
277276 TTLEventPtr event = TTLEvent::createTTLEvent (TTLChannel, timestamp, &ttlData, sizeof (juce::uint8), TTLmsg.eventChannel );
@@ -299,7 +298,7 @@ void NetworkEvents::process (AudioSampleBuffer& buffer)
299298 while (!TTLQueue.empty ())
300299 {
301300 const StringTTL& TTLmsg = TTLQueue.front ();
302- triggerEvent (TTLmsg, timestamp);
301+ triggerTTLEvent (TTLmsg, timestamp);
303302 TTLQueue.pop ();
304303 }
305304 }
0 commit comments