/// <summary> /// cTor Set the voice output and create the voice out items /// </summary> /// <param name="speaker">A GUI_Speech object to talk from</param> public HudVoice(GUI_Speech speaker) { // Create all voice out items and add them to a list for Configuration // ADD NEW ITEMS ONLY AT THE END - App Settings is according to this sequence v_parkbrake = new T_Brakes(speaker); m_triggerList.Add(v_parkbrake); v_gear = new T_Gear(speaker); m_triggerList.Add(v_gear); v_flaps = new T_Flaps(speaker); m_triggerList.Add(v_flaps); v_waypointETE = new T_WaypointETE(speaker); m_triggerList.Add(v_waypointETE); v_glideslope = new T_Glideslope(speaker); m_triggerList.Add(v_glideslope); v_apAltHold = new T_AltHold(speaker); m_triggerList.Add(v_apAltHold); v_airTemp = new T_OAT(speaker); m_triggerList.Add(v_airTemp); v_warnFuel = new T_WarnFuel(speaker); m_triggerList.Add(v_warnFuel); v_rotate = new T_IAS_Rotate(speaker); m_triggerList.Add(v_rotate); v_spoilers = new T_Spoilers(speaker); m_triggerList.Add(v_spoilers); // load from settings string profile = AppSettings.Instance.VoiceCalloutProfile; string[] e = profile.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries); int idx = 0; foreach (var vc in m_triggerList) { bool enabled = false; // default OFF if (e.Length > idx) { enabled = e[idx] == "1"; // found an element in the string } idx++; // next item vc.Enabled = enabled; } }
/// <summary> /// cTor: /// </summary> /// <param name="proto"></param> public V_RAaudio(Label proto, bool showUnit, GUI_Speech gUI_SpeechRef) : base(proto, showUnit) { m_unit = "ft"; m_default = DefaultString("+__'___ " + " "); // -nn,nnn + blank Text = UnitString(m_default); m_raCallout = new Triggers.T_RAcallout(gUI_SpeechRef) { Enabled = false }; // will be enabled once we get a value to report m_raCallout.RegisterObserver( ); // this one is not in the HUDVoice List - so call it here }