Changeset 67
- Timestamp:
- 19/02/10 09:55:27 (5 months ago)
- Location:
- trunk/LiveOSC
- Files:
-
- 3 edited
-
LiveOSC.py (modified) (5 diffs)
-
LiveOSCCallbacks.py (modified) (2 diffs)
-
OSCAPI.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LiveOSC/LiveOSC.py
r66 r67 47 47 clisten = {} 48 48 slisten = {} 49 pplisten = {} 50 cnlisten = {} 51 cclisten = {} 52 49 53 mlisten = { "solo": {}, "mute": {}, "arm": {}, "panning": {}, "volume": {}, "sends": {}, "name": {}, "oml": {}, "omr": {} } 50 54 rlisten = { "solo": {}, "mute": {}, "panning": {}, "volume": {}, "sends": {}, "name": {} } 51 55 masterlisten = { "panning": {}, "volume": {}, "crossfader": {} } 52 56 scenelisten = {} 57 53 58 scene = 0 54 59 track = 0 … … 344 349 345 350 self.clisten = {} 351 352 for clip in self.pplisten: 353 if clip != None: 354 if clip.playing_position_has_listener(self.pplisten[clip]) == 1: 355 clip.remove_playing_position_listener(self.pplisten[clip]) 356 357 self.pplisten = {} 358 359 for clip in self.cnlisten: 360 if clip != None: 361 if clip.name_has_listener(self.cnlisten[clip]) == 1: 362 clip.remove_name_listener(self.cnlisten[clip]) 363 364 self.cnlisten = {} 365 366 for clip in self.cclisten: 367 if clip != None: 368 if clip.color_has_listener(self.cclisten[clip]) == 1: 369 clip.remove_color_listener(self.cclisten[clip]) 370 371 self.cclisten = {} 346 372 347 373 def add_clip_listeners(self): … … 364 390 clip.add_playing_status_listener(cb) 365 391 self.clisten[clip] = cb 392 393 cb2 = lambda :self.clip_position(clip, tid, cid) 394 if self.pplisten.has_key(clip) != 1: 395 clip.add_playing_position_listener(cb2) 396 self.pplisten[clip] = cb2 397 398 cb3 = lambda :self.clip_name(clip, tid, cid) 399 if self.cnlisten.has_key(clip) != 1: 400 clip.add_name_listener(cb3) 401 self.cnlisten[clip] = cb3 402 403 if self.cclisten.has_key(clip) != 1: 404 clip.add_color_listener(cb3) 405 self.cclisten[clip] = cb3 366 406 367 407 def add_slotlistener(self, slot, tid, cid): … … 630 670 631 671 # Clip Callbacks 672 def clip_name(self, clip, tid, cid): 673 self.oscServer.sendOSC('/live/name/clip', (tid, cid, str(clip.name), clip.color)) 674 675 def clip_position(self, clip, tid, cid): 676 if clip.is_playing: 677 self.oscServer.sendOSC('/live/clip/position', (tid, cid, clip.playing_position, clip.length, clip.loop_start, clip.loop_end)) 678 632 679 def slot_changestate(self, slot, tid, cid): 633 680 tmptrack = LiveUtils.getTrack(tid) … … 652 699 if self.clisten.has_key(slot.clip) == 1: 653 700 slot.clip.remove_playing_status_listener(self.clisten[slot.clip]) 701 702 if self.pplisten.has_key(slot.clip) == 1: 703 slot.clip.remove_playing_position_listener(self.pplisten[slot.clip]) 704 705 if self.cnlisten.has_key(slot.clip) == 1: 706 slot.clip.remove_name_listener(self.cnlisten[slot.clip]) 707 708 if self.cclisten.has_key(slot.clip) == 1: 709 slot.clip.remove_color_listener(self.cclisten[slot.clip]) 654 710 655 711 self.oscServer.sendOSC('/live/track/info', (tid, armed, cid, 0, 0.0)) -
trunk/LiveOSC/LiveOSCCallbacks.py
r65 r67 121 121 self.callbackManager.add(self.warpingCB, "/live/clip/warping") 122 122 123 self.callbackManager.add(self.sigCB, "/live/clip/signature") 124 123 125 self.callbackManager.add(self.crossfaderCB, "/live/master/crossfader") 124 126 self.callbackManager.add(self.trackxfaderCB, "/live/track/crossfader") … … 128 130 129 131 self.callbackManager.add(self.selectionCB, "/live/selection") 132 133 def sigCB(self, msg): 134 """ Called when a /live/clip/signature message is recieved 135 """ 136 track = msg[2] 137 clip = msg[3] 138 c = LiveUtils.getSong().visible_tracks[track].clip_slots[clip].clip 139 140 if len(msg) == 4: 141 self.oscServer.sendOSC("/live/clip/signature", (track, clip, c.signature_numerator, c.signature_denominator)) 142 143 if len(msg) == 6: 144 self.oscServer.sendOSC("/live/clip/signature", 1) 145 c.signature_denominator = msg[5] 146 c.signature_numerator = msg[4] 130 147 131 148 def warpingCB(self, msg): -
trunk/LiveOSC/OSCAPI.txt
r66 r67 162 162 /live/track/info 163 163 /live/clip/info 164 /live/clip/position 164 /live/clip/position (int track) (int clip) (float position) (float length) (float loop_start) (float loop_end) 165 165 166 166 /live/name/return 167 167 /live/name/track 168 /live/name/clip 168 /live/name/clip (returns on colour and name changes) 169 169 170 170 /live/arm
Note: See TracChangeset
for help on using the changeset viewer.
