-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPresetManager.h
38 lines (29 loc) · 880 Bytes
/
PresetManager.h
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
#pragma once
#include "common.h"
#include "Parameter.h"
class PresetManager
{
private:
std::vector<Parameter> ¶meterHolder;
std::string fileName;
FILE *f = nullptr;
std::string curProgramName;
void init();
void openFile(int rw);
void closeFile();
bool readProgram(int number, std::string &name, bool readNameOnly, FILE *copyToTmp = nullptr);
public:
std::vector<std::string> presetNames;
PresetManager(std::vector<Parameter> &h, const std::string &file = "FmSynthPresets.dat") : parameterHolder(h), fileName(file)
{
init();
}
std::string readProgram(int number);
void saveProgram(int number, const std::string &name);
void refresh()
{
init();
}
void setProgramName(const std::string &name) { curProgramName = name; }
std::string getProgramName() { return curProgramName; }
};