Fixed a tone of stuff + new features

This commit is contained in:
Ryzerth
2020-12-08 04:36:37 +01:00
parent 929ca50b06
commit c3a8865dd3
31 changed files with 644 additions and 296 deletions

View File

@ -50,6 +50,12 @@ void SignalPath::start() {
fftHandlerSink.start();
}
void SignalPath::stop() {
split.stop();
reshape.stop();
fftHandlerSink.stop();
}
dsp::VFO* SignalPath::addVFO(std::string name, double outSampleRate, double bandwidth, double offset) {
if (vfos.find(name) != vfos.end()) {
return NULL;

View File

@ -3,13 +3,13 @@
#include <dsp/vfo.h>
#include <map>
#include <dsp/sink.h>
#include <module.h>
class SignalPath {
public:
SignalPath();
void init(uint64_t sampleRate, int fftRate, int fftSize, dsp::stream<dsp::complex_t>* input, dsp::complex_t* fftBuffer, void fftHandler(dsp::complex_t*,int,void*));
void start();
void stop();
void setSampleRate(double sampleRate);
void setFFTRate(double rate);
double getSampleRate();

View File

@ -3,7 +3,7 @@
#include <signal_path/vfo_manager.h>
#include <signal_path/source.h>
#include <signal_path/sink.h>
#include <module.h>
#include <new_module.h>
namespace sigpath {
SDRPP_EXPORT SignalPath signalPath;

View File

@ -174,18 +174,18 @@ void SinkManager::showVolumeSlider(std::string name, std::string prefix, float w
float ypos = ImGui::GetCursorPosY();
if (streams.find(name) == streams.end()) {
if (streams.find(name) == streams.end() || name == "") {
float dummy = 0.0f;
style::beginDisabled();
ImGui::SetNextItemWidth(width - height);
ImGui::PushID(ImGui::GetID(("sdrpp_dummy_mute_btn_" + name).c_str()));
ImGui::PushID(ImGui::GetID(("sdrpp_unmute_btn_" + name).c_str()));
ImGui::ImageButton(icons::MUTED, ImVec2(height, height), ImVec2(0, 0), ImVec2(1, 1), btwBorder);
ImGui::PopID();
ImGui::SameLine();
ImGui::SetCursorPosY(ypos - ((height - sliderHeight) / 2.0f));
ImGui::SetNextItemWidth(width - height - 8);
ImGui::SetCursorPosY(ypos + ((height - sliderHeight) / 2.0f) + btwBorder);
ImGui::SliderFloat((prefix + name).c_str(), &dummy, 0.0f, 1.0f, "");
ImGui::SetCursorPosY(ypos);
style::endDisabled();
return;
}
SinkManager::Stream* stream = streams[name];

View File

@ -13,7 +13,11 @@ VFOManager::VFO::VFO(std::string name, int reference, double offset, double band
}
VFOManager::VFO::~VFO() {
dspVFO->stop();
gui::waterfall.vfos.erase(name);
if (gui::waterfall.selectedVFO == name) {
gui::waterfall.selectFirstVFO();
}
sigpath::signalPath.removeVFO(name);
delete wtfVFO;
}
@ -76,6 +80,7 @@ void VFOManager::deleteVFO(VFOManager::VFO* vfo) {
if (name == "") {
return;
}
delete vfo;
vfos.erase(name);
}