public void TestPlayPauseStop()
        {
            Assert.That(!track.IsRunning);

            bass.RunOnAudioThread(() => track.Start());
            bass.Update();

            Assert.That(track.IsRunning);

            bass.RunOnAudioThread(() => track.Stop());
            bass.Update();

            Assert.That(!track.IsRunning);

            bass.RunOnAudioThread(() =>
            {
                track.Seek(track.Length - 1000);
                track.Start();
            });

            bass.Update();

            Assert.That(() =>
            {
                bass.Update();
                return(!track.IsRunning);
            }, Is.True.After(3000));
        }
        public void TestIsRunningUpdatedAfterInlineStop()
        {
            track.StartAsync();
            bass.Update();

            bass.RunOnAudioThread(() => track.Stop());
            Assert.That(track.IsRunning, Is.False);
        }
 private void startStop()
 {
     if (track.IsRunning)
     {
         track.Stop();
         button.Text = "Start";
     }
     else
     {
         track.Start();
         button.Text = "Stop";
     }
 }
        private void load(AudioManager audio, Game game)
        {
            AddStep("Play track", () =>
            {
                Track = new TrackBass(game.Resources.GetStream("Tracks/" + TestLevel.Metadata.Level.LevelName + "/" + TestLevel.SongUrl));

                audio.AddItem(Track);
                Track.Start();
            });

            AddStep("Stop track", () =>
            {
                Track.Stop();
                Track.Seek(0);
            });
        }
 protected override void Dispose(bool isDisposing)
 {
     base.Dispose(isDisposing);
     track?.Stop();
 }