refs #912, icon and identifier for PTT hotkey as static functions

This commit is contained in:
Klaus Basan
2017-03-18 20:40:51 +01:00
committed by Mathew Sutcliffe
parent 422e6626c8
commit 08f6f3f81c
3 changed files with 35 additions and 11 deletions

View File

@@ -14,11 +14,37 @@
#include "blackcore/context/contextaudioimpl.h"
#include "blackcore/context/contextaudioproxy.h"
#include "blackmisc/dbusserver.h"
#include "blackmisc/icons.h"
using namespace BlackMisc;
namespace BlackCore
{
namespace Context
{
const QString &IContextAudio::InterfaceName()
{
static const QString s(BLACKCORE_CONTEXTAUDIO_INTERFACENAME);
return s;
}
const QString &IContextAudio::ObjectPath()
{
static const QString s(BLACKCORE_CONTEXTAUDIO_OBJECTPATH);
return s;
}
const QString &IContextAudio::pttHotkeyAction()
{
static const QString s("/Voice/Activate push-to-talk");
return s;
}
const QPixmap &IContextAudio::pttHotkeyIcon()
{
return CIcons::radio16();
}
IContextAudio *IContextAudio::create(CCoreFacade *runtime, CCoreFacadeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &conn)
{
switch (mode)

View File

@@ -65,18 +65,16 @@ namespace BlackCore
public:
//! Interface name
static const QString &InterfaceName()
{
static QString s(BLACKCORE_CONTEXTAUDIO_INTERFACENAME);
return s;
}
static const QString &InterfaceName();
//! Object path
static const QString &ObjectPath()
{
static QString s(BLACKCORE_CONTEXTAUDIO_OBJECTPATH);
return s;
}
static const QString &ObjectPath();
//! Hotkey identifier for PTT (push to talk)
static const QString &pttHotkeyAction();
//! Hotkey icon for PTT (push to talk)
static const QPixmap &pttHotkeyIcon();
//! \copydoc CContext::getPathAndContextId()
virtual QString getPathAndContextId() const { return this->buildPathAndContextId(ObjectPath()); }

View File

@@ -137,7 +137,7 @@ namespace BlackCore
//! Voice channel by room
QSharedPointer<IVoiceChannel> getVoiceChannelBy(const BlackMisc::Audio::CVoiceRoom &voiceRoom);
CActionBind m_actionPtt { pttHotkeyIdentifier(), pttHotkeyIcon(), this, &CContextAudio::ps_setVoiceTransmission };
CActionBind m_actionPtt { pttHotkeyAction(), pttHotkeyIcon(), this, &CContextAudio::ps_setVoiceTransmission };
std::unique_ptr<IVoice> m_voice; //!< underlying voice lib
std::unique_ptr<IAudioMixer> m_audioMixer;