File Duplex/Device.lua

Functions

Device:__init (name, message_stream, protocol) Initialize the Device class
Device:__tostring ()
Device:_build_settings () Construct the device settings view (for both MIDI and OSC devices)
Device:_send_message (message, xarg) Construct & send internal messages (for both MIDI and OSC devices)
Device:get_protocol () Retrieve the protocol of this device
Device:point_to_value () Convert a display/canvas point to an actual value, ready for output (always overridden with device-specific implementation, as the device will use MIDI or OSC-specific features at this stage)
Device:quantize_color (color, colorspace) Function for quantizing RGB color values to a device color-space
Device:set_control_map (xml_file) Set the device to the provided control-map
Device:show_settings_dialog (process) Open the device settings dialog


Functions

Device:__init (name, message_stream, protocol)
Initialize the Device class

Parameters:

  • name: (String) the 'friendly name' of the device
  • message_stream: (MessageStream)
  • protocol: (Enum), the protocol, e.g. DEVICE_MIDI_PROTOCOL
Device:__tostring ()
Device:_build_settings ()
Construct the device settings view (for both MIDI and OSC devices)

Return value:

    ViewBuilder
Device:_send_message (message, xarg)
Construct & send internal messages (for both MIDI and OSC devices)

Parameters:

  • message: (Message) the message to send
  • xarg: (Table) parameter attributes
Device:get_protocol ()
Retrieve the protocol of this device

Return value:

    (Enum) communication protocol, e.g. DEVICE_MIDI_PROTOCOL
Device:point_to_value ()
Convert a display/canvas point to an actual value, ready for output (always overridden with device-specific implementation, as the device will use MIDI or OSC-specific features at this stage)
Device:quantize_color (color, colorspace)
Function for quantizing RGB color values to a device color-space

Parameters:

  • color: (Number), table containing RGB colors
  • colorspace: (Number), table containing colorspace

Return value:

    (Table), the quantized color
Device:set_control_map (xml_file)
Set the device to the provided control-map

Parameters:

  • xml_file: (String) path to file
Device:show_settings_dialog (process)
Open the device settings dialog

Parameters:

  • process: (BrowserProcess)

Valid XHTML 1.0!