jdxi_editor.ui.widgets.editor.section_base

Section Base Widget

This module provides the SectionBaseWidget class, which provides a common base for all editor sections. It automatically adds standardized icon rows based on section type, ensuring consistency across all tabs.

Classes:

  • SectionBaseWidget: Base widget that automatically adds icon rows to sections.

Features:

  • Automatic icon row addition based on section type

  • Consistent layout structure

  • Theme-aware styling (analog vs regular)

  • Easy to subclass for new sections

Usage Example:

# In a section’s __init__ or setup_ui method:

class MySection(SectionBaseWidget):
def __init__(self, …):

super().__init__(icon_type=”adsr”, analog=False) # Your initialization code self.setup_ui()

def setup_ui(self):

layout = self.get_layout() # Gets the QVBoxLayout with icon row already added # Add your controls to layout layout.addWidget(my_widget)

Classes

SectionBaseWidget

Base widget for editor sections that automatically adds icon rows.

Module Contents

class jdxi_editor.ui.widgets.editor.section_base.SectionBaseWidget(send_midi_parameter: Callable = None, midi_helper: jdxi_editor.midi.io.helper.MidiIOHelper | None = None, address: jdxi_editor.midi.data.address.address.JDXiSysExAddress = None, parent: jdxi_editor.ui.common.QWidget | None = None, icons_row_type: Literal[jdxi_editor.ui.widgets.editor.icon_type.IconType.ADSR, jdxi_editor.ui.widgets.editor.icon_type.IconType.OSCILLATOR, jdxi_editor.ui.widgets.editor.icon_type.IconType.GENERIC, jdxi_editor.ui.widgets.editor.icon_type.IconType.NONE] = 'adsr', analog: bool = False, controls=None)[source]

Bases: jdxi_editor.ui.editors.synth.base.SynthBase

Base widget for editor sections that automatically adds icon rows.

This widget standardizes section structure by automatically adding appropriate icon rows based on section type, reducing boilerplate and ensuring consistency.

WAVEFORM_SPECS: list[jdxi_editor.ui.widgets.spec.SliderSpec] = [][source]
spec: jdxi_editor.ui.editors.base.layout.spec.LayoutSpec | None = None[source]
BUTTON_ENABLE_RULES: dict[Any, list[str]][source]
BUTTON_SPECS: list = [][source]
SYNTH_SPEC[source]
wave_shape_param: list | None = None[source]
wave_shape_buttons = None[source]
wave_shape_icon_map: dict | None = None[source]
analog: bool = False[source]
icons_row_type = 'adsr'[source]
_layout: jdxi_editor.ui.common.QVBoxLayout | None = None[source]
_icon_added: bool = False[source]
midi_helper = None[source]
address: jdxi_editor.midi.data.address.address.JDXiSysExAddress | None = None[source]
_set_param = None[source]
tab_widget = None[source]
adsr_widget = None[source]
amp_control_widgets = [][source]
button_widgets[source]
slider_widgets: dict[Any, jdxi_editor.ui.common.QWidget][source]
_setup_ui()[source]

Assemble section UI

get_layout(margins: tuple[int, int, int, int] = None, spacing: int = None) jdxi_editor.ui.common.QVBoxLayout[source]

Get or create the main layout for this section.

If the layout doesn’t exist, creates it and adds the icon row. This should be called at the start of setup_ui() or init_ui().

Parameters:
  • margins – Optional tuple of (left, top, right, bottom) margins

  • spacing – Optional spacing between widgets

Returns:

The main QVBoxLayout

build_widgets()[source]

Build sliders, switches, combo boxes, buttons, and ADSR

_create_tab_widget()[source]

Override to add Pan slider in its own horizontal layout

abstract generate_mode_button_specs()[source]

formerly generate_wave_shapes before generalization

_create_controls_widget() jdxi_editor.ui.common.QWidget[source]

Controls tab

_get_param_specs() list[source]

Return the main list of specs for widget creation. Supports SLIDER_GROUPS as dict or object with .controls.

_build_widgets()[source]

Create widgets from SLIDER_GROUPS[‘controls’] (sliders, switches, combos).

_update_button_enabled_states(button_param)[source]

Enable/disable controls based on BUTTON_ENABLE_RULES

_initialize_button_states()[source]

