本文整理汇总了Python中SpecialMixerComponent.SpecialMixerComponent.is_enabled方法的典型用法代码示例。如果您正苦于以下问题:Python SpecialMixerComponent.is_enabled方法的具体用法?Python SpecialMixerComponent.is_enabled怎么用?Python SpecialMixerComponent.is_enabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpecialMixerComponent.SpecialMixerComponent
的用法示例。
在下文中一共展示了SpecialMixerComponent.is_enabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Novation_Impulse
# 需要导入模块: from SpecialMixerComponent import SpecialMixerComponent [as 别名]
# 或者: from SpecialMixerComponent.SpecialMixerComponent import is_enabled [as 别名]
#.........这里部分代码省略.........
self._transport_view_modes.name = 'Transport_View_Modes'
def _setup_device(self):
encoders = []
for index in range(8):
encoders.append(PeekableEncoderElement(MIDI_CC_TYPE, 1, index, Live.MidiMap.MapMode.relative_binary_offset))
encoders[-1].set_feedback_delay(-1)
encoders[-1].add_value_listener(self._encoder_value, identify_sender=True)
encoders[-1].name = 'Device_Control_' + str(index)
self._encoders = tuple(encoders)
self._prev_bank_button = ButtonElement(IS_MOMENTARY, MIDI_CC_TYPE, 1, 12)
self._next_bank_button = ButtonElement(IS_MOMENTARY, MIDI_CC_TYPE, 1, 11)
self._prev_bank_button.name = 'Device_Bank_Down_Button'
self._next_bank_button.name = 'Device_Bank_Up_Button'
device = DeviceComponent()
device.name = 'Device_Component'
self.set_device_component(device)
device.set_parameter_controls(self._encoders)
device.set_bank_nav_buttons(self._prev_bank_button, self._next_bank_button)
def _setup_name_display(self):
self._name_display = PhysicalDisplayElement(16, 1)
self._name_display.name = 'Display'
self._name_display.set_message_parts(SYSEX_START + (8,), (247,))
self._name_display_data_source = DisplayDataSource()
self._name_display.segment(0).set_data_source(self._name_display_data_source)
def _encoder_value(self, value, sender):
if not sender in self._encoders:
raise AssertionError
if not value in range(128):
raise AssertionError
display_string = self._device_component.is_enabled() and ' - '
display_string = sender.mapped_parameter() != None and sender.mapped_parameter().name
self._set_string_to_display(display_string)
def _slider_value(self, value, sender):
if not sender in tuple(self._sliders) + (self._master_slider,):
raise AssertionError
if not value in range(128):
raise AssertionError
if self._mixer.is_enabled():
display_string = ' - '
if sender.mapped_parameter() != None:
master = self.song().master_track
tracks = self.song().tracks
returns = self.song().return_tracks
track = None
if sender == self._master_slider:
track = self._has_sliders and master
else:
track = self.song().view.selected_track
else:
track = self._mixer.channel_strip(self._sliders.index(sender))._track
display_string = track == master and 'Master'
elif track in tracks:
display_string = str(list(tracks).index(track) + 1)
elif track in returns:
display_string = str(chr(ord('A') + list(returns).index(track)))
else:
raise False or AssertionError
display_string += ' Volume'
self._set_string_to_display(display_string)
def _mixer_button_value(self, value, sender):
示例2: Novation_Impulse2
# 需要导入模块: from SpecialMixerComponent import SpecialMixerComponent [as 别名]
# 或者: from SpecialMixerComponent.SpecialMixerComponent import is_enabled [as 别名]
#.........这里部分代码省略.........
encoders = []
for index in range(8):
encoders.append(PeekableEncoderElement(MIDI_CC_TYPE, 1, index, Live.MidiMap.MapMode.relative_binary_offset))
encoders[-1].set_feedback_delay(-1)
encoders[-1].add_value_listener(self._encoder_value, identify_sender=True)
encoders[-1].name = 'Device_Control_' + str(index)
self._encoders = tuple(encoders)
self._prev_bank_button = ButtonElement(IS_MOMENTARY, MIDI_CC_TYPE, 1, 12)
self._next_bank_button = ButtonElement(IS_MOMENTARY, MIDI_CC_TYPE, 1, 11)
self._prev_bank_button.name = 'Device_Bank_Down_Button'
self._next_bank_button.name = 'Device_Bank_Up_Button'
device = DeviceComponent()
device.name = 'Device_Component'
self.set_device_component(device)
device.set_parameter_controls(self._encoders)
device.set_bank_nav_buttons(self._prev_bank_button, self._next_bank_button)
def _setup_name_display(self):
self._name_display = PhysicalDisplayElement(16, 1)
self._name_display.name = 'Display'
self._name_display.set_message_parts(SYSEX_START + (8,), (247,))
self._name_display_data_source = DisplayDataSource()
self._name_display.segment(0).set_data_source(self._name_display_data_source)
def _encoder_value(self, value, sender):
if not sender in self._encoders:
raise AssertionError
if not value in range(128):
raise AssertionError
# display_string = self._device_component.is_enabled() and ' - '
# display_string = sender.mapped_parameter() != None and sender.mapped_parameter().name
display_string = ''
if self._device_component.is_enabled():
# display_string = sender.name
# track = self.song().view.selected_track
# display_string = str(list(tracks).index(track) + 1)
pass
if (sender.mapped_parameter() != None):
# display_string = display_string + '-'
display_string = display_string + sender.mapped_parameter().name
self._set_string_to_display(display_string)
def _slider_value(self, value, sender):
self.log ('_slider_value ' + str(value) + ' ' +str(sender))
if not sender in tuple(self._sliders) + (self._master_slider,):
raise AssertionError
if not value in range(128):
raise AssertionError
if self._mixer.is_enabled():
display_string = ' - '
master = self.song().master_track
tracks = self.song().tracks
returns = self.song().return_tracks
track = None
if sender.mapped_parameter() != None:
self.log ('1')
if sender == self._master_slider:
self.log ('2')
# track = self._has_sliders and master
if self._has_sliders:
track = master
else:
self.log ('2.1')
track = self.song().view.selected_track
else: