| 
									
										
										
										
											2017-12-29 22:00:52 +00:00
										 |  |  | ///////////////////////////////////////////////////////////////////////////////////
 | 
					
						
							|  |  |  | // Copyright (C) 2017 F4EXB                                                      //
 | 
					
						
							|  |  |  | //                                                                               //
 | 
					
						
							|  |  |  | // 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.                                           //
 | 
					
						
							| 
									
										
										
										
											2017-12-29 22:00:52 +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/>.          //
 | 
					
						
							|  |  |  | ///////////////////////////////////////////////////////////////////////////////////
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef PLUGINS_CHANNELRX_DEMODATV_ATVDEMODSETTINGS_H_
 | 
					
						
							|  |  |  | #define PLUGINS_CHANNELRX_DEMODATV_ATVDEMODSETTINGS_H_
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <QByteArray>
 | 
					
						
							|  |  |  | #include <QString>
 | 
					
						
							|  |  |  | #include <stdint.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-01 08:14:37 +00:00
										 |  |  | class Serializable; | 
					
						
							| 
									
										
										
										
											2017-12-29 22:00:52 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | struct ATVDemodSettings | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     enum ATVModulation { | 
					
						
							|  |  |  |         ATV_FM1,  //!< Classical frequency modulation with discriminator #1
 | 
					
						
							|  |  |  |         ATV_FM2,  //!< Classical frequency modulation with discriminator #2
 | 
					
						
							|  |  |  |         ATV_FM3,  //!< Classical frequency modulation with phase derivative discriminator
 | 
					
						
							|  |  |  |         ATV_AM,   //!< Classical amplitude modulation
 | 
					
						
							|  |  |  |         ATV_USB,  //!< AM with vestigial lower side band (main signal is in the upper side)
 | 
					
						
							|  |  |  |         ATV_LSB   //!< AM with vestigial upper side band (main signal is in the lower side)
 | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     enum ATVStd | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         ATVStdPAL625, | 
					
						
							|  |  |  |         ATVStdPAL525, | 
					
						
							| 
									
										
										
										
											2020-07-31 02:05:09 +00:00
										 |  |  |         ATVStd819, | 
					
						
							| 
									
										
										
										
											2017-12-29 22:00:52 +00:00
										 |  |  |         ATVStdShortInterleaved, | 
					
						
							|  |  |  |         ATVStdShort, | 
					
						
							|  |  |  |         ATVStdHSkip | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-01 14:13:35 +00:00
										 |  |  |     // RF settings
 | 
					
						
							|  |  |  |     qint64        m_inputFrequencyOffset; //!< Offset from baseband center frequency
 | 
					
						
							|  |  |  |     int           m_bfoFrequency;         //!< BFO frequency (Hz)
 | 
					
						
							|  |  |  |     ATVModulation m_atvModulation;        //!< RF modulation type
 | 
					
						
							|  |  |  |     float         m_fmDeviation;          //!< Expected FM deviation
 | 
					
						
							| 
									
										
										
										
											2020-06-30 23:37:47 +00:00
										 |  |  |     int           m_amScalingFactor;      //!< Factor in % to apply to detected signal scale
 | 
					
						
							|  |  |  |     int           m_amOffsetFactor;       //!< Factor in % to apply to adjusted signal scale
 | 
					
						
							| 
									
										
										
										
											2019-12-01 14:13:35 +00:00
										 |  |  |     bool          m_fftFiltering;         //!< Toggle FFT filter
 | 
					
						
							|  |  |  |     unsigned int  m_fftOppBandwidth;      //!< FFT filter lower frequency cutoff (Hz)
 | 
					
						
							|  |  |  |     unsigned int  m_fftBandwidth;         //!< FFT filter high frequency cutoff (Hz)
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // ATV settings
 | 
					
						
							|  |  |  |     int           m_nbLines;              //!< Number of lines per full frame
 | 
					
						
							|  |  |  |     int           m_fps;                  //!< Number of frames per second
 | 
					
						
							|  |  |  |     ATVStd        m_atvStd;               //!< Standard
 | 
					
						
							|  |  |  |     bool          m_hSync;                //!< Enable/disable horizontal sybchronization
 | 
					
						
							|  |  |  |     bool          m_vSync;                //!< Enable/disable vertical synchronization
 | 
					
						
							|  |  |  |     bool          m_invertVideo;          //!< Toggle invert video
 | 
					
						
							|  |  |  |     bool          m_halfFrames;           //!< Toggle half frames processing
 | 
					
						
							|  |  |  |     float         m_levelSynchroTop;      //!< Horizontal synchronization top level (0.0 to 1.0 scale)
 | 
					
						
							|  |  |  |     float         m_levelBlack;           //!< Black level (0.0 to 1.0 scale)
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // common channel settings
 | 
					
						
							| 
									
										
										
										
											2017-12-29 22:00:52 +00:00
										 |  |  |     quint32 m_rgbColor; | 
					
						
							|  |  |  |     QString m_title; | 
					
						
							|  |  |  |     QString m_udpAddress; | 
					
						
							|  |  |  |     uint16_t m_udpPort; | 
					
						
							|  |  |  |     Serializable *m_channelMarker; | 
					
						
							| 
									
										
										
										
											2019-12-01 14:13:35 +00:00
										 |  |  |     int m_streamIndex; | 
					
						
							| 
									
										
										
										
											2022-04-12 14:20:45 +00:00
										 |  |  |     bool m_useReverseAPI; | 
					
						
							|  |  |  |     QString m_reverseAPIAddress; | 
					
						
							|  |  |  |     uint16_t m_reverseAPIPort; | 
					
						
							|  |  |  |     uint16_t m_reverseAPIDeviceIndex; | 
					
						
							|  |  |  |     uint16_t m_reverseAPIChannelIndex; | 
					
						
							| 
									
										
										
										
											2022-01-09 04:27:12 +00:00
										 |  |  |     Serializable *m_rollupState; | 
					
						
							| 
									
										
										
										
											2022-04-12 14:20:45 +00:00
										 |  |  |     int m_workspaceIndex; | 
					
						
							|  |  |  |     QByteArray m_geometryBytes; | 
					
						
							| 
									
										
										
										
											2022-04-12 16:27:27 +00:00
										 |  |  |     bool m_hidden; | 
					
						
							| 
									
										
										
										
											2017-12-29 22:00:52 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     ATVDemodSettings(); | 
					
						
							|  |  |  |     void resetToDefaults(); | 
					
						
							|  |  |  |     void setChannelMarker(Serializable *channelMarker) { m_channelMarker = channelMarker; } | 
					
						
							| 
									
										
										
										
											2022-01-09 04:27:12 +00:00
										 |  |  |     void setRollupState(Serializable *rollupState) { m_rollupState = rollupState; } | 
					
						
							| 
									
										
										
										
											2017-12-29 22:00:52 +00:00
										 |  |  |     QByteArray serialize() const; | 
					
						
							|  |  |  |     bool deserialize(const QByteArray& data); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-01 14:13:35 +00:00
										 |  |  |     int getRFSliderDivisor(unsigned int sampleRate); | 
					
						
							| 
									
										
										
										
											2017-12-29 22:00:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-01 14:13:35 +00:00
										 |  |  |     static int getFps(int fpsIndex); | 
					
						
							|  |  |  |     static int getFpsIndex(int fps); | 
					
						
							| 
									
										
										
										
											2017-12-29 22:00:52 +00:00
										 |  |  |     static int getNumberOfLines(int nbLinesIndex); | 
					
						
							|  |  |  |     static int getNumberOfLinesIndex(int nbLines); | 
					
						
							| 
									
										
										
										
											2019-12-01 14:13:35 +00:00
										 |  |  |     static float getNominalLineTime(int nbLines, int fps); | 
					
						
							|  |  |  |     static float getRFBandwidthDivisor(ATVModulation modulation); | 
					
						
							| 
									
										
										
										
											2020-08-18 14:23:40 +00:00
										 |  |  |     static void getBaseValues(int sampleRate, int linesPerSecond, uint32_t& nbPointsPerLine); | 
					
						
							| 
									
										
										
										
											2017-12-29 22:00:52 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  |     int m_rfSliderDivisor; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif /* PLUGINS_CHANNELRX_DEMODATV_ATVDEMODSETTINGS_H_ */
 |