48 lines
752 B
C++
48 lines
752 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
class Config {
|
|
public:
|
|
Config(const std::string binaryArgument);
|
|
~Config();
|
|
|
|
bool hasChanged();
|
|
void load();
|
|
|
|
struct AudioConfig {
|
|
std::vector<std::string> devices;
|
|
};
|
|
|
|
struct SampleConfig {
|
|
std::string file;
|
|
uint64_t offset;
|
|
uint64_t length;
|
|
float volume;
|
|
|
|
bool isValid() const;
|
|
};
|
|
|
|
struct ButtonConfig {
|
|
std::string name;
|
|
std::string key;
|
|
uint8_t width; // default is 6
|
|
|
|
std::vector<SampleConfig> samples;
|
|
|
|
bool isValid() const;
|
|
};
|
|
|
|
struct RootConfig {
|
|
AudioConfig audio;
|
|
|
|
std::vector<std::vector<ButtonConfig>> buttons;
|
|
std::string audioPath;
|
|
} rootConfig;
|
|
|
|
private:
|
|
std::string binaryPath;
|
|
const std::string file = "soundboard.json";
|
|
}; |