diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..75c107bc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.pro.user diff --git a/gui/QML/SettingsPage.qml b/gui/QML/SettingsPage.qml index d3041e71..1751e688 100644 --- a/gui/QML/SettingsPage.qml +++ b/gui/QML/SettingsPage.qml @@ -8,13 +8,14 @@ import "style" Item { id: settingsPage - property alias showChannelState : enableExpertMode.checked - property alias enableFullScreenState : enableFullScreen.checked - property alias enableExpertModeState : enableExpertMode.checked + property bool showChannelState : settings.enableExpertModeState + property bool enableFullScreenState : settings.enableFullScreenState + property bool enableExpertModeState : settings.enableExpertModeState Settings { - property alias enableFullScreenState : settingsPage.enableFullScreenState - property alias enableExpertModeState : settingsPage.enableExpertModeState + id: settings + property alias enableFullScreenState : enableFullScreen.checked + property alias enableExpertModeState : enableExpertMode.checked } Connections{ @@ -120,39 +121,43 @@ Item { } SettingsFrame { + Layout.fillWidth: true ColumnLayout{ - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right + anchors.fill: parent spacing: Units.dp(20) TouchSwitch { id: enableAGC name: "Enable AGC" + height: 24 + Layout.fillHeight: true objectName: "enableAGC" checked: true - onChanged: cppGUI.inputEnableAGCChanged(valueChecked) + onChanged: cppGUI.inputEnableAGCChange(valueChecked) } TouchSlider { id: gain enabled: !enableAGC.checked name: "Manual gain" - onValueChanged: cppGUI.inputGainChanged(valueGain) + Layout.fillHeight: true + onValueChanged: cppGUI.inputGainChange(valueGain) } } } SettingsFrame { + id: settingsFrame + Layout.fillWidth: true ColumnLayout{ - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right + anchors.fill: parent spacing: Units.dp(20) TouchSwitch { id: enableFullScreen name: "Enable full screen mode" + height: 24 + Layout.fillHeight: true objectName: "enableFullScreen" checked: false } @@ -160,12 +165,10 @@ Item { TouchSwitch { id: enableExpertMode name: "Enable expert mode" + height: 24 + Layout.fillHeight: true objectName: "enableExpertMode" checked: false - onChanged: { - if(valueChecked == false) - mainWindow.width = Units.dp(350) + radioInformationView.width - } } } } diff --git a/gui/QML/main.qml b/gui/QML/main.qml index 4110f442..d34755ad 100644 --- a/gui/QML/main.qml +++ b/gui/QML/main.qml @@ -52,24 +52,22 @@ ApplicationWindow { visible: true width: Units.dp(700) height: Units.dp(500) - visibility: settingsPageLoader.settingsPage.enableFullScreenState ? "FullScreen" : "Windowed" + visibility: settingsPage.enableFullScreenState ? "FullScreen" : "Windowed" Settings { property alias width : mainWindow.width property alias height : mainWindow.height } - Loader { - id: settingsPageLoader - anchors.topMargin: Units.dp(10) - readonly property SettingsPage settingsPage: item - source: Qt.resolvedUrl("SettingsPage.qml") + SettingsPage{ + id:settingsPage + onEnableExpertModeStateChanged: { + if(enableExpertModeState == false) + mainWindow.width = Units.dp(350) + radioInformationView.width + } } - - Loader { - id: infoPageLoader + InfoPage{ + id: infoPage anchors.topMargin: Units.dp(10) - readonly property InfoPage infoPage: item - source: Qt.resolvedUrl("InfoPage.qml") } Rectangle { @@ -117,7 +115,7 @@ ApplicationWindow { } else { - stackView.push(settingsPageLoader); + stackView.push(settingsPage); } } } @@ -162,7 +160,7 @@ ApplicationWindow { if(stackView.depth > 2) stackView.pop(); else - stackView.push(infoPageLoader); + stackView.push(infoPage); } } } @@ -176,7 +174,7 @@ ApplicationWindow { clip: true Layout.alignment: Qt.AlignLeft Layout.minimumWidth: Units.dp(350) - Layout.fillWidth: settingsPageLoader.settingsPage.enableExpertModeState ? false : true + Layout.fillWidth: settingsPage.enableExpertModeState ? false : true // Implements back key navigation focus: true @@ -189,7 +187,7 @@ ApplicationWindow { width: parent.width height: parent.height ListView { - property bool showChannelState: settingsPageLoader.settingsPage.showChannelState + property alias showChannelState: settingsPage.showChannelState anchors.rightMargin: 0 anchors.bottomMargin: 0 anchors.leftMargin: 0 @@ -213,7 +211,7 @@ ApplicationWindow { Layout.minimumWidth: Units.dp(320) // Disable this view if expert view is enabled and no more space is available - visible: (mainWindow.width < Units.dp(850) && settingsPageLoader.settingsPage.enableExpertModeState) ? false : true + visible: (mainWindow.width < Units.dp(850) && settingsPage.enableExpertModeState) ? false : true // Radio RadioView {} @@ -232,8 +230,8 @@ ApplicationWindow { ExpertView{ id: expertView - Layout.fillWidth: settingsPageLoader.settingsPage.enableExpertModeState ? true : false - visible: settingsPageLoader.settingsPage.enableExpertModeState ? true : false + Layout.fillWidth: settingsPage.enableExpertModeState ? true : false + visible: settingsPage.enableExpertModeState ? true : false } } diff --git a/gui/QML/style/ErrorMessagePopup.qml b/gui/QML/style/ErrorMessagePopup.qml index bdd3a941..c30ce7e6 100644 --- a/gui/QML/style/ErrorMessagePopup.qml +++ b/gui/QML/style/ErrorMessagePopup.qml @@ -11,7 +11,7 @@ Popup { width: textView.width + Units.dp(65) height: Units.dp(50) x: mainWindow.width/2 - width/2 - y: mainWindow.height - toolBar.height - height + y: mainWindow.height - toolBar_.height - height //modal: true //focus: true closePolicy: Popup.NoAutoClose diff --git a/gui/QML/style/TouchSwitch.qml b/gui/QML/style/TouchSwitch.qml index 458b4522..27c7a7d4 100644 --- a/gui/QML/style/TouchSwitch.qml +++ b/gui/QML/style/TouchSwitch.qml @@ -6,7 +6,7 @@ import QtQuick.Layouts 1.1 // Import custom styles import "." -RowLayout { +Item { id: masterLayout signal changed(bool valueChecked) @@ -15,7 +15,6 @@ RowLayout { property alias checked: switchView.checked Layout.preferredWidth: parent.width - spacing: Units.dp(20) Text { id: nameView diff --git a/includes/backend/audio/mp4processor.h b/includes/backend/audio/mp4processor.h index f98e1080..bc68ef4f 100644 --- a/includes/backend/audio/mp4processor.h +++ b/includes/backend/audio/mp4processor.h @@ -39,9 +39,7 @@ #include #include "pad-handler.h" -#ifdef GUI_3 #include "pad_decoder_adapter.h" -#endif class RadioInterface; @@ -90,9 +88,8 @@ Q_OBJECT int16_t aacErrors; int16_t aacFrames; int16_t charSet; -#ifdef GUI_3 PADDecoderAdapter *padDecoderAdapter; -#endif + signals: void show_frameErrors (int); void show_rsErrors (int); diff --git a/includes/backend/fib-processor.h b/includes/backend/fib-processor.h index ee2abdb9..a21a08c5 100644 --- a/includes/backend/fib-processor.h +++ b/includes/backend/fib-processor.h @@ -152,9 +152,7 @@ Q_OBJECT void addtoEnsemble (const QString &); void nameofEnsemble (int, const QString &); void changeinConfiguration (void); -#ifdef GUI_3 void newDateTime (int *); -#endif }; diff --git a/includes/ofdm/ofdm-processor.h b/includes/ofdm/ofdm-processor.h index e407e274..e59233ad 100644 --- a/includes/ofdm/ofdm-processor.h +++ b/includes/ofdm/ofdm-processor.h @@ -29,6 +29,7 @@ #include "dab-constants.h" #include #include +#include #include "stdint.h" #include "phasereference.h" #include "ofdm-decoder.h" @@ -61,10 +62,11 @@ Q_OBJECT void setOffset (int32_t); void coarseCorrectorOn (void); void coarseCorrectorOff (void); -#ifdef GUI_3 void set_scanMode (bool, QString); -#endif + void start (void); private: + std::thread threadHandle; + int32_t syncBufferIndex; virtualInput *theRig; DabParams *params; RadioInterface *myRadioInterface; @@ -101,10 +103,8 @@ Q_OBJECT int32_t inputPointer; DSPCOMPLEX getSample (int32_t); void getSamples (DSPCOMPLEX *, int16_t, int32_t); -#ifdef GUI_3 bool scanMode; int32_t NoReadCounter; -#endif virtual void run (void); int32_t bufferContent; bool isReset; diff --git a/main.cpp b/main.cpp index c6e5d576..fb016ad4 100644 --- a/main.cpp +++ b/main.cpp @@ -28,9 +28,7 @@ #include #include #include -#ifdef GUI_3 #include -#endif #include #include "dab-constants.h" #include "gui.h" @@ -62,21 +60,22 @@ int main (int argc, char **argv) { QString initFileName; RadioInterface *MyRadioInterface; -QApplication a (argc, argv); - -// Default values -uint8_t syncMethod = 2; -QSettings *dabSettings; // ini file -uint8_t dabMode = 127; // illegal value -QString dabDevice = QString (""); -QString dabBand = QString (""); -QString ipAddress = QString (""); -uint16_t ipPort = 1234; -// -// Newer versions of Qt provide all kinds of nice mechanisms, -// unfortunately, there are quite some people (including me (jvk)) -// who also work with older versions of Qt, -#if GUI_3 + QApplication a (argc, argv); + a.setOrganizationName("AlbrechtL"); + a.setOrganizationDomain("welle.io"); + a.setApplicationName("welle.io"); + // Default values + uint8_t syncMethod = 2; + QSettings *dabSettings; // ini file + uint8_t dabMode = 127; // illegal value + QString dabDevice = QString (""); + QString dabBand = QString (""); + QString ipAddress = QString (""); + uint16_t ipPort = 1234; + // + // Newer versions of Qt provide all kinds of nice mechanisms, + // unfortunately, there are quite some people (including me (jvk)) + // who also work with older versions of Qt, QCoreApplication::setApplicationName("welle.io"); QCoreApplication::setApplicationVersion(CURRENT_VERSION); @@ -166,8 +165,7 @@ uint16_t ipPort = 1234; if (RTL_TCPServerPortValue != "") ipPort = RTL_TCPServerPortValue. toInt (); -// Since we do not have the possibility in GUI_2 and GUI_3 to select -// Mode, Band or Device, we create the possibility for +// We create the possibility for // passing appropriate parameters to the command // Selections - if any - will be default for the next session @@ -196,108 +194,6 @@ uint16_t ipPort = 1234; dabDevice, dabMode, dabBand); -#else -// For Qt 4 lovers and other simple people - int opt; -#ifdef GUI_2 - QString channel = "11C"; - QString programName = "Classic FM"; - int gain = 20; - QString dabChannel = QString (""); - QString dabProgramName = QString (""); -#ifndef TCP_STREAMER - QString soundChannel = "default"; - QString dabSoundchannel = QString (""); -#endif -#endif - int dabGain = -1; - while ((opt = getopt (argc, argv, "i:D:S:M:B:C:P:G:A:")) != -1) { - switch (opt) { - case 'i': - initFileName = fullPathfor (QString (optarg)); - break; - - case 'S': - syncMethod = atoi (optarg); - break; - -#if defined (GUI_2) | defined (GUI_4) - case 'D': - dabDevice = optarg; - break; - - case 'M': - dabMode = atoi (optarg); - if (!(dabMode == 1) || (dabMode == 2) || (dabMode == 4)) - dabMode = 1; - break; - - case 'B': - dabBand = optarg; - break; - - case 'I': - ipAddress = optarg; - break; -#endif -#ifdef GUI_2 - case 'C': - dabChannel = QString (optarg); - break; - - case 'P': - dabProgramName = QString (optarg); - break; - - case 'G': - dabGain = atoi (optarg); - break; -#ifndef TCP_STREAMER - case 'A': - dabSoundchannel = QString (optarg); - break; -#endif -#endif - default: - break; - } - } - - if (initFileName == QString ("")) - initFileName = fullPathfor (QString (DEFAULT_INI)); - dabSettings = new QSettings (initFileName, QSettings::IniFormat); - -#if defined (GUI_2) -// Since we do not have the possibility in GUI_2 to select -// Mode, Band or Device, we create the possibility for -// passing appropriate parameters to the command -// Selections - if any - will be default for the next session - - if (dabMode == 127) - dabMode = dabSettings -> value ("dabMode", 1). toInt (); - if (dabDevice == QString ("")) - dabDevice = dabSettings -> value ("device", "dabstick"). toString (); - if (dabBand == QString ("")) - dabBand = dabSettings -> value ("band", "BAND III"). toString (); -#endif -#endif - dabSettings -> endGroup (); -/* - * Before we connect control to the gui, we have to - * instantiate - */ -#ifdef GUI_2 - (void)syncMethod; - dabSettings -> setValue ("dabMode", dabMode); - dabSettings -> setValue ("device", dabDevice); - dabSettings -> setValue ("band", dabBand); - MyRadioInterface = new RadioInterface (dabSettings, - dabDevice, dabMode, dabBand); - dabSettings -> sync (); -#elif GUI_1 - MyRadioInterface = new RadioInterface (dabSettings, syncMethod); - MyRadioInterface -> show (); -#endif #if QT_VERSION >= 0x050600 QGuiApplication::setAttribute (Qt::AA_EnableHighDpiScaling); diff --git a/src/backend/audio/mp4processor.cpp b/src/backend/audio/mp4processor.cpp index 3a24d877..39b0f7a4 100644 --- a/src/backend/audio/mp4processor.cpp +++ b/src/backend/audio/mp4processor.cpp @@ -73,9 +73,6 @@ // error display au_count = 0; au_errors = 0; -#ifdef GUI_3 - padDecoderAdapter = new PADDecoderAdapter(mr); -#endif } mp4Processor::~mp4Processor (void) { @@ -295,11 +292,7 @@ uint8_t theAudioUnit [2 * 960 + 10]; // sure, large enough memset (&theAudioUnit [frame_length], 0, 10); if (((theAudioUnit [0] >> 5) & 07) == 4) -#ifndef GUI_3 - my_padhandler. processPAD (theAudioUnit); -#else padDecoderAdapter-> processPAD (theAudioUnit); -#endif int tmp = aacDecoder. MP42PCM (dacRate, sbrFlag, diff --git a/src/backend/data/mot-data.cpp b/src/backend/data/mot-data.cpp index 76378ad4..380a7f93 100644 --- a/src/backend/data/mot-data.cpp +++ b/src/backend/data/mot-data.cpp @@ -314,32 +314,12 @@ void motHandler::handleComplete (motElement *p) { int16_t i; if (p -> contentType != 2) { -#ifndef GUI_3 - if (p -> name != QString ("")) { - fprintf (stderr, "going to write file %s\n", - (p -> name). toLatin1 (). data ()); - checkDir (p -> name); - FILE *x = fopen (((p -> name). toLatin1 (). data ()), "w+b"); - if (x == NULL) - fprintf (stderr, "cannot write file %s\n", - (p -> name). toLatin1 (). data ()); - else { - (void)fwrite ((p -> body). data (), 1, p -> bodySize, x); - fclose (x); - } - } -#endif return; } if (old_slide != NULL) for (i = 0; i < p -> numofSegments; i ++) p -> marked [i] = false; -#ifndef GUI_3 - fprintf (stderr, "going to show picture %s\n", - (p -> name). toLatin1 (). data ()); - checkDir (p -> name); -#endif the_picture (p -> body, p -> contentsubType, p -> name); old_slide = p; } diff --git a/src/backend/data/pad-handler.cpp b/src/backend/data/pad-handler.cpp index 6a325664..23b93400 100644 --- a/src/backend/data/pad-handler.cpp +++ b/src/backend/data/pad-handler.cpp @@ -251,9 +251,6 @@ int16_t dataLength = 0; void padHandler::add_MSC_element (uint8_t *data, int16_t length) { int16_t i; -#ifndef MOT_BASICS__ - return; -#endif if (msc_dataGroupIndex < 0) return; if (length < 0) diff --git a/src/backend/fib-processor.cpp b/src/backend/fib-processor.cpp index fc7e465b..3f7fbcb6 100644 --- a/src/backend/fib-processor.cpp +++ b/src/backend/fib-processor.cpp @@ -109,10 +109,8 @@ connect (this, SIGNAL (changeinConfiguration (void)), myRadioInterface, SLOT (changeinConfiguration (void))); -#ifdef GUI_3 connect (this, SIGNAL (newDateTime (int *)), myRadioInterface, SLOT (displayDateTime (int *))); -#endif } fib_processor::~fib_processor (void) { @@ -571,9 +569,7 @@ int32_t D = d + 1; if (fig [offset + 20] == 1) dateTime [5] = getBits_6 (fig, offset + 32); // Sekunden dateFlag = true; -#ifdef GUI_3 emit newDateTime (dateTime); -#endif } void fib_processor::FIG0Extension13 (uint8_t *d) { diff --git a/src/input/dabstick/dabstick.cpp b/src/input/dabstick/dabstick.cpp index e21f940f..a7d3db10 100644 --- a/src/input/dabstick/dabstick.cpp +++ b/src/input/dabstick/dabstick.cpp @@ -59,10 +59,8 @@ int32_t tmp; tmp = theStick -> _I_Buffer -> putDataIntoBuffer (buf, len); if ((len - tmp) > 0) theStick -> sampleCounter += len - tmp; -#ifdef GUI_3 theStick -> _I_ShadowBuffer -> putDataIntoBuffer (buf, len); - // Shadow buffer needed for the spectrum viewer in GUI_3 -#endif + // Shadow buffer needed for the spectrum viewer } // // for handling the events in libusb, we need a controlthread @@ -109,9 +107,7 @@ int k; libraryLoaded = false; open = false; _I_Buffer = NULL; -#ifdef GUI_3 _I_ShadowBuffer = NULL; -#endif workerHandle = NULL; lastFrequency = KHz (94700); // just a dummy this -> sampleCounter= 0; @@ -185,9 +181,7 @@ int k; rtlsdr_set_tuner_gain_mode (device, 1); _I_Buffer = new RingBuffer(1024 * 1024); -#ifdef GUI_3 _I_ShadowBuffer = new RingBuffer(8192); -#endif theGain = gains [gainsCount / 2]; // default dabstickSettings -> beginGroup ("dabstickSettings"); @@ -267,10 +261,8 @@ int k; #endif if (_I_Buffer != NULL) delete _I_Buffer; -#ifdef GUI_3 if (_I_ShadowBuffer != NULL) delete _I_ShadowBuffer; -#endif if (gains != NULL) delete[] gains; open = false; @@ -294,9 +286,7 @@ int32_t r; return true; _I_Buffer -> FlushRingBuffer (); -#ifdef GUI_3 _I_ShadowBuffer -> FlushRingBuffer (); -#endif r = this -> rtlsdr_reset_buffer (device); if (r < 0) return false; @@ -397,7 +387,6 @@ uint8_t *tempBuffer = (uint8_t *)alloca (2 * size * sizeof (uint8_t)); return amount / 2; } -#ifdef GUI_3 int32_t dabStick::getSamplesFromShadowBuffer (DSPCOMPLEX *V, int32_t size) { int32_t amount, i; uint8_t *tempBuffer = (uint8_t *)alloca (2 * size * sizeof (uint8_t)); @@ -408,7 +397,6 @@ uint8_t *tempBuffer = (uint8_t *)alloca (2 * size * sizeof (uint8_t)); (float (tempBuffer [2 * i + 1] - 128)) / 128.0); return amount / 2; } -#endif int32_t dabStick::Samples (void) { return _I_Buffer -> GetRingBufferReadAvailable () / 2; diff --git a/src/input/dabstick/dabstick.h b/src/input/dabstick/dabstick.h index 82aaf004..2cd35946 100644 --- a/src/input/dabstick/dabstick.h +++ b/src/input/dabstick/dabstick.h @@ -80,10 +80,8 @@ Q_OBJECT void stopReader (void); int32_t getSamples (DSPCOMPLEX *, int32_t); int32_t getSamples (DSPCOMPLEX *, int32_t, int32_t); -#ifdef GUI_3 int32_t getSamplesFromShadowBuffer (DSPCOMPLEX *V, int32_t size); -#endif int32_t Samples (void); int32_t getSamplesMissed (void); void resetBuffer (void); @@ -95,9 +93,7 @@ Q_OBJECT // // These need to be visible for the separate usb handling thread RingBuffer *_I_Buffer; -#ifdef GUI_3 RingBuffer *_I_ShadowBuffer; -#endif pfnrtlsdr_read_async rtlsdr_read_async; struct rtlsdr_dev *device; int32_t sampleCounter; diff --git a/src/ofdm/ofdm-processor.cpp b/src/ofdm/ofdm-processor.cpp index 7d7713d3..317c27ee 100644 --- a/src/ofdm/ofdm-processor.cpp +++ b/src/ofdm/ofdm-processor.cpp @@ -82,10 +82,8 @@ int32_t i; ofdmSymbolCount = 0; tokenCount = 0; sampleCnt = 0; -#ifdef GUI_3 scanMode = false; NoReadCounter = 0; -#endif /** * the class phaseReference will take a number of samples * and indicate - using some threshold - whether there is @@ -116,12 +114,10 @@ int32_t i; myRadioInterface, SLOT (set_coarseCorrectorDisplay (int))); connect (this, SIGNAL (setSynced (char)), myRadioInterface, SLOT (setSynced (char))); -#ifdef GUI_3 connect (this, SIGNAL (setSignalPresent (bool)), myRadioInterface, SLOT (setSignalPresent (bool))); connect (this, SIGNAL (setErrorMessage (QString)), myRadioInterface, SLOT (setErrorMessage (QString))); -#endif bufferContent = 0; // @@ -132,17 +128,18 @@ int32_t i; refArg [i] = arg (phaseSynchronizer. refTable [(T_u + i) % T_u] * conj (phaseSynchronizer. refTable [(T_u + i + 1) % T_u])); } - start (); + start (); } ofdmProcessor::~ofdmProcessor (void) { running = false; // this will cause an // exception to be raised // through the getNextSampleReady - msleep (100); + /*msleep (100); if (isRunning ()) terminate (); - wait (); + wait ();*/ + threadHandle. join (); delete ofdmBuffer; delete oscillatorTable; delete fft_handler; @@ -150,6 +147,18 @@ int32_t i; delete[] refArg; } +void ofdmProcessor::start (void) { + coarseCorrector = 0; + fineCorrector = 0; + f2Correction = true; + syncBufferIndex = 0; + sLevel = 0; + localPhase = 0; + theRig -> resetBuffer (); + running = true; + threadHandle = std::thread (&ofdmProcessor::run, this); +} + /** * \brief getSample @@ -169,7 +178,6 @@ DSPCOMPLEX temp; while ((bufferContent == 0) && running) { usleep (10); bufferContent = theRig -> Samples (); -#ifdef GUI_3 NoReadCounter ++; if(NoReadCounter > 100000) { // 1 s emit setErrorMessage("Error while reading from input device"); @@ -177,10 +185,6 @@ DSPCOMPLEX temp; } } NoReadCounter = 0; -#else - } -#endif - } if (!running) @@ -218,7 +222,6 @@ int32_t i; while ((bufferContent < n) && running) { usleep (10); bufferContent = theRig -> Samples (); -#ifdef GUI_3 NoReadCounter ++; if (NoReadCounter > 100000) { // 1 s emit setErrorMessage("Error while reading from input device"); @@ -226,9 +229,6 @@ int32_t i; } } NoReadCounter = 0; -#else - } -#endif } if (!running) throw 20; @@ -254,8 +254,6 @@ int32_t i; } } static -int32_t syncBufferIndex = 0; -static int attempts = 0; /*** * \brief run @@ -275,9 +273,9 @@ int32_t syncBufferSize = 32768; int32_t syncBufferMask = syncBufferSize - 1; float envBuffer [syncBufferSize]; - running = true; + /*running = true; fineCorrector = 0; - sLevel = 0; + sLevel = 0;*/ try { Initing: @@ -287,13 +285,11 @@ float envBuffer [syncBufferSize]; jan_abs (getSample (0)); } notSynced: -#ifdef GUI_3 if (scanMode && ++attempts > 5) { emit (setSignalPresent (false)); scanMode = false; attempts = 0; - } -#endif + } syncBufferIndex = 0; currentStrength = 0; @@ -370,28 +366,26 @@ float envBuffer [syncBufferSize]; // /// and then, call upon the phase synchronizer to verify/compute /// the real "first" sample - startIndex = phaseSynchronizer. findIndex (ofdmBuffer); - if (startIndex < 0) { // no sync, try again + startIndex = phaseSynchronizer. findIndex (ofdmBuffer); + if (startIndex < 0) { // no sync, try again /** * In case we do not have a correlation value larger than * a given threshold, we start all over again. */ goto notSynced; - } -#ifdef GUI_3 + } if (scanMode) { emit (setSignalPresent (true)); scanMode = false; attempts = 0; - } -#endif + } /** * Once here, we are synchronized, we need to copy the data we * used for synchronization for block 0 */ - memmove (ofdmBuffer, &ofdmBuffer [startIndex], - (params -> T_u - startIndex) * sizeof (DSPCOMPLEX)); - ofdmBufferIndex = params -> T_u - startIndex; + memmove (ofdmBuffer, &ofdmBuffer [startIndex], + (params -> T_u - startIndex) * sizeof (DSPCOMPLEX)); + ofdmBufferIndex = params -> T_u - startIndex; Block_0: /** @@ -490,19 +484,22 @@ float envBuffer [syncBufferSize]; } void ofdmProcessor:: reset (void) { - if (isRunning ()) - terminate (); - wait (); + /*if (isRunning ()) + terminate (); + wait (); fineCorrector = coarseCorrector = 0; f2Correction = true; syncBufferIndex = 0; attempts = 0; theRig -> resetBuffer (); running = false; -#ifdef GUI_3 scanMode = false; -#endif - start (); + start ();*/ + if (running) { + running = false; + threadHandle. join (); + } + start (); } void ofdmProcessor::stop (void) { @@ -518,14 +515,12 @@ void ofdmProcessor::coarseCorrectorOff (void) { f2Correction = false; } -#ifdef GUI_3 void ofdmProcessor::set_scanMode (bool b, QString channel) { if (b) reset (); scanMode = b; currentChannel = channel; } -#endif #define RANGE 36 int16_t ofdmProcessor::processBlock_0 (DSPCOMPLEX *v) { diff --git a/src/output/audiosink.cpp b/src/output/audiosink.cpp index 59975ba9..76315356 100644 --- a/src/output/audiosink.cpp +++ b/src/output/audiosink.cpp @@ -48,12 +48,6 @@ int32_t i; } portAudio = true; -#ifdef GUI_1 - qDebug ("Hostapis: %d\n", Pa_GetHostApiCount ()); - - for (i = 0; i < Pa_GetHostApiCount (); i ++) - qDebug ("Api %d is %s\n", i, Pa_GetHostApiInfo (i) -> name); -#endif numofDevices = Pa_GetDeviceCount (); outTable = new int16_t [numofDevices + 1]; @@ -61,9 +55,7 @@ int32_t i; outTable [i] = -1; ostream = NULL; setupChannels (InterfaceList); -#ifndef GUI_2 - selectDefaultDevice (); -#endif + selectDefaultDevice (); } audioSink::~audioSink (void) { @@ -87,18 +79,7 @@ int32_t i; bool audioSink::selectDevice (QString s) { int16_t i; -#ifdef GUI_2 - for (i = 0; i < InterfaceList -> size (); i ++) { - QString lname = InterfaceList -> at (i); - if (lname. startsWith (s, Qt::CaseInsensitive)) { - fprintf (stderr, "found %s\n", - lname. toLatin1 (). data ()); - return selectDevice (i + 1); - } - } -#else fprintf (stderr, "you are making a mistake by calling this function\n"); -#endif return false; } diff --git a/welle.io.pro b/welle.io.pro index 7b7d5eb0..dc49a709 100644 --- a/welle.io.pro +++ b/welle.io.pro @@ -8,9 +8,6 @@ Release: QMAKE_CFLAGS += -flto -ffast-math -O3 Release: QMAKE_CXXFLAGS += -flto -ffast-math -O3 Release: QMAKE_LFLAGS += -flto -O3 -DEFINES += GUI_3 # Not necessary after code clean up -DEFINES += MOT_BASICS__ # Not necessary after code clean up - RESOURCES += gui/touch_gui_resource.qrc DEPENDPATH += . \