diff --git a/plugins/samplesource/rtlsdr/rtlsdrgui.cpp b/plugins/samplesource/rtlsdr/rtlsdrgui.cpp
index 57065653f..269fe1fdc 100644
--- a/plugins/samplesource/rtlsdr/rtlsdrgui.cpp
+++ b/plugins/samplesource/rtlsdr/rtlsdrgui.cpp
@@ -152,3 +152,34 @@ void RTLSDRGui::updateHardware()
message->submit(m_pluginAPI->getDSPEngineMessageQueue());
m_updateTimer.stop();
}
+
+void RTLSDRGui::on_checkBox_stateChanged(int state) {
+ if (state == Qt::Checked){
+ ((RTLSDRInput*)m_sampleSource)->set_ds_mode((ui->radioButton->isChecked()) ? true : false);
+ ui->radioButton->setEnabled(true);
+ ui->radioButton_2->setEnabled(true);
+ ui->gain->setEnabled(false);
+ //ui->decimation->setMaximum(6);
+
+ ui->centerFrequency->setValueRange(5, 0U, 30000U);
+ ui->centerFrequency->setValue(0);
+ }
+ else {
+ ((RTLSDRInput*)m_sampleSource)->set_ds_mode(0);
+ ui->radioButton->setEnabled(false);
+ ui->radioButton_2->setEnabled(false);
+ ui->gain->setEnabled(true);
+ //ui->decimation->setMaximum(4);
+
+ ui->centerFrequency->setValueRange(7, 20000U, 2200000U);
+ }
+}
+
+void RTLSDRGui::on_radioButton_toggled(bool checked){
+ if (checked)
+ ((RTLSDRInput*)m_sampleSource)->set_ds_mode(1);
+}
+void RTLSDRGui::on_radioButton_2_toggled(bool checked){
+ if (checked)
+ ((RTLSDRInput*)m_sampleSource)->set_ds_mode(2);
+}
\ No newline at end of file
diff --git a/plugins/samplesource/rtlsdr/rtlsdrgui.h b/plugins/samplesource/rtlsdr/rtlsdrgui.h
index 46b248bd1..1c7c269c9 100644
--- a/plugins/samplesource/rtlsdr/rtlsdrgui.h
+++ b/plugins/samplesource/rtlsdr/rtlsdrgui.h
@@ -46,6 +46,9 @@ private slots:
void on_centerFrequency_changed(quint64 value);
void on_gain_valueChanged(int value);
void on_decimation_valueChanged(int value);
+ void on_checkBox_stateChanged(int state);
+ void on_radioButton_toggled(bool checked);
+ void on_radioButton_2_toggled(bool checked);
void updateHardware();
};
diff --git a/plugins/samplesource/rtlsdr/rtlsdrgui.ui b/plugins/samplesource/rtlsdr/rtlsdrgui.ui
index 0cbe424d4..aa67594e6 100644
--- a/plugins/samplesource/rtlsdr/rtlsdrgui.ui
+++ b/plugins/samplesource/rtlsdr/rtlsdrgui.ui
@@ -7,7 +7,7 @@
0
0
132
- 82
+ 119
@@ -214,6 +214,63 @@
+ -
+
+
+ Qt::Horizontal
+
+
+
+ -
+
+
-
+
+
+ ds
+
+
+
+ -
+
+
+ false
+
+
+ i
+
+
+ true
+
+
+ true
+
+
+
+ -
+
+
+ false
+
+
+ q
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
diff --git a/plugins/samplesource/rtlsdr/rtlsdrinput.cpp b/plugins/samplesource/rtlsdr/rtlsdrinput.cpp
index 4761c0cb4..17feaf069 100644
--- a/plugins/samplesource/rtlsdr/rtlsdrinput.cpp
+++ b/plugins/samplesource/rtlsdr/rtlsdrinput.cpp
@@ -229,3 +229,8 @@ bool RTLSDRInput::applySettings(const GeneralSettings& generalSettings, const Se
}
return true;
}
+
+
+void RTLSDRInput::set_ds_mode(int on){
+ rtlsdr_set_direct_sampling(m_dev, on);
+}
\ No newline at end of file
diff --git a/plugins/samplesource/rtlsdr/rtlsdrinput.h b/plugins/samplesource/rtlsdr/rtlsdrinput.h
index d171af1ad..b1c1ebf18 100644
--- a/plugins/samplesource/rtlsdr/rtlsdrinput.h
+++ b/plugins/samplesource/rtlsdr/rtlsdrinput.h
@@ -91,6 +91,9 @@ public:
bool handleMessage(Message* message);
+
+ void set_ds_mode(int on);
+
private:
QMutex m_mutex;
Settings m_settings;