diff --git a/src/blackcore/context/contextaudio.cpp b/src/blackcore/context/contextaudio.cpp index 5a7365138..233f65a6f 100644 --- a/src/blackcore/context/contextaudio.cpp +++ b/src/blackcore/context/contextaudio.cpp @@ -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) diff --git a/src/blackcore/context/contextaudio.h b/src/blackcore/context/contextaudio.h index 2276d8965..d88dc9c5f 100644 --- a/src/blackcore/context/contextaudio.h +++ b/src/blackcore/context/contextaudio.h @@ -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()); } diff --git a/src/blackcore/context/contextaudioimpl.h b/src/blackcore/context/contextaudioimpl.h index 03ff02502..f06ee8129 100644 --- a/src/blackcore/context/contextaudioimpl.h +++ b/src/blackcore/context/contextaudioimpl.h @@ -137,7 +137,7 @@ namespace BlackCore //! Voice channel by room QSharedPointer 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 m_voice; //!< underlying voice lib std::unique_ptr m_audioMixer;