2020-08-07 14:29:06 +02:00
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include <map>
|
|
|
|
#include <filesystem>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <imgui.h>
|
|
|
|
#include <spdlog/spdlog.h>
|
2020-08-11 18:33:42 +02:00
|
|
|
#include <dsp/types.h>
|
|
|
|
#include <dsp/stream.h>
|
2020-09-20 00:19:39 +02:00
|
|
|
#include <gui/waterfall.h>
|
2020-08-12 16:43:44 +02:00
|
|
|
#include <json.hpp>
|
2020-08-07 14:29:06 +02:00
|
|
|
|
2020-09-20 00:19:39 +02:00
|
|
|
#ifdef _WIN32
|
|
|
|
#ifdef SDRPP_IS_CORE
|
|
|
|
#define SDRPP_EXPORT extern "C" __declspec(dllexport)
|
|
|
|
#else
|
|
|
|
#define SDRPP_EXPORT extern "C" __declspec(dllimport)
|
|
|
|
#endif
|
|
|
|
#else
|
2020-09-20 00:26:45 +02:00
|
|
|
#define SDRPP_EXPORT extern
|
2020-09-20 00:19:39 +02:00
|
|
|
#endif
|
|
|
|
|
2020-08-07 14:29:06 +02:00
|
|
|
#ifdef _WIN32
|
|
|
|
#include <Windows.h>
|
2020-09-20 00:19:39 +02:00
|
|
|
#define MOD_EXPORT extern "C" __declspec(dllexport)
|
2020-08-07 14:29:06 +02:00
|
|
|
#else
|
2020-08-11 18:33:42 +02:00
|
|
|
#include <dlfcn.h>
|
2020-09-20 00:19:39 +02:00
|
|
|
#define MOD_EXPORT extern "C"
|
2020-08-07 14:29:06 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
namespace mod {
|
|
|
|
|
|
|
|
struct Module_t {
|
|
|
|
#ifdef _WIN32
|
|
|
|
HINSTANCE inst;
|
|
|
|
#else
|
|
|
|
void* inst;
|
|
|
|
#endif
|
2020-10-01 01:21:15 +02:00
|
|
|
void (*_INIT_)();
|
|
|
|
void* (*_CREATE_INSTANCE)(std::string);
|
|
|
|
void (*_DELETE_INSTANCE)();
|
|
|
|
void (*_STOP_)();
|
2020-08-07 14:29:06 +02:00
|
|
|
void* ctx;
|
|
|
|
};
|
|
|
|
|
2020-10-01 01:21:15 +02:00
|
|
|
struct ModuleInfo_t {
|
|
|
|
char* name;
|
|
|
|
char* description;
|
|
|
|
char* author;
|
|
|
|
char* version;
|
|
|
|
};
|
|
|
|
|
2020-08-12 16:43:44 +02:00
|
|
|
void initAPI(ImGui::WaterFall* wtf);
|
2020-08-07 14:29:06 +02:00
|
|
|
void loadModule(std::string path, std::string name);
|
2020-08-11 18:33:42 +02:00
|
|
|
void broadcastEvent(int eventId);
|
2020-08-12 16:43:44 +02:00
|
|
|
void loadFromList(std::string path);
|
2020-08-07 14:29:06 +02:00
|
|
|
|
|
|
|
extern std::map<std::string, Module_t> modules;
|
|
|
|
extern std::vector<std::string> moduleNames;
|
2020-08-11 18:33:42 +02:00
|
|
|
};
|
|
|
|
|
2020-10-01 01:21:15 +02:00
|
|
|
#define MOD_INFO MOD_EXPORT const mod::ModuleInfo_t _INFO
|