Module Duplex.Display

The Display is the base class for device displays and the virtual UI

Display performs many duties; it manages UIComponents, as it will both send and recieve their messages, and take care of their visual updates on the idle time update.

The Display will also build the control surface, an interactive representation of the device complete with native sliders, knobs etc.

Changes

0.99.4

- "skip_echo" is checked here, no more need to do so in output_value()

0.99.3

- "soft_echo", will update the hardware only when a message is _not_
  the result of a user action (a.k.a. a virtual event)

0.99

- Refactored 'UI widget' code into it's own Widget* classes

0.98

- First release

Functions

__init (process) Initialize the Display class
add (obj_instance) Register a UIComponent with this display
clear () Clear display, force update of all UI components
apply_tooltips (group_name) Apply tooltips to UIComponents, based on their "tooltip" property
apply_midi_mappings (group_name) Apply MIDI mappings to UIComponents, based on the "midi_mapping" property
apply_to_objects (group_name, callback) Apply callback function to UIComponents, using wildcard syntax (e.g.
set_active_state (state, group_name) Disable an entire section of the display (the enabled state of individual UIComponent is not affected)
apply_to_groups (group_name, callback) Apply callback function to groups (e.g.
get_group_dimensions (group_name) figure out the physical dimensions of a given group
update (foo) Update any UIComponent that has been modified since the last update (called continously)
set_parameter (param, ui_obj, point, skip_ui) Set_parameter: apply parameter changes, update the display
build_control_surface () Build the virtual control-surface (based on the parsed control-map)
generate_message (value, param, released) Generate messages for the virtual control-surface (creates a Duplex.Message which is then passed into a Duplex.MessageStream).
_walk_table (t, done, deep) Walk control-map defition, and create the virtual control surface
_validate_group (xarg) Validate/fix groups and try to give the control map author some hints of what might be wrong with the control map

Tables

canvas_background (table) define the visual appearance of 'empty space', used e.g.

Fields

self.process (Duplex.BrowserProcess)
self.device (Duplex.Device)
self.vb (renoise.ViewBuilder)
self.view (renoise.Views.View)
self.ui_objects (table) associated UIComponent instances
self.ui_notifiers (table) each UI object notifier method is referenced by id, so we can attach/detach the method on the fly (this is done when we need to change the UI Object's value)
self.scheduler (cScheduler) perform periodic updates
self.state_ctrl (Duplex.StateController) handle display states (this is added immediately after initializing the Display, as we need a valid reference to ourselves - search for "StateApplication")


Functions

__init (process)
Initialize the Display class

Parameters:

add (obj_instance)
Register a UIComponent with this display

Parameters:

clear ()
Clear display, force update of all UI components
apply_tooltips (group_name)
Apply tooltips to UIComponents, based on their "tooltip" property

Parameters:

  • group_name [opt] (string or nil), e.g. "Pads1" or "Pads*" (leave out to match all)
apply_midi_mappings (group_name)
Apply MIDI mappings to UIComponents, based on the "midi_mapping" property

Parameters:

  • group_name [opt] (string or nil), e.g. "Pads1" or "Pads*" (leave out to match all)
apply_to_objects (group_name, callback)
Apply callback function to UIComponents, using wildcard syntax (e.g. for specifying tooltips, midi mappings etc.)

Parameters:

  • group_name [opt] (string or nil), e.g. "Pads1" or "Pads*" (leave out to match all)
  • callback (func) function to apply to matched components
set_active_state (state, group_name)
Disable an entire section of the display (the enabled state of individual UIComponent is not affected)

Parameters:

  • state (bool) enabled when true, disabled when false
  • group_name [opt] (string or nil), leave out to match all [[
apply_to_groups (group_name, callback)
Apply callback function to groups (e.g. for quickly disabling entire, or partial display)

Parameters:

  • group_name [opt] (string or nil), leave out to match all
  • callback (func) function to apply to matched groups
get_group_dimensions (group_name)
figure out the physical dimensions of a given group

Parameters:

  • group_name (string) control-map group name

Returns:

  1. width (int)
  2. height (int) [[
update (foo)
Update any UIComponent that has been modified since the last update (called continously)

Parameters:

  • foo TRACE("* Display.update",foo)
set_parameter (param, ui_obj, point, skip_ui)
Set_parameter: apply parameter changes, update the display

Parameters:

build_control_surface ()
Build the virtual control-surface (based on the parsed control-map)

Returns:

    renoise.Views.View
generate_message (value, param, released)
Generate messages for the virtual control-surface (creates a Duplex.Message which is then passed into a Duplex.MessageStream).

Similar to Duplex.Device._send_message, except that here we need to create everything (value, midi message, etc.) from scratch

Parameters:

  • value (number or table) value, or table of values
  • param (table) Param node attributes, see Duplex.ControlMap
  • released (bool), true when button has been released
_walk_table (t, done, deep)
Walk control-map defition, and create the virtual control surface

Parameters:

  • t (table) the control-map defition
  • done (table) internal calculation table
  • deep (int) the nesting level
_validate_group (xarg)
Validate/fix groups and try to give the control map author some hints of what might be wrong with the control map

Parameters:

  • xarg (table) the control-map attributes

Tables

canvas_background
(table) define the visual appearance of 'empty space', used e.g. when we remove a given point due to resizing

Fields:

  • text (string)
  • color (table)
  • val (bool)

Fields

self.process
(Duplex.BrowserProcess)
self.device
(Duplex.Device)
self.vb
(renoise.ViewBuilder)
self.view
(renoise.Views.View)
self.ui_objects
(table) associated UIComponent instances
self.ui_notifiers
(table) each UI object notifier method is referenced by id, so we can attach/detach the method on the fly (this is done when we need to change the UI Object's value)
self.scheduler
(cScheduler) perform periodic updates
self.state_ctrl
(Duplex.StateController) handle display states (this is added immediately after initializing the Display, as we need a valid reference to ourselves - search for "StateApplication")
generated by LDoc 1.4.2