mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 02:55:44 +08:00
@@ -2,11 +2,10 @@
|
|||||||
#define BLACKCORE_CONTEXT_ALL_EMPTIES_H
|
#define BLACKCORE_CONTEXT_ALL_EMPTIES_H
|
||||||
|
|
||||||
// #include "context_application_empty.h"
|
// #include "context_application_empty.h"
|
||||||
// #include "context_audio_empty.h"
|
#include "context_audio_empty.h"
|
||||||
#include "context_network_empty.h"
|
#include "context_network_empty.h"
|
||||||
// #include "context_ownaircraft_empty.h"
|
// #include "context_ownaircraft_empty.h"
|
||||||
// #include "context_settings_empty.h"
|
// #include "context_settings_empty.h"
|
||||||
// #include "context_simulator_empty.h"
|
// #include "context_simulator_empty.h"
|
||||||
|
|
||||||
|
|
||||||
#endif // guard
|
#endif // guard
|
||||||
|
|||||||
@@ -10,21 +10,22 @@
|
|||||||
#include "context_audio.h"
|
#include "context_audio.h"
|
||||||
#include "context_audio_impl.h"
|
#include "context_audio_impl.h"
|
||||||
#include "context_audio_proxy.h"
|
#include "context_audio_proxy.h"
|
||||||
|
#include "context_audio_empty.h"
|
||||||
|
|
||||||
namespace BlackCore
|
namespace BlackCore
|
||||||
{
|
{
|
||||||
|
|
||||||
IContextAudio *IContextAudio::create(CRuntime *parent, CRuntimeConfig::ContextMode mode, CDBusServer *server, QDBusConnection &conn)
|
IContextAudio *IContextAudio::create(CRuntime *runtime, CRuntimeConfig::ContextMode mode, CDBusServer *server, QDBusConnection &conn)
|
||||||
{
|
{
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case CRuntimeConfig::Local:
|
case CRuntimeConfig::Local:
|
||||||
case CRuntimeConfig::LocalInDbusServer:
|
case CRuntimeConfig::LocalInDbusServer:
|
||||||
return (new CContextAudio(mode, parent))->registerWithDBus(server);
|
return (new CContextAudio(mode, runtime))->registerWithDBus(server);
|
||||||
case CRuntimeConfig::Remote:
|
case CRuntimeConfig::Remote:
|
||||||
return new BlackCore::CContextAudioProxy(BlackCore::CDBusServer::ServiceName, conn, mode, parent);
|
return new CContextAudioProxy(BlackCore::CDBusServer::ServiceName, conn, mode, runtime);
|
||||||
default:
|
default:
|
||||||
return nullptr; // audio not mandatory
|
return new CContextAudioEmpty(runtime); // audio not mandatory
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
173
src/blackcore/context_audio_empty.h
Normal file
173
src/blackcore/context_audio_empty.h
Normal file
@@ -0,0 +1,173 @@
|
|||||||
|
/* Copyright (C) 2015
|
||||||
|
* 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_CONTEXTAUDIO_EMPTY_H
|
||||||
|
#define BLACKCORE_CONTEXTAUDIO_EMPTY_H
|
||||||
|
|
||||||
|
#include "context_audio.h"
|
||||||
|
#include "dbus_server.h"
|
||||||
|
#include "voice.h"
|
||||||
|
|
||||||
|
namespace BlackCore
|
||||||
|
{
|
||||||
|
class IVoiceChannel;
|
||||||
|
|
||||||
|
//! Audio context implementation
|
||||||
|
class CContextAudioEmpty : public IContextAudio
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
//! Constructor
|
||||||
|
CContextAudioEmpty(CRuntime *runtime) : IContextAudio(CRuntimeConfig::NotUsed, runtime) {}
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
//! \copydoc IContextAudio::getComVoiceRooms()
|
||||||
|
virtual BlackMisc::Audio::CVoiceRoomList getComVoiceRooms() const override
|
||||||
|
{
|
||||||
|
logEmptyContextWarning(Q_FUNC_INFO);
|
||||||
|
return BlackMisc::Audio::CVoiceRoomList();
|
||||||
|
}
|
||||||
|
|
||||||
|
//! \copydoc IContextAudio::getComVoiceRoomsWithAudioStatus()
|
||||||
|
virtual BlackMisc::Audio::CVoiceRoomList getComVoiceRoomsWithAudioStatus() const override
|
||||||
|
{
|
||||||
|
logEmptyContextWarning(Q_FUNC_INFO);
|
||||||
|
return BlackMisc::Audio::CVoiceRoomList();
|
||||||
|
}
|
||||||
|
|
||||||
|
//! \copydoc IContextAudio::getVoiceRoom
|
||||||
|
virtual BlackMisc::Audio::CVoiceRoom getVoiceRoom(int comUnitValue, bool withAudioStatus) const override
|
||||||
|
{
|
||||||
|
Q_UNUSED(comUnitValue);
|
||||||
|
Q_UNUSED(withAudioStatus);
|
||||||
|
logEmptyContextWarning(Q_FUNC_INFO);
|
||||||
|
return BlackMisc::Audio::CVoiceRoom();
|
||||||
|
}
|
||||||
|
|
||||||
|
//! \copydoc IContextAudio::setComVoiceRooms
|
||||||
|
virtual void setComVoiceRooms(const BlackMisc::Audio::CVoiceRoomList &newRooms) override
|
||||||
|
{
|
||||||
|
Q_UNUSED(newRooms);
|
||||||
|
logEmptyContextWarning(Q_FUNC_INFO);
|
||||||
|
}
|
||||||
|
|
||||||
|
//! \copydoc IContextAudio::getRoomCallsigns()
|
||||||
|
virtual BlackMisc::Aviation::CCallsignList getRoomCallsigns(int comUnitValue) const override
|
||||||
|
{
|
||||||
|
Q_UNUSED(comUnitValue);
|
||||||
|
logEmptyContextWarning(Q_FUNC_INFO);
|
||||||
|
return BlackMisc::Aviation::CCallsignList();
|
||||||
|
}
|
||||||
|
|
||||||
|
//! \copydoc IContextAudio::getRoomUsers()
|
||||||
|
virtual BlackMisc::Network::CUserList getRoomUsers(int comUnitValue) const override
|
||||||
|
{
|
||||||
|
Q_UNUSED(comUnitValue);
|
||||||
|
logEmptyContextWarning(Q_FUNC_INFO);
|
||||||
|
return BlackMisc::Network::CUserList();
|
||||||
|
}
|
||||||
|
|
||||||
|
//! \copydoc IContextAudio::leaveAllVoiceRooms
|
||||||
|
virtual void leaveAllVoiceRooms() override
|
||||||
|
{
|
||||||
|
logEmptyContextWarning(Q_FUNC_INFO);
|
||||||
|
}
|
||||||
|
|
||||||
|
//! \copydoc IContextAudio::getAudioDevices()
|
||||||
|
virtual BlackMisc::Audio::CAudioDeviceInfoList getAudioDevices() const override
|
||||||
|
{
|
||||||
|
logEmptyContextWarning(Q_FUNC_INFO);
|
||||||
|
return BlackMisc::Audio::CAudioDeviceInfoList();
|
||||||
|
}
|
||||||
|
|
||||||
|
//! \copydoc IContextAudio::getCurrentAudioDevices()
|
||||||
|
virtual BlackMisc::Audio::CAudioDeviceInfoList getCurrentAudioDevices() const override
|
||||||
|
{
|
||||||
|
logEmptyContextWarning(Q_FUNC_INFO);
|
||||||
|
return BlackMisc::Audio::CAudioDeviceInfoList();
|
||||||
|
}
|
||||||
|
|
||||||
|
//! \copydoc IContextAudio::setCurrentAudioDevice()
|
||||||
|
virtual void setCurrentAudioDevice(const BlackMisc::Audio::CAudioDeviceInfo &audioDevice) override
|
||||||
|
{
|
||||||
|
Q_UNUSED(audioDevice);
|
||||||
|
logEmptyContextWarning(Q_FUNC_INFO);
|
||||||
|
}
|
||||||
|
|
||||||
|
//! \copydoc IContext::setVoiceOutputVolume
|
||||||
|
virtual void setVoiceOutputVolume(int volume) override
|
||||||
|
{
|
||||||
|
Q_UNUSED(volume);
|
||||||
|
logEmptyContextWarning(Q_FUNC_INFO);
|
||||||
|
}
|
||||||
|
|
||||||
|
//! \copydoc IContext::getVoiceOutputVolume
|
||||||
|
virtual int getVoiceOutputVolume() const override
|
||||||
|
{
|
||||||
|
logEmptyContextWarning(Q_FUNC_INFO);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//! \copydoc ICOntext::setMute
|
||||||
|
virtual void setMute(bool muted) override
|
||||||
|
{
|
||||||
|
Q_UNUSED(muted);
|
||||||
|
logEmptyContextWarning(Q_FUNC_INFO);
|
||||||
|
}
|
||||||
|
|
||||||
|
//! \copydoc IContextAudio::isMuted()
|
||||||
|
virtual bool isMuted() const override
|
||||||
|
{
|
||||||
|
logEmptyContextWarning(Q_FUNC_INFO);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//! \copydoc IContextAudio::playSelcalTone()
|
||||||
|
virtual void playSelcalTone(const BlackMisc::Aviation::CSelcal &selcal) const override
|
||||||
|
{
|
||||||
|
Q_UNUSED(selcal);
|
||||||
|
logEmptyContextWarning(Q_FUNC_INFO);
|
||||||
|
}
|
||||||
|
|
||||||
|
//! \copydoc IContextAudio::playNotification()
|
||||||
|
virtual void playNotification(uint notification, bool considerSettings) const override
|
||||||
|
{
|
||||||
|
Q_UNUSED(notification);
|
||||||
|
Q_UNUSED(considerSettings);
|
||||||
|
logEmptyContextWarning(Q_FUNC_INFO);
|
||||||
|
}
|
||||||
|
|
||||||
|
//! \copydoc IContextAudio::enableAudioLoopback()
|
||||||
|
virtual void enableAudioLoopback(bool enable = true) override
|
||||||
|
{
|
||||||
|
Q_UNUSED(enable);
|
||||||
|
logEmptyContextWarning(Q_FUNC_INFO);
|
||||||
|
}
|
||||||
|
|
||||||
|
//! \copydoc ICOntextAudio::isAudioLoopbackEnabled
|
||||||
|
virtual bool isAudioLoopbackEnabled() const override
|
||||||
|
{
|
||||||
|
logEmptyContextWarning(Q_FUNC_INFO);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//! \copydoc IContextAudio::parseCommandLine
|
||||||
|
virtual bool parseCommandLine(const QString &commandLine) override
|
||||||
|
{
|
||||||
|
Q_UNUSED(commandLine);
|
||||||
|
logEmptyContextWarning(Q_FUNC_INFO);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
#endif // guard
|
||||||
Reference in New Issue
Block a user