本文整理汇总了Python中SpecialSessionComponent.SpecialSessionComponent.set_stop_track_clip_buttons方法的典型用法代码示例。如果您正苦于以下问题:Python SpecialSessionComponent.set_stop_track_clip_buttons方法的具体用法?Python SpecialSessionComponent.set_stop_track_clip_buttons怎么用?Python SpecialSessionComponent.set_stop_track_clip_buttons使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpecialSessionComponent.SpecialSessionComponent
的用法示例。
在下文中一共展示了SpecialSessionComponent.set_stop_track_clip_buttons方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Launchkey
# 需要导入模块: from SpecialSessionComponent import SpecialSessionComponent [as 别名]
# 或者: from SpecialSessionComponent.SpecialSessionComponent import set_stop_track_clip_buttons [as 别名]
#.........这里部分代码省略.........
self._master_slider = None
self._current_midi_map = None
self._transport_view_modes = None
self._send_midi(LED_FLASHING_OFF)
self._send_midi(LIVE_MODE_OFF)
def build_midi_map(self, midi_map_handle):
self._current_midi_map = midi_map_handle
ControlSurface.build_midi_map(self, midi_map_handle)
def _setup_mixer(self):
self._next_nav_button = make_button(103, "Next_Track_Button")
self._prev_nav_button = make_button(102, "Prev_Track_Button")
mute_solo_flip_button = make_button(59, "Master_Button")
self._mixer = SpecialMixerComponent(8)
self._mixer.name = "Mixer"
self._mixer.set_select_buttons(self._next_nav_button, self._prev_nav_button)
self._mixer.selected_strip().name = "Selected_Channel_Strip"
self._mixer.master_strip().name = "Master_Channel_Strip"
self._mixer.master_strip().set_volume_control(self._master_slider)
self._sliders = []
self._strip_buttons = []
for index in range(8):
strip = self._mixer.channel_strip(index)
strip.name = "Channel_Strip_" + str(index)
strip.set_invert_mute_feedback(True)
self._sliders.append(make_slider(41 + index, "Volume_Control_%d" % index))
strip.set_volume_control(self._sliders[-1])
self._strip_buttons.append(make_button(51 + index, "Mute_Button_%d" % index))
self._mixer.set_strip_mute_solo_buttons(tuple(self._strip_buttons), mute_solo_flip_button)
def _setup_session(self):
scene_launch_button = make_configurable_button(104, "Scene_Launch_Button")
scene_stop_button = make_configurable_button(120, "Scene_Stop_Button")
self._session = SpecialSessionComponent(8, 0)
self._session.name = "Session_Control"
self._session.selected_scene().name = "Selected_Scene"
self._session.selected_scene().set_launch_button(scene_launch_button)
self._session.selected_scene().set_triggered_value(GREEN_BLINK)
self._session.set_stop_all_clips_button(scene_stop_button)
scene_stop_button.set_on_off_values(AMBER_FULL, LED_OFF)
self._session.set_mixer(self._mixer)
self._session.set_track_banking_increment(8)
self._session.set_stop_track_clip_value(GREEN_BLINK)
clip_launch_buttons = []
clip_stop_buttons = []
for index in range(8):
clip_launch_buttons.append(make_configurable_button(96 + index, "Clip_Launch_%d" % index))
clip_stop_buttons.append(make_configurable_button(112 + index, "Clip_Stop_%d" % index))
clip_slot = self._session.selected_scene().clip_slot(index)
clip_slot.set_triggered_to_play_value(GREEN_BLINK)
clip_slot.set_triggered_to_record_value(RED_BLINK)
clip_slot.set_stopped_value(AMBER_FULL)
clip_slot.set_started_value(GREEN_FULL)
clip_slot.set_recording_value(RED_FULL)
clip_slot.set_launch_button(clip_launch_buttons[-1])
clip_slot.name = "Selected_Clip_Slot_" + str(index)
self._session.set_stop_track_clip_buttons(tuple(clip_stop_buttons))
def _setup_transport(self):
rwd_button = make_button(112, "Rwd_Button")
ffwd_button = make_button(113, "FFwd_Button")
stop_button = make_button(114, "Stop_Button")
play_button = make_button(115, "Play_Button")
loop_button = make_button(116, "Loop_Button")
rec_button = make_button(117, "Record_Button")
transport = TransportComponent()
transport.name = "Transport"
transport.set_stop_button(stop_button)
transport.set_play_button(play_button)
transport.set_record_button(rec_button)
transport.set_loop_button(loop_button)
self._transport_view_modes = TransportViewModeSelector(transport, self._session, ffwd_button, rwd_button)
self._transport_view_modes.name = "Transport_View_Modes"
def _setup_device(self):
encoders = [make_encoder(21 + index, "Device_Control_%d" % index) for index in xrange(8)]
self._encoders = tuple(encoders)
device = DeviceComponent()
device.name = "Device_Component"
self.set_device_component(device)
device.set_parameter_controls(self._encoders)
def _dummy_listener(self, value):
pass
def _on_selected_track_changed(self):
ControlSurface._on_selected_track_changed(self)
self._update_mixer_offset()
def _update_mixer_offset(self):
all_tracks = self._session.tracks_to_use()
selected_track = self.song().view.selected_track
num_strips = self._session.width()
if selected_track in all_tracks:
track_index = list(all_tracks).index(selected_track)
new_offset = track_index - track_index % num_strips
self._session.set_offsets(new_offset, self._session.scene_offset())
示例2: MainSelectorComponent
# 需要导入模块: from SpecialSessionComponent import SpecialSessionComponent [as 别名]
# 或者: from SpecialSessionComponent.SpecialSessionComponent import set_stop_track_clip_buttons [as 别名]
#.........这里部分代码省略.........
def _setup_session(self, as_active, as_enabled):
assert isinstance(as_active, type(False))
for button in self._nav_buttons:
if as_enabled:
button.set_on_off_values(self._skin.GREEN_FULL, self._skin.GREEN_THIRD)
else:
button.set_on_off_values(127, self._skin.off)
# matrix
self._activate_matrix(True)
for scene_index in range(self._session._num_scenes):
scene = self._session.scene(scene_index)
if as_active:
scene_button = self._side_buttons[scene_index]
scene_button.set_enabled(as_active)
scene_button.set_on_off_values(127, self._skin.off)
scene.set_launch_button(scene_button)
else:
scene.set_launch_button(None)
for track_index in range(self._session._num_tracks):
if as_active:
button = self._matrix.get_button(track_index, scene_index)
button.set_on_off_values(127, self._skin.off)
button.set_enabled(as_active)
scene.clip_slot(track_index).set_launch_button(button)
else:
scene.clip_slot(track_index).set_launch_button(None)
if as_active:
if self._session._stop_clip_buttons != None:
for button in self._session._stop_clip_buttons:
button.set_enabled(as_active)
button.set_on_off_values(self._skin.session.track_stop, self._skin.off)
self._session.set_stop_track_clip_buttons(self._session._stop_clip_buttons)
self._side_buttons[self._session._num_scenes].set_enabled(as_active)
self._side_buttons[self._session._num_scenes].set_on_off_values(self._skin.session._stop_clip_buttons, self._skin.off)
self._session.set_stop_all_clips_button(self._side_buttons[self._session._num_scenes])
else:
self._session.set_stop_track_clip_buttons(None)
self._session.set_stop_all_clips_button(None)
else:
self._session.set_stop_track_clip_buttons(None)
self._session.set_stop_all_clips_button(None)
# zoom
if as_active:
self._zooming.set_zoom_button(self._modes_buttons[0])
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)
# nav buttons
if as_enabled:
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)
示例3: Serato
# 需要导入模块: from SpecialSessionComponent import SpecialSessionComponent [as 别名]
# 或者: from SpecialSessionComponent.SpecialSessionComponent import set_stop_track_clip_buttons [as 别名]
class Serato(ControlSurface):
def __init__(self, c_instance):
publish_in_cs_list = True
ControlSurface.__init__(self, c_instance, not publish_in_cs_list)
self._device_selection_follows_track_selection = True
with self.component_guard():
self._matrix = None
self._session = None
self._mixer = None
self._device = None
self._scene_launch_buttons = None
self._track_arm_buttons = None
self._track_solo_buttons = None
self._track_mute_buttons = None
self._track_stop_buttons = None
self._track_select_buttons = None
self._device_on_off_button = None
self._shift_button = None
self._serato_interface = PySCAClipControl()
self._serato_interface.PySCA_InitializeClipControl()
self._setup_session_control()
self._setup_mixer_control()
self._setup_device_control()
self._session.set_mixer(self._mixer)
self.set_highlighting_session_component(self._session)
return
def disconnect(self):
ControlSurface.disconnect(self)
self._serato_interface.PySCA_DeinitializeClipControl()
self._serato_interface = None
return
def connect_script_instances(self, instanciated_scripts):
""" Called by the Application as soon as all scripts are initialized.
You can connect yourself to other running scripts here, as we do it
connect the extension modules (MackieControlXTs).
"""
for control_surface in self._control_surfaces():
control_surface_session = control_surface.highlighting_session_component()
if control_surface_session:
self._session.sync_to(control_surface_session)
self._on_track_list_changed()
break
def build_midi_map(self, midi_map_handle):
pass
def update_display(self):
ControlSurface.update_display(self)
while self._serato_interface.PySCA_HasIncomingEvent():
new_event = self._serato_interface.PySCA_GetIncomingEvent()
if not self._handle_session_event(new_event):
if not self._handle_mixer_event(new_event):
if not self._handle_device_event(new_event):
print 'Unhandled Event: ' + str(new_event)
def _setup_session_control(self):
is_momentary = True
self._session = SpecialSessionComponent(NUM_TRACKS, NUM_SCENES)
self._session.set_serato_interface(self._serato_interface)
self._matrix = ButtonMatrixElement()
self._scene_launch_buttons = [ ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 0) for index in range(NUM_SCENES) ]
self._track_stop_buttons = [ ButtonElement(not is_momentary, MIDI_NOTE_TYPE, 0, 0) for index in range(NUM_TRACKS) ]
stop_all_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 0)
self._session.set_stop_all_clips_button(stop_all_button)
self._session.set_stop_track_clip_buttons(tuple(self._track_stop_buttons))
for scene_index in range(NUM_SCENES):
scene = self._session.scene(scene_index)
button_row = []
scene.set_launch_button(self._scene_launch_buttons[scene_index])
scene.set_index(scene_index)
scene.set_serato_interface(self._serato_interface)
for track_index in range(NUM_TRACKS):
button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 0)
button_row.append(button)
clip_slot = scene.clip_slot(track_index)
clip_slot.set_launch_button(button)
clip_slot.set_serato_interface(self._serato_interface)
self._matrix.add_row(tuple(button_row))
def _setup_mixer_control(self):
is_momentary = True
self._mixer = SpecialMixerComponent(NUM_TRACKS)
self._mixer.set_serato_interface(self._serato_interface)
self._mixer.master_strip().set_serato_interface(self._serato_interface)
self._track_arm_buttons = []
self._track_solo_buttons = []
self._track_mute_buttons = []
self._track_select_buttons = []
self._shift_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 0)
for track in range(NUM_TRACKS):
strip = self._mixer.channel_strip(track)
strip.set_serato_interface(self._serato_interface)
self._track_arm_buttons.append(ButtonElement(not is_momentary, MIDI_NOTE_TYPE, 0, 0))
self._track_solo_buttons.append(ButtonElement(not is_momentary, MIDI_NOTE_TYPE, 0, 0))
self._track_mute_buttons.append(ButtonElement(not is_momentary, MIDI_NOTE_TYPE, 0, 0))
self._track_select_buttons.append(ButtonElement(not is_momentary, MIDI_NOTE_TYPE, 0, 0))
#.........这里部分代码省略.........
示例4: MainSelectorComponent
# 需要导入模块: from SpecialSessionComponent import SpecialSessionComponent [as 别名]
# 或者: from SpecialSessionComponent.SpecialSessionComponent import set_stop_track_clip_buttons [as 别名]
#.........这里部分代码省略.........
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)
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)
scene_button.set_on_off_values("DefaultButton.Disabled", "DefaultButton.Disabled")
scene.set_launch_button(scene_button)
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)
scene.clip_slot(track_index).set_launch_button(button)
else:
scene.clip_slot(track_index).set_launch_button(None)
if as_active:#Set up stop clip buttons and stop all clips button
if self._session._stop_clip_buttons != None:
for button in self._session._stop_clip_buttons:
button.set_enabled(as_active)
# button.set_on_off_values("Session.StopClip", "DefaultButton.Disabled")
self._session.set_stop_track_clip_buttons(self._session._stop_clip_buttons)
self._side_buttons[self._session._num_scenes].set_enabled(as_active)
self._side_buttons[self._session._num_scenes].set_on_off_values("Session.StopClip", "DefaultButton.Disabled")
self._session.set_stop_all_clips_button(self._side_buttons[self._session._num_scenes])
else:
self._session.set_stop_track_clip_buttons(None)
self._session.set_stop_all_clips_button(None)
else:
self._session.set_stop_track_clip_buttons(None)
self._session.set_stop_all_clips_button(None)
if as_active:# zoom
self._zooming.set_zoom_button(self._modes_buttons[0])# Set Session button as zoom button, wrong behavior???
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)
def _setup_instrument_controller(self, as_active):
if self._instrument_controller != None:
示例5: FCB1020
# 需要导入模块: from SpecialSessionComponent import SpecialSessionComponent [as 别名]
# 或者: from SpecialSessionComponent.SpecialSessionComponent import set_stop_track_clip_buttons [as 别名]
class FCB1020(ControlSurface):
__doc__ = " Script for FCB1010 in APC emulation mode "
_active_instances = []
def _combine_active_instances():
track_offset = 0
scene_offset = 0
for instance in FCB1020._active_instances:
instance._activate_combination_mode(track_offset, scene_offset)
track_offset += instance._session.width()
_combine_active_instances = staticmethod(_combine_active_instances)
def __init__(self, c_instance):
ControlSurface.__init__(self, c_instance)
#self.set_suppress_rebuild_requests(True)
with self.component_guard():
self._note_map = []
self._ctrl_map = []
self._load_MIDI_map()
self._session = None
self._session_zoom = None
self._mixer = None
self._setup_session_control()
self._setup_mixer_control()
self._session.set_mixer(self._mixer)
self._setup_device_and_transport_control()
self.set_highlighting_session_component(self._session)
#self.set_suppress_rebuild_requests(False)
self._pads = []
self._load_pad_translations()
self._do_combine()
def disconnect(self):
self._note_map = None
self._ctrl_map = None
self._pads = None
self._do_uncombine()
self._shift_button = None
self._session = None
self._session_zoom = None
self._mixer = None
ControlSurface.disconnect(self)
def _do_combine(self):
if self not in FCB1020._active_instances:
FCB1020._active_instances.append(self)
FCB1020._combine_active_instances()
def _do_uncombine(self):
if ((self in FCB1020._active_instances) and FCB1020._active_instances.remove(self)):
self._session.unlink()
FCB1020._combine_active_instances()
def _activate_combination_mode(self, track_offset, scene_offset):
if TRACK_OFFSET != -1:
track_offset = TRACK_OFFSET
if SCENE_OFFSET != -1:
scene_offset = SCENE_OFFSET
self._session.link_with_track_offset(track_offset, scene_offset)
def _setup_session_control(self):
is_momentary = True
self._session = SpecialSessionComponent(8, 5)
self._session.name = 'Session_Control'
self._session.set_track_bank_buttons(self._note_map[SESSIONRIGHT], self._note_map[SESSIONLEFT])
self._session.set_scene_bank_buttons(self._note_map[SESSIONDOWN], self._note_map[SESSIONUP])
self._session.set_select_buttons(self._note_map[SCENEDN], self._note_map[SCENEUP])
self._scene_launch_buttons = [self._note_map[SCENELAUNCH[index]] for index in range(5) ]
self._track_stop_buttons = [self._note_map[TRACKSTOP[index]] for index in range(8) ]
self._session.set_stop_all_clips_button(self._note_map[STOPALLCLIPS])
self._session.set_stop_track_clip_buttons(tuple(self._track_stop_buttons))
self._session.set_stop_track_clip_value(2)
self._session.selected_scene().name = 'Selected_Scene'
self._session.selected_scene().set_launch_button(self._note_map[SELSCENELAUNCH])
self._session.set_slot_launch_button(self._note_map[SELCLIPLAUNCH])
for scene_index in range(5):
scene = self._session.scene(scene_index)
scene.name = 'Scene_' + str(scene_index)
button_row = []
scene.set_launch_button(self._scene_launch_buttons[scene_index])
scene.set_triggered_value(2)
for track_index in range(8):
button = self._note_map[CLIPNOTEMAP[scene_index][track_index]]
button_row.append(button)
clip_slot = scene.clip_slot(track_index)
clip_slot.name = str(track_index) + '_Clip_Slot_' + str(scene_index)
clip_slot.set_launch_button(button)
self._session_zoom = SpecialZoomingComponent(self._session)
self._session_zoom.name = 'Session_Overview'
self._session_zoom.set_nav_buttons(self._note_map[ZOOMUP], self._note_map[ZOOMDOWN], self._note_map[ZOOMLEFT], self._note_map[ZOOMRIGHT])
def _setup_mixer_control(self):
is_momentary = True
self._mixer = SpecialMixerComponent(8)
self._mixer.name = 'Mixer'
#.........这里部分代码省略.........
示例6: KontrolF1
# 需要导入模块: from SpecialSessionComponent import SpecialSessionComponent [as 别名]
# 或者: from SpecialSessionComponent.SpecialSessionComponent import set_stop_track_clip_buttons [as 别名]
#.........这里部分代码省略.........
self._suppress_send_midi = False
self.set_enabled(True)
self.update()
self._set_session_highlight(0,0,WIDTH,HEIGHT,True)
def disconnect(self):
self._suppress_send_midi = True
self._session = None
for button in self._all_buttons:
button.set_on_off_values(127, 0)
self._matrix = None
self._stop_buttons = None
self._scene_buttons = None
self._nav_buttons = None
ControlSurface.disconnect(self)
self._suppress_send_midi = False
def update_display(self):
tracks = self.song().visible_tracks
number_tracks = len(tracks)
if self._blink_state:
self._blink_state = False
else:
self._blink_state = True
for track in range(WIDTH):
to = track + self._session._track_offset
if (to < number_tracks):
for y in range(HEIGHT):
ys = self._session._scene_offset+y
yx = (y*4)+track
slot = tracks[to].clip_slots[ys]
if (slot.controls_other_clips) or (slot.has_clip):
if slot.is_triggered:
if self._blink_state:
self._send_midi(tuple([178,yx,40]))
else:
self._send_midi(tuple([178,yx,127]))
def refresh_state(self):
ControlSurface.refresh_state(self)
def _send_midi(self, midi_bytes):
if (not self._suppress_send_midi):
ControlSurface._send_midi(self, midi_bytes)
def _update_hardware(self):
pass
def _send_challenge(self):
pass
def _config_value(self, value):
assert (value in range(128))
def _set_session_highlight(self, track_offset, scene_offset, width, height, include_return_tracks):
ControlSurface._set_session_highlight(self, track_offset, scene_offset, width, height, include_return_tracks)
def _install_forwarding(self, control):
result = ControlSurface._install_forwarding(self, control)
return result
def _translate_message(self, type, from_identifier, from_channel, to_identifier, to_channel):
ControlSurface._translate_message(self, type, from_identifier, from_channel, to_identifier, to_channel)
def on_enabled_changed(self):
self.update()
def update(self):
for scene_index in range(HEIGHT):
self._scene_buttons[scene_index].set_enabled(True)
self._stop_buttons[scene_index].set_enabled(True)
for track_index in range(WIDTH):
self._matrix.get_button(track_index, scene_index).set_enabled(True)
for button in self._nav_buttons:
button.set_enabled(True)
self._session.set_allow_update(False)
for scene_index in range(HEIGHT):
scene = self._session.scene(scene_index)
scene.set_launch_button(self._scene_buttons[scene_index])
for track_index in range(WIDTH):
scene.clip_slot(track_index).set_launch_button(self._matrix.get_button(track_index, scene_index))
#self.log_message(str(tuple(self._stop_buttons)))
self._session.set_stop_track_clip_buttons(tuple(self._stop_buttons))
self._session.set_track_bank_buttons(self._nav_buttons[1], self._nav_buttons[1])
self._session.set_scene_bank_buttons(self._nav_buttons[0], self._nav_buttons[0])
self._session.set_allow_update(True)
示例7: X1MK2
# 需要导入模块: from SpecialSessionComponent import SpecialSessionComponent [as 别名]
# 或者: from SpecialSessionComponent.SpecialSessionComponent import set_stop_track_clip_buttons [as 别名]
class X1MK2(ControlSurface):
__doc__ = " Script for Traktor X1MK2 in APC emulation mode "
_active_instances = []
def _combine_active_instances():
track_offset = 0
scene_offset = 0
for instance in X1MK2._active_instances:
instance._activate_combination_mode(track_offset, scene_offset)
track_offset += instance._session.width()
_combine_active_instances = staticmethod(_combine_active_instances)
def __init__(self, c_instance):
ControlSurface.__init__(self, c_instance)
self._color_skin = make_rgb_skin()
#self.set_suppress_rebuild_requests(True)
with self.component_guard():
self._to_notify = []
self._clip_map = []
self._note_map = []
self._ctrl_map = []
self._enc_map = []
self._load_MIDI_map()
self._session = None
self._session_zoom = None
self._mixer = None
self._setup_session_control()
self._setup_mixer_control()
self._session.set_mixer(self._mixer)
self._setup_device_and_transport_control()
self.set_highlighting_session_component(self._session)
#self.set_suppress_rebuild_requests(False)
self._pads = []
self._load_pad_translations()
self._do_combine()
def disconnect(self):
self._clip_map = None
self._note_map = None
self._ctrl_map = None
self._pads = None
self._do_uncombine()
self._shift_button = None
self._session = None
self._session_zoom = None
self._mixer = None
ControlSurface.disconnect(self)
def _do_combine(self):
if self not in X1MK2._active_instances:
X1MK2._active_instances.append(self)
X1MK2._combine_active_instances()
def _do_uncombine(self):
if ((self in X1MK2._active_instances) and X1MK2._active_instances.remove(self)):
self._session.unlink()
X1MK2._combine_active_instances()
def _activate_combination_mode(self, track_offset, scene_offset):
if TRACK_OFFSET != -1:
track_offset = TRACK_OFFSET
if SCENE_OFFSET != -1:
scene_offset = SCENE_OFFSET
self._session.link_with_track_offset(track_offset, scene_offset)
def _setup_session_control(self):
is_momentary = True
self._session = SpecialSessionComponent(SESSION_WIDTH, SESSION_HEIGHT, self.log_message, enable_skinning = True)
self._session.set_rgb_mode(color_palette = CLIP_COLOR_TABLE(self.log_message), color_table = None, clip_slots_only = True)
self._session.name = 'Session_Control'
self._session.set_track_bank_buttons(self._note_map[SESSIONRIGHT], self._note_map[SESSIONLEFT])
self._session.set_scene_bank_buttons(self._note_map[SESSIONDOWN], self._note_map[SESSIONUP])
self._session.set_select_buttons(self._note_map[SCENEDN], self._note_map[SCENEUP])
self._scene_launch_buttons = [self._note_map[SCENELAUNCH[index]] for index in range(5) ]
self._track_stop_buttons = [self._note_map[TRACKSTOP[index]] for index in range(SESSION_WIDTH)]
self._session.set_stop_all_clips_button(self._note_map[STOPALLCLIPS])
self._session.set_stop_track_clip_buttons(tuple(self._track_stop_buttons))
self._session.selected_scene().name = 'Selected_Scene'
self._session.selected_scene().set_launch_button(self._note_map[SELSCENELAUNCH])
self._session.set_slot_launch_button(self._note_map[SELCLIPLAUNCH])
for scene_index in range(SESSION_HEIGHT):
scene = self._session.scene(scene_index)
scene.name = 'Scene_' + str(scene_index)
button_row = []
scene.set_launch_button(self._scene_launch_buttons[scene_index])
scene.set_triggered_value(2)
for track_index in range(SESSION_WIDTH):
button = self._clip_map[CLIPNOTEMAP[scene_index][track_index]]
button.num_delayed_messages = 3
delete_button = self._note_map[DELETECLIPNOTEMAP[scene_index][track_index]]
button_row.append(button)
clip_slot = scene.clip_slot(track_index)
clip_slot.name = str(track_index) + '_Clip_Slot_' + str(scene_index)
clip_slot.set_launch_button(button)
#.........这里部分代码省略.........