Graceful shutdown of SELCAL player with audio context

This commit is contained in:
Klaus Basan
2020-03-26 19:01:51 +01:00
committed by Mat Sutcliffe
parent 87a9059a05
commit dab907df8c
3 changed files with 9 additions and 0 deletions

View File

@@ -231,6 +231,7 @@ namespace BlackCore
void CContextAudioBase::gracefulShutdown() void CContextAudioBase::gracefulShutdown()
{ {
this->terminateVoiceClient(); this->terminateVoiceClient();
m_selcalPlayer->gracefulShutdown();
QObject::disconnect(this); QObject::disconnect(this);
} }

View File

@@ -24,6 +24,11 @@ namespace BlackSound
} }
CSelcalPlayer::~CSelcalPlayer() CSelcalPlayer::~CSelcalPlayer()
{
this->gracefulShutdown();
}
void CSelcalPlayer::gracefulShutdown()
{ {
m_threadedPlayer.quitAndWait(); m_threadedPlayer.quitAndWait();
} }

View File

@@ -32,6 +32,9 @@ namespace BlackSound
//! Destructor //! Destructor
virtual ~CSelcalPlayer() override; virtual ~CSelcalPlayer() override;
//! Stop the player thread
void gracefulShutdown();
//! Play SELCAL //! Play SELCAL
//! \return Time of the played tone //! \return Time of the played tone
BlackMisc::PhysicalQuantities::CTime play(int volume, const BlackMisc::Aviation::CSelcal &selcal); BlackMisc::PhysicalQuantities::CTime play(int volume, const BlackMisc::Aviation::CSelcal &selcal);