mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 10:55:32 +08:00
refs #912, icon and identifier for PTT hotkey as static functions
This commit is contained in:
committed by
Mathew Sutcliffe
parent
422e6626c8
commit
08f6f3f81c
@@ -14,11 +14,37 @@
|
|||||||
#include "blackcore/context/contextaudioimpl.h"
|
#include "blackcore/context/contextaudioimpl.h"
|
||||||
#include "blackcore/context/contextaudioproxy.h"
|
#include "blackcore/context/contextaudioproxy.h"
|
||||||
#include "blackmisc/dbusserver.h"
|
#include "blackmisc/dbusserver.h"
|
||||||
|
#include "blackmisc/icons.h"
|
||||||
|
|
||||||
|
using namespace BlackMisc;
|
||||||
|
|
||||||
namespace BlackCore
|
namespace BlackCore
|
||||||
{
|
{
|
||||||
namespace Context
|
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)
|
IContextAudio *IContextAudio::create(CCoreFacade *runtime, CCoreFacadeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &conn)
|
||||||
{
|
{
|
||||||
switch (mode)
|
switch (mode)
|
||||||
|
|||||||
@@ -65,18 +65,16 @@ namespace BlackCore
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
//! Interface name
|
//! Interface name
|
||||||
static const QString &InterfaceName()
|
static const QString &InterfaceName();
|
||||||
{
|
|
||||||
static QString s(BLACKCORE_CONTEXTAUDIO_INTERFACENAME);
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Object path
|
//! Object path
|
||||||
static const QString &ObjectPath()
|
static const QString &ObjectPath();
|
||||||
{
|
|
||||||
static QString s(BLACKCORE_CONTEXTAUDIO_OBJECTPATH);
|
//! Hotkey identifier for PTT (push to talk)
|
||||||
return s;
|
static const QString &pttHotkeyAction();
|
||||||
}
|
|
||||||
|
//! Hotkey icon for PTT (push to talk)
|
||||||
|
static const QPixmap &pttHotkeyIcon();
|
||||||
|
|
||||||
//! \copydoc CContext::getPathAndContextId()
|
//! \copydoc CContext::getPathAndContextId()
|
||||||
virtual QString getPathAndContextId() const { return this->buildPathAndContextId(ObjectPath()); }
|
virtual QString getPathAndContextId() const { return this->buildPathAndContextId(ObjectPath()); }
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ namespace BlackCore
|
|||||||
//! Voice channel by room
|
//! Voice channel by room
|
||||||
QSharedPointer<IVoiceChannel> getVoiceChannelBy(const BlackMisc::Audio::CVoiceRoom &voiceRoom);
|
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<IVoice> m_voice; //!< underlying voice lib
|
||||||
std::unique_ptr<IAudioMixer> m_audioMixer;
|
std::unique_ptr<IAudioMixer> m_audioMixer;
|
||||||
|
|||||||
Reference in New Issue
Block a user