Namespace: DeltaEngine.Multimedia
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Tests: DeltaEngine.Multimedia.Tests.SoundTests
2 unit tests call DeltaEngine.Multimedia.Sound.NumberOfInstances
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Property Value
Type: Int32Remarks
Examples
[Test] public void DisposeSoundInstance() { var sound = ContentLoader.Load<Sound>("DefaultSound"); var instance = sound.CreateSoundInstance(); Assert.AreEqual(1, sound.NumberOfInstances); Assert.AreEqual(0, sound.NumberOfPlayingInstances); instance.Dispose(); Assert.AreEqual(0, sound.NumberOfInstances); Assert.AreEqual(0, sound.NumberOfPlayingInstances); }
[Test] public void DisposeSoundInstancesFromSoundClass() { var sound = ContentLoader.Load<Sound>("DefaultSound"); sound.CreateSoundInstance(); sound.Play(); Assert.AreEqual(2, sound.NumberOfInstances); Assert.AreEqual(1, sound.NumberOfPlayingInstances); sound.Dispose(); Assert.AreEqual(0, sound.NumberOfInstances); Assert.AreEqual(0, sound.NumberOfPlayingInstances); }
See Also