Save before changes

This commit is contained in:
Ryzerth
2020-10-01 01:21:15 +02:00
parent 2c4d7cbf09
commit 524f20bc2f
16 changed files with 348 additions and 413 deletions

View File

@@ -0,0 +1,37 @@
#pragma once
#include <string>
#include <vector>
#include <map>
#include <dsp/stream.h>
#include <dsp/types.h>
class SourceManager {
public:
SourceManager();
struct SourceHandler {
dsp::stream<dsp::complex_t>* stream;
void (*menuHandler)(void* ctx);
void (*selectHandler)(void* ctx);
void (*deselectHandler)(void* ctx);
void (*startHandler)(void* ctx);
void (*stopHandler)(void* ctx);
void (*tuneHandler)(double freq, void* ctx);
void* ctx;
};
void registerSource(std::string name, SourceHandler* handler);
void selectSource(std::string name);
void showSelectedMenu();
void start();
void stop();
void tune(double freq);
std::vector<std::string> sourceNames;
private:
std::map<std::string, SourceHandler*> sources;
std::string selectedName;
SourceHandler* selectedHandler = NULL;
};