/// <summary> /// Gets the instance. /// </summary> /// <value>The instance.</value> /* public static FSLSoundManager Instance * { * get { return SingletonCreator.instance; } * } * * private class SingletonCreator * { * // Explicit static constructor to tell C# compiler * // not to mark type as beforefieldinit * static SingletonCreator() * { * } * * internal static readonly FSLSoundManager instance = new FSLSoundManager(); * }*/ #endregion #region Private Members private FSLSoundObject AddSound(FSLSoundObject sound) { lock (this) { SoundObjectVector.Add(sound); return(sound); } }
public void RemoveSound(string name) { FSLSoundObject sound = GetSound( name ); if ( sound == null) return; else sound = null; }
public FSLSoundObject CreateAmbientSound(string soundFile, string name, bool loop, bool streaming) { // lock (LockSync) { int before = Environment.TickCount; FSLSoundObject obj = AddSound(new FSLAmbientSound(soundFile, name, loop, streaming)); if (!streaming && LogManager.Singleton != null) { LogManager.Singleton.LogMessage(LogMessageLevel.LML_NORMAL, "Ambient sound '" + name + "' preloaded within " + (Environment.TickCount - before) + "ms"); } return(obj); } }
public void RemoveSound(string name) { lock (LockSync) { FSLSoundObject sound = GetSound(name); if (sound == null) { return; } else { SoundObjectVector.Remove(sound); // zmiana sound.Destroy(); sound = null; } } }
private FSLSoundObject AddSound(FSLSoundObject sound) { _soundObjectVector.Add( sound ); return sound; }