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
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.SynthBaseBase 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]
- address: jdxi_editor.midi.data.address.address.JDXiSysExAddress | None = None[source]
- 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
- _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).
- _get_button_specs()[source]
Return list of button specs: wave_shapes when set by subclass, else BUTTON_SPECS.
- _create_waveform_buttons()[source]
Create mode/waveform/shape buttons from wave_shapes or BUTTON_SPECS.
- 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
- _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.
- _apply_wave_shape_style(active_shape)[source]
Apply wave shape style (match Digital Filter section mode buttons).
- _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]