mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
Changed
* to CCallsignList * from QString to CCallsign Added: * Method to get users, and * users for callsigns Fixed some Doxygen comments along with the changes
This commit is contained in:
@@ -4,8 +4,10 @@
|
|||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#include "context_voice.h"
|
#include "context_voice.h"
|
||||||
|
#include "context_network.h"
|
||||||
#include "coreruntime.h"
|
#include "coreruntime.h"
|
||||||
|
|
||||||
|
|
||||||
using namespace BlackMisc;
|
using namespace BlackMisc;
|
||||||
using namespace BlackMisc::Aviation;
|
using namespace BlackMisc::Aviation;
|
||||||
using namespace BlackMisc::Voice;
|
using namespace BlackMisc::Voice;
|
||||||
@@ -16,9 +18,11 @@ namespace BlackCore
|
|||||||
/*
|
/*
|
||||||
* Init this context
|
* Init this context
|
||||||
*/
|
*/
|
||||||
CContextVoice::CContextVoice(CCoreRuntime *parent) :
|
CContextVoice::CContextVoice(CCoreRuntime *runtime) :
|
||||||
IContextVoice(parent), m_voice(nullptr), m_currentInputDevice(), m_currentOutputDevice()
|
IContextVoice(runtime), m_voice(nullptr), m_currentInputDevice(), m_currentOutputDevice()
|
||||||
{
|
{
|
||||||
|
Q_ASSERT(runtime);
|
||||||
|
|
||||||
// 1. Init by "network driver"
|
// 1. Init by "network driver"
|
||||||
this->m_voice = new CVoiceVatlib(this);
|
this->m_voice = new CVoiceVatlib(this);
|
||||||
this->m_currentInputDevice = this->m_voice->defaultAudioInputDevice();
|
this->m_currentInputDevice = this->m_voice->defaultAudioInputDevice();
|
||||||
@@ -145,30 +149,43 @@ namespace BlackCore
|
|||||||
/*
|
/*
|
||||||
* Room 1 callsigns
|
* Room 1 callsigns
|
||||||
*/
|
*/
|
||||||
QList<CCallsign> CContextVoice::getCom1RoomCallsigns() const
|
CCallsignList CContextVoice::getCom1RoomCallsigns() const
|
||||||
{
|
{
|
||||||
Q_ASSERT(this->m_voice);
|
Q_ASSERT(this->m_voice);
|
||||||
QSet<QString> signs = this->m_voice->getVoiceRoomCallsings(IVoice::COM1);
|
return this->m_voice->getVoiceRoomCallsigns(IVoice::COM1);
|
||||||
QList<CCallsign> callsigns;
|
|
||||||
foreach(QString sign, signs)
|
|
||||||
{
|
|
||||||
callsigns.append(sign);
|
|
||||||
}
|
|
||||||
return callsigns;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Room 2 callsigns
|
* Room 2 callsigns
|
||||||
*/
|
*/
|
||||||
QList<CCallsign> CContextVoice::getCom2RoomCallsigns() const
|
CCallsignList CContextVoice::getCom2RoomCallsigns() const
|
||||||
{
|
{
|
||||||
Q_ASSERT(this->m_voice);
|
Q_ASSERT(this->m_voice);
|
||||||
QSet<QString> signs = this->m_voice->getVoiceRoomCallsings(IVoice::COM2);
|
return this->m_voice->getVoiceRoomCallsigns(IVoice::COM2);
|
||||||
QList<CCallsign> callsigns;
|
|
||||||
foreach(QString sign, signs)
|
|
||||||
{
|
|
||||||
callsigns.append(sign);
|
|
||||||
}
|
|
||||||
return callsigns;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Room 1 users
|
||||||
|
*/
|
||||||
|
Network::CUserList CContextVoice::getCom1RoomUsers() const
|
||||||
|
{
|
||||||
|
Q_ASSERT(this->m_voice);
|
||||||
|
Q_ASSERT(this->getRuntime());
|
||||||
|
Q_ASSERT(this->getRuntime()->getIContextNetwork());
|
||||||
|
return this->getRuntime()->getIContextNetwork()->
|
||||||
|
getUsersForCallsigns(this->getCom1RoomCallsigns());
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Room 1 users
|
||||||
|
*/
|
||||||
|
Network::CUserList CContextVoice::getCom2RoomUsers() const
|
||||||
|
{
|
||||||
|
Q_ASSERT(this->m_voice);
|
||||||
|
Q_ASSERT(this->getRuntime());
|
||||||
|
Q_ASSERT(this->getRuntime()->getIContextNetwork());
|
||||||
|
return this->getRuntime()->getIContextNetwork()->
|
||||||
|
getUsersForCallsigns(this->getCom2RoomCallsigns());
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -39,10 +39,9 @@ namespace BlackCore
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief With link to server
|
* \brief Constructor
|
||||||
* \param server
|
|
||||||
*/
|
*/
|
||||||
CContextVoice(CCoreRuntime *parent);
|
CContextVoice(CCoreRuntime *runtime);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Destructor
|
* \brief Destructor
|
||||||
@@ -51,7 +50,7 @@ namespace BlackCore
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Register myself in DBus
|
* \brief Register myself in DBus
|
||||||
* \param server
|
* \param server DBus server
|
||||||
*/
|
*/
|
||||||
void registerWithDBus(CDBusServer *server)
|
void registerWithDBus(CDBusServer *server)
|
||||||
{
|
{
|
||||||
@@ -60,7 +59,6 @@ namespace BlackCore
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Runtime
|
* \brief Runtime
|
||||||
* \return
|
|
||||||
*/
|
*/
|
||||||
const CCoreRuntime *getRuntime() const
|
const CCoreRuntime *getRuntime() const
|
||||||
{
|
{
|
||||||
@@ -69,42 +67,46 @@ namespace BlackCore
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Using local objects?
|
* \brief Using local objects?
|
||||||
* \return
|
|
||||||
*/
|
*/
|
||||||
virtual bool usingLocalObjects() const { return true; }
|
virtual bool usingLocalObjects() const { return true; }
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
/*!
|
/*!
|
||||||
* Get voice rooms for COM1, COM2, but not with the latest status
|
* \copydoc IContextVoice::getComVoiceRooms()
|
||||||
* \return
|
|
||||||
*/
|
*/
|
||||||
virtual BlackMisc::Voice::CVoiceRoomList getComVoiceRooms() const;
|
virtual BlackMisc::Voice::CVoiceRoomList getComVoiceRooms() const;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Get voice rooms for COM1, COM2: From this connection status
|
* \copydoc IContextVoice::getComVoiceRoomsWithAudioStatus()
|
||||||
* etc. can be obtained
|
|
||||||
* \return
|
|
||||||
*/
|
*/
|
||||||
virtual BlackMisc::Voice::CVoiceRoomList getComVoiceRoomsWithAudioStatus();
|
virtual BlackMisc::Voice::CVoiceRoomList getComVoiceRoomsWithAudioStatus();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Set voice rooms
|
* \copydoc IContextVoice::setComVoiceRooms()
|
||||||
* \param voiceRoomCom1
|
|
||||||
* \param voiceRoomCom2
|
|
||||||
*/
|
*/
|
||||||
virtual void setComVoiceRooms(const BlackMisc::Voice::CVoiceRoom &voiceRoomCom1, const BlackMisc::Voice::CVoiceRoom &voiceRoomCom2);
|
virtual void setComVoiceRooms(const BlackMisc::Voice::CVoiceRoom &voiceRoomCom1, const BlackMisc::Voice::CVoiceRoom &voiceRoomCom2);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief COM1 room user's callsigns
|
* \copydoc IContextVoice::getCom1RoomCallsigns()
|
||||||
* \return
|
* \return
|
||||||
*/
|
*/
|
||||||
virtual QList<BlackMisc::Aviation::CCallsign> getCom1RoomCallsigns() const;
|
virtual BlackMisc::Aviation::CCallsignList getCom1RoomCallsigns() const;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief COM2 room user's callsigns
|
* \copydoc IContextVoice::getCom2RoomCallsigns()
|
||||||
* \return
|
* \return
|
||||||
*/
|
*/
|
||||||
virtual QList<BlackMisc::Aviation::CCallsign> getCom2RoomCallsigns() const;
|
virtual BlackMisc::Aviation::CCallsignList getCom2RoomCallsigns() const;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \copydoc IContextVoice::getCom1RoomUsers()
|
||||||
|
*/
|
||||||
|
virtual BlackMisc::Network::CUserList getCom1RoomUsers() const;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \copydoc IContextVoice::getCom2RoomUsers()
|
||||||
|
*/
|
||||||
|
virtual BlackMisc::Network::CUserList getCom2RoomUsers() const;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Leave all voice rooms
|
* Leave all voice rooms
|
||||||
@@ -113,39 +115,37 @@ namespace BlackCore
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Audio devices
|
* \brief Audio devices
|
||||||
* \return
|
* \return all input/output devices
|
||||||
*/
|
*/
|
||||||
virtual BlackMisc::Voice::CAudioDeviceList getAudioDevices() const;
|
virtual BlackMisc::Voice::CAudioDeviceList getAudioDevices() const;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Set current audio device
|
* \brief Set current audio device
|
||||||
* \param audioDevice
|
* \return get input and output device
|
||||||
*/
|
*/
|
||||||
virtual BlackMisc::Voice::CAudioDeviceList getCurrentAudioDevices() const;
|
virtual BlackMisc::Voice::CAudioDeviceList getCurrentAudioDevices() const;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Set current audio device
|
* \brief Set current audio device
|
||||||
* \param audioDevice
|
|
||||||
*/
|
*/
|
||||||
virtual void setCurrentAudioDevice(const BlackMisc::Voice::CAudioDevice &audioDevice);
|
virtual void setCurrentAudioDevice(const BlackMisc::Voice::CAudioDevice &audioDevice);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Set volumes, also allows to mute
|
* \brief Set volumes via com units, also allows to mute
|
||||||
* \param com1
|
* \see BlackMisc::Aviation::CComSystem::setVolumeInput()
|
||||||
* \param com2
|
* \see BlackMisc::Aviation::CComSystem::setVolumeOutput()
|
||||||
*/
|
*/
|
||||||
virtual void setVolumes(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2);
|
virtual void setVolumes(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Is muted?
|
* \brief Is muted?
|
||||||
* \return
|
|
||||||
*/
|
*/
|
||||||
virtual bool isMuted() const;
|
virtual bool isMuted() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CVoiceVatlib *m_voice;
|
CVoiceVatlib *m_voice; //!< underlying voice lib
|
||||||
BlackMisc::Voice::CAudioDevice m_currentInputDevice;
|
BlackMisc::Voice::CAudioDevice m_currentInputDevice; //!< input device
|
||||||
BlackMisc::Voice::CAudioDevice m_currentOutputDevice;
|
BlackMisc::Voice::CAudioDevice m_currentOutputDevice; //!< current output device
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,19 +39,35 @@ namespace BlackCore
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* COM1 users
|
* COM1 callsigns
|
||||||
*/
|
*/
|
||||||
QList<BlackMisc::Aviation::CCallsign> IContextVoice::getCom1RoomCallsigns() const
|
BlackMisc::Aviation::CCallsignList IContextVoice::getCom1RoomCallsigns() const
|
||||||
{
|
{
|
||||||
return this->m_dBusInterface->callDBusRet<QList<BlackMisc::Aviation::CCallsign> >(QLatin1Literal("getCom1RoomCallsigns"));
|
return this->m_dBusInterface->callDBusRet<BlackMisc::Aviation::CCallsignList>(QLatin1Literal("getCom1RoomCallsigns"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* COM2 users
|
* COM2 callsigns
|
||||||
*/
|
*/
|
||||||
QList<BlackMisc::Aviation::CCallsign> IContextVoice::getCom2RoomCallsigns() const
|
BlackMisc::Aviation::CCallsignList IContextVoice::getCom2RoomCallsigns() const
|
||||||
{
|
{
|
||||||
return this->m_dBusInterface->callDBusRet<QList<BlackMisc::Aviation::CCallsign> >(QLatin1Literal("getCom2RoomCallsigns"));
|
return this->m_dBusInterface->callDBusRet<BlackMisc::Aviation::CCallsignList>(QLatin1Literal("getCom2RoomCallsigns"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* COM1 callsigns
|
||||||
|
*/
|
||||||
|
BlackMisc::Network::CUserList IContextVoice::getCom1RoomUsers() const
|
||||||
|
{
|
||||||
|
return this->m_dBusInterface->callDBusRet<BlackMisc::Network::CUserList>(QLatin1Literal("getCom1RoomUsers"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* COM2 callsigns
|
||||||
|
*/
|
||||||
|
BlackMisc::Network::CUserList IContextVoice::getCom2RoomUsers() const
|
||||||
|
{
|
||||||
|
return this->m_dBusInterface->callDBusRet<BlackMisc::Network::CUserList>(QLatin1Literal("getCom2RoomUsers"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user