Skip to content

Commit

Permalink
feat(Sounds) Added C-Chord and Caution Sounds (#431)
Browse files Browse the repository at this point in the history
* feat(MCP): Cosmetic Update

* fix(AP) Fixed TO/GA keybind bug

* fix(AP): LOC Fix

* Fix(AP): LOC intercept

* Squashed commit of the following:

commit 8794e93
Author: Ninjo <[email protected]>
Date:   Fri Apr 15 14:35:15 2022 +0200

    feat(sound): cchord and caution sounds (#429)

commit e417aed
Author: Ninjo <[email protected]>
Date:   Thu Apr 14 23:53:44 2022 +0200

    build: upload fragmenter zip assets to release (#428)

commit 9f3a136
Author: Ninjo <[email protected]>
Date:   Thu Apr 14 22:19:18 2022 +0200

    build: fragmenter script (#427)

commit d83c883
Author: 747-4EVER <[email protected]>
Date:   Thu Apr 14 11:18:48 2022 +0200

    feat(EICAS) New Messages (#424)

commit 942cb62
Author: dcherrie <[email protected]>
Date:   Tue Apr 12 03:32:09 2022 +1000

    feat: update salty livery model, new thumbnails (#420)

commit 366bbc5
Author: Robin Breitfeld <[email protected]>
Date:   Sun Apr 10 22:10:49 2022 +0200

    feat(fmc): VNAV operating altitude suggestion (#419)

    * VNAV climb altitude suggestion

    * remove unnecessary variable

    * update NaN check

    * update max crz altitude formula

    * fix(FMC): Fixed VNAV NaN bug

    * fix(FMC): better aligned text

    Co-authored-by: 747-4EVER <[email protected]>

commit 63347e4
Author: Ninjo <[email protected]>
Date:   Sun Apr 10 22:01:59 2022 +0200

    feat(fmc): improvements to simbrief uplink (#422)

    * feat(fmc): no wpt select on uplink, uplink chime, fixes

    * chore: remove debug stuff and stuff

    * fix: crz alt format on perf init uplink preview

* feat(Sounds): Added C-Chord and Caution Sound
  • Loading branch information
747-4EVER authored Apr 16, 2022
1 parent 1f4fde8 commit d5fd734
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@

<Alert>
<Type>SoundOnly</Type>
<SoundEvent>tone_altitude_alert_default</SoundEvent>
<SoundEvent>cchord</SoundEvent>
<Condition>
<StateMachine>
<State id="Armed" value="0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2235,8 +2235,8 @@ class Cabin_Annunciations extends Annunciations {
this.displayCaution = [];
this.displayAdvisory = [];
this.displayMemo = [];
this.warningToneNameZ = new Name_Z("tone_warning");
this.cautionToneNameZ = new Name_Z("tone_caution");
this.warningToneNameZ = new Name_Z("siren");
this.cautionToneNameZ = new Name_Z("caution_aural");
this.warningTone = false;
this.firstAcknowledge = true;
this.offStart = false;
Expand All @@ -2245,6 +2245,7 @@ class Cabin_Annunciations extends Annunciations {
super.init(root);
this.alwaysUpdate = true;
this.isPlayingWarningTone = false;
this.isPlayingCautionTone = false;
for (var i = 0; i < this.allMessages.length; i++) {
var message = this.allMessages[i];
var value = false;
Expand Down Expand Up @@ -2292,10 +2293,24 @@ class Cabin_Annunciations extends Annunciations {
break;
case Annunciation_MessageType.CAUTION:
this.displayCaution.push(message);
if (!message.Acknowledged && !this.isPlayingWarningTone && this.gps.isPrimary) {
let res = this.gps.playInstrumentSound("tone_caution");
if (res)
this.isPlayingWarningTone = true;

//Caution sound inhibited when fuel switches off and on ground or for ENG X SHUTDOWN message.
let shutdownInhibit = false;
let fuelSwitches = 0;
for (let i = 5; i < 9; i++) {
if (SimVar.GetSimVarValue("FUELSYSTEM VALVE SWITCH:" + i, "bool")) {
fuelSwitches++;
}
}
if ((fuelSwitches == 0 && Simplane.getIsGrounded()) || message.Text.indexOf('SHUTDOWN') !== -1) {
shutdownInhibit = true;
}

if (!message.Acknowledged && !this.isPlayingCautionTone && this.gps.isPrimary && !shutdownInhibit) {
let res = this.gps.playInstrumentSound("caution_aural");
if (res) {
this.isPlayingCautionTone = true;
}
}
break;
case Annunciation_MessageType.ADVISORY:
Expand Down Expand Up @@ -2381,7 +2396,7 @@ class Cabin_Annunciations extends Annunciations {
this.needReload = false;
}
if (this.warningTone && !this.isPlayingWarningTone && this.gps.isPrimary) {
let res = this.gps.playInstrumentSound("tone_warning");
let res = this.gps.playInstrumentSound("siren");
if (res)
this.isPlayingWarningTone = true;
}
Expand Down Expand Up @@ -2412,9 +2427,12 @@ class Cabin_Annunciations extends Annunciations {
}
}
onSoundEnd(_eventId) {
if (Name_Z.compare(_eventId, this.warningToneNameZ) || Name_Z.compare(_eventId, this.cautionToneNameZ)) {
if (Name_Z.compare(_eventId, this.warningToneNameZ)) {
this.isPlayingWarningTone = false;
}
else if (Name_Z.compare(_eventId, this.cautionToneNameZ)) {
this.isPlayingCautionTone = false;
}
}
onShutDown() {
for (let i = 0; i < this.allMessages.length; i++) {
Expand Down

0 comments on commit d5fd734

Please sign in to comment.