Namespace: DadGUI::cUIParameter Files: cUIParameter.h / cUIParameter.cpp Directory: DAD_FORGE/GUI/Components/ Inheritance: iGUI_EventListener, DadPersistentStorage::cSerializedObject, DadDSP::cParameter Description: Integration of the DadDSP::cUIParameter class into the GUI system.
📋 Class Description
The cUIParameter class extends the DadDSP::cParameter class to integrate it into the GUI. It adds the following features:
Persistence: Automatic save and restore of values via DadPersistentStorage.
Real-Time (RT): Smooth value interpolation to avoid audio artifacts during abrupt changes.
GUI Synchronization: Automatic notification of value changes (via MIDI or restore) to parent views to update the display.
🔗 External Dependencies
File Inclusions
Included File
Source
Role
"GUI_Event.h"
DAD_FORGE/GUI
Event management and notifications
"Serialize.h"
DAD_FORGE/Core
Serialization interface for persistence
"cParameter.h"
DAD_FORGE/DSP
Base class for DSP parameters
"HardwareAndCo.h"
DAD_FORGE/Hardware
Access to global variables, system constants (SAMPLING_RATE, etc.)
External Functions Called
Function
Source
Usage
void Subscribe_AllSerializeEvents(...)
Global GUI Event Manager
Registers the parameter for save/restore events
void Subscribe_Update(...)
Global GUI Event Manager
Subscribes the parameter to interface updates
void Subscribe_RT_Process(...)
Global GUI Event Manager
Subscribes the parameter to the real-time (audio) processing cycle
void Subscribe_FastUpdate(...)
Global GUI Event Manager
Subscribes the parameter to the fast update (GUI) cycle
Initializes the parameter with its limits, increments, and callback functions. Also configures interpolation (slope) and subscription to GUI/RT events.
Parameter(s)
Â
SerializeID
Unique identifier for serialization.
InitValue
Initial parameter value.
Min / Max
Value range limits.
RapidIncrement
Fast increment step size. Used for fast adjustments.
SlowIncrement
Slow increment step size. Used for fine adjustments.
Callback
Pointer to a callback function called when the value changes. Signature: void(*)(cParameter*, uint32_t). Can be nullptr to disable.
CallbackUserData
User data passed to the callback.
Slope
Smoothing factor. Determines the speed of transition toward the target value. Gives the value in seconds to go from Min to Max value.
Control
MIDI control number (CC number, 0-127). Value 0xFF disables MIDI control. The MIDI callback will be registered if a valid value is provided.
RTProcess
If true, the parameter is processed in the audio thread.