本文整理汇总了Python中_Framework.PhysicalDisplayElement.PhysicalDisplayElement.display_message方法的典型用法代码示例。如果您正苦于以下问题:Python PhysicalDisplayElement.display_message方法的具体用法?Python PhysicalDisplayElement.display_message怎么用?Python PhysicalDisplayElement.display_message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类_Framework.PhysicalDisplayElement.PhysicalDisplayElement
的用法示例。
在下文中一共展示了PhysicalDisplayElement.display_message方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Axiom_DirectLink
# 需要导入模块: from _Framework.PhysicalDisplayElement import PhysicalDisplayElement [as 别名]
# 或者: from _Framework.PhysicalDisplayElement.PhysicalDisplayElement import display_message [as 别名]
#.........这里部分代码省略.........
self._device_component.set_bank_nav_buttons(None, None)
self._device_navigation.set_device_nav_buttons(self._device_bank_buttons[0], self._device_bank_buttons[1])
else:
self._session.set_track_bank_buttons(None, None)
self._mixer.set_select_buttons(self._next_nav_button, self._prev_nav_button)
self._device_navigation.set_device_nav_buttons(None, None)
self._device_component.set_bank_nav_buttons(self._device_bank_buttons[0], self._device_bank_buttons[1])
self.request_rebuild_midi_map()
return
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._display_data_source.set_display_string(display_string)
self._set_display_data_source(self._display_data_source)
self._display_reset_delay = STANDARD_DISPLAY_DELAY
return
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 "Ma"
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 += " Vol"
self._display_data_source.set_display_string(display_string)
self._set_display_data_source(self._display_data_source)
self._display_reset_delay = STANDARD_DISPLAY_DELAY
return
def _mixer_button_value(self, value, sender):
if not sender in tuple(self._strip_buttons) + (self._selected_mute_solo_button,):
raise AssertionError
if not value in range(128):
raise AssertionError
if self._mixer.is_enabled() and value > 0:
strip = None
strip = sender == self._selected_mute_solo_button and self._mixer.selected_strip()
else:
strip = self._mixer.channel_strip(self._strip_buttons.index(sender))
strip != None and self._set_display_data_source(strip.track_name_data_source())
else:
self._display_data_source.set_display_string(" - ")
self._set_display_data_source(self._display_data_source)
self._display_reset_delay = STANDARD_DISPLAY_DELAY
return
def _device_bank_value(self, value):
if not value in range(128):
raise AssertionError
if self._device_component.is_enabled() and value > 0:
data_source = self._device_component.bank_name_data_source()
data_source = self._shift_pressed and self._device_component.device_name_data_source()
self._set_display_data_source(data_source)
self._display_reset_delay = STANDARD_DISPLAY_DELAY
def _inst_value(self, value):
if not value in range(128):
raise AssertionError
value > 0 and self._device_component.is_enabled() and self.song().view.selected_track.view.select_instrument() and self._set_display_data_source(
self._device_component.device_name_data_source()
)
self._display_reset_delay = STANDARD_DISPLAY_DELAY
def _show_current_track_name(self):
if self._display != None and self._mixer != None:
self._set_display_data_source(self._mixer.selected_strip().track_name_data_source())
return
def _show_startup_message(self):
self._display.display_message("LIVE")
self._display_reset_delay = INITIAL_DISPLAY_DELAY
def _set_display_data_source(self, data_source):
raise isinstance(data_source, DisplayDataSource) or AssertionError
self._display.segment(0).set_data_source(data_source)
data_source.update()
示例2: Axiom_AIR_25_49_61
# 需要导入模块: from _Framework.PhysicalDisplayElement import PhysicalDisplayElement [as 别名]
# 或者: from _Framework.PhysicalDisplayElement.PhysicalDisplayElement import display_message [as 别名]
#.........这里部分代码省略.........
self._drum_pads = None
self._identify_button = None
self._main_group_hyper_button = None
self._main_group_track_button = None
self._main_group_fx_button = None
self._encoder_group_midi_button = None
self._encoder_group_mix_button = None
self._encoder_group_fx_button = None
self._fader_group_mode_button = None
self._fader_group_midi_button = None
self._fader_group_mix_button = None
self._fader_group_fx_button = None
self._drum_group_midi_button = None
self._drum_group_roll_button = None
self._drum_group_hyper_button = None
self._mixer_for_encoders = None
self._mixer_for_faders = None
self._device_for_encoders = None
self._device_for_faders = None
self._transport = None
self._session = None
ControlSurface.disconnect(self)
self._send_midi(SYSEX_START + DISABLE_HYPERCONTROL)
def refresh_state(self):
ControlSurface.refresh_state(self)
self.schedule_message(5, self._send_midi, IDENTITY_REQUEST)
def handle_sysex(self, midi_bytes):
if midi_bytes[0:10] == AXIOM_AIR_RESPONSE:
if midi_bytes[12:15] < AXIOM_REV4_RESPONSE:
self.schedule_message(1, self._send_midi, SYSEX_START + ENGAGE_HYPERCONTROL)
self.schedule_message(2, self._send_midi, SYSEX_START + CLEAR_ALL)
self.schedule_message(3, self._name_display.display_message, "Firmware")
self.schedule_message(13, self._name_display.display_message, "Update")
self.schedule_message(23, self._name_display.display_message, "Required")
self.schedule_message(33, self._send_midi, SYSEX_START + DISABLE_HYPERCONTROL)
elif midi_bytes[12:15] >= AXIOM_REV4_RESPONSE:
if self._waiting_for_first_response == True:
self._waiting_for_first_response = False
self._has_faders = midi_bytes[10] != 50
self.schedule_message(1, self._send_midi, SYSEX_START + ENGAGE_HYPERCONTROL)
self.schedule_message(2, self._send_midi, SYSEX_START + SPECIAL_HYPERCONTROL)
self.schedule_message(3, self._complete_setup)
else:
self._display_reset_delay = 0
elif midi_bytes[0:8] == REQUEST_HYPERCONTROL:
self.schedule_message(5, self._send_midi, IDENTITY_REQUEST)
def update_display(self):
ControlSurface.update_display(self)
if self._display_reset_delay >= 0:
self._display_reset_delay -= 1
if self._display_reset_delay == -1:
self._set_displays_to_default()
def _on_selected_track_changed(self):
ControlSurface._on_selected_track_changed(self)
self._display_reset_delay = 0
def restore_bank(self, bank_index):
ControlSurface.restore_bank(self, bank_index)
if self._alt_device_component != None:
self._alt_device_component.restore_bank(bank_index)
def set_appointed_device(self, device):
示例3: Novation_Impulse
# 需要导入模块: from _Framework.PhysicalDisplayElement import PhysicalDisplayElement [as 别名]
# 或者: from _Framework.PhysicalDisplayElement.PhysicalDisplayElement import display_message [as 别名]
#.........这里部分代码省略.........
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):
if not value in range(128):
raise AssertionError
if self._mixer.is_enabled() and value > 0:
strip = self._mixer.channel_strip(self._strip_buttons.index(sender))
self._string_to_display = strip != None and None
self._name_display.segment(0).set_data_source(strip.track_name_data_source())
self._name_display.update()
self._display_reset_delay = STANDARD_DISPLAY_DELAY
else:
self._set_string_to_display(' - ')
def _preview_value(self, value):
raise value in range(128) or AssertionError
for encoder in self._encoders:
encoder.set_peek_mode(value > 0)
def _show_current_track_name(self):
if self._name_display != None and self._mixer != None:
self._string_to_display = None
self._name_display.segment(0).set_data_source(self._mixer.selected_strip().track_name_data_source())
self._name_display.update()
def _show_startup_message(self):
self._name_display.display_message('LIVE')
self._display_reset_delay = INITIAL_DISPLAY_DELAY
def _set_string_to_display(self, string_to_display):
raise isinstance(string_to_display, (str, unicode)) or AssertionError
self._name_display.segment(0).set_data_source(self._name_display_data_source)
self._string_to_display = string_to_display
self._display_reset_delay = STANDARD_DISPLAY_DELAY
def _on_selected_track_changed(self):
ControlSurface._on_selected_track_changed(self)
self._show_current_track_name()
all_tracks = self._has_sliders or 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
if not new_offset / num_strips == int(new_offset / num_strips):
raise AssertionError
self._session.set_offsets(new_offset, self._session.scene_offset())
示例4: Novation_Impulse2
# 需要导入模块: from _Framework.PhysicalDisplayElement import PhysicalDisplayElement [as 别名]
# 或者: from _Framework.PhysicalDisplayElement.PhysicalDisplayElement import display_message [as 别名]
#.........这里部分代码省略.........
self.select_armed_track_if_only_one()
def select_armed_track_if_only_one(self):
self.log("select_armed_track_if_only_one")
song = self.song()
armed_tracks = []
tracks = song.tracks
self.log("select_armed_track_if_only_one 2")
for track in tracks:
if track.can_be_armed and track.arm:
armed_tracks.append(track)
self.log(str(len(armed_tracks)))
if (len(armed_tracks) == 1):
self.log("selecting the track")
sel_track = armed_tracks[0]
self.song().view.selected_track = sel_track
self._mixer._selected_tracks = []
self._mixer._selected_tracks.append(sel_track)
self._mixer.on_selected_track_changed()
def _preview_value(self, value):
if not value in range(128):
raise AssertionError
for encoder in self._encoders:
encoder.set_peek_mode(value > 0)
def _show_current_track_name(self):
if self._name_display != None and self._mixer != None:
self._string_to_display = None
self._name_display.segment(0).set_data_source(self._mixer.selected_strip().track_name_data_source())
self._name_display.update()
def _show_startup_message(self):
self._name_display.display_message('LIVE')
self._display_reset_delay = INITIAL_DISPLAY_DELAY
def _set_string_to_display(self, string_to_display):
if not isinstance(string_to_display, (str, unicode)):
raise AssertionError
self._name_display.segment(0).set_data_source(self._name_display_data_source)
self._string_to_display = string_to_display
self._display_reset_delay = STANDARD_DISPLAY_DELAY
def _on_selected_track_changed(self):
self.log('_on_selected_track_changed')
ControlSurface._on_selected_track_changed(self)
self._show_current_track_name()
#all_tracks = self._has_sliders or self._session.tracks_to_use()
all_tracks2 = self._session.tracks_to_use()
selected_track = self.song().view.selected_track
num_strips = self._session.width()
if selected_track in all_tracks2:
track_index = list(all_tracks2).index(selected_track)
self.log('track_index '+ str(track_index))
new_offset = track_index - track_index % num_strips
self.log('new_offset '+ str(new_offset))
if not new_offset / num_strips == int(new_offset / num_strips):
raise AssertionError
self._session.set_offsets(new_offset, self._session.scene_offset())
def _shift_button_handler(self, value):
self.log("root shift handler : "+ str(value))
if not self._shift_button != None:
raise AssertionError
if not value in range(128):