jdxi_editor.ui.editors.validation

Validation utilities for editor sections.

This module provides validation functions to ensure editor sections are configured correctly, preventing bugs like using FILTER parameters in AMP sections or vice versa.

Usage:

# Run validation directly python jdxi_editor/ui/editors/validation.py

# Or run the unit tests python -m unittest tests.test_editor_validation

# Or use in code from jdxi_editor.ui.editors.validation import validate_digital_sections errors = validate_digital_sections() if errors:

# Handle validation errors

Attributes

project_root

Functions

validate_adsr_spec(→ List[str])

Validate that spec_adsr uses parameters with the expected prefix.

validate_section_parameters(→ List[str])

Validate that parameter specs (e.g. SLIDER_GROUPS['controls']) use parameters with expected prefixes.

validate_digital_sections(→ Dict[str, List[str]])

Validate all digital editor sections for correct parameter usage.

Module Contents

jdxi_editor.ui.editors.validation.validate_adsr_spec(section_name: str, adsr_spec: Dict[jdxi_editor.ui.adsr.spec.ADSRStage, jdxi_editor.ui.adsr.spec.ADSRSpec], expected_prefix: str) List[str][source]

Validate that spec_adsr uses parameters with the expected prefix.

Parameters:
  • section_name – Name of the section being validated (e.g., “DigitalAmpSection”)

  • adsr_spec – The spec_adsr dictionary to validate

  • expected_prefix – Expected parameter prefix (e.g., “AMP_ENV”, “FILTER_ENV”)

Returns:

List of error messages (empty if validation passes)

jdxi_editor.ui.editors.validation.validate_section_parameters(section_name: str, param_specs: List, expected_prefixes: Set[str]) List[str][source]

Validate that parameter specs (e.g. SLIDER_GROUPS[‘controls’]) use parameters with expected prefixes.

Parameters:
  • section_name – Name of the section being validated

  • param_specs – List of SliderSpec/SwitchSpec/ComboBoxSpec objects

  • expected_prefixes – Set of allowed parameter name prefixes

Returns:

List of error messages (empty if validation passes)

jdxi_editor.ui.editors.validation.validate_digital_sections() Dict[str, List[str]][source]

Validate all digital editor sections for correct parameter usage.

Returns:

Dictionary mapping section names to lists of error messages

jdxi_editor.ui.editors.validation.project_root[source]