libdrmconf 0.15.0
A library to program DMR radios.
Loading...
Searching...
No Matches
tonesettings.hh
1#ifndef TONESETTINGS_HH
2#define TONESETTINGS_HH
3
4#include "configobject.hh"
5#include "level.hh"
6#include "channel.hh"
7
8
9class ToneSettings : public ConfigItem
10{
11 Q_OBJECT
12
14 Q_PROPERTY(bool silent READ silent WRITE enableSilent)
17
19 Q_PROPERTY(bool smsTone READ smsToneEnabled WRITE enableSMSTone)
21 Q_PROPERTY(bool ringtone READ ringtoneEnabled WRITE enableRingtone);
23 Q_PROPERTY(bool bootTone READ bootToneEnabled WRITE enableBootTone)
25 Q_PROPERTY(Melody * bootMelody READ bootMelody)
28 Q_PROPERTY(Channel::Types talkPermit READ talkPermit WRITE setTalkPermit)
30 Q_PROPERTY(Channel::Types callStart READ callStart WRITE setCallStart)
34 Q_PROPERTY(Channel::Types callEnd READ callEnd WRITE setCallEnd)
39 Q_PROPERTY(Channel::Types channelIdle READ channelIdle WRITE setChannelIdle)
45 Q_PROPERTY(bool callReset READ callResetEnabled WRITE enableCallReset)
48
49public:
51 explicit ToneSettings(QObject *parent = nullptr);
52
53 ConfigItem *clone() const override;
54
56 bool silent() const;
58 void enableSilent(bool enable);
59
61 bool keyToneEnabled() const;
63 Level keyToneVolume() const;
65 void setKeyToneVolume(Level volume);
67 void disableKeyTone();
68
70 bool smsToneEnabled() const;
72 void enableSMSTone(bool enable);
73
75 bool ringtoneEnabled() const;
77 void enableRingtone(bool enable);
78
80 bool bootToneEnabled() const;
82 void enableBootTone(bool enable);
84 Melody *bootMelody() const;
85
87 Channel::Types talkPermit() const;
89 void setTalkPermit(Channel::Types permit);
90
92 Channel::Types callStart() const;
94 void setCallStart(Channel::Types permit);
96 Melody *callStartMelody() const;
97
99 Channel::Types callEnd() const;
101 void setCallEnd(Channel::Types permit);
103 Melody *callEndMelody() const;
104
106 Channel::Types channelIdle() const;
108 void setChannelIdle(Channel::Types permit);
110 Melody *channelIdleMelody() const;
111
113 bool callResetEnabled() const;
115 void enableCallReset(bool enable);
117 Melody *callResetMelody() const;
118
119protected:
146};
147
148
149
150#endif //TONESETTINGS_HH
The base class of all channels (analog and digital) of a codeplug configuration.
Definition channel.hh:38
ConfigItem(QObject *parent=nullptr)
Hidden constructor.
Definition configobject.cc:158
Some simple class implementing a [1-10] level setting.
Definition level.hh:15
A config item that encodes a melody.
Definition melody.hh:20
void enableBootTone(bool enable)
Enables boot-tone.
Definition tonesettings.cc:102
Channel::Types _talkPermit
Enables talk-permit tones for several channel types.
Definition tonesettings.hh:133
bool ringtoneEnabled() const
Returns true, if the ringtone is enabled.
Definition tonesettings.cc:83
Channel::Types callStart
Enables call-start tone for different channel types.
Definition tonesettings.hh:30
bool callReset
Enables call reset tone.
Definition tonesettings.hh:45
bool _silent
If true, all tones are disabled.
Definition tonesettings.hh:121
Melody * bootMelody
Enables boot melody.
Definition tonesettings.hh:25
Melody * _callEndMelody
Call end melody.
Definition tonesettings.hh:139
bool bootToneEnabled() const
Returns true, if the boot-tone is enabled.
Definition tonesettings.cc:97
bool _callReset
Enables call-reset tones.
Definition tonesettings.hh:144
Level keyTone
Key tone volume.
Definition tonesettings.hh:16
void enableSMSTone(bool enable)
Enables/disables SMS tone.
Definition tonesettings.cc:74
Level _keyTone
The key tone volume.
Definition tonesettings.hh:123
void enableSilent(bool enable)
Disables all tones.
Definition tonesettings.cc:36
void setCallEnd(Channel::Types permit)
Sets channel types, for which the call-end tone is enabled.
Definition tonesettings.cc:154
void setCallStart(Channel::Types permit)
Sets channel types, for which the call-start tone is enabled.
Definition tonesettings.cc:135
bool _smsTone
Enables SMS tones.
Definition tonesettings.hh:125
bool smsTone
Enables notification tone for SMS reception.
Definition tonesettings.hh:19
Melody * callStartMelody
The call-start melody.
Definition tonesettings.hh:32
bool ringtone
Enables ringtones.
Definition tonesettings.hh:21
void setKeyToneVolume(Level volume)
Sets key tone volume.
Definition tonesettings.cc:55
Melody * _bootMelody
The boot melody.
Definition tonesettings.hh:131
Channel::Types channelIdle
Enables channel-idle tone for different channel types.
Definition tonesettings.hh:39
void enableCallReset(bool enable)
Enables call-reset tone.
Definition tonesettings.cc:192
bool keyToneEnabled() const
Returns true, if the key-tones are enabled.
Definition tonesettings.cc:45
Melody * _channelIdleMelody
Idle melody.
Definition tonesettings.hh:142
bool _bootTone
Enables boot-tone.
Definition tonesettings.hh:129
Channel::Types _channelIdle
Enables channel-idle tones for several channel types.
Definition tonesettings.hh:141
void setTalkPermit(Channel::Types permit)
Sets channel types, for which the talk-permit tone is enabled.
Definition tonesettings.cc:121
bool _ringtone
Enables ringtones.
Definition tonesettings.hh:127
Level keyToneVolume() const
Returns the key tone volume.
Definition tonesettings.cc:50
Channel::Types _callEnd
Enables call-end tones for several channel types.
Definition tonesettings.hh:138
ToneSettings(QObject *parent=nullptr)
Default constructor.
Definition tonesettings.cc:3
Channel::Types _callStart
Enables call-start tones for several channel types.
Definition tonesettings.hh:135
Melody * callEndMelody
The call-end melody.
Definition tonesettings.hh:36
Melody * _callResetMelody
Reset melody.
Definition tonesettings.hh:145
Melody * callResetMelody
The call-reset melody.
Definition tonesettings.hh:47
void disableKeyTone()
Disables key-tones.
Definition tonesettings.cc:63
Melody * channelIdleMelody
The channel-idle melody.
Definition tonesettings.hh:41
Channel::Types talkPermit
Enables talk-permit tone for different channel types.
Definition tonesettings.hh:28
Channel::Types callEnd
Enables call-end tone for different channel types.
Definition tonesettings.hh:34
bool bootTone
Enables boot melody.
Definition tonesettings.hh:23
void setChannelIdle(Channel::Types permit)
Sets channel types, for which the channel-idle tone is enabled.
Definition tonesettings.cc:173
bool silent
Disables all tones.
Definition tonesettings.hh:14
bool callResetEnabled() const
Returns true, if the call-reset tone is enabled.
Definition tonesettings.cc:187
ConfigItem * clone() const override
Clones this item.
Definition tonesettings.cc:20
bool smsToneEnabled() const
Returns true, if the SMS tone is enabled.
Definition tonesettings.cc:69
Melody * _callStartMelody
Call melody.
Definition tonesettings.hh:136
void enableRingtone(bool enable)
Enables ringtone.
Definition tonesettings.cc:88