From 836bfe1d3f6ad0b946db5b6363e417b4e27d030f Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Sat, 8 Jun 2013 14:06:19 +0800 Subject: [PATCH] issue #2103 modify audioEngine table name to AudioEngine --- .../CocosDenshionTest/CocosDenshionTest.lua | 40 ++++++++-------- .../project.pbxproj.REMOVED.git-id | 2 +- .../{audioEngine.lua => AudioEngine.lua} | 46 +++++++++---------- 3 files changed, 44 insertions(+), 44 deletions(-) rename scripting/lua/script/{audioEngine.lua => AudioEngine.lua} (68%) diff --git a/samples/Lua/TestLua/Resources/luaScript/CocosDenshionTest/CocosDenshionTest.lua b/samples/Lua/TestLua/Resources/luaScript/CocosDenshionTest/CocosDenshionTest.lua index 488b9a6037..15ca73998a 100644 --- a/samples/Lua/TestLua/Resources/luaScript/CocosDenshionTest/CocosDenshionTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/CocosDenshionTest/CocosDenshionTest.lua @@ -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 diff --git a/samples/Lua/TestLua/proj.ios/TestLua.xcodeproj/project.pbxproj.REMOVED.git-id b/samples/Lua/TestLua/proj.ios/TestLua.xcodeproj/project.pbxproj.REMOVED.git-id index c5957cdc32..02bb92acff 100644 --- a/samples/Lua/TestLua/proj.ios/TestLua.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/samples/Lua/TestLua/proj.ios/TestLua.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -54465b466d8d1517df1d0297972fe6c29e4bdb1c \ No newline at end of file +9d61a5b14ae04510a9e3158ad944e3aea5ec334f \ No newline at end of file diff --git a/scripting/lua/script/audioEngine.lua b/scripting/lua/script/AudioEngine.lua similarity index 68% rename from scripting/lua/script/audioEngine.lua rename to scripting/lua/script/AudioEngine.lua index 080be53667..cb45f14593 100644 --- a/scripting/lua/script/audioEngine.lua +++ b/scripting/lua/script/AudioEngine.lua @@ -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