From 37eab63fcd4155e0262625c2c95503846cd9cb2c Mon Sep 17 00:00:00 2001 From: Raynaldo Rivera Date: Tue, 2 Sep 2014 09:38:39 -0700 Subject: [PATCH] Removed unneeded macros in the examples --- Examples/Tutorial1_2DSound/src/main.cpp | 24 +------------------ Examples/Tutorial2_3DSound/src/main.cpp | 15 ------------ .../Tutorial3_MemoryPlayback/src/main.cpp | 8 ------- Examples/Tutorial4_AudioCapture/src/main.cpp | 7 ------ Examples/Tutorial5_AudioEffects/src/main.cpp | 15 +----------- .../Tutorial6_CustomEventHandler/src/main.cpp | 16 ++----------- .../Tutorial7_CustomLogReceiver/src/main.cpp | 16 ++----------- 7 files changed, 6 insertions(+), 95 deletions(-) diff --git a/Examples/Tutorial1_2DSound/src/main.cpp b/Examples/Tutorial1_2DSound/src/main.cpp index 638d6d8..485c5d5 100644 --- a/Examples/Tutorial1_2DSound/src/main.cpp +++ b/Examples/Tutorial1_2DSound/src/main.cpp @@ -8,13 +8,6 @@ //Include cAudio.h so we can work wtih cAudio #include "cAudio.h" -#if defined(CAUDIO_COMILER_MINGW) -// do nothing -#elif defined(CAUDIO_PLATFORM_WIN) -# define AUDIO_FILE(_soundName_) CAUDIO_MEDIA_ROOT##_soundName_ -#else -# define AUDIO_FILE(_soundName_) CAUDIO_MEDIA_ROOT#_soundName_ -#endif using namespace std; @@ -52,26 +45,11 @@ int main(int argc, char* argv[]) { pDeviceList = 0; //Create a IAudio object and load a sound from a file - -#if defined(CAUDIO_COMPILER_MINGW) - cAudio::IAudioSource* mysound = audioMgr->create("bling", "../Media/cAudioTheme1.ogg",true); -#elif defined(CAUDIO_PLATFORM_WIN) - cAudio::IAudioSource* mysound = audioMgr->create("bling", AUDIO_FILE("cAudioTheme1.ogg"),true); -#else - cAudio::IAudioSource* mysound = audioMgr->create("bling", AUDIO_FILE(cAudioTheme1.ogg),true); -#endif + cAudio::IAudioSource* mysound = audioMgr->create("song", "../Media/cAudioTheme1.ogg",true); for (size_t i=0; i<10; i++) { - -#if defined(CAUDIO_COMPILER_MINGW) audioMgr->play2D("../Media/bling.ogg"); - -#elif defined(CAUDIO_PLATFORM_WIN) - audioMgr->play2D(AUDIO_FILE("bling.ogg")); -#else - audioMgr->play2D(AUDIO_FILE(bling.ogg)); -#endif } if(mysound) diff --git a/Examples/Tutorial2_3DSound/src/main.cpp b/Examples/Tutorial2_3DSound/src/main.cpp index d697db4..a3e77a1 100644 --- a/Examples/Tutorial2_3DSound/src/main.cpp +++ b/Examples/Tutorial2_3DSound/src/main.cpp @@ -9,14 +9,6 @@ //Include cAudio.h so we can work wtih cAudio #include "cAudio.h" -#if defined(CAUDIO_COMILER_MINGW) -// do nothing -#elif defined(CAUDIO_PLATFORM_WIN) -# define AUDIO_FILE(_soundName_) CAUDIO_MEDIA_ROOT##_soundName_ -#else -# define AUDIO_FILE(_soundName_) CAUDIO_MEDIA_ROOT#_soundName_ -#endif - using namespace std; @@ -61,14 +53,7 @@ int main(int argc, char* argv[]) cAudio::IListener* listener = audioMgr->getListener(); //Create a IAudio object and load a sound from a file - -#if defined(CAUDIO_COMPILER_MINGW) cAudio::IAudioSource* mysound = audioMgr->create("bling", "../Media/bling.ogg",true); -#elif defined(CAUDIO_PLATFORM_WIN) - cAudio::IAudioSource* mysound = audioMgr->create("bling", AUDIO_FILE("bling.ogg"),true); -#else - cAudio::IAudioSource* mysound = audioMgr->create("bling", AUDIO_FILE(bling.ogg),true); -#endif //Set the IAudio Sound to play3d and loop //play3d takes 4 arguments play3d(toloop,x,y,z,strength) diff --git a/Examples/Tutorial3_MemoryPlayback/src/main.cpp b/Examples/Tutorial3_MemoryPlayback/src/main.cpp index f6b096c..c61990a 100644 --- a/Examples/Tutorial3_MemoryPlayback/src/main.cpp +++ b/Examples/Tutorial3_MemoryPlayback/src/main.cpp @@ -9,14 +9,6 @@ //Include cAudio.h so we can work wtih cAudio #include "cAudio.h" -#if defined(CAUDIO_COMILER_MINGW) -// do nothing -#elif defined(CAUDIO_PLATFORM_WIN) -# define AUDIO_FILE(_soundName_) CAUDIO_MEDIA_ROOT##_soundName_ -#else -# define AUDIO_FILE(_soundName_) CAUDIO_MEDIA_ROOT#_soundName_ -#endif -//Our Bling sound #include "bling.h" using namespace std; diff --git a/Examples/Tutorial4_AudioCapture/src/main.cpp b/Examples/Tutorial4_AudioCapture/src/main.cpp index c35794e..44a9b66 100644 --- a/Examples/Tutorial4_AudioCapture/src/main.cpp +++ b/Examples/Tutorial4_AudioCapture/src/main.cpp @@ -7,13 +7,6 @@ #include //Include cAudio.h so we can work wtih cAudio #include "cAudio.h" -#if defined(CAUDIO_COMILER_MINGW) -// do nothing -#elif defined(CAUDIO_PLATFORM_WIN) -# define AUDIO_FILE(_soundName_) CAUDIO_MEDIA_ROOT##_soundName_ -#else -# define AUDIO_FILE(_soundName_) CAUDIO_MEDIA_ROOT#_soundName_ -#endif using namespace std; diff --git a/Examples/Tutorial5_AudioEffects/src/main.cpp b/Examples/Tutorial5_AudioEffects/src/main.cpp index fdd2f0c..18dbc64 100644 --- a/Examples/Tutorial5_AudioEffects/src/main.cpp +++ b/Examples/Tutorial5_AudioEffects/src/main.cpp @@ -8,13 +8,6 @@ ///Include cAudio.h so we can work wtih cAudio #include "cAudio.h" -#if defined(CAUDIO_COMILER_MINGW) -// do nothing -#elif defined(CAUDIO_PLATFORM_WIN) -# define AUDIO_FILE(_soundName_) CAUDIO_MEDIA_ROOT##_soundName_ -#else -# define AUDIO_FILE(_soundName_) CAUDIO_MEDIA_ROOT#_soundName_ -#endif using namespace std; @@ -65,13 +58,7 @@ int main(int argc, char* argv[]) filter->setLowFrequencyVolume(0.1f); //Create a IAudio object and load a sound from a file -#if defined(CAUDIO_COMPILER_MINGW) - cAudio::IAudioSource* mysound = audioMgr->create("bling", "../Media/Footsteps.wav",true); -#elif defined(CAUDIO_PLATFORM_WIN) - cAudio::IAudioSource* mysound = audioMgr->create("bling", AUDIO_FILE("Footsteps.wav"),true); -#else - cAudio::IAudioSource* mysound = audioMgr->create("bling", AUDIO_FILE(Footsteps.wav),true); -#endif + cAudio::IAudioSource* mysound = audioMgr->create("footsteps", "../Media/Footsteps.wav",true); if(mysound) { diff --git a/Examples/Tutorial6_CustomEventHandler/src/main.cpp b/Examples/Tutorial6_CustomEventHandler/src/main.cpp index 9d7a05d..dea9f6f 100644 --- a/Examples/Tutorial6_CustomEventHandler/src/main.cpp +++ b/Examples/Tutorial6_CustomEventHandler/src/main.cpp @@ -8,13 +8,6 @@ //Include cAudio.h so we can work wtih cAudio #include "cAudio.h" -#if defined(CAUDIO_COMILER_MINGW) -// do nothing -#elif defined(CAUDIO_PLATFORM_WIN) -# define AUDIO_FILE(_soundName_) CAUDIO_MEDIA_ROOT##_soundName_ -#else -# define AUDIO_FILE(_soundName_) CAUDIO_MEDIA_ROOT#_soundName_ -#endif //Include the custom handler #include "cTestHandler.h" @@ -58,13 +51,8 @@ int main(int argc, char* argv[]) pDeviceList = 0; //Create a IAudio object and load a sound from a file -#if defined(CAUDIO_COMPILER_MINGW) - cAudio::IAudioSource* mysound = audioMgr->create("bling", "../Media/cAudioTheme1.ogg",true); -#elif defined(CAUDIO_PLATFORM_WIN) - cAudio::IAudioSource* mysound = audioMgr->create("bling", AUDIO_FILE("cAudioTheme1.ogg"),true); -#else - cAudio::IAudioSource* mysound = audioMgr->create("bling", AUDIO_FILE(cAudioTheme1.ogg),true); -#endif + cAudio::IAudioSource* mysound = audioMgr->create("song", "../Media/cAudioTheme1.ogg",true); + mysound->registerEventHandler(handle); if(mysound) diff --git a/Examples/Tutorial7_CustomLogReceiver/src/main.cpp b/Examples/Tutorial7_CustomLogReceiver/src/main.cpp index f512abc..98916fc 100644 --- a/Examples/Tutorial7_CustomLogReceiver/src/main.cpp +++ b/Examples/Tutorial7_CustomLogReceiver/src/main.cpp @@ -8,13 +8,6 @@ //Include cAudio.h so we can work wtih cAudio #include "cAudio.h" -#if defined(CAUDIO_COMILER_MINGW) -// do nothing -#elif defined(CAUDIO_PLATFORM_WIN) -# define AUDIO_FILE(_soundName_) CAUDIO_MEDIA_ROOT##_soundName_ -#else -# define AUDIO_FILE(_soundName_) CAUDIO_MEDIA_ROOT#_soundName_ -#endif //Include the new log receiver #include "cTestLogReceiver.h" @@ -65,13 +58,8 @@ int main(int argc, char* argv[]) pDeviceList = 0; //Create a IAudio object and load a sound from a file -#if defined(CAUDIO_COMPILER_MINGW) - cAudio::IAudioSource* mysound = audioMgr->create("bling", "../Media/cAudioTheme1.ogg",true); -#elif defined(CAUDIO_PLATFORM_WIN) - cAudio::IAudioSource* mysound = audioMgr->create("bling", AUDIO_FILE("cAudioTheme1.ogg"),true); -#else - cAudio::IAudioSource* mysound = audioMgr->create("bling", AUDIO_FILE(cAudioTheme1.ogg),true); -#endif + cAudio::IAudioSource* mysound = audioMgr->create("song", "../Media/cAudioTheme1.ogg",true); + if(mysound) { mysound->setVolume(0.5);