issue #2103 modify audioEngine table name to AudioEngine

This commit is contained in:
samuele3hu 2013-06-08 14:06:19 +08:00
parent 34b4cb48ab
commit 836bfe1d3f
3 changed files with 44 additions and 44 deletions

View File

@ -1,4 +1,4 @@
require "audioEngine"
require "AudioEngine"
local EFFECT_FILE = "effect1.wav"
local MUSIC_FILE = "background.mp3"
@ -36,60 +36,60 @@ local function CocosDenshionTest()
local nIdx = pMenuItem:getZOrder() - 10000
-- play background music
if nIdx == 0 then
audioEngine.playMusic(MUSIC_FILE, true)
AudioEngine.playMusic(MUSIC_FILE, true)
elseif nIdx == 1 then
-- stop background music
audioEngine.stopMusic()
AudioEngine.stopMusic()
elseif nIdx == 2 then
-- pause background music
audioEngine.pauseMusic()
AudioEngine.pauseMusic()
elseif nIdx == 3 then
-- resume background music
audioEngine.resumeMusic()
AudioEngine.resumeMusic()
-- rewind background music
elseif nIdx == 4 then
audioEngine.rewindMusic()
AudioEngine.rewindMusic()
elseif nIdx == 5 then
-- is background music playing
if audioEngine.isMusicPlaying () then
if AudioEngine.isMusicPlaying () then
cclog("background music is playing")
else
cclog("background music is not playing")
end
elseif nIdx == 6 then
-- play effect
m_nSoundId = audioEngine.playEffect(EFFECT_FILE)
m_nSoundId = AudioEngine.playEffect(EFFECT_FILE)
elseif nIdx == 7 then
-- play effect
m_nSoundId = audioEngine.playEffect(EFFECT_FILE, true)
m_nSoundId = AudioEngine.playEffect(EFFECT_FILE, true)
elseif nIdx == 8 then
-- stop effect
audioEngine.stopEffect(m_nSoundId)
AudioEngine.stopEffect(m_nSoundId)
elseif nIdx == 9 then
-- unload effect
audioEngine.unloadEffect(EFFECT_FILE)
AudioEngine.unloadEffect(EFFECT_FILE)
elseif nIdx == 10 then
-- add bakcground music volume
audioEngine.setMusicVolume(audioEngine.getMusicVolume() + 0.1)
AudioEngine.setMusicVolume(AudioEngine.getMusicVolume() + 0.1)
elseif nIdx == 11 then
-- sub backgroud music volume
audioEngine.setMusicVolume(audioEngine.getMusicVolume() - 0.1)
AudioEngine.setMusicVolume(AudioEngine.getMusicVolume() - 0.1)
elseif nIdx == 12 then
-- add effects volume
audioEngine.setEffectsVolume(audioEngine.getEffectsVolume() + 0.1)
AudioEngine.setEffectsVolume(AudioEngine.getEffectsVolume() + 0.1)
elseif nIdx == 13 then
-- sub effects volume
audioEngine.setEffectsVolume(audioEngine.getEffectsVolume() - 0.1)
AudioEngine.setEffectsVolume(AudioEngine.getEffectsVolume() - 0.1)
elseif nIdx == 14 then
audioEngine.pauseEffect(m_nSoundId)
AudioEngine.pauseEffect(m_nSoundId)
elseif nIdx == 15 then
audioEngine.resumeEffect(m_nSoundId)
AudioEngine.resumeEffect(m_nSoundId)
elseif nIdx == 16 then
audioEngine.pauseAllEffects()
AudioEngine.pauseAllEffects()
elseif nIdx == 17 then
audioEngine.resumeAllEffects()
AudioEngine.resumeAllEffects()
elseif nIdx == 18 then
audioEngine.stopAllEffects()
AudioEngine.stopAllEffects()
end
end
-- add menu items for tests

View File

@ -1 +1 @@
54465b466d8d1517df1d0297972fe6c29e4bdb1c
9d61a5b14ae04510a9e3158ad944e3aea5ec334f

View File

@ -1,5 +1,5 @@
--Encapsulate SimpleAudioEngine to audioEngine,Play music and sound effects.
audioEngine = audioEngine or {}
--Encapsulate SimpleAudioEngine to AudioEngine,Play music and sound effects.
AudioEngine = AudioEngine or {}
local sharedEngine = SimpleAudioEngine:sharedEngine()
@ -100,26 +100,26 @@ local function resumeEffect(handle)
end
audioEngine.stopAllEffects = stopAllEffects
audioEngine.getMusicVolume = getMusicVolume
audioEngine.isMusicPlaying = isMusicPlaying
audioEngine.getEffectsVolume = getEffectsVolume
audioEngine.setMusicVolume = setMusicVolume
audioEngine.stopEffect = stopEffect
audioEngine.stopMusic = stopMusic
audioEngine.playMusic = playMusic
audioEngine.pauseAllEffects = pauseAllEffects
audioEngine.preloadMusic = preloadMusic
audioEngine.resumeMusic = resumeMusic
audioEngine.playEffect = playEffect
audioEngine.rewindMusic = rewindMusic
audioEngine.willPlayMusic = willPlayMusic
audioEngine.unloadEffect = unloadEffect
audioEngine.preloadEffect = preloadEffect
audioEngine.setEffectsVolume = setEffectsVolume
audioEngine.pauseEffect = pauseEffect
audioEngine.resumeAllEffects = resumeAllEffects
audioEngine.pauseMusic = pauseMusic
audioEngine.resumeEffect = resumeEffect
AudioEngine.stopAllEffects = stopAllEffects
AudioEngine.getMusicVolume = getMusicVolume
AudioEngine.isMusicPlaying = isMusicPlaying
AudioEngine.getEffectsVolume = getEffectsVolume
AudioEngine.setMusicVolume = setMusicVolume
AudioEngine.stopEffect = stopEffect
AudioEngine.stopMusic = stopMusic
AudioEngine.playMusic = playMusic
AudioEngine.pauseAllEffects = pauseAllEffects
AudioEngine.preloadMusic = preloadMusic
AudioEngine.resumeMusic = resumeMusic
AudioEngine.playEffect = playEffect
AudioEngine.rewindMusic = rewindMusic
AudioEngine.willPlayMusic = willPlayMusic
AudioEngine.unloadEffect = unloadEffect
AudioEngine.preloadEffect = preloadEffect
AudioEngine.setEffectsVolume = setEffectsVolume
AudioEngine.pauseEffect = pauseEffect
AudioEngine.resumeAllEffects = resumeAllEffects
AudioEngine.pauseMusic = pauseMusic
AudioEngine.resumeEffect = resumeEffect