-
Notifications
You must be signed in to change notification settings - Fork 82
/
MainSelectorComponent.py
616 lines (536 loc) · 23.6 KB
/
MainSelectorComponent.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
# -*- coding: utf-8 -*-
from _Framework.ModeSelectorComponent import ModeSelectorComponent
from _Framework.ButtonElement import ButtonElement
from _Framework.ButtonMatrixElement import ButtonMatrixElement
from _Framework.SessionZoomingComponent import DeprecatedSessionZoomingComponent# noqa
from .DeviceControllerComponent import DeviceControllerComponent
from .SpecialSessionComponent import SpecialSessionComponent
from .InstrumentControllerComponent import InstrumentControllerComponent
from .SubSelectorComponent import SubSelectorComponent # noqa
from .StepSequencerComponent import StepSequencerComponent
from .StepSequencerComponent2 import StepSequencerComponent2
from .NoteRepeatComponent import NoteRepeatComponent
from _Framework.SceneComponent import SceneComponent
from .SpecialProSessionComponent import SpecialProSessionComponent
import Live
import time
try:
from .Settings import Settings
except ImportError:
from .Settings import *
class MainSelectorComponent(ModeSelectorComponent):
""" Class that reassigns the button on the launchpad to different functions """
def __init__(self, matrix, top_buttons, side_buttons, config_button, osd, control_surface, note_repeat, c_instance):
#verify matrix dimentions
assert isinstance(matrix, ButtonMatrixElement)
assert ((matrix.width() == 8) and (matrix.height() == 8))
assert isinstance(top_buttons, tuple)
assert (len(top_buttons) == 8)
assert isinstance(side_buttons, tuple)
assert (len(side_buttons) == 8)
assert isinstance(config_button, ButtonElement)
assert isinstance(note_repeat, NoteRepeatComponent)
ModeSelectorComponent.__init__(self) #super constructor
#inject ControlSurface and OSD components (M4L)
self._matrix = matrix
self._nav_buttons = top_buttons[:4]#arrow buttons
self._mode_buttons = top_buttons[4:]#session,user1,user2,mixer buttons
self._side_buttons = side_buttons#launch buttons
self._config_button = config_button#used to reset launchpad
self._osd = osd
self._control_surface = control_surface
self._note_repeat = note_repeat
self._c_instance = c_instance
self._pro_session_on = False
self._long_press = 500
self._last_session_mode_button_press = int(round(time.time() * 1000))
self._aux_scene = None
#Non-Matrix buttons
self._all_buttons = []
for button in self._side_buttons + self._nav_buttons:
self._all_buttons.append(button)
#initialize index variables
self._mode_index = 0 #Inherited from parent
self._main_mode_index = 0 #LP original modes
self._sub_mode_list = [0, 0, 0, 0]
for index in range(4):
self._sub_mode_list[index] = 0
self.set_mode_buttons(self._mode_buttons)
self._last_mode_index = 0
self._clip_stop_buttons = []
for column in range(8):
self._clip_stop_buttons.append(matrix.get_button(column,matrix.height()-1))
self._session = SpecialProSessionComponent(matrix.width(), matrix.height(), None, self._side_buttons, self._control_surface, self, self._c_instance.song())
#initialize _session variables
self._session.set_osd(self._osd)
self._session.name = 'Session_Control'
###ZOOMING COMPONENT
self._zooming = DeprecatedSessionZoomingComponent(self._session, enable_skinning = True)
self._zooming.name = 'Session_Overview'
self._zooming.set_empty_value("DefaultButton.Disabled")
#Non-Matrix buttons
self._all_buttons = []
for button in self._side_buttons + self._nav_buttons:
self._all_buttons.append(button)
#SubSelector changes the Mode using side buttons -> MIXER MODE (ie. Pan, Volume, Send1, Send2, Stop, Solo, Activate, Arm)
self._sub_modes = SubSelectorComponent(matrix, side_buttons, self._session, self._control_surface)
self._sub_modes.name = 'Mixer_Modes'
self._sub_modes._mixer.set_osd(self._osd)
self._sub_modes.set_update_callback(self._update_control_channels)
#User2 stepSequencer (Drum & Melodic)
self._stepseq = StepSequencerComponent(self._matrix, self._side_buttons, self._nav_buttons, self._control_surface)
self._stepseq.set_osd(self._osd)
#User2 stepSequencer (Retro style)
self._stepseq2 = StepSequencerComponent2(self._matrix, self._side_buttons, self._nav_buttons, self._control_surface)
self._stepseq2.set_osd(self._osd)
#User1 Instrument controller (Scale)
self._instrument_controller = InstrumentControllerComponent(self._matrix, self._side_buttons, self._nav_buttons, self._control_surface, self._note_repeat)
self._instrument_controller.set_osd(self._osd)
#self._instrument_controller = None
#User1 Device controller (Fx or Instrument parameters)
self._device_controller = DeviceControllerComponent(control_surface = self._control_surface, matrix = self._matrix, side_buttons = self._side_buttons, top_buttons = self._nav_buttons)
self._device_controller.set_osd(self._osd)
self._init_session()
self._all_buttons = tuple(self._all_buttons)
def disconnect(self):
for button in self._modes_buttons:
button.remove_value_listener(self._mode_value)
self._session = None
self._zooming = None
for button in self._all_buttons:
button.set_on_off_values("DefaultButton.Disabled", "DefaultButton.Disabled")
self._config_button.turn_off()
self._matrix = None
self._side_buttons = None
self._nav_buttons = None
self._config_button = None
ModeSelectorComponent.disconnect(self)
def session_component(self):
return self._session
def _update_mode(self):
mode = self._modes_heap[-1][0] #get first value of last _modes_heap tuple. _modes_heap tuple structure is (mode, sender, observer)
assert mode in range(self.number_of_modes()) # 8 for this script
if self._main_mode_index == mode:
if self._main_mode_index == 1: #user mode 1 and device controller and instrument mode
self._sub_mode_list[self._main_mode_index] = (self._sub_mode_list[self._main_mode_index] + 1) % len(Settings.USER_MODES_1)
self.update()
elif self._main_mode_index == 2: #user mode 2 and step sequencer
self._sub_mode_list[self._main_mode_index] = (self._sub_mode_list[self._main_mode_index] + 1) % len(Settings.USER_MODES_2)
self.update()
elif self._main_mode_index == 3: #Mixer mode
self.update()
else: #Session mode
self._sub_mode_list[self._main_mode_index] = 0
self._mode_index = 0
self.update()
else:
self._main_mode_index = mode
self.update()
def set_mode(self, mode):
self._clean_heap()
self._modes_heap = [(mode, None, None)]
# if ((self.__main_mode_index != mode) or (mode == 3) or True):
# self._main_mode_index = mode
# self._update_mode()
# self.update()
def _mode_value(self, value, sender):
assert len(self._modes_buttons) > 0
assert isinstance(value, int)
assert sender in self._modes_buttons
session_mode_changed = False
new_mode = self._modes_buttons.index(sender)
now = int(round(time.time() * 1000))
if new_mode == 0 and self._last_mode_index == 0:
if value > 0:
self._last_session_mode_button_press = now
else:
if now - self._last_session_mode_button_press < self._long_press:
self._pro_session_on = not self._pro_session_on
session_mode_changed = True
self._last_mode_index = new_mode
super(MainSelectorComponent, self)._mode_value(value, sender)
if session_mode_changed == True:
self._update_mode()
def number_of_modes(self):
return 1 + 3 + 3 + 1
def on_enabled_changed(self):
self.update()
def _update_mode_buttons(self):
self._modes_buttons[0].set_on_off_values("Mode.Session.On","Mode.Session.Off")
self._modes_buttons[3].set_on_off_values("Mode.Mixer.On","Mode.Mixer.Off")
mode1 = self.getSkinName(Settings.USER_MODES_1[self._sub_mode_list[1]])
mode2 = self.getSkinName(Settings.USER_MODES_2[self._sub_mode_list[2]])
self._modes_buttons[1].set_on_off_values("Mode."+mode1+".On","Mode."+mode1+".Off")
self._modes_buttons[2].set_on_off_values("Mode."+mode2+".On","Mode."+mode2+".Off")
for index in range(4):
if (index == self._main_mode_index):
self._modes_buttons[index].turn_on()
else:
self._modes_buttons[index].turn_off()
def getSkinName(self, user2Mode):
if user2Mode=="instrument":
user2Mode = "Note"
if user2Mode=="device":
user2Mode = "Device"
if user2Mode=="user 1":
user2Mode = "User"
if user2Mode=="user 2":
user2Mode = "User2"
if user2Mode=="drum stepseq":
user2Mode = "StepSequencer"
if user2Mode=="melodic stepseq":
user2Mode = "StepSequencer2"
return user2Mode
def channel_for_current_mode(self):
# in this code, midi channels start at 0.
# so channels range from 0 - 15.
# mapping to 1-16 in the real world
if self._main_mode_index == 0:
new_channel = 0 # session
elif self._main_mode_index == 1:
if self._sub_mode_list[self._main_mode_index] == 0:
new_channel = 11 # instrument controller
# instrument controller uses base channel plus the 4 next ones. 11,12,13,14,15
if self._instrument_controller != None:
self._instrument_controller.base_channel = new_channel
elif self._sub_mode_list[self._main_mode_index] == 1:
new_channel = 3 # device controller
elif self._sub_mode_list[self._main_mode_index] == 2:
new_channel = 4 # plain user mode 1
elif self._main_mode_index == 2:
if self._sub_mode_list[self._main_mode_index] == 0:
new_channel = 1 # step seq
elif self._sub_mode_list[self._main_mode_index] == 1:
new_channel = 2 # melodic step seq
elif self._sub_mode_list[self._main_mode_index] == 2:
new_channel = 5 # plain user mode 2
elif self._main_mode_index == 3: # mixer modes
# mixer uses base channel 7 and the 4 next ones.
new_channel = 6 + self._sub_modes.mode() # 6,7,8,9,10
return new_channel
def update(self):
assert (self._modes_buttons != None)
if self.is_enabled():
self._update_mode_buttons()
as_active = True
as_enabled = True
self._session.set_allow_update(False)
self._zooming.set_allow_update(False)
self._config_button.send_value(40) #Set LP double buffering mode (investigate this)
self._config_button.send_value(1) #Set LP X-Y layout grid mapping mode
if self._main_mode_index == 0:
# session
if(self._pro_session_on):
self._control_surface.show_message("PRO SESSION MODE")
else:
self._control_surface.show_message("SESSION MODE")
self._setup_mixer(not as_active)
self._setup_device_controller(not as_active)
self._setup_step_sequencer(not as_active)
self._setup_step_sequencer2(not as_active)
self._setup_instrument_controller(not as_active)
self._setup_session(as_active, as_enabled)
self._update_control_channels()
self._mode_index = 0
elif self._main_mode_index == 1:
self._setup_sub_mode(Settings.USER_MODES_1[self._sub_mode_list[self._main_mode_index]])
elif self._main_mode_index == 2:
self._setup_sub_mode(Settings.USER_MODES_2[self._sub_mode_list[self._main_mode_index]])
elif self._main_mode_index == 3:
# mixer
self._control_surface.show_message("MIXER MODE")
self._setup_device_controller(not as_active)
self._setup_step_sequencer(not as_active)
self._setup_step_sequencer2(not as_active)
self._setup_instrument_controller(not as_active)
self._setup_session(not as_active, as_enabled)
self._setup_mixer(as_active)
self._update_control_channels()
self._mode_index = 3
else:
assert False
self._session.set_allow_update(True)
self._zooming.set_allow_update(True)
def _setup_sub_mode(self, mode):
as_active = True
as_enabled = True
if mode == "instrument":
self._control_surface.show_message("INSTRUMENT MODE")
self._setup_session(not as_active, not as_enabled)
self._setup_step_sequencer(not as_active)
self._setup_step_sequencer2(not as_active)
self._setup_mixer(not as_active)
self._setup_device_controller(not as_active)
self._update_control_channels()
self._setup_instrument_controller(as_active)
self._mode_index = 4
elif mode == "melodic stepseq":
self._control_surface.show_message("MELODIC SEQUENCER MODE")
self._setup_session(not as_active, not as_enabled)
self._setup_instrument_controller(not as_active)
self._setup_device_controller(not as_active)
self._setup_mixer(not as_active)
self._setup_step_sequencer(not as_active)
self._setup_step_sequencer2(as_active)
self._update_control_channels()
self._mode_index = 7
elif mode == "user 1":
self._control_surface.show_message("USER 1 MODE" )
self._setup_session(not as_active, not as_enabled)
self._setup_step_sequencer(not as_active)
self._setup_step_sequencer2(not as_active)
self._setup_mixer(not as_active)
self._setup_device_controller(not as_active)
self._setup_instrument_controller(not as_active)
self._setup_user_mode(True, True, False, True)
self._update_control_channels()
self._mode_index = 1
self._osd.clear()
self._osd.mode = "User 1"
self._osd.update()
elif mode == "drum stepseq":
self._control_surface.show_message("DRUM STEP SEQUENCER MODE")
self._setup_session(not as_active, not as_enabled)
self._setup_instrument_controller(not as_active)
self._setup_device_controller(not as_active)
self._setup_mixer(not as_active)
self._setup_step_sequencer2(not as_active)
self._setup_step_sequencer(as_active)
self._update_control_channels()
self._mode_index = 6
elif mode == "device":
self._control_surface.show_message("DEVICE CONTROLLER MODE")
self._setup_session(not as_active, not as_enabled)
self._setup_step_sequencer(not as_active)
self._setup_step_sequencer2(not as_active)
self._setup_mixer(not as_active)
self._setup_instrument_controller(not as_active)
self._setup_device_controller(as_active)
self._update_control_channels()
self._mode_index = 5
elif mode == "user 2":
self._control_surface.show_message("USER 2 MODE" )
self._setup_session(not as_active, not as_enabled)
self._setup_instrument_controller(not as_active)
self._setup_device_controller(not as_active)
self._setup_mixer(not as_active)
self._setup_step_sequencer(not as_active)
self._setup_step_sequencer2(not as_active)
self._setup_user_mode(False, False, False, False)
self._update_control_channels()
self._mode_index = 2
self._osd.clear()
self._osd.mode = "User 2"
self._osd.update()
def _setup_session(self, as_active, as_navigation_enabled):
assert isinstance(as_active, type(False))#assert is boolean
for button in self._nav_buttons:
if as_navigation_enabled:
button.set_on_off_values("Mode.Session.On", "Mode.Session.Off")
else:
button.set_on_off_values("DefaultButton.Disabled", "DefaultButton.Disabled")
# matrix
self._activate_matrix(True)
self._turn_off_scene_buttons()
if (self._session.height() != self._matrix .height()) and (self._aux_scene != None):
self._session._scenes.append(self._aux_scene)
if as_active:
self._session._set_pro_mode_on(self._pro_session_on)
else:
self._session._set_pro_mode_on(False)
for scene_index in range(self._session._num_scenes):#iterate over scenes
scene = self._session.scene(scene_index)
if as_active:#set scene launch buttons
scene_button = self._side_buttons[scene_index]
scene_button.set_enabled(as_active)
if not self._pro_session_on:
scene.set_launch_button(scene_button)
else:
scene.set_launch_button(None)
else:
scene.set_launch_button(None)
for track_index in range(self._session._num_tracks):#iterate over tracks of a scene -> clip slots
if as_active:#set clip slot launch button
button = self._matrix.get_button(track_index, scene_index)
button.set_on_off_values("DefaultButton.Disabled", "DefaultButton.Disabled")
button.set_enabled(as_active)
clip_slot = scene.clip_slot(track_index)
if not self._pro_session_on:
clip_slot.set_triggered_to_play_value("Session.ClipTriggeredPlay")
clip_slot.set_stopped_value("Session.ClipStopped")
clip_slot.set_started_value("Session.ClipStarted")
clip_slot.set_launch_button(button)
else:
if(scene_index<self._matrix.height() -1):
clip_slot.set_triggered_to_play_value("ProSession.ClipTriggeredPlay")
clip_slot.set_stopped_value("ProSession.ClipStopped")
clip_slot.set_started_value("ProSession.ClipStarted")
clip_slot.set_launch_button(button)
else:
scene.clip_slot(track_index).set_launch_button(None)
else:
scene.clip_slot(track_index).set_launch_button(None)
if (self._pro_session_on):
self._aux_scene = self._session._scenes.pop(-1)
if as_active:#Set up stop clip buttons and stop all clips button
if self._pro_session_on:
if self._clip_stop_buttons != None:
for button in self._clip_stop_buttons:
button.set_enabled(as_active)
# button.set_on_off_values("Session.StopClip", "DefaultButton.Disabled")
self._session.set_stop_track_clip_buttons(self._clip_stop_buttons)
else:
self._session.set_stop_track_clip_buttons(None)
else:
self._session.set_stop_track_clip_buttons(None)
else:
self._session.set_stop_track_clip_buttons(None)
if as_active:# zoom
self._zooming.set_zoom_button(self._modes_buttons[0])# Set Session button as zoom shift button
self._zooming.set_button_matrix(self._matrix)
self._zooming.set_scene_bank_buttons(self._side_buttons)
self._zooming.set_nav_buttons(self._nav_buttons[0], self._nav_buttons[1], self._nav_buttons[2], self._nav_buttons[3])
self._zooming.update()
else:
self._zooming.set_zoom_button(None)
self._zooming.set_button_matrix(None)
self._zooming.set_scene_bank_buttons(None)
self._zooming.set_nav_buttons(None, None, None, None)
if as_navigation_enabled: # nav buttons (track/scene)
self._session.set_track_bank_buttons(self._nav_buttons[3], self._nav_buttons[2])
self._session.set_scene_bank_buttons(self._nav_buttons[1], self._nav_buttons[0])
else:
self._session.set_track_bank_buttons(None, None)
self._session.set_scene_bank_buttons(None, None)
self._session.set_enabled(as_active)
self._session._do_show_highlight()
def _setup_instrument_controller(self, as_active):
if self._instrument_controller != None:
if as_active:
self._activate_matrix(False) #Disable matrix buttons (clip slots)
self._activate_scene_buttons(True)#Enable side buttons
self._activate_navigation_buttons(True)#Enable nav buttons
else:
for scene_index in range(8):#Restore all matrix buttons and scene launch buttons
scene_button = self._side_buttons[scene_index]
scene_button.use_default_message() # Reset to original channel
scene_button.force_next_send() #Flush
for track_index in range(8):
button = self._matrix.get_button(track_index, scene_index)
button.use_default_message()# Reset to original channel
button.force_next_send()#Flush
self._instrument_controller.set_enabled(as_active)#Enable/disable instrument controller
def _setup_device_controller(self, as_active):
if self._device_controller != None:
if as_active:
self._activate_scene_buttons(True)
self._activate_matrix(True)
self._activate_navigation_buttons(True)
self._device_controller._is_active = True
self._config_button.send_value(32)
self._device_controller.set_enabled(True)
self._device_controller.update()
else:
self._device_controller._is_active = False
temp=self._device_controller.set_enabled(False)
def _setup_user_mode(self, release_matrix=True, release_side_buttons=True, release_nav_buttons=True, drum_rack_mode=True):
# user1 -> All True but release_nav_buttons / user2 -> All false
for scene_index in range(8):
scene_button = self._side_buttons[scene_index]
scene_button.set_on_off_values("DefaultButton.Disabled", "DefaultButton.Disabled")
scene_button.force_next_send()
scene_button.turn_off()
scene_button.set_enabled((not release_side_buttons))#User2 enabled
for track_index in range(8):
button = self._matrix.get_button(track_index, scene_index)
button.set_on_off_values("DefaultButton.Disabled", "DefaultButton.Disabled")
button.turn_off()
button.set_enabled((not release_matrix))#User2 enabled
for button in self._nav_buttons:
button.set_on_off_values("DefaultButton.Disabled", "DefaultButton.Disabled")
button.turn_off()
button.set_enabled((not release_nav_buttons)) #User1 & User2 enabled
if drum_rack_mode:#User1 enabled
self._config_button.send_value(2)#Set LP drum rack layout grid mapping mode
self._config_button.send_value(32)#Send enable flashing led config message to LP
def _setup_step_sequencer(self, as_active):
if(self._stepseq != None):
#if(self._stepseq.is_enabled() != as_active):
if as_active:
self._activate_scene_buttons(True)
self._activate_matrix(True)
self._activate_navigation_buttons(True)
self._config_button.send_value(32)
self._stepseq.set_enabled(True)
else:
self._stepseq.set_enabled(False)
def _setup_step_sequencer2(self, as_active):
if(self._stepseq2 != None):
#if(self._stepseq2.is_enabled() != as_active):
if as_active:
self._activate_scene_buttons(True)
self._activate_matrix(True)
self._activate_navigation_buttons(True)
self._config_button.send_value(32)
self._stepseq2.set_enabled(True)
else:
self._stepseq2.set_enabled(False)
def _setup_mixer(self, as_active):
assert isinstance(as_active, type(False))
if as_active:
self._activate_navigation_buttons(True)
self._activate_scene_buttons(True)
self._activate_matrix(True)
if(self._sub_modes.is_enabled()):# go back to default mode
self._sub_modes.set_mode(-1)
else:
self._sub_modes.release_controls()
self._sub_modes.set_enabled(as_active)
def _init_session(self):
#self._session.set_stop_clip_value("Session.StopClip")
#self._session.set_stop_clip_triggered_value("Session.ClipTriggeredStop")
session_height = self._matrix.height()
#if self._session._stop_clip_buttons != None:
# session_height = self._matrix.height()-1
for scene_index in range(session_height):
# scene = self._session.scene(scene_index)
# scene.set_triggered_value("Session.SceneTriggered")
# scene.name = 'Scene_' + str(scene_index)
for track_index in range(self._matrix.width()):
# clip_slot = scene.clip_slot(track_index)
# clip_slot.set_triggered_to_play_value("ProSession.ClipTriggeredPlay")
# clip_slot.set_triggered_to_record_value("Session.ClipTriggeredRecord")
# clip_slot.set_stopped_value("ProSession.ClipStopped")
# clip_slot.set_started_value("ProSession.ClipStarted")
# clip_slot.set_recording_value("Session.ClipRecording")
# clip_slot.set_record_button_value("Session.RecordButton")
# clip_slot.name = str(track_index) + '_Clip_Slot_' + str(scene_index)
self._all_buttons.append(self._matrix.get_button(track_index, scene_index))
#self._zooming.set_stopped_value("Zooming.Stopped")
#self._zooming.set_selected_value("Zooming.Selected")
#self._zooming.set_playing_value("Zooming.Playing")
def _activate_navigation_buttons(self, active):
for button in self._nav_buttons:
button.set_enabled(active)
def _activate_scene_buttons(self, active):
for button in self._side_buttons:
button.set_enabled(active)
def _activate_matrix(self, active):
for scene_index in range(8):
for track_index in range(8):
self._matrix.get_button(track_index, scene_index).set_enabled(active)
def _turn_off_scene_buttons(self):
for side_button in self._side_buttons:
side_button.set_on_off_values("DefaultButton.Disabled", "DefaultButton.Disabled")
side_button.turn_off()
def log_message(self, msg):
self._control_surface.log_message(msg)
# Update the channels of the buttons in the user modes..
def _update_control_channels(self):
new_channel = self.channel_for_current_mode()
for button in self._all_buttons:
button.set_channel(new_channel)
button.force_next_send()
#def _update_session_tempo_button(self):
# if self._session != None:
# self._session._update_session_tempo_button()