本文整理匯總了Python中ConfigurableButtonElement.ConfigurableButtonElement.add_value_listener方法的典型用法代碼示例。如果您正苦於以下問題:Python ConfigurableButtonElement.add_value_listener方法的具體用法?Python ConfigurableButtonElement.add_value_listener怎麽用?Python ConfigurableButtonElement.add_value_listener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ConfigurableButtonElement.ConfigurableButtonElement
的用法示例。
在下文中一共展示了ConfigurableButtonElement.add_value_listener方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: Axiom_AIR_25_49_61
# 需要導入模塊: from ConfigurableButtonElement import ConfigurableButtonElement [as 別名]
# 或者: from ConfigurableButtonElement.ConfigurableButtonElement import add_value_listener [as 別名]
#.........這裏部分代碼省略.........
def set_appointed_device(self, device):
ControlSurface.set_appointed_device(self, device)
with self.component_guard():
if self._alt_device_component != None:
self._alt_device_component.set_device(device)
def set_alt_device_component(self, device_component):
self._alt_device_component = device_component
def _update_device_selection(self):
track = self.song().view.selected_track
device_to_select = track.view.selected_device
if device_to_select == None and len(track.devices) > 0:
device_to_select = track.devices[0]
if device_to_select != None:
self.song().view.select_device(device_to_select)
self._device_component.set_device(device_to_select)
if self._alt_device_component != None:
self._alt_device_component.set_device(device_to_select)
def _setup_controls(self):
self._left_button = create_button(99, "Left_Button")
self._right_button = create_button(100, "Right_Button")
self._up_button = create_button(101, "Up_Button")
self._down_button = create_button(102, "Down_Button")
self._loop_button = create_button(113, "Loop_Button")
self._rwd_button = create_button(114, "Rwd_Button")
self._ffwd_button = create_button(115, "FFwd_Button")
self._stop_button = create_button(116, "Stop_Button")
self._play_button = create_button(117, "Play_Button")
self._rec_button = create_button(118, "Record_Button")
self._select_button = ConfigurableButtonElement(IS_MOMENTARY, MIDI_CC_TYPE, GLOBAL_CHANNEL, 98)
self._select_button.name = "Select_Button"
self._select_button.add_value_listener(self._select_button_value)
self._main_group_hyper_button = create_configurable_button(104, "Fader_Group_HyperControl_Button", 2, 14)
self._main_group_track_button = create_configurable_button(105, "Main_Group_Track_Button", 2, 11)
self._main_group_fx_button = create_configurable_button(106, "Main_Group_Inst_FX_Button", 2, 11)
self._identify_button = create_configurable_button(97, "Identify_Button", 2, 16)
self._identify_button.add_value_listener(self._identify_value)
self._fader_buttons = []
for index in range(8):
self._fader_buttons.append(create_configurable_button(49 + index, "Fader_Button_%d" % index))
self._fader_buttons[-1].add_value_listener(self._fader_button_value, identify_sender=True)
self._faders = []
for index in range(8):
self._faders.append(create_slider(33 + index, "Fader_%d" % index))
self._faders[-1].add_value_listener(self._fader_value, identify_sender=True)
self._master_fader_button = create_configurable_button(57, "Master_Fader_Button")
self._master_fader_button.add_value_listener(self._fader_button_value, identify_sender=True)
self._master_fader = create_slider(41, "Master_Fader")
self._master_fader.add_value_listener(self._fader_value, identify_sender=True)
self._fader_group_mode_button = create_configurable_button(61, "Fader_Group_Mode_Button")
self._fader_group_midi_button = create_configurable_button(60, "Fader_Group_MIDI_Button")
self._fader_group_midi_button.add_value_listener(self._midi_button_value, identify_sender=True)
self._fader_group_mix_button = create_configurable_button(58, "Fader_Group_Mix_Button", 0, 1)
self._fader_group_mix_button.add_value_listener(self._hyper_button_value, identify_sender=True)
self._fader_group_fx_button = create_configurable_button(59, "Fader_Group_Inst_FX_Button", 0, -1)
self._fader_group_fx_button.add_value_listener(self._hyper_button_value, identify_sender=True)
self._encoders = []
for index in range(8):
self._encoders.append(create_encoder(17 + index, "Encoder_%d" % index))
self._encoders[-1].add_value_listener(self._encoder_value, identify_sender=True)
self._encoder_group_midi_button = create_configurable_button(27, "Encoder_Group_MIDI_Button", 0, 72)