def _get_children_from_model(self): tracks_to_use = tracks_to_use_from_song(self._object) return [ (t.name, t) for t in tracks_to_use ]
def tracks_to_use(song): return list(tracks_to_use_from_song(song) + (song.master_track,))
def _update_all_stop_buttons(self): tracks = tracks_to_use_from_song(self.song())[self._track_offset:] self.stop_track_clips_buttons.control_count = len(tracks) for track, button in izip(tracks, self.stop_track_clips_buttons): self._update_stop_button(track, button)
def _on_tracks_changed(self): tracks = tracks_to_use_from_song(self.song()) self._track_offset = clamp(self._track_offset, 0, len(tracks) - 1) self._on_fired_slot_index_changed.replace_subjects(tracks, count()) self._on_playing_slot_index_changed.replace_subjects(tracks, count()) self._update_all_stop_buttons()
def _set_track_offset(self, value): if not 0 <= value < len(tracks_to_use_from_song(self.song())): raise IndexError self._track_offset = value self._update_all_stop_buttons()
def tracks_to_use(song): return list(tracks_to_use_from_song(song) + (song.master_track, ))