예제 #1
0
        /**
         * @brief Whether the background music is playing
         * @return If is playing return true,or return false
         */

        public bool IsBackgroundMusicPlaying()
        {
            if (_NoAudioHardware)
            {
                return(false);
            }
            return(SharedMusic.IsPlaying());
        }
예제 #2
0
        /**
         * @brief Rewind playing background music
         */

        public void RewindBackgroundMusic()
        {
            if (_NoAudioHardware)
            {
                return;
            }
            SharedMusic.Rewind();
        }
예제 #3
0
        /**
         * @brief Pause playing background music
         */

        public void PauseBackgroundMusic()
        {
            if (_NoAudioHardware)
            {
                return;
            }
            SharedMusic.Pause();
        }
예제 #4
0
        /**
         * @brief Preload background music
         * @param pszFilePath The path of the background music file,or the FileName of T_SoundResInfo
         */

        public void PreloadBackgroundMusic(string pszFilePath)
        {
            if (_NoAudioHardware)
            {
                return;
            }
            SharedMusic.Open(FullPath(pszFilePath), pszFilePath.GetHashCode());
        }
예제 #5
0
        public void PlayBackgroundMusic(string filename, bool loop = false)
        {
            if (null == filename)
            {
                return;
            }

            SharedMusic.Open(FullPath(filename), filename.GetHashCode());
            SharedMusic.Play(loop);
        }
        /**
         * @brief Play background music
         * @param pszFilePath The path of the background music file,or the FileName of T_SoundResInfo
         * @param bLoop Whether the background music loop or not
         */

        public void PlayBackgroundMusic(string pszFilePath, bool bLoop)
        {
            if (null == pszFilePath)
            {
                return;
            }

            SharedMusic.Open(FullPath(pszFilePath), pszFilePath.GetHashCode());
            SharedMusic.Play(bLoop);
        }
예제 #7
0
 public void StopBackgroundMusic(bool releaseData = false)
 {
     if (releaseData)
     {
         SharedMusic.Close();
     }
     else
     {
         SharedMusic.Stop();
     }
 }
        /**
         * @brief Release the shared Engine object
         * @warning It must be called before the application exit, or a memroy leak will be casued.
         */

        public void End()
        {
            SharedMusic.Close();

            lock (SharedList) {
                foreach (var kvp in SharedList)
                {
                    kvp.Value.Close();
                }

                SharedList.Clear();
            }
        }
예제 #9
0
        /**
         * @brief Stop playing background music
         * @param bReleaseData If release the background music data or not.As default value is false
         */

        public void StopBackgroundMusic(bool bReleaseData)
        {
            if (_NoAudioHardware)
            {
                return;
            }
            if (bReleaseData)
            {
                SharedMusic.Close();
            }
            else
            {
                SharedMusic.Stop();
            }
        }
예제 #10
0
 public void SaveMediaState()
 {
     SharedMusic.SaveMediaState();
 }
예제 #11
0
 /// <summary>
 /// Restore the media player's state to how it was prior to the game launch. You need to do this when the game terminates
 /// if you run music that clobbers the music that was playing before the game launched.
 /// </summary>
 public void RestoreMediaState()
 {
     SharedMusic.RestoreMediaState();
 }
예제 #12
0
 public void RewindBackgroundMusic()
 {
     SharedMusic.Rewind();
 }
예제 #13
0
 public void ResumeBackgroundMusic()
 {
     SharedMusic.Resume();
 }
예제 #14
0
 public void PauseBackgroundMusic()
 {
     SharedMusic.Pause();
 }
예제 #15
0
 /// <summary>
 /// Save the media player's current playback state.
 /// </summary>
 public void SaveMediaState()
 {
     // CCTask.RunAsync(CocosDenshion.CCSimpleAudioEngine.SharedEngine.SaveMediaState);
     SharedMusic.SaveMediaState();
 }
예제 #16
0
        /**
         * @brief Preload background music
         * @param pszFilePath The path of the background music file,or the FileName of T_SoundResInfo
         */

        public void PreloadBackgroundMusic(string pszFilePath)
        {
            SharedMusic.Open(FullPath(pszFilePath), pszFilePath.GetHashCode());
        }
예제 #17
0
 public void PreloadBackgroundMusic(string filename)
 {
     SharedMusic.Open(FullPath(filename), filename.GetHashCode());
 }
예제 #18
0
        /**
         * @brief Whether the background music is playing
         * @return If is playing return true,or return false
         */

        public bool IsBackgroundMusicPlaying()
        {
            return(SharedMusic.IsPlaying());
        }