mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 19:35:32 +08:00
refactor: Read AFV URLs from bootstrap.json
This also removes the possibility to change the URL on the fly via the UI. Fixes #257
This commit is contained in:
@@ -152,7 +152,7 @@ namespace BlackCore::Context
|
||||
|
||||
void CContextAudioBase::initVoiceClient()
|
||||
{
|
||||
if (m_voiceClient) { return; }
|
||||
if (m_voiceClient || !sApp) { return; }
|
||||
|
||||
const CAudioDeviceInfoList devices = CAudioDeviceInfoList::allDevices();
|
||||
if (devices != m_activeLocalDevices)
|
||||
@@ -179,9 +179,7 @@ namespace BlackCore::Context
|
||||
}
|
||||
#endif
|
||||
|
||||
m_voiceClient = new CAfvClient(CVoiceSetup().getAfvVoiceServerUrl(), this);
|
||||
const CVoiceSetup vs = m_voiceSettings.getThreadLocal();
|
||||
m_voiceClient->updateVoiceServerUrl(vs.getAfvVoiceServerUrl());
|
||||
m_voiceClient = new CAfvClient(sApp->getGlobalSetup().getAfvApiServerUrl().toQString(), this);
|
||||
|
||||
Q_ASSERT_X(m_voiceClient->thread() == qApp->thread(), Q_FUNC_INFO, "Should be in main thread");
|
||||
m_voiceClient->start(); // thread
|
||||
@@ -288,9 +286,6 @@ namespace BlackCore::Context
|
||||
return false;
|
||||
}
|
||||
|
||||
const CVoiceSetup vs = m_voiceSettings.getThreadLocal();
|
||||
m_voiceClient->updateVoiceServerUrl(vs.getAfvVoiceServerUrl());
|
||||
|
||||
const CUser connectedUser = this->getIContextNetwork()->getConnectedServer().getUser();
|
||||
const QString client = "swift " % BlackConfig::CBuildConfig::getShortVersionString();
|
||||
CCallsign cs = connectedUser.getCallsign();
|
||||
@@ -540,17 +535,6 @@ namespace BlackCore::Context
|
||||
return m_voiceClient->isLoopback();
|
||||
}
|
||||
|
||||
void CContextAudioBase::setVoiceSetup(const CVoiceSetup &setup)
|
||||
{
|
||||
// could be recycled for some AFV setup
|
||||
Q_UNUSED(setup)
|
||||
}
|
||||
|
||||
CVoiceSetup CContextAudioBase::getVoiceSetup() const
|
||||
{
|
||||
return CVoiceSetup();
|
||||
}
|
||||
|
||||
void CContextAudioBase::setVoiceTransmission(bool enable, PTTCOM com)
|
||||
{
|
||||
if (!m_voiceClient) { return; }
|
||||
@@ -582,12 +566,6 @@ namespace BlackCore::Context
|
||||
this->setComOutputVolume(CComSystem::Com2, s.getOutVolumeCom2());
|
||||
}
|
||||
|
||||
void CContextAudioBase::onChangedVoiceSettings()
|
||||
{
|
||||
const CVoiceSetup vs = m_voiceSettings.getThreadLocal();
|
||||
m_voiceClient->updateVoiceServerUrl(vs.getAfvVoiceServerUrl());
|
||||
}
|
||||
|
||||
void CContextAudioBase::audioIncreaseVolume(bool enabled)
|
||||
{
|
||||
if (!enabled) { return; }
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "blackmisc/audio/audiodeviceinfolist.h"
|
||||
#include "blackmisc/audio/notificationsounds.h"
|
||||
#include "blackmisc/audio/audiosettings.h"
|
||||
#include "blackmisc/audio/voicesetup.h"
|
||||
#include "blackmisc/audio/ptt.h"
|
||||
#include "blackmisc/aviation/callsignset.h"
|
||||
#include "blackmisc/aviation/comsystem.h"
|
||||
@@ -196,12 +195,6 @@ namespace BlackCore
|
||||
bool isAudioLoopbackEnabled() const;
|
||||
//! @}
|
||||
|
||||
//! @{
|
||||
//! Voice setup
|
||||
BlackMisc::Audio::CVoiceSetup getVoiceSetup() const;
|
||||
void setVoiceSetup(const BlackMisc::Audio::CVoiceSetup &setup);
|
||||
//! @}
|
||||
|
||||
//! Info string about audio
|
||||
QString audioRunsWhereInfo() const;
|
||||
|
||||
@@ -328,9 +321,6 @@ namespace BlackCore
|
||||
//! Changed audio settings
|
||||
void onChangedAudioSettings();
|
||||
|
||||
//! Changed voice settings
|
||||
void onChangedVoiceSettings();
|
||||
|
||||
//! @{
|
||||
//! Audio increase/decrease volume
|
||||
void audioIncreaseVolume(bool enabled);
|
||||
@@ -366,7 +356,6 @@ namespace BlackCore
|
||||
|
||||
// settings
|
||||
BlackMisc::CSetting<BlackMisc::Audio::TSettings> m_audioSettings { this, &CContextAudioBase::onChangedAudioSettings };
|
||||
BlackMisc::CSetting<BlackMisc::Audio::TVoiceSetup> m_voiceSettings { this, &CContextAudioBase::onChangedVoiceSettings };
|
||||
|
||||
BlackMisc::CSetting<Audio::TInputDevice> m_inputDeviceSetting { this, &CContextAudioBase::changeDeviceSettings };
|
||||
BlackMisc::CSetting<Audio::TOutputDevice> m_outputDeviceSetting { this, &CContextAudioBase::changeDeviceSettings };
|
||||
|
||||
@@ -42,7 +42,6 @@ using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::Network;
|
||||
using namespace BlackMisc::Geo;
|
||||
using namespace BlackMisc::Audio;
|
||||
using namespace BlackMisc::Simulation;
|
||||
using namespace BlackMisc::Weather;
|
||||
using namespace BlackCore::Fsd;
|
||||
|
||||
@@ -16,7 +16,6 @@ using namespace BlackMisc;
|
||||
using namespace BlackMisc::Network;
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackMisc::Audio;
|
||||
using namespace BlackMisc::Weather;
|
||||
using namespace BlackMisc::Simulation;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user