File Duplex/MessageStream.lua

Functions

Message:__init (device) Initialize Message class
Message:__tostring () Print message (for debugging purposes)
MessageStream:__init (process) Initialize the MessageStream class
MessageStream:_get_button_hold_time () Retrieve the button hold time from the global preferences
MessageStream:_handle_events (msg, listeners) Loop through listeners, invoke event handler methods
MessageStream:_handle_or_pass (msg, listeners) Handle or pass: invoke event handlers or pass on to Renoise as MIDI (only valid msg context is MIDI_NOTE_MESSAGE)
MessageStream:add_listener (obj, evt_type, handler) Add an event listener (used by UIComponents)
MessageStream:input_message (msg) Here we receive a message from the device, and pass it to all the relevant UIComponents.
MessageStream:on_idle () The MessageStream idle time method, checks for held buttons
MessageStream:remove_listener (obj, evt_type) Remove event listener from previously attached UIComponent


Functions

Message:__init (device)
Initialize Message class

Parameters:

  • device: (Device)
Message:__tostring ()
Print message (for debugging purposes)
MessageStream:__init (process)
Initialize the MessageStream class

Parameters:

  • process: (BrowserProcess) reference to BrowserProcess
MessageStream:_get_button_hold_time ()
Retrieve the button hold time from the global preferences

Return value:

    Number
MessageStream:_handle_events (msg, listeners)
Loop through listeners, invoke event handler methods

Parameters:

  • msg: (Message)
  • listeners: (Table)

Return value:

    boolean, true when message was handled, false if handler didn't exist, or (any) handler actively rejected the message
MessageStream:_handle_or_pass (msg, listeners)
Handle or pass: invoke event handlers or pass on to Renoise as MIDI (only valid msg context is MIDI_NOTE_MESSAGE)

Parameters:

  • msg: (Message)
  • listeners: (Table), listener methods
MessageStream:add_listener (obj, evt_type, handler)
Add an event listener (used by UIComponents)

Parameters:

  • obj: (UIComponent) the UIComponent instance
  • evt_type: (Enum) event type, e.g. DEVICE_EVENT_BUTTON_PRESSED
  • handler: (Function) reference to the handling method
MessageStream:input_message (msg)
Here we receive a message from the device, and pass it to all the relevant UIComponents. If a listener's handler method actively reject the message (by explicitly returning false in the event-handling method), we instead (can choose to) pass the message on to Renoise as a MIDI message

Parameters:

  • msg: (Message)
MessageStream:on_idle ()
The MessageStream idle time method, checks for held buttons
MessageStream:remove_listener (obj, evt_type)
Remove event listener from previously attached UIComponent

Parameters:

  • obj: (UIComponent) the UIComponent instance
  • evt_type: (Enum) event type, e.g. DEVICE_EVENT_BUTTON_PRESSED

Return value:

    (Boolean) true if successfull. false if not

Valid XHTML 1.0!