Exemplo n.º 1
0
 public void end()
 {
     SimpleAudioEngine.sharedMusic().Close();
     foreach (KeyValuePair <uint, EffectPlayer> keyValuePair in SimpleAudioEngine.sharedList())
     {
         keyValuePair.Value.Close();
     }
     SimpleAudioEngine.sharedList().Clear();
 }
Exemplo n.º 2
0
        public void unloadEffect(string pszFilePath)
        {
            uint num = SimpleAudioEngine._Hash(pszFilePath);

            if (SimpleAudioEngine.sharedList().ContainsKey(num))
            {
                SimpleAudioEngine.sharedList().Remove(num);
            }
        }
Exemplo n.º 3
0
 public void stopEffect(uint nSoundId)
 {
     foreach (KeyValuePair <uint, EffectPlayer> keyValuePair in SimpleAudioEngine.sharedList())
     {
         if (nSoundId != keyValuePair.Key)
         {
             continue;
         }
         keyValuePair.Value.Stop();
     }
 }
Exemplo n.º 4
0
        public uint playEffect(string pszFilePath, bool bLoop)
        {
            uint num = SimpleAudioEngine._Hash(pszFilePath);

            this.preloadEffect(pszFilePath);
            foreach (KeyValuePair <uint, EffectPlayer> keyValuePair in SimpleAudioEngine.sharedList())
            {
                if (num != keyValuePair.Key)
                {
                    continue;
                }
                keyValuePair.Value.Play(bLoop);
            }
            return(num);
        }
Exemplo n.º 5
0
        public void preloadEffect(string pszFilePath)
        {
            if (pszFilePath.Length <= 0)
            {
                return;
            }
            uint num = SimpleAudioEngine._Hash(pszFilePath);

            if (SimpleAudioEngine.sharedList().ContainsKey(num))
            {
                return;
            }
            EffectPlayer effectPlayer = new EffectPlayer();

            effectPlayer.Open(SimpleAudioEngine._FullPath(pszFilePath), num);
            SimpleAudioEngine.sharedList().Add(num, effectPlayer);
        }