debug of TestAudioEngine project
This commit is contained in:
natural-law 2010-11-12 03:51:17 +00:00
parent 70421ccc84
commit 7ec770844b
13 changed files with 73 additions and 1110 deletions

View File

@ -14,8 +14,8 @@ include $(TO_PROJECT_ROOT)/MakeInclude/Makefile_TOPS_Def.ARM
DEFINES += -DUNDER_UPHONE
INCLUDE_PATH += -I. -I./Res \
-I../CocosDenshion
LIBS += -lCocosDenshion
-I../CocosDenshion/include
LIBS += -lCocosDenshion -lTSoundPlayer
OBJECTS_DIR = ./Debug-ARM
DESTDIR = $(TO_PROJECT_ROOT)/$(BIN_OUTPUT_DIR)

View File

@ -1,9 +1,9 @@
// Original file name: TestAudioEngine_Res.ENU.tr3
// Generated by TOPS Builder 1.2.3.235 Date:2010-9-29
// Generated by TOPS Builder 1.2.3.239 Date:2010-11-2
//$VERSION 60004
//$VERSION 60005
//$SETTINGS
//$Begin
//$VCPRJFILE=$002E$002E$005C$0054$0065$0073$0074$0041$0075$0064$0069$006F$0045$006E$0067$0069$006E$0065$002E$0076$0063$0070$0072$006F$006A
@ -28,6 +28,8 @@ FORM ID Form1002 AT(0,0,320,480)
FRAME
NOSAVEBEHIND
BIClose
DisableSystemStatusBar
FullScreen
VISIBLED
ENABLED
CHARSET 0
@ -149,5 +151,14 @@ BEGIN
END
// raw data
RAWDATA ID background FileName $0073$006F$0075$006E$0064$0073$005C$0062$0061$0063$006B$0067$0072$006F$0075$006E$0064$002E$006D$0070$0033
//sounds\background.mp3
RAWDATA ID Effect1 FileName $0073$006F$0075$006E$0064$0073$005C$0045$0066$0066$0065$0063$0074$0031$002E$0077$0061$0076
//sounds\Effect1.wav
RAWDATA ID Effect2 FileName $0073$006F$0075$006E$0064$0073$005C$0045$0066$0066$0065$0063$0074$0032$002E$0077$0061$0076
//sounds\Effect2.wav
// Application

View File

@ -4,6 +4,6 @@
// update the controls' trnaslation status.
// Original file name: TestAudioEngine_Res.ENU.tr3.tts
// Generated by TOPS Builder 1.2.3.235 Date:2010-9-29
// Generated by TOPS Builder 1.2.3.239 Date:2010-11-2

View File

@ -1,11 +1,11 @@
// Original file name: TestAudioEngine_Res.TR3
// Generated by TOPS Builder 1.2.3.235 Date:2010-9-29
// Generated by TOPS Builder 1.2.3.239 Date:2010-11-2
#include "TestAudioEngine_Res.h"
//$VERSION 60004
//$VERSION 60005
//$SETTINGS
//$Begin
//$VCPRJFILE=$002E$002E$005C$0054$0065$0073$0074$0041$0075$0064$0069$006F$0045$006E$0067$0069$006E$0065$002E$0076$0063$0070$0072$006F$006A
@ -30,6 +30,7 @@ FORM ID Form1002 AT(0,0,320,480)
FRAME
NOSAVEBEHIND
BIClose
DisableSystemStatusBar
FullScreen
VISIBLED
ENABLED
@ -152,5 +153,14 @@ BEGIN
END
// raw data
RAWDATA ID background FileName $0073$006F$0075$006E$0064$0073$005C$0062$0061$0063$006B$0067$0072$006F$0075$006E$0064$002E$006D$0070$0033
//sounds\background.mp3
RAWDATA ID Effect1 FileName $0073$006F$0075$006E$0064$0073$005C$0045$0066$0066$0065$0063$0074$0031$002E$0077$0061$0076
//sounds\Effect1.wav
RAWDATA ID Effect2 FileName $0073$006F$0075$006E$0064$0073$005C$0045$0066$0066$0065$0063$0074$0032$002E$0077$0061$0076
//sounds\Effect2.wav
// Application

