2024-06-20 18:44:17 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) 2012 maintech GmbH, Otto-Hahn-Str. 15, 97204 Hoechberg, Germany //
|
|
|
|
// written by Christian Daniel //
|
|
|
|
// Copyright (C) 2015-2020, 2022-2023 Edouard Griffiths, F4EXB <f4exb06@gmail.com> //
|
|
|
|
// Copyright (C) 2022 Jon Beniston, M7RCE <jon@beniston.com> //
|
|
|
|
// //
|
|
|
|
// This program is free software; you can redistribute it and/or modify //
|
|
|
|
// it under the terms of the GNU General Public License as published by //
|
|
|
|
// the Free Software Foundation as version 3 of the License, or //
|
|
|
|
// (at your option) any later version. //
|
|
|
|
// //
|
|
|
|
// This program is distributed in the hope that it will be useful, //
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
|
|
|
// GNU General Public License V3 for more details. //
|
|
|
|
// //
|
|
|
|
// You should have received a copy of the GNU General Public License //
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#ifndef INCLUDE_WDSPRXGUI_H
|
|
|
|
#define INCLUDE_WDSPRXGUI_H
|
|
|
|
|
|
|
|
#include <QIcon>
|
|
|
|
|
|
|
|
#include "channel/channelgui.h"
|
|
|
|
#include "dsp/channelmarker.h"
|
|
|
|
#include "gui/fftnrdialog.h"
|
|
|
|
#include "util/messagequeue.h"
|
|
|
|
#include "settings/rollupstate.h"
|
|
|
|
#include "wdsprxsettings.h"
|
|
|
|
|
|
|
|
class PluginAPI;
|
|
|
|
class DeviceUISet;
|
|
|
|
|
|
|
|
class AudioFifo;
|
|
|
|
class WDSPRx;
|
2024-06-26 21:39:25 -04:00
|
|
|
class WDSPRxAGCDialog;
|
|
|
|
class WDSPRxDNBDialog;
|
|
|
|
class WDSPRxDNRDialog;
|
2024-07-02 00:14:22 -04:00
|
|
|
class WDSPRxAMDialog;
|
2024-07-04 15:37:56 -04:00
|
|
|
class WDSPRxFMDialog;
|
2024-07-02 00:14:22 -04:00
|
|
|
class WDSPRxCWPeakDialog;
|
2024-07-05 21:25:41 -04:00
|
|
|
class WDSPRxSquelchDialog;
|
2024-07-08 17:44:10 -04:00
|
|
|
class WDSPRxEqDialog;
|
2024-07-19 22:46:57 -04:00
|
|
|
class WDSPRxPanDialog;
|
2024-06-20 18:44:17 -04:00
|
|
|
class SpectrumVis;
|
|
|
|
class BasebandSampleSink;
|
2024-07-20 17:31:25 -04:00
|
|
|
class CRightClickEnabler;
|
2024-06-20 18:44:17 -04:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class WDSPRxGUI;
|
|
|
|
}
|
|
|
|
|
|
|
|
class WDSPRxGUI : public ChannelGUI {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
static WDSPRxGUI* create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
|
|
|
|
virtual void destroy();
|
|
|
|
|
2024-08-24 07:17:02 -04:00
|
|
|
void resetToDefaults() final;
|
|
|
|
QByteArray serialize() const final;
|
|
|
|
bool deserialize(const QByteArray& data) final;
|
|
|
|
MessageQueue *getInputMessageQueue() final { return &m_inputMessageQueue; }
|
|
|
|
void setWorkspaceIndex(int index) final { m_settings.m_workspaceIndex = index; };
|
|
|
|
int getWorkspaceIndex() const final { return m_settings.m_workspaceIndex; };
|
|
|
|
void setGeometryBytes(const QByteArray& blob) final { m_settings.m_geometryBytes = blob; };
|
|
|
|
QByteArray getGeometryBytes() const final { return m_settings.m_geometryBytes; };
|
|
|
|
QString getTitle() const final { return m_settings.m_title; };
|
|
|
|
QColor getTitleColor() const final { return m_settings.m_rgbColor; };
|
|
|
|
void zetHidden(bool hidden) final { m_settings.m_hidden = hidden; }
|
|
|
|
bool getHidden() const final { return m_settings.m_hidden; }
|
|
|
|
ChannelMarker& getChannelMarker() final { return m_channelMarker; }
|
|
|
|
int getStreamIndex() const final { return m_settings.m_streamIndex; }
|
|
|
|
void setStreamIndex(int streamIndex) final { m_settings.m_streamIndex = streamIndex; }
|
2024-06-20 18:44:17 -04:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void channelMarkerChangedByCursor();
|
|
|
|
void channelMarkerHighlightedByCursor();
|
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::WDSPRxGUI* ui;
|
|
|
|
PluginAPI* m_pluginAPI;
|
|
|
|
DeviceUISet* m_deviceUISet;
|
|
|
|
ChannelMarker m_channelMarker;
|
|
|
|
RollupState m_rollupState;
|
|
|
|
WDSPRxSettings m_settings;
|
|
|
|
qint64 m_deviceCenterFrequency;
|
|
|
|
int m_basebandSampleRate;
|
|
|
|
bool m_doApplySettings;
|
|
|
|
int m_spectrumRate;
|
|
|
|
bool m_audioBinaural;
|
|
|
|
bool m_audioFlipChannels;
|
|
|
|
bool m_audioMute;
|
|
|
|
bool m_squelchOpen;
|
|
|
|
int m_audioSampleRate;
|
|
|
|
uint32_t m_tickCount;
|
|
|
|
|
|
|
|
WDSPRx* m_wdspRx;
|
|
|
|
SpectrumVis* m_spectrumVis;
|
|
|
|
MessageQueue m_inputMessageQueue;
|
2024-06-26 21:39:25 -04:00
|
|
|
WDSPRxAGCDialog* m_agcDialog;
|
|
|
|
WDSPRxDNBDialog* m_dnbDialog;
|
|
|
|
WDSPRxDNRDialog* m_dnrDialog;
|
2024-07-02 00:14:22 -04:00
|
|
|
WDSPRxAMDialog* m_amDialog;
|
2024-07-04 15:37:56 -04:00
|
|
|
WDSPRxFMDialog* m_fmDialog;
|
2024-07-02 00:14:22 -04:00
|
|
|
WDSPRxCWPeakDialog* m_cwPeakDialog;
|
2024-07-05 21:25:41 -04:00
|
|
|
WDSPRxSquelchDialog* m_squelchDialog;
|
2024-07-08 17:44:10 -04:00
|
|
|
WDSPRxEqDialog* m_equalizerDialog;
|
2024-07-19 22:46:57 -04:00
|
|
|
WDSPRxPanDialog* m_panDialog;
|
2024-06-20 18:44:17 -04:00
|
|
|
|
2024-07-20 17:31:25 -04:00
|
|
|
CRightClickEnabler *m_audioMuteRightClickEnabler;
|
|
|
|
CRightClickEnabler *m_agcRightClickEnabler;
|
|
|
|
CRightClickEnabler *m_dnbRightClickEnabler;
|
|
|
|
CRightClickEnabler *m_dnrRightClickEnabler;
|
|
|
|
CRightClickEnabler *m_cwPeakRightClickEnabler;
|
|
|
|
CRightClickEnabler *m_squelchRightClickEnabler;
|
|
|
|
CRightClickEnabler *m_equalizerRightClickEnabler;
|
|
|
|
CRightClickEnabler *m_panRightClickEnabler;
|
|
|
|
CRightClickEnabler *m_demodRightClickEnabler;
|
|
|
|
|
2024-06-20 18:44:17 -04:00
|
|
|
QIcon m_iconDSBUSB;
|
|
|
|
QIcon m_iconDSBLSB;
|
|
|
|
|
2024-08-24 07:17:02 -04:00
|
|
|
explicit WDSPRxGUI(PluginAPI* pluginAPI, DeviceUISet* deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent = nullptr);
|
|
|
|
~WDSPRxGUI() final;
|
2024-06-20 18:44:17 -04:00
|
|
|
|
|
|
|
bool blockApplySettings(bool block);
|
|
|
|
void applySettings(bool force = false);
|
|
|
|
void applyBandwidths(unsigned int spanLog2, bool force = false);
|
2024-08-24 07:17:02 -04:00
|
|
|
unsigned int spanLog2Max() const;
|
2024-06-20 18:44:17 -04:00
|
|
|
void displaySettings();
|
|
|
|
bool handleMessage(const Message& message);
|
2024-08-24 07:17:02 -04:00
|
|
|
void makeUIConnections() const;
|
2024-06-20 18:44:17 -04:00
|
|
|
void updateAbsoluteCenterFrequency();
|
|
|
|
uint32_t getValidAudioSampleRate() const;
|
|
|
|
|
2024-08-24 07:17:02 -04:00
|
|
|
void leaveEvent(QEvent*) final;
|
|
|
|
void enterEvent(EnterEventType*) final;
|
2024-06-20 18:44:17 -04:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void on_deltaFrequency_changed(qint64 value);
|
|
|
|
void on_audioBinaural_toggled(bool binaural);
|
|
|
|
void on_audioFlipChannels_toggled(bool flip);
|
|
|
|
void on_dsb_toggled(bool dsb);
|
|
|
|
void on_BW_valueChanged(int value);
|
|
|
|
void on_lowCut_valueChanged(int value);
|
|
|
|
void on_volume_valueChanged(int value);
|
|
|
|
void on_agc_toggled(bool checked);
|
|
|
|
void on_dnr_toggled(bool checked);
|
2024-07-02 00:14:22 -04:00
|
|
|
void on_dnb_toggled(bool checked);
|
2024-07-19 22:46:57 -04:00
|
|
|
void on_anf_toggled(bool checked);
|
2024-06-24 04:20:14 -04:00
|
|
|
void on_agcGain_valueChanged(int value);
|
2024-06-20 18:44:17 -04:00
|
|
|
void on_audioMute_toggled(bool checked);
|
|
|
|
void on_spanLog2_valueChanged(int value);
|
|
|
|
void on_flipSidebands_clicked(bool checked);
|
|
|
|
void on_fftWindow_currentIndexChanged(int index);
|
2024-06-26 21:39:25 -04:00
|
|
|
void on_profileIndex_valueChanged(int value);
|
2024-07-02 00:14:22 -04:00
|
|
|
void on_demod_currentIndexChanged(int index);
|
|
|
|
void on_cwPeaking_toggled(bool checked);
|
2024-07-05 21:25:41 -04:00
|
|
|
void on_squelch_toggled(bool checked);
|
|
|
|
void on_squelchThreshold_valueChanged(int value);
|
2024-07-08 17:44:10 -04:00
|
|
|
void on_equalizer_toggled(bool checked);
|
2024-07-12 21:23:08 -04:00
|
|
|
void on_rit_toggled(bool checked);
|
|
|
|
void on_ritFrequency_valueChanged(int value);
|
2024-07-14 15:51:22 -04:00
|
|
|
void on_dbOrS_toggled(bool checked);
|
2024-08-24 07:17:02 -04:00
|
|
|
void onWidgetRolled(const QWidget* widget, bool rollDown);
|
2024-06-20 18:44:17 -04:00
|
|
|
void onMenuDialogCalled(const QPoint& p);
|
|
|
|
void handleInputMessages();
|
|
|
|
void audioSelect(const QPoint& p);
|
2024-06-26 21:39:25 -04:00
|
|
|
void agcSetupDialog(const QPoint& p);
|
|
|
|
void agcSetup(int valueChanged);
|
|
|
|
void dnbSetupDialog(const QPoint& p);
|
|
|
|
void dnbSetup(int valueChanged);
|
2024-06-20 18:44:17 -04:00
|
|
|
void dnrSetupDialog(const QPoint& p);
|
|
|
|
void dnrSetup(int valueChanged);
|
2024-07-02 00:14:22 -04:00
|
|
|
void cwPeakSetupDialog(const QPoint& p);
|
|
|
|
void cwPeakSetup(int valueChanged);
|
|
|
|
void demodSetupDialog(const QPoint& p);
|
|
|
|
void amSetup(int valueChanged);
|
2024-07-04 15:37:56 -04:00
|
|
|
void fmSetup(int valueChanged);
|
2024-07-05 21:25:41 -04:00
|
|
|
void squelchSetupDialog(const QPoint& p);
|
|
|
|
void squelchSetup(int valueChanged);
|
2024-07-08 17:44:10 -04:00
|
|
|
void equalizerSetupDialog(const QPoint& p);
|
|
|
|
void equalizerSetup(int valueChanged);
|
2024-07-19 22:46:57 -04:00
|
|
|
void panSetupDialog(const QPoint& p);
|
|
|
|
void panSetup(int valueChanged);
|
2024-06-20 18:44:17 -04:00
|
|
|
void tick();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INCLUDE_WDSPRXGUI_H
|