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));
        }
Ejemplo n.º 2
0
 private void startStop()
 {
     if (track.IsRunning)
     {
         track.Stop();
         button.Text = "Start";
     }
     else
     {
         track.Start();
         button.Text = "Stop";
     }
 }
Ejemplo n.º 3
0
        public void play(BeatmapInfo Beatmap, BeatmapDatabase Database)
        {
            using (var reader = Database.GetReader(Beatmap.BeatmapSet))
                using (var file = reader.GetStream(Beatmap.Metadata?.AudioFile ?? Beatmap.BeatmapSet.Metadata.AudioFile))
                {
                    MemoryStream ms = new MemoryStream();
                    file.CopyTo(ms);
                    System.Diagnostics.Debug.Print("Loaded file of size {0}", ms.Length);

                    Track track = new TrackBass(ms);

                    Audio.Track.SetExclusive(track);
                    track.Start();
                }
        }
Ejemplo n.º 4
0
        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);
            });
        }
Ejemplo n.º 5
0
 public void TestIsRunningUpdatedAfterInlineStart()
 {
     bass.RunOnAudioThread(() => track.Start());
     Assert.That(track.IsRunning, Is.True);
 }