Revision: 7510
http://svn.sourceforge.net/supercollider/?rev=7510&view=revAuthor: cruxxial
Date: 2008-04-11 17:23:49 -0700 (Fri, 11 Apr 2008)
Log Message:
-----------
moving wouter's ProgramChangeResponder into common with the other responders
Modified Paths:
--------------
trunk/build/SCClassLibrary/Common/Control/MIDIResponder.sc
Modified: trunk/build/SCClassLibrary/Common/Control/MIDIResponder.sc
===================================================================
--- trunk/build/SCClassLibrary/Common/Control/MIDIResponder.sc 2008-04-12 00:17:38 UTC (rev 7509)
+++ trunk/build/SCClassLibrary/Common/Control/MIDIResponder.sc 2008-04-12 00:23:49 UTC (rev 7510)
@@ -197,3 +197,37 @@
PolyTouchResponder
*/
+ProgramChangeResponder : MIDIResponder {
+ classvar <pcinit = false,<pcr;
+
+ *new { arg function, src, chan, value, install=true;
+ ^super.new.function_(function)
+ .matchEvent_(MIDIEvent(nil, this.fixSrc(src), chan, nil, value))
+ .init(install)
+ }
+ *init {
+ if(MIDIClient.initialized.not,{ MIDIIn.connect });
+ pcinit = true;
+ pcr = [];
+ MIDIIn.program = { arg src, chan, val;
+ pcr.do({ arg r;
+ if(r.matchEvent.match(src, chan, nil, val))
+ { r.value(src,chan,val) };
+ });
+ }
+ }
+ value { arg src,chan,val;
+ function.value(src,chan,val);
+ }
+ *initialized { ^pcinit }
+ *responders { ^pcr }
+
+ *add { arg resp;
+ pcr = pcr.add(resp);
+ }
+ *remove { arg resp;
+ pcr.remove(resp);
+ }
+}
+
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
_______________________________________________
sc-dev mailing list
sc-dev@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-dev