MayaFlux 0.1.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 ===");
39
40 initialize();
41
43
45
46 MF_PRINT(Journal::Component::USER, Journal::Context::Init, "=== Audio Processing Active ===");
47
48 run();
49
50 std::cout << "Press Enter [Return] to stop...\n";
51 std::cin.get();
53
54 } catch (const std::exception& e) {
55 std::cerr << "Error: " << e.what() << std::flush;
56 return 1;
57 }
58
59 return 0;
60}
#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:114
void Init()
Initializes the default engine with default settings.
Definition Core.cpp:84
void End()
Stops and cleans up the default engine.
Definition Core.cpp:133