コード例 #1
0
 public void PlayMusicAndVideo()
 {
     MockSoundDevice device = new MockSoundDevice();
     Assert.IsTrue(device.IsInitialized);
     var music1 = ContentLoader.Load<Music>("DefaultMusic");
     music1.Play();
     Assert.False(MockMusic.MusicStopCalled);
     device.RegisterCurrentMusic(music1);
     Assert.IsTrue(device.IsActive);
     Assert.IsTrue(device.IsInitialized);
     device.RapidUpdate();
     device.Dispose();
 }
コード例 #2
0
 public void PlayAndStopMusic()
 {
     MockSoundDevice device = new MockSoundDevice();
     Assert.IsTrue(device.IsPauseable);
     Assert.IsTrue(device.IsInitialized);
     var musicTime = ContentLoader.Load<Music>("DefaultMusic");
     musicTime.StreamFinished = () => { };
     musicTime.Play();
     device.RegisterCurrentMusic(musicTime);
     musicTime.Stop();
     device.RapidUpdate();
     musicTime.Loop = true;
     musicTime.Stop();
     device.RapidUpdate();
     device.Dispose();
 }
コード例 #3
0
		public void ChangeMusicVolume()
		{
			var device = new MockSoundDevice();
			float defaultMusicVolume = Settings.Current.MusicVolume;
			Assert.IsTrue(device.IsInitialized);
			try
			{
				device.MusicVolume = 1.0f;
				Assert.AreEqual(1.0f, device.MusicVolume);
			}
			finally
			{
				device.MusicVolume = defaultMusicVolume;
			}
			device.RapidUpdate();
			device.Dispose();
		}