MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
Config.hpp
Go to the documentation of this file.
2
3namespace MayaFlux {
4
5namespace Nodes {
6 struct NodeConfig;
7}
8
9namespace Core {
10 struct GlobalStreamInfo;
11 struct GlobalGraphicsConfig;
12 struct GlobalInputConfig;
13 struct GlobalNetworkConfig;
14}
15
16/**
17 * @brief Checks if the default engine has currently accepted all configurations and initialized all managers
18 * @return True if the engine is ready for processing, false otherwise
19 */
20MAYAFLUX_API bool is_engine_configured();
21
22/**
23@brief Globlal configuration for MayaFlux
24*
25* This namespace contains global configuration settings for MayaFlux, including graph and node configurations.
26* It provides access to settings such as sample rate, buffer size, and number of output channels
27* from the default audio engine.
28*/
29namespace Config {
30
31 MAYAFLUX_API Nodes::NodeConfig& get_node_config();
32
33 /**
34 * @brief Sets the node configuration for the default engine
35 * @param config The NodeConfig to set
36 */
37 MAYAFLUX_API void set_node_config(const Nodes::NodeConfig& config);
38
39 /**
40 * @brief Gets the sample rate from the default engine
41 * @return Current sample rate in Hz
42 */
43 MAYAFLUX_API uint32_t get_sample_rate();
44
45 /**
46 * @brief Gets the buffer size from the default engine
47 * @return Current buffer size in frames
48 */
49 MAYAFLUX_API uint32_t get_buffer_size();
50
51 /**
52 * @brief Gets the number of output channels from the default engine
53 * @return Current number of output channels
54 */
55 MAYAFLUX_API uint32_t get_num_out_channels();
56
57 /**
58 * @brief Gets the stream configuration from the default engine
59 * @return Copy of the GlobalStreamInfo struct
60 */
61 MAYAFLUX_API Core::GlobalStreamInfo& get_global_stream_info();
62
63 /**
64 * @brief Gets the graphics configuration from the default engine
65 * @return Copy of the GlobalGraphicsConfig struct
66 */
67 MAYAFLUX_API Core::GlobalGraphicsConfig& get_global_graphics_config();
68
69 /**
70 * @brief Gets the input configuration from the default engine
71 * @return Copy of the GlobalInputConfig struct
72 */
73 MAYAFLUX_API Core::GlobalInputConfig& get_global_input_config();
74
75 /**
76 * @brief Gets the network configuration from the default engine
77 * @return Copy of the GlobalNetworkConfig struct
78 */
79 MAYAFLUX_API Core::GlobalNetworkConfig& get_global_network_config();
80
81 /**
82 * @brief Sets the minimum severity level for journal entries to be logged
83 * @param severity Minimum severity level (e.g., INFO, WARN, ERROR, TRACE, DEBUG, FATAL)
84 */
86
87 /**
88 * @brief Enables or disables logging for specific journal components
89 * @param component Vector of Journal::Component values to enable/disable
90 * @param enabled True to enable logging for the specified components, false to disable
91 */
92 MAYAFLUX_API void set_journal_component_filter(const std::vector<Journal::Component>& component, bool enabled);
93
94 /**
95 * @brief Enables or disables logging for specific journal contexts
96 * @param context Vector of Journal::Context values to enable/disable
97 * @param enabled True to enable logging for the specified contexts, false to disable
98 */
99 MAYAFLUX_API void set_journal_context_filter(const std::vector<Journal::Context>& context, bool enabled);
100
101 /**
102 * @brief Stores journal entries to a file by adding a FileSink to the Archivist
103 * @param file_name Path to the log file
104 */
105 MAYAFLUX_API void store_journal_entries(const std::string& file_name);
106
107 /**
108 * @brief Outputs journal entries to the console by adding a ConsoleSink to the Archivist
109 * NOTE: This records thread safe entries and cannot unsink once called.
110 */
111 MAYAFLUX_API void sink_journal_to_console();
112
113 /**
114 * @brief Load engine configuration from a JSON file, applying any present fields
115 * to the pre-Init config structs.
116 * @param path Path to a mayaflux.json file.
117 * @return True if the file was read and at least partially applied. False if the
118 * file could not be opened or parsed; last_error() will be set.
119 * @note Must be called before Init(). Fields absent from the file retain defaults.
120 */
121 MAYAFLUX_API bool load_config_from_file(const std::string& path);
122}
123
124}
std::string severity
Definition Config.cpp:16
Core::GlobalGraphicsConfig & get_global_graphics_config()
Gets the graphics configuration from the default engine.
Definition Config.cpp:68
Nodes::NodeConfig & get_node_config()
Definition Config.cpp:92
void set_journal_component_filter(const std::vector< Journal::Component > &component, bool enabled)
Enables or disables logging for specific journal components.
Definition Config.cpp:137
Core::GlobalInputConfig & get_global_input_config()
Gets the input configuration from the default engine.
Definition Config.cpp:76
uint32_t get_buffer_size()
Gets the buffer size from the default engine.
Definition Config.cpp:114
void set_node_config(const Nodes::NodeConfig &config)
Sets the node configuration for the default engine.
Definition Config.cpp:97
bool load_config_from_file(const std::string &path)
Load engine configuration from a JSON file, applying any present fields to the pre-Init config struct...
Definition Config.cpp:162
void store_journal_entries(const std::string &file_name)
Stores journal entries to a file by adding a FileSink to the Archivist.
Definition Config.cpp:151
void set_journal_severity(Journal::Severity severity)
Sets the minimum severity level for journal entries to be logged.
Definition Config.cpp:132
void sink_journal_to_console()
Outputs journal entries to the console by adding a ConsoleSink to the Archivist NOTE: This records th...
Definition Config.cpp:157
void set_journal_context_filter(const std::vector< Journal::Context > &context, bool enabled)
Enables or disables logging for specific journal contexts.
Definition Config.cpp:144
uint32_t get_sample_rate()
Gets the sample rate from the default engine.
Definition Config.cpp:105
Core::GlobalStreamInfo & get_global_stream_info()
Gets the stream configuration from the default engine.
Definition Config.cpp:60
uint32_t get_num_out_channels()
Gets the number of output channels from the default engine.
Definition Config.cpp:123
Core::GlobalNetworkConfig & get_global_network_config()
Gets the network configuration from the default engine.
Definition Config.cpp:84
@ Nodes
DSP Generator and Filter Nodes, graph pipeline, node management.
@ Core
Core engine, backend, subsystems.
bool is_engine_configured()
Checks if the default engine has currently accepted all configurations and initialized all managers.
Definition Config.cpp:52
Main namespace for the Maya Flux audio engine.
Definition Runtime.cpp:12