def __init__(self, c_instance, publish_self=True, *a, **k): """ Define and Initialize standard behavior """ super(ControlSurface, self).__init__(*a, **k) self.canonical_parent = None if publish_self: if isinstance(__builtins__, dict): if CS_LIST_KEY not in __builtins__.keys(): __builtins__[CS_LIST_KEY] = [] __builtins__[CS_LIST_KEY].append(self) else: if not hasattr(__builtins__, CS_LIST_KEY): setattr(__builtins__, CS_LIST_KEY, []) cs_list = getattr(__builtins__, CS_LIST_KEY) cs_list.append(self) setattr(__builtins__, CS_LIST_KEY, cs_list) self._c_instance = c_instance self._pad_translations = None self._suggested_input_port = str('') self._suggested_output_port = str('') self._components = [] self._displays = [] self.controls = [] self._highlighting_session_component = None self._device_component = None self._device_selection_follows_track_selection = False self._forwarding_long_identifier_registry = {} self._forwarding_registry = {} self._is_sending_scheduled_messages = BooleanContext() self._remaining_scheduled_messages = [] self._task_group = Task.TaskGroup(auto_kill=False) self._in_build_midi_map = BooleanContext() self._suppress_requests_counter = 0 self._rebuild_requests_during_suppression = 0 self._enabled = True self._in_component_guard = BooleanContext() self._accumulate_midi_messages = BooleanContext() self._midi_message_dict = {} self._midi_message_list = [] self._midi_message_count = 0 self._control_surface_injector = inject( parent_task_group=const(self._task_group), show_message=const(self.show_message), register_component=const(self._register_component), register_control=const(self._register_control), request_rebuild_midi_map=const(self.request_rebuild_midi_map), send_midi=const(self._send_midi), song=self.song).everywhere() with self.setting_listener_caller(): self.song().add_visible_tracks_listener( self._on_track_list_changed) self.song().add_scenes_listener(self._on_scene_list_changed) self.song().view.add_selected_track_listener( self._on_selected_track_changed) self.song().view.add_selected_scene_listener( self._on_selected_scene_changed)
def __init__(self, c_instance=None, publish_self=True, *a, **k): """ Define and Initialize standard behavior """ super(ControlSurface, self).__init__(*a, **k) if not c_instance: raise AssertionError self.canonical_parent = None publish_self and publish_control_surface(self) self._c_instance = c_instance self.log_message('Initialising...') self._pad_translations = None self._suggested_input_port = str('') self._suggested_output_port = str('') self._components = [] self._displays = [] self.controls = [] self._highlighting_session_component = None self._device_component = None self._device_selection_follows_track_selection = False self._forwarding_long_identifier_registry = {} self._forwarding_registry = {} self._is_sending_scheduled_messages = BooleanContext() self._remaining_scheduled_messages = [] self._task_group = Task.TaskGroup(auto_kill=False) self._in_build_midi_map = BooleanContext() self._suppress_requests_counter = 0 self._rebuild_requests_during_suppression = 0 self._enabled = True self._in_component_guard = BooleanContext() self._accumulate_midi_messages = BooleanContext() self._midi_message_dict = {} self._midi_message_list = [] self._midi_message_count = 0 self._control_surface_injector = inject( parent_task_group=const(self._task_group), show_message=const(self.show_message), log_message=const(self.log_message), register_component=const(self._register_component), register_control=const(self._register_control), request_rebuild_midi_map=const(self.request_rebuild_midi_map), send_midi=const(self._send_midi), song=self.song).everywhere() with self.setting_listener_caller(): self.song().add_visible_tracks_listener( self._on_track_list_changed) self.song().add_scenes_listener(self._on_scene_list_changed) self.song().view.add_selected_track_listener( self._on_selected_track_changed) self.song().view.add_selected_scene_listener( self._on_selected_scene_changed) return
def __init__(self, *a, **k): super(CompoundElement, self).__init__(*a, **k) resource = self.resource original_grab_resource = resource.grab original_release_resource = resource.release def grab_resource(client, **k): self._grab_nested_control_elements(client, **k) original_grab_resource(client, **k) def release_resource(client): original_release_resource(client) self._release_nested_control_elements(client) self.resource.grab = grab_resource self.resource.release = release_resource self._nested_control_elements = dict() self._nested_element_clients = dict() self._disable_notify_owner_on_button_ownership_change = BooleanContext( ) self._listen_nested_requests = 0
def __init__(self, *a, **k): super(CompoundElement, self).__init__(*a, **k) self._nested_control_elements = dict() self._disable_notify_owner_on_button_ownership_change = BooleanContext( ) self._listen_nested_requests = 0