Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
b91d1e3
Initial implementation of EMER CANC pb
FozzieHi Dec 1, 2025
c4d64c8
Add manual audio inhibition (MAI)
FozzieHi Jan 18, 2026
992fd85
Add Emergency audio cancel (EAC)
FozzieHi Jan 18, 2026
b82a373
Handle caution clearing
FozzieHi Jan 18, 2026
08c9569
Add comment
FozzieHi Jan 18, 2026
55fe3d8
Undo EMER CANC changes to A380X for now
FozzieHi Jan 18, 2026
e9d781b
Merge branch 'master' into emer-canc
FozzieHi Jan 18, 2026
be1b28b
Mute aural alerts instead of stopping
FozzieHi Jan 18, 2026
311f613
Add comment
FozzieHi Jan 18, 2026
9a37b08
Remove old use
FozzieHi Jan 18, 2026
9efe4d6
Add back MAI for non-mutable sounds
FozzieHi Jan 18, 2026
1a80b3e
Move to selectAndPlayMostImportantSound
FozzieHi Jan 18, 2026
b0a729a
Use pulse down to determine single button press
FozzieHi Jan 19, 2026
7b472f6
Add initial A380X instrument implementation
FozzieHi Jan 22, 2026
543e884
Port A32NX changes to A380X
FozzieHi Jan 22, 2026
4727495
Cancelled caution publishing
FozzieHi Jan 22, 2026
e51920f
Update stsMoreAvailableSimvar when not visible
FozzieHi Jan 24, 2026
84c260a
Allow holding down EMER CANC pb for ECC
FozzieHi Jan 24, 2026
c6c834c
Rename variables
FozzieHi Jan 24, 2026
72787b9
Fix line length
FozzieHi Jan 24, 2026
b12c213
Add comment
FozzieHi Jan 24, 2026
03e84c0
Cancel C-chord
FozzieHi Jan 24, 2026
9943b38
Merge branch 'master' into emer-canc
FozzieHi Jan 24, 2026
edef5c4
Also deactivate non-sensed procedures
FozzieHi Jan 24, 2026
c3c0540
Small refactor
FozzieHi Jan 24, 2026
10bde97
Port cav charge active to fix AP involuntary disc not cancelling
FozzieHi Jan 24, 2026
fed2289
Make overspeed non-cancellable
FozzieHi Jan 24, 2026
eafbae8
Fix cancelling of cChord
FozzieHi Jan 24, 2026
33b75f9
Merge branch 'master' into emer-canc
FozzieHi Feb 22, 2026
54959fe
Add EMERGENCY CANCEL ON memo to A320
FozzieHi Feb 22, 2026
2c74073
Add EMERGENCY CANCEL ON memo to A380
FozzieHi Feb 22, 2026
d6efc4f
Update comment
FozzieHi Feb 22, 2026
89bc497
Add to procedure page
FozzieHi Feb 22, 2026
d88d665
Fix audio being overridden by other sources
FozzieHi Feb 22, 2026
ce1db78
Port audio changes to A32NX
FozzieHi Feb 22, 2026
b24a10d
Update gating
FozzieHi Feb 22, 2026
872e05f
Fix buffer input
FozzieHi Feb 22, 2026
cb2b535
Do not auto remove status if more page is available
FozzieHi Feb 22, 2026
7b844e2
Cleanup
FozzieHi Feb 22, 2026
d848697
Add more page margin
FozzieHi Feb 22, 2026
dac4961
Fix stale more active var
FozzieHi Feb 22, 2026
e9963f5
Fix MORE pb illuminating
FozzieHi Feb 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const EWDMessages = {
'000002010': ' \x1b<3mFLAPS FULL',
'000002011': ' \x1b<3mFLAPS\x1b<5m.....CONF 3',
'000002012': ' \x1b<3mFLAPS CONF 3',
'315100001': '\x1b<7mEMERGENCY CANCEL ON',
'320000001': '\x1b<4mAUTO BRK OFF',
'000002201': '\x1b<3mAUTO BRK LO',
'000002202': '\x1b<3mAUTO BRK MED',
Expand Down
60 changes: 48 additions & 12 deletions fbw-a32nx/src/systems/systems-host/systems/FWC/FwsSoundManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ export const FwsAuralsList: Record<string, FwsAural> = {
},
};