View File

@ -1,5 +1,5 @@
// Original file name: TestAudioEngine_Res.h
// Generated by TOPS Builder 1.2.3.235 Date:2010-9-29
// Generated by TOPS Builder 1.2.3.239 Date:2010-11-2
#define ResFolder1001 1001
#define Form1002 1002
@ -9,3 +9,6 @@
#define PlayLoaded 1006
#define PlayEffect 1007
#define UnLoadBtn 1008
#define background 1009
#define Effect1 1010
#define Effect2 1011

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
8070ff84e97308e15b7e3ee69f9fc915d60c02cb

View File

@ -7,7 +7,7 @@
//
//---┤编译器信息├---
// 编译器名称: TR3C.exe
// 编译器版本: TG3 资源编译器 版本V1.5 Build 91
// 编译器版本: TG3 资源编译器 版本V1.5 Build 92
//
//---┤注意├---
// 警告:未经允许,任何人不准擅自修改此文件!!!否则后果自负!
@ -30,4 +30,7 @@
#define TESTAU_ID_Form1002_UnLoadBtn 1073742832/*"UnLoadEffect"*/
#define TESTAU_ID_RAWDATA_background 1073742833
#define TESTAU_ID_RAWDATA_Effect1 1073742834
#define TESTAU_ID_RAWDATA_Effect2 1073742835
#endif

View File

@ -7,7 +7,7 @@
//
//---┤编译器信息├---
// 编译器名称: TR3C.exe
// 编译器版本: TG3 资源编译器 版本V1.5 Build 91
// 编译器版本: TG3 资源编译器 版本V1.5 Build 92
//
//---┤注意├---
// 警告:未经允许,任何人不准擅自修改此文件!!!否则后果自负!

View File

@ -96,7 +96,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="mkdir d:\Work7\NEWPLUS\TDA_DATA\UserData&#x0D;&#x0A;mkdir d:\Work7\NEWPLUS\TDA_DATA\UserData&#x0D;&#x0A;copy .\Res\sounds\background.mp3 D:\Work7\NEWPLUS\TDA_DATA\UserData&#x0D;&#x0A;copy .\Res\sounds\Effect1.mp3 D:\Work7\NEWPLUS\TDA_DATA\UserData&#x0D;&#x0A;copy .\Res\sounds\Effect2.mp3 D:\Work7\NEWPLUS\TDA_DATA\UserData&#x0D;&#x0A;"
CommandLine=""
/>
</Configuration>
<Configuration
@ -220,6 +220,18 @@
<Filter
Name="Res"
>
<File
RelativePath=".\Res\sounds\background.mp3"
>
</File>
<File
RelativePath=".\Res\sounds\Effect1.wav"
>
</File>
<File
RelativePath=".\Res\sounds\Effect2.wav"
>
</File>
<File
RelativePath=".\Res\TestAudioEngine_Res.ENU.tr3"
>

View File

