示例#1
0
        /// <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;
        }
示例#3
0
 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);
     }
 }
示例#4
0
 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;
        }