internal static void Stop() { if (tempPlayer != null) { tempPlayer.Stop(); tempPlayer = null; } player.Stop(); NAudioMidi.Stop(); status(STOP); }
private static void getNext() { NAudioMidi.Stop(); if (currentTrack.isPlaylistTrack) { currentKey++; status(TRACK_STOPPED); } switch (currentTrack.next) { case nextTrack.bgRandom: BgPlay(); break; case nextTrack.next: if (currentKey >= mainPlayList.tracks.Count) { MessageBox.Show("Данный трек последний в плейлисте, поэтому воспроизвести следующий трек невозможно.", "ПОСЛЕДНИЙ ТРЕК В ПЛЕЙЛИСТЕ", MessageBoxButtons.OK, MessageBoxIcon.Warning); Stop(); break; } else { Play(mainPlayList.tracks[currentKey], currentKey); } break; case nextTrack.bgConcrete: if (bgMain != null) { Play(bgMain, currentKey); } else { BgPlay(); } break; case nextTrack.cycle: Play(currentTrack, currentKey); break; case nextTrack.pause: Stop(); break; default: Stop(); break; } }