Exemple #1
0
 def _init_browse_mode(self):
     self._main_modes.add_mode(
         u'browse', [
             self._when_track_is_not_frozen(
                 self._enable_stop_mute_solo_as_modifiers,
                 partial(self._view_control.show_view, u'Browser'),
                 self._browser_back_to_top, self._browser_hotswap_mode,
                 self._browser_mode, self._browser_reset_load_memory)
         ],
         groups=[u'add_effect', u'add_track', u'browse'],
         behaviour=mixin(DynamicBehaviourMixin, CancellableBehaviour)(
             lambda: not self._browser_hotswap_mode._mode.can_hotswap(
             ) and u'add_effect_left'))
     self._main_modes.add_mode(
         u'add_effect_right', [
             self._when_track_is_not_frozen(
                 self._enable_stop_mute_solo_as_modifiers,
                 self._browser_back_to_top,
                 LazyEnablingMode(self._create_create_device_right))
         ],
         behaviour=mixin(ExcludingBehaviourMixin,
                         CancellableBehaviour)([u'add_track', u'browse']),
         groups=[u'add_effect'])
     self._main_modes.add_mode(
         u'add_effect_left', [
             self._when_track_is_not_frozen(
                 self._enable_stop_mute_solo_as_modifiers,
                 self._browser_back_to_top,
                 LazyEnablingMode(self._create_create_device_left))
         ],
         behaviour=mixin(ExcludingBehaviourMixin,
                         CancellableBehaviour)([u'add_track', u'browse']),
         groups=[u'add_effect'])
     self._main_modes.add_mode(
         u'add_instrument_track', [
             self._enable_stop_mute_solo_as_modifiers,
             self._browser_back_to_top,
             LazyEnablingMode(self._create_create_instrument_track)
         ],
         behaviour=mixin(ExcludingBehaviourMixin, AlternativeBehaviour)(
             excluded_groups=[u'browse', u'add_effect'],
             alternative_mode=u'add_default_track'),
         groups=[u'add_track'])
     self._main_modes.add_mode(u'add_default_track', [
         self._enable_stop_mute_solo_as_modifiers,
         self._browser_back_to_top,
         LazyEnablingMode(self._create_create_default_track)
     ],
                               groups=[u'add_track'])
     self._main_modes.add_effect_right_button.mode_unselected_color = self._main_modes.add_effect_left_button.mode_unselected_color = self._main_modes.add_instrument_track_button.mode_unselected_color = u'DefaultButton.On'
Exemple #2
0
 def __init__(self, create_browser=nop, *a, **k):
     super(BrowserMode,
           self).__init__(LazyEnablingMode(create_browser), *a, **k)
 def __init__(self, create_browser=nop, scales_enabler=None, *a, **k):
     (super(BrowserMode, self).__init__)(LazyEnablingMode(create_browser),
                                         *a, **k)
     self._scales_enabler = scales_enabler