Skip to content
Snippets Groups Projects
Commit fead48ec authored by Emmanuel Lepage Vallee's avatar Emmanuel Lepage Vallee
Browse files

[ #37081 ] Implement new 'mute DTMF' option

parent 0bcbca12
Branches
Tags
No related merge requests found
...@@ -192,6 +192,18 @@ void AudioSettingsModel::setCaptureVolume(int volume) ...@@ -192,6 +192,18 @@ void AudioSettingsModel::setCaptureVolume(int volume)
emit captureVolumeChanged(volume); emit captureVolumeChanged(volume);
} }
void AudioSettingsModel::setDTMFMuted(bool muted)
{
//TODO
DBus::ConfigurationManager::instance().muteDtmf(muted);
emit DTMFMutedChanged(muted);
}
bool AudioSettingsModel::areDTMFMuted() const
{
return DBus::ConfigurationManager::instance().isDtmfMuted();
}
/**************************************************************** /****************************************************************
* * * *
* AlsaPluginModel * * AlsaPluginModel *
......
...@@ -56,6 +56,7 @@ public: ...@@ -56,6 +56,7 @@ public:
bool isNoiseSuppressEnabled () const; bool isNoiseSuppressEnabled () const;
bool isPlaybackMuted() const; bool isPlaybackMuted() const;
bool isCaptureMuted () const; bool isCaptureMuted () const;
bool areDTMFMuted () const;
int playbackVolume () const; int playbackVolume () const;
int captureVolume () const; int captureVolume () const;
...@@ -85,12 +86,14 @@ public Q_SLOTS: ...@@ -85,12 +86,14 @@ public Q_SLOTS:
void muteCapture ( bool m ); void muteCapture ( bool m );
void setPlaybackVolume( int volume ); void setPlaybackVolume( int volume );
void setCaptureVolume ( int volume ); void setCaptureVolume ( int volume );
void setDTMFMuted ( bool muted );
Q_SIGNALS: Q_SIGNALS:
void captureMuted(bool); void captureMuted(bool);
void playbackMuted(bool); void playbackMuted(bool);
void playbackVolumeChanged(int); void playbackVolumeChanged(int);
void captureVolumeChanged(int); void captureVolumeChanged(int);
void DTMFMutedChanged(bool);
private: private:
//Constructor //Constructor
......
...@@ -204,16 +204,17 @@ void ContactProxyModel::reloadCategories() ...@@ -204,16 +204,17 @@ void ContactProxyModel::reloadCategories()
void ContactProxyModel::slotContactAdded(Contact* c) void ContactProxyModel::slotContactAdded(Contact* c)
{ {
if (!c) return;
const QString val = category(c); const QString val = category(c);
TopLevelItem* item = getTopLevelItem(val); TopLevelItem* item = getTopLevelItem(val);
ContactTreeNode* contactNode = new ContactTreeNode(c,this); ContactTreeNode* contactNode = new ContactTreeNode(c,this);
contactNode->m_pParent3 = item; contactNode->m_pParent3 = item;
contactNode->m_Index = item->m_lChildren.size(); contactNode->m_Index = item->m_lChildren.size();
emit layoutAboutToBeChanged(); //emit layoutAboutToBeChanged();
beginInsertRows(index(item->m_Index,0,QModelIndex()),item->m_lChildren.size(),item->m_lChildren.size()); { beginInsertRows(index(item->m_Index,0,QModelIndex()),item->m_lChildren.size(),item->m_lChildren.size()); {
item->m_lChildren << contactNode; item->m_lChildren << contactNode;
} endInsertRows(); } endInsertRows();
emit layoutChanged(); //emit layoutChanged();
} }
bool ContactProxyModel::setData( const QModelIndex& index, const QVariant &value, int role) bool ContactProxyModel::setData( const QModelIndex& index, const QVariant &value, int role)
...@@ -503,6 +504,8 @@ int ContactProxyModel::acceptedPayloadTypes() ...@@ -503,6 +504,8 @@ int ContactProxyModel::acceptedPayloadTypes()
QString ContactProxyModel::category(Contact* ct) const { QString ContactProxyModel::category(Contact* ct) const {
if (!ct)
return QString();
QString cat; QString cat;
switch (m_Role) { switch (m_Role) {
case AbstractContactBackend::Role::Organization: case AbstractContactBackend::Role::Organization:
......
...@@ -267,6 +267,13 @@ ...@@ -267,6 +267,13 @@
</arg> </arg>
</signal> </signal>
<!-- For now only expose these two options to clients -->
<method name="muteDtmf" tp:name-for-bindings="muteDtmf">
<arg type="b" name="muteDtmf" direction="in"/>
</method>
<method name="isDtmfMuted" tp:name-for-bindings="isDtmfMuted">
<arg type="b" name="muted" direction="out"/>
</method>
<method name="muteCapture" tp:name-for-bindings="muteCapture"> <method name="muteCapture" tp:name-for-bindings="muteCapture">
<arg type="b" name="mute" direction="in"> <arg type="b" name="mute" direction="in">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment