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

◆ Init() [3/3]

void MayaFlux::Core::Engine::Init ( const GlobalStreamInfo streamInfo,
const GlobalGraphicsConfig graphics_config,
const GlobalInputConfig input_config 
)

Initializes the processing engine with custom stream and graphics configurations.

Parameters
streamInfoConfiguration for sample rate, buffer size, and channels
graphics_configConfiguration for graphics/windowing backend
input_configConfiguration for input handling

Configures the processing engine with the specified stream and graphics information. This method must be called before starting the engine.

Definition at line 103 of file Engine.cpp.

104{
106 m_stream_info = streamInfo;
107 m_graphics_config = graphics_config;
108 m_input_config = input_config;
109
110 m_scheduler = std::make_shared<Vruta::TaskScheduler>(m_stream_info.sample_rate);
111 m_event_manager = std::make_shared<Vruta::EventManager>();
112 m_input_manager = std::make_shared<InputManager>();
113
114 m_buffer_manager = std::make_shared<Buffers::BufferManager>(
117 m_stream_info.sample_rate, m_stream_info.buffer_size);
118
119 m_node_graph_manager = std::make_shared<Nodes::NodeGraphManager>(m_stream_info.sample_rate, m_stream_info.buffer_size);
120
121 m_node_graph_manager->set_node_config(m_node_config);
122
123 m_io_manager = std::make_shared<IO::IOManager>(
125
127 m_window_manager = std::make_shared<WindowManager>(m_graphics_config);
128 } else {
129 MF_WARN(Journal::Component::Core, Journal::Context::Init, "No windowing backend selected - running in audio-only mode");
130 }
131
132 m_subsystem_manager = std::make_shared<SubsystemManager>(
134
135 m_subsystem_manager->create_audio_subsystem(m_stream_info);
136
137 m_subsystem_manager->create_graphics_subsystem(m_graphics_config);
138
139 m_subsystem_manager->create_input_subsystem(m_input_config);
140
141 m_buffer_manager->initialize_buffer_service();
142
143 m_is_initialized = true;
144
145 MF_PRINT(Journal::Component::Core, Journal::Context::Init, "Audio backend: RtAudio, Sample rate: {}", m_stream_info.sample_rate);
146}
#define MF_PRINT(comp, ctx,...)
#define MF_WARN(comp, ctx,...)
std::shared_ptr< SubsystemManager > m_subsystem_manager
Definition Engine.hpp:383
std::shared_ptr< IO::IOManager > m_io_manager
IO manager for video/audio loading and dispatch.
Definition Engine.hpp:387
GlobalGraphicsConfig m_graphics_config
Graphics/windowing configuration.
Definition Engine.hpp:367
std::shared_ptr< Vruta::EventManager > m_event_manager
Event manager (currently only glfw events)
Definition Engine.hpp:385
std::shared_ptr< Buffers::BufferManager > m_buffer_manager
Buffer manager.
Definition Engine.hpp:382
GlobalStreamInfo m_stream_info
Stream configuration.
Definition Engine.hpp:366
std::shared_ptr< WindowManager > m_window_manager
Window manager (Windowing subsystem)
Definition Engine.hpp:384
std::shared_ptr< Vruta::TaskScheduler > m_scheduler
Task scheduler.
Definition Engine.hpp:380
std::shared_ptr< InputManager > m_input_manager
Input manager (HID/MIDI/etc.)
Definition Engine.hpp:386
Nodes::NodeConfig m_node_config
Node processing configuration.
Definition Engine.hpp:369
std::shared_ptr< Nodes::NodeGraphManager > m_node_graph_manager
Node graph manager.
Definition Engine.hpp:381
GlobalInputConfig m_input_config
Input configuration.
Definition Engine.hpp:368
@ Init
Engine/subsystem initialization.
@ Core
Core engine, backend, subsystems.
@ NONE
No windowing (offscreen rendering only)
uint32_t target_frame_rate
Target frame rate for visual processing (Hz)
WindowingBackend windowing_backend
Selected windowing backend.
uint32_t channels
Number of discrete channels in this set.
bool enabled
Whether this channel set is active in the stream.
uint32_t buffer_size
Number of samples per processing block.
ChannelConfig input
Configuration for input signal channels (disabled by default)
uint32_t sample_rate
Number of samples processed per second (Hz)
ChannelConfig output
Configuration for output signal channels.

References MayaFlux::Core::GlobalStreamInfo::buffer_size, MayaFlux::Core::GlobalStreamInfo::ChannelConfig::channels, MayaFlux::Journal::Core, MayaFlux::Core::GlobalStreamInfo::ChannelConfig::enabled, MayaFlux::Journal::Init, MayaFlux::Core::GlobalStreamInfo::input, m_buffer_manager, m_event_manager, m_graphics_config, m_input_config, m_input_manager, m_io_manager, m_is_initialized, m_node_config, m_node_graph_manager, m_scheduler, m_stream_info, m_subsystem_manager, m_window_manager, MF_PRINT, MF_WARN, MayaFlux::Core::GlobalGraphicsConfig::NONE, MayaFlux::Core::GlobalStreamInfo::output, MayaFlux::Core::GlobalStreamInfo::sample_rate, MayaFlux::Core::GlobalGraphicsConfig::target_frame_rate, and MayaFlux::Core::GlobalGraphicsConfig::windowing_backend.