static private Remove ( |
||
inst | The SoundEffectInstance to add to the playing list. | |
Результат | void |
/// <summary>Plays or resumes a SoundEffectInstance.</summary> /// <remarks>Throws an exception if more sounds are playing than the platform allows.</remarks> public virtual void Play() { if (_isDisposed) { throw new ObjectDisposedException("SoundEffectInstance"); } if (State == SoundState.Playing) { return; } // We don't need to check if we're at the instance play limit // if we're resuming from a paused state. if (State != SoundState.Paused) { if (!SoundEffectInstancePool.SoundsAvailable) { throw new InstancePlayLimitException(); } SoundEffectInstancePool.Remove(this); } // For non-XAct sounds we need to be sure the latest // master volume level is applied before playback. if (!_isXAct) { PlatformSetVolume(_volume * SoundEffect.MasterVolume); } PlatformPlay(); }
/// <summary> /// Resumes playback of the DynamicSoundEffectInstance. /// </summary> public override void Resume() { AssertNotDisposed(); if (_state != SoundState.Playing) { Volume = Volume; // Add the instance to the pool if (!SoundEffectInstancePool.SoundsAvailable) { throw new InstancePlayLimitException(); } SoundEffectInstancePool.Remove(this); } PlatformResume(); _state = SoundState.Playing; }
/// <summary>Plays or resumes a SoundEffectInstance.</summary> /// <remarks>Throws an exception if more sounds are playing than the platform allows.</remarks> public void Play() { if (State == SoundState.Playing) { return; } // We don't need to check if we're at the instance play limit // if we're resuming from a paused state. if (State != SoundState.Paused) { SoundEffectInstancePool.Remove(this); if (!SoundEffectInstancePool.SoundsAvailable) { throw new InstancePlayLimitException(); } } PlatformPlay(); }
/// <summary> /// Plays or resumes the DynamicSoundEffectInstance. /// </summary> public override void Play() { AssertNotDisposed(); if (_state != SoundState.Playing) { // Ensure that the volume reflects master volume, which is done by the setter. Volume = Volume; // Add the instance to the pool if (!SoundEffectInstancePool.SoundsAvailable) { throw new InstancePlayLimitException(); } SoundEffectInstancePool.Remove(this); PlatformPlay(); _state = SoundState.Playing; CheckBufferCount(); DynamicSoundEffectInstanceManager.AddInstance(this); } }