本文整理汇总了Python中_Framework.SessionZoomingComponent.SessionZoomingComponent.set_enabled方法的典型用法代码示例。如果您正苦于以下问题:Python SessionZoomingComponent.set_enabled方法的具体用法?Python SessionZoomingComponent.set_enabled怎么用?Python SessionZoomingComponent.set_enabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类_Framework.SessionZoomingComponent.SessionZoomingComponent
的用法示例。
在下文中一共展示了SessionZoomingComponent.set_enabled方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: OhmModesHH
# 需要导入模块: from _Framework.SessionZoomingComponent import SessionZoomingComponent [as 别名]
# 或者: from _Framework.SessionZoomingComponent.SessionZoomingComponent import set_enabled [as 别名]
#.........这里部分代码省略.........
if(button._flash_state > 0):
button.flash(self._timer)
def strobe(self):
if(self._backlight_type != 'static'):
if(self._backlight_type is 'pulse'):
self._backlight = int(math.fabs(((self._timer * 16) % 64) -32) +32)
if(self._backlight_type is 'up'):
self._backlight = int(((self._timer * 8) % 64) + 16)
if(self._backlight_type is 'down'):
self._backlight = int(math.fabs(int(((self._timer * 8) % 64) - 64)) + 16)
self._send_midi(tuple([176, 27, int(self._backlight)]))
if(self._ohm_type != 'static'):
if(self._ohm_type is 'pulse'):
self._ohm = int(math.fabs(((self._timer * 16) % 64) -32) +32)
if(self._ohm_type is 'up'):
self._ohm = int(((self._timer * 8) % 64) + 16)
if(self._ohm_type is 'down'):
self._ohm = int(math.fabs(int(((self._timer * 8) % 64) - 64)) + 16)
self._send_midi(tuple([176, 63, int(self._ohm)]))
self._send_midi(tuple([176, 31, int(self._ohm)]))
def deassign_matrix(self):
#self._scale_mode.set_mode_buttons(None)
#self._scale_mode.set_enabled(False)
#self._octave_mode.set_mode_buttons(None)
#self._octave_mode.set_enabled(False)
#self._session_zoom.set_button_matrix(None)
#if self._dial[15].has_value_listener(self._knob_set_scene):
# self._dial[15].remove_value_listener(self._knob_set_scene)
#if self._dial[14].has_value_listener(self._knob_set_track):
# self._dial[14].remove_value_listener(self._knob_set_track)
self._session_zoom.set_enabled(False)
self._session_zoom.set_nav_buttons(None, None, None, None)
self._session.set_track_bank_buttons(None, None)
self._session.set_scene_bank_buttons(None, None)
for column in range(7):
self._mixer.channel_strip(column).set_crossfade_toggle(None)
self._mixer.channel_strip(column).set_mute_button(None)
self._mixer.channel_strip(column).set_solo_button(None)
self._mixer.channel_strip(column).set_arm_button(None)
self._mixer.channel_strip(column).set_send_controls(None)
self._mixer.channel_strip(column).set_pan_control(None)
self._mixer.track_eq(column).set_enabled(False)
for row in range(7):
self._scene[row].clip_slot(column).set_launch_button(None)
for column in range(8):
#self._button[column]._on_value = SELECT_COLOR[self._rgb]
for row in range(8):
self._grid[column][row].set_channel(0)
self._grid[column][row].release_parameter()
self._grid[column][row].use_default_message()
self._grid[column][row].set_enabled(True)
self._grid[column][row].send_value(0, True)
self._grid[column][row]._on_value = 127
self._grid[column][row]._off_value = 0
#for index in range(8):
# self._button[index].set_channel(0)
# self._button[index].use_default_message()
# self._button[index].set_enabled(True)
# self._button[index].reset()
#for index in range(6):
# self._menu[index]._on_value = 127
# self._menu[index]._off_value = 0
# self._menu[index].reset()
示例2: LemurPad
# 需要导入模块: from _Framework.SessionZoomingComponent import SessionZoomingComponent [as 别名]
# 或者: from _Framework.SessionZoomingComponent.SessionZoomingComponent import set_enabled [as 别名]
#.........这里部分代码省略.........
for index in range(8):
self._pedal[index] = EncoderElement(MIDI_CC_TYPE, 0, 25+index, Live.MidiMap.MapMode.absolute)
self._pedal[index].name = 'Pedal_'+str(index)
self._pedal[index]._report = False
def _setup_session_control(self):
is_momentary = True
num_tracks = 4
num_scenes = 5
self._session = NameServerSessionComponent(num_tracks, num_scenes, self)
self._session.name = "Left_Session"
self._session.set_offsets(0, 0)
self._session.set_stop_clip_value(self._color_defs['STOP_CLIP'])
self._scene = [None for index in range(5)]
for row in range(num_scenes):
self._scene[row] = self._session.scene(row)
self._scene[row].name = 'L_Scene_' + str(row)
for column in range(num_tracks):
clip_slot = self._scene[row].clip_slot(column)
clip_slot.name = str(column) + '_Clip_Slot_L_' + str(row)
clip_slot.set_triggered_to_play_value(self._color_defs['CLIP_TRG_PLAY'])
clip_slot.set_triggered_to_record_value(self._color_defs['CLIP_TRG_REC'])
clip_slot.set_stopped_value(self._color_defs['CLIP_STOP'])
clip_slot.set_started_value(self._color_defs['CLIP_STARTED'])
clip_slot.set_recording_value(self._color_defs['CLIP_RECORDING'])
self._session.set_mixer(self._mixer)
self._session_zoom = SessionZoomingComponent(self._session)
self._session_zoom.name = 'L_Session_Overview'
self._session_zoom.set_stopped_value(self._color_defs['ZOOM_STOPPED'])
self._session_zoom.set_playing_value(self._color_defs['ZOOM_PLAYING'])
self._session_zoom.set_selected_value(self._color_defs['ZOOM_SELECTED'])
self._session_zoom._zoom_button = (self._dummy_button)
self._session_zoom.set_enabled(True)
self._session2 = SessionComponent(num_tracks, num_scenes)
self._session2.name = 'Right_Session'
self._session2.set_offsets(4, 0)
self._session2.set_stop_clip_value(self._color_defs['STOP_CLIP'])
self._scene2 = [None for index in range(5)]
for row in range(num_scenes):
self._scene2[row] = self._session2.scene(row)
self._scene2[row].name = 'R_Scene_' + str(row)
for column in range(num_tracks):
clip_slot = self._scene2[row].clip_slot(column)
clip_slot.name = str(column) + '_Clip_Slot_R_' + str(row)
clip_slot.set_triggered_to_play_value(self._color_defs['CLIP_TRG_PLAY'])
clip_slot.set_triggered_to_record_value(self._color_defs['CLIP_TRG_REC'])
clip_slot.set_stopped_value(self._color_defs['CLIP_STOP'])
clip_slot.set_started_value(self._color_defs['CLIP_STARTED'])
clip_slot.set_recording_value(self._color_defs['CLIP_RECORDING'])
self._session2.set_mixer(self._mixer2)
self._session2.add_offset_listener(self._on_session_offset_changes)
self._session_zoom2 = SessionZoomingComponent(self._session2)
self._session_zoom2.name = 'R_Session_Overview'
self._session_zoom2.set_stopped_value(self._color_defs['ZOOM_STOPPED'])
self._session_zoom2.set_playing_value(self._color_defs['ZOOM_PLAYING'])
self._session_zoom2.set_selected_value(self._color_defs['ZOOM_SELECTED'])
self._session_zoom.set_enabled(True)
self._session_zoom2._zoom_button = (self._dummy_button2)
self._session_main = SessionComponent(8, num_scenes)
self._session_main.name = 'Main_Session'
self._session_main.set_stop_clip_value(self._color_defs['STOP_CLIP'])
self._scene_main = [None for index in range(5)]
for row in range(num_scenes):
self._scene_main[row] = self._session_main.scene(row)
self._scene_main[row].name = 'M_Scene_' + str(row)
示例3: OhmModes
# 需要导入模块: from _Framework.SessionZoomingComponent import SessionZoomingComponent [as 别名]
# 或者: from _Framework.SessionZoomingComponent.SessionZoomingComponent import set_enabled [as 别名]
#.........这里部分代码省略.........
def flash(self):
for row in range(8):
if self._button[row]._flash_state > 0:
self._button[row].flash(self._timer)
for column in range(8):
button = self._grid[column][row]
if button._flash_state > 0:
button.flash(self._timer)
def strobe(self):
if self._backlight_type != 'static':
if self._backlight_type is 'pulse':
self._backlight = int(math.fabs(self._timer * 16 % 64 - 32) + 32)
if self._backlight_type is 'up':
self._backlight = int(self._timer * 8 % 64 + 16)
if self._backlight_type is 'down':
self._backlight = int(math.fabs(int(self._timer * 8 % 64 - 64)) + 16)
self._send_midi(tuple([176, 27, int(self._backlight)]))
if self._ohm_type != 'static':
if self._ohm_type is 'pulse':
self._ohm = int(math.fabs(self._timer * 16 % 64 - 32) + 32)
if self._ohm_type is 'up':
self._ohm = int(self._timer * 8 % 64 + 16)
if self._ohm_type is 'down':
self._ohm = int(math.fabs(int(self._timer * 8 % 64 - 64)) + 16)
self._send_midi(tuple([176, 63, int(self._ohm)]))
self._send_midi(tuple([176, 31, int(self._ohm)]))
def deassign_matrix(self):
with self.component_guard():
self._host._set_knobs(None)
self._host._set_button_matrix(None)
self._host.set_enabled(False)
self._modNum.set_enabled(False)
self.assign_alternate_mappings(0)
self._scale_mode.set_mode_buttons(None)
self._scale_mode.set_enabled(False)
self._octave_mode.set_mode_buttons(None)
self._octave_mode.set_enabled(False)
self._session_zoom.set_enabled(False)
self._session_zoom.set_nav_buttons(None, None, None, None)
self._session.set_track_bank_buttons(None, None)
self._session.set_scene_bank_buttons(None, None)
self._transport.set_enabled(False)
for column in range(4):
self._mixer.track_eq(column)._gain_controls = None
self._mixer.track_eq(column).set_enabled(False)
for column in range(7):
self._mixer.channel_strip(column).set_crossfade_toggle(None)
self._mixer.channel_strip(column).set_mute_button(None)
self._mixer.channel_strip(column).set_solo_button(None)
self._mixer.channel_strip(column).set_arm_button(None)
self._mixer.channel_strip(column).set_send_controls(None)
self._mixer.channel_strip(column).set_pan_control(None)
self._mixer.track_eq(column).set_enabled(False)
for row in range(5):
self._scene[row].clip_slot(column).set_launch_button(None)
"""for column in range(8):
self._button[column]._on_value = SELECT_COLOR[self._rgb]
for row in range(8):
self._grid[column][row].set_enabled(True)
self._grid[column][row].release_parameter()
self._grid[column][row].use_default_message()
示例4: AumPC40
# 需要导入模块: from _Framework.SessionZoomingComponent import SessionZoomingComponent [as 别名]
# 或者: from _Framework.SessionZoomingComponent.SessionZoomingComponent import set_enabled [as 别名]
#.........这里部分代码省略.........
global_translation_selector.set_mode_buttons(tuple(global_bank_buttons))
def _product_model_id_byte(self):
return 115
def _setup_monobridge(self):
self._monobridge = MonoBridgeElement(self)
self._monobridge.name = 'MonoBridge'
def _setup_monomod(self):
self._host = MonomodComponent(self)
self._host.name = 'Monomod_Host'
self.hosts = [self._host]
self._monomod = ButtonMatrixElement()
self._monomod.name = 'Monomod'
for row in range(5):
button_row = []
for column in range(8):
button_row.append(self._matrix.get_button(column, row))
self._monomod.add_row(tuple(button_row))
self._monomod.add_row(tuple(self._track_stop_buttons))
self._monomod.add_row(tuple(self._select_buttons))
self._monomod.add_row(tuple(self._solo_buttons))
self._monomod_mode = MonomodModeComponent(self._monomod_mode_update, self)
self._monomod_mode.name = "Monomod_Mode_Component"
def _monomod_mode_update(self):
if(self._monomod_mode._mode_index == 0) or (self._host._active_client == None):
self.flash_status = 0
self._host.set_enabled(False)
self._host._set_button_matrix(None)
self._host._set_nav_buttons(None)
self._host._set_lock_button(None)
self._host._set_alt_button(None)
self._host._set_shift_button(None)
self._monomod.reset()
self._session.set_track_bank_buttons(self._right_button, self._left_button)
self._session.set_scene_bank_buttons(self._down_button, self._up_button)
for track in range(8):
self._mixer.channel_strip(track).set_select_button(self._select_buttons[track])
self._mixer.channel_strip(track).set_solo_button(self._solo_buttons[track])
self._transport.set_nudge_buttons(self._nudge_up_button, self._nudge_down_button)
self._session.set_enabled(True)
self._session_zoom._is_zoomed_out = False
self._session_zoom.set_enabled(True)
self.request_rebuild_midi_map()
self._master_select_button.turn_off()
elif(self._monomod_mode._mode_index == 1):
self._transport.set_nudge_buttons(None, None)
for track in range(8):
self._mixer.channel_strip(track).set_select_button(None)
self._mixer.channel_strip(track).set_solo_button(None)
self._session.set_enabled(False)
self._session_zoom.set_enabled(False)
self._session.set_track_bank_buttons(None, None)
self._session.set_scene_bank_buttons(None, None)
self.flash_status = 1
self._monomod.reset()
self._host._set_button_matrix(self._monomod)
self._host._set_nav_buttons([self._up_button, self._down_button, self._left_button, self._right_button])
self._host._set_shift_button(self._shift_button)
示例5: OhmModes
# 需要导入模块: from _Framework.SessionZoomingComponent import SessionZoomingComponent [as 别名]
# 或者: from _Framework.SessionZoomingComponent.SessionZoomingComponent import set_enabled [as 别名]
#.........这里部分代码省略.........
#if(self.flash_status > 0):
for row in range(8):
if(self._button[row]._flash_state > 0):
self._button[row].flash(self._timer)
for column in range(8):
button = self._grid[column][row]
if(button._flash_state > 0):
button.flash(self._timer)
def strobe(self):
if(self._backlight_type != 'static'):
if(self._backlight_type is 'pulse'):
self._backlight = int(math.fabs(((self._timer * 16) % 64) -32) +32)
if(self._backlight_type is 'up'):
self._backlight = int(((self._timer * 8) % 64) + 16)
if(self._backlight_type is 'down'):
self._backlight = int(math.fabs(int(((self._timer * 8) % 64) - 64)) + 16)
self._send_midi(tuple([176, 27, int(self._backlight)]))
if(self._ohm_type != 'static'):
if(self._ohm_type is 'pulse'):
self._ohm = int(math.fabs(((self._timer * 16) % 64) -32) +32)
if(self._ohm_type is 'up'):
self._ohm = int(((self._timer * 8) % 64) + 16)
if(self._ohm_type is 'down'):
self._ohm = int(math.fabs(int(((self._timer * 8) % 64) - 64)) + 16)
self._send_midi(tuple([176, 63, int(self._ohm)]))
self._send_midi(tuple([176, 31, int(self._ohm)]))
def deassign_matrix(self):
self._host._set_knobs(None)
self._host._set_button_matrix(None)
self._modNum.set_enabled(False)
self.assign_alternate_mappings(0)
self._scale_mode.set_mode_buttons(None)
self._scale_mode.set_enabled(False)
self._octave_mode.set_mode_buttons(None)
self._octave_mode.set_enabled(False)
#self._session_zoom.set_button_matrix(None)
self._session_zoom.set_enabled(False)
self._session_zoom.set_nav_buttons(None, None, None, None)
self._session.set_track_bank_buttons(None, None)
self._session.set_scene_bank_buttons(None, None)
for column in range(4):
#self._mixer.track_eq(column).set_gain_controls(tuple([self._dial[column + 8], self._dial[column + 4], self._dial[column]]))
self._mixer.track_eq(column)._gain_controls = None
self._mixer.track_eq(column).set_enabled(False)
for column in range(7):
self._mixer.channel_strip(column).set_crossfade_toggle(None)
self._mixer.channel_strip(column).set_mute_button(None)
self._mixer.channel_strip(column).set_solo_button(None)
self._mixer.channel_strip(column).set_arm_button(None)
self._mixer.channel_strip(column).set_send_controls(None)
self._mixer.channel_strip(column).set_pan_control(None)
self._mixer.track_eq(column).set_enabled(False)
for row in range(5):
self._scene[row].clip_slot(column).set_launch_button(None)
for column in range(8):
self._button[column]._on_value = SELECT_COLOR[self._rgb]
for row in range(8):
self._grid[column][row].set_channel(0)
self._grid[column][row].release_parameter()
self._grid[column][row].use_default_message()
self._grid[column][row].set_enabled(True)
self._grid[column][row].send_value(0, True)
示例6: AumTroll_G
# 需要导入模块: from _Framework.SessionZoomingComponent import SessionZoomingComponent [as 别名]
# 或者: from _Framework.SessionZoomingComponent.SessionZoomingComponent import set_enabled [as 别名]
#.........这里部分代码省略.........
self._session_zoom.set_zoom_button(self._button[31]) #assign a shift button so that we can switch states between the SessionComponent and the SessionZoomingComponent
"""this section is used so that we can reassign the color properties of each state. Legacy, from the OhmModes script, to support either RGB or Monochrome"""
def _assign_session_colors(self):
num_tracks = 8
num_scenes = 4
self._session.set_stop_clip_value(STOP_ALL[self._rgb])
for row in range(num_scenes):
for column in range(num_tracks):
self._scene[row].clip_slot(column).set_triggered_to_play_value(CLIP_TRG_PLAY[self._rgb])
self._scene[row].clip_slot(column).set_triggered_to_record_value(CLIP_TRG_REC[self._rgb])
self._scene[row].clip_slot(column).set_stopped_value(CLIP_STOP[self._rgb])
self._scene[row].clip_slot(column).set_started_value(CLIP_STARTED[self._rgb])
self._scene[row].clip_slot(column).set_recording_value(CLIP_RECORDING[self._rgb])
self._session_zoom.set_stopped_value(ZOOM_STOPPED[self._rgb])
self._session_zoom.set_playing_value(ZOOM_PLAYING[self._rgb])
self._session_zoom.set_selected_value(ZOOM_SELECTED[self._rgb])
self.refresh_state()
def deassign_live_controls(self, *a, **k):
for index in range(4):
self._encoder[index].send_value(0, True)
self._encoder[index].clear_send_cache()
self._mixer.channel_strip(index+4).set_volume_control(None) #Since we gave our mixer 4 tracks above, we'll now assign our fader controls to it #for the left side of the mixer
self._mixer.channel_strip(index+4).set_solo_button(None) #remove the solo button assignments
self._mixer.channel_strip(index+4).set_arm_button(None) #remove the arm button assignments
self._mixer.channel_strip(index+4).set_mute_button(None) #remove the mute button assignments
self._mixer.channel_strip(index+4).set_select_button(None) #remove the select button assignments
#self._alt_device_navigator.set_arrange_session_toggle_button(None)
self._alt_device_navigator.set_device_clip_toggle_button(None)
self._alt_device_navigator.set_detail_toggle_button(None)
self._alt_device_navigator.set_enabled(False)
#self._alt_device_navigator.set_shift_button(None)
self._transport.set_nudge_buttons(None, None)
self._recorder.set_record_button(None)
self._recorder.set_re_enable_automation_button(None)
super(AumTroll_G, self).deassign_live_controls(*a, **k)
def assign_live_controls(self):
"""the following lines update all of the controls' last_sent properties, so that they forward the next value they receive regardless of whether or not it is the same as the last it recieved"""
"""we also reset the encoder rings and buttons, since the device component will not update them if it is not locked to a device in Live"""
for index in range(16):
self._grid[index].force_next_send()
for index in range(32):
#self._button[index].set_on_off_values(0, 127)
self._button[index].send_value(0, True)
self._button[index].force_next_send()
for index in range(8):
self._encoder_button[index+4].send_value(0, True)
self._encoder_button[index+4].force_next_send()
for index in range(12):
self._encoder[index].send_value(0, True)
self._encoder[index].force_next_send()
"""here we assign the left side of our mixer's buttons on the lower 32 keys"""
if self._monohm is None:
with self.component_guard():
for index in range(4): #we set up a recursive loop to assign all four of our track channel strips' controls
self._button[index+16].set_on_value(MUTE[self._rgb]) #set the mute color from the Map.py
self._mixer.channel_strip(index).set_mute_button(self._button[index+16]) #assign the mute buttons to our mixer channel strips
self._button[index+28].set_on_value(MUTE[self._rgb]) #set the mute color from the Map.py