Module src.backends
Central backend loader and manager.
Detects available backends, issues warnings on fallback, and launches the active‐notes tracking thread.
Functions
setup (backendName) | Configure which backend to use (must be called once at startup). |
start () | Start (or restart) the backend’s active‐notes thread. |
Fields
thread | Thread handle for the active‐notes tracker. |
name | Name of the selected backend (directory under src/backends ). |
controls | Controls API for the selected backend. |
commandMenu | Command‐menu API for the selected backend. |
fallbackMessage | Human‐readable warnings aggregated during setup. |
Functions
- setup (backendName)
-
Configure which backend to use (must be called once at startup).
Verifies the backend directory exists, checks for winpty on Windows,
and loads the corresponding controls and
command_menu
modules. Any warnings are concatenated intoM.fallbackMessage
.Parameters:
- backendName string Name of the desired backend (or empty to use null)
Returns:
-
table
The backend manager table (
M
) - start ()
-
Start (or restart) the backend’s active‐notes thread.
Spawns
track_active_notes_thread.lua
from the selected backend directory and saves the thread handle inM.thread
.
Fields
- thread
-
Thread handle for the active‐notes tracker.
- thread Thread or nil
- name
-
Name of the selected backend (directory under
src/backends
).- name string
- controls
-
Controls API for the selected backend.
Exposes functions like
togglePlayback
,beginSong
, etc.- controls table
- commandMenu
-
Command‐menu API for the selected backend.
Provides in‐game command dispatching.
- commandMenu table
- fallbackMessage
-
Human‐readable warnings aggregated during setup.
Populated if an unknown backend is requested or winpty is missing on Windows.
- fallbackMessage string or nil