34{
35 try {
38 "Version: {}.{}.{}", MAYAFLUX_VERSION_MAJOR, MAYAFLUX_VERSION_MINOR, MAYAFLUX_VERSION_PATCH);
40
41 bool config_override = false;
42#ifdef MAYAFLUX_CONFIG_OVERRIDE
43 config_override = true;
44#endif
45
46 std::string config_path;
47 for (int i = 1; i < argc; ++i) {
48 if (std::string_view(argv[i]) == "--config" && i + 1 < argc) {
49 config_path = argv[++i];
50 } else if (std::string_view(argv[i]) == "--config-override") {
51 config_override = true;
52 }
53 }
54
55 if (config_path.empty()) {
56 namespace fs = std::filesystem;
57 auto candidate = fs::path(Config::SOURCE_DIR) / "mayaflux.json";
58 if (fs::exists(candidate))
59 config_path = candidate.string();
60 }
61
62 if (config_override) {
64 "Config override active: file loads after settings()");
66 if (!config_path.empty())
68 } else {
69 if (!config_path.empty())
72 }
73
75
77
78 MF_LOG(Journal::Component::USER, Journal::Context::Init,
"=== AudioVisual Processing Active ===");
79
81
82 std::cout << "Press Enter [Return] to stop...\n";
84
86
87 } catch (const std::exception& e) {
88 std::cerr << "Error: " << e.what() << std::flush;
89 return 1;
90 }
91
92 return 0;
93}
#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 user input (optional convenience function)
void End()
Stops and cleans up the default engine.