MayaFlux 1.0.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 318 of file SubsystemManager.cpp.

319{
320 auto handle = get_validated_handle(type);
321 if (!handle)
322 return;
323
324 if (!hook) {
326 "Invalid process hook: Hook cannot be null or invalid.");
327 return;
328 }
329
331 handle->pre_process_hooks[name] = std::move(hook);
332 } else {
333 handle->post_process_hooks[name] = std::move(hook);
334 }
335}
#define MF_ERROR(comp, ctx,...)
std::optional< glm::vec3 > position
Definition Decoder.cpp:93
vk::PhysicalDeviceType type
Definition VKDevice.cpp:126
std::string name
Definition VKDevice.cpp:123
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, name, position, MayaFlux::Core::PRE_PROCESS, MayaFlux::Journal::Runtime, and type.

+ Here is the call graph for this function: