mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
Bugfix to set aircraft callsign from voice context, fixes #120
In the same step added methods to test squelch and microphone, refs #123
This commit is contained in:
committed by
Mathew Sutcliffe
parent
7a63768c83
commit
2feab9f5e7
@@ -34,6 +34,15 @@ namespace BlackCore
|
||||
this->leaveAllVoiceRooms();
|
||||
}
|
||||
|
||||
/*
|
||||
* Own aircraft
|
||||
*/
|
||||
void CContextVoice::setOwnAircraft(const CAircraft &ownAircraft)
|
||||
{
|
||||
Q_ASSERT(this->m_voice);
|
||||
this->m_voice->setMyAircraftCallsign(ownAircraft.getCallsign());
|
||||
}
|
||||
|
||||
/*
|
||||
* Voice rooms for COM
|
||||
*/
|
||||
@@ -216,4 +225,24 @@ namespace BlackCore
|
||||
CAudioDevice outputDevice = m_voice->getCurrentOutputDevice();
|
||||
BlackSound::CSoundGenerator::playSelcal(90, selcal, outputDevice);
|
||||
}
|
||||
|
||||
/*
|
||||
* Mic test.
|
||||
*/
|
||||
void CContextVoice::runMicrophoneTest() const
|
||||
{
|
||||
Q_ASSERT(this->m_voice);
|
||||
this->m_voice->runMicrophoneTest();
|
||||
}
|
||||
|
||||
/*
|
||||
* Squelch test.
|
||||
*/
|
||||
void CContextVoice::runSquelchTest() const
|
||||
{
|
||||
Q_ASSERT(this->m_voice);
|
||||
this->m_voice->runSquelchTest();
|
||||
}
|
||||
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -71,6 +71,11 @@ namespace BlackCore
|
||||
virtual bool usingLocalObjects() const { return true; }
|
||||
|
||||
public slots:
|
||||
/*!
|
||||
* \copydoc IContextVoice::setOwnAircraft
|
||||
*/
|
||||
virtual void setOwnAircraft(const BlackMisc::Aviation::CAircraft &ownAircraft);
|
||||
|
||||
/*!
|
||||
* \copydoc IContextVoice::getComVoiceRooms()
|
||||
*/
|
||||
@@ -147,11 +152,21 @@ namespace BlackCore
|
||||
virtual bool isMuted() const;
|
||||
|
||||
/*!
|
||||
* \brief Play selcal tone
|
||||
* \param selcal
|
||||
* \copydoc IContextVoice::playSelcalTone()
|
||||
*/
|
||||
virtual void playSelcalTone(const BlackMisc::Aviation::CSelcal &selcal) const;
|
||||
|
||||
/*!
|
||||
* \copydoc IContextVoice::runMicrophoneTest()
|
||||
*/
|
||||
virtual void runMicrophoneTest() const;
|
||||
|
||||
/*!
|
||||
* \copydoc IContextVoice::runSquelchTest()
|
||||
*/
|
||||
virtual void runSquelchTest() const;
|
||||
|
||||
|
||||
private:
|
||||
CVoiceVatlib *m_voice; //!< underlying voice lib
|
||||
};
|
||||
|
||||
@@ -31,6 +31,14 @@ namespace BlackCore
|
||||
// void
|
||||
}
|
||||
|
||||
/*
|
||||
* Own aircraft
|
||||
*/
|
||||
void IContextVoice::setOwnAircraft(const CAircraft &ownAircraft)
|
||||
{
|
||||
this->m_dBusInterface->callDBus(QLatin1Literal("setOwnAircraft"), ownAircraft);
|
||||
}
|
||||
|
||||
/*
|
||||
* Leave all voice rooms
|
||||
*/
|
||||
@@ -143,6 +151,22 @@ namespace BlackCore
|
||||
this->m_dBusInterface->callDBus(QLatin1Literal("playSelcalTone"), selcal);
|
||||
}
|
||||
|
||||
/*
|
||||
* MIC test
|
||||
*/
|
||||
void IContextVoice::runMicrophoneTest() const
|
||||
{
|
||||
this->m_dBusInterface->callDBus(QLatin1Literal("runMicrophoneTest"));
|
||||
}
|
||||
|
||||
/*
|
||||
* MIC test
|
||||
*/
|
||||
void IContextVoice::runSquelchTest() const
|
||||
{
|
||||
this->m_dBusInterface->callDBus(QLatin1Literal("runSquelchTest"));
|
||||
}
|
||||
|
||||
/*
|
||||
* Volumes, by COM systems
|
||||
*/
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
#include "blackmisc/vaudiodevicelist.h"
|
||||
#include "blackmisc/vvoiceroomlist.h"
|
||||
#include "blackmisc/nwuserlist.h"
|
||||
#include "blackmisc/aviocomsystem.h"
|
||||
#include "blackmisc/avcallsignlist.h"
|
||||
#include "blackmisc/avaircraft.h"
|
||||
#include "blackcore/voice_vatlib.h"
|
||||
#include <QObject>
|
||||
#include <QDBusAbstractInterface>
|
||||
@@ -102,6 +101,13 @@ namespace BlackCore
|
||||
|
||||
public slots:
|
||||
|
||||
/*!
|
||||
* Set my own identity for the voice rooms.
|
||||
* \remarks Actually at this time the callsign alone was sufficient. But I pass the
|
||||
* whole aircraft object so further information are present if needed any time later.
|
||||
*/
|
||||
virtual void setOwnAircraft(const BlackMisc::Aviation::CAircraft &ownAiricraft);
|
||||
|
||||
/*!
|
||||
* Get voice rooms for COM1, COM2:
|
||||
* From this connection audio status can be obtained
|
||||
@@ -191,6 +197,17 @@ namespace BlackCore
|
||||
* \brief Play SELCAL tone
|
||||
*/
|
||||
virtual void playSelcalTone(const BlackMisc::Aviation::CSelcal &selcal) const;
|
||||
|
||||
/*!
|
||||
* \brief Microphone test
|
||||
*/
|
||||
virtual void runMicrophoneTest() const;
|
||||
|
||||
/*!
|
||||
* \brief Microphone test
|
||||
*/
|
||||
virtual void runSquelchTest() const;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace BlackCore
|
||||
/*!
|
||||
* \brief Runs a 5 seconds test, measuring the qualitiy of your mic input
|
||||
*/
|
||||
virtual void runMicTest() = 0;
|
||||
virtual void runMicrophoneTest() = 0;
|
||||
|
||||
/*!
|
||||
* \brief Value of the measured squelch
|
||||
|
||||
@@ -244,7 +244,7 @@ namespace BlackCore
|
||||
/*
|
||||
* Start microphone test
|
||||
*/
|
||||
void CVoiceVatlib::runMicTest()
|
||||
void CVoiceVatlib::runMicrophoneTest()
|
||||
{
|
||||
Q_ASSERT_X(m_voice->IsValid() && m_voice->IsSetup(), "CVoiceClientVatlib", "Cvatlib_Voice_Simple invalid or not setup!");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user