Ref T609, encapsulate PTT action/key

This commit is contained in:
Klaus Basan
2019-04-18 00:58:19 +02:00
parent c69a833598
commit 13a2465424
7 changed files with 63 additions and 20 deletions

View File

@@ -33,17 +33,6 @@ namespace BlackCore
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, CDBusServer *server, QDBusConnection &connection)
{
switch (mode)

View File

@@ -72,12 +72,6 @@ namespace BlackCore
//! Object path
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 override { return this->buildPathAndContextId(ObjectPath()); }

View File

@@ -22,6 +22,7 @@
#include "blackmisc/audio/audiodeviceinfolist.h"
#include "blackmisc/audio/notificationsounds.h"
#include "blackmisc/audio/voiceroomlist.h"
#include "blackmisc/input/actionhotkeydefs.h"
#include "blackmisc/aviation/callsignset.h"
#include "blackmisc/aviation/comsystem.h"
#include "blackmisc/aviation/selcal.h"
@@ -140,7 +141,7 @@ namespace BlackCore
//! Voice channel by room
QSharedPointer<IVoiceChannel> getVoiceChannelBy(const BlackMisc::Audio::CVoiceRoom &voiceRoom);
CActionBind m_actionPtt { pttHotkeyAction(), pttHotkeyIcon(), this, &CContextAudio::setVoiceTransmission };
CActionBind m_actionPtt { BlackMisc::Input::pttHotkeyAction(), BlackMisc::Input::pttHotkeyIcon(), this, &CContextAudio::setVoiceTransmission };
std::unique_ptr<IVoice> m_voice; //!< underlying voice lib
std::unique_ptr<IAudioMixer> m_audioMixer;