const MutableSounds = [FwsAuralsList.cavalryChargeOnce, FwsAuralsList.cavalryChargeCont];

// FIXME Not all sounds are added to this yet (e.g. CIDS chimes), consider adding them in the future
// Also, single chimes are not filtered (in RL only once every two seconds)
export class FwsSoundManager {
Expand All @@ -251,6 +253,12 @@ export class FwsSoundManager {
/** in seconds */
private currentSoundPlayTimeRemaining = 0;

private manualAudioInhibition = false;

private requestedVolume = FwsAuralVolume.Full;

private appliedVolume: FwsAuralVolume | null = null;

constructor(
private bus: EventBus,
private startupCompleted: Subscribable<boolean>,
Expand All @@ -272,6 +280,15 @@ export class FwsSoundManager {
return this.currentSoundPlaying;
}

/** Inhibit starting any new broadcasts (MAI). */
setManualAudioInhibition(inhibit: boolean) {
if (this.manualAudioInhibition === inhibit) {
return;
}
this.manualAudioInhibition = inhibit;
this.applyVolume();
}

/** Add sound to queue. Don't add if already playing */
enqueueSound(soundKey: keyof typeof FwsAuralsList) {
const sound = FwsAuralsList[soundKey];
Expand Down Expand Up @@ -321,7 +338,17 @@ export class FwsSoundManager {

/** This only has an effect on sounds defining WwiseRTPC behavior/var for volume */
setVolume(volume: FwsAuralVolume) {
SimVar.SetSimVarValue('L:A32NX_FWS_AUDIO_VOLUME', SimVarValueType.Enum, volume);
this.requestedVolume = volume;
this.applyVolume();
}

private applyVolume() {
const effectiveVolume = this.manualAudioInhibition ? FwsAuralVolume.Silent : this.requestedVolume;
if (this.appliedVolume !== null && effectiveVolume === this.appliedVolume) {
return;
}
SimVar.SetSimVarValue('L:A32NX_FWS_AUDIO_VOLUME', SimVarValueType.Enum, effectiveVolume);
this.appliedVolume = effectiveVolume;
}

/** Play now, not to be called from the outside */
Expand Down Expand Up @@ -360,13 +387,21 @@ export class FwsSoundManager {
}
});

// TODO: Once all sounds are mutable, this.manualAudioInhibition shouldn't be needed anymore
if (this.manualAudioInhibition && !MutableSounds.includes(FwsAuralsList[selectedSoundKey])) {
return;
}

if (selectedSoundKey) {
this.playSound(selectedSoundKey);
return selectedSoundKey;
}

// See if single chimes are left
if (this.singleChimesPending) {
if (this.manualAudioInhibition) {
return null;
}
this.playSound('singleChime');
this.singleChimesPending--;
return 'singleChime';
Expand Down Expand Up @@ -398,17 +433,18 @@ export class FwsSoundManager {
// Interrupt if sound with higher category is present in queue and current sound is continuous
let shouldInterrupt = false;
let rescheduleSound: keyof typeof FwsAuralsList | null = null;
this.soundQueue.forEach((sk) => {
const s = FwsAuralsList[sk];
if (
s &&
this.currentSoundPlaying &&
FwsAuralsList[this.currentSoundPlaying]?.continuous &&
s.type > FwsAuralsList[this.currentSoundPlaying].type
) {
shouldInterrupt = true;
}
});
const currentSound = this.currentSoundPlaying ? FwsAuralsList[this.currentSoundPlaying] : undefined;
if (currentSound?.continuous) {
this.soundQueue.forEach((sk) => {
const s = FwsAuralsList[sk];
if (
s &&
(s.type > currentSound.type || (s.type === currentSound.type && s.priority > currentSound.priority))
) {
shouldInterrupt = true;
}
});
}

if (shouldInterrupt) {
if (this.currentSoundPlaying && FwsAuralsList[this.currentSoundPlaying]?.continuous) {
Expand Down
Loading