def __init__(self, parent, num_params=8, direct_bank=False, mono=True, shared=False, path=None, delayed_update=False, new_skin=False, *a, **k): self._parent = parent self._use_new_skin = new_skin self._mapper = None Framework_DeviceComponentBase.__init__(self, *a, **k) self._is_osc = hasattr(self._parent, '_osc_control') and self._parent._osc_control if not self._is_osc: g_hud = False self.log( 'DeviceComponent(STANDARD): num: ' + str(num_params) + ', path: ' + str(path) + ', HUD: ' + str(g_hud) + ', OSC: ' + str(self._is_osc), True) if g_mapper: PrEditorParameterProvider.__init__(self, parent) self.log('****** create mapper(STANDARD): path: ' + str(path), True) PrEditorMapper.__init__(self, PrEditorParameterProvider, path, num_params) DeviceComponentBase.__init__(self, parent, PrEditorMapper if g_mapper else None, False, num_params, direct_bank, mono, shared, path, delayed_update, new_skin) k.pop('feedback_mode', None) k.pop('lock_button', None) def make_hud_encoder(index, name): control = HUDControlElement(self, self._hud_state_control, i) control.name = name + '_' + str(i) return control def make_osc_encoder(index, name, osc_msg): control = OSCControlElement(self, self._parent.oscServer, i, osc_msg) control.name = name + '_' + str(i) return control if g_hud: self.log('Creating HUD notification', True) self._hud_state_control = NotifyingControlElement() self._hud_state_control.name = 'HUD_State' self._hud_controls = ButtonMatrixElement(rows=[[ make_osc_encoder(i, 'HUD_Control', '/hud') for i in xrange(8) ]]) self._hud_cs_controls = ButtonMatrixElement(rows=[[ make_osc_encoder(i, 'HUD_CS_Control', '/hudcs') for i in xrange(8) ]]) self._mono = mono for light in self.encoder_rings: light.enabled = True for light in self.device_select: light.enabled = False light.color = 'DefaultButton.Off' if self._mono else 'Device.NoDevice' light.disabled_color = 'DefaultButton.Off' if self._mono else 'Device.NoDevice' for light in self.device_enable: light.enabled = False light.color = 'DefaultButton.Off' if self._mono else 'Device.NoDevice' light.disabled_color = 'DefaultButton.Off' if self._mono else 'Device.NoDevice' for light in self.parameter_lights: light.enabled = False