Namespace: DadGUI::cOn_Off_Manager Files: cBypassOnOffManager.h / cBypassOnOffManager.cpp Directory: DAD_FORGE/GUI/Core/ Inheritance: iBypassOnOffManager, DadGUI::iGUI_EventListener Description: Manages state transitions between the ON and OFF states for audio effects.
๐ Class Description
The cOn_Off_Manager class is a simplified implementation of iBypassOnOffManager that does not handle the โBypassโ state. It focuses on the transition between activation (ON) and deactivation (OFF) of the effect. It uses fade-in/fade-out processes to ensure smooth audio transitions and listens to MIDI commands to toggle between these two states.
๐ External Dependencies
File Inclusions
Included File
Source
Role
"GUI_Event.h"
DAD_FORGE/GUI
GUI event management
"cDryWet.h"
DAD_FORGE/Drivers
Dry/Wet mixing control for transitions
"cMidi.h"
DAD_FORGE/Drivers
MIDI message management
Global Variables
Variable / Object
Type
Source
Role
__DryWet
DadDrivers::cDryWet
extern in cBypassOnOffManager.h
Audio mixing control for transitions
__Midi
DadDrivers::cMidi
extern in cBypassOnOffManager.cpp
MIDI command reception
__GUI_EventManager
DadGUI::GUI_EventManager
extern in cBypassOnOffManager.cpp
GUI event publishing/subscription
๐ฏ Enumerations and Associated Structures
eEffectState_t
Represents the states supported by this manager (bypass mode is mapped to OFF).
Element
Value
Description
bypass
0
Mapped to off state in this manager
off
1
Effect is disabled
on
2
Effect is active
๐ Public Methods
Initialize
Element
Details
Method
void Initialize()
Description
Initializes the state to โoffโ, configures the Dry/Wet mixer, subscribes to GUI events, and configures MIDI callbacks (ON, OFF, BYPASS).
Return
void
on_GUI_FastUpdate
Element
Details
Method
void on_GUI_FastUpdate()
Description
Checks if a target state change has been requested. If so, initiates the transition (OnToOff or OffToOn). Updates the internal state once the fade is complete.
Return
void
setState
Element
Details
Method
void setState(eEffectState_t State)
Description
Sets the target state. Note: the bypass state is converted to off for this manager.
Parameter(s)
ย
State
eEffectState_t: The desired target state.
Return
void
๐ Protected / Private Methods
OnToOff
Element
Details
Method
void OnToOff()
Description
Triggers the transition from the On state to the Off state via a fade-out.
Return
void
OffToOn
Element
Details
Method
void OffToOn()
Description
Triggers the transition from the Off state to the On state via a fade-in.