SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
mainsettings.h
Go to the documentation of this file.
1 #ifndef INCLUDE_SETTINGS_H
2 #define INCLUDE_SETTINGS_H
3 
4 #include <QString>
6 #include "preferences.h"
7 #include "preset.h"
8 #include "export.h"
9 
10 class Command;
11 class AudioDeviceManager;
12 class AMBEEngine;
13 
15 public:
16  MainSettings();
17  ~MainSettings();
18 
19  void load();
20  void save() const;
21 
22  void resetToDefaults();
23  QString getFileLocation() const;
24  int getFileFormat() const;
25 
26  const Preferences& getPreferences() const { return m_preferences; }
27 
28  Preset* newPreset(const QString& group, const QString& description);
29  void deletePreset(const Preset* preset);
30  int getPresetCount() const { return m_presets.count(); }
31  const Preset* getPreset(int index) const { return m_presets[index]; }
32  const Preset* getPreset(const QString& groupName, quint64 centerFrequency, const QString& description, const QString& type) const;
33  void sortPresets();
34  void renamePresetGroup(const QString& oldGroupName, const QString& newGroupName);
35  void deletePresetGroup(const QString& groupName);
36 
37  void addCommand(Command *command);
38  void deleteCommand(const Command* command);
39  int getCommandCount() const { return m_commands.count(); }
40  const Command* getCommand(int index) const { return m_commands[index]; }
41  const Command* getCommand(const QString& groupName, const QString& description) const;
42  void sortCommands();
43  void renameCommandGroup(const QString& oldGroupName, const QString& newGroupName);
44  void deleteCommandGroup(const QString& groupName);
45 
46  const Preset& getWorkingPresetConst() const { return m_workingPreset; }
47  Preset* getWorkingPreset() { return &m_workingPreset; }
48  int getSourceIndex() const { return m_preferences.getSourceIndex(); }
49  void setSourceIndex(int value) { m_preferences.setSourceIndex(value); }
50  const QString& getSourceDeviceId() const { return m_preferences.getSourceDevice(); }
51  void setSourceDeviceId(const QString& deviceId) { m_preferences.setSourceDevice(deviceId); }
52 
53  void setLatitude(float latitude) { m_preferences.setLatitude(latitude); }
54  void setLongitude(float longitude) { m_preferences.setLongitude(longitude); }
55  float getLatitude() const { return m_preferences.getLatitude(); }
56  float getLongitude() const { return m_preferences.getLongitude(); }
57 
58  void setConsoleMinLogLevel(const QtMsgType& minLogLevel) { m_preferences.setConsoleMinLogLevel(minLogLevel); }
59  void setFileMinLogLevel(const QtMsgType& minLogLevel) { m_preferences.setFileMinLogLevel(minLogLevel); }
60  void setUseLogFile(bool useLogFile) { m_preferences.setUseLogFile(useLogFile); }
61  void setLogFileName(const QString& value) { m_preferences.setLogFileName(value); }
62  QtMsgType getConsoleMinLogLevel() const { return m_preferences.getConsoleMinLogLevel(); }
63  QtMsgType getFileMinLogLevel() const { return m_preferences.getFileMinLogLevel(); }
64  bool getUseLogFile() const { return m_preferences.getUseLogFile(); }
65  const QString& getLogFileName() const { return m_preferences.getLogFileName(); }
66  DeviceUserArgs& getDeviceUserArgs() { return m_hardwareDeviceUserArgs; }
67 
68  const AudioDeviceManager *getAudioDeviceManager() const { return m_audioDeviceManager; }
69  void setAudioDeviceManager(AudioDeviceManager *audioDeviceManager) { m_audioDeviceManager = audioDeviceManager; }
70  void setAMBEEngine(AMBEEngine *ambeEngine) { m_ambeEngine = ambeEngine; }
71 
72 protected:
76  typedef QList<Preset*> Presets;
77  Presets m_presets;
78  typedef QList<Command*> Commands;
79  Commands m_commands;
82 };
83 
84 #endif // INCLUDE_SETTINGS_H
float getLatitude() const
Definition: mainsettings.h:55
const QString & getLogFileName() const
Definition: mainsettings.h:65
Preferences m_preferences
Definition: mainsettings.h:73
QList< Command * > Commands
Definition: mainsettings.h:78
int getSourceIndex() const
Definition: mainsettings.h:48
bool getUseLogFile() const
Definition: mainsettings.h:64
const Command * getCommand(int index) const
Definition: mainsettings.h:40
Presets m_presets
Definition: mainsettings.h:77
void setConsoleMinLogLevel(const QtMsgType &minLogLevel)
Definition: mainsettings.h:58
Commands m_commands
Definition: mainsettings.h:79
int getPresetCount() const
Definition: mainsettings.h:30
AMBEEngine * m_ambeEngine
Definition: mainsettings.h:81
QtMsgType getFileMinLogLevel() const
Definition: mainsettings.h:63
Preset m_workingPreset
Definition: mainsettings.h:75
void setFileMinLogLevel(const QtMsgType &minLogLevel)
Definition: mainsettings.h:59
Definition: preset.h:28
Preset * getWorkingPreset()
Definition: mainsettings.h:47
void setAMBEEngine(AMBEEngine *ambeEngine)
Definition: mainsettings.h:70
void setLongitude(float longitude)
Definition: mainsettings.h:54
const AudioDeviceManager * getAudioDeviceManager() const
Definition: mainsettings.h:68
float getLongitude() const
Definition: mainsettings.h:56
const QString & getSourceDeviceId() const
Definition: mainsettings.h:50
const Preset * getPreset(int index) const
Definition: mainsettings.h:31
void setUseLogFile(bool useLogFile)
Definition: mainsettings.h:60
AudioDeviceManager * m_audioDeviceManager
Definition: mainsettings.h:74
QList< Preset * > Presets
Definition: mainsettings.h:76
const Preferences & getPreferences() const
Definition: mainsettings.h:26
void setAudioDeviceManager(AudioDeviceManager *audioDeviceManager)
Definition: mainsettings.h:69
DeviceUserArgs & getDeviceUserArgs()
Definition: mainsettings.h:66
void setLatitude(float latitude)
Definition: mainsettings.h:53
DeviceUserArgs m_hardwareDeviceUserArgs
Definition: mainsettings.h:80
int getCommandCount() const
Definition: mainsettings.h:39
QtMsgType getConsoleMinLogLevel() const
Definition: mainsettings.h:62
#define SDRBASE_API
Definition: export.h:40
const Preset & getWorkingPresetConst() const
Definition: mainsettings.h:46
void setLogFileName(const QString &value)
Definition: mainsettings.h:61
void setSourceIndex(int value)
Definition: mainsettings.h:49
void setSourceDeviceId(const QString &deviceId)
Definition: mainsettings.h:51