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