15 struct JournalConfig {
22 static constexpr auto describe()
24 return std::make_tuple(
25 IO::member(
"severity", &JournalConfig::severity),
26 IO::member(
"sink_to_console", &JournalConfig::sink_to_console),
27 IO::member(
"log_file", &JournalConfig::log_file),
28 IO::member(
"disable_components", &JournalConfig::disable_components),
29 IO::member(
"disable_contexts", &JournalConfig::disable_contexts));
40 static constexpr auto describe()
42 return std::make_tuple(
44 IO::member(
"graphics", &EngineConfig::graphics),
47 IO::member(
"journal", &EngineConfig::journal));
139 for (
const auto& comp : component) {
146 for (
const auto& ctx : context) {
165 auto result = ser.
read<EngineConfig>(path);
168 "Failed to load config from {}: {}", path, ser.
last_error());
176 const auto& j = result->journal;
178 if (!j.severity.empty()) {
179 auto sev = Reflect::string_to_enum_case_insensitive<Journal::Severity>(j.severity);
184 "Unknown journal severity: {}", j.severity);
187 if (j.sink_to_console)
189 if (!j.log_file.empty())
191 for (
const auto& name : j.disable_components) {
192 auto comp = Reflect::string_to_enum_case_insensitive<Journal::Component>(name);
197 "Unknown journal component: {}", name);
201 for (
const auto& name : j.disable_contexts) {
202 auto ctx = Reflect::string_to_enum_case_insensitive<Journal::Context>(name);
207 "Unknown journal context: {}", name);
#define MF_ERROR(comp, ctx,...)
#define MF_WARN(comp, ctx,...)
Core::GlobalNetworkConfig network
Core::GlobalStreamInfo stream
Core::GlobalGraphicsConfig graphics
std::vector< std::string > disable_contexts
std::vector< std::string > disable_components
Core::GlobalInputConfig input
Core engine lifecycle and configuration API.
GlobalStreamInfo & get_stream_info()
Gets the current stream configuration.
void set_node_config(const Nodes::NodeConfig &config)
Sets the node processing configuration.
GlobalNetworkConfig & get_network_config()
Gets the current network configuration.
Nodes::NodeConfig & get_node_config()
Gets the current node processing configuration.
GlobalInputConfig & get_input_config()
Gets the current input configuration.
GlobalGraphicsConfig & get_graphics_config()
Gets the current graphics configuration.
std::optional< T > read(const std::string &path)
Read path and deserialize into T.
const std::string & last_error() const
Last error message, empty if no error.
Converts arbitrary C++ types to/from JSON strings and disk files.
void add_sink(std::unique_ptr< Sink > sink)
Add a log sink for output.
void set_component_filter(Component comp, bool enabled)
Enable or disable logging for a specific component.
static Archivist & instance()
Get the singleton instance of the Archivist.
void set_min_severity(Severity min_sev)
Set the minimum severity level for logging.
void set_context_filter(Context ctx, bool enabled)
Enable or disable logging for a specific context.
Core::GlobalGraphicsConfig & get_global_graphics_config()
Gets the graphics configuration from the default engine.
Nodes::NodeConfig & get_node_config()
void set_journal_component_filter(const std::vector< Journal::Component > &component, bool enabled)
Enables or disables logging for specific journal components.
Core::GlobalInputConfig & get_global_input_config()
Gets the input configuration from the default engine.
uint32_t get_buffer_size()
Gets the buffer size from the default engine.
void set_node_config(const Nodes::NodeConfig &config)
Sets the node configuration for the default engine.
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...
void store_journal_entries(const std::string &file_name)
Stores journal entries to a file by adding a FileSink to the Archivist.
void set_journal_severity(Journal::Severity severity)
Sets the minimum severity level for journal entries to be logged.
void sink_journal_to_console()
Outputs journal entries to the console by adding a ConsoleSink to the Archivist NOTE: This records th...
void set_journal_context_filter(const std::vector< Journal::Context > &context, bool enabled)
Enables or disables logging for specific journal contexts.
uint32_t get_sample_rate()
Gets the sample rate from the default engine.
Core::GlobalStreamInfo & get_global_stream_info()
Gets the stream configuration from the default engine.
uint32_t get_num_out_channels()
Gets the number of output channels from the default engine.
Core::GlobalNetworkConfig & get_global_network_config()
Gets the network configuration from the default engine.
Globlal configuration for MayaFlux.
constexpr auto member(std::string_view key, T Class::*ptr)
@ Configuration
Configuration and parameter updates.
@ API
MayaFlux/API Wrapper and convenience functions.
bool is_engine_configured()
Checks if the default engine has currently accepted all configurations and initialized all managers.
bool is_configured()
Checks if the default engine has currently accepted all configurations and initialized all managers.
Core::Engine & get_context()
Gets the default engine instance.
Main namespace for the Maya Flux audio engine.
Configuration for the NetworkSubsystem.
uint32_t channels
Number of discrete channels in this set.
uint32_t buffer_size
Number of samples per processing block.
uint32_t sample_rate
Number of samples processed per second (Hz)
ChannelConfig output
Configuration for output signal channels.
Comprehensive configuration for digital audio stream processing.
Configuration settings for individual audio nodes.