internal void RegisterCurrentMusic(Music music) { if (currentPlayingMusic != null) currentPlayingMusic.Stop(); currentPlayingMusic = music; }
public override void Preview(string contentName) { verdana = ContentLoader.Load<Font>("Verdana12"); new FontText(verdana, "Play/Stop", Rectangle.One); music = ContentLoader.Load<Music>(contentName); music.Play(1); var trigger = new MouseButtonTrigger(); trigger.AddTag("temporary"); var musicCommand = new Command(() => //ncrunch: no coverage start { if (music.IsPlaying()) music.Stop(); else music.Play(1); }).Add(trigger); musicCommand.AddTag("temporary"); //ncrunch: no coverage end }