Source code for jdxi_editor.ui.editors.digital.partial.amp.spec

from dataclasses import dataclass
from typing import Optional

from jdxi_editor.ui.widgets.spec import ComboBoxSpec, SliderSpec, SwitchSpec


@dataclass
[docs] class AmpLayoutSpec: """Layout of Widgets"""
[docs] controls: Optional[list[SwitchSpec | SliderSpec | ComboBoxSpec]] = None
[docs] pan: Optional[list[SliderSpec | None]] = None
[docs] adsr: Optional[dict] = None
[docs] def get(self, item, fallback=None): """Dict-like access: return the attribute named `item`, else `fallback`.""" if hasattr(self, item): return getattr(self, item) return fallback