MayaFlux 0.4.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,
const GlobalNetworkConfig network_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
network_configConfiguration for network subsystem

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 m_network_config = network_config;
110
111 m_scheduler = std::make_shared<Vruta::TaskScheduler>(m_stream_info.sample_rate);
112 m_event_manager = std::make_shared<Vruta::EventManager>();
113 m_input_manager = std::make_shared<InputManager>();
114
115 m_buffer_manager = std::make_shared<Buffers::BufferManager>(
118 m_stream_info.sample_rate, m_stream_info.buffer_size);
119
120 m_node_graph_manager = std::make_shared<Nodes::NodeGraphManager>(
122
123 m_node_graph_manager->set_node_config(m_node_config);
124
125 m_io_manager = std::make_shared<IO::IOManager>(
127
129 m_window_manager = std::make_shared<WindowManager>(m_graphics_config);
130 } else {
131 MF_WARN(Journal::Component::Core, Journal::Context::Init, "No windowing backend selected - running in audio-only mode");
132 }
133
134 m_subsystem_manager = std::make_shared<SubsystemManager>(
136
137 m_subsystem_manager->create_audio_subsystem(m_stream_info);
138
139 m_subsystem_manager->create_graphics_subsystem(m_graphics_config);
140
141 m_subsystem_manager->create_network_subsystem(m_network_config);
142
143 m_subsystem_manager->create_input_subsystem(m_input_config);
144
145 m_buffer_manager->initialize_buffer_service();
146
147 m_is_initialized = true;
148
149 MF_PRINT(Journal::Component::Core, Journal::Context::Init, "Audio backend: RtAudio, Sample rate: {}", m_stream_info.sample_rate);
150}
#define MF_PRINT(comp, ctx,...)
#define MF_WARN(comp, ctx,...)
std::shared_ptr< SubsystemManager > m_subsystem_manager
Definition Engine.hpp:402
std::shared_ptr< IO::IOManager > m_io_manager
IO manager for video/audio loading and dispatch.
Definition Engine.hpp:406
GlobalNetworkConfig m_network_config
Network configuration.
Definition Engine.hpp:387
GlobalGraphicsConfig m_graphics_config
Graphics/windowing configuration.
Definition Engine.hpp:385
std::shared_ptr< Vruta::EventManager > m_event_manager
Event manager (currently only glfw events)
Definition Engine.hpp:404
std::shared_ptr< Buffers::BufferManager > m_buffer_manager
Buffer manager.
Definition Engine.hpp:401
GlobalStreamInfo m_stream_info
Stream configuration.
Definition Engine.hpp:384
std::shared_ptr< WindowManager > m_window_manager
Window manager (Windowing subsystem)
Definition Engine.hpp:403
std::shared_ptr< Vruta::TaskScheduler > m_scheduler
Task scheduler.
Definition Engine.hpp:399
std::shared_ptr< InputManager > m_input_manager
Input manager (HID/MIDI/etc.)
Definition Engine.hpp:405
Nodes::NodeConfig m_node_config
Node processing configuration.
Definition Engine.hpp:388
std::shared_ptr< Nodes::NodeGraphManager > m_node_graph_manager
Node graph manager.
Definition Engine.hpp:400
GlobalInputConfig m_input_config
Input configuration.
Definition Engine.hpp:386
@ 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_network_config, 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.