diff --git a/core/src/credits.cpp b/core/src/credits.cpp index c2204f82..1384f9cc 100644 --- a/core/src/credits.cpp +++ b/core/src/credits.cpp @@ -35,6 +35,7 @@ namespace sdrpp_credits { }; const char* patrons[] = { + "Bob Logan", "Croccydile", "Daniele D'Agnelli", "EB3FRN", diff --git a/core/src/dsp/vfo.h b/core/src/dsp/vfo.h index 4edb56bd..63190b3e 100644 --- a/core/src/dsp/vfo.h +++ b/core/src/dsp/vfo.h @@ -46,6 +46,7 @@ namespace dsp { if (running) { return; } xlator.start(); resamp.start(); + running = true; } void stop() { @@ -53,6 +54,7 @@ namespace dsp { if (!running) { return; } xlator.stop(); resamp.stop(); + running = false; } void setInSampleRate(float inSampleRate) { diff --git a/core/src/gui/main_window.cpp b/core/src/gui/main_window.cpp index 9f29fd0d..954dbd6d 100644 --- a/core/src/gui/main_window.cpp +++ b/core/src/gui/main_window.cpp @@ -188,6 +188,7 @@ void MainWindow::init() { gui::waterfall.setFFTHeight(fftHeight); tuningMode = core::configManager.conf["centerTuning"] ? tuner::TUNER_MODE_CENTER : tuner::TUNER_MODE_NORMAL; + gui::waterfall.VFOMoveSingleClick = (tuningMode == tuner::TUNER_MODE_CENTER); core::configManager.release(); @@ -397,6 +398,7 @@ void MainWindow::draw() { ImGui::PushID(ImGui::GetID("sdrpp_ena_st_btn")); if (ImGui::ImageButton(icons::CENTER_TUNING, ImVec2(30, 30), ImVec2(0, 0), ImVec2(1, 1), 5)) { tuningMode = tuner::TUNER_MODE_NORMAL; + gui::waterfall.VFOMoveSingleClick = false; core::configManager.acquire(); core::configManager.conf["centerTuning"] = false; core::configManager.release(true); @@ -407,6 +409,7 @@ void MainWindow::draw() { ImGui::PushID(ImGui::GetID("sdrpp_dis_st_btn")); if (ImGui::ImageButton(icons::NORMAL_TUNING, ImVec2(30, 30), ImVec2(0, 0), ImVec2(1, 1), 5)) { tuningMode = tuner::TUNER_MODE_CENTER; + gui::waterfall.VFOMoveSingleClick = true; tuner::tune(tuner::TUNER_MODE_CENTER, gui::waterfall.selectedVFO, gui::freqSelect.frequency); core::configManager.acquire(); core::configManager.conf["centerTuning"] = true; @@ -525,6 +528,8 @@ void MainWindow::draw() { firstMenuRender = true; } + ImGui::Checkbox("WF Single Click", &gui::waterfall.VFOMoveSingleClick); + ImGui::Spacing(); } diff --git a/core/src/gui/widgets/waterfall.cpp b/core/src/gui/widgets/waterfall.cpp index 970388ef..f0269fed 100644 --- a/core/src/gui/widgets/waterfall.cpp +++ b/core/src/gui/widgets/waterfall.cpp @@ -246,6 +246,7 @@ namespace ImGui { ImGuiButtonFlags_MouseButtonLeft | ImGuiButtonFlags_PressedOnClick); bool draging = ImGui::IsMouseDragging(ImGuiMouseButton_Left) && ImGui::IsWindowFocused(); + mouseInFFTResize = (dragOrigin.x > widgetPos.x && dragOrigin.x < widgetPos.x + widgetSize.x && dragOrigin.y >= widgetPos.y + newFFTAreaHeight - 2 && dragOrigin.y <= widgetPos.y + newFFTAreaHeight + 2); mouseInFreq = IS_IN_AREA(dragOrigin, freqAreaMin, freqAreaMax); mouseInFFT = IS_IN_AREA(dragOrigin, fftAreaMin, fftAreaMax); mouseInWaterfall = IS_IN_AREA(dragOrigin, wfMin, wfMax); @@ -266,15 +267,31 @@ namespace ImGui { // Deselect everything if the mouse is released if (!ImGui::IsMouseDown(ImGuiMouseButton_Left)) { + if (fftResizeSelect) { + FFTAreaHeight = newFFTAreaHeight; + onResize(); + } + + fftResizeSelect = false; freqScaleSelect = false; vfoSelect = false; vfoBorderSelect = false; lastDrag = 0; } - // If mouse was clicked, check what was clicked - if (mouseClicked) { - bool targetFound = false; + bool targetFound = false; + + // If the mouse was clicked anywhere in the waterfall, check if the resize was clicked + if (mouseInFFTResize) { + ImGui::SetMouseCursor(ImGuiMouseCursor_ResizeNS); + if (ImGui::IsMouseClicked(ImGuiMouseButton_Left)) { + fftResizeSelect = true; + targetFound = true; + } + } + + // If mouse was clicked inside the central part, check what was clicked + if (mouseClicked && !targetFound) { mouseDownPos = mousePos; // First, check if a VFO border was selected @@ -311,6 +328,16 @@ namespace ImGui { } } + // If the FFT resize bar was selected, resize FFT accordingly + if (fftResizeSelect) { + ImGui::SetMouseCursor(ImGuiMouseCursor_ResizeNS); + newFFTAreaHeight = mousePos.y - widgetPos.y; + newFFTAreaHeight = std::clamp(newFFTAreaHeight, 150, widgetSize.y - 50); + ImGui::GetForegroundDrawList()->AddLine(ImVec2(widgetPos.x, newFFTAreaHeight + widgetPos.y), ImVec2(widgetEndPos.x, newFFTAreaHeight + widgetPos.y), + ImGui::GetColorU32(ImGuiCol_SeparatorActive)); + return; + } + // If a vfo border is selected, resize VFO accordingly if (vfoBorderSelect) { ImGui::SetMouseCursor(ImGuiMouseCursor_ResizeEW); @@ -418,7 +445,7 @@ namespace ImGui { } // Finally, if nothing else was selected, just move the VFO - if (ImGui::IsMouseDown(ImGuiMouseButton_Left) && (mouseInFFT|mouseInWaterfall) && (mouseMoved || hoveredVFOName == "")) { + if ((VFOMoveSingleClick ? ImGui::IsMouseClicked(ImGuiMouseButton_Left) : ImGui::IsMouseDown(ImGuiMouseButton_Left)) && (mouseInFFT|mouseInWaterfall) && (mouseMoved || hoveredVFOName == "")) { if (selVfo != NULL) { int refCenter = mousePos.x - (widgetPos.x + 50); if (refCenter >= 0 && refCenter < dataWidth) { @@ -808,33 +835,6 @@ namespace ImGui { return; } - // Handle fft resize - if (!gui::mainWindow.lockWaterfallControls && !inputHandled) { - ImVec2 winSize = ImGui::GetWindowSize(); - ImVec2 mousePos = ImGui::GetMousePos(); - mousePos.x -= widgetPos.x; - mousePos.y -= widgetPos.y; - bool click = ImGui::IsMouseClicked(ImGuiMouseButton_Left); - bool down = ImGui::IsMouseDown(ImGuiMouseButton_Left); - if (draggingFW) { - newFFTAreaHeight = mousePos.y; - newFFTAreaHeight = std::clamp(newFFTAreaHeight, 150, widgetSize.y - 50); - ImGui::GetForegroundDrawList()->AddLine(ImVec2(widgetPos.x, newFFTAreaHeight + widgetPos.y), ImVec2(widgetEndPos.x, newFFTAreaHeight + widgetPos.y), - ImGui::GetColorU32(ImGuiCol_SeparatorActive)); - } - if (mousePos.y >= newFFTAreaHeight - 2 && mousePos.y <= newFFTAreaHeight + 2 && mousePos.x > 0 && mousePos.x < widgetSize.x) { - ImGui::SetMouseCursor(ImGuiMouseCursor_ResizeNS); - if (click) { - draggingFW = true; - } - } - if(!down && draggingFW) { - draggingFW = false; - FFTAreaHeight = newFFTAreaHeight; - onResize(); - } - } - buf_mtx.unlock(); } diff --git a/core/src/gui/widgets/waterfall.h b/core/src/gui/widgets/waterfall.h index 55e4c798..42ccf58e 100644 --- a/core/src/gui/widgets/waterfall.h +++ b/core/src/gui/widgets/waterfall.h @@ -137,6 +137,7 @@ namespace ImGui { bool bandplanEnabled = false; bandplan::BandPlan_t* bandplan = NULL; + bool mouseInFFTResize = false; bool mouseInFreq = false; bool mouseInFFT = false; bool mouseInWaterfall = false; @@ -175,6 +176,7 @@ namespace ImGui { }; bool inputHandled = false; + bool VFOMoveSingleClick = false; Event onInputProcess; enum { @@ -279,6 +281,7 @@ namespace ImGui { int bandPlanPos = BANDPLAN_POS_BOTTOM; // UI Select elements + bool fftResizeSelect = false; bool freqScaleSelect = false; bool vfoSelect = false; bool vfoBorderSelect = false; diff --git a/docker_builds/debian_bullseye/do_build.sh b/docker_builds/debian_bullseye/do_build.sh index b980347a..84bcb26f 100644 --- a/docker_builds/debian_bullseye/do_build.sh +++ b/docker_builds/debian_bullseye/do_build.sh @@ -21,4 +21,4 @@ cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD make -j2 cd .. -sh make_debian_package.sh ./build libfftw3-dev libglfw3-dev libglew-dev libvolk2-dev \ No newline at end of file +sh make_debian_package.sh ./build 'libfftw3-dev, libglfw3-dev, libglew-dev, libvolk2-dev, librtaudio-dev' \ No newline at end of file diff --git a/docker_builds/debian_buster/do_build.sh b/docker_builds/debian_buster/do_build.sh index a0b294a0..6f144428 100644 --- a/docker_builds/debian_buster/do_build.sh +++ b/docker_builds/debian_buster/do_build.sh @@ -21,4 +21,4 @@ cmake .. -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_BLADERF_SOURCE=OFF -DOPT_BUIL make -j2 cd .. -sh make_debian_package.sh ./build libfftw3-dev libglfw3-dev libglew-dev libvolk1-dev \ No newline at end of file +sh make_debian_package.sh ./build 'libfftw3-dev, libglfw3-dev, libglew-dev, libvolk1-dev, librtaudio-dev' \ No newline at end of file diff --git a/docker_builds/debian_sid/do_build.sh b/docker_builds/debian_sid/do_build.sh index b980347a..84bcb26f 100644 --- a/docker_builds/debian_sid/do_build.sh +++ b/docker_builds/debian_sid/do_build.sh @@ -21,4 +21,4 @@ cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD make -j2 cd .. -sh make_debian_package.sh ./build libfftw3-dev libglfw3-dev libglew-dev libvolk2-dev \ No newline at end of file +sh make_debian_package.sh ./build 'libfftw3-dev, libglfw3-dev, libglew-dev, libvolk2-dev, librtaudio-dev' \ No newline at end of file diff --git a/docker_builds/ubuntu_bionic/do_build.sh b/docker_builds/ubuntu_bionic/do_build.sh index c1243d54..db1b4a59 100644 --- a/docker_builds/ubuntu_bionic/do_build.sh +++ b/docker_builds/ubuntu_bionic/do_build.sh @@ -40,4 +40,4 @@ make -j2 # Generate package cd .. -sh make_debian_package.sh ./build libfftw3-dev libglfw3-dev libglew-dev libvolk1-dev \ No newline at end of file +sh make_debian_package.sh ./build 'libfftw3-dev, libglfw3-dev, libglew-dev, libvolk1-dev, librtaudio-dev' \ No newline at end of file diff --git a/docker_builds/ubuntu_focal/do_build.sh b/docker_builds/ubuntu_focal/do_build.sh index b980347a..84bcb26f 100644 --- a/docker_builds/ubuntu_focal/do_build.sh +++ b/docker_builds/ubuntu_focal/do_build.sh @@ -21,4 +21,4 @@ cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD make -j2 cd .. -sh make_debian_package.sh ./build libfftw3-dev libglfw3-dev libglew-dev libvolk2-dev \ No newline at end of file +sh make_debian_package.sh ./build 'libfftw3-dev, libglfw3-dev, libglew-dev, libvolk2-dev, librtaudio-dev' \ No newline at end of file diff --git a/docker_builds/ubuntu_groovy/do_build.sh b/docker_builds/ubuntu_groovy/do_build.sh index b980347a..84bcb26f 100644 --- a/docker_builds/ubuntu_groovy/do_build.sh +++ b/docker_builds/ubuntu_groovy/do_build.sh @@ -21,4 +21,4 @@ cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD make -j2 cd .. -sh make_debian_package.sh ./build libfftw3-dev libglfw3-dev libglew-dev libvolk2-dev \ No newline at end of file +sh make_debian_package.sh ./build 'libfftw3-dev, libglfw3-dev, libglew-dev, libvolk2-dev, librtaudio-dev' \ No newline at end of file diff --git a/docker_builds/ubuntu_hirsute/do_build.sh b/docker_builds/ubuntu_hirsute/do_build.sh index b980347a..84bcb26f 100644 --- a/docker_builds/ubuntu_hirsute/do_build.sh +++ b/docker_builds/ubuntu_hirsute/do_build.sh @@ -21,4 +21,4 @@ cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD make -j2 cd .. -sh make_debian_package.sh ./build libfftw3-dev libglfw3-dev libglew-dev libvolk2-dev \ No newline at end of file +sh make_debian_package.sh ./build 'libfftw3-dev, libglfw3-dev, libglew-dev, libvolk2-dev, librtaudio-dev' \ No newline at end of file diff --git a/radio/src/am_demod.h b/radio/src/am_demod.h index 3d7b5398..0135ea4f 100644 --- a/radio/src/am_demod.h +++ b/radio/src/am_demod.h @@ -194,7 +194,7 @@ private: } const float bwMax = 15000; - const float bwMin = 6000; + const float bwMin = 1000; const float bbSampRate = 15000; std::string uiPrefix; diff --git a/radio/src/fm_demod.h b/radio/src/fm_demod.h index 3a247ae6..36258807 100644 --- a/radio/src/fm_demod.h +++ b/radio/src/fm_demod.h @@ -183,7 +183,7 @@ private: } const float bwMax = 50000; - const float bwMin = 6000; + const float bwMin = 1000; const float bbSampRate = 50000; std::string uiPrefix; diff --git a/readme.md b/readme.md index be1bf679..aa6b60dd 100644 --- a/readme.md +++ b/readme.md @@ -338,7 +338,7 @@ To solve, this, simply downgrade to libusb1.3 If you also have the SoapySDR module loaded (not necessarily enabled), this is a bug in libhackrf. It's caused by libhackrf not checking if it's already initialized. The solution until a fixed libhackrf version is released is to completely remove the soapy_source module from SDR++. To do this, delete `modules/soapy_source.dll` on windows -or `/usr/share/sdrpp/plugins/soapy_source.so` on linux. +or `/usr/lib/sdrpp/plugins/soapy_source.so` on linux. ## Issue not listed here? @@ -353,6 +353,7 @@ I will soon publish a contributing.md listing the code style to use. ## Patrons +* Bob Logan * Croccydile * [Daniele D'Agnelli](https://linkedin.com/in/dagnelli) * [EB3FRN](https://www.eb3frn.net/) diff --git a/rpi_install.sh b/rpi_install.sh new file mode 100644 index 00000000..584e13b9 --- /dev/null +++ b/rpi_install.sh @@ -0,0 +1,22 @@ +#!/bin/sh +set -e + +[ $(id -u) = 0 ] && echo "Please do not run this script as root" && exit 100 + +echo "Installing dependencies" +sudo apt update +sudo apt install -y build-essential cmake git libfftw3-dev libglfw3-dev libglew-dev libvolk2-dev libsoapysdr-dev libairspyhf-dev libairspy-dev \ + libiio-dev libad9361-dev librtaudio-dev libhackrf-dev librtlsdr-dev libbladerf-dev liblimesuite-dev p7zip-full wget + +echo "Preparing build" +mkdir -p build +cd build +cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON + +echo "Building" +make + +echo "Installing" +sudo make install + +echo "Done!" \ No newline at end of file