From 1fcd783dd9e2a7ec3978e701d7ec6ae763966ca2 Mon Sep 17 00:00:00 2001 From: Ryzerth Date: Mon, 14 Dec 2020 18:14:04 +0100 Subject: [PATCH] fixed zoom bug --- core/src/core.cpp | 3 ++ demo/CMakeLists.txt | 14 ----- demo/src/main.cpp | 51 ------------------ root_dev/config.json | 4 +- root_dev/soapy_source_config.json | 2 +- source_demo/CMakeLists.txt | 14 ----- source_demo/src/main.cpp | 87 ------------------------------- 7 files changed, 6 insertions(+), 169 deletions(-) delete mode 100644 demo/CMakeLists.txt delete mode 100644 demo/src/main.cpp delete mode 100644 source_demo/CMakeLists.txt delete mode 100644 source_demo/src/main.cpp diff --git a/core/src/core.cpp b/core/src/core.cpp index cc70054..041a893 100644 --- a/core/src/core.cpp +++ b/core/src/core.cpp @@ -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); } }; diff --git a/demo/CMakeLists.txt b/demo/CMakeLists.txt deleted file mode 100644 index aed95f1..0000000 --- a/demo/CMakeLists.txt +++ /dev/null @@ -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 "") \ No newline at end of file diff --git a/demo/src/main.cpp b/demo/src/main.cpp deleted file mode 100644 index 4ae5579..0000000 --- a/demo/src/main.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include -#include -#include -#include - -#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 -} \ No newline at end of file diff --git a/root_dev/config.json b/root_dev/config.json index 2a539b6..c5bec38 100644 --- a/root_dev/config.json +++ b/root_dev/config.json @@ -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, diff --git a/root_dev/soapy_source_config.json b/root_dev/soapy_source_config.json index 6fd6e95..c919d06 100644 --- a/root_dev/soapy_source_config.json +++ b/root_dev/soapy_source_config.json @@ -35,7 +35,7 @@ "LNA": 24.503000259399414, "VGA": 16.332000732421875 }, - "sampleRate": 8000000.0 + "sampleRate": 16000000.0 }, "Microphone (Realtek High Definition Audio)": { "sampleRate": 96000.0 diff --git a/source_demo/CMakeLists.txt b/source_demo/CMakeLists.txt deleted file mode 100644 index 56147b8..0000000 --- a/source_demo/CMakeLists.txt +++ /dev/null @@ -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 "") \ No newline at end of file diff --git a/source_demo/src/main.cpp b/source_demo/src/main.cpp deleted file mode 100644 index 8617ced..0000000 --- a/source_demo/src/main.cpp +++ /dev/null @@ -1,87 +0,0 @@ -#include -#include -#include -#include -#include - -#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 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 -} \ No newline at end of file