libdrmconf  0.12.0
A library to program DMR radios.
radiosettings.hh
1 #ifndef RADIOSETTINGS_HH
2 #define RADIOSETTINGS_HH
3 
4 #include "configobject.hh"
5 #include "channel.hh"
6 
7 #include "radioddity_extensions.hh"
8 #include "anytone_extension.hh"
9 #include "tyt_extensions.hh"
10 
11 
14 class RadioSettings : public ConfigItem
15 {
16  Q_OBJECT
18  Q_PROPERTY(QString introLine1 READ introLine1 WRITE setIntroLine1)
20  Q_PROPERTY(QString introLine2 READ introLine2 WRITE setIntroLine2)
22  Q_PROPERTY(unsigned micLevel READ micLevel WRITE setMicLevel)
24  Q_PROPERTY(bool speech READ speech WRITE enableSpeech)
26  Q_PROPERTY(Channel::Power power READ power WRITE setPower)
28  Q_PROPERTY(unsigned squelch READ squelch WRITE setSquelch)
30  Q_PROPERTY(unsigned vox READ vox WRITE setVOX)
32  Q_PROPERTY(unsigned tot READ tot WRITE setTOT)
41 
42 public:
44  explicit RadioSettings(QObject *parent=nullptr);
45 
46  bool copy(const ConfigItem &other);
47  ConfigItem *clone() const;
48 
50  void clear();
51 
53  const QString &introLine1() const;
55  void setIntroLine1(const QString &line);
56 
58  const QString &introLine2() const;
60  void setIntroLine2(const QString &line);
61 
63  unsigned micLevel() const;
65  void setMicLevel(unsigned value);
66 
68  bool speech() const;
70  void enableSpeech(bool enabled);
71 
73  unsigned squelch() const;
75  void setSquelch(unsigned squelch);
76 
78  Channel::Power power() const;
81 
83  bool voxDisabled() const;
85  unsigned vox() const;
87  void setVOX(unsigned level);
89  void disableVOX();
90 
92  bool totDisabled() const;
94  unsigned tot() const;
96  void setTOT(unsigned sec);
98  void disableTOT();
99 
103  DMRRadioID *defaultId() const;
105  void setDefaultId(DMRRadioID *id);
106 
111 
116 
121 
122 protected slots:
124  void onExtensionModified();
125 
126 protected:
128  QString _introLine1;
130  QString _introLine2;
132  unsigned _micLevel;
134  bool _speech;
136  unsigned _squelch;
140  unsigned _vox;
151 };
152 
153 #endif // RADIOCONFIG_HH
Implements the device specific extension for the general settings of AnyTone devices.
Definition: anytone_extension.hh:2052
Power
Specifies the prefix for every ID assigned to every channel during serialization.
Definition: channel.hh:61
Base class for all configuration objects (channels, zones, contacts, etc).
Definition: configobject.hh:40
Implements a reference to a radio ID.
Definition: configreference.hh:251
Represents a DMR radio ID within the abstract config.
Definition: radioid.hh:33
Represents the common radio-global settings.
Definition: radiosettings.hh:15
RadiodditySettingsExtension * radioddity
The settings extension for Radioddity devices.
Definition: radiosettings.hh:38
void setVOX(unsigned level)
Sets the default VOX level [0-10], 0=disabled.
Definition: radiosettings.cc:119
DMRRadioIDReference * defaultID
The default DMR radio ID.
Definition: radiosettings.hh:34
QString _introLine2
Holds the second intro line.
Definition: radiosettings.hh:130
RadioSettings(QObject *parent=nullptr)
Default constructor.
Definition: radiosettings.cc:4
ConfigItem * clone() const
Clones this item.
Definition: radiosettings.cc:26
TyTSettingsExtension * tyt
The settings extension for TyT devices.
Definition: radiosettings.hh:36
unsigned squelch
The squelch level.
Definition: radiosettings.hh:28
QString _introLine1
Holds the first intro line.
Definition: radiosettings.hh:128
void enableSpeech(bool enabled)
Enables/disables the speech synthesis.
Definition: radiosettings.cc:84
void clear()
Resets the settings.
Definition: radiosettings.cc:36
AnytoneSettingsExtension * anytoneExtension() const
Returns the AnyTone device specific radio settings.
Definition: radiosettings.cc:198
void setSquelch(unsigned squelch)
Sets the default squelch level.
Definition: radiosettings.cc:94
bool _speech
Holds the speech synthesis flag.
Definition: radiosettings.hh:134
AnytoneSettingsExtension * anytone
Settings for AnyTone devices.
Definition: radiosettings.hh:40
void setTOT(unsigned sec)
Sets the default transmit timeout (TOT) in seconds, 0=disabled.
Definition: radiosettings.cc:137
bool totDisabled() const
Returns true if the transmit timeout (TOT) is disabled.
Definition: radiosettings.cc:129
bool voxDisabled() const
Returns true if VOX is disabled by default.
Definition: radiosettings.cc:111
void onExtensionModified()
Internal used callback whenever an extension is modified.
Definition: radiosettings.cc:216
DMRRadioID * defaultId() const
Returns the default DMR ID or nullptr, if non is set.
Definition: radiosettings.cc:151
QString introLine1
The first intro line.
Definition: radiosettings.hh:18
void setIntroLine1(const QString &line)
(Re-)Sets the first intro line.
Definition: radiosettings.cc:54
bool speech
Speech synthesis flag.
Definition: radiosettings.hh:24
unsigned _micLevel
Holds the mic amplification level.
Definition: radiosettings.hh:132
unsigned vox
The default vox sensitivity.
Definition: radiosettings.hh:30
unsigned tot
The default transmit timeout.
Definition: radiosettings.hh:32
void setTyTExtension(TyTSettingsExtension *ext)
Sets the TyT device specific radio settings.
Definition: radiosettings.cc:166
unsigned _squelch
Holds the global squelch setting.
Definition: radiosettings.hh:136
void setMicLevel(unsigned value)
(Re-)Sets the MIC amplification level [1,10].
Definition: radiosettings.cc:74
RadiodditySettingsExtension * radioddityExtension() const
Returns the Radioddity device specific radio settings.
Definition: radiosettings.cc:180
DMRRadioIDReference * _defaultId
Reference to the default DMR radio ID.
Definition: radiosettings.hh:144
void disableTOT()
Disables the transmit timeout (TOT).
Definition: radiosettings.cc:142
void setDefaultId(DMRRadioID *id)
Sets the default DMR ID.
Definition: radiosettings.cc:157
RadiodditySettingsExtension * _radioddityExtension
Device specific settings extension for Radioddity devices.
Definition: radiosettings.hh:148
void setPower(Channel::Power power)
Sets the default channel power.
Definition: radiosettings.cc:105
unsigned micLevel
The mic amplification level.
Definition: radiosettings.hh:22
void setIntroLine2(const QString &line)
(Re-)Sets the second intro line.
Definition: radiosettings.cc:64
AnytoneSettingsExtension * _anytoneExtension
Device specific settings extension for AnyTone devices.
Definition: radiosettings.hh:150
bool copy(const ConfigItem &other)
Copies the given item into this one.
Definition: radiosettings.cc:14
void setAnytoneExtension(AnytoneSettingsExtension *ext)
Sets the AnyTone device specific radio settings.
Definition: radiosettings.cc:202
TyTSettingsExtension * tytExtension() const
Returns the TyT device specific radio settings.
Definition: radiosettings.cc:162
void disableVOX()
Disables VOX by default.
Definition: radiosettings.cc:124
QString introLine2
The scond intro line.
Definition: radiosettings.hh:20
unsigned _vox
Holds the global VOX level.
Definition: radiosettings.hh:140
Channel::Power power
The default channel power.
Definition: radiosettings.hh:26
Channel::Power _power
Holds the global power setting.
Definition: radiosettings.hh:138
TyTSettingsExtension * _tytExtension
Device specific settings extension for TyT devices.
Definition: radiosettings.hh:146
void setRadioddityExtension(RadiodditySettingsExtension *ext)
Sets the Radioddity device specific radio settings.
Definition: radiosettings.cc:184
DMRRadioIDReference * defaultIdRef() const
Retruns a reference to the default DMR radio Id.
Definition: radiosettings.cc:147
unsigned _transmitTimeOut
Holds the global transmit timeout.
Definition: radiosettings.hh:142
Represents the general settings extension for Radioddity devices.
Definition: radioddity_extensions.hh:313
Represents the TyT general settings extension.
Definition: tyt_extensions.hh:678