예제 #1
0
 def _update_instruments(self):
     drum_group = find_drum_group_device(self.device_parent)
     simpler = find_sliced_simpler(self.device_parent)
     do_notify = liveobj_changed(drum_group, self._drum_group) or liveobj_changed(simpler, self._simpler)
     self._drum_group = drum_group
     self._simpler = simpler
     if do_notify:
         self.notify_instrument()
예제 #2
0
def select_clip_and_get_name_from_slot(clip_slot, song):
    if liveobj_valid(clip_slot):
        if song.view.highlighted_clip_slot != clip_slot:
            song.view.highlighted_clip_slot = clip_slot
        if clip_slot.has_clip and liveobj_changed(song.view.detail_clip, clip_slot.clip):
            song.view.detail_clip = clip_slot.clip
    return clip_name_from_clip_slot(clip_slot)
예제 #3
0
def select_clip_and_get_name_from_slot(clip_slot, song):
    if liveobj_valid(clip_slot):
        if song.view.highlighted_clip_slot != clip_slot:
            song.view.highlighted_clip_slot = clip_slot
        if clip_slot.has_clip and liveobj_changed(song.view.detail_clip, clip_slot.clip):
            song.view.detail_clip = clip_slot.clip
    return clip_name_from_clip_slot(clip_slot)
 def _on_selected_track_changed(self):
     super(TaggedSettingsComponent, self)._on_selected_track_changed()
     # debug('setting tagged to False')
     if liveobj_changed(self.song.view.selected_track, self._last_track):
         self._last_track = self.song.view.selected_track
         self._track_has_tagged_attribute = False
         self._read_attribute_tag()
예제 #5
0
	def _on_selected_track_changed(self):
		super(TaggedSettingsComponent, self)._on_selected_track_changed()
		#debug('setting tagged to False')
		if liveobj_changed(self.song.view.selected_track, self._last_track):
			self._last_track = self.song.view.selected_track
			self._track_has_tagged_attribute = False
			self._read_attribute_tag()
예제 #6
0
 def _is_drum_rack_selected(self):
     selected_item = self._flattened_chain.selected_item
     instrument = self._find_top_level_instrument()
     return liveobj_valid(selected_item) and isinstance(
         selected_item, Live.RackDevice.RackDevice
     ) and selected_item.can_have_drum_pads and not liveobj_changed(
         selected_item, instrument)
def find_decorated_object(proxied_object, decorator_factory):
    decorated_obj = None
    if liveobj_valid(proxied_object):
        decorated_obj = find_if(
            lambda obj: not liveobj_changed(obj.proxied_object, proxied_object
                                            ),
            decorator_factory.decorated_objects.itervalues())
    return decorated_obj
예제 #8
0
 def selected_mixer_track(self, track_or_chain):
     unwrapped_track = getattr(track_or_chain, 'proxied_object', track_or_chain)
     if liveobj_changed(self._selected_mixer_track, unwrapped_track):
         if isinstance(unwrapped_track, Live.Chain.Chain):
             self._view.selected_chain = unwrapped_track
             unwrapped_track.canonical_parent.view.selected_chain = unwrapped_track
         else:
             self._view.selected_track = unwrapped_track
예제 #9
0
 def set_detail_clip(self, clip):
     if liveobj_changed(clip, self._sequencer_clip):
         self._sequencer_clip = clip
         self._step_duplicator.set_clip(clip)
         if self.can_change_page:
             self.set_selected_page_point(0)
         self._on_clip_notes_changed.subject = clip
         self._on_clip_notes_changed()
 def focus_object(self, obj):
     if obj != self.get_zoom_object():
         identifier = self.get_object_identifier(obj)
         if identifier in self.focusable_object_connections:
             connection = self.focusable_object_connections[identifier]
             animate = liveobj_changed(self._focused_object, obj)
             self._focused_object = obj
             self._focus_connection(connection, animate=animate)
             return True
     return False
 def focus_object(self, obj):
     if obj != self.get_zoom_object():
         identifier = self.get_object_identifier(obj)
         if identifier in self.focusable_object_connections:
             connection = self.focusable_object_connections[identifier]
             animate = liveobj_changed(self._focused_object, obj)
             self._focused_object = obj
             self._focus_connection(connection, animate=animate)
             return True
     return False
