Fixed windows bugs

This commit is contained in:
Ryzerth 2020-09-20 02:18:01 +02:00
parent ab8ce4c53f
commit 51ee02f9da
4 changed files with 47 additions and 50 deletions

View File

@ -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);
}

View File

@ -6,11 +6,10 @@
#include <dsp/stream.h>
#include <thread>
#include <ctime>
#include <signal_path/audio.h>
#define CONCAT(a, b) ((std::string(a) + b).c_str())
mod::API_t* API;
struct RecorderContext_t {
std::string name;
dsp::stream<dsp::StereoFloat_t>* 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<std::string> streamNames = API->getStreamNameList();
std::vector<std::string> 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;

View File

@ -3,13 +3,13 @@
"Radio": {
"device": "Speakers (Realtek High Definiti",
"sampleRate": 48000.0,
"volume": 0.3655914068222046
"volume": 0.602150559425354
}
},
"bandPlan": "General",
"bandPlanEnabled": true,
"fftHeight": 300,
"frequency": 96914040,
"frequency": 99000000,
"max": 0.0,
"maximized": false,
"menuWidth": 300,
@ -36,7 +36,7 @@
}
},
"windowSize": {
"h": 1053,
"w": 959
"h": 720,
"w": 1280
}
}

View File

@ -1,4 +1,4 @@
{
"Radio": "./radio/radio.so",
"Recorder": "./recorder/recorder.so"
"Radio": "./radio/Release/radio.dll",
"Recorder": "./recorder/Release/recorder.dll"
}