本文整理汇总了Python中_Framework.SessionZoomingComponent.SessionZoomingComponent.set_allow_update方法的典型用法代码示例。如果您正苦于以下问题:Python SessionZoomingComponent.set_allow_update方法的具体用法?Python SessionZoomingComponent.set_allow_update怎么用?Python SessionZoomingComponent.set_allow_update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类_Framework.SessionZoomingComponent.SessionZoomingComponent
的用法示例。
在下文中一共展示了SessionZoomingComponent.set_allow_update方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MainSelectorComponent
# 需要导入模块: from _Framework.SessionZoomingComponent import SessionZoomingComponent [as 别名]
# 或者: from _Framework.SessionZoomingComponent.SessionZoomingComponent import set_allow_update [as 别名]
#.........这里部分代码省略.........
else:
if self._mode_index==0:
new_channel = 0 #session
elif self._mode_index==1:
if self._sub_mode_index[self._mode_index]==0:
new_channel = 11 #instrument controller 11,12,13,14
if self._instrument_controller != None:
self._instrument_controller.base_channel = new_channel
elif self._sub_mode_index[self._mode_index]==1:
new_channel = 3 #device controler
else :
new_channel = 4 #plain user mode 1
elif self._mode_index==2:
if self._sub_mode_index[self._mode_index]==0:
new_channel = 5 #user 2
else:
new_channel = 1 + self._sub_mode_index[self._mode_index] #step seq 1,2
elif self._mode_index==3: #mixer modes
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)
self._config_button.send_value(1)
if (self._mode_index == 0):
#session
self._setup_mixer(not as_active)
self._setup_device_controller(not as_active)
self._setup_step_sequencer(not as_active)
self._setup_instrument_controller(not as_active)
self._setup_session(as_active, as_enabled)
self._update_control_channels()
elif (self._mode_index == 1):
self._setup_session(not as_active, not as_enabled)
self._setup_step_sequencer(not as_active)
self._setup_mixer(not as_active)
#user mode + device controller + instrument controller
if (self._sub_mode_index[self._mode_index]==0):
self._setup_device_controller(not as_active)
self._update_control_channels()
self._setup_instrument_controller(as_active)
elif (self._sub_mode_index[self._mode_index]==1):
self._setup_instrument_controller(not as_active)
self._setup_device_controller(as_active)
self._update_control_channels()
else:
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()
elif (self._mode_index == 2):
示例2: MainSelectorComponent
# 需要导入模块: from _Framework.SessionZoomingComponent import SessionZoomingComponent [as 别名]
# 或者: from _Framework.SessionZoomingComponent.SessionZoomingComponent import set_allow_update [as 别名]
#.........这里部分代码省略.........
new_channel = 5 # user 2
else:
new_channel = 1 + self._sub_mode_index[self._mode_index] # step seq
elif self._mode_index == 3: # mixer modes
new_channel = 6 + self._sub_modes.mode()
# if (new_channel > 0):
# new_channel += 3
return new_channel
def update(self):
assert self._modes_buttons != None
if self.is_enabled():
# for index in range(len(self._modes_buttons)):
# self._modes_buttons[index].set_force_next_value()
# if index == self._mode_index:
# self._modes_buttons[index].turn_on()
# else:
# self._modes_buttons[index].turn_off()
self._update_mode_buttons()
# update matrix and side buttons
for scene_index in range(8):
# update scene button
self._side_buttons[scene_index].set_enabled(True)
for track_index in range(8):
# update matrix
self._matrix.get_button(track_index, scene_index).set_enabled(True)
for button in self._nav_buttons:
button.set_enabled(True)
as_active = True
as_enabled = True
self._session.set_allow_update(False)
self._zooming.set_allow_update(False)
self._config_button.send_value(40)
self._config_button.send_value(1)
release_buttons = self._mode_index == 1
if self._mode_index == 0:
# session
self._setup_mixer((not as_active))
self._setup_device_controller((not as_active))
self._setup_step_sequencer((not as_active), 0)
self._setup_device_controller((not as_active))
self._setup_session(as_active, as_enabled)
elif self._mode_index == 1:
# user mode + device controller
self._setup_mixer((not as_active))
if self._sub_mode_index[self._mode_index] == 0:
self._setup_step_sequencer((not as_active), 0)
self._setup_device_controller((not as_active))
self._setup_session((not as_active), (as_enabled))
self._setup_user1(True, True, True)
else:
self._setup_session(not as_active, not as_enabled)
self._setup_step_sequencer(not as_active, 0)
self._setup_device_controller(as_active)
elif self._mode_index == 2:
self._setup_session((not as_active), (not as_enabled))
self._setup_mixer((not as_active))
self._setup_device_controller((not as_active))
if self._sub_mode_index[self._mode_index] == 0:
self._setup_device_controller((not as_active))
self._setup_step_sequencer((not as_active), 0)
self._setup_user2(release_buttons)
示例3: MainSelectorComponent
# 需要导入模块: from _Framework.SessionZoomingComponent import SessionZoomingComponent [as 别名]
# 或者: from _Framework.SessionZoomingComponent.SessionZoomingComponent import set_allow_update [as 别名]
#.........这里部分代码省略.........
def set_mode(self, mode):
assert mode in range(self.number_of_modes())
if (self._mode_index != mode) or (mode == 3):
self._mode_index = mode
self.update()
def channel_for_current_mode(self):
new_channel = self._mode_index + self._sub_modes.mode()
if new_channel > 0:
new_channel += 3
return new_channel
def update(self):
assert self._modes_buttons != None
if self.is_enabled():
# for index in range(len(self._modes_buttons)):
# self._modes_buttons[index].set_force_next_value()
# if index == self._mode_index:
# self._modes_buttons[index].turn_on()
# else:
# self._modes_buttons[index].turn_off()
for scene_index in range(8):
self._side_buttons[scene_index].set_enabled(True)
for track_index in range(8):
self._matrix.get_button(track_index, scene_index).set_enabled(True)
for button in self._nav_buttons:
button.set_enabled(True)
as_active = True
as_enabled = True
self._session.set_allow_update(False)
self._zooming.set_allow_update(False)
self._config_button.send_value(40)
self._config_button.send_value(1)
release_buttons = self._mode_index == 1
if self._mode_index < 4:
self._script._suppress_session_highlight = False
self._session.set_show_highlight(True)
# self._script.set_highlighting_session_component(self.session_component())
self._script._host._set_key_buttons(None)
self._script._host.set_enabled(False)
self._script._host._set_button_matrix(None)
self._script._host._set_alt_button(None)
self._script._host._set_shift_button(None)
self._script._host._set_nav_buttons(None)
for button in self._modes_buttons:
button.set_on_off_values(127, 4)
if self._mode_index == 0:
self._setup_mixer(not as_active)
self._setup_session(as_active, as_enabled)
elif self._mode_index == 1:
self._setup_session(not as_active, not as_enabled)
self._setup_mixer(not as_active)
self._setup_user(release_buttons)
elif self._mode_index == 2:
self._setup_session(not as_active, not as_enabled)
self._setup_mixer(not as_active)
self._setup_user(release_buttons)
elif self._mode_index == 3:
self._setup_session(not as_active, as_enabled)
self._setup_mixer(as_active)
elif self._mode_index == 4:
示例4: MainSelectorComponent
# 需要导入模块: from _Framework.SessionZoomingComponent import SessionZoomingComponent [as 别名]
# 或者: from _Framework.SessionZoomingComponent.SessionZoomingComponent import set_allow_update [as 别名]
#.........这里部分代码省略.........
def number_of_modes(self):
return 5
def on_enabled_changed(self):
self.update()
def set_mode(self, mode):
assert (mode in range(self.number_of_modes()))
if ((self._mode_index != mode) or (mode == 3)):
self._mode_index = mode
self.update()
def update(self):
assert (self._modes_buttons != None)
if self.is_enabled():
for scene_index in range(8):
self._side_buttons[scene_index].set_enabled(True)
for track_index in range(8):
self._matrix.get_button(track_index, scene_index).set_enabled(True)
for button in self._nav_buttons:
button.set_enabled(True)
as_active = True
as_enabled = True
self._session.set_allow_update(False)
self._zooming.set_allow_update(False)
self._config_button.send_value(40)
self._config_button.send_value(1)
release_buttons = (self._mode_index == 1)
if (self._mode_index < 4):
self._script._host._set_key_buttons(None)
self._script._host.set_enabled(False)
self._script._host._set_button_matrix(None)
self._script._host._set_alt_button(None)
self._script._host._set_shift_button(None)
self._script._host._set_nav_buttons(None)
for button in self._modes_buttons:
button.set_on_off_values(5, 0)
if (self._mode_index == 0):
self._setup_mixer((not as_active))
self._setup_session(as_active, as_enabled)
elif (self._mode_index == 1):
self._setup_session((not as_active), (not as_enabled))
self._setup_mixer((not as_active))
self._setup_user(release_buttons)
elif (self._mode_index == 2):
self._setup_session((not as_active), (not as_enabled))
self._setup_mixer((not as_active))
self._setup_user(release_buttons)
elif (self._mode_index == 3):
self._setup_session((not as_active), as_enabled)
self._setup_mixer(as_active)
elif (self._mode_index == 4):
self._setup_session((not as_active), (not as_enabled))
self._setup_mixer((not as_active))
self._setup_user(release_buttons)
self._script._host._set_button_matrix(self._matrix)
示例5: MainSelectorComponent
# 需要导入模块: from _Framework.SessionZoomingComponent import SessionZoomingComponent [as 别名]
# 或者: from _Framework.SessionZoomingComponent.SessionZoomingComponent import set_allow_update [as 别名]
#.........这里部分代码省略.........
def set_mode(self, mode):
if not mode in range(self.number_of_modes()):
raise AssertionError
self._mode_index = (self._mode_index != mode or mode == 3) and mode
self.update()
def channel_for_current_mode(self):
new_channel = self._mode_index + self._sub_modes.mode()
if new_channel > 0:
new_channel += 3
return new_channel
def update(self):
if not self._modes_buttons != None:
raise AssertionError
if self.is_enabled():
for index in range(len(self._modes_buttons)):
self._modes_buttons[index].set_force_next_value()
if index == self._mode_index:
self._modes_buttons[index].turn_on()
else:
self._modes_buttons[index].turn_off()
for scene_index in range(8):
self._side_buttons[scene_index].set_enabled(True)
for track_index in range(8):
self._matrix.get_button(track_index, scene_index).set_enabled(True)
for button in self._nav_buttons:
button.set_enabled(True)
as_active = True
as_enabled = True
self._session.set_allow_update(False)
self._zooming.set_allow_update(False)
self._config_button.send_value(40)
self._config_button.send_value(1)
release_buttons = self._mode_index == 1
self._mode_index == 0 and self._setup_mixer(not as_active)
self._setup_session(as_active, as_enabled)
elif self._mode_index == 1:
self._setup_session(not as_active, not as_enabled)
self._setup_mixer(not as_active)
self._setup_user(release_buttons)
elif self._mode_index == 2:
self._setup_session(not as_active, not as_enabled)
self._setup_mixer(not as_active)
self._setup_user(release_buttons)
elif self._mode_index == 3:
self._setup_session(not as_active, as_enabled)
self._setup_mixer(as_active)
else:
raise False or AssertionError
self._session.set_allow_update(True)
self._zooming.set_allow_update(True)
self._update_control_channels()
def _update_control_channels(self):
new_channel = self.channel_for_current_mode()
for button in self._all_buttons:
button.set_channel(new_channel)
button.set_force_next_value()
def _setup_session(self, as_active, as_enabled):
if not isinstance(as_active, type(False)):
raise AssertionError
示例6: MainSelectorComponent
# 需要导入模块: from _Framework.SessionZoomingComponent import SessionZoomingComponent [as 别名]
# 或者: from _Framework.SessionZoomingComponent.SessionZoomingComponent import set_allow_update [as 别名]
#.........这里部分代码省略.........
if self._sub_mode_index[self._main_mode_index]==0:
#instrument controller
self._mode_index = 4
elif self._sub_mode_index[self._main_mode_index]==1:
#device controller
self._mode_index = 5
else:
#plain user mode 1
self._mode_index = 1
elif self._main_mode_index == 2:
if self._sub_mode_index[self._main_mode_index]==0:
#stepseq
self._mode_index = 6
elif self._sub_mode_index[self._main_mode_index]==1:
#melodic step seq
self._mode_index = 7
else:
#plain user mode 2
self._mode_index = 2
elif self._main_mode_index == 3:
self._mode_index = 3
else:
assert False
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)
self._config_button.send_value(1)
if self._main_mode_index == 0:
#session
self._m4lmode_index = 0
self.refresh_map_display()
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()
elif self._main_mode_index == 1:
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)
if self._sub_mode_index[self._main_mode_index]==0:
#instrument controller
self._setup_device_controller(not as_active)
self._update_control_channels()
self._setup_instrument_controller(as_active)
elif self._sub_mode_index[self._main_mode_index]==1:
#device controller
self._setup_instrument_controller(not as_active)
self._setup_device_controller(as_active)
self._update_control_channels()
else: