2023-11-18 12:02:48 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) 2012 maintech GmbH, Otto-Hahn-Str. 15, 97204 Hoechberg, Germany //
|
|
|
|
// written by Christian Daniel //
|
|
|
|
// Copyright (C) 2015-2022 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/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////
|
2014-05-18 16:52:39 +01:00
|
|
|
#ifndef INCLUDE_NFMDEMODGUI_H
|
|
|
|
#define INCLUDE_NFMDEMODGUI_H
|
|
|
|
|
2020-10-04 06:16:15 +02:00
|
|
|
#include "channel/channelgui.h"
|
2015-06-17 01:42:58 +02:00
|
|
|
#include "dsp/dsptypes.h"
|
2015-08-25 00:36:53 +02:00
|
|
|
#include "dsp/channelmarker.h"
|
2017-09-16 22:23:31 +02:00
|
|
|
#include "util/messagequeue.h"
|
2022-01-09 05:27:12 +01:00
|
|
|
#include "settings/rollupstate.h"
|
2014-05-18 16:52:39 +01:00
|
|
|
|
2017-10-08 10:26:36 +02:00
|
|
|
#include "nfmdemodsettings.h"
|
|
|
|
|
2014-05-18 16:52:39 +01:00
|
|
|
class PluginAPI;
|
2017-10-31 08:24:05 +01:00
|
|
|
class DeviceUISet;
|
2017-11-09 01:03:05 +01:00
|
|
|
class BasebandSampleSink;
|
2014-05-18 16:52:39 +01:00
|
|
|
class NFMDemod;
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class NFMDemodGUI;
|
|
|
|
}
|
|
|
|
|
2020-10-04 06:16:15 +02:00
|
|
|
class NFMDemodGUI : public ChannelGUI {
|
2014-05-18 16:52:39 +01:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-11-09 01:03:05 +01:00
|
|
|
static NFMDemodGUI* create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
|
2017-09-16 10:45:08 +02:00
|
|
|
virtual void destroy();
|
2014-05-18 16:52:39 +01:00
|
|
|
|
|
|
|
void resetToDefaults();
|
|
|
|
QByteArray serialize() const;
|
|
|
|
bool deserialize(const QByteArray& data);
|
2017-09-16 22:23:31 +02:00
|
|
|
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
|
2022-04-12 16:20:45 +02:00
|
|
|
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; };
|
|
|
|
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; };
|
|
|
|
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; };
|
|
|
|
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; };
|
|
|
|
virtual QString getTitle() const { return m_settings.m_title; };
|
|
|
|
virtual QColor getTitleColor() const { return m_settings.m_rgbColor; };
|
2022-04-12 18:27:27 +02:00
|
|
|
virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; }
|
|
|
|
virtual bool getHidden() const { return m_settings.m_hidden; }
|
2022-04-16 16:45:53 +02:00
|
|
|
virtual ChannelMarker& getChannelMarker() { return m_channelMarker; }
|
2022-04-18 01:42:03 +02:00
|
|
|
virtual int getStreamIndex() const { return m_settings.m_streamIndex; }
|
|
|
|
virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; }
|
2014-05-18 16:52:39 +01:00
|
|
|
|
2017-11-14 01:45:13 +01:00
|
|
|
public slots:
|
|
|
|
void channelMarkerChangedByCursor();
|
2017-11-14 22:58:35 +01:00
|
|
|
void channelMarkerHighlightedByCursor();
|
2014-05-18 16:52:39 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::NFMDemodGUI* ui;
|
|
|
|
PluginAPI* m_pluginAPI;
|
2017-10-31 08:24:05 +01:00
|
|
|
DeviceUISet* m_deviceUISet;
|
2015-08-25 00:36:53 +02:00
|
|
|
ChannelMarker m_channelMarker;
|
2022-01-09 05:27:12 +01:00
|
|
|
RollupState m_rollupState;
|
2017-10-08 10:26:36 +02:00
|
|
|
NFMDemodSettings m_settings;
|
2022-04-13 11:08:21 +02:00
|
|
|
qint64 m_deviceCenterFrequency;
|
|
|
|
int m_basebandSampleRate;
|
2014-05-18 16:52:39 +01:00
|
|
|
bool m_basicSettingsShown;
|
2015-08-19 01:02:52 +02:00
|
|
|
bool m_doApplySettings;
|
2014-05-18 16:52:39 +01:00
|
|
|
|
|
|
|
NFMDemod* m_nfmDemod;
|
2016-03-27 05:37:15 +02:00
|
|
|
bool m_squelchOpen;
|
2020-08-01 10:09:39 +02:00
|
|
|
int m_audioSampleRate;
|
2021-04-17 18:14:15 +02:00
|
|
|
bool m_reportedDcsCode;
|
|
|
|
bool m_dcsShowPositive;
|
2017-08-17 17:25:10 +02:00
|
|
|
uint32_t m_tickCount;
|
2017-09-16 22:23:31 +02:00
|
|
|
MessageQueue m_inputMessageQueue;
|
2014-05-18 16:52:39 +01:00
|
|
|
|
2017-11-09 01:03:05 +01:00
|
|
|
explicit NFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent = 0);
|
2015-08-18 09:24:56 +02:00
|
|
|
virtual ~NFMDemodGUI();
|
2014-05-18 16:52:39 +01:00
|
|
|
|
2015-08-19 01:02:52 +02:00
|
|
|
void blockApplySettings(bool block);
|
2017-06-06 01:53:52 +02:00
|
|
|
void applySettings(bool force = false);
|
2017-10-12 01:21:30 +02:00
|
|
|
void displaySettings();
|
2021-04-17 18:14:15 +02:00
|
|
|
void setCtcssFreq(Real ctcssFreq);
|
|
|
|
void setDcsCode(unsigned int dcsCode);
|
2020-10-03 19:51:14 +02:00
|
|
|
bool handleMessage(const Message& message);
|
2022-04-12 16:20:45 +02:00
|
|
|
void makeUIConnections();
|
2022-04-13 11:08:21 +02:00
|
|
|
void updateAbsoluteCenterFrequency();
|
2015-05-11 11:03:01 +02:00
|
|
|
|
|
|
|
void leaveEvent(QEvent*);
|
2022-11-17 14:36:12 +00:00
|
|
|
void enterEvent(EnterEventType*);
|
2017-11-14 01:45:13 +01:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void on_deltaFrequency_changed(qint64 value);
|
2020-11-12 18:32:24 +01:00
|
|
|
void on_channelSpacingApply_clicked();
|
2020-11-08 02:04:17 +01:00
|
|
|
void on_rfBW_valueChanged(int value);
|
2017-11-14 01:45:13 +01:00
|
|
|
void on_afBW_valueChanged(int value);
|
2020-11-08 02:04:17 +01:00
|
|
|
void on_fmDev_valueChanged(int value);
|
2017-11-14 01:45:13 +01:00
|
|
|
void on_volume_valueChanged(int value);
|
|
|
|
void on_squelchGate_valueChanged(int value);
|
|
|
|
void on_deltaSquelch_toggled(bool checked);
|
|
|
|
void on_squelch_valueChanged(int value);
|
|
|
|
void on_ctcss_currentIndexChanged(int index);
|
|
|
|
void on_ctcssOn_toggled(bool checked);
|
2021-04-17 18:14:15 +02:00
|
|
|
void on_dcsOn_toggled(bool checked);
|
|
|
|
void on_dcsCode_currentIndexChanged(int index);
|
2019-05-17 22:06:59 +02:00
|
|
|
void on_highPassFilter_toggled(bool checked);
|
2017-11-14 01:45:13 +01:00
|
|
|
void on_audioMute_toggled(bool checked);
|
|
|
|
void onWidgetRolled(QWidget* widget, bool rollDown);
|
|
|
|
void onMenuDialogCalled(const QPoint& p);
|
|
|
|
void handleInputMessages();
|
2022-12-28 20:33:28 +01:00
|
|
|
void audioSelect(const QPoint& p);
|
2017-11-14 01:45:13 +01:00
|
|
|
void tick();
|
2014-05-18 16:52:39 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INCLUDE_NFMDEMODGUI_H
|