本文整理汇总了Python中_Framework.ButtonSliderElement.ButtonSliderElement类的典型用法代码示例。如果您正苦于以下问题:Python ButtonSliderElement类的具体用法?Python ButtonSliderElement怎么用?Python ButtonSliderElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ButtonSliderElement类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
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
示例2: __init__
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
示例3: release_parameter
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
示例4: __init__
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
示例5: send_value
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
示例6: send_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
示例7: send_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
示例8: release_parameter
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()
示例9: connect_to
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()