Package _Framework :: Module ControlSurface :: Class ControlSurface
[hide private]
[frames] | no frames]

Class ControlSurface

source code

                       object --+            
                                |            
    Disconnectable.Disconnectable --+        
                                    |        
Disconnectable.CompoundDisconnectable --+    
                                        |    
                  SubjectSlot.SlotManager --+
                                            |
                                           ControlSurface

Central base class for scripts based on the new Framework. New scripts need to subclass this class and add special behavior.

Instance Methods [hide private]
 
__init__(self, c_instance, publish_self=True, *a, **k)
Define and Initialize standard behavior
source code
 
components(self) source code
 
enable_test_mode(self)
Acceptance tests should call this function before using the script, to ensure an appropriate testing state
source code
 
_get_tasks(self) source code
 
_tasks(self) source code
 
application(self)
Returns a reference to the application that we are running in
source code
 
song(self)
Returns a reference to the Live song instance that we control
source code
 
disconnect(self)
Live -> Script: Called right before we get disconnected from Live
source code
 
_control_surfaces(self)
Returns list of registered control surfaces
source code
 
can_lock_to_devices(self)
Live -> Script
source code
 
lock_to_device(self, device)
Live -> Script Live tells the script which device to control
source code
 
unlock_from_device(self, device)
Live -> Script Live tells the script to unlock from a certain device
source code
 
restore_bank(self, bank_index)
Live -> Script Live tells the script which bank to use.
source code
 
set_appointed_device(self, device)
Live -> Script Live tells the script to unlock from a certain device
source code
 
suggest_input_port(self)
Live -> Script: Live can ask for the name of the script's prefered input port
source code
 
suggest_output_port(self)
Live -> Script: Live can ask for the name of the script's prefered output port
source code
 
suggest_map_mode(self, cc_no, channel)
Live -> Script: Live can ask for a suitable mapping mode for a given CC
source code
 
suggest_needs_takeover(self, cc_no, channel)
Live -> Script: Live can ask whether a given CC needs takeover
source code
 
supports_pad_translation(self) source code
 
set_highlighting_session_component(self, session_component) source code
 
highlighting_session_component(self)
Return the session component showing the ring in Live session
source code
 
show_message(self, message)
Displays the given message in Live's status bar
source code
 
log_message(self, *message)
Writes the given message into Live's main log file
source code
 
instance_identifier(self) source code
 
connect_script_instances(self, instanciated_scripts)
Called by the Application as soon as all scripts are initialized.
source code
 
request_rebuild_midi_map(self)
Script -> Live.
source code
 
build_midi_map(self, midi_map_handle)
Live -> Script Build DeviceParameter Mappings, that are processed in Audio time, or forward MIDI messages explicitly to our receive_midi_functions.
source code
 
toggle_lock(self)
Script -> Live Use this function to toggle the script's lock on devices
source code
 
refresh_state(self)
Live -> Script Send out MIDI to completely update the attached MIDI controller.
source code
 
update(self) source code
 
update_display(self)
Live -> Script Aka on_timer.
source code
 
receive_midi(self, midi_bytes)
Live -> Script MIDI messages are only received through this function, when explicitly forwarded in 'build_midi_map'.
source code
 
is_sysex_message(self, midi_bytes) source code
 
_do_receive_midi(self, midi_bytes) source code
 
handle_nonsysex(self, midi_bytes) source code
 
handle_sysex(self, midi_bytes) source code
 
set_device_component(self, device_component) source code
 
suppressing_rebuild_requests(self)
Delays requesting a MIDI map rebuild, if any, until the scope of the context manager is exited.
source code
 
_set_suppress_rebuild_requests(self, suppress_requests) source code
 
set_pad_translations(self, pad_translations) source code
 
set_enabled(self, enable) source code
 
schedule_message(self, delay_in_ticks, callback, parameter=None)
Schedule a callback to be called after a specified time
source code
 
_process_remaining_scheduled_messages(self) source code
 
set_feedback_channels(self, channels) source code
 
set_controlled_track(self, track)
Sets the track that will send its feedback to the control surface
source code
 
_register_control(self, control)
puts control into the list of controls for triggering updates
source code
 
_register_component(self, component)
puts component into the list of controls for triggering updates
source code
 
