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:
Klaus Basan
2019-05-01 02:11:02 +02:00
parent 8df7404f2b
commit bcbdaaf1a7
19 changed files with 99 additions and 29 deletions

View File

@@ -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
}