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 //
|
|
|
|
// //
|
|
|
|
// 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
|
|
|
|
|
|
|
|
#include "gui/rollupwidget.h"
|
|
|
|
#include "plugin/plugingui.h"
|
|
|
|
#include "dsp/channelmarker.h"
|
|
|
|
#include "dsp/movingaverage.h"
|
2016-10-02 07:18:07 -04:00
|
|
|
|
2017-01-08 14:11:01 -05:00
|
|
|
#include "rdsparser.h"
|
2015-12-06 04:30:51 -05:00
|
|
|
|
|
|
|
class PluginAPI;
|
2016-10-10 19:17:55 -04:00
|
|
|
class DeviceSourceAPI;
|
2015-12-06 04:30:51 -05:00
|
|
|
|
2016-10-03 09:55:16 -04:00
|
|
|
class ThreadedBasebandSampleSink;
|
2016-10-02 15:52:39 -04:00
|
|
|
class DownChannelizer;
|
2015-12-06 13:47:55 -05:00
|
|
|
class SpectrumVis;
|
2015-12-06 04:30:51 -05:00
|
|
|
class BFMDemod;
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class BFMDemodGUI;
|
|
|
|
}
|
|
|
|
|
|
|
|
class BFMDemodGUI : public RollupWidget, public PluginGUI {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2016-10-10 19:17:55 -04:00
|
|
|
static BFMDemodGUI* create(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI);
|
2015-12-06 04:30:51 -05:00
|
|
|
void destroy();
|
|
|
|
|
|
|
|
void setName(const QString& name);
|
|
|
|
QString getName() const;
|
|
|
|
virtual qint64 getCenterFrequency() const;
|
|
|
|
virtual void setCenterFrequency(qint64 centerFrequency);
|
|
|
|
|
|
|
|
void resetToDefaults();
|
|
|
|
QByteArray serialize() const;
|
|
|
|
bool deserialize(const QByteArray& data);
|
|
|
|
|
|
|
|
virtual bool handleMessage(const Message& message);
|
|
|
|
|
2016-05-16 13:37:53 -04:00
|
|
|
static const QString m_channelID;
|
|
|
|
|
2015-12-06 04:30:51 -05:00
|
|
|
private slots:
|
|
|
|
void viewChanged();
|
2015-12-08 07:10:02 -05:00
|
|
|
void channelSampleRateChanged();
|
2015-12-06 04:30:51 -05:00
|
|
|
void on_deltaFrequency_changed(quint64 value);
|
|
|
|
void on_deltaMinus_toggled(bool minus);
|
|
|
|
void on_rfBW_valueChanged(int value);
|
|
|
|
void on_afBW_valueChanged(int value);
|
|
|
|
void on_volume_valueChanged(int value);
|
|
|
|
void on_squelch_valueChanged(int value);
|
2015-12-06 21:36:56 -05:00
|
|
|
void on_audioStereo_toggled(bool stereo);
|
2015-12-25 14:12:50 -05:00
|
|
|
void on_lsbStereo_toggled(bool lsb);
|
2015-12-08 18:04:46 -05:00
|
|
|
void on_showPilot_clicked();
|
2015-12-08 22:13:13 -05:00
|
|
|
void on_rds_clicked();
|
2015-12-15 21:12:38 -05:00
|
|
|
void on_g14ProgServiceNames_currentIndexChanged(int index);
|
|
|
|
void on_clearData_clicked(bool checked);
|
2015-12-15 22:12:49 -05:00
|
|
|
void on_g00AltFrequenciesBox_activated(int index);
|
|
|
|
void on_g14MappedFrequencies_activated(int index);
|
|
|
|
void on_g14AltFrequencies_activated(int index);
|
2015-12-06 04:30:51 -05:00
|
|
|
void onWidgetRolled(QWidget* widget, bool rollDown);
|
|
|
|
void onMenuDoubleClicked();
|
|
|
|
void tick();
|
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::BFMDemodGUI* ui;
|
|
|
|
PluginAPI* m_pluginAPI;
|
2016-10-10 19:17:55 -04:00
|
|
|
DeviceSourceAPI* m_deviceAPI;
|
2015-12-06 04:30:51 -05:00
|
|
|
ChannelMarker m_channelMarker;
|
|
|
|
bool m_basicSettingsShown;
|
|
|
|
bool m_doApplySettings;
|
2015-12-13 19:36:13 -05:00
|
|
|
int m_rdsTimerCount;
|
2015-12-06 04:30:51 -05:00
|
|
|
|
2016-10-03 09:55:16 -04:00
|
|
|
ThreadedBasebandSampleSink* m_threadedChannelizer;
|
2016-10-02 15:52:39 -04:00
|
|
|
DownChannelizer* m_channelizer;
|
2015-12-06 13:47:55 -05:00
|
|
|
SpectrumVis* m_spectrumVis;
|
2015-12-13 03:45:29 -05:00
|
|
|
RDSParser m_rdsParser;
|
2015-12-06 13:47:55 -05:00
|
|
|
|
|
|
|
BFMDemod* m_bfmDemod;
|
2015-12-06 04:30:51 -05:00
|
|
|
MovingAverage<Real> m_channelPowerDbAvg;
|
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;
|
2015-12-06 04:30:51 -05:00
|
|
|
|
|
|
|
static const int m_rfBW[];
|
|
|
|
|
2016-10-10 19:17:55 -04:00
|
|
|
explicit BFMDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidget* parent = NULL);
|
2015-12-06 04:30:51 -05:00
|
|
|
virtual ~BFMDemodGUI();
|
|
|
|
|
|
|
|
void blockApplySettings(bool block);
|
|
|
|
void applySettings();
|
2015-12-14 09:15:31 -05:00
|
|
|
void rdsUpdate(bool force);
|
|
|
|
void rdsUpdateFixedFields();
|
2015-12-06 04:30:51 -05:00
|
|
|
|
|
|
|
void leaveEvent(QEvent*);
|
|
|
|
void enterEvent(QEvent*);
|
2015-12-15 22:12:49 -05:00
|
|
|
|
|
|
|
void changeFrequency(qint64 f);
|
2017-01-08 14:11:01 -05:00
|
|
|
|
|
|
|
static int requiredBW(int rfBW)
|
|
|
|
{
|
|
|
|
if (rfBW <= 48000) {
|
|
|
|
return 48000;
|
|
|
|
} else {
|
|
|
|
return (3*rfBW)/2;
|
|
|
|
}
|
|
|
|
}
|
2015-12-06 04:30:51 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INCLUDE_BFMDEMODGUI_H
|