mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
COM audio did not tune in (voice room) if channel was already selected at startup
Reason was: hardcoded channel spacing to 8.33kHz As a result changed to channel spacing based on COM unit, which could also be changed at runtime * the issue itself was in own aircraft context * added functions for channel spacing * changed to COM unit channel spacing (instead of hardcoded spacing)
This commit is contained in:
@@ -288,7 +288,7 @@ namespace BlackCore
|
||||
CAtcStation CAirspaceMonitor::getAtcStationForComUnit(const CComSystem &comSystem) const
|
||||
{
|
||||
CAtcStation station;
|
||||
CAtcStationList stations = m_atcStationsOnline.findIfComUnitTunedIn25KHz(comSystem);
|
||||
CAtcStationList stations = m_atcStationsOnline.findIfComUnitTunedInChannelSpacing(comSystem);
|
||||
if (stations.isEmpty()) { return station; }
|
||||
stations.sortByDistanceToReferencePosition();
|
||||
return stations.front();
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace BlackCore
|
||||
|
||||
m_selcalPlayer = new CSelcalPlayer(QAudioDeviceInfo::defaultOutputDevice(), this);
|
||||
|
||||
changeDeviceSettings();
|
||||
this->changeDeviceSettings();
|
||||
}
|
||||
|
||||
CContextAudio *CContextAudio::registerWithDBus(CDBusServer *server)
|
||||
@@ -160,17 +160,23 @@ namespace BlackCore
|
||||
Q_ASSERT(m_voice);
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO;}
|
||||
m_voiceChannelMapping.clear();
|
||||
m_channel1->leaveVoiceRoom();
|
||||
m_channel2->leaveVoiceRoom();
|
||||
m_unusedVoiceChannels.push_back(m_channel1);
|
||||
m_unusedVoiceChannels.push_back(m_channel2);
|
||||
if (m_channel1)
|
||||
{
|
||||
m_channel1->leaveVoiceRoom();
|
||||
m_unusedVoiceChannels.push_back(m_channel1);
|
||||
}
|
||||
if (m_channel2)
|
||||
{
|
||||
m_channel2->leaveVoiceRoom();
|
||||
m_unusedVoiceChannels.push_back(m_channel2);
|
||||
}
|
||||
}
|
||||
|
||||
CIdentifier CContextAudio::audioRunsWhere() const
|
||||
{
|
||||
Q_ASSERT(m_voice);
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
static const BlackMisc::CIdentifier i("CContextAudio");
|
||||
static const CIdentifier i("CContextAudio");
|
||||
return i;
|
||||
}
|
||||
|
||||
@@ -299,8 +305,8 @@ namespace BlackCore
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << newRooms; }
|
||||
|
||||
const CVoiceRoomList currentRooms = this->getComVoiceRooms();
|
||||
const CVoiceRoom currentRoomCom1 = currentRooms[0];
|
||||
const CVoiceRoom currentRoomCom2 = currentRooms[1];
|
||||
const CVoiceRoom currentRoomCom1 = currentRooms[0];
|
||||
const CVoiceRoom currentRoomCom2 = currentRooms[1];
|
||||
CVoiceRoom newRoomCom1 = newRooms[0];
|
||||
CVoiceRoom newRoomCom2 = newRooms[1];
|
||||
const CCallsign ownCallsign(this->getIContextOwnAircraft()->getOwnAircraft().getCallsign());
|
||||
|
||||
@@ -195,7 +195,7 @@ namespace BlackCore
|
||||
if (!m_voiceRoom1UrlOverride.isEmpty()) { rooms[0] = CVoiceRoom(m_voiceRoom1UrlOverride); }
|
||||
if (!m_voiceRoom2UrlOverride.isEmpty()) { rooms[1] = CVoiceRoom(m_voiceRoom2UrlOverride); }
|
||||
|
||||
// set the rooms
|
||||
// set the rooms on the side where the audio is located
|
||||
emit this->getIContextApplication()->fakedSetComVoiceRoom(rooms);
|
||||
}
|
||||
|
||||
@@ -442,7 +442,7 @@ namespace BlackCore
|
||||
const CSimulatedAircraft myAircraft(this->getOwnAircraft());
|
||||
|
||||
// relevant frequency
|
||||
if (myAircraft.getCom1System().isActiveFrequencyWithin8_33kHzChannel(atcStation.getFrequency()) || myAircraft.getCom2System().isActiveFrequencyWithin8_33kHzChannel(atcStation.getFrequency()))
|
||||
if (myAircraft.getCom1System().isActiveFrequencyWithinChannelSpacing(atcStation.getFrequency()) || myAircraft.getCom2System().isActiveFrequencyWithinChannelSpacing(atcStation.getFrequency()))
|
||||
{
|
||||
this->resolveVoiceRooms(); // online status changed
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user