audioinstruments.panel_view

The control panel for an instrument: one file, laid out from the shared controls.

build(instrument, screen=..., ...) puts the panel on a screen for an instrument from audioinstruments.create(), or for a PanelAdapter already wrapped. Sixteen encoders with LED rings on the right, sixteen patch pads in eight banks on the left, a dot-matrix display, and the FINE, BYPASS, RELOAD and EXIT buttons.

The controls come from controls (apps/lib/controlkit) and LVGL, imported here inside a guard: without them this module still loads, and build() raises ImportError. A host with its own control surface never needs them.

audioinstruments.panel_view.SHOW_MS = 1500

How long the display shows a value after the last turn, in milliseconds.

class audioinstruments.panel_view.Panel(adapter, screen=None, group=None, theme=None, title=None, subtitle=None, on_close=None, two_wheels=False)[source]

Bases: object

The built panel, and the few things that update it.

adapter is what it edits. screen is the object to build on (the active screen by default) and group the input group the encoders join (the default group). theme is a theme name or dict, title replaces the adapter’s name on the faceplate, subtitle the line under it, and on_close, when given, adds an EXIT button that calls it.

two_wheels is for a setup with a second wheel that moves focus between the controls (see display_driver.set_wheel_mapping): the group stays in edit mode, so the other wheel always turns the control that has focus.

refresh_status()[source]

Repaint the engine light and the buttons’ LEDs from the adapter.

set_status(text)[source]

Show text on the display’s second line in place of READY.

For a live readout (a meter, a load figure) that fits the display’s width. An engine error, a restart or BYPASSED still takes its place, and so does a value being shown while a control moves. None puts READY back.

default_value(index)[source]

The value a reset returns macro index to: what the patch set.

edited()[source]

True when an encoder sits away from the value the patch gave it.

choose_patch(index)[source]

Pick patch index as if its pad were pressed.

delete()[source]

Take the panel off the screen and stop its timer.

audioinstruments.panel_view.build(instrument, screen=None, group=None, **options)[source]

Build the panel for instrument (or its adapter) and return it.

options are the keywords Panel takes: theme, title, subtitle, on_close, two_wheels.