예제 #12
0
 def selected_mixer_track(self, track_or_chain):
     unwrapped_track = getattr(track_or_chain, 'proxied_object', track_or_chain)
     if liveobj_changed(self._selected_mixer_track, unwrapped_track):
         if isinstance(unwrapped_track, Live.Chain.Chain):
             self._view.selected_chain = unwrapped_track
             instruments = list(find_instrument_devices(self._view.selected_track))
             if instruments:
                 instruments[0].view.selected_chain = unwrapped_track
         else:
             self._view.selected_track = unwrapped_track
 def set_detail_clip(self, clip):
     if liveobj_changed(clip, self._sequencer_clip):
         self._is_following = liveobj_valid(clip) and (self._is_following or clip_is_new_recording(clip))
         self._on_playing_position_changed.subject = clip
         self._on_playing_status_changed.subject = clip
         self._on_loop_start_changed.subject = clip
         self._on_loop_end_changed.subject = clip
         self._on_is_recording_changed.subject = clip
         self._sequencer_clip = clip
         self._select_start_page_if_out_of_loop_range()
         self._on_loop_changed()
 def set_parameter_host(self, parameter_host):
     new_parameter_host = parameter_host if is_simpler(parameter_host) else None
     if liveobj_changed(self._parameter_host, new_parameter_host):
         old_zoom = self.zoom
         self._parameter_host = new_parameter_host
         with self._updating_zoom_scaling():
             self._set_zoom_parameter()
         self._on_zoom_changed.subject = self._zoom_parameter
         self._on_sample_changed.subject = self._parameter_host
         if self.zoom != old_zoom:
             self.notify_zoom()
 def set_parameter_host(self, parameter_host):
     new_parameter_host = parameter_host if is_simpler(parameter_host) else None
     if liveobj_changed(self._parameter_host, new_parameter_host):
         old_zoom = self.zoom
         self._parameter_host = new_parameter_host
         with self._updating_zoom_scaling():
             self._set_zoom_parameter()
         self._on_zoom_changed.subject = self._zoom_parameter
         self._on_sample_changed.subject = self._parameter_host
         if self.zoom != old_zoom:
             self.notify_zoom()
예제 #16
0
 def set_detail_clip(self, clip):
     if liveobj_changed(clip, self._sequencer_clip):
         self.is_following = liveobj_valid(clip) and (self.is_following or clip_is_new_recording(clip))
         self._on_playing_position_changed.subject = clip
         self._on_playing_status_changed.subject = clip
         self._on_loop_start_changed.subject = clip
         self._on_loop_end_changed.subject = clip
         self._on_is_recording_changed.subject = clip
         self._sequencer_clip = clip
         self._step_duplicator.set_clip(clip)
         self._on_loop_changed()
예제 #17
0
 def object(self, obj):
     if liveobj_changed(self._object, obj):
         self._object = obj
         if obj is None:
             notification = self._notification_ref()
             if notification:
                 notification.hide()
             self.set_enabled(False)
         else:
             self._render_color_palette(translate_color_index(obj.color_index))
             self.set_enabled(True)
             self._notification_ref = self.show_notification('Select a color for: %s' % obj.name, notification_time=-1)
예제 #18
0
 def object(self, obj):
     if liveobj_changed(self._object, obj):
         self._object = obj
         if obj is None:
             notification = self._notification_ref()
             if notification:
                 notification.hide()
             self.set_enabled(False)
         else:
             self._render_color_palette(translate_color_index(obj.color_index))
             self.set_enabled(True)
             self._notification_ref = self.show_notification(u'Select a color for: %s' % obj.name, notification_time=-1)
예제 #19
0
 def device_changed(self, device):
     current_device = getattr(self.device(), '_live_object', self.device())
     return liveobj_changed(current_device, device) and (
         not self._locked_to_device
         or current_device.canonical_parent == device.canonical_parent)
 def _set_selected_item(self, device):
     if liveobj_changed(self._selected_item, device):
         self._selected_item = device
         self.notify_selected_item()
