def __init__(self, *a, **k): super(AutoArmComponent, self).__init__(*a, **k) self._auto_arm_restore_behaviour = None self._notification = self.register_component(NotificationComponent(notification_time=10.0)) self._on_tracks_changed.subject = self.song() self._on_exclusive_arm_changed.subject = self.song() self._on_tracks_changed()
def __init__(self, playing_clip_above_layer=None, playing_clip_below_layer=None, *a, **k): super(SelectPlayingClipComponent, self).__init__(*a, **k) self._update_mode_task = self._tasks.add( Task.sequence(Task.delay(1), Task.run(self._update_mode))) self._update_mode_task.kill() self._notification = self.register_component( NotificationComponent(notification_time=-1, is_enabled=False)) self.add_mode('default', None) self.add_mode('above', [ AddLayerMode(self, playing_clip_above_layer), self._notification, partial(self._show_notification, MessageBoxText.PLAYING_CLIP_ABOVE_SELECTED_CLIP) ]) self.add_mode('below', [ AddLayerMode(self, playing_clip_below_layer), self._notification, partial(self._show_notification, MessageBoxText.PLAYING_CLIP_BELOW_SELECTED_CLIP) ]) self.selected_mode = 'default' self._on_detail_clip_changed.subject = self.song().view self._on_playing_slot_index_changed.subject = self.song( ).view.selected_track