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

@@ -58,8 +58,7 @@ namespace BlackGui
ui->setupUi(this);
// init from aircraft
const CSimulatedAircraft ownAircraft = this->getOwnAircraft();
this->updateCockpitFromContext(ownAircraft, CIdentifier("dummyInitialValues")); // intentionally different name here
this->forceCockpitUpdateFromOwnAircraftContext();
// COM form
connect(ui->editor_Com, &CCockpitComForm::testSelcal, this, &CCockpitComComponent::testSelcal);
@@ -75,11 +74,15 @@ namespace BlackGui
// hook up with changes from own aircraft context
if (sGui)
{
// own aircraft
connect(sGui->getIContextOwnAircraft(), &IContextOwnAircraft::changedAircraftCockpit, this, &CCockpitComComponent::updateCockpitFromContext, Qt::QueuedConnection);
connect(sGui->getIContextOwnAircraft(), &IContextOwnAircraft::changedSelcal, this, &CCockpitComComponent::updateSelcalFromContext, Qt::QueuedConnection);
// hook up with audio context
connect(sGui->getIContextAudio(), &IContextAudio::changedVoiceRooms, this, &CCockpitComComponent::updateVoiceRoomStatusFromContext, Qt::QueuedConnection);
// network
connect(sGui->getIContextNetwork(), &IContextNetwork::changedAtcStationsOnlineDigest, this, &CCockpitComComponent::onAtcStationsChanged, Qt::QueuedConnection);
}
}
@@ -171,6 +174,18 @@ namespace BlackGui
ui->editor_Com->setVoiceRoomStatus(selectedVoiceRooms);
}
void CCockpitComComponent::forceCockpitUpdateFromOwnAircraftContext()
{
if (!sGui || sGui->isShuttingDown()) { return; }
const CSimulatedAircraft ownAircraft = this->getOwnAircraft();
this->updateCockpitFromContext(ownAircraft, CIdentifier("dummyInitialValues")); // intentionally different name here
}
void CCockpitComComponent::onAtcStationsChanged()
{
// void
}
void CCockpitComComponent::updateSelcalInContext(const CSelcal &selcal)
{
if (!sGui || sGui->isShuttingDown() || !sGui->getIContextOwnAircraft()) { return; }