mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-07-10 19:15:31 +02:00
Started work for older system support
This commit is contained in:
63
scanner/src/main.cpp
Normal file
63
scanner/src/main.cpp
Normal file
@ -0,0 +1,63 @@
|
||||
#include <imgui.h>
|
||||
#include <module.h>
|
||||
#include <gui/gui.h>
|
||||
|
||||
SDRPP_MOD_INFO {
|
||||
/* Name: */ "scanner",
|
||||
/* Description: */ "Frequency scanner for SDR++",
|
||||
/* Author: */ "Ryzerth",
|
||||
/* Version: */ 0, 1, 0,
|
||||
/* Max instances */ -1
|
||||
};
|
||||
|
||||
class ScannerModule : public ModuleManager::Instance {
|
||||
public:
|
||||
ScannerModule(std::string name) {
|
||||
this->name = name;
|
||||
gui::menu.registerEntry(name, menuHandler, this, NULL);
|
||||
}
|
||||
|
||||
~ScannerModule() {
|
||||
gui::menu.removeEntry(name);
|
||||
}
|
||||
|
||||
void postInit() {}
|
||||
|
||||
void enable() {
|
||||
enabled = true;
|
||||
}
|
||||
|
||||
void disable() {
|
||||
enabled = false;
|
||||
}
|
||||
|
||||
bool isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
private:
|
||||
static void menuHandler(void* ctx) {
|
||||
ScannerModule* _this = (ScannerModule*)ctx;
|
||||
ImGui::Text("Hello SDR++, my name is %s", _this->name.c_str());
|
||||
}
|
||||
|
||||
std::string name;
|
||||
bool enabled = true;
|
||||
|
||||
};
|
||||
|
||||
MOD_EXPORT void _INIT_() {
|
||||
// Nothing here
|
||||
}
|
||||
|
||||
MOD_EXPORT ModuleManager::Instance* _CREATE_INSTANCE_(std::string name) {
|
||||
return new ScannerModule(name);
|
||||
}
|
||||
|
||||
MOD_EXPORT void _DELETE_INSTANCE_(void* instance) {
|
||||
delete (ScannerModule*)instance;
|
||||
}
|
||||
|
||||
MOD_EXPORT void _END_() {
|
||||
// Nothing here
|
||||
}
|
Reference in New Issue
Block a user