mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05:34 +08:00
* Info for which machine audio setup is displayed * Obtain audio "location" * Remark: Audio can run on core and in GUI which is different from other contexts
105 lines
4.6 KiB
C++
105 lines
4.6 KiB
C++
/* Copyright (C) 2013
|
|
* swift Project Community / Contributors
|
|
*
|
|
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
|
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
|
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
|
* contained in the LICENSE file.
|
|
*/
|
|
|
|
//! \file
|
|
|
|
#ifndef BLACKCORE_CONTEXT_CONTEXTVOICE_PROXY_H
|
|
#define BLACKCORE_CONTEXT_CONTEXTVOICE_PROXY_H
|
|
|
|
#include <QObject>
|
|
#include <QString>
|
|
|
|
#include "blackcore/blackcoreexport.h"
|
|
#include "blackcore/context/contextaudio.h"
|
|
#include "blackcore/corefacadeconfig.h"
|
|
#include "blackmisc/audio/audiodeviceinfolist.h"
|
|
#include "blackmisc/audio/notificationsounds.h"
|
|
#include "blackmisc/audio/voiceroom.h"
|
|
#include "blackmisc/audio/voiceroomlist.h"
|
|
#include "blackmisc/aviation/callsignset.h"
|
|
#include "blackmisc/aviation/comsystem.h"
|
|
#include "blackmisc/aviation/selcal.h"
|
|
#include "blackmisc/identifier.h"
|
|
#include "blackmisc/network/userlist.h"
|
|
|
|
class QDBusConnection;
|
|
|
|
namespace BlackMisc
|
|
{
|
|
class CGenericDBusInterface;
|
|
namespace Audio { class CAudioDeviceInfo; }
|
|
namespace Aviation { class CCallsign; }
|
|
}
|
|
|
|
namespace BlackCore
|
|
{
|
|
class CCoreFacade;
|
|
namespace Context
|
|
{
|
|
//! Audio context proxy
|
|
//! \ingroup dbus
|
|
class BLACKCORE_EXPORT CContextAudioProxy : public IContextAudio
|
|
{
|
|
Q_OBJECT
|
|
Q_CLASSINFO("D-Bus Interface", BLACKCORE_CONTEXTAUDIO_INTERFACENAME)
|
|
friend class IContextAudio;
|
|
|
|
public:
|
|
//! Destructor
|
|
virtual ~CContextAudioProxy() {}
|
|
|
|
//! Unit test relay signals
|
|
//! \private
|
|
static void unitTestRelaySignals();
|
|
|
|
public slots:
|
|
// interface overrides
|
|
//! \publicsection
|
|
//! @{
|
|
virtual BlackMisc::Audio::CVoiceRoomList getComVoiceRooms() const override;
|
|
virtual BlackMisc::Audio::CVoiceRoomList getComVoiceRoomsWithAudioStatus() const override;
|
|
virtual BlackMisc::Audio::CVoiceRoom getVoiceRoom(BlackMisc::Aviation::CComSystem::ComUnit comUnitValue, bool withAudioStatus) const override;
|
|
virtual void setComVoiceRooms(const BlackMisc::Audio::CVoiceRoomList &voiceRooms) override;
|
|
virtual void setOwnCallsignForRooms(const BlackMisc::Aviation::CCallsign &callsign) override;
|
|
virtual BlackMisc::Aviation::CCallsignSet getRoomCallsigns(BlackMisc::Aviation::CComSystem::ComUnit comUnitValue) const override;
|
|
virtual BlackMisc::Network::CUserList getRoomUsers(BlackMisc::Aviation::CComSystem::ComUnit comUnitValue) const override;
|
|
virtual void leaveAllVoiceRooms() override;
|
|
virtual BlackMisc::CIdentifier audioRunsWhere() const override;
|
|
virtual BlackMisc::Audio::CAudioDeviceInfoList getAudioDevices() const override;
|
|
virtual BlackMisc::Audio::CAudioDeviceInfoList getCurrentAudioDevices() const override;
|
|
virtual void setCurrentAudioDevice(const BlackMisc::Audio::CAudioDeviceInfo &audioDevice) override;
|
|
virtual void setVoiceOutputVolume(int volume) override;
|
|
virtual int getVoiceOutputVolume() const override;
|
|
virtual void setMute(bool muted) override;
|
|
virtual bool isMuted() const override;
|
|
virtual void playSelcalTone(const BlackMisc::Aviation::CSelcal &selcal) const override;
|
|
virtual void playNotification(BlackMisc::Audio::CNotificationSounds::Notification notification, bool considerSettings) const override;
|
|
virtual void enableAudioLoopback(bool enable = true) override;
|
|
virtual bool isAudioLoopbackEnabled() const override;
|
|
virtual bool parseCommandLine(const QString &commandLine, const BlackMisc::CIdentifier &originator) override;
|
|
//! @}
|
|
|
|
private:
|
|
BlackMisc::CGenericDBusInterface *m_dBusInterface;
|
|
|
|
//! Relay connection signals to local signals
|
|
//! No idea why this has to be wired and is not done automatically
|
|
void relaySignals(const QString &serviceName, QDBusConnection &connection);
|
|
|
|
protected:
|
|
//! Contructor
|
|
CContextAudioProxy(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : IContextAudio(mode, runtime), m_dBusInterface(nullptr) {}
|
|
|
|
//! DBus version constructor
|
|
CContextAudioProxy(const QString &serviceName, QDBusConnection &connection, CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime);
|
|
};
|
|
} // ns
|
|
} // ns
|
|
#endif // guard
|