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));
        }
示例#2
0
        public void TestSeekToEndFails()
        {
            bool?success = null;

            bass.RunOnAudioThread(() => { success = track.Seek(track.Length); });
            bass.Update();

            Assert.AreEqual(0, track.CurrentTime);
            Assert.IsFalse(success);
        }
        public void TestSampleInitialisesOnUpdateDevice()
        {
            if (RuntimeInfo.OS == RuntimeInfo.Platform.Linux)
            {
                Assert.Ignore("Test may be intermittent on linux (see AudioThread.FreeDevice()).");
            }

            Assert.That(sample.IsLoaded, Is.False);
            bass.RunOnAudioThread(() => bass.SampleStore.UpdateDevice(0));
            Assert.That(sample.IsLoaded, Is.True);
        }
示例#4
0
 public void TestPlayingUpdatedAfterInlinePlay()
 {
     bass.RunOnAudioThread(() => channel = sample.Play());
     Assert.That(channel.Playing, Is.True);
 }