@ -14,7 +14,7 @@ const ResourceRegisterEntry ResRegList_TestAudioEngine[] =
TG_RESOURCE_DEFINE
};
const AppResourceEntry TestAudioEngineResourceEntry =
extern const AppResourceEntry TestAudioEngineResourceEntry =
{
(ResourceRegisterEntry*)ResRegList_TestAudioEngine, // res list in this app
sizeof(ResRegList_TestAudioEngine) / sizeof(ResourceRegisterEntry), //number of item in res

View File

@ -11,9 +11,18 @@
#include "SimpleAudioEngine.h"
#include <cassert>
const static char s_BackgroundFile[] = "/NEWPLUS/TDA_DATA/UserData/background.mp3";
const static char s_Effect1File[] = "/NEWPLUS/TDA_DATA/UserData/Effect1.mp3";
const static char s_Effect2File[] = "/NEWPLUS/TDA_DATA/UserData/Effect2.mp3";
extern const AppResourceEntry TestAudioEngineResourceEntry;
/**
@warning FileName必须包含文件的扩展名
wav
*/
const T_SoundResInfo SoundResInfo[] =
{
{ "background.mp3", TESTAU_ID_RAWDATA_background },
{ "Effect1.wav", TESTAU_ID_RAWDATA_Effect1 },
{ "Effect2.wav", TESTAU_ID_RAWDATA_Effect2 },
};
TMainForm::TMainForm(TApplication * pApp):TWindow(pApp)
, m_nEffect1ID(0)
@ -35,6 +44,8 @@ Boolean TMainForm::EventHandler(TApplication * pApp, EventType * pEvent)
{
case EVENT_WinInit:
{
SimpleAudioEngine::getSharedEngine()->setResourceEntry(&TestAudioEngineResourceEntry);
SimpleAudioEngine::getSharedEngine()->setSoundResInfo(SoundResInfo, sizeof(SoundResInfo) / sizeof(T_SoundResInfo));
bHandled = TRUE;
}
break;
@ -79,8 +90,8 @@ Boolean TMainForm::CtrlSelected(TApplication * pApp, EventType * pEvent)
{
case TESTAU_ID_Form1002_PlayBack:
// play background music
pAudioEngine->playBackgroundMusic(s_BackgroundFile, true);
pAudioEngine->SetBackgroundMusicVolume(30);
pAudioEngine->playBackgroundMusic(SoundResInfo[0].FileName, true);
bHandled = TRUE;
break;
@ -92,7 +103,7 @@ Boolean TMainForm::CtrlSelected(TApplication * pApp, EventType * pEvent)
case TESTAU_ID_Form1002_LoadEffect:
// load effect1
m_nEffect1ID = pAudioEngine->preloadEffect(s_Effect1File);
m_nEffect1ID = pAudioEngine->preloadEffect(SoundResInfo[1].FileName);
assert(m_nEffect1ID > 0);
bHandled = TRUE;
break;
@ -112,17 +123,16 @@ Boolean TMainForm::CtrlSelected(TApplication * pApp, EventType * pEvent)
}
else
{
pAudioEngine->playPreloadedEffect(m_nEffect1ID);
pAudioEngine->SetEffectsVolume(30);
pAudioEngine->playPreloadedEffect(m_nEffect1ID);
}
bHandled = TRUE;
break;
case TESTAU_ID_Form1002_PlayEffect:
// play effect2
m_nEffect2ID = pAudioEngine->playEffect(s_Effect2File);
assert(m_nEffect2ID > 0);
pAudioEngine->SetEffectsVolume(30);
m_nEffect2ID = pAudioEngine->playEffect(SoundResInfo[2].FileName);
assert(m_nEffect2ID > 0);
bHandled = TRUE;
break;
default:

View File

@ -34,10 +34,10 @@ DEFINES=-DUNDER_UPHONE ;
;DEFINES=-D__TCOM_SUPPORT__ ;生成的是TCOM组件注意TOPS应用也可以同时是TCOM组件
;包含路径可以使用多个INCLUDE_PATH串也可以使用INCLUDE_PATH1、INCLUDE_PATH2等方式MakeFile中依据出现顺序(不是数字大小)排列
INCLUDE_PATH=-I../CocosDenshion ;应用额外的包含路径。注意ITOPS自己的所有路径都会自动包含故此这里仅仅包含应用自己特有的路径即可
INCLUDE_PATH=-I../CocosDenshion/include ;应用额外的包含路径。注意ITOPS自己的所有路径都会自动包含故此这里仅仅包含应用自己特有的路径即可
;连接的库文件可以使用多个LIBS串也可以使用LIBS1、LIBS2等方式MakeFile中依据出现顺序(不是数字大小)排列
LIBS=-lCocosDenshion ;应用额外的连接库。注意ITOPS自己的所需库自动包含而且库包含路径也已经包含故此这里仅仅包含应用自己特有的库的名字即可
LIBS=-lCocosDenshion -lTSoundPlayer ;应用额外的连接库。注意ITOPS自己的所需库自动包含而且库包含路径也已经包含故此这里仅仅包含应用自己特有的库的名字即可
;强制包含文件的名字,不能使用通配符,一定要使用相对或者绝对路径
;极力要求使用相对路径,多个文件之间使用“|”分隔