MayaFlux 0.3.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 275 of file SubsystemManager.cpp.

276{
277 auto handle = get_validated_handle(type);
278 if (!handle)
279 return;
280
281 if (!hook) {
283 "Invalid process hook: Hook cannot be null or invalid.");
284 return;
285 }
286
287 if (position == HookPosition::PRE_PROCESS) {
288 handle->pre_process_hooks[name] = std::move(hook);
289 } else {
290 handle->post_process_hooks[name] = std::move(hook);
291 }
292}
#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: