1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-23 16:38:37 -05:00
sdrangel/sdrbase/settings/mainsettings.h

90 lines
3.8 KiB
C
Raw Normal View History

#ifndef INCLUDE_SETTINGS_H
#define INCLUDE_SETTINGS_H
#include <QString>
2019-06-12 12:50:53 -04:00
#include "device/deviceuserargs.h"
#include "preferences.h"
#include "preset.h"
#include "export.h"
2018-01-04 05:11:53 -05:00
class Command;
2019-07-20 17:25:00 -04:00
class AudioDeviceManager;
class AMBEEngine;
2018-01-04 05:11:53 -05:00
2018-03-03 14:23:38 -05:00
class SDRBASE_API MainSettings {
public:
MainSettings();
~MainSettings();
void load();
void save() const;
void resetToDefaults();
2019-08-06 02:48:14 -04:00
void initialize();
2019-01-17 05:22:38 -05:00
QString getFileLocation() const;
int getFileFormat() const; //!< see QSettings::Format for the values
const Preferences& getPreferences() const { return m_preferences; }
2019-08-06 02:48:14 -04:00
void setPreferences(const Preferences& preferences) { m_preferences = preferences; }
Preset* newPreset(const QString& group, const QString& description);
2019-08-06 02:48:14 -04:00
void addPreset(Preset *preset);
void deletePreset(const Preset* preset);
int getPresetCount() const { return m_presets.count(); }
const Preset* getPreset(int index) const { return m_presets[index]; }
2019-05-08 19:12:40 -04:00
const Preset* getPreset(const QString& groupName, quint64 centerFrequency, const QString& description, const QString& type) const;
void sortPresets();
void renamePresetGroup(const QString& oldGroupName, const QString& newGroupName);
void deletePresetGroup(const QString& groupName);
2019-08-06 02:48:14 -04:00
void clearPresets();
2018-01-04 05:11:53 -05:00
void addCommand(Command *command);
void deleteCommand(const Command* command);
int getCommandCount() const { return m_commands.count(); }
const Command* getCommand(int index) const { return m_commands[index]; }
const Command* getCommand(const QString& groupName, const QString& description) const;
void sortCommands();
void renameCommandGroup(const QString& oldGroupName, const QString& newGroupName);
void deleteCommandGroup(const QString& groupName);
2019-08-06 02:48:14 -04:00
void clearCommands();
2018-01-04 05:11:53 -05:00
const Preset& getWorkingPresetConst() const { return m_workingPreset; }
Preset* getWorkingPreset() { return &m_workingPreset; }
int getSourceIndex() const { return m_preferences.getSourceIndex(); }
void setSourceIndex(int value) { m_preferences.setSourceIndex(value); }
2017-11-01 22:30:54 -04:00
const QString& getSourceDeviceId() const { return m_preferences.getSourceDevice(); }
void setSourceDeviceId(const QString& deviceId) { m_preferences.setSourceDevice(deviceId); }
2016-09-28 07:38:38 -04:00
void setLatitude(float latitude) { m_preferences.setLatitude(latitude); }
void setLongitude(float longitude) { m_preferences.setLongitude(longitude); }
float getLatitude() const { return m_preferences.getLatitude(); }
float getLongitude() const { return m_preferences.getLongitude(); }
2017-11-11 20:23:55 -05:00
void setConsoleMinLogLevel(const QtMsgType& minLogLevel) { m_preferences.setConsoleMinLogLevel(minLogLevel); }
void setFileMinLogLevel(const QtMsgType& minLogLevel) { m_preferences.setFileMinLogLevel(minLogLevel); }
void setUseLogFile(bool useLogFile) { m_preferences.setUseLogFile(useLogFile); }
void setLogFileName(const QString& value) { m_preferences.setLogFileName(value); }
2017-11-11 20:23:55 -05:00
QtMsgType getConsoleMinLogLevel() const { return m_preferences.getConsoleMinLogLevel(); }
QtMsgType getFileMinLogLevel() const { return m_preferences.getFileMinLogLevel(); }
bool getUseLogFile() const { return m_preferences.getUseLogFile(); }
const QString& getLogFileName() const { return m_preferences.getLogFileName(); }
2019-06-12 12:50:53 -04:00
DeviceUserArgs& getDeviceUserArgs() { return m_hardwareDeviceUserArgs; }
const AudioDeviceManager *getAudioDeviceManager() const { return m_audioDeviceManager; }
void setAudioDeviceManager(AudioDeviceManager *audioDeviceManager) { m_audioDeviceManager = audioDeviceManager; }
2019-07-20 17:25:00 -04:00
void setAMBEEngine(AMBEEngine *ambeEngine) { m_ambeEngine = ambeEngine; }
protected:
Preferences m_preferences;
AudioDeviceManager *m_audioDeviceManager;
Preset m_workingPreset;
typedef QList<Preset*> Presets;
Presets m_presets;
2018-01-04 05:11:53 -05:00
typedef QList<Command*> Commands;
Commands m_commands;
2019-06-12 12:50:53 -04:00
DeviceUserArgs m_hardwareDeviceUserArgs;
2019-07-20 17:25:00 -04:00
AMBEEngine *m_ambeEngine;
};
#endif // INCLUDE_SETTINGS_H