| 
									
										
										
										
											2023-11-19 06:43:20 +01:00
										 |  |  | ///////////////////////////////////////////////////////////////////////////////////////
 | 
					
						
							|  |  |  | // Copyright (C) 2012 maintech GmbH, Otto-Hahn-Str. 15, 97204 Hoechberg, Germany     //
 | 
					
						
							|  |  |  | // written by Christian Daniel                                                       //
 | 
					
						
							|  |  |  | // Copyright (C) 2015-2019, 2021-2022 Edouard Griffiths, F4EXB <f4exb06@gmail.com>   //
 | 
					
						
							|  |  |  | // Copyright (C) 2020, 2022-2023 Jon Beniston, M7RCE <jon@beniston.com>              //
 | 
					
						
							|  |  |  | //                                                                                   //
 | 
					
						
							|  |  |  | // 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                      //
 | 
					
						
							|  |  |  | // (at your option) any later version.                                               //
 | 
					
						
							|  |  |  | //                                                                                   //
 | 
					
						
							|  |  |  | // 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/>.              //
 | 
					
						
							|  |  |  | ///////////////////////////////////////////////////////////////////////////////////////
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | #ifndef INCLUDE_PREFERENCES_H
 | 
					
						
							|  |  |  | #define INCLUDE_PREFERENCES_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <QString>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-20 13:49:21 +01:00
										 |  |  | #include "export.h"
 | 
					
						
							| 
									
										
										
										
											2018-03-03 20:23:38 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | class SDRBASE_API Preferences { | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | public: | 
					
						
							| 
									
										
										
										
											2022-03-20 12:23:50 +01:00
										 |  |  |     enum ElementType | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         SourceDevice = 2, | 
					
						
							|  |  |  |         AudioType, | 
					
						
							|  |  |  |         AudioDevice, | 
					
						
							|  |  |  |         SourceIndex, | 
					
						
							|  |  |  |         Latitude, | 
					
						
							|  |  |  |         Longitude, | 
					
						
							|  |  |  |         ConsoleMinLogLevel, | 
					
						
							|  |  |  |         UseLogFile, | 
					
						
							|  |  |  |         LogFileName, | 
					
						
							|  |  |  |         FileMinLogLevel, | 
					
						
							|  |  |  |         StationName, | 
					
						
							|  |  |  |         Altitude, | 
					
						
							| 
									
										
										
										
											2022-06-18 12:35:44 +01:00
										 |  |  |         SourceItemIndex, | 
					
						
							| 
									
										
										
										
											2022-12-20 21:06:39 +00:00
										 |  |  |         Multisampling, | 
					
						
							| 
									
										
										
										
											2023-02-14 14:46:08 +00:00
										 |  |  |         AutoUpdatePosition, | 
					
						
							| 
									
										
										
										
											2023-02-16 11:00:30 +00:00
										 |  |  |         MapMultisampling, | 
					
						
							| 
									
										
										
										
											2023-08-13 23:52:57 +01:00
										 |  |  |         MapSmoothing, | 
					
						
							|  |  |  |         FFTEngine | 
					
						
							| 
									
										
										
										
											2022-03-20 12:23:50 +01:00
										 |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     Preferences(); | 
					
						
							|  |  |  |     Preferences(const Preferences&) = default; | 
					
						
							|  |  |  |     Preferences& operator=(const Preferences&) = default; | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	void resetToDefaults(); | 
					
						
							|  |  |  | 	QByteArray serialize() const; | 
					
						
							|  |  |  | 	bool deserialize(const QByteArray& data); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	const QString& getSourceDevice() const { return m_sourceDevice; } | 
					
						
							| 
									
										
										
										
											2022-03-20 12:23:50 +01:00
										 |  |  | 	void setSourceDevice(const QString& value) { m_sourceDevice = value; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-10-02 02:22:56 +02:00
										 |  |  | 	int getSourceIndex() const { return m_sourceIndex; } | 
					
						
							| 
									
										
										
										
											2022-03-20 12:23:50 +01:00
										 |  |  | 	void setSourceIndex(const int value) { m_sourceIndex = value; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-05 12:35:39 +01:00
										 |  |  | 	int getSourceItemIndex() const { return m_sourceItemIndex; } | 
					
						
							| 
									
										
										
										
											2022-03-20 12:23:50 +01:00
										 |  |  | 	void setSourceItemIndex(const int value) { m_sourceItemIndex = value; } | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	const QString& getAudioType() const { return m_audioType; } | 
					
						
							| 
									
										
										
										
											2022-03-20 12:23:50 +01:00
										 |  |  | 	void setAudioType(const QString& value) { m_audioType = value; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 	const QString& getAudioDevice() const { return m_audioDevice; } | 
					
						
							| 
									
										
										
										
											2022-03-20 12:23:50 +01:00
										 |  |  | 	void setAudioDevice(const QString& value) { m_audioDevice = value; } | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-03-20 12:23:50 +01:00
										 |  |  |     QString getStationName() const { return m_stationName; } | 
					
						
							| 
									
										
										
										
											2020-10-27 16:22:10 +00:00
										 |  |  | 	void setStationName(const QString& name) { m_stationName = name; } | 
					
						
							| 
									
										
										
										
											2022-03-20 12:23:50 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-28 13:38:38 +02:00
										 |  |  | 	float getLatitude() const { return m_latitude; } | 
					
						
							| 
									
										
										
										
											2022-03-20 12:23:50 +01:00
										 |  |  |     void setLatitude(float latitude) { m_latitude = latitude; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-28 13:38:38 +02:00
										 |  |  | 	float getLongitude() const { return m_longitude; } | 
					
						
							| 
									
										
										
										
											2022-03-20 12:23:50 +01:00
										 |  |  | 	void setLongitude(float longitude) { m_longitude = longitude; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-27 16:22:10 +00:00
										 |  |  | 	float getAltitude() const { return m_altitude; } | 
					
						
							| 
									
										
										
										
											2022-03-20 12:23:50 +01:00
										 |  |  | 	void setAltitude(float altitude) { m_altitude = altitude; } | 
					
						
							| 
									
										
										
										
											2016-09-28 13:38:38 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-20 21:06:39 +00:00
										 |  |  | 	bool getAutoUpdatePosition() const { return m_autoUpdatePosition; } | 
					
						
							|  |  |  | 	void setAutoUpdatePosition(bool autoUpdatePosition) { m_autoUpdatePosition = autoUpdatePosition; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-12 02:23:55 +01:00
										 |  |  | 	QtMsgType getConsoleMinLogLevel() const { return m_consoleMinLogLevel; } | 
					
						
							| 
									
										
										
										
											2022-03-20 12:23:50 +01:00
										 |  |  | 	void setConsoleMinLogLevel(const QtMsgType& minLogLevel) { m_consoleMinLogLevel = minLogLevel; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-12 02:23:55 +01:00
										 |  |  |     QtMsgType getFileMinLogLevel() const { return m_fileMinLogLevel; } | 
					
						
							| 
									
										
										
										
											2022-03-20 12:23:50 +01:00
										 |  |  |     void setFileMinLogLevel(const QtMsgType& minLogLevel) { m_fileMinLogLevel = minLogLevel; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-11 19:26:23 +01:00
										 |  |  | 	bool getUseLogFile() const { return m_useLogFile; } | 
					
						
							| 
									
										
										
										
											2022-03-20 12:23:50 +01:00
										 |  |  | 	void setUseLogFile(bool useLogFile) { m_useLogFile = useLogFile; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-11 19:26:23 +01:00
										 |  |  | 	const QString& getLogFileName() const { return m_logFileName; } | 
					
						
							| 
									
										
										
										
											2022-03-20 12:23:50 +01:00
										 |  |  | 	void setLogFileName(const QString& value) { m_logFileName = value; } | 
					
						
							| 
									
										
										
										
											2017-11-11 19:26:23 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-06-18 12:35:44 +01:00
										 |  |  |     int getMultisampling() const { return m_multisampling; } | 
					
						
							|  |  |  |     void setMultisampling(int samples) { m_multisampling = samples; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-14 14:46:08 +00:00
										 |  |  |     int getMapMultisampling() const { return m_mapMultisampling; } | 
					
						
							|  |  |  |     void setMapMultisampling(int samples) { m_mapMultisampling = samples; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-16 11:00:30 +00:00
										 |  |  |     bool getMapSmoothing() const { return m_mapSmoothing; } | 
					
						
							|  |  |  |     void setMapSmoothing(bool smoothing) { m_mapSmoothing = smoothing; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-13 23:52:57 +01:00
										 |  |  |     const QString& getFFTEngine() const { return m_fftEngine; } | 
					
						
							|  |  |  |     void setFFTEngine(const QString& fftEngine) { m_fftEngine = fftEngine; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | protected: | 
					
						
							| 
									
										
										
										
											2019-07-31 23:56:23 +02:00
										 |  |  | 	QString m_sourceDevice; //!< Identification of the source used in R0 tab (GUI flavor) at startup
 | 
					
						
							|  |  |  | 	int m_sourceIndex;      //!< Index of the source used in R0 tab (GUI flavor) at startup
 | 
					
						
							| 
									
										
										
										
											2021-12-05 12:35:39 +01:00
										 |  |  | 	int m_sourceItemIndex;  //!< Index of device item in the source used in R0 tab (GUI flavor) at startup
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	QString m_audioType; | 
					
						
							|  |  |  | 	QString m_audioDevice; | 
					
						
							| 
									
										
										
										
											2016-09-28 13:38:38 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-27 16:22:10 +00:00
										 |  |  | 	QString m_stationName;  //!< Name of the station (for drawing on the map)
 | 
					
						
							| 
									
										
										
										
											2021-12-05 12:35:39 +01:00
										 |  |  |     float m_latitude;       //!< Position of the station
 | 
					
						
							| 
									
										
										
										
											2016-09-28 13:38:38 +02:00
										 |  |  | 	float m_longitude; | 
					
						
							| 
									
										
										
										
											2021-12-05 12:35:39 +01:00
										 |  |  |     float m_altitude;       //!< Altitude in metres
 | 
					
						
							| 
									
										
										
										
											2022-12-20 21:06:39 +00:00
										 |  |  |     bool m_autoUpdatePosition; //!< Automatically update position from GPS
 | 
					
						
							| 
									
										
										
										
											2017-11-11 19:26:23 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-12 02:23:55 +01:00
										 |  |  | 	QtMsgType m_consoleMinLogLevel; | 
					
						
							|  |  |  |     QtMsgType m_fileMinLogLevel; | 
					
						
							| 
									
										
										
										
											2017-11-11 19:26:23 +01:00
										 |  |  | 	bool m_useLogFile; | 
					
						
							|  |  |  | 	QString m_logFileName; | 
					
						
							| 
									
										
										
										
											2022-06-18 12:35:44 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-14 14:46:08 +00:00
										 |  |  |     int m_multisampling;    //!< Number of samples to use for multisampling anti-aliasing for spectrums (typically 0 or 4)
 | 
					
						
							| 
									
										
										
										
											2023-02-16 11:00:30 +00:00
										 |  |  |     int m_mapMultisampling; //!< Number of samples to use for multisampling anti-aliasing for 2D maps (16 gives best text, if not using mapSmoothing)
 | 
					
						
							|  |  |  |     bool m_mapSmoothing;    //!< Whether to use smoothing for text boxes on 2D maps
 | 
					
						
							| 
									
										
										
										
											2023-08-13 23:52:57 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     QString m_fftEngine;    //!< FFT Engine (FFTW, Kiss, vkFFT)
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif // INCLUDE_PREFERENCES_H
 |