mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-01-24 08:44:44 +01:00
fixed zoom bug
This commit is contained in:
parent
2c84123158
commit
1fcd783dd9
@ -34,7 +34,10 @@ namespace core {
|
||||
void setInputSampleRate(double samplerate) {
|
||||
// NOTE: Zoom controls won't work
|
||||
gui::waterfall.setBandwidth(samplerate);
|
||||
gui::waterfall.setViewOffset(0);
|
||||
gui::waterfall.setViewBandwidth(samplerate);
|
||||
sigpath::signalPath.setSampleRate(samplerate);
|
||||
setViewBandwidthSlider(samplerate);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1,14 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
project(demo)
|
||||
|
||||
if (MSVC)
|
||||
set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc")
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -fpermissive")
|
||||
endif (MSVC)
|
||||
|
||||
file(GLOB SRC "src/*.cpp")
|
||||
|
||||
add_library(demo SHARED ${SRC})
|
||||
target_link_libraries(demo PRIVATE sdrpp_core)
|
||||
set_target_properties(demo PROPERTIES PREFIX "")
|
@ -1,51 +0,0 @@
|
||||
#include <imgui.h>
|
||||
#include <spdlog/spdlog.h>
|
||||
#include <module.h>
|
||||
#include <gui/gui.h>
|
||||
|
||||
#define CONCAT(a, b) ((std::string(a) + b).c_str())
|
||||
|
||||
MOD_INFO {
|
||||
/* Name: */ "demo",
|
||||
/* Description: */ "Demo module for SDR++",
|
||||
/* Author: */ "Ryzerth",
|
||||
/* Version: */ "0.1.0"
|
||||
};
|
||||
|
||||
class DemoModule {
|
||||
public:
|
||||
DemoModule(std::string name) {
|
||||
this->name = name;
|
||||
gui::menu.registerEntry(name, menuHandler, this);
|
||||
spdlog::info("DemoModule '{0}': Instance created!", name);
|
||||
}
|
||||
|
||||
~DemoModule() {
|
||||
spdlog::info("DemoModule '{0}': Instance deleted!", name);
|
||||
}
|
||||
|
||||
private:
|
||||
static void menuHandler(void* ctx) {
|
||||
DemoModule* _this = (DemoModule*)ctx;
|
||||
ImGui::Text("Hi from %s!", _this->name.c_str());
|
||||
}
|
||||
|
||||
std::string name;
|
||||
|
||||
};
|
||||
|
||||
MOD_EXPORT void _INIT_() {
|
||||
// Do your one time init here
|
||||
}
|
||||
|
||||
MOD_EXPORT void* _CREATE_INSTANCE_(std::string name) {
|
||||
return new DemoModule(name);
|
||||
}
|
||||
|
||||
MOD_EXPORT void _DELETE_INSTANCE_(void* instance) {
|
||||
delete (DemoModule*)instance;
|
||||
}
|
||||
|
||||
MOD_EXPORT void _STOP_() {
|
||||
// Do your one shutdown here
|
||||
}
|
@ -3,7 +3,7 @@
|
||||
"bandPlanEnabled": true,
|
||||
"centerTuning": false,
|
||||
"fftHeight": 300,
|
||||
"frequency": 100100000,
|
||||
"frequency": 98712000,
|
||||
"max": 0.0,
|
||||
"maximized": true,
|
||||
"menuOrder": [
|
||||
@ -41,7 +41,7 @@
|
||||
"Radio": {
|
||||
"muted": false,
|
||||
"sink": "Audio",
|
||||
"volume": 0.4642857015132904
|
||||
"volume": 0.2908163368701935
|
||||
},
|
||||
"Radio 1": {
|
||||
"muted": false,
|
||||
|
@ -35,7 +35,7 @@
|
||||
"LNA": 24.503000259399414,
|
||||
"VGA": 16.332000732421875
|
||||
},
|
||||
"sampleRate": 8000000.0
|
||||
"sampleRate": 16000000.0
|
||||
},
|
||||
"Microphone (Realtek High Definition Audio)": {
|
||||
"sampleRate": 96000.0
|
||||
|
@ -1,14 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
project(soapy)
|
||||
|
||||
if (MSVC)
|
||||
set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc")
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -fpermissive")
|
||||
endif (MSVC)
|
||||
|
||||
file(GLOB SRC "src/*.cpp")
|
||||
|
||||
add_library(soapy SHARED ${SRC})
|
||||
target_link_libraries(soapy PRIVATE sdrpp_core)
|
||||
set_target_properties(soapy PROPERTIES PREFIX "")
|
@ -1,87 +0,0 @@
|
||||
#include <imgui.h>
|
||||
#include <spdlog/spdlog.h>
|
||||
#include <module.h>
|
||||
#include <gui/gui.h>
|
||||
#include <signal_path/signal_path.h>
|
||||
|
||||
#define CONCAT(a, b) ((std::string(a) + b).c_str())
|
||||
|
||||
MOD_INFO {
|
||||
/* Name: */ "soapy",
|
||||
/* Description: */ "SoapySDR input module for SDR++",
|
||||
/* Author: */ "Ryzerth",
|
||||
/* Version: */ "0.1.0"
|
||||
};
|
||||
|
||||
class SoapyModule {
|
||||
public:
|
||||
SoapyModule(std::string name) {
|
||||
this->name = name;
|
||||
|
||||
handler.ctx = this;
|
||||
handler.selectHandler = menuSelected;
|
||||
handler.deselectHandler = menuDeselected;
|
||||
handler.menuHandler = menuHandler;
|
||||
handler.startHandler = start;
|
||||
handler.stopHandler = stop;
|
||||
handler.tuneHandler = tune;
|
||||
sigpath::sourceManager.registerSource("SoapySDR", &handler);
|
||||
spdlog::info("SoapyModule '{0}': Instance created!", name);
|
||||
}
|
||||
|
||||
~SoapyModule() {
|
||||
spdlog::info("SoapyModule '{0}': Instance deleted!", name);
|
||||
}
|
||||
|
||||
private:
|
||||
static void menuSelected(void* ctx) {
|
||||
SoapyModule* _this = (SoapyModule*)ctx;
|
||||
spdlog::info("SoapyModule '{0}': Menu Select!", _this->name);
|
||||
}
|
||||
|
||||
static void menuDeselected(void* ctx) {
|
||||
SoapyModule* _this = (SoapyModule*)ctx;
|
||||
spdlog::info("SoapyModule '{0}': Menu Deselect!", _this->name);
|
||||
}
|
||||
|
||||
static void start(void* ctx) {
|
||||
SoapyModule* _this = (SoapyModule*)ctx;
|
||||
spdlog::info("SoapyModule '{0}': Start!", _this->name);
|
||||
}
|
||||
|
||||
static void stop(void* ctx) {
|
||||
SoapyModule* _this = (SoapyModule*)ctx;
|
||||
spdlog::info("SoapyModule '{0}': Stop!", _this->name);
|
||||
}
|
||||
|
||||
static void tune(double freq, void* ctx) {
|
||||
SoapyModule* _this = (SoapyModule*)ctx;
|
||||
spdlog::info("SoapyModule '{0}': Tune: {1}!", _this->name, freq);
|
||||
}
|
||||
|
||||
|
||||
static void menuHandler(void* ctx) {
|
||||
SoapyModule* _this = (SoapyModule*)ctx;
|
||||
ImGui::Text("Hi from %s!", _this->name.c_str());
|
||||
}
|
||||
|
||||
std::string name;
|
||||
dsp::stream<dsp::complex_t> stream;
|
||||
SourceManager::SourceHandler handler;
|
||||
};
|
||||
|
||||
MOD_EXPORT void _INIT_() {
|
||||
// Do your one time init here
|
||||
}
|
||||
|
||||
MOD_EXPORT void* _CREATE_INSTANCE_(std::string name) {
|
||||
return new SoapyModule(name);
|
||||
}
|
||||
|
||||
MOD_EXPORT void _DELETE_INSTANCE_(void* instance) {
|
||||
delete (SoapyModule*)instance;
|
||||
}
|
||||
|
||||
MOD_EXPORT void _STOP_() {
|
||||
// Do your one shutdown here
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user