// Set the value dependent Note in the soundBite // Returns true if the note has changed public static bool ModNote(EVolume volume, float value, PingLib.SoundBite soundBite) { uint note = 0; // default is silent if (volume != EVolume.V_Silent) { note = ToneFromVS(value, soundBite.Tone, volume == EVolume.V_Plus); } bool changed = soundBite.Tone != note; soundBite.Tone = note; return(changed); }
private void DI_Vario_ButtonClicked(object sender, ClickedEventArgs e) { // rotate through the Volumes _volume++; _volume = (_volume == EVolume.V_LAST) ? EVolume.V_Silent : _volume; // Set Note to Silence if not connected (just in case..) if (!SC.SimConnectClient.Instance.IsConnected) { // this will change the Volume if needed and clears the Ping when not connected (else it is taken in the next Update) _soundBite.Tone = 0; // Ask for Silence } // color if enabled, else default BG _label.ItemBackColor = (_volume == EVolume.V_Silent) ? cActBG : (_volume == EVolume.V_PlusMinus) ? cMetB : cLiveBG; }