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
Functions
|
Validate that spec_adsr uses parameters with the expected prefix. |
|
Validate that parameter specs (e.g. SLIDER_GROUPS['controls']) use parameters with expected prefixes. |
|
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)