mirror of https://github.com/axmolengine/axmol.git
parent
70421ccc84
commit
7ec770844b
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
@ -0,0 +1 @@
|
|||
8070ff84e97308e15b7e3ee69f9fc915d60c02cb
|
|
@ -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
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
//
|
||||
//---┤编译器信息├---
|
||||
// 编译器名称: TR3C.exe
|
||||
// 编译器版本: TG3 资源编译器 版本V1.5 Build 91
|
||||
// 编译器版本: TG3 资源编译器 版本V1.5 Build 92
|
||||
//
|
||||
//---┤注意├---
|
||||
// 警告:未经允许,任何人不准擅自修改此文件!!!否则后果自负!
|
||||
|
|
|
@ -96,7 +96,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="mkdir d:\Work7\NEWPLUS\TDA_DATA\UserData
mkdir d:\Work7\NEWPLUS\TDA_DATA\UserData
copy .\Res\sounds\background.mp3 D:\Work7\NEWPLUS\TDA_DATA\UserData
copy .\Res\sounds\Effect1.mp3 D:\Work7\NEWPLUS\TDA_DATA\UserData
copy .\Res\sounds\Effect2.mp3 D:\Work7\NEWPLUS\TDA_DATA\UserData
"
|
||||
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"
|
||||
>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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自己的所需库自动包含,而且库包含路径也已经包含,故此这里仅仅包含应用自己特有的库的名字即可
|
||||
|
||||
;强制包含文件的名字,不能使用通配符,一定要使用相对或者绝对路径
|
||||
;极力要求使用相对路径,多个文件之间使用“|”分隔
|
||||
|
|
Loading…
Reference in New Issue