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