Welcome Sound and Heartbeat

From MIB-Helper.com Wiki
Revision as of 20:38, 12 January 2025 by Mr-fix (talk | contribs)
Jump to navigation Jump to search

flags related to the availability of the feature

CL_ANN_AMP_TONE_HEARTBEAT
CL_ENT_AMP_TONE_WELCOME
CL_ANN_AMP_MENU_TONE_HEARTBEAT
TONEID_HEARTBEAT
VOLUME_MENU_HEARTBEAT
GREY_OUT_POPUP_HEARTBEAT_CHOICE
VOLUME_HEARTBEAT_RANGE
FOCUS_LISTENER_VOLUME_HEARTBEAT_CHOICE
TONE_LEFT_DRAWER_AUDI_DEPARTURE_SOUND
case 1000034: {
 return "TONE_HEARTBEAT_MAIN";
}

function that checks readiness sound coding/adatpation?

   private boolean isReadinessSoundCoded() {
       return this.env.getSysConst(4596) == 1;
   }
this.setSysConstBool(4596, this.getAdaptationANP().isVehicleReadinessSoundAvailable());
this.setSysConstBool(4606, this.getAdaptationANP().isVehicleLeavingSoundAvailable());

  @Override
   public boolean isVehicleReadinessSoundAvailable() {
       return this.getBoolean(57, 0, false);
   }

   @Override
   public boolean isVehicleLeavingSoundAvailable() {
       return this.getBoolean(57, 1, false);
   }

function that triggers the sound

   @Override
   public void play() {
       this.lc.log(-2137614336, "[HeartbeatPlayer.play]");
       this.ringTonePlayer.playTone(this.playMode, 10);
   }

looks like those sound are considered to be ringtones. volume setting might be set to ringtone volume. Or fixed value.

   static /* synthetic */ int access$302(Heartbeat heartbeat, int n) {
       heartbeat.heartbeatVolume = n;
       return heartbeat.heartbeatVolume;
   }


Here's the definition of the volume menu:

   public void createVolumeMenus() {
       this.loweredEntMenus[0] = this.loweredEntAps;
       this.loweredEntMenus[1] = this.loweredEntNav;
       this.menus[3] = new PhoneRingtoneVolumeRange(this);
       this.menus[1] = new TAVolumeRange(this);
       this.menus[2] = new SDSVolumeRange(this);
       this.menus[0] = new NaviVolumeRange(this);
       this.menus[4] = this.loweredEntNav;
       this.menus[5] = this.loweredEntAps;
       this.menus[6] = new TouchpadVolumeRange(this);
       this.menus[7] = new SMSBeepVolumeRange(this);
       this.menus[8] = new HeartbeatVolumeRange(this);
       this.menus[9] = new RingtoneSelectionVolumeRange(this);
       this.menus[10] = new PhoneMicGainVolumeRange(this);
       if (this.env.getSysConst(4162) == 1) {
           this.menus[11] = new WirelessChargingVolumeRange(this);
       }
       this.menus[12] = new InfoAnnouncementVolumeRange(this);
   }

menu[8] is for the sound that we are looking for. Let's check how the HeartbeatVolumeRange class looks like:

public class HeartbeatVolumeRange
extends AbstractVolumeRange {
   private static final int CONNECTION;
   private final int[] volumeConnections = new int[]{48, 82};
   private final int[] greyOutConnections = AudioConnection.GREY_OUT_ALL;
   private final HeartbeatPlayer player;
   private final String name;

I this looks like the tone menu section responsible for Welcome/Heartbeat:

   private void executeConditiontONEHEARTBEATMAINScreen(int n, HMIView[] hMIViewArray, int n2) {
       switch (n) {
           case 3883: {
               if (this.evaluateSimpleChoiceModelValueEqualsCondition(3883, n2, 1)) {
                   if (hMIViewArray[0] != null) {
                       ((ScreenWidgetEVO)hMIViewArray[0]).setToplevelScreen(true);
                   }
                   if (hMIViewArray[0] == null) break;
                   ((ScreenWidgetEVO)hMIViewArray[0]).setOpenSelectionDrawerByHkReturn(true);
                   break;
               }
               if (hMIViewArray[0] != null) {
                   ((ScreenWidgetEVO)hMIViewArray[0]).setToplevelScreen(false);
               }
               if (hMIViewArray[0] == null) break;
               ((ScreenWidgetEVO)hMIViewArray[0]).setOpenSelectionDrawerByHkReturn(false);
               break;
           }
           case 4073: {
               if (hMIViewArray[0] == null) break;
               ((RotaryController)hMIViewArray[0]).setEnabled(!this.evaluateSimpleChoiceModelValueGreaterCondition(4073, n2, 0));
               break;
           }
       }
   }