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) 2014 John Greb <hexameron@spam.no> //
|
|
|
|
// Copyright (C) 2015-2020, 2022 Edouard Griffiths, F4EXB <f4exb06@gmail.com> //
|
|
|
|
// Copyright (C) 2022-2023 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-11-16 22:39:50 +00:00
|
|
|
#ifndef INCLUDE_WFMDEMODGUI_H
|
|
|
|
#define INCLUDE_WFMDEMODGUI_H
|
|
|
|
|
2020-10-04 06:16:15 +02:00
|
|
|
#include "channel/channelgui.h"
|
2015-08-25 00:59:14 +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-11-16 22:39:50 +00:00
|
|
|
|
2017-10-08 02:52:32 +02:00
|
|
|
#include "wfmdemodsettings.h"
|
|
|
|
|
2014-11-16 22:39:50 +00:00
|
|
|
class PluginAPI;
|
2017-10-31 08:24:05 +01:00
|
|
|
class DeviceUISet;
|
2017-11-09 01:03:05 +01:00
|
|
|
class BasebandSampleSink;
|
2014-11-16 22:39:50 +00:00
|
|
|
class WFMDemod;
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class WFMDemodGUI;
|
|
|
|
}
|
|
|
|
|
2020-10-04 06:16:15 +02:00
|
|
|
class WFMDemodGUI : public ChannelGUI {
|
2014-11-16 22:39:50 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-11-09 01:03:05 +01:00
|
|
|
static WFMDemodGUI* create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
|
2017-09-16 10:45:08 +02:00
|
|
|
virtual void destroy();
|
2014-11-16 22:39:50 +00: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-11-16 22:39:50 +00:00
|
|
|
|
2017-11-14 08:27:38 +01:00
|
|
|
public slots:
|
|
|
|
void channelMarkerChangedByCursor();
|
2017-11-14 22:58:35 +01:00
|
|
|
void channelMarkerHighlightedByCursor();
|
2014-11-16 22:39:50 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::WFMDemodGUI* ui;
|
|
|
|
PluginAPI* m_pluginAPI;
|
2017-10-31 08:24:05 +01:00
|
|
|
DeviceUISet* m_deviceUISet;
|
2015-08-25 00:59:14 +02:00
|
|
|
ChannelMarker m_channelMarker;
|
2022-01-09 05:27:12 +01:00
|
|
|
RollupState m_rollupState;
|
2017-10-08 02:52:32 +02:00
|
|
|
WFMDemodSettings m_settings;
|
2022-04-13 11:08:21 +02:00
|
|
|
qint64 m_deviceCenterFrequency;
|
|
|
|
int m_basebandSampleRate;
|
2014-11-16 22:39:50 +00:00
|
|
|
bool m_basicSettingsShown;
|
2015-08-19 01:02:52 +02:00
|
|
|
bool m_doApplySettings;
|
2017-04-26 10:04:02 +02:00
|
|
|
bool m_audioMute;
|
|
|
|
bool m_squelchOpen;
|
2020-08-01 10:09:39 +02:00
|
|
|
int m_audioSampleRate;
|
2023-11-13 12:15:56 +00:00
|
|
|
bool m_recentAudioFifoError;
|
2014-11-16 22:39:50 +00:00
|
|
|
|
|
|
|
WFMDemod* m_wfmDemod;
|
2017-09-16 22:23:31 +02:00
|
|
|
MessageQueue m_inputMessageQueue;
|
2015-05-14 11:08:23 +02:00
|
|
|
|
2017-11-09 01:03:05 +01:00
|
|
|
explicit WFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent = 0);
|
2015-08-17 08:29:34 +02:00
|
|
|
virtual ~WFMDemodGUI();
|
2014-11-16 22:39:50 +00:00
|
|
|
|
2015-08-19 01:02:52 +02:00
|
|
|
void blockApplySettings(bool block);
|
2017-10-08 02:52:32 +02:00
|
|
|
void applySettings(bool force = false);
|
|
|
|
void displaySettings();
|
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-14 11:08:23 +02:00
|
|
|
|
|
|
|
void leaveEvent(QEvent*);
|
2022-11-17 14:36:12 +00:00
|
|
|
void enterEvent(EnterEventType*);
|
2017-01-08 19:42:26 +01:00
|
|
|
|
2017-11-14 08:27:38 +01:00
|
|
|
private slots:
|
|
|
|
void on_deltaFrequency_changed(qint64 value);
|
2019-06-04 20:48:06 +02:00
|
|
|
void on_rfBW_changed(quint64 value);
|
2017-11-14 08:27:38 +01:00
|
|
|
void on_afBW_valueChanged(int value);
|
|
|
|
void on_volume_valueChanged(int value);
|
|
|
|
void on_squelch_valueChanged(int value);
|
|
|
|
void on_audioMute_toggled(bool checked);
|
|
|
|
void onWidgetRolled(QWidget* widget, bool rollDown);
|
|
|
|
void onMenuDialogCalled(const QPoint& p);
|
2018-05-25 10:08:47 +02:00
|
|
|
void handleInputMessages();
|
2022-12-28 20:33:28 +01:00
|
|
|
void audioSelect(const QPoint& p);
|
2017-11-14 08:27:38 +01:00
|
|
|
void tick();
|
2014-11-16 22:39:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INCLUDE_WFMDEMODGUI_H
|