-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
38 lines (31 loc) · 1.02 KB
/
main.cpp
File metadata and controls
38 lines (31 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "synth_engine.hpp"
#include "config_manager.hpp"
#include <iostream>
std::filesystem::path getPathToWorkdir()
{
const char* home = std::getenv("HOME");
if (!home) {
std::cerr << "HOME environment variable is not set.\n";
return std::filesystem::path("/tmp");
}
std::filesystem::path path_to_workdir = std::filesystem::path(home) / ".config" ;
return path_to_workdir;
};
/**
* Write a parser:
* --workdir <path> - path to the folder where the configuration files are stored
* --preset <name> - name of the preset to load
* --scale <name> - name of the scale to load
* --reset - reset to default configuration
* --list-presets - list all available presets
* --list-scales - list all available scales
*/
int32_t main()
{
std::filesystem::path path_to_workdir = getPathToWorkdir();
ConfigManager config_manager = ConfigManager(path_to_workdir);
SynthEngine& synth_engine = SynthEngine::getSynthEngine();
synth_engine.setConfigManager(&config_manager);
synth_engine.run();
return 0;
}