component_guard(self)
Context manager that guards user code.
source code
 
in_component_guard(self) source code
 
setting_listener_caller(self) source code
 
_call_guarded_listener(self, listener) source code
 
accumulating_midi_messages(self) source code
 
_send_midi(self, midi_event_bytes, optimized=True)
Script -> Live Use this function to send MIDI events through Live to the _real_ MIDI devices that this script is assigned to.
source code
 
_flush_midi_messages(self) source code
 
_do_send_midi(self, midi_event_bytes) source code
 
_install_mapping(self, midi_map_handle, control, parameter, feedback_delay, feedback_map) source code
 
_install_forwarding(self, midi_map_handle, control) source code
 
_translate_message(self, type, from_identifier, from_channel, to_identifier, to_channel) source code
 
_set_session_highlight(self, track_offset, scene_offset, width, height, include_return_tracks) source code
 
_on_track_list_changed(self) source code
 
_on_scene_list_changed(self) source code
 
_on_selected_track_changed(self) source code
 
_on_selected_scene_changed(self) source code
 
_toggle_lock(self) source code
 
_refresh_displays(self)
Make sure the displays of the control surface display current data.
source code
 
_update_device_selection(self) source code

Inherited from SubjectSlot.SlotManager: register_slot, register_slot_manager

Inherited from Disconnectable.CompoundDisconnectable: disconnect_disconnectable, find_disconnectable, has_disconnectable, register_disconnectable, unregister_disconnectable

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, c_instance, publish_self=True, *a, **k)
(Constructor)

source code 

Define and Initialize standard behavior

Overrides: object.__init__

components(self)

source code 
Decorators:
  • @property

disconnect(self)

source code 

Live -> Script: Called right before we get disconnected from Live

Overrides: Disconnectable.Disconnectable.disconnect

lock_to_device(self, device)

source code 

Live -> Script Live tells the script which device to control

Decorators:
  • @_scheduled_method

unlock_from_device(self, device)

source code 

Live -> Script Live tells the script to unlock from a certain device

Decorators:
  • @_scheduled_method

restore_bank(self, bank_index)

source code 

Live -> Script Live tells the script which bank to use.

Decorators:
  • @_scheduled_method

set_appointed_device(self, device)

source code 

Live -> Script Live tells the script to unlock from a certain device

Decorators:
  • @_scheduled_method

connect_script_instances(self, instanciated_scripts)

source code 

Called by the Application as soon as all scripts are initialized. You can connect yourself to other running scripts here, as we do it connect the extension modules (MackieControlXTs).

request_rebuild_midi_map(self)

source code 

Script -> Live. When the internal MIDI controller has changed in a way that you need to rebuild the MIDI mappings, request a rebuild by calling this function This is processed as a request, to be sure that its not too often called, because its time-critical.

build_midi_map(self, midi_map_handle)

source code 

Live -> Script Build DeviceParameter Mappings, that are processed in Audio time, or forward MIDI messages explicitly to our receive_midi_functions. Which means that when you are not forwarding MIDI, nor mapping parameters, you will never get any MIDI messages at all.

refresh_state(self)

source code 

Live -> Script Send out MIDI to completely update the attached MIDI controller. Will be called when requested by the user, after for example having reconnected the MIDI cables...

update_display(self)

source code 

Live -> Script Aka on_timer. Called every 100 ms and should be used to update display relevant parts of the controller

suppressing_rebuild_requests(self)

source code 

Delays requesting a MIDI map rebuild, if any, until the scope of the context manager is exited.

Decorators:
  • @contextmanager

component_guard(self)

source code 

Context manager that guards user code. This prevents unnecesary updating and enables several optimisations. Should be used to guard calls to components or control elements.

Decorators:
  • @contextmanager

in_component_guard(self)

source code 
Decorators:
  • @property

setting_listener_caller(self)

source code 
Decorators:
  • @contextmanager

accumulating_midi_messages(self)

source code 
Decorators:
  • @contextmanager

_send_midi(self, midi_event_bytes, optimized=True)

source code 

Script -> Live Use this function to send MIDI events through Live to the _real_ MIDI devices that this script is assigned to.

When optimized=True it is assumed that messages can be dropped -- only the last message within an update for a given (channel, key) has visible effects.