1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-29 19:28:47 -05:00
sdrangel/sdrbase/settings/preferences.h

100 lines
3.3 KiB
C
Raw Normal View History

#ifndef INCLUDE_PREFERENCES_H
#define INCLUDE_PREFERENCES_H
#include <QString>
#include "export.h"
2018-03-03 14:23:38 -05:00
class SDRBASE_API Preferences {
public:
enum ElementType
{
SourceDevice = 2,
AudioType,
AudioDevice,
SourceIndex,
Latitude,
Longitude,
ConsoleMinLogLevel,
UseLogFile,
LogFileName,
FileMinLogLevel,
StationName,
Altitude,
2022-06-18 07:35:44 -04:00
SourceItemIndex,
Multisampling
};
Preferences();
Preferences(const Preferences&) = default;
Preferences& operator=(const Preferences&) = default;
void resetToDefaults();
QByteArray serialize() const;
bool deserialize(const QByteArray& data);
const QString& getSourceDevice() const { return m_sourceDevice; }
void setSourceDevice(const QString& value) { m_sourceDevice = value; }
int getSourceIndex() const { return m_sourceIndex; }
void setSourceIndex(const int value) { m_sourceIndex = value; }
int getSourceItemIndex() const { return m_sourceItemIndex; }
void setSourceItemIndex(const int value) { m_sourceItemIndex = value; }
const QString& getAudioType() const { return m_audioType; }
void setAudioType(const QString& value) { m_audioType = value; }
const QString& getAudioDevice() const { return m_audioDevice; }
void setAudioDevice(const QString& value) { m_audioDevice = value; }
QString getStationName() const { return m_stationName; }
void setStationName(const QString& name) { m_stationName = name; }
2016-09-28 07:38:38 -04:00
float getLatitude() const { return m_latitude; }
void setLatitude(float latitude) { m_latitude = latitude; }
2016-09-28 07:38:38 -04:00
float getLongitude() const { return m_longitude; }
void setLongitude(float longitude) { m_longitude = longitude; }
float getAltitude() const { return m_altitude; }
void setAltitude(float altitude) { m_altitude = altitude; }
2016-09-28 07:38:38 -04:00
2017-11-11 20:23:55 -05:00
QtMsgType getConsoleMinLogLevel() const { return m_consoleMinLogLevel; }
void setConsoleMinLogLevel(const QtMsgType& minLogLevel) { m_consoleMinLogLevel = minLogLevel; }
2017-11-11 20:23:55 -05:00
QtMsgType getFileMinLogLevel() const { return m_fileMinLogLevel; }
void setFileMinLogLevel(const QtMsgType& minLogLevel) { m_fileMinLogLevel = minLogLevel; }
bool getUseLogFile() const { return m_useLogFile; }
void setUseLogFile(bool useLogFile) { m_useLogFile = useLogFile; }
const QString& getLogFileName() const { return m_logFileName; }
void setLogFileName(const QString& value) { m_logFileName = value; }
2022-06-18 07:35:44 -04:00
int getMultisampling() const { return m_multisampling; }
void setMultisampling(int samples) { m_multisampling = samples; }
protected:
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
int m_sourceItemIndex; //!< Index of device item in the source used in R0 tab (GUI flavor) at startup
QString m_audioType;
QString m_audioDevice;
2016-09-28 07:38:38 -04:00
QString m_stationName; //!< Name of the station (for drawing on the map)
float m_latitude; //!< Position of the station
2016-09-28 07:38:38 -04:00
float m_longitude;
float m_altitude; //!< Altitude in metres
2017-11-11 20:23:55 -05:00
QtMsgType m_consoleMinLogLevel;
QtMsgType m_fileMinLogLevel;
bool m_useLogFile;
QString m_logFileName;
2022-06-18 07:35:44 -04:00
int m_multisampling; //!< Number of samples to use for multisampling anti-aliasing (typically 0 or 4)
};
#endif // INCLUDE_PREFERENCES_H