2015-12-06 18:47:55 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) 2015 F4EXB //
|
|
|
|
// written by Edouard Griffiths //
|
|
|
|
// //
|
|
|
|
// 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 //
|
2019-04-11 04:39:30 +00:00
|
|
|
// (at your option) any later version. //
|
2015-12-06 18:47:55 +00:00
|
|
|
// //
|
|
|
|
// 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/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2015-12-06 09:30:51 +00:00
|
|
|
#ifndef INCLUDE_BFMDEMODGUI_H
|
|
|
|
#define INCLUDE_BFMDEMODGUI_H
|
|
|
|
|
2020-10-04 04:16:15 +00:00
|
|
|
#include "channel/channelgui.h"
|
2015-12-06 09:30:51 +00:00
|
|
|
#include "dsp/channelmarker.h"
|
2017-09-16 20:23:31 +00:00
|
|
|
#include "util/messagequeue.h"
|
2022-01-09 04:27:12 +00:00
|
|
|
#include "settings/rollupstate.h"
|
2017-10-01 15:54:48 +00:00
|
|
|
#include "bfmdemodsettings.h"
|
2016-10-02 11:18:07 +00:00
|
|
|
|
2015-12-06 09:30:51 +00:00
|
|
|
class PluginAPI;
|
2017-10-31 07:24:05 +00:00
|
|
|
class DeviceUISet;
|
2017-10-01 09:50:16 +00:00
|
|
|
class RDSParser;
|
2015-12-06 09:30:51 +00:00
|
|
|
|
2015-12-06 18:47:55 +00:00
|
|
|
class SpectrumVis;
|
2015-12-06 09:30:51 +00:00
|
|
|
class BFMDemod;
|
2017-11-09 00:03:05 +00:00
|
|
|
class BasebandSampleSink;
|
2015-12-06 09:30:51 +00:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class BFMDemodGUI;
|
|
|
|
}
|
|
|
|
|
2020-10-04 04:16:15 +00:00
|
|
|
class BFMDemodGUI : public ChannelGUI {
|
2015-12-06 09:30:51 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-11-09 00:03:05 +00:00
|
|
|
static BFMDemodGUI* create(PluginAPI* pluginAPI, DeviceUISet *deviceAPI, BasebandSampleSink *rxChannel);
|
2017-09-16 08:45:08 +00:00
|
|
|
virtual void destroy();
|
2015-12-06 09:30:51 +00:00
|
|
|
|
|
|
|
void resetToDefaults();
|
|
|
|
QByteArray serialize() const;
|
|
|
|
bool deserialize(const QByteArray& data);
|
2017-09-16 20:23:31 +00:00
|
|
|
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
|
2022-04-12 14:20:45 +00: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 16:27:27 +00:00
|
|
|
virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; }
|
|
|
|
virtual bool getHidden() const { return m_settings.m_hidden; }
|
2022-04-16 14:45:53 +00:00
|
|
|
virtual ChannelMarker& getChannelMarker() { return m_channelMarker; }
|
2022-04-17 23:42:03 +00:00
|
|
|
virtual int getStreamIndex() const { return m_settings.m_streamIndex; }
|
|
|
|
virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; }
|
2015-12-06 09:30:51 +00:00
|
|
|
|
2017-11-14 00:23:01 +00:00
|
|
|
public slots:
|
|
|
|
void channelMarkerChangedByCursor();
|
2017-11-14 21:58:35 +00:00
|
|
|
void channelMarkerHighlightedByCursor();
|
2015-12-06 09:30:51 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::BFMDemodGUI* ui;
|
|
|
|
PluginAPI* m_pluginAPI;
|
2017-10-31 07:24:05 +00:00
|
|
|
DeviceUISet* m_deviceUISet;
|
2015-12-06 09:30:51 +00:00
|
|
|
ChannelMarker m_channelMarker;
|
2022-01-09 04:27:12 +00:00
|
|
|
RollupState m_rollupState;
|
2017-10-01 15:54:48 +00:00
|
|
|
BFMDemodSettings m_settings;
|
2022-04-13 09:08:21 +00:00
|
|
|
qint64 m_deviceCenterFrequency;
|
|
|
|
int m_basebandSampleRate;
|
2015-12-06 09:30:51 +00:00
|
|
|
bool m_doApplySettings;
|
2015-12-14 00:36:13 +00:00
|
|
|
int m_rdsTimerCount;
|
2022-01-12 12:54:19 +00:00
|
|
|
bool m_radiotext_AB_flag;
|
2015-12-06 09:30:51 +00:00
|
|
|
|
2015-12-06 18:47:55 +00:00
|
|
|
SpectrumVis* m_spectrumVis;
|
|
|
|
|
|
|
|
BFMDemod* m_bfmDemod;
|
2015-12-08 08:25:46 +00:00
|
|
|
int m_rate;
|
2015-12-16 02:12:38 +00:00
|
|
|
std::vector<unsigned int> m_g14ComboIndex;
|
2017-09-16 20:23:31 +00:00
|
|
|
MessageQueue m_inputMessageQueue;
|
2015-12-06 09:30:51 +00:00
|
|
|
|
2017-11-09 00:03:05 +00:00
|
|
|
explicit BFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent = 0);
|
2015-12-06 09:30:51 +00:00
|
|
|
virtual ~BFMDemodGUI();
|
|
|
|
|
|
|
|
void blockApplySettings(bool block);
|
2017-08-25 16:56:43 +00:00
|
|
|
void applySettings(bool force = false);
|
2017-10-01 17:20:56 +00:00
|
|
|
void displaySettings();
|
2015-12-14 14:15:31 +00:00
|
|
|
void rdsUpdate(bool force);
|
|
|
|
void rdsUpdateFixedFields();
|
2020-10-03 17:51:14 +00:00
|
|
|
bool handleMessage(const Message& message);
|
2022-04-12 14:20:45 +00:00
|
|
|
void makeUIConnections();
|
2022-04-13 09:08:21 +00:00
|
|
|
void updateAbsoluteCenterFrequency();
|
2015-12-06 09:30:51 +00:00
|
|
|
|
|
|
|
void leaveEvent(QEvent*);
|
|
|
|
void enterEvent(QEvent*);
|
2015-12-16 03:12:49 +00:00
|
|
|
|
|
|
|
void changeFrequency(qint64 f);
|
2017-01-08 19:11:01 +00:00
|
|
|
|
2017-11-14 00:23:01 +00:00
|
|
|
private slots:
|
|
|
|
void on_deltaFrequency_changed(qint64 value);
|
|
|
|
void on_rfBW_valueChanged(int value);
|
|
|
|
void on_afBW_valueChanged(int value);
|
|
|
|
void on_volume_valueChanged(int value);
|
|
|
|
void on_squelch_valueChanged(int value);
|
|
|
|
void on_audioStereo_toggled(bool stereo);
|
|
|
|
void on_lsbStereo_toggled(bool lsb);
|
|
|
|
void on_showPilot_clicked();
|
|
|
|
void on_rds_clicked();
|
|
|
|
void on_g14ProgServiceNames_currentIndexChanged(int index);
|
|
|
|
void on_clearData_clicked(bool checked);
|
|
|
|
void on_g00AltFrequenciesBox_activated(int index);
|
2022-01-12 12:54:19 +00:00
|
|
|
void on_go2ClearPrevText_clicked();
|
2017-11-14 00:23:01 +00:00
|
|
|
void on_g14MappedFrequencies_activated(int index);
|
|
|
|
void on_g14AltFrequencies_activated(int index);
|
|
|
|
void onWidgetRolled(QWidget* widget, bool rollDown);
|
|
|
|
void onMenuDialogCalled(const QPoint& p);
|
|
|
|
void handleInputMessages();
|
2018-03-27 21:57:29 +00:00
|
|
|
void audioSelect();
|
2017-11-14 00:23:01 +00:00
|
|
|
void tick();
|
2015-12-06 09:30:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INCLUDE_BFMDEMODGUI_H
|