diff --git a/CMakeLists.txt b/CMakeLists.txt index 8158e5dd..6d3e51fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,11 +6,6 @@ set(CMAKE_BUILD_TYPE "RelWithDebInfo") # Compiler config set(CMAKE_CXX_FLAGS "-O2 /std:c++17") -# HackRF -include_directories(sdrpp "C:/Program Files/PothosSDR/include/libhackrf/") -link_directories(sdrpp "C:/Program Files/PothosSDR/lib/") -link_libraries(hackrf) - # Volk include_directories(sdrpp "C:/Program Files/PothosSDR/include/volk/") link_libraries(volk) diff --git a/readme.md b/readme.md new file mode 100644 index 00000000..bff25647 --- /dev/null +++ b/readme.md @@ -0,0 +1,41 @@ +## SDR++, The bloat-free SDR software. +SDR++ is a cross-platform and open source SDR software with the aim of being bloat free and simple to use. + +# Current Features +* Uses SoapySDR for wide hardware support +* Hardware accelerated graphics (OpenGL + ImGui) +* SIMD accelerated DSP (parts of the DSP are still missing) +* Cross-platform +* Full waterfall update when possible. Makes browsing signals easier and more pleasant + +# Comming soon +* Multi-VFO +* Plugins +* Digital demodulators and decoders + +## Building on Windows +# Requirements +* cmake +* vcpkg (for the packages listed below) +* fftw3 +* portaudio +* glfw +* glew +* PothosSDR (for libvolk and SoapySDR) + +``` +mkdir build +cd build +cmake .. "-DCMAKE_TOOLCHAIN_FILE=C:/Users/Alex/vcpkg/scripts/buildsystems/vcpkg.cmake" -G "Visual Studio 15 2017 Win64" +cmake --build . --config Release +``` + +## Building on Linux +comming soon :) + +## Building on OSX +comming soon as well :) + +## Contributing +Feel free to issue pull request and report bugs via the github issues. +I will soon publish a contributing.md listing the code style to use. \ No newline at end of file diff --git a/res/icons/logo.png b/res/icons/logo.png new file mode 100644 index 00000000..6b4ec18a Binary files /dev/null and b/res/icons/logo.png differ diff --git a/src/icons.cpp b/src/icons.cpp index 012ea674..3a77362a 100644 --- a/src/icons.cpp +++ b/src/icons.cpp @@ -4,6 +4,7 @@ #include namespace icons { + ImTextureID LOGO; ImTextureID PLAY; ImTextureID STOP; ImTextureID PLAY_RAW; @@ -24,6 +25,7 @@ namespace icons { } void load() { + LOGO = (ImTextureID)loadTexture("res/icons/logo.png"); PLAY_RAW = (ImTextureID)loadTexture("res/icons/play_raw.png"); STOP_RAW = (ImTextureID)loadTexture("res/icons/stop_raw.png"); } diff --git a/src/icons.h b/src/icons.h index 47ba1a8f..92dca23d 100644 --- a/src/icons.h +++ b/src/icons.h @@ -4,6 +4,7 @@ #include namespace icons { + extern ImTextureID LOGO; extern ImTextureID PLAY; extern ImTextureID STOP; extern ImTextureID PLAY_RAW; diff --git a/src/main.cpp b/src/main.cpp index b8677e62..97ba6b06 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #ifdef _WIN32 @@ -34,7 +35,7 @@ int main() { glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // Required on Mac // Create window with graphics context - GLFWwindow* window = glfwCreateWindow(1280, 720, "SDR++ v0.1.0 (Built at " __TIME__ ", " __DATE__ ")", NULL, NULL); + GLFWwindow* window = glfwCreateWindow(1280, 720, "SDR++ v" VERSION_STR " (Built at " __TIME__ ", " __DATE__ ")", NULL, NULL); if (window == NULL) return 1; glfwMakeContextCurrent(window); diff --git a/src/main_window.cpp b/src/main_window.cpp index 8b2957de..e2e11dbe 100644 --- a/src/main_window.cpp +++ b/src/main_window.cpp @@ -211,13 +211,6 @@ void drawWindow() { fSel.setFrequency(wtf.getCenterFrequency() + wtf.getVFOOfset()); } - // vfoFreq = wtf.getVFOOfset() + freq; - - // if (vfoFreq != lastVfoFreq) { - // lastVfoFreq = vfoFreq; - // sigPath.setVFOFrequency(vfoFreq - freq); - // } - if (volume != lastVolume) { lastVolume = volume; sigPath.setVolume(volume); @@ -239,26 +232,6 @@ void drawWindow() { bw = sampleRate; } - - // if (ImGui::BeginMenuBar()) - // { - // if (ImGui::BeginMenu("File")) - // { - // ImGui::EndMenu(); - // } - // if (ImGui::BeginMenu("Edit")) - // { - // ImGui::MenuItem("Show Example Window", "", &showExample); - // ImGui::EndMenu(); - // } - // ImGui::EndMenuBar(); - // } - - if (showExample) { - ImGui::ShowDemoWindow(); - } - - ImVec2 vMin = ImGui::GetWindowContentRegionMin(); ImVec2 vMax = ImGui::GetWindowContentRegionMax(); @@ -290,12 +263,16 @@ void drawWindow() { fSel.draw(); + ImGui::SetCursorPosY(ImGui::GetCursorPosY() - 8); + ImGui::SameLine(ImGui::GetWindowWidth() - 40); + ImGui::Image(icons::LOGO, ImVec2(30, 30)); + ImGui::Columns(3, "WindowColumns", false); ImVec2 winSize = ImGui::GetWindowSize(); ImGui::SetColumnWidth(0, 300); - ImGui::SetColumnWidth(1, winSize.x - 300 - 50); - ImGui::SetColumnWidth(2, 50); + ImGui::SetColumnWidth(1, winSize.x - 300 - 60); + ImGui::SetColumnWidth(2, 60); // Left Column ImGui::BeginChild("Left Column"); @@ -303,7 +280,14 @@ void drawWindow() { if (ImGui::CollapsingHeader("Source")) { ImGui::PushItemWidth(ImGui::GetWindowSize().x); ImGui::Combo("##_0_", &devId, soapy.txtDevList.c_str()); - ImGui::Combo("##_1_", &srId, soapy.txtSampleRateList.c_str()); + + if (!playing) { + ImGui::Combo("##_1_", &srId, soapy.txtSampleRateList.c_str()); + } + else { + ImGui::Text("%s Samples/s", soapy.txtSampleRateList.c_str()); + } + if (ImGui::Button("Refresh")) { soapy.refresh(); @@ -380,23 +364,26 @@ void drawWindow() { ImGui::NextColumn(); ImGui::Text("Zoom"); - ImGui::NewLine(); ImGui::VSliderFloat("##_7_", ImVec2(20.0f, 150.0f), &bw, 1000.0f, sampleRate, ""); - ImGui::Text("Max"); ImGui::NewLine(); + + ImGui::Text("Max"); ImGui::VSliderFloat("##_8_", ImVec2(20.0f, 150.0f), &fftMax, -100.0f, 0.0f, ""); - ImGui::Text("Min"); ImGui::NewLine(); + + ImGui::Text("Min"); ImGui::VSliderFloat("##_9_", ImVec2(20.0f, 150.0f), &fftMin, -100.0f, 0.0f, ""); if (bw != lastBW) { lastBW = bw; - wtf.setViewOffset(wtf.getVFOOfset()); wtf.setViewBandwidth(bw); + wtf.setViewOffset(wtf.getVFOOfset()); } + + wtf.setFFTMin(fftMin); wtf.setFFTMax(fftMax); wtf.setWaterfallMin(fftMin); diff --git a/src/signal_path.cpp b/src/signal_path.cpp index 5718b281..30614049 100644 --- a/src/signal_path.cpp +++ b/src/signal_path.cpp @@ -32,17 +32,6 @@ void SignalPath::init(uint64_t sampleRate, int fftRate, int fftSize, dsp::stream audio.init(&audioResamp.output, 16); } - -dsp::DCBiasRemover dcBiasRemover; - dsp::Splitter split; - dsp::BlockDecimator fftBlockDec; - dsp::HandlerSink fftHandlerSink; - dsp::VFO mainVFO; - dsp::FMDemodulator demod; - dsp::AMDemodulator amDemod; - dsp::FloatResampler audioResamp; - io::AudioSink audio; - void SignalPath::setSampleRate(float sampleRate) { dcBiasRemover.stop(); split.stop(); diff --git a/src/styles.h b/src/styles.h index 20c042c1..b3ba260e 100644 --- a/src/styles.h +++ b/src/styles.h @@ -13,8 +13,4 @@ void setImguiStyle(ImGuiIO& io) { ImGui::StyleColorsDark(); //ImGui::StyleColorsLight(); - - //ImGui::GetStyle().Colors[ImGuiCol_Header] = ImVec4(0.235f, 0.235f, 0.235f, 1.0f); - //ImGui::GetStyle().Colors[ImGuiCol_HeaderHovered] = ImVec4(0.235f, 0.235f, 0.235f, 1.0f); - //ImGui::GetStyle().Colors[ImGuiCol_HeaderActive] = ImVec4(0.235f, 0.235f, 0.235f, 1.0f); } \ No newline at end of file diff --git a/src/version.h b/src/version.h new file mode 100644 index 00000000..fed749b8 --- /dev/null +++ b/src/version.h @@ -0,0 +1,3 @@ +#pragma once + +#define VERSION_STR "0.2.1_alpha" \ No newline at end of file