Example #1
0
 def __init__(self,
              c_instance,
              macro_map_mode,
              volume_map_mode,
              device_controls,
              transport_controls,
              volume_controls,
              trackarm_controls,
              bank_controls,
              descriptions=None,
              mixer_options=None):
     self._GenericScript__c_instance = c_instance
     self._GenericScript__macro_map_mode = macro_map_mode
     self._GenericScript__volume_map_mode = volume_map_mode
     self._GenericScript__suggested_input_port = str('')
     self._GenericScript__suggested_output_port = str('')
     self._GenericScript__global_channel = 0
     self._GenericScript__pad_translation = ()
     if descriptions:
         if (list(descriptions.keys()).count('INPUTPORT') > 0):
             self._GenericScript__suggested_input_port = descriptions[
                 'INPUTPORT']
         if (list(descriptions.keys()).count('OUTPUTPORT') > 0):
             self._GenericScript__suggested_output_port = descriptions[
                 'OUTPUTPORT']
         if (list(descriptions.keys()).count('CHANNEL') > 0):
             self._GenericScript__global_channel = descriptions['CHANNEL']
             if (self._GenericScript__global_channel < 0):
                 self._GenericScript__global_channel = 0
         if (list(descriptions.keys()).count('PAD_TRANSLATION') > 0):
             self._GenericScript__pad_translation = descriptions[
                 'PAD_TRANSLATION']
     self._GenericScript__device = 0
     self._GenericScript__transport = 0
     self._GenericScript__mixer = 0
     if device_controls:
         self._GenericScript__device = GenericDeviceControl(
             self, device_controls, macro_map_mode, bank_controls)
     if transport_controls:
         self._GenericScript__transport = GenericTransportControl(
             self, transport_controls)
     if (volume_controls and trackarm_controls):
         self._GenericScript__mixer = GenericMixerControl(
             self, volume_controls, volume_map_mode, trackarm_controls,
             mixer_options)
     self.song().add_tracks_listener(self._GenericScript__on_tracks_changed)
     self._GenericScript__transport_controls = transport_controls
     self._GenericScript__trackarm_controls = trackarm_controls
     self._GenericScript__bank_controls = bank_controls
     self._GenericScript__volume_controls = volume_controls
     self._GenericScript__device_controls = device_controls