Esempio n. 1
0
 public static SimpleAudioEngine sharedEngine()
 {
     if (SimpleAudioEngine.s_SharedEngine == null)
     {
         SimpleAudioEngine.s_SharedEngine = new SimpleAudioEngine();
     }
     return(SimpleAudioEngine.s_SharedEngine);
 }
Esempio n. 2
0
 public void stopBackgroundMusic(bool bReleaseData)
 {
     if (bReleaseData)
     {
         SimpleAudioEngine.sharedMusic().Close();
         return;
     }
     SimpleAudioEngine.sharedMusic().Stop();
 }
        /**
        @brief Get the shared Engine object,it will new one when first time be called
        */
        public static SimpleAudioEngine sharedEngine()
        {
            if (null == s_SharedEngine)
            {
                s_SharedEngine = new SimpleAudioEngine();
            }

            return s_SharedEngine;
        }
        /**
         * @brief Get the shared Engine object,it will new one when first time be called
         */
        public static SimpleAudioEngine sharedEngine()
        {
            if (null == s_SharedEngine)
            {
                s_SharedEngine = new SimpleAudioEngine();
            }

            return(s_SharedEngine);
        }
Esempio n. 5
0
 public void playBackgroundMusic(string pszFilePath, bool bLoop)
 {
     if (pszFilePath == null)
     {
         return;
     }
     SimpleAudioEngine.sharedMusic().Open(SimpleAudioEngine._FullPath(pszFilePath), SimpleAudioEngine._Hash(pszFilePath));
     SimpleAudioEngine.sharedMusic().Play(bLoop);
 }
Esempio n. 6
0
 public void end()
 {
     SimpleAudioEngine.sharedMusic().Close();
     foreach (KeyValuePair <uint, EffectPlayer> keyValuePair in SimpleAudioEngine.sharedList())
     {
         keyValuePair.Value.Close();
     }
     SimpleAudioEngine.sharedList().Clear();
 }
Esempio n. 7
0
        public void unloadEffect(string pszFilePath)
        {
            uint num = SimpleAudioEngine._Hash(pszFilePath);

            if (SimpleAudioEngine.sharedList().ContainsKey(num))
            {
                SimpleAudioEngine.sharedList().Remove(num);
            }
        }
Esempio n. 8
0
 public void stopEffect(uint nSoundId)
 {
     foreach (KeyValuePair <uint, EffectPlayer> keyValuePair in SimpleAudioEngine.sharedList())
     {
         if (nSoundId != keyValuePair.Key)
         {
             continue;
         }
         keyValuePair.Value.Stop();
     }
 }
Esempio n. 9
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);
        }
Esempio n. 10
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);
        }
Esempio n. 11
0
 public void pauseBackgroundMusic()
 {
     SimpleAudioEngine.sharedMusic().Pause();
 }
Esempio n. 12
0
 public bool isBackgroundMusicPlaying()
 {
     return(SimpleAudioEngine.sharedMusic().IsPlaying());
 }
Esempio n. 13
0
 public float getBackgroundMusicVolume()
 {
     return(SimpleAudioEngine.sharedMusic().Volume);
 }
Esempio n. 14
0
 public void preloadBackgroundMusic(string pszFilePath)
 {
     SimpleAudioEngine.sharedMusic().Open(SimpleAudioEngine._FullPath(pszFilePath), SimpleAudioEngine._Hash(pszFilePath));
 }
Esempio n. 15
0
 public void setBackgroundMusicVolume(float volume)
 {
     SimpleAudioEngine.sharedMusic().Volume = volume;
 }
Esempio n. 16
0
 public void SaveMediaState()
 {
     SimpleAudioEngine.sharedMusic().SaveMediaState();
 }
Esempio n. 17
0
 public void rewindBackgroundMusic()
 {
     SimpleAudioEngine.sharedMusic().Rewind();
 }
Esempio n. 18
0
 public void resumeBackgroundMusic()
 {
     SimpleAudioEngine.sharedMusic().Resume();
 }
Esempio n. 19
0
 public void RestoreMediaState()
 {
     SimpleAudioEngine.sharedMusic().RestoreMediaState();
 }