Full module system

This commit is contained in:
Ryzerth
2020-08-12 16:43:44 +02:00
parent cdea80f8c5
commit 31a95031e4
15 changed files with 174 additions and 37 deletions

View File

@@ -7,6 +7,8 @@
#include <spdlog/spdlog.h>
#include <dsp/types.h>
#include <dsp/stream.h>
#include <waterfall.h>
#include <json.hpp>
#ifdef _WIN32
#include <Windows.h>
@@ -27,6 +29,9 @@ namespace mod {
int (*getVFOOutputBlockSize)(std::string name);
void (*setVFOReference)(std::string name, int ref);
void (*removeVFO)(std::string name);
std::string (*getSelectedVFOName)(void);
void (*bindVolumeVariable)(float* vol);
void (*unbindVolumeVariable)(void);
enum {
REF_LOWER,
@@ -38,6 +43,7 @@ namespace mod {
enum {
EVENT_STREAM_PARAM_CHANGED,
EVENT_SELECTED_VFO_CHANGED,
_EVENT_COUNT
};
@@ -49,14 +55,16 @@ namespace mod {
#endif
void* (*_INIT_)(API_t*, ImGuiContext*, std::string);
void (*_DRAW_MENU_)(void*);
void (*_NEW_FRAME_)(void*);
void (*_HANDLE_EVENT_)(void*, int);
void (*_STOP_)(void*);
void* ctx;
};
void initAPI();
void initAPI(ImGui::WaterFall* wtf);
void loadModule(std::string path, std::string name);
void broadcastEvent(int eventId);
void loadFromList(std::string path);
extern std::map<std::string, Module_t> modules;
extern std::vector<std::string> moduleNames;