MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ register_process_hook()

void MayaFlux::Core::SubsystemManager::register_process_hook ( SubsystemType  type,
const std::string &  name,
ProcessHook  hook,
HookPosition  position = HookPosition::POST_PROCESS 
)

Register a processing hook for a specific subsystem.

Parameters
typeSubsystemType to attach the hook to
nameUnique identifier for the hook
hookCallback function to execute
positionWhen to execute the hook (PRE_PROCESS or POST_PROCESS)

Process hooks allow custom code execution at specific points in the processing cycle. Used for monitoring, debugging, or additional processing.

Definition at line 236 of file SubsystemManager.cpp.

237{
238 auto handle = get_validated_handle(type);
239 if (!handle)
240 return;
241
242 if (!hook) {
244 "Invalid process hook: Hook cannot be null or invalid.");
245 return;
246 }
247
248 if (position == HookPosition::PRE_PROCESS) {
249 handle->pre_process_hooks[name] = std::move(hook);
250 } else {
251 handle->post_process_hooks[name] = std::move(hook);
252 }
253}
#define MF_ERROR(comp, ctx,...)
SubsystemProcessingHandle * get_validated_handle(SubsystemType type) const
Get processing handle with validation.
@ PRE_PROCESS
Execute hook before any audio processing occurs.
@ Runtime
General runtime operations (default fallback)
@ Core
Core engine, backend, subsystems.

References MayaFlux::Journal::Core, get_validated_handle(), MF_ERROR, MayaFlux::Core::PRE_PROCESS, and MayaFlux::Journal::Runtime.

+ Here is the call graph for this function: