Module src.backends.midiport.backend_controls
Provides TCP-based control interface for the midiport backend.
Implements non-blocking connect/reconnect and line-oriented command framing.
Class BackendControls
| backendcontrols:new () | Constructor. |
| backendcontrols:send_message (message, host, port) | Send a single line (with CRLF) to the MIDI-port server. |
| backendcontrols:disconnect () | Close the control TCP socket, if open. |
| backendcontrols:beginSong () | Begin song (Backtab binding). |
| backendcontrols:nextSong () | Next song (Enter binding). |
| backendcontrols:getHelp (_host, _port) | Return the pre-loaded MIDI-port help dump. |
Class BackendControls
BackendControls class.
- backendcontrols:new ()
-
Constructor. Called by scene.lua as:
backends.controls = require(...).new()Returns:
- backendcontrols:send_message (message, host, port)
-
Send a single line (with CRLF) to the MIDI-port server.
Parameters:
- message string Raw command (e.g. “gain 0.8”)
- host
string
TCP host (e.g. "localhost") - port
number
TCP port (e.g. 9800)
Returns:
-
boolean
True on success, false on failure
- backendcontrols:disconnect ()
-
Close the control TCP socket, if open.
Returns:
-
boolean
Always returns true
- backendcontrols:beginSong ()
- Begin song (Backtab binding). Pushes “clear” to track_control before starting.
- backendcontrols:nextSong ()
- Next song (Enter binding). Pushes “clear” to track_control before advancing.
- backendcontrols:getHelp (_host, _port)
-
Return the pre-loaded MIDI-port help dump.
Parameters:
- _host string (ignored)
- _port number (ignored)
Returns:
-
table
Array of help lines