MayaFlux 0.3.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
main.cpp
Go to the documentation of this file.
1#ifdef __has_include
2#if __has_include("user_project.hpp")
3#include "user_project.hpp"
4#define HAS_USER_PROJECT
5#else
6#define MAYASIMPLE
8#endif
9#endif
10
12{
13#ifdef HAS_USER_PROJECT
14 try {
15 settings();
16 } catch (const std::exception& e) {
17 MF_ERROR(MayaFlux::Journal::Component::USER, MayaFlux::Journal::Context::Init, "Error during user initialization: {}", e.what());
18 }
19#endif
20}
21
22void run()
23{
24#ifdef HAS_USER_PROJECT
25 try {
26 compose();
27 } catch (const std::exception& e) {
29 }
30#endif
31}
32
33int main()
34{
35 try {
36 MF_PRINT(MayaFlux::Journal::Component::USER, MayaFlux::Journal::Context::Init, "=== MayaFlux Creative Coding Framework ===");
38 "Version: {}.{}.{}", MAYAFLUX_VERSION_MAJOR, MAYAFLUX_VERSION_MINOR, MAYAFLUX_VERSION_PATCH);
40
41 initialize();
42
44
46
47 MF_PRINT(Journal::Component::USER, Journal::Context::Init, "=== AudioVisual Processing Active ===");
48
49 run();
50
51 std::cout << "Press Enter [Return] to stop...\n";
53
55
56 } catch (const std::exception& e) {
57 std::cerr << "Error: " << e.what() << std::flush;
58 return 1;
59 }
60
61 return 0;
62}
#define MF_ERROR(comp, ctx,...)
#define MF_PRINT(comp, ctx,...)
void run()
Definition main.cpp:22
void initialize()
Definition main.cpp:11
int main()
Definition main.cpp:33
@ Init
Engine/subsystem initialization.
@ Runtime
General runtime operations (default fallback)
@ USER
User code, scripts, plugins.
void Start()
Starts audio processing on the default engine.
Definition Core.cpp:110
void Init()
Initializes the default engine with default settings.
Definition Core.cpp:86
void Await()
Blocks launcher until user input (optional convenience function)
Definition Core.cpp:129
void End()
Stops and cleans up the default engine.
Definition Core.cpp:136