Beispiel #1
0
 def _create_transport(self):
     transport = TransportComponent(
         play_toggle_model_transform=(lambda v: v))
     transport.layer = Layer(
         record_button=(self._modified_start_stop_button),
         play_button=(self._start_stop_button))
     return transport
Beispiel #2
0
    def _init_transport_component(self, transport_controls, global_channel):

        def make_transport_button(control, name, is_momentary=True):
            return ButtonElement(is_momentary,
              MIDI_CC_TYPE,
              global_channel,
              (transport_controls[control]),
              name=name)

        if transport_controls:
            momentary_seek = 'NORELEASE' not in list(transport_controls.keys())
            layer_specs = {}
            for key, spec in iteritems(TRANSPORT_BUTTON_SPECIFICATIONS):
                key_upper = key.upper()
                if has_specification_for(key_upper, transport_controls):
                    layer_specs['{}_button'.format(spec.layer_name)] = make_transport_button(key_upper,
                      ('{}_Button'.format(spec.control_name)),
                      is_momentary=(momentary_seek if key in ('Rwd', 'Ffwd') else True))

            transport = TransportComponent(name='Transport')
            transport.layer = Layer(**layer_specs)