Set initial button state (first in wave_shapes / BUTTON_SPECS). Uses spec.param (SliderSpec and WaveShapeSpec both expose .param).

_create_button_row_layout()[source]

Create layout for button row. Override in subclasses.

_create_adsr()[source]

Create ADSR widget from spec_adsr

_add_centered_row(*widgets: jdxi_editor.ui.common.QWidget) None[source]

add centered row

_get_button_specs()[source]

Return list of button specs: wave_shapes when set by subclass, else BUTTON_SPECS.

_resolve_icon(icon_name: str | None) PySide6.QtGui.QIcon | None[source]

resolve icon

_build_wave_button(spec) PySide6.QtWidgets.QPushButton[source]

Build wave button

_register_button(spec, btn: PySide6.QtWidgets.QPushButton)[source]

register button

_create_waveform_buttons()[source]

Create mode/waveform/shape buttons from wave_shapes or BUTTON_SPECS.

_add_icon_row() None[source]

Add the appropriate icon row based on icon_type

_create_adsr_group()[source]

Create amp ADSR envelope using standardized helper

build_adsr_widget() jdxi_editor.ui.widgets.adsr.adsr.ADSR[source]

build ADSR widget

setup_ui() None[source]

Setup the UI for this section.

Subclasses should override this method and call get_layout() at the start to ensure the icon row is added.

Example

def setup_ui(self):

layout = self.get_layout() layout.addWidget(my_widget)

init_ui() None[source]

Initialize the UI for this section.

Alias for setup_ui() for sections that use init_ui() naming. Subclasses can override either setup_ui() or init_ui().

_add_tab(*, key: jdxi_editor.midi.data.parameter.digital.spec.TabDefinitionMixin, widget: jdxi_editor.ui.common.QWidget) None[source]

Add a tab using TabDefinitionMixin pattern

create_layout()[source]

create main rows layout

_on_button_selected(button_param)[source]

Handle button selection & enabling dependent widgets

_add_widget_rows(layout: PySide6.QtWidgets.QHBoxLayout, rows: list[list[jdxi_editor.ui.common.QWidget]])[source]

add a list of rows of widgets to a layout

_add_group_with_widget_rows(label: str, rows: list[list[jdxi_editor.ui.common.QWidget]])[source]

Create a group box, populate it with rows of widgets, and add it to the parent layout.

_create_shape_row()[source]

Shape and sync controls

_apply_wave_shape_style(active_shape)[source]

Apply wave shape style (match Digital Filter section mode buttons).

_on_shape_group_changed(shape_value: int, checked: bool) None[source]

on shape group changed

_get_wave_shape_button(shape: jdxi_editor.midi.data.digital.lfo.DigitalLFOShape | jdxi_editor.midi.data.analog.lfo.AnalogLFOShape)[source]

get wave shape button

set_wave_shape(shape: jdxi_editor.midi.data.digital.lfo.DigitalLFOShape | jdxi_editor.midi.data.analog.lfo.AnalogLFOShape, send_midi: bool = False)[source]

Update UI + optionally send MIDI

_send_wave_shape_midi(shape: jdxi_editor.midi.data.digital.lfo.DigitalLFOShape | jdxi_editor.midi.data.analog.lfo.AnalogLFOShape)[source]

Send Wave Shape

_apply_wave_shape_ui(btn: Any | None, shape: jdxi_editor.midi.data.digital.lfo.DigitalLFOShape | jdxi_editor.midi.data.analog.lfo.AnalogLFOShape)[source]

Apply wave shape UI

_wrap_row(widgets: list[jdxi_editor.ui.common.QWidget]) jdxi_editor.ui.common.QWidget[source]

Convert a list of controls into a QWidget row container.

Qt rule: layouts cannot be inserted where a QWidget is required (tabs, group boxes, pages). So we wrap the layout inside a QWidget.

_build_sliders(specs: list[jdxi_editor.ui.widgets.spec.SliderSpec])[source]

build sliders

_build_combo_boxes(specs: list[jdxi_editor.ui.widgets.spec.ComboBoxSpec])[source]

build combo boxes

_build_switches(specs: list[jdxi_editor.ui.widgets.spec.SwitchSpec])[source]
abstract _build_layout_spec()[source]

Build layout spec