basic profile loading
This commit is contained in:
@@ -4,6 +4,11 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include "yaml-cpp/yaml.h"
|
||||
|
||||
#include "ParameterStore.h"
|
||||
|
||||
#define CONFIG_VERSION 0x0002
|
||||
|
||||
enum class ConfigFile {
|
||||
Audio = 0
|
||||
@@ -15,17 +20,27 @@ const std::vector<std::string> filePaths = {
|
||||
"audio.yaml"
|
||||
};
|
||||
|
||||
// Reads from yaml config files
|
||||
// Handles things like profile loading
|
||||
class ConfigInterface {
|
||||
|
||||
public:
|
||||
|
||||
ConfigInterface();
|
||||
ConfigInterface(ParameterStore* params);
|
||||
~ConfigInterface() = default;
|
||||
|
||||
int getValue(ConfigFile file, std::string key, int defaultVal);
|
||||
|
||||
void loadProfile(std::string filename);
|
||||
std::array<ParamDefault, 5> loadEnvProfile(YAML::Node* node, std::string profile);
|
||||
std::array<ParamDefault, 5> loadEnvProfile(std::string filename, std::string profile);
|
||||
|
||||
private:
|
||||
|
||||
const std::string configRoot = "config";
|
||||
|
||||
// loading parameters
|
||||
ParameterStore* params_;
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user