From e4f391528217955141e268af2af8117e2c58f5db Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 15 Nov 2016 18:58:17 +0100 Subject: [PATCH] SDRPlay plugin: interface replaced by libmirisdr: refactor interim state (1) --- plugins/samplesource/sdrplay/sdrplaygui.cpp | 462 +++--------------- plugins/samplesource/sdrplay/sdrplaygui.h | 23 +- plugins/samplesource/sdrplay/sdrplaygui.ui | 340 +++++++------ plugins/samplesource/sdrplay/sdrplayinput.cpp | 175 +++++-- plugins/samplesource/sdrplay/sdrplayinput.h | 25 +- .../samplesource/sdrplay/sdrplaysettings.cpp | 43 +- .../samplesource/sdrplay/sdrplaysettings.h | 5 +- 7 files changed, 389 insertions(+), 684 deletions(-) diff --git a/plugins/samplesource/sdrplay/sdrplaygui.cpp b/plugins/samplesource/sdrplay/sdrplaygui.cpp index 3ca3bcd51..8954aa55e 100644 --- a/plugins/samplesource/sdrplay/sdrplaygui.cpp +++ b/plugins/samplesource/sdrplay/sdrplaygui.cpp @@ -28,331 +28,6 @@ #include "dsp/dspengine.h" #include "dsp/dspcommands.h" -// ==================================================================== - -unsigned int SDRPlayGui::m_bbGr[m_nbBands][m_nbGRValues] = { - { // 10k - 12M - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, // 0 - 9 - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, // 10 - 19 - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, // 20 - 29 - 30, 31, 32, 33, 34, 11, 12, 13, 14, 15, // 30 - 39 - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, // 40 - 49 - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, // 50 - 59 - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, // 60 - 69 - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, // 70 - 79 - 56, 57, 58, 40, 41, 42, 43, 44, 45, 46, // 80 - 89 - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, // 90 - 99 - 57, 58, 59, // 100 - 102 - }, - { // 12 - 30M - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, // 0 - 9 - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, // 10 - 19 - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, // 20 - 29 - 30, 31, 32, 33, 34, 11, 12, 13, 14, 15, // 30 - 39 - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, // 40 - 49 - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, // 50 - 59 - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, // 60 - 69 - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, // 70 - 79 - 56, 57, 58, 40, 41, 42, 43, 44, 45, 46, // 80 - 89 - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, // 90 - 99 - 57, 58, 59, // 100 - 102 - }, - { // 30 - 60M - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, // 0 - 9 - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, // 10 - 19 - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, // 20 - 29 - 30, 31, 32, 33, 34, 11, 12, 13, 14, 15, // 30 - 39 - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, // 40 - 49 - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, // 50 - 59 - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, // 60 - 69 - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, // 70 - 79 - 56, 57, 58, 40, 41, 42, 43, 44, 45, 46, // 80 - 89 - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, // 90 - 99 - 57, 58, 59, // 100 - 102 - }, - { // 60 - 120M - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, // 0 - 9 - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, // 10 - 19 - 20, 21, 22, 23, 24, 25, 26, 27, 28, 5, // 20 - 29 - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, // 30 - 39 - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, // 40 - 49 - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, // 50 - 59 - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, // 60 - 69 - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, // 70 - 79 - 56, 57, 58, 40, 41, 42, 43, 44, 45, 46, // 80 - 89 - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, // 90 - 99 - 57, 58, 59, // 100 - 102 - }, - { // 120 - 250M - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, // 0 - 9 - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, // 10 - 19 - 20, 21, 22, 23, 24, 25, 26, 27, 28, 5, // 20 - 29 - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, // 30 - 39 - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, // 40 - 49 - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, // 50 - 59 - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, // 60 - 69 - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, // 70 - 79 - 56, 57, 58, 40, 41, 42, 43, 44, 45, 46, // 80 - 89 - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, // 90 - 99 - 57, 58, 59, // 100 - 102 - }, - { // 250 - 420M - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, // 0 - 9 - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, // 10 - 19 - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, // 20 - 29 - 30, 31, 32, 33, 34, 11, 12, 13, 14, 15, // 30 - 39 - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, // 40 - 49 - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, // 50 - 59 - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, // 60 - 69 - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, // 70 - 79 - 56, 57, 58, 40, 41, 42, 43, 44, 45, 46, // 80 - 89 - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, // 90 - 99 - 57, 58, 59, // 100 - 102 - }, - { // 420M - 1G - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, // 0 - 9 - 10, 11, 5, 6, 7, 8, 9, 10, 11, 12, // 10 - 19 - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, // 20 - 29 - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, // 30 - 39 - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, // 40 - 49 - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, // 50 - 59 - 53, 54, 55, 56, 57, 58, 40, 41, 42, 43, // 60 - 69 - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, // 70 - 79 - 54, 55, 56, 57, 58, 59, 59, 59, 59, 59, // 80 - 89 - 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, // 90 - 99 - 59, 59, 59, // 100 - 102 - }, - { // 1 - 2G - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, // 0 - 9 - 10, 11, 5, 6, 7, 8, 9, 10, 11, 12, // 10 - 19 - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, // 20 - 29 - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, // 30 - 39 - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, // 40 - 49 - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, // 50 - 59 - 53, 54, 55, 56, 57, 58, 40, 41, 42, 43, // 60 - 69 - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, // 70 - 79 - 54, 55, 56, 57, 58, 59, 59, 59, 59, 59, // 80 - 89 - 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, // 90 - 99 - 59, 59, 59, // 100 - 102 - } -}; - -unsigned int SDRPlayGui::m_lnaGr[m_nbBands][m_nbGRValues] = { - { // 10k - 12M - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 9 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 10 - 19 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20 - 29 - 0, 0, 0, 0, 0, 24, 24, 24, 24, 24, // 30 - 39 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 40 - 49 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 50 - 59 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 60 - 69 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 70 - 79 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 80 - 89 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 90 - 99 - 24, 24, 24, // 100 - 102 - }, - { // 12 - 30M - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 9 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 10 - 19 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20 - 29 - 0, 0, 0, 0, 0, 24, 24, 24, 24, 24, // 30 - 39 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 40 - 49 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 50 - 59 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 60 - 69 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 70 - 79 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 80 - 89 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 90 - 99 - 24, 24, 24, // 100 - 102 - }, - { // 30 - 60M - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 9 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 10 - 19 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20 - 29 - 0, 0, 0, 0, 0, 24, 24, 24, 24, 24, // 30 - 39 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 40 - 49 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 50 - 59 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 60 - 69 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 70 - 79 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 80 - 89 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 90 - 99 - 24, 24, 24, // 100 - 102 - }, - { // 60 - 120M - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 9 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 10 - 19 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, // 20 - 29 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 30 - 39 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 40 - 49 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 50 - 59 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 60 - 69 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 70 - 79 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 80 - 89 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 90 - 99 - 24, 24, 24, // 100 - 102 - }, - { // 120 - 250M - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 9 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 10 - 19 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, // 20 - 29 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 30 - 39 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 40 - 49 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 50 - 59 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 60 - 69 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 70 - 79 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 80 - 89 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 90 - 99 - 24, 24, 24, // 100 - 102 - }, - { // 250 - 420M - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 9 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 10 - 19 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20 - 29 - 0, 0, 0, 0, 0, 24, 24, 24, 24, 24, // 30 - 39 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 40 - 49 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 50 - 59 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 60 - 69 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 70 - 79 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 80 - 89 - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, // 90 - 99 - 24, 24, 24, // 100 - 102 - }, - { // 420M - 1G - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 9 - 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, // 10 - 19 - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // 20 - 29 - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // 30 - 39 - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // 40 - 49 - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // 50 - 59 - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // 60 - 69 - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // 70 - 79 - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // 80 - 89 - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // 90 - 99 - 7, 7, 7, // 100 - 102 - }, - { // 1 - 2G - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 9 - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // 10 - 19 - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // 20 - 29 - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // 30 - 39 - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // 40 - 49 - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // 50 - 59 - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // 60 - 69 - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // 70 - 79 - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // 80 - 89 - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // 90 - 99 - 7, 7, 7, // 100 - 102 - } -}; - -unsigned int SDRPlayGui::m_mixerGr[m_nbBands][m_nbGRValues] = { - { // 10k - 12M - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 9 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 10 - 19 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20 - 29 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 30 - 39 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 40 - 49 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 50 - 59 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 60 - 69 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 70 - 79 - 0, 0, 0, 19, 19, 19, 19, 19, 19, 19, // 80 - 89 - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, // 90 - 99 - 19, 19, 19, // 100 - 102 - }, - { // 12 - 30M - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 9 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 10 - 19 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20 - 29 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 30 - 39 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 40 - 49 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 50 - 59 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 60 - 69 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 70 - 79 - 0, 0, 0, 19, 19, 19, 19, 19, 19, 19, // 80 - 89 - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, // 90 - 99 - 19, 19, 19, // 100 - 102 - }, - { // 30 - 60M - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 9 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 10 - 19 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20 - 29 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 30 - 39 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 40 - 49 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 50 - 59 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 60 - 69 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 70 - 79 - 0, 0, 0, 19, 19, 19, 19, 19, 19, 19, // 80 - 89 - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, // 90 - 99 - 19, 19, 19, // 100 - 102 - }, - { // 60 - 120M - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 9 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 10 - 19 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20 - 29 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 30 - 39 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 40 - 49 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 50 - 59 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 60 - 69 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 70 - 79 - 0, 0, 0, 19, 19, 19, 19, 19, 19, 19, // 80 - 89 - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, // 90 - 99 - 19, 19, 19, // 100 - 102 - }, - { // 120 - 250M - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 9 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 10 - 19 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20 - 29 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 30 - 39 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 40 - 49 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 50 - 59 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 60 - 69 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 70 - 79 - 0, 0, 0, 19, 19, 19, 19, 19, 19, 19, // 80 - 89 - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, // 90 - 99 - 19, 19, 19, // 100 - 102 - }, - { // 250 - 420M - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 9 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 10 - 19 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20 - 29 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 30 - 39 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 40 - 49 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 50 - 59 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 60 - 69 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 70 - 79 - 0, 0, 0, 19, 19, 19, 19, 19, 19, 19, // 80 - 89 - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, // 90 - 99 - 19, 19, 19, // 100 - 102 - }, - { // 420M - 1G - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 9 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 10 - 19 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20 - 29 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 30 - 39 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 40 - 49 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 50 - 59 - 0, 0, 0, 0, 0, 19, 19, 19, 19, 19, // 60 - 69 - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, // 70 - 79 - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, // 80 - 89 - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, // 90 - 99 - 19, 19, 19, // 100 - 102 - }, - { // 1 - 2G - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 9 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 10 - 19 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20 - 29 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 30 - 39 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 40 - 49 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 50 - 59 - 0, 0, 0, 0, 0, 19, 19, 19, 19, 19, // 60 - 69 - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, // 70 - 79 - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, // 80 - 89 - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, // 90 - 99 - 19, 19, 19, // 100 - 102 - } -}; - -// ==================================================================== SDRPlayGui::SDRPlayGui(DeviceSourceAPI *deviceAPI, QWidget* parent) : QWidget(parent), @@ -375,12 +50,6 @@ SDRPlayGui::SDRPlayGui(DeviceSourceAPI *deviceAPI, QWidget* parent) : ui->ifFrequency->addItem(QString::number(SDRPlayIF::getIF(i))); } - ui->mirDCCorr->clear(); - for (int i = 0; i < SDRPlayDCCorr::getNbDCCorrs(); i++) - { - ui->mirDCCorr->addItem(SDRPlayDCCorr::getDCCorrName(i)); - } - ui->samplerate->clear(); for (int i = 0; i < SDRPlaySampleRates::getNbRates(); i++) { @@ -476,6 +145,8 @@ bool SDRPlayGui::handleMessage(const Message& message) { if (SDRPlayInput::MsgReportSDRPlay::match(message)) { + qDebug() << "SDRPlayGui::handleMessage: MsgReportSDRPlay"; + m_gains = ((SDRPlayInput::MsgReportSDRPlay&) message).getGains(); displaySettings(); return true; } @@ -534,8 +205,8 @@ void SDRPlayGui::displaySettings() { ui->centerFrequency->setValue(m_settings.m_centerFrequency / 1000); - ui->ppm->setValue(m_settings.m_LOppmTenths); - ui->ppmText->setText(QString("%1").arg(QString::number(m_settings.m_LOppmTenths/10.0, 'f', 1))); + ui->ppm->setValue(m_settings.m_LOppmCorrection); + ui->ppmText->setText(QString("%1").arg(QString::number(m_settings.m_LOppmCorrection/10.0, 'f', 1))); ui->samplerate->setCurrentIndex(m_settings.m_devSampleRateIndex); @@ -544,25 +215,36 @@ void SDRPlayGui::displaySettings() ui->fBand->setCurrentIndex(m_settings.m_frequencyBandIndex); ui->ifFrequency->setCurrentIndex(m_settings.m_ifFrequencyIndex); - ui->mirDCCorr->setCurrentIndex(m_settings.m_mirDcCorrIndex); - ui->mirDCCorrTrackTime->setValue(m_settings.m_mirDcCorrTrackTimeIndex); - ui->mirDCCorrTrackTimeText->setText(tr("%1us").arg(m_settings.m_mirDcCorrIndex * 3)); ui->samplerate->setCurrentIndex(m_settings.m_devSampleRateIndex); ui->decim->setCurrentIndex(m_settings.m_log2Decim); ui->fcPos->setCurrentIndex((int) m_settings.m_fcPos); - ui->gr->setValue(m_settings.m_gainRedctionIndex); + if (m_gains.size() > 0) + { + int dist = abs(m_settings.m_gain - m_gains[0]); + int pos = 0; - char grStrChr[20]; + for (uint i = 1; i < m_gains.size(); i++) + { + if (abs(m_settings.m_gain - m_gains[i]) < dist) + { + dist = abs(m_settings.m_gain - m_gains[i]); + pos = i; + } + } - sprintf(grStrChr, "%03d:%02d-%02d-%02d", - m_settings.m_gainRedctionIndex, - 24 - m_lnaGr[m_settings.m_frequencyBandIndex][m_settings.m_gainRedctionIndex], - 19 - m_mixerGr[m_settings.m_frequencyBandIndex][m_settings.m_gainRedctionIndex], - 59 - m_bbGr[m_settings.m_frequencyBandIndex][m_settings.m_gainRedctionIndex]); - - ui->grText->setText(QString(grStrChr)); + ui->gainText->setText(tr("%1.%2").arg(m_gains[pos] / 10).arg(abs(m_gains[pos] % 10))); + ui->gain->setMaximum(m_gains.size() - 1); + ui->gain->setEnabled(true); + ui->gain->setValue(pos); + } + else + { + ui->gain->setMaximum(0); + ui->gain->setEnabled(false); + ui->gain->setValue(0); + } } void SDRPlayGui::sendSettings() @@ -616,8 +298,8 @@ void SDRPlayGui::on_centerFrequency_changed(quint64 value) void SDRPlayGui::on_ppm_valueChanged(int value) { - m_settings.m_LOppmTenths = value; - ui->ppmText->setText(QString("%1").arg(QString::number(m_settings.m_LOppmTenths/10.0, 'f', 1))); + m_settings.m_LOppmCorrection = value; + ui->ppmText->setText(QString("%1").arg(QString::number(m_settings.m_LOppmCorrection/10.0, 'f', 1))); sendSettings(); } @@ -735,24 +417,22 @@ void SDRPlayGui::on_record_toggled(bool checked) // ==================================================================== unsigned int SDRPlaySampleRates::m_rates[m_nb_rates] = { - 2000, // 0 - 2048, // 1 - 2304, // 2 - 2400, // 3 - 3072, // 4 - 3200, // 5 - 4000, // 6 - 4096, // 7 - 4608, // 8 - 4800, // 9 - 5000, // 10 - 6000, // 11 - 6144, // 12 - 8000, // 13 - 8192, // 14 - 9216, // 15 - 9600, // 16 - 10000, // 17 + 1536000, // 0 + 2000000, // 1 + 2048000, // 2 + 2304000, // 3 + 2400000, // 4 + 3072000, // 5 + 3200000, // 6 + 4000000, // 7 + 4096000, // 8 + 4608000, // 9 + 4800000, // 10 + 5000000, // 11 + 6000000, // 12 + 6144000, // 13 + 8000000, // 14 + 8192000, // 15 }; unsigned int SDRPlaySampleRates::getRate(unsigned int rate_index) @@ -788,14 +468,14 @@ unsigned int SDRPlaySampleRates::getNbRates() // ==================================================================== unsigned int SDRPlayBandwidths::m_bw[m_nb_bw] = { - 200, // 0 - 300, // 1 - 600, // 2 - 1536, // 3 - 5000, // 4 - 6000, // 5 - 7000, // 6 - 8000, // 7 + 200000, // 0 + 300000, // 1 + 600000, // 2 + 1536000, // 3 + 5000000, // 4 + 6000000, // 5 + 7000000, // 6 + 8000000, // 7 }; unsigned int SDRPlayBandwidths::getBandwidth(unsigned int bandwidth_index) @@ -831,10 +511,10 @@ unsigned int SDRPlayBandwidths::getNbBandwidths() // ==================================================================== unsigned int SDRPlayIF::m_if[m_nb_if] = { - 0, // 0 - 450, // 1 - 1620, // 2 - 2048, // 3 + 0, // 0 + 450000, // 1 + 1620000, // 2 + 2048000, // 3 }; unsigned int SDRPlayIF::getIF(unsigned int if_index) @@ -945,31 +625,3 @@ unsigned int SDRPlayBands::getNbBands() { return SDRPlayBands::m_nb_bands; } - -// ==================================================================== - -const char* SDRPlayDCCorr::m_dcCorrName[m_nb_dcCorrs] = { - "None", // 0 - "Per1", // 1 - "Per2", // 2 - "Per3", // 3 - "1Shot", // 4 - "Cont", // 5 -}; - -QString SDRPlayDCCorr::getDCCorrName(unsigned int dcCorr_index) -{ - if (dcCorr_index < m_nb_dcCorrs) - { - return QString(m_dcCorrName[dcCorr_index]); - } - else - { - return QString(m_dcCorrName[0]); - } -} - -unsigned int SDRPlayDCCorr::getNbDCCorrs() -{ - return SDRPlayDCCorr::m_nb_dcCorrs; -} diff --git a/plugins/samplesource/sdrplay/sdrplaygui.h b/plugins/samplesource/sdrplay/sdrplaygui.h index 7a7a443b4..28a63de39 100644 --- a/plugins/samplesource/sdrplay/sdrplaygui.h +++ b/plugins/samplesource/sdrplay/sdrplaygui.h @@ -18,6 +18,7 @@ #define PLUGINS_SAMPLESOURCE_SDRPLAY_SDRPLAYGUI_H_ #include +#include #include "plugin/plugingui.h" #include "sdrplayinput.h" @@ -56,18 +57,13 @@ private: SDRPlaySettings m_settings; QTimer m_updateTimer; QTimer m_statusTimer; + std::vector m_gains; DeviceSampleSource* m_sampleSource; FileRecord *m_fileSink; //!< File sink to record device I/Q output int m_sampleRate; quint64 m_deviceCenterFrequency; //!< Center frequency in device int m_lastEngineState; - static const unsigned int m_nbGRValues = 103; - static const unsigned int m_nbBands = 8; - static unsigned int m_bbGr[m_nbBands][m_nbGRValues]; - static unsigned int m_lnaGr[m_nbBands][m_nbGRValues]; - static unsigned int m_mixerGr[m_nbBands][m_nbGRValues]; - void displaySettings(); void sendSettings(); void updateSampleRateAndFrequency(); @@ -82,13 +78,11 @@ private slots: void on_dcOffset_toggled(bool checked); void on_iqImbalance_toggled(bool checked); void on_fBand_currentIndexChanged(int index); - void on_mirDCCorr_currentIndexChanged(int index); - void on_mirDCCorrTrackTime_valueChanged(int value); void on_bandwidth_currentIndexChanged(int index); void on_samplerate_currentIndexChanged(int index); void on_decim_currentIndexChanged(int index); void on_fcPos_currentIndexChanged(int index); - void on_gr_valueChanged(int value); + void on_gain_valueChanged(int value); void on_startStop_toggled(bool checked); void on_record_toggled(bool checked); }; @@ -102,7 +96,7 @@ public: static unsigned int getRateIndex(unsigned int rate); static unsigned int getNbRates(); private: - static const unsigned int m_nb_rates = 18; + static const unsigned int m_nb_rates = 16; static unsigned int m_rates[m_nb_rates]; }; @@ -139,13 +133,4 @@ private: static const char* m_bandName[m_nb_bands]; }; -class SDRPlayDCCorr { -public: - static QString getDCCorrName(unsigned int dcCorr_index); - static unsigned int getNbDCCorrs(); -private: - static const unsigned int m_nb_dcCorrs = 6; - static const char* m_dcCorrName[m_nb_dcCorrs]; -}; - #endif /* PLUGINS_SAMPLESOURCE_SDRPLAY_SDRPLAYGUI_H_ */ diff --git a/plugins/samplesource/sdrplay/sdrplaygui.ui b/plugins/samplesource/sdrplay/sdrplaygui.ui index fdbb5dd9f..bd00fc912 100644 --- a/plugins/samplesource/sdrplay/sdrplaygui.ui +++ b/plugins/samplesource/sdrplay/sdrplaygui.ui @@ -35,7 +35,16 @@ 3 - + + 2 + + + 2 + + + 2 + + 2 @@ -201,7 +210,7 @@ - 0.0 + 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -219,13 +228,17 @@ - - + + - Automatic IQ imbalance correction + Frequency band + + + + - IQ + Auto @@ -252,24 +265,20 @@ - - + + + + Automatic IQ imbalance correction + - Auto + IQ - - - Frequency band - - - - - - - IF frequency in kHz + + + Band @@ -287,53 +296,7 @@ 3 - - - - - 70 - 16777215 - - - - IF bandwidth in kHz - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - BW - - - - - - - kHz - - - - Qt::Horizontal @@ -346,75 +309,130 @@ - - + + + + + 70 + 16777215 + + - MirSDR DC auto tracking - - - - - - -1 - - - 5 + IF bandwidth in kHz - - - - 24 - 24 - + + + + 0 + 0 + - - MirSDR DC auto tracking time in uS - - - 1 - - - 63 - - - 35 + + BW - - - - - 42 - 0 - - + + - 105uS + kHz - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + IF frequency in kHz + + + + + + + IF + + + + + + + kHz - + 3 - + + + + + 70 + 16777215 + + + + Sample rate in kS/s + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Relative position of device center frequency + + + + Inf + + + + + Sup + + + + + Cen + + + + + + + + Fp + + + + Dec - + @@ -465,61 +483,6 @@ - - - - Fp - - - - - - - Relative position of device center frequency - - - - Inf - - - - - Sup - - - - - Cen - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 70 - 16777215 - - - - Sample rate in kS/s - - - @@ -540,6 +503,19 @@ + + + + Qt::Horizontal + + + + 40 + 20 + + + + @@ -555,21 +531,21 @@ 3 - + - Gain reduction + Tuner gain 0 - 102 + 0 1 - 35 + 0 Qt::Horizontal @@ -577,7 +553,7 @@ - + 40 @@ -585,10 +561,10 @@ - Gain reduction:LNA-Mixer-BaseBand gains in dB + Tuner gain in dB - 035:24-19-59 + --- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -596,9 +572,9 @@ - + - GR + Gain @@ -652,6 +628,26 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/samplesource/sdrplay/sdrplayinput.cpp b/plugins/samplesource/sdrplay/sdrplayinput.cpp index c0ddafe8f..1c55a4609 100644 --- a/plugins/samplesource/sdrplay/sdrplayinput.cpp +++ b/plugins/samplesource/sdrplay/sdrplayinput.cpp @@ -34,10 +34,9 @@ MESSAGE_CLASS_DEFINITION(SDRPlayInput::MsgReportSDRPlay, Message) SDRPlayInput::SDRPlayInput(DeviceSourceAPI *deviceAPI) : m_deviceAPI(deviceAPI), m_settings(), + m_dev(0), m_sdrPlayThread(0), - m_deviceDescription("SDRPlay"), - m_samplesPerPacket(4096), - m_mirStreamRunning(false) + m_deviceDescription("SDRPlay") { } @@ -51,68 +50,142 @@ bool SDRPlayInput::init(const Message& cmd) return false; } -bool SDRPlayInput::start(int device) +bool SDRPlayInput::start(uint32_t device) { - mir_sdr_ErrT r; QMutexLocker mutexLocker(&m_mutex); + if (m_dev != 0) + { + stop(); + } + + char vendor[256]; + char product[256]; + char serial[256]; + int res; + int numberOfGains; + if (!m_sampleFifo.setSize(96000 * 4)) { qCritical("SDRPlayInput::start: could not allocate SampleFifo"); return false; } + if ((res = mirisdr_open(&m_dev, device)) < 0) + { + qCritical("SDRPlayInput::start: could not open SDRPlay #%d: %s", device, strerror(errno)); + return false; + } + + vendor[0] = '\0'; + product[0] = '\0'; + serial[0] = '\0'; + + if ((res = mirisdr_get_device_usb_strings(m_dev, vendor, product, serial)) < 0) + { + qCritical("SDRPlayInput::start: error accessing USB device"); + stop(); + return false; + } + + qWarning("SDRPlayInput::start: open: %s %s, SN: %s", vendor, product, serial); + m_deviceDescription = QString("%1 (SN %2)").arg(product).arg(serial); + + if ((res = mirisdr_set_sample_rate(m_dev, 2048000)) < 0) + { + qCritical("SDRPlayInput::start: could not set sample rate: 2048kS/s"); + stop(); + return false; + } + + if ((res = mirisdr_set_center_freq(m_dev, m_settings.m_centerFrequency)) < 0) + { + qCritical("SDRPlayInput::start: could not set frequency to: %lu Hz", m_settings.m_centerFrequency); + stop(); + return false; + } + + if ((res = mirisdr_set_sample_format(m_dev, "336_S16"))) // sample format S12 + { + qCritical("SDRPlayInput::start: could not set sample format: rc: %d", res); + stop(); + return false; + } + + if ((res = mirisdr_set_transfer(m_dev, "BULK")) < 0) + { + qCritical("SDRPlayInput::start: could not set USB Bulk mode: rc: %d", res); + stop(); + return false; + } + + if ((res = mirisdr_set_if_freq(m_dev, SDRPlayIF::m_if[m_settings.m_ifFrequencyIndex])) < 0) + { + qCritical("SDRPlayInput::start: could not set IF frequency at index %d: rc: %d", m_settings.m_ifFrequencyIndex, res); + stop(); + return false; + } + + if ((res = mirisdr_set_bandwidth(m_dev, SDRPlayBandwidths::m_bw[m_settings.m_bandwidthIndex])) < 0) + { + qCritical("SDRPlayInput::start: could not set bandwidth at index %d: rc: %d", m_settings.m_bandwidthIndex, res); + stop(); + return false; + } + + if ((res = mirisdr_set_tuner_gain_mode(m_dev, 1)) < 0) + { + qCritical("SDRPlayInput::start: error setting tuner gain mode"); + stop(); + return false; + } + + numberOfGains = mirisdr_get_tuner_gains(m_dev, 0); + + if (numberOfGains < 0) + { + qCritical("SDRPlayInput::start: error getting number of gain values supported"); + stop(); + return false; + } + else + { + qDebug("SDRPlayInput::start: supported gain values: %d", numberOfGains); + } + + m_gains.resize(numberOfGains); + + if (mirisdr_get_tuner_gains(m_dev, &m_gains[0]) < 0) + { + qCritical("SDRPlayInput::start: error getting gain values"); + stop(); + return false; + } + else + { + qDebug() << "SDRPlayInput::start: " << m_gains.size() << "gains"; + MsgReportSDRPlay *message = MsgReportSDRPlay::create(m_gains); + getOutputMessageQueueToGUI()->push(message); + } + + if ((res = mirisdr_reset_buffer(m_dev)) < 0) + { + qCritical("SDRPlayInput::start: could not reset USB EP buffers: %s", strerror(errno)); + stop(); + return false; + } + if((m_sdrPlayThread = new SDRPlayThread(&m_sampleFifo)) == 0) { qFatal("SDRPlayInput::start: failed to create thread"); return false; } - int agcSetPoint = -m_settings.m_gainRedctionIndex; - double sampleRateMHz = SDRPlaySampleRates::getRate(m_settings.m_devSampleRateIndex) / 1e3; - double frequencyMHz = m_settings.m_centerFrequency / 1e6; - int infoOverallGr; + m_sdrPlayThread->startWork(); - r = mir_sdr_DCoffsetIQimbalanceControl(1, 0); - if (r != mir_sdr_Success) - { - qCritical("SDRPlayInput::start: mir_sdr_DCoffsetIQimbalanceControl failed with code %d", (int) r); - } + mutexLocker.unlock(); - r = mir_sdr_AgcControl(mir_sdr_AGC_DISABLE, agcSetPoint, 0, 0, 0, 0, 1); - if (r != mir_sdr_Success) - { - qCritical("SDRPlayInput::start: mir_sdr_AgcControl failed with code %d", (int) r); - } - - qDebug("SDRPlayInput::start: sampleRateMHz: %lf frequencyMHz: %lf", sampleRateMHz, frequencyMHz); - - mir_sdr_DebugEnable(1); - - r = mir_sdr_StreamInit( - &agcSetPoint, - sampleRateMHz, - frequencyMHz, - mir_sdr_BW_1_536, - mir_sdr_IF_Zero, - 1, /* LNA */ - &infoOverallGr, - 0, /* use internal gr tables according to band */ - &m_samplesPerPacket, - SDRPlayThread::streamCallback, - SDRPlayInput::callbackGC, - 0); - - if (r != mir_sdr_Success) - { - qCritical("SDRPlayInput::start: mir_sdr_StreamInit failed with code %d", (int) r); - } - else - { - qDebug("SDRPlayInput::start: Mir stream started: samplesPerPacket: %d", m_samplesPerPacket); - m_mirStreamRunning = true; - m_sdrPlayThread->startWork(); - } + applySettings(m_settings, true); } void SDRPlayInput::stop() @@ -293,11 +366,11 @@ bool SDRPlayInput::applySettings(const SDRPlaySettings& settings, bool force) } } - if ((m_settings.m_LOppmTenths != settings.m_LOppmTenths) || force) + if ((m_settings.m_LOppmCorrection != settings.m_LOppmCorrection) || force) { - m_settings.m_LOppmTenths = settings.m_LOppmTenths; + m_settings.m_LOppmCorrection = settings.m_LOppmCorrection; - mir_sdr_ErrT r = mir_sdr_SetPpm(m_settings.m_LOppmTenths / 10.0); + mir_sdr_ErrT r = mir_sdr_SetPpm(m_settings.m_LOppmCorrection / 10.0); if (r != mir_sdr_Success) { diff --git a/plugins/samplesource/sdrplay/sdrplayinput.h b/plugins/samplesource/sdrplay/sdrplayinput.h index 4bfc9668a..fd536c897 100644 --- a/plugins/samplesource/sdrplay/sdrplayinput.h +++ b/plugins/samplesource/sdrplay/sdrplayinput.h @@ -20,8 +20,9 @@ #include #include "sdrplaysettings.h" -#include +#include #include +#include class DeviceSourceAPI; class SDRPlayThread; @@ -52,14 +53,19 @@ public: MESSAGE_CLASS_DECLARATION public: - static MsgReportSDRPlay* create() + const std::vector& getGains() const { return m_gains; } + + static MsgReportSDRPlay* create(const std::vector& gains) { - return new MsgReportSDRPlay(); + return new MsgReportSDRPlay(gains); } protected: - MsgReportSDRPlay() : - Message() + std::vector m_gains; + + MsgReportSDRPlay(const std::vector& gains) : + Message(), + m_gains(gains) { } }; @@ -67,7 +73,7 @@ public: virtual ~SDRPlayInput(); virtual bool init(const Message& message); - virtual bool start(int device); + virtual bool start(uint32_t device); virtual void stop(); virtual const QString& getDeviceDescription() const; @@ -78,17 +84,14 @@ public: private: bool applySettings(const SDRPlaySettings& settings, bool force); - void reinitMirSDR(mir_sdr_ReasonForReinitT reasonForReinit); - static void callbackGC(unsigned int gRdB, unsigned int lnaGRdB, void *cbContext); DeviceSourceAPI *m_deviceAPI; QMutex m_mutex; SDRPlaySettings m_settings; + mirisdr_dev_t* m_dev; SDRPlayThread* m_sdrPlayThread; QString m_deviceDescription; - - int m_samplesPerPacket; - bool m_mirStreamRunning; + std::vector m_gains; }; #endif /* PLUGINS_SAMPLESOURCE_SDRPLAY_SDRPLAYINPUT_H_ */ diff --git a/plugins/samplesource/sdrplay/sdrplaysettings.cpp b/plugins/samplesource/sdrplay/sdrplaysettings.cpp index 91ec6beb4..b02ad139f 100644 --- a/plugins/samplesource/sdrplay/sdrplaysettings.cpp +++ b/plugins/samplesource/sdrplay/sdrplaysettings.cpp @@ -27,11 +27,10 @@ SDRPlaySettings::SDRPlaySettings() void SDRPlaySettings::resetToDefaults() { m_centerFrequency = 7040*1000; - m_LOppmTenths = 0; + m_gain = 0; + m_LOppmCorrection = 0; m_frequencyBandIndex = 0; m_ifFrequencyIndex = 0; - m_mirDcCorrIndex = 0; - m_mirDcCorrTrackTimeIndex = 1; m_bandwidthIndex = 0; m_devSampleRateIndex = 0; m_gainRedctionIndex = 35; @@ -45,18 +44,17 @@ QByteArray SDRPlaySettings::serialize() const { SimpleSerializer s(1); - s.writeS32(1, m_LOppmTenths); + s.writeS32(1, m_LOppmCorrection); s.writeU32(2, m_frequencyBandIndex); s.writeU32(3, m_ifFrequencyIndex); - s.writeU32(4, m_mirDcCorrIndex); - s.writeU32(5, m_mirDcCorrTrackTimeIndex); - s.writeU32(6, m_bandwidthIndex); - s.writeU32(7, m_devSampleRateIndex); - s.writeU32(8, m_gainRedctionIndex); - s.writeU32(9, m_log2Decim); - s.writeS32(10, (int) m_fcPos); - s.writeBool(11, m_dcBlock); - s.writeBool(12, m_iqCorrection); + s.writeS32(4, m_gain); + s.writeU32(5, m_bandwidthIndex); + s.writeU32(6, m_devSampleRateIndex); + s.writeU32(7, m_gainRedctionIndex); + s.writeU32(8, m_log2Decim); + s.writeS32(9, (int) m_fcPos); + s.writeBool(10, m_dcBlock); + s.writeBool(11, m_iqCorrection); return s.final(); } @@ -75,19 +73,18 @@ bool SDRPlaySettings::deserialize(const QByteArray& data) { int intval; - d.readS32(1, &m_LOppmTenths, 0); + d.readS32(1, &m_LOppmCorrection, 0); d.readU32(2, &m_frequencyBandIndex, 0); d.readU32(3, &m_ifFrequencyIndex, 0); - d.readU32(4, &m_mirDcCorrIndex, 0); - d.readU32(5, &m_mirDcCorrTrackTimeIndex, 1); - d.readU32(6, &m_bandwidthIndex, 0); - d.readU32(7, &m_devSampleRateIndex, 0); - d.readU32(8, &m_gainRedctionIndex, 35); - d.readU32(9, &m_log2Decim, 0); - d.readS32(10, &intval, 0); + d.readS32(4, &m_gain, 0); + d.readU32(5, &m_bandwidthIndex, 0); + d.readU32(6, &m_devSampleRateIndex, 0); + d.readU32(7, &m_gainRedctionIndex, 35); + d.readU32(8, &m_log2Decim, 0); + d.readS32(9, &intval, 0); m_fcPos = (fcPos_t) intval; - d.readBool(11, &m_dcBlock, false); - d.readBool(12, &m_iqCorrection, false); + d.readBool(10, &m_dcBlock, false); + d.readBool(11, &m_iqCorrection, false); return true; } diff --git a/plugins/samplesource/sdrplay/sdrplaysettings.h b/plugins/samplesource/sdrplay/sdrplaysettings.h index 496befd3c..86080ded0 100644 --- a/plugins/samplesource/sdrplay/sdrplaysettings.h +++ b/plugins/samplesource/sdrplay/sdrplaysettings.h @@ -28,11 +28,10 @@ struct SDRPlaySettings { } fcPos_t; uint64_t m_centerFrequency; - int32_t m_LOppmTenths; + qint32 m_gain; + int32_t m_LOppmCorrection; uint32_t m_frequencyBandIndex; uint32_t m_ifFrequencyIndex; - uint32_t m_mirDcCorrIndex; - uint32_t m_mirDcCorrTrackTimeIndex; uint32_t m_bandwidthIndex; uint32_t m_devSampleRateIndex; uint32_t m_gainRedctionIndex;