def _on_selected_device_changed(self): selected_device = self._selected_track.view.selected_device if selected_device == None: self._set_current_node(self._make_exit_node()) return else: is_just_default_child_selection = False if self._current_node and self._current_node.children: selected = self.selected_object if isinstance(selected, Live.DrumPad.DrumPad) and is_first_device_on_pad( selected_device, selected): is_just_default_child_selection = True if isinstance( selected, Live.Chain.Chain ) and selected_device and selected_device.canonical_parent == selected and selected.devices[ 0] == selected_device: is_just_default_child_selection = True if not is_just_default_child_selection: target = selected_device and selected_device.canonical_parent if not self._current_node or self._current_node.object != target: node = self._make_navigation_node(target, is_entering=False) self._set_current_node(node) self._on_device_parameters_changed.subject = selected_device return
def _can_update_device_selection(self, new_selection): can_update = liveobj_valid(new_selection) if not self.is_drum_pad_selected: drum_pad_selected_or_requested = self._should_select_drum_pad() if can_update and drum_pad_selected_or_requested: if is_empty_rack(new_selection): can_update = False can_update = can_update and self.is_drum_pad_selected and not is_first_device_on_pad(new_selection, self._flattened_chain.selected_item) elif not can_update and not drum_pad_selected_or_requested: can_update = True return can_update
def _can_update_device_selection(self, new_selection): can_update = liveobj_valid(new_selection) drum_pad_selected_or_requested = self.is_drum_pad_selected or self._should_select_drum_pad() if can_update and drum_pad_selected_or_requested: if is_empty_rack(new_selection): can_update = False if can_update and self.is_drum_pad_selected: can_update = not is_first_device_on_pad(new_selection, self._flattened_chain.selected_item) else: if not can_update and not drum_pad_selected_or_requested: can_update = True return can_update
def _on_selected_device_changed(self): selected_device = self._selected_track.view.selected_device if selected_device == None: self._set_current_node(self._make_exit_node()) return is_just_default_child_selection = False if self._current_node and self._current_node.children: selected = self.selected_object if isinstance(selected, Live.DrumPad.DrumPad) and is_first_device_on_pad(selected_device, selected): is_just_default_child_selection = True if isinstance(selected, Live.Chain.Chain) and selected_device and selected_device.canonical_parent == selected and selected.devices[0] == selected_device: is_just_default_child_selection = True if not is_just_default_child_selection: target = selected_device and selected_device.canonical_parent if not self._current_node or self._current_node.object != target: node = self._make_navigation_node(target, is_entering=False) self._set_current_node(node)