33{
34 try {
37 "Version: {}.{}.{}", MAYAFLUX_VERSION_MAJOR, MAYAFLUX_VERSION_MINOR, MAYAFLUX_VERSION_PATCH);
39
40 bool config_override = false;
41#ifdef MAYAFLUX_CONFIG_OVERRIDE
42 config_override = true;
43#endif
44
45 std::string config_path;
46 for (int i = 1; i < argc; ++i) {
47 if (std::string_view(argv[i]) == "--config" && i + 1 < argc) {
48 config_path = argv[++i];
49 } else if (std::string_view(argv[i]) == "--config-override") {
50 config_override = true;
51 }
52 }
53
54 if (config_path.empty()) {
55 namespace fs = std::filesystem;
56 auto candidate = fs::path(Config::SOURCE_DIR) / "mayaflux.json";
57 if (fs::exists(candidate))
58 config_path = candidate.string();
59 }
60
61 if (config_override) {
63 "Config override active: file loads after settings()");
65 if (!config_path.empty())
67 } else {
68 if (!config_path.empty())
71 }
72
74
76
77 MF_LOG(Journal::Component::USER, Journal::Context::Init,
"=== AudioVisual Processing Active ===");
78
80
81 std::cout << "Press Ctrl-C to stop...\n";
83
85
86 } catch (const std::exception& e) {
87 std::cerr << "Error: " << e.what() << std::flush;
88 return 1;
89 }
90
91 return 0;
92}
#define MF_LOG(comp, ctx,...)
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...
@ Init
Engine/subsystem initialization.
@ USER
User code, scripts, plugins.
void Start()
Starts audio processing on the default engine.
void Init()
Initializes the default engine with default settings.
void Await()
Blocks launcher until Ctrl-C is pressed (optional convenience function)
void End()
Stops and cleans up the default engine.