예제 #21
0
 def _set_selected_child_in_model(self, value):
     if liveobj_valid(value) and liveobj_changed(self._object.view.selected_chain, value):
         self._object.view.selected_chain = value
예제 #22
0
 def _set_selected_child_in_model(self, value):
     if liveobj_valid(value) and liveobj_changed(
             self._object.view.selected_chain, value):
         self._object.view.selected_chain = value
 def set_data(self, data):
     if liveobj_changed(data, self._data):
         self._data = data
         self.invalidate()
예제 #24
0
 def device_changed(self, device):
     current_device = getattr(self.device(), b'_live_object', self.device())
     return liveobj_changed(current_device, device)
예제 #25
0
 def _on_selected_mixer_track_changed(self):
     selected_mixer_track = self._get_selected_chain_or_track()
     if liveobj_changed(self._selected_mixer_track, selected_mixer_track):
         self._selected_mixer_track = selected_mixer_track
         self.notify_selected_mixer_track(self.selected_mixer_track)
예제 #26
0
def find_decorated_object(proxied_object, decorator_factory):
    decorated_obj = None
    if liveobj_valid(proxied_object):
        decorated_obj = find_if(lambda obj: not liveobj_changed(obj.proxied_object, proxied_object), decorator_factory.decorated_objects.itervalues())
    return decorated_obj
예제 #27
0
 def _is_drum_rack_selected(self):
     selected_item = self._flattened_chain.selected_item
     instrument = self._find_top_level_instrument()
     return liveobj_valid(selected_item) and isinstance(selected_item, Live.RackDevice.RackDevice) and selected_item.can_have_drum_pads and not liveobj_changed(selected_item, instrument)
예제 #28
0
 def _on_selected_item_changed(self, _):
     if liveobj_changed(self._selected_item_when_item_artificially_selected,
                        self.song.view.selected_track):
         self._artificially_selected_item = None
     self.notify_selected_item()
     return
예제 #29
0
 def _set_device_parent(self, device_parent):
     if liveobj_changed(self._device_parent, device_parent):
         self._device_parent = device_parent
         self.update()
 def _device_changed(self, device):
     current_device = getattr(self._device, '_live_object', self._device)
     return not self._locked_to_device and liveobj_changed(current_device, device)
예제 #31
0
	def device(self, device):
		#debug('provider device_setter:', device)
		if liveobj_changed(self._device, device):
			self._device = device
			self.notify_device()
 def _device_changed(self, device):
     current_device = getattr(self._device, '_live_object', self._device)
     return not self._locked_to_device and liveobj_changed(
         current_device, device)
예제 #33
0
 def _select_mixable(self, track):
     if liveobj_valid(track) and liveobj_changed(
             self._track_provider.selected_item, track):
         self._track_provider.selected_item = track
 def set_data(self, data):
     if liveobj_changed(data, self._data):
         self._data = data
         self.invalidate()
 def _content_cache_is_valid(self):
     return self._content_filter_type == self._browser.filter_type and not liveobj_changed(self._content_hotswap_target, self._browser.hotswap_target)
예제 #36
0
 def _set_selected_item(self, device):
     if liveobj_changed(self._selected_item, device):
         self._selected_item = device
         self.notify_selected_item()
 def _content_cache_is_valid(self):
     return self._content_filter_type == self._browser.filter_type and not liveobj_changed(self._content_hotswap_target, self._browser.hotswap_target)
예제 #38
0
 def _ensure_track_selection_history_is_synced(self):
     if liveobj_changed(self._currently_selected_track, self._song.view.selected_track):
         self._previously_selected_track = self._currently_selected_track
         self._currently_selected_track = self._song.view.selected_track
예제 #39
0
 def device(self, device):
     #debug('provider device_setter:', device)
     if liveobj_changed(self._device, device):
         self._device = device
         self.notify_device()
 def _device_changed(self, device):
     current_device = getattr(self.device(), "_live_object", self.device())
     return liveobj_changed(current_device, device)