def __init__(self, buttons): ButtonSliderElement.__init__(self, buttons) num_buttons = len(buttons) self._disabled = False self._mode = SLIDER_MODE_VOLUME self._value_map = tuple( [float(index / num_buttons) for index in range(num_buttons)])
def __init__(self, buttons, parent): ButtonSliderElement.__init__(self, buttons) self._num_buttons = len(buttons) self._value_map = tuple([float(index) / (self._num_buttons-1) for index in range(self._num_buttons)]) self._precision_mode = False self._parent = parent self._enabled = True
def __init__(self, buttons, control_surface, parent = None): ButtonSliderElement.__init__(self, buttons) self._control_surface = control_surface self._parent = parent self._num_buttons = len(buttons) self._value_map = tuple([float(index) / (self._num_buttons-1) for index in range(self._num_buttons)]) self._precision_mode = False self._enabled = True
def __init__(self, buttons): ButtonSliderElement.__init__(self, buttons) num_buttons = len(buttons) self._disabled = False self._mode = SLIDER_MODE_VOLUME self._value_map = tuple([ float((index / num_buttons)) for index in range(num_buttons) ]) self._parent = None self._precision_mode = False
def release_parameter(self): old_param = self._parameter_to_map_to ButtonSliderElement.release_parameter(self) if not self._disabled and old_param != None: for button in self._buttons: button.reset() return
def __init__(self, buttons, control_surface, parent = None): ButtonSliderElement.__init__(self, buttons) self._control_surface = control_surface self._skin = self._control_surface._skin self._parent = parent self._num_buttons = len(buttons) self._value_map = tuple([float(index) / (self._num_buttons-1) for index in range(self._num_buttons)]) self._precision_mode = False self._enabled = True
def send_value(self, value): assert self._disabled or value != None assert isinstance(value, int) assert value in range(128) if value != self._last_sent_value: if self._mode == SLIDER_MODE_SINGLE: ButtonSliderElement.send_value(self, value) elif self._mode == SLIDER_MODE_VOLUME: self._send_value_volume(value) elif self._mode == SLIDER_MODE_PAN: self._send_value_pan(value) else: assert False self._last_sent_value = value
def send_value(self, value): if (not self._disabled): assert (value != None) assert isinstance(value, int) assert (value in range(128)) if (value != self._last_sent_value): if (self._mode == SLIDER_MODE_SINGLE): ButtonSliderElement.send_value(self, value) elif (self._mode == SLIDER_MODE_VOLUME): self._send_value_volume(value) elif (self._mode == SLIDER_MODE_PAN): self._send_value_pan(value) else: assert False self._last_sent_value = value
def send_value(self, value): raise self._disabled or value != None or AssertionError raise isinstance(value, int) or AssertionError if not value in range(128): raise AssertionError if value != self._last_sent_value: if self._mode == SLIDER_MODE_SINGLE: ButtonSliderElement.send_value(self, value) elif self._mode == SLIDER_MODE_VOLUME: self._send_value_volume(value) elif self._mode == SLIDER_MODE_PAN: self._send_value_pan(value) else: raise False or AssertionError self._last_sent_value = value
def release_parameter(self): old_param = self._parameter_to_map_to ButtonSliderElement.release_parameter(self) if ((not self._disabled) and (old_param != None)): for button in self._buttons: button.reset()
def connect_to(self, parameter): ButtonSliderElement.connect_to(self, parameter) if (self._parameter_to_map_to != None): self._last_sent_value = -1 self._on_parameter_changed()
def connect_to(self, parameter): ButtonSliderElement.connect_to(self, parameter) if self._parameter_to_map_to != None: self._last_sent_value = -1 self._on_parameter_changed()