refs #335, volume and mute functions

* refs #339, in the same step fixed delete
This commit is contained in:
Klaus Basan
2014-10-22 14:35:40 +02:00
committed by Roland Winklmeier
parent efb89dd7be
commit e1647cd8fd
5 changed files with 88 additions and 21 deletions

View File

@@ -19,13 +19,12 @@ namespace BlackCore
CContextAudioProxy::CContextAudioProxy(const QString &serviceName, QDBusConnection &connection, CRuntimeConfig::ContextMode mode, CRuntime *runtime) : IContextAudio(mode, runtime), m_dBusInterface(nullptr)
{
this->m_dBusInterface = new BlackMisc::CGenericDBusInterface(
serviceName, IContextAudio::ObjectPath(), IContextAudio::InterfaceName(),
connection, this);
serviceName, IContextAudio::ObjectPath(), IContextAudio::InterfaceName(), connection, this);
this->relaySignals(serviceName, connection);
}
/*
* Workaround for signals, not working without, but why?
* Relaying signals
*/
void CContextAudioProxy::relaySignals(const QString &serviceName, QDBusConnection &connection)
{
@@ -33,7 +32,13 @@ namespace BlackCore
"audioTestCompleted", this, SIGNAL(audioTestCompleted()));
Q_ASSERT(s);
s = connection.connect(serviceName, IContextAudio::ObjectPath(), IContextAudio::InterfaceName(),
"changedVoiceRooms", this, SIGNAL(changedVoiceRooms(BlackMisc::Audio::CVoiceRoomList, bool)));
"changedVoiceRooms", this, SIGNAL(changedVoiceRooms(BlackMisc::Audio::CVoiceRoomList, bool)));
Q_ASSERT(s);
s = connection.connect(serviceName, IContextAudio::ObjectPath(), IContextAudio::InterfaceName(),
"changedAudioVolumes", this, SIGNAL(changedAudioVolumes(QList<qint32>)));
Q_ASSERT(s);
s = connection.connect(serviceName, IContextAudio::ObjectPath(), IContextAudio::InterfaceName(),
"changedMute", this, SIGNAL(changedMute(bool)));
Q_ASSERT(s);
Q_UNUSED(s);
}
@@ -198,6 +203,22 @@ namespace BlackCore
this->m_dBusInterface->callDBus(QLatin1Literal("setVolumes"), com1, com2);
}
/*
* Volumes
*/
void CContextAudioProxy::setVolumes(qint32 com1Volume, qint32 com2Volume)
{
this->m_dBusInterface->callDBus(QLatin1Literal("setVolumes"), com1Volume, com2Volume);
}
/*
* Toggle mute
*/
void CContextAudioProxy::setMute(bool muted)
{
return this->m_dBusInterface->callDBus(QLatin1Literal("setMute"), muted);
}
/*
* Muted?
*/