Example #1
0
 private void _setMainTone(Tone tone)
 {
     if (currentTone == tone)
     {
         SetEnable(false);
     }
     else
     {
         currentTone.SetState(false);
         currentTone = tone;
         currentTone.SetState(true);
     }
 }
Example #2
0
 private void setTone(Tone tone)
 {
     if (currentTone == tone)
     {
         SetState(false);
     }
     else
     {
         currentTone.SetState(false);
         currentTone = tone;
         currentTone.SetState(true);
     }
 }
Example #3
0
 internal void previousTone()
 {
     currentTone.SetState(false);
     //Underflow Check
     if (MainTones.IndexOf(currentTone) - 1 < 0)
     {
         currentTone = MainTones[MainTones.Count - 1];
     }
     else
     {
         currentTone = MainTones[MainTones.IndexOf(currentTone) - 1];
         if (_enable)
         {
             currentTone.SetState(true);
         }
     }
 }
Example #4
0
 internal void nextTone()
 {
     currentTone.SetState(false);
     //OverflowCatch
     if (MainTones.IndexOf(currentTone) + 1 >= MainTones.Count)
     {
         currentTone = MainTones[0];
     }
     else
     {
         currentTone = MainTones[MainTones.IndexOf(currentTone) + 1];
         if (_enable)
         {
             currentTone.SetState(true);
         }
     }
 }
Example #5
0
 /// <summary>
 /// Stops the current tone and disables the siren if it is equal to <paramref name="tone"/>
 /// else it will disable the current tone and enable the <paramref name="tone"/>
 /// </summary>
 /// <param name="tone"></param>
 internal void setMainTone(Tone tone)
 {
     _setMainTone(MainTones.Find((maintone) => maintone == tone));
 }
Example #6
0
 internal MainSiren(ref Tones tonesl)
 {
     MainTones   = new List <Tone>(new[] { tonesl.tone1, tonesl.tone2, tonesl.tone3, tonesl.tone4 });
     currentTone = MainTones[0];
 }
Example #7
0
 public MainSiren(Tones tonesl)
 {
     MainTones   = new List <Tone>(new[] { tonesl.tone1, tonesl.tone2, tonesl.tone3, tonesl.tone4 });
     currentTone = MainTones[0];
 }