/** * @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()); }
/** * @brief Rewind playing background music */ public void RewindBackgroundMusic() { if (_NoAudioHardware) { return; } SharedMusic.Rewind(); }
/** * @brief Pause playing background music */ public void PauseBackgroundMusic() { if (_NoAudioHardware) { return; } SharedMusic.Pause(); }
/** * @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()); }
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); }
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(); } }
/** * @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(); } }
public void SaveMediaState() { SharedMusic.SaveMediaState(); }
/// <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(); }
public void RewindBackgroundMusic() { SharedMusic.Rewind(); }
public void ResumeBackgroundMusic() { SharedMusic.Resume(); }
public void PauseBackgroundMusic() { SharedMusic.Pause(); }
/// <summary> /// Save the media player's current playback state. /// </summary> public void SaveMediaState() { // CCTask.RunAsync(CocosDenshion.CCSimpleAudioEngine.SharedEngine.SaveMediaState); SharedMusic.SaveMediaState(); }
/** * @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()); }
public void PreloadBackgroundMusic(string filename) { SharedMusic.Open(FullPath(filename), filename.GetHashCode()); }
/** * @brief Whether the background music is playing * @return If is playing return true,or return false */ public bool IsBackgroundMusicPlaying() { return(SharedMusic.IsPlaying()); }