From 51ee02f9da6a2ab1b2b7e948b877b6f616a34ab4 Mon Sep 17 00:00:00 2001 From: Ryzerth Date: Sun, 20 Sep 2020 02:18:01 +0200 Subject: [PATCH] Fixed windows bugs --- core/src/signal_path/vfo_manager.cpp | 1 - recorder/src/main.cpp | 10 ++-- root_dev/config.json | 82 ++++++++++++++-------------- root_dev/module_list.json | 4 +- 4 files changed, 47 insertions(+), 50 deletions(-) diff --git a/core/src/signal_path/vfo_manager.cpp b/core/src/signal_path/vfo_manager.cpp index b7397ad8..f43248f1 100644 --- a/core/src/signal_path/vfo_manager.cpp +++ b/core/src/signal_path/vfo_manager.cpp @@ -119,7 +119,6 @@ int VFOManager::getOutputBlockSize(std::string name) { void VFOManager::updateFromWaterfall(ImGui::WaterFall* wtf) { for (auto const& [name, vfo] : vfos) { if (vfo->wtfVFO->centerOffsetChanged) { - spdlog::info("UH OH: Change!"); vfo->wtfVFO->centerOffsetChanged = false; vfo->dspVFO->setOffset(vfo->wtfVFO->centerOffset); } diff --git a/recorder/src/main.cpp b/recorder/src/main.cpp index 3bd4655b..4dda16cf 100644 --- a/recorder/src/main.cpp +++ b/recorder/src/main.cpp @@ -6,11 +6,10 @@ #include #include #include +#include #define CONCAT(a, b) ((std::string(a) + b).c_str()) -mod::API_t* API; - struct RecorderContext_t { std::string name; dsp::stream* stream; @@ -60,7 +59,6 @@ void sampleRateChanged(void* ctx, float sampleRate, int blockSize) { } MOD_EXPORT void* _INIT_(mod::API_t* _API, ImGuiContext* imctx, std::string _name) { - API = _API; RecorderContext_t* ctx = new RecorderContext_t; ctx->recording = false; ctx->selectedStreamName = ""; @@ -77,7 +75,7 @@ MOD_EXPORT void _NEW_FRAME_(RecorderContext_t* ctx) { MOD_EXPORT void _DRAW_MENU_(RecorderContext_t* ctx) { float menuColumnWidth = ImGui::GetContentRegionAvailWidth(); - std::vector streamNames = API->getStreamNameList(); + std::vector streamNames = audio::getStreamNameList(); std::string nameList; for (std::string name : streamNames) { nameList += name; @@ -124,7 +122,7 @@ MOD_EXPORT void _DRAW_MENU_(RecorderContext_t* ctx) { ctx->samplesWritten = 0; ctx->sampleRate = 48000; ctx->writer = new WavWriter("recordings/" + genFileName("audio_"), 16, 2, 48000); - ctx->stream = API->bindToStreamStereo(ctx->selectedStreamName, streamRemovedHandler, sampleRateChanged, ctx); + ctx->stream = audio::bindToStreamStereo(ctx->selectedStreamName, streamRemovedHandler, sampleRateChanged, ctx); ctx->workerThread = std::thread(_writeWorker, ctx); ctx->recording = true; ctx->startTime = time(0); @@ -136,7 +134,7 @@ MOD_EXPORT void _DRAW_MENU_(RecorderContext_t* ctx) { ctx->stream->stopReader(); ctx->workerThread.join(); ctx->stream->clearReadStop(); - API->unbindFromStreamStereo(ctx->selectedStreamName, ctx->stream); + audio::unbindFromStreamStereo(ctx->selectedStreamName, ctx->stream); ctx->writer->close(); delete ctx->writer; ctx->recording = false; diff --git a/root_dev/config.json b/root_dev/config.json index 81d30f93..a0d5796f 100644 --- a/root_dev/config.json +++ b/root_dev/config.json @@ -1,42 +1,42 @@ -{ - "audio": { - "Radio": { - "device": "Speakers (Realtek High Definiti", - "sampleRate": 48000.0, - "volume": 0.3655914068222046 - } - }, - "bandPlan": "General", - "bandPlanEnabled": true, - "fftHeight": 300, - "frequency": 96914040, - "max": 0.0, - "maximized": false, - "menuWidth": 300, - "min": -51.47058868408203, - "showWaterfall": true, - "source": "HackRF One #0 901868dc282c8f8b", - "sourceSettings": { - "Generic RTL2832U OEM :: 00000001": { - "gains": { - "TUNER": 0.0 - }, - "sampleRate": 2560000 - }, - "HackRF One #0 901868dc282c8f8b": { - "gains": { - "AMP": 0.0, - "LNA": 24.503000259399414, - "VGA": 16.229999542236328 - }, - "sampleRate": 8000000 - }, - "PulseAudio": { - "sampleRate": 96000 - } - }, - "windowSize": { - "h": 1053, - "w": 959 - } +{ + "audio": { + "Radio": { + "device": "Speakers (Realtek High Definiti", + "sampleRate": 48000.0, + "volume": 0.602150559425354 + } + }, + "bandPlan": "General", + "bandPlanEnabled": true, + "fftHeight": 300, + "frequency": 99000000, + "max": 0.0, + "maximized": false, + "menuWidth": 300, + "min": -51.47058868408203, + "showWaterfall": true, + "source": "HackRF One #0 901868dc282c8f8b", + "sourceSettings": { + "Generic RTL2832U OEM :: 00000001": { + "gains": { + "TUNER": 0.0 + }, + "sampleRate": 2560000 + }, + "HackRF One #0 901868dc282c8f8b": { + "gains": { + "AMP": 0.0, + "LNA": 24.503000259399414, + "VGA": 16.229999542236328 + }, + "sampleRate": 8000000 + }, + "PulseAudio": { + "sampleRate": 96000 + } + }, + "windowSize": { + "h": 720, + "w": 1280 + } } \ No newline at end of file diff --git a/root_dev/module_list.json b/root_dev/module_list.json index 15853c86..6036c3d6 100644 --- a/root_dev/module_list.json +++ b/root_dev/module_list.json @@ -1,4 +1,4 @@ { - "Radio": "./radio/radio.so", - "Recorder": "./recorder/recorder.so" + "Radio": "./radio/Release/radio.dll", + "Recorder": "./recorder/Release/recorder.dll" }