コード例 #1
0
 public static SimpleAudioEngine sharedEngine()
 {
     if (SimpleAudioEngine.s_SharedEngine == null)
     {
         SimpleAudioEngine.s_SharedEngine = new SimpleAudioEngine();
     }
     return(SimpleAudioEngine.s_SharedEngine);
 }
コード例 #2
0
 public void stopBackgroundMusic(bool bReleaseData)
 {
     if (bReleaseData)
     {
         SimpleAudioEngine.sharedMusic().Close();
         return;
     }
     SimpleAudioEngine.sharedMusic().Stop();
 }
コード例 #3
0
        /**
        @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;
        }
コード例 #4
0
        /**
         * @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);
        }
コード例 #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);
 }
コード例 #6
0
 public void end()
 {
     SimpleAudioEngine.sharedMusic().Close();
     foreach (KeyValuePair <uint, EffectPlayer> keyValuePair in SimpleAudioEngine.sharedList())
     {
         keyValuePair.Value.Close();
     }
     SimpleAudioEngine.sharedList().Clear();
 }
コード例 #7
0
        public void unloadEffect(string pszFilePath)
        {
            uint num = SimpleAudioEngine._Hash(pszFilePath);

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