Example #1
0
 // Will probably move to its own component
 void PlayIfCan(Note note)
 {
     if (soundPlayer == null || !soundPlayer.IsPlaying)
     {
         soundPlayer = Sound.Play(note);
     }
 }
Example #2
0
 void PlayImmediatly(IEnumerable <Note> notes)
 {
     if (soundPlayer != null)
     {
         soundPlayer.Stop();
     }
     soundPlayer = Sound.Play(notes);
 }