diff --git a/CocosDenshion/third_party/fmod/documentation/FMOD Event System - Best Practices For Programmers.pdf.REMOVED.git-id b/CocosDenshion/third_party/fmod/documentation/FMOD Event System - Best Practices For Programmers.pdf.REMOVED.git-id deleted file mode 100644 index 42232caeda..0000000000 --- a/CocosDenshion/third_party/fmod/documentation/FMOD Event System - Best Practices For Programmers.pdf.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -fe25757fdb0cc2e48002bf130522902794158965 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/documentation/Getting started with FMOD for Linux.pdf.REMOVED.git-id b/CocosDenshion/third_party/fmod/documentation/Getting started with FMOD for Linux.pdf.REMOVED.git-id deleted file mode 100644 index 5b79271982..0000000000 --- a/CocosDenshion/third_party/fmod/documentation/Getting started with FMOD for Linux.pdf.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -2b6d571d132326e599c4790cc0a24aaaa940f721 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/documentation/LICENSE.TXT b/CocosDenshion/third_party/fmod/documentation/LICENSE.TXT deleted file mode 100644 index c5656560bd..0000000000 --- a/CocosDenshion/third_party/fmod/documentation/LICENSE.TXT +++ /dev/null @@ -1,85 +0,0 @@ -FMOD Ex SoundSystem Copyright © 2005-2011 Firelight Technologies Pty, Ltd. - -FMOD NON-COMMERCIAL LICENSE ------------------------------------- -IF YOUR PRODUCT IS NOT INTENDED FOR COMMERCIAL GAIN AND DOES NOT -INCLUDE THE FMOD LIBRARY FOR RESALE, LICENSE OR OTHER COMMERCIAL -DISTRIBUTION, THEN USE OF FMOD IS FREE OF CHARGE. THERE ARE NO -LICENSE FEES FOR NON-COMMERCIAL APPLICATIONS. - -CONDITIONS/LIMITATIONS: -- WHEN USING THIS LICENSE, THE FMOD LIBRARY CANNOT BE USED FOR - RESALE OR OTHER COMMERCIAL DISTRIBUTION -- THIS LICENSE CANNOT BE USED FOR PRODUCTS WHICH DO NOT MAKE - PROFIT BUT ARE STILL COMMERCIALLY RELEASED -- THIS LICENSE CANNOT BE USED FOR COMMERCIAL SERVICES, WHERE THE - EXECUTABLE CONTAINING FMOD IS NOT SOLD, BUT THE DATA IS. -- WHEN USING FMOD, A CREDIT LINE IS REQUIRED IN EITHER DOCUMENTATION, - OR 'ON SCREEN' FORMAT (IF POSSIBLE). IT SHOULD CONTAIN AT LEAST - THE WORDS FMOD SOUND SYSTEM AND FIRELIGHT TECHNOLOGIES. - LOGOS ARE AVAILABLE FOR BOX OR MANUAL ART, BUT ARE NOT MANDANTORY. - AN EXAMPLE CREDIT COULD BE: - - FMOD Sound System, copyright © Firelight Technologies Pty, Ltd., 1994-2011. - - NOTE THIS IN ADVANCE, AS IT MUST BE DONE BEFORE SHIPPING YOUR - PRODUCT WITH FMOD. - -Uses Ogg Vorbis codec. BSD license. ------------------------------------- -Copyright (c) 2002, Xiph.org Foundation - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -- Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - -- Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -- Neither the name of the Xiph.org Foundation nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION -OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -For Android platform code. --------------------------- -Copyright (C) 2010 The Android Open Source Project -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. diff --git a/CocosDenshion/third_party/fmod/documentation/fmod-profiler.pdf.REMOVED.git-id b/CocosDenshion/third_party/fmod/documentation/fmod-profiler.pdf.REMOVED.git-id deleted file mode 100644 index bbd9ca9f63..0000000000 --- a/CocosDenshion/third_party/fmod/documentation/fmod-profiler.pdf.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -fe3d4e47687a4bc181a1b3e1d71459b13f8d1ebc \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/documentation/fmodex.chm.REMOVED.git-id b/CocosDenshion/third_party/fmod/documentation/fmodex.chm.REMOVED.git-id deleted file mode 100644 index 2cee46a70a..0000000000 --- a/CocosDenshion/third_party/fmod/documentation/fmodex.chm.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -ea6ff436eda933873fe871fb22523eebdfcccbca \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/documentation/revision.txt.REMOVED.git-id b/CocosDenshion/third_party/fmod/documentation/revision.txt.REMOVED.git-id deleted file mode 100644 index cc8215e791..0000000000 --- a/CocosDenshion/third_party/fmod/documentation/revision.txt.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -2e5bd5bfc4d59acfe03fe0d7fd67187dd7281171 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/examples/3d/Makefile b/CocosDenshion/third_party/fmod/examples/3d/Makefile deleted file mode 100644 index c076990692..0000000000 --- a/CocosDenshion/third_party/fmod/examples/3d/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -3d_cpp: main.cpp - g++ -O3 -o 3d main.cpp ../../api/lib/libfmodex.so -pthread - -3d_c: main.c - g++ -O3 -o 3d main.c ../../api/lib/libfmodex.so -pthread - -run: - ./3d - -clean: - rm -f 3d diff --git a/CocosDenshion/third_party/fmod/examples/3d/main.c b/CocosDenshion/third_party/fmod/examples/3d/main.c deleted file mode 100644 index ec0687e721..0000000000 --- a/CocosDenshion/third_party/fmod/examples/3d/main.c +++ /dev/null @@ -1,254 +0,0 @@ -/*=============================================================================================== - 3d Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to basic 3d positioning -===============================================================================================*/ -#include "../../api/inc/fmod.h" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include -#include - - -const int INTERFACE_UPDATETIME = 50; // 50ms update for interface - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD_SYSTEM *system; - FMOD_SOUND *sound1, *sound2, *sound3; - FMOD_CHANNEL *channel1 = 0, *channel2 = 0, *channel3 = 0; - FMOD_RESULT result; - int key; - int listenerflag = TRUE; - FMOD_VECTOR listenerpos = { 0.0f, 0.0f, 0.0f }; - unsigned int version; - - printf("===============================================================\n"); - printf("3d Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("===============================================================\n"); - printf("This example plays 2 3D sounds in software. Optionally you can\n"); - printf("play a 2D software sound as well.\n"); - printf("Hardware sounds are not supported on Linux\n"); - printf("===============================================================\n\n"); - - /* - Create a System object and initialize. - */ - result = FMOD_System_Create(&system); - ERRCHECK(result); - - result = FMOD_System_GetVersion(system, &version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - getch(); - return 0; - } - - result = FMOD_System_Init(system, 10, FMOD_INIT_NORMAL, NULL); - ERRCHECK(result); - - /* - Load some sounds - */ - result = FMOD_System_CreateSound(system, "../media/drumloop.wav", FMOD_SOFTWARE | FMOD_3D, 0, &sound1); - ERRCHECK(result); - result = FMOD_Sound_Set3DMinMaxDistance(sound1, 4.0f, 10000.0f); - ERRCHECK(result); - result = FMOD_Sound_SetMode(sound1, FMOD_LOOP_NORMAL); - ERRCHECK(result); - - result = FMOD_System_CreateSound(system, "../media/jaguar.wav", FMOD_SOFTWARE | FMOD_3D, 0, &sound2); - ERRCHECK(result); - result = FMOD_Sound_Set3DMinMaxDistance(sound2, 4.0f, 10000.0f); - ERRCHECK(result); - result = FMOD_Sound_SetMode(sound2, FMOD_LOOP_NORMAL); - ERRCHECK(result); - - result = FMOD_System_CreateSound(system, "../media/swish.wav", FMOD_SOFTWARE | FMOD_2D, 0, &sound3); - ERRCHECK(result); - - /* - Play sounds at certain positions - */ - { - FMOD_VECTOR pos = { -10.0f, -0.0f, 0.0f }; - FMOD_VECTOR vel = { 0.0f, 0.0f, 0.0f }; - - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound1, TRUE, &channel1); - ERRCHECK(result); - result = FMOD_Channel_Set3DAttributes(channel1, &pos, &vel); - ERRCHECK(result); - result = FMOD_Channel_SetPaused(channel1, FALSE); - ERRCHECK(result); - } - - { - FMOD_VECTOR pos = { 15.0f, -0.0f, -0.0f }; - FMOD_VECTOR vel = { 0.0f, 0.0f, 0.0f }; - - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound2, TRUE, &channel2); - ERRCHECK(result); - result = FMOD_Channel_Set3DAttributes(channel2, &pos, &vel); - ERRCHECK(result); - result = FMOD_Channel_SetPaused(channel2, FALSE); - ERRCHECK(result); - } - - /* - Display help - */ - { - int numchannels; - - result = FMOD_System_GetHardwareChannels(system, &numchannels); - ERRCHECK(result); - - printf("Hardware channels : %d\n", numchannels); - } - - printf("=========================================================================\n"); - printf("Press 1 Pause/Unpause 16bit 3D sound at any time\n"); - printf(" 2 Pause/Unpause 8bit 3D sound at any time\n"); - printf(" 3 Play 16bit STEREO 2D sound at any time\n"); - printf(" < Move listener left (in still mode)\n"); - printf(" > Move listener right (in still mode)\n"); - printf(" SPACE Stop/Start listener automatic movement\n"); - printf(" ESC Quit\n"); - printf("=========================================================================\n"); - - /* - Main loop - */ - do - { - if (kbhit()) - { - key = getch(); - - if (key == '1') - { - int paused; - FMOD_Channel_GetPaused(channel1, &paused); - FMOD_Channel_SetPaused(channel1, !paused); - } - - if (key == '2') - { - int paused; - FMOD_Channel_GetPaused(channel2, &paused); - FMOD_Channel_SetPaused(channel2, !paused); - } - - if (key == '3') - { - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound3, FALSE, &channel3); - ERRCHECK(result); - } - - if (key == ' ') - { - listenerflag = !listenerflag; - } - - if (!listenerflag) - { - if (key == '<') - { - listenerpos.x -= 1.0f; - if (listenerpos.x < -35) - { - listenerpos.x = -35; - } - } - if (key == '>') - { - listenerpos.x += 1.0f; - if (listenerpos.x > 30) - { - listenerpos.x = 30; - } - } - } - } - - // ========================================================================================== - // UPDATE THE LISTENER - // ========================================================================================== - { - static float t = 0; - static FMOD_VECTOR lastpos = { 0.0f, 0.0f, 0.0f }; - FMOD_VECTOR forward = { 0.0f, 0.0f, 1.0f }; - FMOD_VECTOR up = { 0.0f, 1.0f, 0.0f }; - FMOD_VECTOR vel; - - if (listenerflag) - { - listenerpos.x = ((float)sin(t * 0.05f) * 33.0f); // left right pingpong - } - - // ********* NOTE ******* READ NEXT COMMENT!!!!! - // vel = how far we moved last FRAME (m/f), then time compensate it to SECONDS (m/s). - vel.x = (listenerpos.x - lastpos.x) * (1000 / INTERFACE_UPDATETIME); - vel.y = (listenerpos.y - lastpos.y) * (1000 / INTERFACE_UPDATETIME); - vel.z = (listenerpos.z - lastpos.z) * (1000 / INTERFACE_UPDATETIME); - - // store pos for next time - lastpos = listenerpos; - - result = FMOD_System_Set3DListenerAttributes(system, 0, &listenerpos, &vel, &forward, &up); - ERRCHECK(result); - - t += (30 * (1.0f / (float)INTERFACE_UPDATETIME)); // t is just a time value .. it increments in 30m/s steps in this example - - // print out a small visual display - { - char s[80]; - - sprintf(s, "|.......................<1>......................<2>....................|"); - - s[(int)(listenerpos.x) + 35] = 'L'; - printf("%s\r", s); - fflush(stdout); - } - } - - FMOD_System_Update(system); - - Sleep(INTERFACE_UPDATETIME - 1); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = FMOD_Sound_Release(sound1); - ERRCHECK(result); - result = FMOD_Sound_Release(sound2); - ERRCHECK(result); - result = FMOD_Sound_Release(sound3); - ERRCHECK(result); - - result = FMOD_System_Close(system); - ERRCHECK(result); - result = FMOD_System_Release(system); - ERRCHECK(result); - - return 0; -} diff --git a/CocosDenshion/third_party/fmod/examples/3d/main.cpp b/CocosDenshion/third_party/fmod/examples/3d/main.cpp deleted file mode 100644 index f9066e69f2..0000000000 --- a/CocosDenshion/third_party/fmod/examples/3d/main.cpp +++ /dev/null @@ -1,255 +0,0 @@ -/*=============================================================================================== - 3d Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to basic 3d positioning -===============================================================================================*/ -#include "../../api/inc/fmod.hpp" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include -#include - - -const int INTERFACE_UPDATETIME = 50; // 50ms update for interface - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD::System *system; - FMOD::Sound *sound1, *sound2, *sound3; - FMOD::Channel *channel1 = 0, *channel2 = 0, *channel3 = 0; - FMOD_RESULT result; - int key; - bool listenerflag = true; - FMOD_VECTOR listenerpos = { 0.0f, 0.0f, 0.0f }; - unsigned int version; - - printf("===============================================================\n"); - printf("3d Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("===============================================================\n\n"); - printf("This example plays 2 3D sounds in software. Optionally you can\n"); - printf("play a 2D software sound as well.\n"); - printf("Hardware sounds are not supported on Linux\n"); - printf("===============================================================\n\n"); - - /* - Create a System object and initialize. - */ - result = FMOD::System_Create(&system); - ERRCHECK(result); - - result = system->getVersion(&version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - getch(); - return 0; - } - - result = system->init(10, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - /* - Load some sounds - */ - - result = system->createSound("../media/drumloop.wav", FMOD_SOFTWARE | FMOD_3D, 0, &sound1); - ERRCHECK(result); - result = sound1->set3DMinMaxDistance(4.0f, 10000.0f); - ERRCHECK(result); - result = sound1->setMode(FMOD_LOOP_NORMAL); - ERRCHECK(result); - - result = system->createSound("../media/jaguar.wav", FMOD_SOFTWARE | FMOD_3D, 0, &sound2); - ERRCHECK(result); - result = sound2->set3DMinMaxDistance(4.0f, 10000.0f); - ERRCHECK(result); - result = sound2->setMode(FMOD_LOOP_NORMAL); - ERRCHECK(result); - - result = system->createSound("../media/swish.wav", FMOD_SOFTWARE | FMOD_2D, 0, &sound3); - ERRCHECK(result); - - /* - Play sounds at certain positions - */ - { - FMOD_VECTOR pos = { -10.0f, -0.0f, 0.0f }; - FMOD_VECTOR vel = { 0.0f, 0.0f, 0.0f }; - - result = system->playSound(FMOD_CHANNEL_FREE, sound1, true, &channel1); - ERRCHECK(result); - result = channel1->set3DAttributes(&pos, &vel); - ERRCHECK(result); - result = channel1->setPaused(false); - ERRCHECK(result); - } - - { - FMOD_VECTOR pos = { 15.0f, -0.0f, -0.0f }; - FMOD_VECTOR vel = { 0.0f, 0.0f, 0.0f }; - - result = system->playSound(FMOD_CHANNEL_FREE, sound2, true, &channel2); - ERRCHECK(result); - result = channel2->set3DAttributes(&pos, &vel); - ERRCHECK(result); - result = channel2->setPaused(false); - ERRCHECK(result); - } - - /* - Display help - */ - { - int numchannels = 0; - - result = system->getHardwareChannels(&numchannels); - ERRCHECK(result); - - printf("Hardware channels : %d\n", numchannels); - } - - printf("=========================================================================\n"); - printf("Press 1 Pause/Unpause 16bit 3D sound at any time\n"); - printf(" 2 Pause/Unpause 8bit 3D sound at any time\n"); - printf(" 3 Play 16bit STEREO 2D sound at any time\n"); - printf(" < Move listener left (in still mode)\n"); - printf(" > Move listener right (in still mode)\n"); - printf(" SPACE Stop/Start listener automatic movement\n"); - printf(" ESC Quit\n"); - printf("=========================================================================\n"); - - /* - Main loop - */ - do - { - if (kbhit()) - { - key = getch(); - - if (key == '1') - { - bool paused; - channel1->getPaused(&paused); - channel1->setPaused(!paused); - } - - if (key == '2') - { - bool paused; - channel2->getPaused(&paused); - channel2->setPaused(!paused); - } - - if (key == '3') - { - result = system->playSound(FMOD_CHANNEL_FREE, sound3, false, &channel3); - ERRCHECK(result); - } - - if (key == ' ') - { - listenerflag = !listenerflag; - } - - if (!listenerflag) - { - if (key == '<') - { - listenerpos.x -= 1.0f; - if (listenerpos.x < -35) - { - listenerpos.x = -35; - } - } - if (key == '>') - { - listenerpos.x += 1.0f; - if (listenerpos.x > 30) - { - listenerpos.x = 30; - } - } - } - } - - // ========================================================================================== - // UPDATE THE LISTENER - // ========================================================================================== - { - static float t = 0; - static FMOD_VECTOR lastpos = { 0.0f, 0.0f, 0.0f }; - FMOD_VECTOR forward = { 0.0f, 0.0f, 1.0f }; - FMOD_VECTOR up = { 0.0f, 1.0f, 0.0f }; - FMOD_VECTOR vel; - - if (listenerflag) - { - listenerpos.x = ((float)sin(t * 0.05f) * 33.0f); // left right pingpong - } - - // ********* NOTE ******* READ NEXT COMMENT!!!!! - // vel = how far we moved last FRAME (m/f), then time compensate it to SECONDS (m/s). - vel.x = (listenerpos.x - lastpos.x) * (1000 / INTERFACE_UPDATETIME); - vel.y = (listenerpos.y - lastpos.y) * (1000 / INTERFACE_UPDATETIME); - vel.z = (listenerpos.z - lastpos.z) * (1000 / INTERFACE_UPDATETIME); - - // store pos for next time - lastpos = listenerpos; - - result = system->set3DListenerAttributes(0, &listenerpos, &vel, &forward, &up); - ERRCHECK(result); - - t += (30 * (1.0f / (float)INTERFACE_UPDATETIME)); // t is just a time value .. it increments in 30m/s steps in this example - - // print out a small visual display - { - char s[80]; - - sprintf(s, "|.......................<1>......................<2>....................|"); - - s[(int)(listenerpos.x) + 35] = 'L'; - printf("%s\r", s); - fflush(stdout); - } - } - - system->update(); - - Sleep(INTERFACE_UPDATETIME - 1); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = sound1->release(); - ERRCHECK(result); - result = sound2->release(); - ERRCHECK(result); - result = sound3->release(); - ERRCHECK(result); - - result = system->close(); - ERRCHECK(result); - result = system->release(); - ERRCHECK(result); - - return 0; -} diff --git a/CocosDenshion/third_party/fmod/examples/cdplayer/Makefile b/CocosDenshion/third_party/fmod/examples/cdplayer/Makefile deleted file mode 100644 index 9e935e5bfd..0000000000 --- a/CocosDenshion/third_party/fmod/examples/cdplayer/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -cdplayer_cpp: main.cpp - g++ -O3 -o cdplayer main.cpp ../../api/lib/libfmodex.so -pthread - -cdplayer_c: main.c - g++ -O3 -o cdplayer main.c ../../api/lib/libfmodex.so -pthread - -run: - ./cdplayer - -clean: - rm -f cdplayer diff --git a/CocosDenshion/third_party/fmod/examples/cdplayer/cdplayer b/CocosDenshion/third_party/fmod/examples/cdplayer/cdplayer deleted file mode 100755 index ec5e6b93b6..0000000000 Binary files a/CocosDenshion/third_party/fmod/examples/cdplayer/cdplayer and /dev/null differ diff --git a/CocosDenshion/third_party/fmod/examples/cdplayer/main.c b/CocosDenshion/third_party/fmod/examples/cdplayer/main.c deleted file mode 100644 index 0c3eea349b..0000000000 --- a/CocosDenshion/third_party/fmod/examples/cdplayer/main.c +++ /dev/null @@ -1,236 +0,0 @@ -/*=============================================================================================== - CDPlayer Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to play CD tracks digitally and generate a CDDB query -===============================================================================================*/ -#include "../../api/inc/fmod.h" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - -int cddb_sum(int n) -{ - int ret = 0; - - while (n > 0) - { - ret += (n % 10); - n /= 10; - } - - return ret; -} - -unsigned long cddb_discid(FMOD_CDTOC *toc) -{ - int i, t, n = 0; - - for (i = 0; i < toc->numtracks; i++) - { - n += cddb_sum((toc->min[i] * 60) + toc->sec[i]); - } - - t = ((toc->min[toc->numtracks] * 60) + toc->sec[toc->numtracks]) - ((toc->min[0] * 60) + toc->sec[0]); - - return ((n % 0xff) << 24 | t << 8 | toc->numtracks); -} - -void dump_cddb_query(FMOD_CDTOC *toc) -{ - int i; - - printf("cddb query %08x %d", cddb_discid(toc), toc->numtracks); - - for (i = 0; i < toc->numtracks; i++) - { - printf(" %d", (toc->min[i] * (60 * 75)) + (toc->sec[i] * 75) + toc->frame[i]); - } - - printf(" %d\n", (toc->min[toc->numtracks] * 60) + toc->sec[toc->numtracks]); -} - - -int main(int argc, char *argv[]) -{ - FMOD_SYSTEM *system; - FMOD_SOUND *cdsound; - FMOD_SOUND *sound; - FMOD_CHANNEL *channel = 0; - FMOD_RESULT result; - int key, numtracks, currenttrack = 0; - unsigned int version; - - if (argc < 2) - { - printf("Usage: cdplayer \n"); - printf("Example: cdplayer /dev/cdrom\n"); - exit(-1); - } - - printf("==================================================================\n"); - printf("CDPlayer Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("==================================================================\n\n"); - - /* - Create a System object and initialize. - */ - result = FMOD_System_Create(&system); - ERRCHECK(result); - - result = FMOD_System_GetVersion(system, &version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - result = FMOD_System_Init(system, 1, FMOD_INIT_NORMAL, NULL); - ERRCHECK(result); - - /* - Bump up the file buffer size a bit from the 16k default for CDDA, because it is a slower medium. - */ - result = FMOD_System_SetStreamBufferSize(system, 64*1024, FMOD_TIMEUNIT_RAWBYTES); - ERRCHECK(result); - - result = FMOD_System_CreateStream(system, argv[1], FMOD_OPENONLY, 0, &cdsound); - ERRCHECK(result); - result = FMOD_Sound_GetNumSubSounds(cdsound, &numtracks); - ERRCHECK(result); - result = FMOD_Sound_GetSubSound(cdsound, currenttrack, &sound); - ERRCHECK(result); - - for (;;) - { - FMOD_TAG tag; - - if (FMOD_Sound_GetTag(cdsound, 0, -1, &tag) != FMOD_OK) - { - break; - } - if (tag.datatype == FMOD_TAGDATATYPE_CDTOC) - { - dump_cddb_query((FMOD_CDTOC *)tag.data); - } - } - - printf("\n========================================\n"); - printf("Press SPACE to pause\n"); - printf(" n to skip to next track\n"); - printf(" ESC to exit\n"); - printf("========================================\n\n"); - - /* - Print out length of entire CD. Did you know you can also play 'cdsound' and it will play the whole CD without gaps? - */ - { - unsigned int lenms; - - result = FMOD_Sound_GetLength(cdsound, &lenms, FMOD_TIMEUNIT_MS); - ERRCHECK(result); - - printf("Total CD length %02d:%02d\n\n", lenms / 1000 / 60, lenms / 1000 % 60, lenms / 10 % 100); - } - - /* - Play a CD track - */ - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound, FALSE, &channel); - ERRCHECK(result); - - /* - Main loop - */ - do - { - if (kbhit()) - { - key = getch(); - - switch (key) - { - case ' ' : - { - int paused; - FMOD_Channel_GetPaused(channel, &paused); - FMOD_Channel_SetPaused(channel, !paused); - break; - } - - case 'n' : - { - currenttrack++; - if (currenttrack >= numtracks) - { - currenttrack = 0; - } - result = FMOD_Sound_GetSubSound(cdsound, currenttrack, &sound); - ERRCHECK(result); - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound, FALSE, &channel); - ERRCHECK(result); - break; - } - } - } - - FMOD_System_Update(system); - - if (channel) - { - unsigned int ms, lenms, percent = 0; - FMOD_BOOL playing; - FMOD_BOOL paused; - - result = FMOD_Channel_GetPaused(channel, &paused); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - result = FMOD_Channel_IsPlaying(channel, &playing); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - result = FMOD_Channel_GetPosition(channel, &ms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - result = FMOD_Sound_GetLength(sound, &lenms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - printf("Track %d/%d : %02d:%02d:%02d/%02d:%02d:%02d : %s\r", currenttrack + 1, numtracks, ms / 1000 / 60, ms / 1000 % 60, ms / 10 % 100, lenms / 1000 / 60, lenms / 1000 % 60, lenms / 10 % 100, paused ? "Paused " : playing ? "Playing" : "Stopped"); - } - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = FMOD_Sound_Release(sound); - ERRCHECK(result); - result = FMOD_System_Close(system); - ERRCHECK(result); - result = FMOD_System_Release(system); - ERRCHECK(result); - - return 0; -} diff --git a/CocosDenshion/third_party/fmod/examples/cdplayer/main.cpp b/CocosDenshion/third_party/fmod/examples/cdplayer/main.cpp deleted file mode 100644 index 08eec0cd65..0000000000 --- a/CocosDenshion/third_party/fmod/examples/cdplayer/main.cpp +++ /dev/null @@ -1,238 +0,0 @@ -/*=============================================================================================== - CDPlayer Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to play CD tracks digitally and generate a CDDB query -===============================================================================================*/ -#include "../../api/inc/fmod.hpp" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - -int cddb_sum(int n) -{ - int ret = 0; - - while (n > 0) - { - ret += (n % 10); - n /= 10; - } - - return ret; -} - -unsigned long cddb_discid(FMOD_CDTOC *toc) -{ - int i, t, n = 0; - - for (i = 0; i < toc->numtracks; i++) - { - n += cddb_sum((toc->min[i] * 60) + toc->sec[i]); - } - - t = ((toc->min[toc->numtracks] * 60) + toc->sec[toc->numtracks]) - ((toc->min[0] * 60) + toc->sec[0]); - - return ((n % 0xff) << 24 | t << 8 | toc->numtracks); -} - -void dump_cddb_query(FMOD_CDTOC *toc) -{ - int i; - - printf("cddb query %08x %d", cddb_discid(toc), toc->numtracks); - - for (i = 0; i < toc->numtracks; i++) - { - printf(" %d", (toc->min[i] * (60 * 75)) + (toc->sec[i] * 75) + toc->frame[i]); - } - - printf(" %d\n", (toc->min[toc->numtracks] * 60) + toc->sec[toc->numtracks]); -} - - -int main(int argc, char *argv[]) -{ - FMOD::System *system; - FMOD::Sound *cdsound; - FMOD::Sound *sound; - FMOD::Channel *channel = 0; - FMOD_RESULT result; - int key, numtracks, currenttrack = 0; - unsigned int version; - - if (argc < 2) - { - printf("Usage: cdplayer \n"); - printf("Example: cdplayer /dev/cdrom\n"); - exit(-1); - } - - printf("==================================================================\n"); - printf("CDPlayer Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("==================================================================\n\n"); - - /* - Create a System object and initialize. - */ - result = FMOD::System_Create(&system); - ERRCHECK(result); - - result = system->getVersion(&version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - result = system->init(1, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - /* - Bump up the file buffer size a bit from the 16k default for CDDA, because it is a slower medium. - */ - result = system->setStreamBufferSize(64*1024, FMOD_TIMEUNIT_RAWBYTES); - ERRCHECK(result); - - result = system->createStream(argv[1], FMOD_OPENONLY, 0, &cdsound); - ERRCHECK(result); - result = cdsound->getNumSubSounds(&numtracks); - ERRCHECK(result); - result = cdsound->getSubSound(currenttrack, &sound); - ERRCHECK(result); - - for (;;) - { - FMOD_TAG tag; - - if (cdsound->getTag(0, -1, &tag) != FMOD_OK) - { - break; - } - if (tag.datatype == FMOD_TAGDATATYPE_CDTOC) - { - dump_cddb_query((FMOD_CDTOC *)tag.data); - } - } - - printf("\n========================================\n"); - printf("Press SPACE to pause\n"); - printf(" n to skip to next track\n"); - printf(" ESC to exit\n"); - printf("========================================\n\n"); - - /* - Print out length of entire CD. Did you know you can also play 'cdsound' and it will play the whole CD without gaps? - */ - { - unsigned int lenms; - - result = cdsound->getLength(&lenms, FMOD_TIMEUNIT_MS); - ERRCHECK(result); - - printf("Total CD length %02d:%02d\n\n", lenms / 1000 / 60, lenms / 1000 % 60, lenms / 10 % 100); - } - - - /* - Play a CD track - */ - result = system->playSound(FMOD_CHANNEL_FREE, sound, false, &channel); - ERRCHECK(result); - - /* - Main loop - */ - do - { - if (kbhit()) - { - key = getch(); - - switch (key) - { - case ' ' : - { - bool paused; - channel->getPaused(&paused); - channel->setPaused(!paused); - break; - } - - case 'n' : - { - currenttrack++; - if (currenttrack >= numtracks) - { - currenttrack = 0; - } - result = cdsound->getSubSound(currenttrack, &sound); - ERRCHECK(result); - result = system->playSound(FMOD_CHANNEL_FREE, sound, false, &channel); - ERRCHECK(result); - break; - } - } - } - - system->update(); - - if (channel) - { - unsigned int ms; - unsigned int lenms; - bool playing; - bool paused; - - result = channel->getPaused(&paused); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - result = channel->isPlaying(&playing); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - result = channel->getPosition(&ms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - result = sound->getLength(&lenms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - printf("Track %d/%d : %02d:%02d:%02d/%02d:%02d:%02d : %s\r", currenttrack + 1, numtracks, ms / 1000 / 60, ms / 1000 % 60, ms / 10 % 100, lenms / 1000 / 60, lenms / 1000 % 60, lenms / 10 % 100, paused ? "Paused " : playing ? "Playing" : "Stopped"); - } - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = sound->release(); - ERRCHECK(result); - result = system->close(); - ERRCHECK(result); - result = system->release(); - ERRCHECK(result); - - return 0; -} diff --git a/CocosDenshion/third_party/fmod/examples/channelgroups/Makefile b/CocosDenshion/third_party/fmod/examples/channelgroups/Makefile deleted file mode 100644 index d069d00587..0000000000 --- a/CocosDenshion/third_party/fmod/examples/channelgroups/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -channelgroups_cpp: main.cpp - g++ -O3 -o channelgroups main.cpp ../../api/lib/libfmodex.so -pthread - -channelgroups_c: main.c - g++ -O3 -o channelgroups main.c ../../api/lib/libfmodex.so -pthread - -run: - ./channelgroups - -clean: - rm -f channelgroups diff --git a/CocosDenshion/third_party/fmod/examples/channelgroups/main.c b/CocosDenshion/third_party/fmod/examples/channelgroups/main.c deleted file mode 100644 index f738cac1bf..0000000000 --- a/CocosDenshion/third_party/fmod/examples/channelgroups/main.c +++ /dev/null @@ -1,226 +0,0 @@ -/*=============================================================================================== - ChannelGroups Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to put channels into channel groups, so that you can affect a group - of channels at a time instead of just one channel at a time. -===============================================================================================*/ -#include "../../api/inc/fmod.h" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD_SYSTEM *system; - FMOD_SOUND *sound[6]; - FMOD_CHANNEL *channel[6]; - FMOD_CHANNELGROUP *groupA, *groupB, *masterGroup; - FMOD_RESULT result; - int key, count; - unsigned int version; - - /* - Create a System object and initialize. - */ - result = FMOD_System_Create(&system); - ERRCHECK(result); - - result = FMOD_System_GetVersion(system, &version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - result = FMOD_System_Init(system, 32, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - result = FMOD_System_CreateSound(system, "../media/drumloop.wav", FMOD_LOOP_NORMAL, 0, &sound[0]); - ERRCHECK(result); - result = FMOD_System_CreateSound(system, "../media/jaguar.wav", FMOD_LOOP_NORMAL, 0, &sound[1]); - ERRCHECK(result); - result = FMOD_System_CreateSound(system, "../media/swish.wav", FMOD_LOOP_NORMAL, 0, &sound[2]); - ERRCHECK(result); - result = FMOD_System_CreateSound(system, "../media/c.ogg", FMOD_LOOP_NORMAL, 0, &sound[3]); - ERRCHECK(result); - result = FMOD_System_CreateSound(system, "../media/d.ogg", FMOD_LOOP_NORMAL, 0, &sound[4]); - ERRCHECK(result); - result = FMOD_System_CreateSound(system, "../media/e.ogg", FMOD_LOOP_NORMAL, 0, &sound[5]); - ERRCHECK(result); - - result = FMOD_System_CreateChannelGroup(system, "Group A", &groupA); - ERRCHECK(result); - - result = FMOD_System_CreateChannelGroup(system, "Group B", &groupB); - ERRCHECK(result); - - result = FMOD_System_GetMasterChannelGroup(system, &masterGroup); - ERRCHECK(result); - - printf("=======================================================================\n"); - printf("ChannelGroups Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("=======================================================================\n"); - printf("\n"); - printf("Group A : drumloop.wav, jaguar.wav, swish.wav\n"); - printf("Group B : c.ogg, d.ogg, e.ogg\n"); - printf("\n"); - printf("Press 'A' to mute/unmute group A\n"); - printf("Press 'B' to mute/unmute group B\n"); - printf("Press 'C' to mute/unmute group A and B (master group)\n"); - printf("Press 'Esc' to quit\n"); - printf("\n"); - - /* - Instead of being independent, set the group A and B to be children of the master group. - */ - result = FMOD_ChannelGroup_AddGroup(masterGroup, groupA); - ERRCHECK(result); - - result = FMOD_ChannelGroup_AddGroup(masterGroup, groupB); - ERRCHECK(result); - - /* - Start all the sounds! - */ - for (count = 0; count < 6; count++) - { - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound[count], TRUE, &channel[count]); - ERRCHECK(result); - if (count < 3) - { - result = FMOD_Channel_SetChannelGroup(channel[count], groupA); - } - else - { - result = FMOD_Channel_SetChannelGroup(channel[count], groupB); - } - ERRCHECK(result); - result = FMOD_Channel_SetPaused(channel[count], FALSE); - ERRCHECK(result); - } - - /* - Change the volume of each group, just because we can! (And makes it less of a loud noise). - */ - result = FMOD_ChannelGroup_SetVolume(groupA, 0.5f); - ERRCHECK(result); - result = FMOD_ChannelGroup_SetVolume(groupB, 0.5f); - ERRCHECK(result); - - /* - Main loop. - */ - do - { - if (kbhit()) - { - key = getch(); - - switch (key) - { - case 'a' : - case 'A' : - { - static int mute = TRUE; - - FMOD_ChannelGroup_SetMute(groupA, mute); - - mute = !mute; - break; - } - case 'b' : - case 'B' : - { - static int mute = TRUE; - - FMOD_ChannelGroup_SetMute(groupB, mute); - - mute = !mute; - break; - } - case 'c' : - case 'C' : - { - static int mute = TRUE; - - FMOD_ChannelGroup_SetMute(masterGroup, mute); - - mute = !mute; - break; - } - } - } - - FMOD_System_Update(system); - - { - int channelsplaying = 0; - - FMOD_System_GetChannelsPlaying(system, &channelsplaying); - - printf("Channels Playing %2d\r", channelsplaying); - } - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - A little fade out. (over 2 seconds) - */ - printf("Goodbye!\n"); - { - float pitch = 1.0f; - float vol = 1.0f; - - for (count = 0; count < 200; count++) - { - FMOD_ChannelGroup_SetPitch(masterGroup, pitch); - FMOD_ChannelGroup_SetVolume(masterGroup, vol); - - vol -= (1.0f / 200.0f); - pitch -= (0.5f / 200.0f); - - Sleep(10); - } - } - - /* - Shut down - */ - for (count = 0; count < 6; count++) - { - result = FMOD_Sound_Release(sound[count]); - ERRCHECK(result); - } - - result = FMOD_ChannelGroup_Release(groupA); - ERRCHECK(result); - result = FMOD_ChannelGroup_Release(groupB); - ERRCHECK(result); - - result = FMOD_System_Close(system); - ERRCHECK(result); - result = FMOD_System_Release(system); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/examples/channelgroups/main.cpp b/CocosDenshion/third_party/fmod/examples/channelgroups/main.cpp deleted file mode 100644 index 6c043d0843..0000000000 --- a/CocosDenshion/third_party/fmod/examples/channelgroups/main.cpp +++ /dev/null @@ -1,226 +0,0 @@ -/*=============================================================================================== - ChannelGroups Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to put channels into channel groups, so that you can affect a group - of channels at a time instead of just one channel at a time. -===============================================================================================*/ -#include "../../api/inc/fmod.hpp" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD::System *system; - FMOD::Sound *sound[6]; - FMOD::Channel *channel[6]; - FMOD::ChannelGroup *groupA, *groupB, *masterGroup; - FMOD_RESULT result; - int key, count; - unsigned int version; - - /* - Create a System object and initialize. - */ - result = FMOD::System_Create(&system); - ERRCHECK(result); - - result = system->getVersion(&version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - result = system->init(32, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - result = system->createSound("../media/drumloop.wav", FMOD_LOOP_NORMAL, 0, &sound[0]); - ERRCHECK(result); - result = system->createSound("../media/jaguar.wav", FMOD_LOOP_NORMAL, 0, &sound[1]); - ERRCHECK(result); - result = system->createSound("../media/swish.wav", FMOD_LOOP_NORMAL, 0, &sound[2]); - ERRCHECK(result); - result = system->createSound("../media/c.ogg", FMOD_LOOP_NORMAL, 0, &sound[3]); - ERRCHECK(result); - result = system->createSound("../media/d.ogg", FMOD_LOOP_NORMAL, 0, &sound[4]); - ERRCHECK(result); - result = system->createSound("../media/e.ogg", FMOD_LOOP_NORMAL, 0, &sound[5]); - ERRCHECK(result); - - result = system->createChannelGroup("Group A", &groupA); - ERRCHECK(result); - - result = system->createChannelGroup("Group B", &groupB); - ERRCHECK(result); - - result = system->getMasterChannelGroup(&masterGroup); - ERRCHECK(result); - - printf("=======================================================================\n"); - printf("ChannelGroups Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("=======================================================================\n"); - printf("\n"); - printf("Group A : drumloop.wav, jaguar.wav, swish.wav\n"); - printf("Group B : c.ogg, d.ogg, e.ogg\n"); - printf("\n"); - printf("Press 'A' to mute/unmute group A\n"); - printf("Press 'B' to mute/unmute group B\n"); - printf("Press 'C' to mute/unmute group A and B (master group)\n"); - printf("Press 'Esc' to quit\n"); - printf("\n"); - - /* - Instead of being independent, set the group A and B to be children of the master group. - */ - result = masterGroup->addGroup(groupA); - ERRCHECK(result); - - result = masterGroup->addGroup(groupB); - ERRCHECK(result); - - /* - Start all the sounds! - */ - for (count = 0; count < 6; count++) - { - result = system->playSound(FMOD_CHANNEL_FREE, sound[count], true, &channel[count]); - ERRCHECK(result); - if (count < 3) - { - result = channel[count]->setChannelGroup(groupA); - } - else - { - result = channel[count]->setChannelGroup(groupB); - } - ERRCHECK(result); - result = channel[count]->setPaused(false); - ERRCHECK(result); - } - - /* - Change the volume of each group, just because we can! (And makes it less noise). - */ - result = groupA->setVolume(0.5f); - ERRCHECK(result); - result = groupB->setVolume(0.5f); - ERRCHECK(result); - - /* - Main loop. - */ - do - { - if (kbhit()) - { - key = getch(); - - switch (key) - { - case 'a' : - case 'A' : - { - static bool mute = true; - - groupA->setMute(mute); - - mute = !mute; - break; - } - case 'b' : - case 'B' : - { - static bool mute = true; - - groupB->setMute(mute); - - mute = !mute; - break; - } - case 'c' : - case 'C' : - { - static bool mute = true; - - masterGroup->setMute(mute); - - mute = !mute; - break; - } - } - } - - system->update(); - - { - int channelsplaying = 0; - - system->getChannelsPlaying(&channelsplaying); - - printf("Channels Playing %2d\r", channelsplaying); - } - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - A little fade out. (over 2 seconds) - */ - printf("Goodbye!\n"); - { - float pitch = 1.0f; - float vol = 1.0f; - - for (count = 0; count < 200; count++) - { - masterGroup->setPitch(pitch); - masterGroup->setVolume(vol); - - vol -= (1.0f / 200.0f); - pitch -= (0.5f / 200.0f); - - Sleep(10); - } - } - - /* - Shut down - */ - for (count = 0; count < 6; count++) - { - result = sound[count]->release(); - ERRCHECK(result); - } - - result = groupA->release(); - ERRCHECK(result); - result = groupB->release(); - ERRCHECK(result); - - result = system->close(); - ERRCHECK(result); - result = system->release(); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/examples/common/wincompat.h b/CocosDenshion/third_party/fmod/examples/common/wincompat.h deleted file mode 100644 index 0a4a281a2b..0000000000 --- a/CocosDenshion/third_party/fmod/examples/common/wincompat.h +++ /dev/null @@ -1,84 +0,0 @@ -#if !defined(WINCOMPAT_INCLUDED) && !defined(PLATFORM_WINDOWS) && !defined(WIN32) && !defined(WINDOWS) && !defined(__WIN32__) -#define WINCOMPAT_INCLUDED - -/** - * - * Author: Magnus Naeslund (mag@fbab.net, mag@bahnhof.se) - * (c) 2000 Magnus Naeslund, all rights reserved - * - */ - -#include -#include -#include -#include -#include -#include -#include - -#ifndef TRUE - #define TRUE 1 -#endif -#ifndef FALSE - #define FALSE 0 -#endif - -#define _kbhit kbhit -#define _getch getch -#define stricmp strcasecmp -#define strnicmp strncasecmp - -#define Sleep(x) usleep((x)*1000) - -static int inited=0; -static struct termios ori; - -static void tcatexit(){ - tcsetattr(0,TCSANOW,&ori); -} - -static void init_terminal(){ - struct termios t; - tcgetattr(0,&t); - tcgetattr(0,&ori); - t.c_lflag &= ~(ICANON); - t.c_lflag &= ~(ECHO); - tcsetattr(0,TCSANOW,&t); - atexit(tcatexit); -} - -static inline int kbhit(){ - fd_set rfds; - struct timeval tv; - - if (!inited){ - inited=1; - init_terminal(); - } - - FD_ZERO(&rfds); - FD_SET(0, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 10*1000; - return select(1, &rfds, NULL, NULL, &tv)>0; -} - -static inline int getch(){ - fd_set rfds; - - if (!inited){ - inited=1; - init_terminal(); - } - - FD_ZERO(&rfds); - FD_SET(0, &rfds); - if (select(1, &rfds, NULL, NULL, NULL)>0) - return getchar(); - else{ - printf("wincompat.h: select() on fd 0 failed\n"); - return 0xDeadBeef; - } -} - -#endif diff --git a/CocosDenshion/third_party/fmod/examples/dsp_custom/Makefile b/CocosDenshion/third_party/fmod/examples/dsp_custom/Makefile deleted file mode 100644 index 19c045dffb..0000000000 --- a/CocosDenshion/third_party/fmod/examples/dsp_custom/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -dsp_custom_cpp: main.cpp - g++ -O3 -o dsp_custom main.cpp ../../api/lib/libfmodex.so -pthread - -dsp_custom_c: main.c - g++ -O3 -o dsp_custom main.c ../../api/lib/libfmodex.so -pthread - -run: - ./dsp_custom - -clean: - rm -f dsp_custom diff --git a/CocosDenshion/third_party/fmod/examples/dsp_custom/main.c b/CocosDenshion/third_party/fmod/examples/dsp_custom/main.c deleted file mode 100644 index b46bebfd18..0000000000 --- a/CocosDenshion/third_party/fmod/examples/dsp_custom/main.c +++ /dev/null @@ -1,185 +0,0 @@ -/*=============================================================================================== - Custom DSP Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to add a user created DSP callback to process audio data. - A read callback is generated at runtime, and can be added anywhere in the DSP network. - -===============================================================================================*/ -#include "../../api/inc/fmod.h" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include -#include - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -FMOD_RESULT F_CALLBACK myDSPCallback(FMOD_DSP_STATE *dsp_state, float *inbuffer, float *outbuffer, unsigned int length, int inchannels, int outchannels) -{ - unsigned int count, userdata; - int count2; - char name[256]; - FMOD_DSP *thisdsp = dsp_state->instance; - - /* - This redundant call just shows using the instance parameter of FMOD_DSP_STATE and using it to - call a DSP information function. - */ - FMOD_DSP_GetInfo(thisdsp, name, 0, 0, 0, 0); - - FMOD_DSP_GetUserData(thisdsp, (void **)&userdata); - - /* - This loop assumes inchannels = outchannels, which it will be if the DSP is created with '0' - as the number of channels in FMOD_DSP_DESCRIPTION. - Specifying an actual channel count will mean you have to take care of any number of channels coming in, - but outputting the number of channels specified. Generally it is best to keep the channel - count at 0 for maximum compatibility. - */ - for (count = 0; count < length; count++) - { - /* - Feel free to unroll this. - */ - for (count2 = 0; count2 < outchannels; count2++) - { - /* - This DSP filter just halves the volume! - Input is modified, and sent to output. - */ - outbuffer[(count * outchannels) + count2] = inbuffer[(count * inchannels) + count2] * 0.2f; - } - } - - return FMOD_OK; -} - - -int main(int argc, char *argv[]) -{ - FMOD_SYSTEM *system; - FMOD_SOUND *sound; - FMOD_CHANNEL *channel; - FMOD_DSP *mydsp; - FMOD_RESULT result; - int key; - unsigned int version; - float pan = 0; - - /* - Create a System object and initialize. - */ - result = FMOD_System_Create(&system); - ERRCHECK(result); - - result = FMOD_System_GetVersion(system, &version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - result = FMOD_System_Init(system, 32, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - result = FMOD_System_CreateSound(system, "../media/drumloop.wav", FMOD_SOFTWARE | FMOD_LOOP_NORMAL, 0, &sound); - ERRCHECK(result); - - printf("===============================================================================\n"); - printf("Custom DSP example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("===============================================================================\n"); - printf("Press 'f' to activate, deactivate user filter\n"); - printf("Press 'Esc' to quit\n"); - printf("\n"); - - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound, FALSE, &channel); - ERRCHECK(result); - - /* - Create the DSP effects. - */ - { - FMOD_DSP_DESCRIPTION dspdesc; - - memset(&dspdesc, 0, sizeof(FMOD_DSP_DESCRIPTION)); - - strcpy(dspdesc.name, "My first DSP unit"); - dspdesc.channels = 0; // 0 = whatever comes in, else specify. - dspdesc.read = myDSPCallback; - dspdesc.userdata = (void *)0x12345678; - - result = FMOD_System_CreateDSP(system, &dspdesc, &mydsp); - ERRCHECK(result); - } - - /* - Inactive by default. - */ - FMOD_DSP_SetBypass(mydsp, TRUE); - - /* - Main loop. - */ - result = FMOD_System_AddDSP(system, mydsp, 0); - - - /* - Main loop. - */ - do - { - if (kbhit()) - { - key = getch(); - - switch (key) - { - case 'f' : - case 'F' : - { - static int active = FALSE; - - FMOD_DSP_SetBypass(mydsp, active); - - active = !active; - break; - } - } - } - - FMOD_System_Update(system); - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = FMOD_Sound_Release(sound); - ERRCHECK(result); - - result = FMOD_DSP_Release(mydsp); - ERRCHECK(result); - - result = FMOD_System_Close(system); - ERRCHECK(result); - result = FMOD_System_Release(system); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/examples/dsp_custom/main.cpp b/CocosDenshion/third_party/fmod/examples/dsp_custom/main.cpp deleted file mode 100644 index 33e5d3cc0c..0000000000 --- a/CocosDenshion/third_party/fmod/examples/dsp_custom/main.cpp +++ /dev/null @@ -1,185 +0,0 @@ -/*=============================================================================================== - Custom DSP Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to add a user created DSP callback to process audio data. - A read callback is generated at runtime, and can be added anywhere in the DSP network. - -===============================================================================================*/ -#include "../../api/inc/fmod.hpp" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include -#include - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -FMOD_RESULT F_CALLBACK myDSPCallback(FMOD_DSP_STATE *dsp_state, float *inbuffer, float *outbuffer, unsigned int length, int inchannels, int outchannels) -{ - unsigned int count, userdata; - int count2; - char name[256]; - FMOD::DSP *thisdsp = (FMOD::DSP *)dsp_state->instance; - - /* - This redundant call just shows using the instance parameter of FMOD_DSP_STATE and using it to - call a DSP information function. - */ - thisdsp->getInfo(name, 0, 0, 0, 0); - - thisdsp->getUserData((void **)&userdata); - - /* - This loop assumes inchannels = outchannels, which it will be if the DSP is created with '0' - as the number of channels in FMOD_DSP_DESCRIPTION. - Specifying an actual channel count will mean you have to take care of any number of channels coming in, - but outputting the number of channels specified. Generally it is best to keep the channel - count at 0 for maximum compatibility. - */ - for (count = 0; count < length; count++) - { - /* - Feel free to unroll this. - */ - for (count2 = 0; count2 < outchannels; count2++) - { - /* - This DSP filter just halves the volume! - Input is modified, and sent to output. - */ - outbuffer[(count * outchannels) + count2] = inbuffer[(count * inchannels) + count2] * 0.2f; - } - } - - return FMOD_OK; -} - - -int main(int argc, char *argv[]) -{ - FMOD::System *system; - FMOD::Sound *sound; - FMOD::Channel *channel; - FMOD::DSP *mydsp; - FMOD_RESULT result; - int key; - unsigned int version; - float pan = 0; - - /* - Create a System object and initialize. - */ - result = FMOD::System_Create(&system); - ERRCHECK(result); - - result = system->getVersion(&version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - result = system->init(32, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - result = system->createSound("../media/drumloop.wav", FMOD_SOFTWARE | FMOD_LOOP_NORMAL, 0, &sound); - ERRCHECK(result); - - printf("===================================================================\n"); - printf("Custom DSP example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("===================================================================\n"); - printf("Press 'f' to activate, deactivate user filter\n"); - printf("Press 'Esc' to quit\n"); - printf("\n"); - - result = system->playSound(FMOD_CHANNEL_FREE, sound, false, &channel); - ERRCHECK(result); - - /* - Create the DSP effects. - */ - { - FMOD_DSP_DESCRIPTION dspdesc; - - memset(&dspdesc, 0, sizeof(FMOD_DSP_DESCRIPTION)); - - strcpy(dspdesc.name, "My first DSP unit"); - dspdesc.channels = 0; // 0 = whatever comes in, else specify. - dspdesc.read = myDSPCallback; - dspdesc.userdata = (void *)0x12345678; - - result = system->createDSP(&dspdesc, &mydsp); - ERRCHECK(result); - } - - /* - Inactive by default. - */ - mydsp->setBypass(true); - - /* - Main loop. - */ - result = system->addDSP(mydsp, 0); - - - /* - Main loop. - */ - do - { - if (kbhit()) - { - key = getch(); - - switch (key) - { - case 'f' : - case 'F' : - { - static bool active = false; - - mydsp->setBypass(active); - - active = !active; - break; - } - } - } - - system->update(); - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = sound->release(); - ERRCHECK(result); - - result = mydsp->release(); - ERRCHECK(result); - - result = system->close(); - ERRCHECK(result); - result = system->release(); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/examples/dsp_effectperspeaker/Makefile b/CocosDenshion/third_party/fmod/examples/dsp_effectperspeaker/Makefile deleted file mode 100644 index e1a470b843..0000000000 --- a/CocosDenshion/third_party/fmod/examples/dsp_effectperspeaker/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -dsp_effectperspeaker_cpp: main.cpp - g++ -O3 -o dsp_effectperspeaker main.cpp ../../api/lib/libfmodex.so -pthread - -dsp_effectperspeaker_c: main.c - g++ -O3 -o dsp_effectperspeaker main.c ../../api/lib/libfmodex.so -pthread - -run: - ./dsp_effectperspeaker - -clean: - rm -f dsp_effectperspeaker diff --git a/CocosDenshion/third_party/fmod/examples/dsp_effectperspeaker/main.c b/CocosDenshion/third_party/fmod/examples/dsp_effectperspeaker/main.c deleted file mode 100644 index 80f993388e..0000000000 --- a/CocosDenshion/third_party/fmod/examples/dsp_effectperspeaker/main.c +++ /dev/null @@ -1,268 +0,0 @@ -/*=============================================================================================== - DSP Effect per speaker Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to manipulate a DSP network and as an example, creates 2 dsp effects, - and splits a single sound into 2 audio paths, which it then filters seperately. - To only have each audio path come out of one speaker each, FMOD_DSPConnection_setLevels is used just - before the 2 branches merge back together again. - - For more speakers: - 1. Use FMOD_System_SetSpeakerMode or FMOD_System_SetOutputFormat. - 2. Create more effects, currently 2 for stereo (reverb and chorus), create one per speaker. - 3. Under the 'Now connect the 2 effects to channeldsp head.' section, connect the extra effects - by duplicating the code more times. - 4. Filter each effect to each speaker by calling FMOD_DSP_SetInputLevels. Expand the existing code - by extending the level arrays from 2 to the number of speakers you require, and change the - numlevels parameter in FMOD_DSP_SetInputLevels from 2 to the correct number accordingly. - -===============================================================================================*/ -#include "../common/wincompat.h" -#include "../../api/inc/fmod.h" -#include "../../api/inc/fmod_errors.h" - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD_SYSTEM *system; - FMOD_SOUND *sound; - FMOD_CHANNEL *channel; - FMOD_DSP *dsplowpass, *dspchorus, *dsphead, *dspchannelmixer; - FMOD_DSPCONNECTION *dsplowpassconnection, *dspchorusconnection; - FMOD_RESULT result; - int key; - unsigned int version; - float pan = 0; - - /* - Create a System object and initialize. - */ - result = FMOD_System_Create(&system); - ERRCHECK(result); - - result = FMOD_System_GetVersion(system, &version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - result = FMOD_System_Init(system, 32, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - result = FMOD_System_CreateSound(system, "../media/drumloop.wav", FMOD_SOFTWARE | FMOD_LOOP_NORMAL, 0, &sound); - ERRCHECK(result); - - printf("===============================================================================\n"); - printf("DSP Effect per speaker example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("===============================================================================\n"); - printf("Press 'L' to toggle reverb on/off on left speaker only\n"); - printf("Press 'R' to toggle chorus on/off on right speaker only\n"); - printf("Press '[' to pan sound left\n"); - printf("Press ']' to pan sound right\n"); - printf("Press 'Esc' to quit\n"); - printf("\n"); - - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound, FALSE, &channel); - ERRCHECK(result); - - /* - Create the DSP effects. - */ - result = FMOD_System_CreateDSPByType(system, FMOD_DSP_TYPE_REVERB, &dsplowpass); - ERRCHECK(result); - - result = FMOD_System_CreateDSPByType(system, FMOD_DSP_TYPE_CHORUS, &dspchorus); - ERRCHECK(result); - - /* - Connect up the DSP network - */ - - /* - When a sound is played, a subnetwork is set up in the DSP network which looks like this. - Wavetable is the drumloop sound, and it feeds its data from right to left. - - [DSPHEAD]<------------[DSPCHANNELMIXER] - */ - result = FMOD_System_GetDSPHead(system, &dsphead); - ERRCHECK(result); - - result = FMOD_DSP_GetInput(dsphead, 0, &dspchannelmixer, 0); - ERRCHECK(result); - - /* - Now disconnect channeldsp head from wavetable to look like this. - - [DSPHEAD] [DSPCHANNELMIXER] - */ - result = FMOD_DSP_DisconnectFrom(dsphead, dspchannelmixer); - ERRCHECK(result); - - /* - Now connect the 2 effects to channeldsp head. - Store the 2 connections this makes so we can set their speakerlevels later. - - [DSPLOWPASS] - /x - [DSPHEAD] [DSPCHANNELMIXER] - \y - [DSPCHORUS] - */ - result = FMOD_DSP_AddInput(dsphead, dsplowpass, &dsplowpassconnection); /* x = dsplowpassconnection */ - ERRCHECK(result); - result = FMOD_DSP_AddInput(dsphead, dspchorus, &dspchorusconnection); /* y = dspchorusconnection */ - ERRCHECK(result); - - /* - Now connect the wavetable to the 2 effects - - [DSPLOWPASS] - /x \ - [DSPHEAD] [DSPCHANNELMIXER] - \y / - [DSPCHORUS] - */ - result = FMOD_DSP_AddInput(dsplowpass, dspchannelmixer, NULL); /* Null for connection - we dont care about it. */ - ERRCHECK(result); - result = FMOD_DSP_AddInput(dspchorus, dspchannelmixer, NULL); /* Null for connection - we dont care about it. */ - ERRCHECK(result); - - /* - Now the drumloop will be twice as loud, because it is being split into 2, then recombined at the end. - What we really want is to only feed the dspchannelmixer->dsplowpass through the left speaker, and - dspchannelmixer->dspchorus to the right speaker. - We can do that simply by setting the pan, or speaker levels of the connections. - - [DSPLOWPASS] - /x=1,0 \ - [DSPHEAD] [DSPCHANNELMIXER] - \y=0,1 / - [DSPCHORUS] - */ - { - float leftinputon[2] = { 1.0f, 0.0f }; - float rightinputon[2] = { 0.0f, 1.0f }; - float inputsoff[2] = { 0.0f, 0.0f }; - - result = FMOD_DSPConnection_SetLevels(dsplowpassconnection, FMOD_SPEAKER_FRONT_LEFT, leftinputon, 2); - ERRCHECK(result); - result = FMOD_DSPConnection_SetLevels(dsplowpassconnection, FMOD_SPEAKER_FRONT_RIGHT, inputsoff, 2); - ERRCHECK(result); - - result = FMOD_DSPConnection_SetLevels(dspchorusconnection, FMOD_SPEAKER_FRONT_LEFT, inputsoff, 2); - ERRCHECK(result); - result = FMOD_DSPConnection_SetLevels(dspchorusconnection, FMOD_SPEAKER_FRONT_RIGHT, rightinputon, 2); - ERRCHECK(result); - } - - result = FMOD_DSP_SetBypass(dsplowpass, TRUE); - result = FMOD_DSP_SetBypass(dspchorus, TRUE); - - result = FMOD_DSP_SetActive(dsplowpass, TRUE); - result = FMOD_DSP_SetActive(dspchorus, TRUE); - - /* - Main loop. - */ - do - { - if (kbhit()) - { - key = getch(); - - switch (key) - { - case 'l' : - case 'L' : - { - static int reverb = FALSE; - - FMOD_DSP_SetBypass(dsplowpass, reverb); - - reverb = !reverb; - break; - } - case 'r' : - case 'R' : - { - static int chorus = FALSE; - - FMOD_DSP_SetBypass(dspchorus, chorus); - - chorus = !chorus; - break; - } - case '[' : - { - FMOD_Channel_GetPan(channel, &pan); - pan -= 0.1f; - if (pan < -1) - { - pan = -1; - } - FMOD_Channel_SetPan(channel, pan); - break; - } - case ']' : - { - FMOD_Channel_GetPan(channel, &pan); - pan += 0.1f; - if (pan > 1) - { - pan = 1; - } - FMOD_Channel_SetPan(channel, pan); - break; - } - } - } - - FMOD_System_Update(system); - - { - int channelsplaying = 0; - - FMOD_System_GetChannelsPlaying(system, &channelsplaying); - - printf("Channels Playing %2d : Pan = %.02f\r", channelsplaying, pan); - } - - fflush(stdout); - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = FMOD_Sound_Release(sound); - ERRCHECK(result); - - result = FMOD_DSP_Release(dsplowpass); - ERRCHECK(result); - result = FMOD_DSP_Release(dspchorus); - ERRCHECK(result); - - result = FMOD_System_Close(system); - ERRCHECK(result); - result = FMOD_System_Release(system); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/examples/dsp_effectperspeaker/main.cpp b/CocosDenshion/third_party/fmod/examples/dsp_effectperspeaker/main.cpp deleted file mode 100644 index bbde2d97c7..0000000000 --- a/CocosDenshion/third_party/fmod/examples/dsp_effectperspeaker/main.cpp +++ /dev/null @@ -1,268 +0,0 @@ -/*=============================================================================================== - DSP Effect per speaker Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to manipulate a DSP network and as an example, creates 2 dsp effects, - and splits a single sound into 2 audio paths, which it then filters seperately. - To only have each audio path come out of one speaker each, DSPConnection::setLevels is used just - before the 2 branches merge back together again. - - For more speakers: - 1. Use System::setSpeakerMode or System::setOutputFormat. - 2. Create more effects, currently 2 for stereo (lowpass and chorus), create one per speaker. - 3. Under the 'Now connect the 2 effects to channeldsp head.' section, connect the extra effects - by duplicating the code more times. - 4. Filter each effect to each speaker by calling DSP::setInputLevels. Expand the existing code - by extending the level arrays from 2 to the number of speakers you require, and change the - numlevels parameter in DSP::setInputLevels from 2 to the correct number accordingly. - -===============================================================================================*/ -#include "../common/wincompat.h" -#include "../../api/inc/fmod.hpp" -#include "../../api/inc/fmod_errors.h" - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD::System *system; - FMOD::Sound *sound; - FMOD::Channel *channel; - FMOD::DSP *dsplowpass, *dspchorus, *dsphead, *dspchannelmixer; - FMOD::DSPConnection *dsplowpassconnection, *dspchorusconnection; - FMOD_RESULT result; - int key; - unsigned int version; - float pan = 0; - - /* - Create a System object and initialize. - */ - result = FMOD::System_Create(&system); - ERRCHECK(result); - - result = system->getVersion(&version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - result = system->init(32, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - result = system->createSound("../media/drumloop.wav", FMOD_SOFTWARE | FMOD_LOOP_NORMAL, 0, &sound); - ERRCHECK(result); - - printf("===============================================================================\n"); - printf("DSP effect per speaker example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("===============================================================================\n"); - printf("Press 'L' to toggle lowpass on/off on left speaker only\n"); - printf("Press 'R' to toggle chorus on/off on right speaker only\n"); - printf("Press '[' to pan sound left\n"); - printf("Press ']' to pan sound right\n"); - printf("Press 'Esc' to quit\n"); - printf("\n"); - - result = system->playSound(FMOD_CHANNEL_FREE, sound, false, &channel); - ERRCHECK(result); - - /* - Create the DSP effects. - */ - result = system->createDSPByType(FMOD_DSP_TYPE_LOWPASS, &dsplowpass); - ERRCHECK(result); - - result = system->createDSPByType(FMOD_DSP_TYPE_CHORUS, &dspchorus); - ERRCHECK(result); - - /* - Connect up the DSP network - */ - - /* - When a sound is played, a subnetwork is set up in the DSP network which looks like this. - Wavetable is the drumloop sound, and it feeds its data from right to left. - - [DSPHEAD]<------------[DSPCHANNELMIXER] - */ - result = system->getDSPHead(&dsphead); - ERRCHECK(result); - - result = dsphead->getInput(0, &dspchannelmixer, 0); - ERRCHECK(result); - - /* - Now disconnect channeldsp head from wavetable to look like this. - - [DSPHEAD] [DSPCHANNELMIXER] - */ - result = dsphead->disconnectFrom(dspchannelmixer); - ERRCHECK(result); - - /* - Now connect the 2 effects to channeldsp head. - Store the 2 connections this makes so we can set their speakerlevels later. - - [DSPLOWPASS] - /x - [DSPHEAD] [DSPCHANNELMIXER] - \y - [DSPCHORUS] - */ - result = dsphead->addInput(dsplowpass, &dsplowpassconnection); /* x = dsplowpassconnection */ - ERRCHECK(result); - result = dsphead->addInput(dspchorus, &dspchorusconnection); /* y = dspchorusconnection */ - ERRCHECK(result); - - /* - Now connect the wavetable to the 2 effects - - [DSPLOWPASS] - /x \ - [DSPHEAD] [DSPCHANNELMIXER] - \y / - [DSPCHORUS] - */ - result = dsplowpass->addInput(dspchannelmixer, 0); /* Null for connection - we dont care about it. */ - ERRCHECK(result); - result = dspchorus->addInput(dspchannelmixer, 0); /* Null for connection - we dont care about it. */ - ERRCHECK(result); - - /* - Now the drumloop will be twice as loud, because it is being split into 2, then recombined at the end. - What we really want is to only feed the dspchannelmixer->dsplowpass through the left speaker, and - dspchannelmixer->dspchorus to the right speaker. - We can do that simply by setting the pan, or speaker levels of the connections. - - [DSPLOWPASS] - /x=1,0 \ - [DSPHEAD] [DSPCHANNELMIXER] - \y=0,1 / - [DSPCHORUS] - */ - { - float leftinputon[2] = { 1.0f, 0.0f }; - float rightinputon[2] = { 0.0f, 1.0f }; - float inputsoff[2] = { 0.0f, 0.0f }; - - result = dsplowpassconnection->setLevels(FMOD_SPEAKER_FRONT_LEFT, leftinputon, 2); - ERRCHECK(result); - result = dsplowpassconnection->setLevels(FMOD_SPEAKER_FRONT_RIGHT, inputsoff, 2); - ERRCHECK(result); - - result = dspchorusconnection->setLevels(FMOD_SPEAKER_FRONT_LEFT, inputsoff, 2); - ERRCHECK(result); - result = dspchorusconnection->setLevels(FMOD_SPEAKER_FRONT_RIGHT, rightinputon, 2); - ERRCHECK(result); - } - - result = dsplowpass->setBypass(true); - result = dspchorus->setBypass(true); - - result = dsplowpass->setActive(true); - result = dspchorus->setActive(true); - - /* - Main loop. - */ - do - { - if (kbhit()) - { - key = getch(); - - switch (key) - { - case 'l' : - case 'L' : - { - static bool lowpass = false; - - dsplowpass->setBypass(lowpass); - - lowpass = !lowpass; - break; - } - case 'r' : - case 'R' : - { - static bool chorus = false; - - dspchorus->setBypass(chorus); - - chorus = !chorus; - break; - } - case '[' : - { - channel->getPan(&pan); - pan -= 0.1f; - if (pan < -1) - { - pan = -1; - } - channel->setPan(pan); - break; - } - case ']' : - { - channel->getPan(&pan); - pan += 0.1f; - if (pan > 1) - { - pan = 1; - } - channel->setPan(pan); - break; - } - } - } - - system->update(); - - { - int channelsplaying = 0; - - system->getChannelsPlaying(&channelsplaying); - - printf("Channels Playing %2d : Pan = %.02f\r", channelsplaying, pan); - } - - fflush(stdout); - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = sound->release(); - ERRCHECK(result); - - result = dsplowpass->release(); - ERRCHECK(result); - result = dspchorus->release(); - ERRCHECK(result); - - result = system->close(); - ERRCHECK(result); - result = system->release(); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/examples/effects/Makefile b/CocosDenshion/third_party/fmod/examples/effects/Makefile deleted file mode 100644 index 714215c0bb..0000000000 --- a/CocosDenshion/third_party/fmod/examples/effects/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -effects_cpp: main.cpp - g++ -O3 -o effects main.cpp ../../api/lib/libfmodex.so -pthread - -effects_c: main.c - g++ -O3 -o effects main.c ../../api/lib/libfmodex.so -pthread - -run: - ./effects - -clean: - rm -f effects diff --git a/CocosDenshion/third_party/fmod/examples/effects/effects b/CocosDenshion/third_party/fmod/examples/effects/effects deleted file mode 100755 index d414f54deb..0000000000 Binary files a/CocosDenshion/third_party/fmod/examples/effects/effects and /dev/null differ diff --git a/CocosDenshion/third_party/fmod/examples/effects/main.c b/CocosDenshion/third_party/fmod/examples/effects/main.c deleted file mode 100644 index c6ab6cf8d0..0000000000 --- a/CocosDenshion/third_party/fmod/examples/effects/main.c +++ /dev/null @@ -1,333 +0,0 @@ -/*=============================================================================================== - Effects Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to apply some of the built in software effects to sounds. - This example filters the global mix. All software sounds played here would be filtered in the - same way. - To filter per channel, and not have other channels affected, simply replace FMOD_System_AddDSP with - FMOD_Channel_AddDSP. - Note in this example you don't have to add and remove units each time, you could simply add them - all at the start then use FMOD_DSP_SetActive to toggle them on and off. -===============================================================================================*/ -#include "../../api/inc/fmod.h" -#include "../../api/inc/fmod_dsp.h" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD_SYSTEM *system = 0; - FMOD_SOUND *sound = 0; - FMOD_CHANNEL *channel = 0; - FMOD_DSP *dsplowpass = 0; - FMOD_DSP *dsphighpass = 0; - FMOD_DSP *dspecho = 0; - FMOD_DSP *dspflange = 0; - FMOD_DSP *dspdistortion = 0; - FMOD_DSP *dspchorus = 0; - FMOD_DSP *dspparameq = 0; - FMOD_RESULT result; - int key; - unsigned int version; - - /* - Create a System object and initialize. - */ - result = FMOD_System_Create(&system); - ERRCHECK(result); - - result = FMOD_System_GetVersion(system, &version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - result = FMOD_System_Init(system, 32, FMOD_INIT_NORMAL, NULL); - ERRCHECK(result); - - result = FMOD_System_CreateSound(system, "../media/drumloop.wav", FMOD_SOFTWARE, 0, &sound); - ERRCHECK(result); - - printf("=================================================================\n"); - printf("Effects Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("=================================================================\n"); - printf("\n"); - printf("Press SPACE to paused/unpause sound.\n"); - printf("Press 1 to toggle dsplowpass effect.\n"); - printf("Press 2 to toggle dsphighpass effect.\n"); - printf("Press 3 to toggle dspecho effect.\n"); - printf("Press 4 to toggle dspflange effect.\n"); - printf("Press 5 to toggle dspdistortion effect.\n"); - printf("Press 6 to toggle dspchorus effect.\n"); - printf("Press 7 to toggle dspparameq effect.\n"); - printf("Press 'Esc' to quit\n"); - printf("\n"); - - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound, 0, &channel); - ERRCHECK(result); - - /* - Create some effects to play with. - */ - result = FMOD_System_CreateDSPByType(system, FMOD_DSP_TYPE_LOWPASS, &dsplowpass); - ERRCHECK(result); - result = FMOD_System_CreateDSPByType(system, FMOD_DSP_TYPE_HIGHPASS, &dsphighpass); - ERRCHECK(result); - result = FMOD_System_CreateDSPByType(system, FMOD_DSP_TYPE_ECHO, &dspecho); - ERRCHECK(result); - result = FMOD_System_CreateDSPByType(system, FMOD_DSP_TYPE_FLANGE, &dspflange); - ERRCHECK(result); - result = FMOD_System_CreateDSPByType(system, FMOD_DSP_TYPE_DISTORTION, &dspdistortion); - ERRCHECK(result); - result = FMOD_System_CreateDSPByType(system, FMOD_DSP_TYPE_CHORUS, &dspchorus); - ERRCHECK(result); - result = FMOD_System_CreateDSPByType(system, FMOD_DSP_TYPE_PARAMEQ, &dspparameq); - ERRCHECK(result); - - /* - Main loop. - */ - do - { - if (kbhit()) - { - key = getch(); - - switch (key) - { - case ' ' : - { - int paused; - - FMOD_Channel_GetPaused(channel, &paused); - ERRCHECK(result); - - paused = !paused; - - result = FMOD_Channel_SetPaused(channel, paused); - ERRCHECK(result); - break; - } - case '1' : - { - int active; - - result = FMOD_DSP_GetActive(dsplowpass, &active); - ERRCHECK(result); - - if (active) - { - result = FMOD_DSP_Remove(dsplowpass); - ERRCHECK(result); - } - else - { - result = FMOD_System_AddDSP(system, dsplowpass, 0); - ERRCHECK(result); - } - break; - } - case '2' : - { - int active; - - result = FMOD_DSP_GetActive(dsphighpass, &active); - ERRCHECK(result); - - if (active) - { - result = FMOD_DSP_Remove(dsphighpass); - ERRCHECK(result); - } - else - { - result = FMOD_System_AddDSP(system, dsphighpass, 0); - ERRCHECK(result); - } - break; - } - case '3' : - { - int active; - - result = FMOD_DSP_GetActive(dspecho, &active); - ERRCHECK(result); - - if (active) - { - result = FMOD_DSP_Remove(dspecho); - ERRCHECK(result); - } - else - { - result = FMOD_System_AddDSP(system, dspecho, 0); - ERRCHECK(result); - - result = FMOD_DSP_SetParameter(dspecho, FMOD_DSP_ECHO_DELAY, 50.0f); - ERRCHECK(result); - } - break; - } - case '4' : - { - int active; - - result = FMOD_DSP_GetActive(dspflange, &active); - ERRCHECK(result); - - if (active) - { - result = FMOD_DSP_Remove(dspflange); - ERRCHECK(result); - } - else - { - result = FMOD_System_AddDSP(system, dspflange, 0); - ERRCHECK(result); - } - break; - } - case '5' : - { - int active; - - result = FMOD_DSP_GetActive(dspdistortion, &active); - ERRCHECK(result); - - if (active) - { - result = FMOD_DSP_Remove(dspdistortion); - ERRCHECK(result); - } - else - { - result = FMOD_System_AddDSP(system, dspdistortion, 0); - ERRCHECK(result); - - result = FMOD_DSP_SetParameter(dspdistortion, FMOD_DSP_DISTORTION_LEVEL, 0.8f); - ERRCHECK(result); - } - break; - } - case '6' : - { - int active; - - result = FMOD_DSP_GetActive(dspchorus, &active); - ERRCHECK(result); - - if (active) - { - result = FMOD_DSP_Remove(dspchorus); - ERRCHECK(result); - } - else - { - result = FMOD_System_AddDSP(system, dspchorus, 0); - ERRCHECK(result); - } - break; - } - case '7' : - { - int active; - - result = FMOD_DSP_GetActive(dspparameq, &active); - ERRCHECK(result); - - if (active) - { - result = FMOD_DSP_Remove(dspparameq); - ERRCHECK(result); - } - else - { - result = FMOD_System_AddDSP(system, dspparameq, 0); - ERRCHECK(result); - - result = FMOD_DSP_SetParameter(dspparameq, FMOD_DSP_PARAMEQ_CENTER, 5000.0f); - ERRCHECK(result); - result = FMOD_DSP_SetParameter(dspparameq, FMOD_DSP_PARAMEQ_GAIN, 0.0f); - ERRCHECK(result); - } - break; - } - } - } - - FMOD_System_Update(system); - - { - int paused = 0; - int dsplowpass_active; - int dsphighpass_active; - int dspecho_active; - int dspflange_active; - int dspdistortion_active; - int dspchorus_active; - int dspparameq_active; - - FMOD_DSP_GetActive(dsplowpass , &dsplowpass_active); - FMOD_DSP_GetActive(dsphighpass , &dsphighpass_active); - FMOD_DSP_GetActive(dspecho , &dspecho_active); - FMOD_DSP_GetActive(dspflange , &dspflange_active); - FMOD_DSP_GetActive(dspdistortion, &dspdistortion_active); - FMOD_DSP_GetActive(dspchorus , &dspchorus_active); - FMOD_DSP_GetActive(dspparameq , &dspparameq_active); - - if (channel) - { - result = FMOD_Channel_GetPaused(channel, &paused); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - } - - printf("%s : lowpass[%c] highpass[%c] echo[%c] flange[%c] dist[%c] chorus[%c] parameq[%c]\r", - paused ? "Paused " : "Playing", - dsplowpass_active ? 'x' : ' ', - dsphighpass_active ? 'x' : ' ', - dspecho_active ? 'x' : ' ', - dspflange_active ? 'x' : ' ', - dspdistortion_active ? 'x' : ' ', - dspchorus_active ? 'x' : ' ', - dspparameq_active ? 'x' : ' '); - fflush(stdout); - } - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = FMOD_Sound_Release(sound); - ERRCHECK(result); - result = FMOD_System_Close(system); - ERRCHECK(result); - result = FMOD_System_Release(system); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/examples/effects/main.cpp b/CocosDenshion/third_party/fmod/examples/effects/main.cpp deleted file mode 100644 index c417eb045f..0000000000 --- a/CocosDenshion/third_party/fmod/examples/effects/main.cpp +++ /dev/null @@ -1,333 +0,0 @@ -/*=============================================================================================== - Effects Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to apply some of the built in software effects to sounds. - This example filters the global mix. All software sounds played here would be filtered in the - same way. - To filter per channel, and not have other channels affected, simply replace system->addDSP with - channel->addDSP. - Note in this example you don't have to add and remove units each time, you could simply add them - all at the start then use DSP::setActive to toggle them on and off. -===============================================================================================*/ -#include "../../api/inc/fmod.hpp" -#include "../../api/inc/fmod_dsp.h" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD::System *system = 0; - FMOD::Sound *sound = 0; - FMOD::Channel *channel = 0; - FMOD::DSP *dsplowpass = 0; - FMOD::DSP *dsphighpass = 0; - FMOD::DSP *dspecho = 0; - FMOD::DSP *dspflange = 0; - FMOD::DSP *dspdistortion = 0; - FMOD::DSP *dspchorus = 0; - FMOD::DSP *dspparameq = 0; - FMOD_RESULT result; - int key; - unsigned int version; - - /* - Create a System object and initialize. - */ - result = FMOD::System_Create(&system); - ERRCHECK(result); - - result = system->getVersion(&version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - result = system->init(32, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - result = system->createSound("../media/drumloop.wav", FMOD_SOFTWARE, 0, &sound); - ERRCHECK(result); - - printf("=================================================================\n"); - printf("Effects Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("=================================================================\n"); - printf("\n"); - printf("Press SPACE to paused/unpause sound.\n"); - printf("Press 1 to toggle dsplowpass effect.\n"); - printf("Press 2 to toggle dsphighpass effect.\n"); - printf("Press 3 to toggle dspecho effect.\n"); - printf("Press 4 to toggle dspflange effect.\n"); - printf("Press 5 to toggle dspdistortion effect.\n"); - printf("Press 6 to toggle dspchorus effect.\n"); - printf("Press 7 to toggle dspparameq effect.\n"); - printf("Press 'Esc' to quit\n"); - printf("\n"); - - result = system->playSound(FMOD_CHANNEL_FREE, sound, false, &channel); - ERRCHECK(result); - - /* - Create some effects to play with. - */ - result = system->createDSPByType(FMOD_DSP_TYPE_LOWPASS, &dsplowpass); - ERRCHECK(result); - result = system->createDSPByType(FMOD_DSP_TYPE_HIGHPASS, &dsphighpass); - ERRCHECK(result); - result = system->createDSPByType(FMOD_DSP_TYPE_ECHO, &dspecho); - ERRCHECK(result); - result = system->createDSPByType(FMOD_DSP_TYPE_FLANGE, &dspflange); - ERRCHECK(result); - result = system->createDSPByType(FMOD_DSP_TYPE_DISTORTION, &dspdistortion); - ERRCHECK(result); - result = system->createDSPByType(FMOD_DSP_TYPE_CHORUS, &dspchorus); - ERRCHECK(result); - result = system->createDSPByType(FMOD_DSP_TYPE_PARAMEQ, &dspparameq); - ERRCHECK(result); - - /* - Main loop. - */ - do - { - if (kbhit()) - { - key = getch(); - - switch (key) - { - case ' ' : - { - bool paused; - - channel->getPaused(&paused); - ERRCHECK(result); - - paused = !paused; - - result = channel->setPaused(paused); - ERRCHECK(result); - break; - } - case '1' : - { - bool active; - - result = dsplowpass->getActive(&active); - ERRCHECK(result); - - if (active) - { - result = dsplowpass->remove(); - ERRCHECK(result); - } - else - { - result = system->addDSP(dsplowpass, 0); - ERRCHECK(result); - } - break; - } - case '2' : - { - bool active; - - result = dsphighpass->getActive(&active); - ERRCHECK(result); - - if (active) - { - result = dsphighpass->remove(); - ERRCHECK(result); - } - else - { - result = system->addDSP(dsphighpass, 0); - ERRCHECK(result); - } - break; - } - case '3' : - { - bool active; - - result = dspecho->getActive(&active); - ERRCHECK(result); - - if (active) - { - result = dspecho->remove(); - ERRCHECK(result); - } - else - { - result = system->addDSP(dspecho, 0); - ERRCHECK(result); - - result = dspecho->setParameter(FMOD_DSP_ECHO_DELAY, 50.0f); - ERRCHECK(result); - } - break; - } - case '4' : - { - bool active; - - result = dspflange->getActive(&active); - ERRCHECK(result); - - if (active) - { - result = dspflange->remove(); - ERRCHECK(result); - } - else - { - result = system->addDSP(dspflange, 0); - ERRCHECK(result); - } - break; - } - case '5' : - { - bool active; - - result = dspdistortion->getActive(&active); - ERRCHECK(result); - - if (active) - { - result = dspdistortion->remove(); - ERRCHECK(result); - } - else - { - result = system->addDSP(dspdistortion, 0); - ERRCHECK(result); - - result = dspdistortion->setParameter(FMOD_DSP_DISTORTION_LEVEL, 0.8f); - ERRCHECK(result); - } - break; - } - case '6' : - { - bool active; - - result = dspchorus->getActive(&active); - ERRCHECK(result); - - if (active) - { - result = dspchorus->remove(); - ERRCHECK(result); - } - else - { - result = system->addDSP(dspchorus, 0); - ERRCHECK(result); - } - break; - } - case '7' : - { - bool active; - - result = dspparameq->getActive(&active); - ERRCHECK(result); - - if (active) - { - result = dspparameq->remove(); - ERRCHECK(result); - } - else - { - result = system->addDSP(dspparameq, 0); - ERRCHECK(result); - - result = dspparameq->setParameter(FMOD_DSP_PARAMEQ_CENTER, 5000.0f); - ERRCHECK(result); - result = dspparameq->setParameter(FMOD_DSP_PARAMEQ_GAIN, 0.0f); - ERRCHECK(result); - } - break; - } - } - } - - system->update(); - - { - bool paused = 0; - bool dsplowpass_active; - bool dsphighpass_active; - bool dspecho_active; - bool dspflange_active; - bool dspdistortion_active; - bool dspchorus_active; - bool dspparameq_active; - - dsplowpass ->getActive(&dsplowpass_active); - dsphighpass ->getActive(&dsphighpass_active); - dspecho ->getActive(&dspecho_active); - dspflange ->getActive(&dspflange_active); - dspdistortion->getActive(&dspdistortion_active); - dspchorus ->getActive(&dspchorus_active); - dspparameq ->getActive(&dspparameq_active); - - if (channel) - { - result = channel->getPaused(&paused); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - } - - printf("%s : lowpass[%c] highpass[%c] echo[%c] flange[%c] dist[%c] chorus[%c] parameq[%c]\r", - paused ? "Paused " : "Playing", - dsplowpass_active ? 'x' : ' ', - dsphighpass_active ? 'x' : ' ', - dspecho_active ? 'x' : ' ', - dspflange_active ? 'x' : ' ', - dspdistortion_active ? 'x' : ' ', - dspchorus_active ? 'x' : ' ', - dspparameq_active ? 'x' : ' '); - fflush(stdout); - } - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = sound->release(); - ERRCHECK(result); - result = system->close(); - ERRCHECK(result); - result = system->release(); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/examples/filecallbacks/Makefile b/CocosDenshion/third_party/fmod/examples/filecallbacks/Makefile deleted file mode 100644 index 741a5e3c6b..0000000000 --- a/CocosDenshion/third_party/fmod/examples/filecallbacks/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -filecallbacks_cpp: main.cpp - g++ -O3 -o filecallbacks main.cpp ../../api/lib/libfmodex.so -pthread - -filecallbacks_c: main.c - g++ -O3 -o filecallbacks main.c ../../api/lib/libfmodex.so -pthread - -run: - ./filecallbacks - -clean: - rm -f filecallbacks diff --git a/CocosDenshion/third_party/fmod/examples/filecallbacks/main.c b/CocosDenshion/third_party/fmod/examples/filecallbacks/main.c deleted file mode 100644 index fe106fb941..0000000000 --- a/CocosDenshion/third_party/fmod/examples/filecallbacks/main.c +++ /dev/null @@ -1,230 +0,0 @@ -/*=============================================================================================== - File Callbacks Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example is a modified version of the playstream example. - It shows the correct way declare and handle fmod file callbacks with System::setFileSystem. -===============================================================================================*/ -#include "../../api/inc/fmod.h" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -/* - TIPS: - - 1. use F_CALLBACK. Do NOT force cast your own function to fmod's callback type. - 2. return FMOD_ERR_FILE_NOTFOUND in open as required. - 3. return number of bytes read in read callback. Do not get the size and count - around the wrong way in fread for example, this would return 1 instead of the number of bytes read. - - QUESTIONS: - - 1. Why does fmod seek to the end and read? Because it is looking for ID3V1 tags. - Use FMOD_IGNORETAGS in FMOD_System_CreateSound / FMOD_System_CreateStream if you don't like this behaviour. -*/ - -FMOD_RESULT F_CALLBACK myopen(const char *name, int unicode, unsigned int *filesize, void **handle, void **userdata) -{ - if (name) - { - FILE *fp; - - fp = fopen(name, "rb"); - if (!fp) - { - return FMOD_ERR_FILE_NOTFOUND; - } - - fseek(fp, 0, SEEK_END); - *filesize = ftell(fp); - fseek(fp, 0, SEEK_SET); - - *userdata = (void *)0x12345678; - *handle = fp; - } - - return FMOD_OK; -} - -FMOD_RESULT F_CALLBACK myclose(void *handle, void *userdata) -{ - if (!handle) - { - return FMOD_ERR_INVALID_PARAM; - } - - fclose((FILE *)handle); - - return FMOD_OK; -} - -FMOD_RESULT F_CALLBACK myread(void *handle, void *buffer, unsigned int sizebytes, unsigned int *bytesread, void *userdata) -{ - if (!handle) - { - return FMOD_ERR_INVALID_PARAM; - } - - if (bytesread) - { - *bytesread = (int)fread(buffer, 1, sizebytes, (FILE *)handle); - - if (*bytesread < sizebytes) - { - return FMOD_ERR_FILE_EOF; - } - } - - return FMOD_OK; -} - -FMOD_RESULT F_CALLBACK myseek(void *handle, unsigned int pos, void *userdata) -{ - if (!handle) - { - return FMOD_ERR_INVALID_PARAM; - } - - fseek((FILE *)handle, pos, SEEK_SET); - - return FMOD_OK; -} - - -int main(int argc, char *argv[]) -{ - FMOD_SYSTEM *system; - FMOD_SOUND *sound; - FMOD_CHANNEL *channel = 0; - FMOD_RESULT result; - int key; - unsigned int version; - - /* - Create a System object and initialize. - */ - result = FMOD_System_Create(&system); - ERRCHECK(result); - - result = FMOD_System_GetVersion(system, &version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - result = FMOD_System_Init(system, 1, FMOD_INIT_NORMAL, NULL); - ERRCHECK(result); - - result = FMOD_System_SetFileSystem(system, myopen, myclose, myread, myseek, 0, 0, 2048); - ERRCHECK(result); - - result = FMOD_System_CreateStream(system, "../media/wave.mp3", FMOD_HARDWARE | FMOD_LOOP_NORMAL | FMOD_2D, 0, &sound); - ERRCHECK(result); - - printf("====================================================================\n"); - printf("PlayStream Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("====================================================================\n"); - printf("\n"); - printf("Press space to pause, Esc to quit\n"); - printf("\n"); - - /* - Play the sound. - */ - - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound, 0, &channel); - ERRCHECK(result); - - /* - Main loop. - */ - do - { - if (kbhit()) - { - key = getch(); - - switch (key) - { - case ' ' : - { - int paused; - FMOD_Channel_GetPaused(channel, &paused); - FMOD_Channel_SetPaused(channel, !paused); - break; - } - } - } - - FMOD_System_Update(system); - - if (channel) - { - unsigned int ms; - unsigned int lenms; - int playing; - int paused; - - FMOD_Channel_IsPlaying(channel, &playing); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - result = FMOD_Channel_GetPaused(channel, &paused); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - result = FMOD_Channel_GetPosition(channel, &ms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - result = FMOD_Sound_GetLength(sound, &lenms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - printf("Time %02d:%02d:%02d/%02d:%02d:%02d : %s\r", ms / 1000 / 60, ms / 1000 % 60, ms / 10 % 100, lenms / 1000 / 60, lenms / 1000 % 60, lenms / 10 % 100, paused ? "Paused " : playing ? "Playing" : "Stopped"); - fflush(stdout); - } - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = FMOD_Sound_Release(sound); - ERRCHECK(result); - result = FMOD_System_Close(system); - ERRCHECK(result); - result = FMOD_System_Release(system); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/examples/filecallbacks/main.cpp b/CocosDenshion/third_party/fmod/examples/filecallbacks/main.cpp deleted file mode 100644 index a4730916d1..0000000000 --- a/CocosDenshion/third_party/fmod/examples/filecallbacks/main.cpp +++ /dev/null @@ -1,229 +0,0 @@ -/*=============================================================================================== - File Callbacks Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example is a modified version of the playstream example. - It shows the correct way declare and handle fmod file callbacks with System::setFileSystem. -===============================================================================================*/ -#include "../../api/inc/fmod.hpp" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -/* - TIPS: - - 1. use F_CALLBACK. Do NOT force cast your own function to fmod's callback type. - 2. return FMOD_ERR_FILE_NOTFOUND in open as required. - 3. return number of bytes read in read callback. Do not get the size and count - around the wrong way in fread for example, this would return 1 instead of the number of bytes read. - - QUESTIONS: - - 1. Why does fmod seek to the end and read? Because it is looking for ID3V1 tags. - Use FMOD_IGNORETAGS in System::createSound / System::createStream if you don't like this behaviour. - -*/ - -FMOD_RESULT F_CALLBACK myopen(const char *name, int unicode, unsigned int *filesize, void **handle, void **userdata) -{ - if (name) - { - FILE *fp; - - fp = fopen(name, "rb"); - if (!fp) - { - return FMOD_ERR_FILE_NOTFOUND; - } - - fseek(fp, 0, SEEK_END); - *filesize = ftell(fp); - fseek(fp, 0, SEEK_SET); - - *userdata = (void *)0x12345678; - *handle = fp; - } - - return FMOD_OK; -} - -FMOD_RESULT F_CALLBACK myclose(void *handle, void *userdata) -{ - if (!handle) - { - return FMOD_ERR_INVALID_PARAM; - } - - fclose((FILE *)handle); - - return FMOD_OK; -} - -FMOD_RESULT F_CALLBACK myread(void *handle, void *buffer, unsigned int sizebytes, unsigned int *bytesread, void *userdata) -{ - if (!handle) - { - return FMOD_ERR_INVALID_PARAM; - } - - if (bytesread) - { - *bytesread = (int)fread(buffer, 1, sizebytes, (FILE *)handle); - - if (*bytesread < sizebytes) - { - return FMOD_ERR_FILE_EOF; - } - } - - return FMOD_OK; -} - -FMOD_RESULT F_CALLBACK myseek(void *handle, unsigned int pos, void *userdata) -{ - if (!handle) - { - return FMOD_ERR_INVALID_PARAM; - } - - fseek((FILE *)handle, pos, SEEK_SET); - - return FMOD_OK; -} - - -int main(int argc, char *argv[]) -{ - FMOD::System *system; - FMOD::Sound *sound; - FMOD::Channel *channel = 0; - FMOD_RESULT result; - int key; - unsigned int version; - - /* - Create a System object and initialize. - */ - result = FMOD::System_Create(&system); - ERRCHECK(result); - - result = system->getVersion(&version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - result = system->init(1, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - result = system->setFileSystem(myopen, myclose, myread, myseek, 0, 0, 2048); - ERRCHECK(result); - - result = system->createStream("../media/wave.mp3", FMOD_HARDWARE | FMOD_LOOP_NORMAL | FMOD_2D, 0, &sound); - ERRCHECK(result); - - printf("========================================================================\n"); - printf("File Callbacks Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("========================================================================\n"); - printf("\n"); - printf("Press space to pause, Esc to quit\n"); - printf("\n"); - - /* - Play the sound. - */ - - result = system->playSound(FMOD_CHANNEL_FREE, sound, false, &channel); - ERRCHECK(result); - - /* - Main loop. - */ - do - { - if (kbhit()) - { - key = getch(); - - switch (key) - { - case ' ' : - { - bool paused; - channel->getPaused(&paused); - channel->setPaused(!paused); - break; - } - } - } - - system->update(); - - if (channel) - { - unsigned int ms; - unsigned int lenms; - bool playing; - bool paused; - - channel->isPlaying(&playing); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE)) - { - ERRCHECK(result); - } - - result = channel->getPaused(&paused); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE)) - { - ERRCHECK(result); - } - - result = channel->getPosition(&ms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE)) - { - ERRCHECK(result); - } - - result = sound->getLength(&lenms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE)) - { - ERRCHECK(result); - } - - printf("Time %02d:%02d:%02d/%02d:%02d:%02d : %s\r", ms / 1000 / 60, ms / 1000 % 60, ms / 10 % 100, lenms / 1000 / 60, lenms / 1000 % 60, lenms / 10 % 100, paused ? "Paused " : playing ? "Playing" : "Stopped"); - fflush(stdout); - } - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = sound->release(); - ERRCHECK(result); - result = system->close(); - ERRCHECK(result); - result = system->release(); - ERRCHECK(result); - - return 0; -} diff --git a/CocosDenshion/third_party/fmod/examples/generatetone/Makefile b/CocosDenshion/third_party/fmod/examples/generatetone/Makefile deleted file mode 100644 index bc7f3cc699..0000000000 --- a/CocosDenshion/third_party/fmod/examples/generatetone/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -generatetone_cpp: main.cpp - g++ -O3 -o generatetone main.cpp ../../api/lib/libfmodex.so - -generatetone_c: main.c - g++ -O3 -o generatetone main.c ../../api/lib/libfmodex.so - -run: - ./generatetone - -clean: - rm -f generatetone diff --git a/CocosDenshion/third_party/fmod/examples/generatetone/main.c b/CocosDenshion/third_party/fmod/examples/generatetone/main.c deleted file mode 100644 index 2c668b92cf..0000000000 --- a/CocosDenshion/third_party/fmod/examples/generatetone/main.c +++ /dev/null @@ -1,230 +0,0 @@ -/*=============================================================================================== - GenerateTone Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how simply play generated tones using FMOD_System_PlayDSP instead of - manually connecting and disconnecting DSP units. -===============================================================================================*/ -#include "../../api/inc/fmod.h" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD_SYSTEM *system; - FMOD_CHANNEL *channel = 0; - FMOD_DSP *dsp = 0; - FMOD_RESULT result; - int key; - unsigned int version; - - /* - Create a System object and initialize. - */ - result = FMOD_System_Create(&system); - ERRCHECK(result); - - result = FMOD_System_GetVersion(system, &version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - getch(); - return 0; - } - - result = FMOD_System_Init(system, 32, FMOD_INIT_NORMAL, NULL); - ERRCHECK(result); - - /* - Create DSP units for each type of noise we want. - */ - result = FMOD_System_CreateDSPByType(system, FMOD_DSP_TYPE_OSCILLATOR, &dsp); - ERRCHECK(result); - result = FMOD_DSP_SetParameter(dsp, FMOD_DSP_OSCILLATOR_RATE, 440.0f); - ERRCHECK(result); - - printf("======================================================================\n"); - printf("GenerateTone Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("======================================================================\n\n"); - printf("\n"); - printf("Press '1' to play a sine wave\n"); - printf("Press '2' to play a square wave\n"); - printf("Press '3' to play a triangle wave\n"); - printf("Press '4' to play a saw wave\n"); - printf("Press '5' to play a white noise\n"); - printf("Press 's' to stop channel\n"); - printf("\n"); - printf("Press 'v'/'V' to change channel volume\n"); - printf("Press 'f'/'F' to change channel frequency\n"); - printf("Press '['/']' to change channel pan\n"); - printf("Press 'Esc' to quit\n"); - printf("\n"); - - /* - Main loop - */ - do - { - if (kbhit()) - { - key = getch(); - - switch (key) - { - case '1' : - { - result = FMOD_System_PlayDSP(system, FMOD_CHANNEL_REUSE, dsp, TRUE, &channel); - - FMOD_Channel_SetVolume(channel, 0.5f); - result = FMOD_DSP_SetParameter(dsp, FMOD_DSP_OSCILLATOR_TYPE, 0); - ERRCHECK(result); - FMOD_Channel_SetPaused(channel, FALSE); - break; - } - case '2' : - { - result = FMOD_System_PlayDSP(system, FMOD_CHANNEL_REUSE, dsp, TRUE, &channel); - FMOD_Channel_SetVolume(channel, 0.125f); - result = FMOD_DSP_SetParameter(dsp, FMOD_DSP_OSCILLATOR_TYPE, 1); - ERRCHECK(result); - FMOD_Channel_SetPaused(channel, FALSE); - break; - } - case '3' : - { - result = FMOD_System_PlayDSP(system, FMOD_CHANNEL_REUSE, dsp, TRUE, &channel); - FMOD_Channel_SetVolume(channel, 0.5f); - result = FMOD_DSP_SetParameter(dsp, FMOD_DSP_OSCILLATOR_TYPE, 2); - ERRCHECK(result); - FMOD_Channel_SetPaused(channel, FALSE); - break; - } - case '4' : - { - result = FMOD_System_PlayDSP(system, FMOD_CHANNEL_REUSE, dsp, TRUE, &channel); - FMOD_Channel_SetVolume(channel, 0.125f); - result = FMOD_DSP_SetParameter(dsp, FMOD_DSP_OSCILLATOR_TYPE, 4); - ERRCHECK(result); - FMOD_Channel_SetPaused(channel, FALSE); - break; - } - case '5' : - { - result = FMOD_System_PlayDSP(system, FMOD_CHANNEL_REUSE, dsp, TRUE, &channel); - FMOD_Channel_SetVolume(channel, 0.25f); - result = FMOD_DSP_SetParameter(dsp, FMOD_DSP_OSCILLATOR_TYPE, 5); - ERRCHECK(result); - FMOD_Channel_SetPaused(channel, FALSE); - break; - } - case 's' : - { - FMOD_Channel_Stop(channel); - break; - } - case 'v' : - { - float volume; - - FMOD_Channel_GetVolume(channel, &volume); - volume -= 0.1f; - FMOD_Channel_SetVolume(channel, volume); - break; - } - case 'V' : - { - float volume; - - FMOD_Channel_GetVolume(channel, &volume); - volume += 0.1f; - FMOD_Channel_SetVolume(channel, volume); - break; - } - case 'f' : - { - float frequency; - - FMOD_Channel_GetFrequency(channel, &frequency); - frequency -= 500.0f; - FMOD_Channel_SetFrequency(channel, frequency); - break; - } - case 'F' : - { - float frequency; - - FMOD_Channel_GetFrequency(channel, &frequency); - frequency += 500.0f; - FMOD_Channel_SetFrequency(channel, frequency); - break; - } - case '[' : - { - float pan; - - FMOD_Channel_GetPan(channel, &pan); - pan -= 0.1f; - FMOD_Channel_SetPan(channel, pan); - break; - } - case ']' : - { - float pan; - - FMOD_Channel_GetPan(channel, &pan); - pan += 0.1f; - FMOD_Channel_SetPan(channel, pan); - break; - } - } - } - - FMOD_System_Update(system); - - { - float frequency = 0, volume = 0, pan = 0; - int playing = FALSE; - - if (channel) - { - FMOD_Channel_GetFrequency(channel, &frequency); - FMOD_Channel_GetVolume(channel, &volume); - FMOD_Channel_GetPan(channel, &pan); - FMOD_Channel_IsPlaying(channel, &playing); - } - - printf("Channel %s : Frequency %.1f Volume %.1f Pan %.1f \r", playing ? "playing" : "stopped", frequency, volume, pan); - fflush(stdout); - } - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = FMOD_DSP_Release(dsp); - ERRCHECK(result); - result = FMOD_System_Close(system); - ERRCHECK(result); - result = FMOD_System_Release(system); - ERRCHECK(result); - - return 0; -} diff --git a/CocosDenshion/third_party/fmod/examples/generatetone/main.cpp b/CocosDenshion/third_party/fmod/examples/generatetone/main.cpp deleted file mode 100644 index eba958d49f..0000000000 --- a/CocosDenshion/third_party/fmod/examples/generatetone/main.cpp +++ /dev/null @@ -1,234 +0,0 @@ -/*=============================================================================================== - GenerateTone Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how simply play generated tones using FMOD::System::payDSP instead of - manually connecting and disconnecting DSP units. -===============================================================================================*/ -#include "../../api/inc/fmod.hpp" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD::System *system; - FMOD::Channel *channel = 0; - FMOD::DSP *dsp = 0; - FMOD_RESULT result; - int key; - unsigned int version; - - /* - Create a System object and initialize. - */ - result = FMOD::System_Create(&system); - ERRCHECK(result); - - result = system->getVersion(&version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - getch(); - return 0; - } - - result = system->init(32, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - /* - Create an oscillator DSP unit for the tone. - */ - result = system->createDSPByType(FMOD_DSP_TYPE_OSCILLATOR, &dsp); - ERRCHECK(result); - result = dsp->setParameter(FMOD_DSP_OSCILLATOR_RATE, 440.0f); - ERRCHECK(result); - - printf("======================================================================\n"); - printf("GenerateTone Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("======================================================================\n\n"); - printf("\n"); - printf("Press '1' to play a sine wave\n"); - printf("Press '2' to play a square wave\n"); - printf("Press '3' to play a triangle wave\n"); - printf("Press '4' to play a saw wave\n"); - printf("Press '5' to play a white noise\n"); - printf("Press 's' to stop channel\n"); - printf("\n"); - printf("Press 'v'/'V' to change channel volume\n"); - printf("Press 'f'/'F' to change channel frequency\n"); - printf("Press '['/']' to change channel pan\n"); - printf("Press 'Esc' to quit\n"); - printf("\n"); - - /* - Main loop - */ - do - { - if (kbhit()) - { - key = getch(); - - switch (key) - { - case '1' : - { - result = system->playDSP(FMOD_CHANNEL_REUSE, dsp, true, &channel); - - channel->setVolume(0.5f); - result = dsp->setParameter(FMOD_DSP_OSCILLATOR_TYPE, 0); - ERRCHECK(result); - channel->setPaused(false); - break; - } - case '2' : - { - result = system->playDSP(FMOD_CHANNEL_REUSE, dsp, true, &channel); - - channel->setVolume(0.125f); - result = dsp->setParameter(FMOD_DSP_OSCILLATOR_TYPE, 1); - ERRCHECK(result); - channel->setPaused(false); - break; - } - case '3' : - { - result = system->playDSP(FMOD_CHANNEL_REUSE, dsp, true, &channel); - - channel->setVolume(0.5f); - result = dsp->setParameter(FMOD_DSP_OSCILLATOR_TYPE, 2); - ERRCHECK(result); - channel->setPaused(false); - break; - } - case '4' : - { - result = system->playDSP(FMOD_CHANNEL_REUSE, dsp, true, &channel); - - channel->setVolume(0.125f); - result = dsp->setParameter(FMOD_DSP_OSCILLATOR_TYPE, 4); - ERRCHECK(result); - channel->setPaused(false); - break; - } - case '5' : - { - result = system->playDSP(FMOD_CHANNEL_REUSE, dsp, true, &channel); - - channel->setVolume(0.25f); - result = dsp->setParameter(FMOD_DSP_OSCILLATOR_TYPE, 5); - ERRCHECK(result); - channel->setPaused(false); - break; - } - case 's' : - { - channel->stop(); - break; - } - case 'v' : - { - float volume; - - channel->getVolume(&volume); - volume -= 0.1f; - channel->setVolume(volume); - break; - } - case 'V' : - { - float volume; - - channel->getVolume(&volume); - volume += 0.1f; - channel->setVolume(volume); - break; - } - case 'f' : - { - float frequency; - - channel->getFrequency(&frequency); - frequency -= 500.0f; - channel->setFrequency(frequency); - break; - } - case 'F' : - { - float frequency; - - channel->getFrequency(&frequency); - frequency += 500.0f; - channel->setFrequency(frequency); - break; - } - case '[' : - { - float pan; - - channel->getPan(&pan); - pan -= 0.1f; - channel->setPan(pan); - break; - } - case ']' : - { - float pan; - - channel->getPan(&pan); - pan += 0.1f; - channel->setPan(pan); - break; - } - } - } - - system->update(); - - { - float frequency = 0, volume = 0, pan = 0; - bool playing = false; - - if (channel) - { - channel->getFrequency(&frequency); - channel->getVolume(&volume); - channel->getPan(&pan); - channel->isPlaying(&playing); - } - - printf("Channel %s : Frequency %.1f Volume %.1f Pan %.1f \r", playing ? "playing" : "stopped", frequency, volume, pan); - fflush(stdout); - } - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = dsp->release(); - ERRCHECK(result); - result = system->close(); - ERRCHECK(result); - result = system->release(); - ERRCHECK(result); - - return 0; -} diff --git a/CocosDenshion/third_party/fmod/examples/loadfrommemory/Makefile b/CocosDenshion/third_party/fmod/examples/loadfrommemory/Makefile deleted file mode 100644 index ceec753a43..0000000000 --- a/CocosDenshion/third_party/fmod/examples/loadfrommemory/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -loadfrommemory_cpp: main.cpp - g++ -O3 -o loadfrommemory main.cpp ../../api/lib/libfmodex.so -pthread - -loadfrommemory_c: main.c - g++ -O3 -o loadfrommemory main.c ../../api/lib/libfmodex.so -pthread - -run: - ./loadfrommemory - -clean: - rm -f loadfrommemory diff --git a/CocosDenshion/third_party/fmod/examples/loadfrommemory/main.c b/CocosDenshion/third_party/fmod/examples/loadfrommemory/main.c deleted file mode 100644 index f6f3d7a577..0000000000 --- a/CocosDenshion/third_party/fmod/examples/loadfrommemory/main.c +++ /dev/null @@ -1,219 +0,0 @@ -/*=============================================================================================== - Load from memory example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example is simply a variant of the play sound example, but it loads the data into memory - then uses the 'load from memory' feature of System::createSound. -===============================================================================================*/ -#include "../../api/inc/fmod.h" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include -#include - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - -void LoadFileIntoMemory(const char *name, void **buff, int *length) -{ - FILE *fp = fopen(name, "rb"); - - fseek(fp, 0, SEEK_END); - *length = ftell(fp); - fseek(fp, 0, SEEK_SET); - - *buff = malloc(*length); - fread(*buff, *length, 1, fp); - - fclose(fp); -} - -int main(int argc, char *argv[]) -{ - FMOD_SYSTEM *system; - FMOD_SOUND *sound1, *sound2, *sound3; - FMOD_CHANNEL *channel = 0; - FMOD_RESULT result; - int key; - unsigned int version; - void *buff = 0; - int length = 0; - FMOD_CREATESOUNDEXINFO exinfo; - - /* - Create a System object and initialize. - */ - result = FMOD_System_Create(&system); - ERRCHECK(result); - - result = FMOD_System_GetVersion(system, &version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - result = FMOD_System_Init(system, 32, FMOD_INIT_NORMAL, NULL); - ERRCHECK(result); - - LoadFileIntoMemory("../media/drumloop.wav", &buff, &length); - memset(&exinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO)); - exinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO); - exinfo.length = length; - - result = FMOD_System_CreateSound(system, (const char *)buff, FMOD_HARDWARE | FMOD_OPENMEMORY, &exinfo, &sound1); - ERRCHECK(result); - - result = FMOD_Sound_SetMode(sound1, FMOD_LOOP_OFF); - ERRCHECK(result); - - free(buff); // don't need the original memory any more. Note! If loading as a stream, the memory must stay active so do not free it! - - LoadFileIntoMemory("../media/jaguar.wav", &buff, &length); - memset(&exinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO)); - exinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO); - exinfo.length = length; - - result = FMOD_System_CreateSound(system, (const char *)buff, FMOD_SOFTWARE | FMOD_OPENMEMORY, &exinfo, &sound2); - ERRCHECK(result); - - free(buff); // don't need the original memory any more. Note! If loading as a stream, the memory must stay active so do not free it! - - LoadFileIntoMemory("../media/swish.wav", &buff, &length); - memset(&exinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO)); - exinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO); - exinfo.length = length; - - result = FMOD_System_CreateSound(system, (const char *)buff, FMOD_HARDWARE | FMOD_OPENMEMORY, &exinfo, &sound3); - ERRCHECK(result); - - free(buff); // don't need the original memory any more. Note! If loading as a stream, the memory must stay active so do not free it! - - printf("==========================================================================\n"); - printf("Load from memory example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("==========================================================================\n"); - printf("\n"); - printf("Press '1' to play a mono sound using hardware mixing\n"); - printf("Press '2' to play a mono sound using software mixing\n"); - printf("Press '3' to play a stereo sound using hardware mixing\n"); - printf("Press 'Esc' to quit\n"); - printf("\n"); - - /* - Main loop. - */ - do - { - if (kbhit()) - { - key = getch(); - - switch (key) - { - case '1' : - { - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound1, 0, &channel); - ERRCHECK(result); - break; - } - case '2' : - { - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound2, 0, &channel); - ERRCHECK(result); - break; - } - case '3' : - { - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound3, 0, &channel); - ERRCHECK(result); - break; - } - } - } - - FMOD_System_Update(system); - - { - unsigned int ms = 0; - unsigned int lenms = 0; - int playing = 0; - int paused = 0; - int channelsplaying = 0; - - if (channel) - { - FMOD_SOUND *currentsound = 0; - - result = FMOD_Channel_IsPlaying(channel, &playing); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - result = FMOD_Channel_GetPaused(channel, &paused); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - result = FMOD_Channel_GetPosition(channel, &ms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - FMOD_Channel_GetCurrentSound(channel, ¤tsound); - if (currentsound) - { - result = FMOD_Sound_GetLength(currentsound, &lenms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - } - } - - result = FMOD_Sound_GetLength(sound1, &lenms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - FMOD_System_GetChannelsPlaying(system, &channelsplaying); - - printf("Time %02d:%02d:%02d/%02d:%02d:%02d : %s : Channels Playing %2d\r", ms / 1000 / 60, ms / 1000 % 60, ms / 10 % 100, lenms / 1000 / 60, lenms / 1000 % 60, lenms / 10 % 100, paused ? "Paused " : playing ? "Playing" : "Stopped", channelsplaying); - fflush(stdout); - } - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = FMOD_Sound_Release(sound1); - ERRCHECK(result); - result = FMOD_Sound_Release(sound2); - ERRCHECK(result); - result = FMOD_Sound_Release(sound3); - ERRCHECK(result); - result = FMOD_System_Close(system); - ERRCHECK(result); - result = FMOD_System_Release(system); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/examples/loadfrommemory/main.cpp b/CocosDenshion/third_party/fmod/examples/loadfrommemory/main.cpp deleted file mode 100644 index 2dba723573..0000000000 --- a/CocosDenshion/third_party/fmod/examples/loadfrommemory/main.cpp +++ /dev/null @@ -1,213 +0,0 @@ -/*=============================================================================================== - Load from memory example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example is simply a variant of the play sound example, but it loads the data into memory - then uses the 'load from memory' feature of System::createSound. -===============================================================================================*/ -#include "../../api/inc/fmod.hpp" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include -#include - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - -void LoadFileIntoMemory(const char *name, void **buff, int *length) -{ - FILE *fp = fopen(name, "rb"); - - fseek(fp, 0, SEEK_END); - *length = ftell(fp); - fseek(fp, 0, SEEK_SET); - - *buff = malloc(*length); - fread(*buff, *length, 1, fp); - - fclose(fp); -} - -int main(int argc, char *argv[]) -{ - FMOD::System *system; - FMOD::Sound *sound1, *sound2, *sound3; - FMOD::Channel *channel = 0; - FMOD_RESULT result; - int key; - unsigned int version; - void *buff = 0; - int length = 0; - FMOD_CREATESOUNDEXINFO exinfo; - - /* - Create a System object and initialize. - */ - result = FMOD::System_Create(&system); - ERRCHECK(result); - - result = system->getVersion(&version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - result = system->init(32, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - LoadFileIntoMemory("../media/drumloop.wav", &buff, &length); - memset(&exinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO)); - exinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO); - exinfo.length = length; - - result = system->createSound((const char *)buff, FMOD_HARDWARE | FMOD_OPENMEMORY, &exinfo, &sound1); - ERRCHECK(result); - - result = sound1->setMode(FMOD_LOOP_OFF); - ERRCHECK(result); - - free(buff); // don't need the original memory any more. Note! If loading as a stream, the memory must stay active so do not free it! - - LoadFileIntoMemory("../media/jaguar.wav", &buff, &length); - memset(&exinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO)); - exinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO); - exinfo.length = length; - - result = system->createSound((const char *)buff, FMOD_SOFTWARE | FMOD_OPENMEMORY, &exinfo, &sound2); - ERRCHECK(result); - - free(buff); // don't need the original memory any more. Note! If loading as a stream, the memory must stay active so do not free it! - - LoadFileIntoMemory("../media/swish.wav", &buff, &length); - memset(&exinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO)); - exinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO); - exinfo.length = length; - - result = system->createSound((const char *)buff, FMOD_HARDWARE | FMOD_OPENMEMORY, &exinfo, &sound3); - ERRCHECK(result); - - free(buff); // don't need the original memory any more. Note! If loading as a stream, the memory must stay active so do not free it! - - printf("==========================================================================\n"); - printf("Load from memory example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("==========================================================================\n"); - printf("\n"); - printf("Press '1' to play a mono sound using hardware mixing\n"); - printf("Press '2' to play a mono sound using software mixing\n"); - printf("Press '3' to play a stereo sound using hardware mixing\n"); - printf("Press 'Esc' to quit\n"); - printf("\n"); - - /* - Main loop. - */ - do - { - if (kbhit()) - { - key = getch(); - - switch (key) - { - case '1' : - { - result = system->playSound(FMOD_CHANNEL_FREE, sound1, false, &channel); - ERRCHECK(result); - break; - } - case '2' : - { - result = system->playSound(FMOD_CHANNEL_FREE, sound2, false, &channel); - ERRCHECK(result); - break; - } - case '3' : - { - result = system->playSound(FMOD_CHANNEL_FREE, sound3, false, &channel); - ERRCHECK(result); - break; - } - } - } - - system->update(); - - { - unsigned int ms = 0; - unsigned int lenms = 0; - bool playing = 0; - bool paused = 0; - int channelsplaying = 0; - - if (channel) - { - FMOD::Sound *currentsound = 0; - - result = channel->isPlaying(&playing); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - result = channel->getPaused(&paused); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - result = channel->getPosition(&ms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - channel->getCurrentSound(¤tsound); - if (currentsound) - { - result = currentsound->getLength(&lenms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - } - } - - system->getChannelsPlaying(&channelsplaying); - - printf("Time %02d:%02d:%02d/%02d:%02d:%02d : %s : Channels Playing %2d\r", ms / 1000 / 60, ms / 1000 % 60, ms / 10 % 100, lenms / 1000 / 60, lenms / 1000 % 60, lenms / 10 % 100, paused ? "Paused " : playing ? "Playing" : "Stopped", channelsplaying); - fflush(stdout); - } - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = sound1->release(); - ERRCHECK(result); - result = sound2->release(); - ERRCHECK(result); - result = sound3->release(); - ERRCHECK(result); - result = system->close(); - ERRCHECK(result); - result = system->release(); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/examples/media/playlist.m3u b/CocosDenshion/third_party/fmod/examples/media/playlist.m3u deleted file mode 100644 index 381935fcc0..0000000000 --- a/CocosDenshion/third_party/fmod/examples/media/playlist.m3u +++ /dev/null @@ -1,11 +0,0 @@ -#EXTM3U -#EXTINF:11,Unknown - FMOD example wave -wave.mp3 -#EXTINF:1,swish -swish.wav -#EXTINF:2,stereo -stereo.ogg -#EXTINF:1,jaguar -jaguar.wav -#EXTINF:0,drumloop -drumloop.wav diff --git a/CocosDenshion/third_party/fmod/examples/media/wave.mp3.REMOVED.git-id b/CocosDenshion/third_party/fmod/examples/media/wave.mp3.REMOVED.git-id deleted file mode 100644 index d18eccea47..0000000000 --- a/CocosDenshion/third_party/fmod/examples/media/wave.mp3.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -400b6a591c4687406c5b5943181e083952872de7 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/examples/multiplesoundcard/Makefile b/CocosDenshion/third_party/fmod/examples/multiplesoundcard/Makefile deleted file mode 100644 index b221cabf3e..0000000000 --- a/CocosDenshion/third_party/fmod/examples/multiplesoundcard/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -multiplesoundcard_cpp: main.cpp - g++ -O3 -o multiplesoundcard main.cpp ../../api/lib/libfmodex.so -pthread - -multiplesoundcard_c: main.c - g++ -O3 -o multiplesoundcard main.c ../../api/lib/libfmodex.so -pthread - -run: - ./multiplesoundcard - -clean: - rm -f multiplesoundcard diff --git a/CocosDenshion/third_party/fmod/examples/multiplesoundcard/main.c b/CocosDenshion/third_party/fmod/examples/multiplesoundcard/main.c deleted file mode 100644 index e99247f834..0000000000 --- a/CocosDenshion/third_party/fmod/examples/multiplesoundcard/main.c +++ /dev/null @@ -1,226 +0,0 @@ -/*=============================================================================================== - MultipleSoundCard Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to simply load and play multiple sounds. This is about the simplest - use of FMOD. - This makes FMOD decode the into memory when it loads. If the sounds are big and possibly take - up a lot of ram, then it would be better to use the FMOD_CREATESTREAM flag so that it is - streamed in realtime as it plays. -===============================================================================================*/ -#include "../../api/inc/fmod.h" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD_SYSTEM *systemA, *systemB; - FMOD_SOUND *soundA, *soundB; - FMOD_CHANNEL *channelA = 0, *channelB = 0; - FMOD_RESULT result; - int key, count, numdrivers, driver; - unsigned int version; - - /* - Create Sound Card A - */ - result = FMOD_System_Create(&systemA); - ERRCHECK(result); - - result = FMOD_System_GetVersion(systemA, &version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - getch(); - return 0; - } - - result = FMOD_System_GetNumDrivers(systemA, &numdrivers); - ERRCHECK(result); - - printf("---------------------------------------------------------\n"); - printf("Select soundcard A\n"); - printf("---------------------------------------------------------\n"); - for (count=0; count < numdrivers; count++) - { - char name[256]; - - result = FMOD_System_GetDriverInfo(systemA, count, name, 256, 0); - ERRCHECK(result); - - printf("%d : %s\n", count + 1, name); - } - printf("---------------------------------------------------------\n"); - printf("Press a corresponding number or ESC to quit\n"); - - do - { - key = getch(); - if (key == 27) - { - return 0; - } - driver = key - '1'; - } while (driver < 0 || driver >= numdrivers); - - printf("\n"); - - result = FMOD_System_SetDriver(systemA, driver); - ERRCHECK(result); - - result = FMOD_System_Init(systemA, 32, FMOD_INIT_NORMAL, NULL); - ERRCHECK(result); - - - - /* - Create Sound Card B - */ - result = FMOD_System_Create(&systemB); - ERRCHECK(result); - - result = FMOD_System_GetVersion(systemB, &version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - getch(); - return 0; - } - - result = FMOD_System_GetNumDrivers(systemB, &numdrivers); - ERRCHECK(result); - - printf("---------------------------------------------------------\n"); - printf("Select soundcard B\n"); - printf("---------------------------------------------------------\n"); - for (count=0; count < numdrivers; count++) - { - char name[256]; - - result = FMOD_System_GetDriverInfo(systemB, count, name, 256, 0); - ERRCHECK(result); - - printf("%d : %s\n", count + 1, name); - } - printf("---------------------------------------------------------\n"); - printf("Press a corresponding number or ESC to quit\n"); - - do - { - key = getch(); - if (key == 27) - { - return 0; - } - driver = key - '1'; - } while (driver < 0 || driver >= numdrivers); - - printf("\n"); - - result = FMOD_System_SetDriver(systemB, driver); - ERRCHECK(result); - - result = FMOD_System_Init(systemB, 32, FMOD_INIT_NORMAL, NULL); - ERRCHECK(result); - - - /* - Load 1 sample into each soundcard. - */ - result = FMOD_System_CreateSound(systemA, "../media/drumloop.wav", FMOD_HARDWARE, 0, &soundA); - ERRCHECK(result); - result = FMOD_Sound_SetMode(soundA, FMOD_LOOP_OFF); - ERRCHECK(result); - - result = FMOD_System_CreateSound(systemB, "../media/jaguar.wav", FMOD_HARDWARE, 0,&soundB); - ERRCHECK(result); - - printf("======================================================================\n"); - printf("MultipleSoundCard Example. Copyright (c) Firelight Technologies 2004.\n"); - printf("======================================================================\n"); - printf("\n"); - printf("Press '1' to play a sound on soundcard A\n"); - printf("Press '2' to play a sound on soundcard B\n"); - printf("Press 'Esc' to quit\n"); - printf("\n"); - - /* - Main loop. - */ - do - { - int channelsplayingA = 0; - int channelsplayingB = 0; - - if (kbhit()) - { - key = getch(); - - switch (key) - { - case '1' : - { - result = FMOD_System_PlaySound(systemA, FMOD_CHANNEL_FREE, soundA, 0, &channelA); - ERRCHECK(result); - break; - } - case '2' : - { - result = FMOD_System_PlaySound(systemB, FMOD_CHANNEL_FREE, soundB, 0, &channelB); - ERRCHECK(result); - break; - } - } - } - - FMOD_System_Update(systemA); - FMOD_System_Update(systemB); - - FMOD_System_GetChannelsPlaying(systemA, &channelsplayingA); - FMOD_System_GetChannelsPlaying(systemB, &channelsplayingB); - - printf("Channels Playing on A %2d. Channels Playing on B %2d.\r", channelsplayingA, channelsplayingB); - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = FMOD_Sound_Release(soundA); - ERRCHECK(result); - result = FMOD_System_Close(systemA); - ERRCHECK(result); - result = FMOD_System_Release(systemA); - ERRCHECK(result); - - result = FMOD_Sound_Release(soundB); - ERRCHECK(result); - result = FMOD_System_Close(systemB); - ERRCHECK(result); - result = FMOD_System_Release(systemB); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/examples/multiplesoundcard/main.cpp b/CocosDenshion/third_party/fmod/examples/multiplesoundcard/main.cpp deleted file mode 100644 index aec4520f4f..0000000000 --- a/CocosDenshion/third_party/fmod/examples/multiplesoundcard/main.cpp +++ /dev/null @@ -1,228 +0,0 @@ -/*=============================================================================================== - MultipleSoundCard Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to play sounds on 2 different sound cards from the same application. - It creates 2 FMOD::System objects, selects a different sound device for each, then allows - the user to play 1 sound on 1 soundcard and another sound on another soundcard. - - Note that sounds created on device A cannot be played on device B and vice versa. - You will have to each sound separately for each sound card. Device A might load the sound - into its own memory so obviously device B wouldnt be able to play it. -===============================================================================================*/ -#include "../../api/inc/fmod.hpp" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD::System *systemA, *systemB; - FMOD::Sound *soundA, *soundB; - FMOD::Channel *channelA = 0, *channelB = 0;; - FMOD_RESULT result; - int key, count, numdrivers, driver; - unsigned int version; - - /* - Create Sound Card A - */ - result = FMOD::System_Create(&systemA); - ERRCHECK(result); - - result = systemA->getVersion(&version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - getch(); - return 0; - } - - result = systemA->getNumDrivers(&numdrivers); - ERRCHECK(result); - - printf("---------------------------------------------------------\n"); - printf("Select soundcard A\n"); - printf("---------------------------------------------------------\n"); - for (count=0; count < numdrivers; count++) - { - char name[256]; - - result = systemA->getDriverInfo(count, name, 256, 0); - ERRCHECK(result); - - printf("%d : %s\n", count + 1, name); - } - printf("---------------------------------------------------------\n"); - printf("Press a corresponding number or ESC to quit\n"); - - do - { - key = getch(); - if (key == 27) - { - return 0; - } - driver = key - '1'; - } while (driver < 0 || driver >= numdrivers); - - printf("\n"); - - result = systemA->setDriver(driver); - ERRCHECK(result); - - result = systemA->init(32, FMOD_INIT_NORMAL, NULL); - ERRCHECK(result); - - - - /* - Create Sound Card B - */ - result = FMOD::System_Create(&systemB); - ERRCHECK(result); - - result = systemB->getVersion(&version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - getch(); - return 0; - } - - result = systemB->getNumDrivers(&numdrivers); - ERRCHECK(result); - - printf("---------------------------------------------------------\n"); - printf("Select soundcard B\n"); - printf("---------------------------------------------------------\n"); - for (count=0; count < numdrivers; count++) - { - char name[256]; - - result = systemB->getDriverInfo(count, name, 256, 0); - ERRCHECK(result); - - printf("%d : %s\n", count + 1, name); - } - printf("---------------------------------------------------------\n"); - printf("Press a corresponding number or ESC to quit\n"); - - do - { - key = getch(); - if (key == 27) - { - return 0; - } - driver = key - '1'; - } while (driver < 0 || driver >= numdrivers); - - printf("\n"); - - result = systemB->setDriver(driver); - ERRCHECK(result); - - result = systemB->init(32, FMOD_INIT_NORMAL, NULL); - ERRCHECK(result); - - - /* - Load 1 sample into each soundcard. - */ - result = systemA->createSound("../media/drumloop.wav", FMOD_HARDWARE, 0, &soundA); - ERRCHECK(result); - result = soundA->setMode(FMOD_LOOP_OFF); - ERRCHECK(result); - - result = systemB->createSound("../media/jaguar.wav", FMOD_HARDWARE, 0, &soundB); - ERRCHECK(result); - - printf("======================================================================\n"); - printf("MultipleSoundCard Example. Copyright (c) Firelight Technologies 2004.\n"); - printf("======================================================================\n"); - printf("\n"); - printf("Press '1' to play a sound on soundcard A\n"); - printf("Press '2' to play a sound on soundcard B\n"); - printf("Press 'Esc' to quit\n"); - printf("\n"); - - /* - Main loop. - */ - do - { - int channelsplayingA = 0; - int channelsplayingB = 0; - - if (kbhit()) - { - key = getch(); - - switch (key) - { - case '1' : - { - result = systemA->playSound(FMOD_CHANNEL_FREE, soundA, 0, &channelA); - ERRCHECK(result); - break; - } - case '2' : - { - result = systemB->playSound(FMOD_CHANNEL_FREE, soundB, 0, &channelB); - ERRCHECK(result); - break; - } - } - } - - systemA->update(); - systemB->update(); - - systemA->getChannelsPlaying(&channelsplayingA); - systemB->getChannelsPlaying(&channelsplayingB); - - printf("Channels Playing on A %2d. Channels Playing on B %2d.\r", channelsplayingA, channelsplayingB); - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = soundA->release(); - ERRCHECK(result); - result = systemA->close(); - ERRCHECK(result); - result = systemA->release(); - ERRCHECK(result); - - result = soundB->release(); - ERRCHECK(result); - result = systemB->close(); - ERRCHECK(result); - result = systemB->release(); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/examples/multispeakeroutput/Makefile b/CocosDenshion/third_party/fmod/examples/multispeakeroutput/Makefile deleted file mode 100644 index 5030259732..0000000000 --- a/CocosDenshion/third_party/fmod/examples/multispeakeroutput/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -multispeakeroutput_cpp: main.cpp - g++ -O3 -o multispeakeroutput main.cpp ../../api/lib/libfmodex.so -pthread - -multispeakeroutput_c: main.c - g++ -O3 -o multispeakeroutput main.c ../../api/lib/libfmodex.so -pthread - -run: - ./multispeakeroutput - -clean: - rm -f multispeakeroutput diff --git a/CocosDenshion/third_party/fmod/examples/multispeakeroutput/main.c b/CocosDenshion/third_party/fmod/examples/multispeakeroutput/main.c deleted file mode 100644 index a2e3be628c..0000000000 --- a/CocosDenshion/third_party/fmod/examples/multispeakeroutput/main.c +++ /dev/null @@ -1,335 +0,0 @@ -/*=============================================================================================== - Multi Speaker Output Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to play sounds in multiple speakers, and also how to even assign - sound subchannels, such as those in a stereo sound to different individual speakers. -===============================================================================================*/ -#include "../../api/inc/fmod.h" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD_SYSTEM *system; - FMOD_SOUND *sound1, *sound2; - FMOD_CHANNEL *channel = 0; - FMOD_RESULT result; - int key; - unsigned int version; - - /* - Create a System object and initialize. - */ - result = FMOD_System_Create(&system); - ERRCHECK(result); - - result = FMOD_System_GetVersion(system, &version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - getch(); - return 0; - } - - /* - Multichannel only supported in ALSA mode in 5.1 and 7.1. - If the user doesn't have 5.1 speakers then only the speakers - they have will be audible. - */ - - result = FMOD_System_SetOutput(system, FMOD_OUTPUTTYPE_ALSA); - ERRCHECK(result); - - FMOD_System_SetSpeakerMode(system, FMOD_SPEAKERMODE_5POINT1); - ERRCHECK(result); - - result = FMOD_System_Init(system, 32, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - result = FMOD_System_CreateSound(system, "../media/drumloop.wav", FMOD_SOFTWARE | FMOD_2D, 0, &sound1); - ERRCHECK(result); - result = FMOD_Sound_SetMode(sound1, FMOD_LOOP_OFF); - - result = FMOD_System_CreateSound(system, "../media/stereo.ogg", FMOD_SOFTWARE | FMOD_2D, 0, &sound2); - ERRCHECK(result); - - printf("==============================================================================\n"); - printf("Multi Speaker Output Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("==============================================================================\n"); - printf("\n"); - printf("Note! You must have your speaker configuration set up correctly\n"); - printf(" in the windows control panel for this to work properly.\n"); - printf("\n"); - printf("Press '1' to play a mono sound on the FRONT LEFT speaker.\n"); - printf("Press '2' to play a mono sound on the FRONT RIGHT speaker.\n"); - printf("Press '3' to play a mono sound on the CENTER speaker.\n"); - printf("Press '4' to play a mono sound on the REAR LEFT speaker.\n"); - printf("Press '5' to play a mono sound on the REAR RIGHT speaker.\n"); - printf("Press '6' to play a mono sound on the SIDE LEFT speaker.\n"); - printf("Press '7' to play a mono sound on the SIDE RIGHT speaker.\n"); - printf("Press '8' to play a stereo sound on the front speakers.\n"); - printf("Press '9' to play a stereo sound on the front speakers but channel swapped.\n"); - printf("Press '0' to play the right part of a stereo sound on the CENTER speaker.\n"); - printf("Press 'Esc' to quit\n"); - printf("\n"); - - /* - Main loop. - */ - do - { - if (kbhit()) - { - key = getch(); - - switch (key) - { - case '1' : - { - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound1, TRUE, &channel); - ERRCHECK(result); - - result = FMOD_Channel_SetSpeakerMix(channel, 1.0f, 0, 0, 0, 0, 0, 0, 0); - ERRCHECK(result); - - result = FMOD_Channel_SetPaused(channel, FALSE); - ERRCHECK(result); - break; - } - case '2' : - { - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound1, TRUE, &channel); - ERRCHECK(result); - - result = FMOD_Channel_SetSpeakerMix(channel, 0, 1.0f, 0, 0, 0, 0, 0, 0); - ERRCHECK(result); - - result = FMOD_Channel_SetPaused(channel, FALSE); - ERRCHECK(result); - break; - } - case '3' : - { - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound1, TRUE, &channel); - ERRCHECK(result); - - result = FMOD_Channel_SetSpeakerMix(channel, 0, 0, 1.0f, 0, 0, 0, 0, 0); - ERRCHECK(result); - - result = FMOD_Channel_SetPaused(channel, FALSE); - ERRCHECK(result); - break; - } - case '4' : - { - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound1, TRUE, &channel); - ERRCHECK(result); - - result = FMOD_Channel_SetSpeakerMix(channel, 0, 0, 0, 0, 1.0f, 0, 0, 0); - ERRCHECK(result); - - result = FMOD_Channel_SetPaused(channel, FALSE); - ERRCHECK(result); - break; - } - case '5' : - { - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound1, TRUE, &channel); - ERRCHECK(result); - - result = FMOD_Channel_SetSpeakerMix(channel, 0, 0, 0, 0, 0, 1.0f, 0, 0); - ERRCHECK(result); - - result = FMOD_Channel_SetPaused(channel, FALSE); - ERRCHECK(result); - break; - } - case '6' : - { - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound1, TRUE, &channel); - ERRCHECK(result); - - result = FMOD_Channel_SetSpeakerMix(channel, 0, 0, 0, 0, 0, 0, 1.0f, 0); - ERRCHECK(result); - - result = FMOD_Channel_SetPaused(channel, FALSE); - ERRCHECK(result); - break; - } - case '7' : - { - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound1, TRUE, &channel); - ERRCHECK(result); - - result = FMOD_Channel_SetSpeakerMix(channel, 0, 0, 0, 0, 0, 0, 0, 1.0f); - ERRCHECK(result); - - result = FMOD_Channel_SetPaused(channel, FALSE); - ERRCHECK(result); - - break; - } - case '8' : - { - float levels[2] = { 0, 1.0f }; - - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound2, TRUE, &channel); - ERRCHECK(result); - - /* - By default a stereo sound would play in all right and all left speakers, so this forces it to just the front. - */ - result = FMOD_Channel_SetSpeakerMix(channel, 1.0f, 1.0f, 0, 0, 0, 0, 0, 0); - ERRCHECK(result); - - result = FMOD_Channel_SetPaused(channel, FALSE); - ERRCHECK(result); - - break; - } - case '9' : - { - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound2, TRUE, &channel); - ERRCHECK(result); - - /* - Clear out all speakers first. - */ - result = FMOD_Channel_SetSpeakerMix(channel, 0, 0, 0, 0, 0, 0, 0, 0); - ERRCHECK(result); - - /* - Put the left channel of the sound in the right speaker. - */ - { - float levels[2] = { 0, 1.0f }; /* This array represents the source stereo sound. l/r */ - - result = FMOD_Channel_SetSpeakerLevels(channel, FMOD_SPEAKER_FRONT_LEFT, levels, 2); - ERRCHECK(result); - } - /* - Put the right channel of the sound in the left speaker. - */ - { - float levels[2] = { 1.0f, 0 }; /* This array represents the source stereo sound. l/r */ - - result = FMOD_Channel_SetSpeakerLevels(channel, FMOD_SPEAKER_FRONT_RIGHT, levels, 2); - ERRCHECK(result); - } - - result = FMOD_Channel_SetPaused(channel, FALSE); - ERRCHECK(result); - - break; - } - case '0' : - { - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound2, TRUE, &channel); - ERRCHECK(result); - - /* - Clear out all speakers first. - */ - result = FMOD_Channel_SetSpeakerMix(channel, 0, 0, 0, 0, 0, 0, 0, 0); - ERRCHECK(result); - - /* - Put the left channel of the sound in the right speaker. - */ - { - float levels[2] = { 0, 1.0f }; /* This array represents the source stereo sound. l/r */ - - result = FMOD_Channel_SetSpeakerLevels(channel, FMOD_SPEAKER_FRONT_CENTER, levels, 2); - ERRCHECK(result); - } - - result = FMOD_Channel_SetPaused(channel, FALSE); - ERRCHECK(result); - - break; - } - } - } - - FMOD_System_Update(system); - - { - unsigned int ms = 0; - unsigned int lenms = 0; - int playing = FALSE; - int paused = FALSE; - int channelsplaying = 0; - - if (channel) - { - FMOD_SOUND *currentsound = 0; - - result = FMOD_Channel_IsPlaying(channel, &playing); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - result = FMOD_Channel_GetPaused(channel, &paused); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - result = FMOD_Channel_GetPosition(channel, &ms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - FMOD_Channel_GetCurrentSound(channel, ¤tsound); - if (currentsound) - { - result = FMOD_Sound_GetLength(currentsound, &lenms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - } - } - - FMOD_System_GetChannelsPlaying(system, &channelsplaying); - - printf("Time %02d:%02d:%02d/%02d:%02d:%02d : %s : Channels Playing %2d\r", ms / 1000 / 60, ms / 1000 % 60, ms / 10 % 100, lenms / 1000 / 60, lenms / 1000 % 60, lenms / 10 % 100, paused ? "Paused " : playing ? "Playing" : "Stopped", channelsplaying); - } - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = FMOD_Sound_Release(sound1); - ERRCHECK(result); - result = FMOD_Sound_Release(sound2); - ERRCHECK(result); - result = FMOD_System_Close(system); - ERRCHECK(result); - result = FMOD_System_Release(system); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/examples/multispeakeroutput/main.cpp b/CocosDenshion/third_party/fmod/examples/multispeakeroutput/main.cpp deleted file mode 100644 index c771563e3f..0000000000 --- a/CocosDenshion/third_party/fmod/examples/multispeakeroutput/main.cpp +++ /dev/null @@ -1,337 +0,0 @@ -/*=============================================================================================== - Multi Speaker Output Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to play sounds in multiple speakers, and also how to even assign - sound subchannels, such as those in a stereo sound to different individual speakers. -===============================================================================================*/ -#include "../../api/inc/fmod.hpp" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD::System *system; - FMOD::Sound *sound1, *sound2; - FMOD::Channel *channel = 0; - FMOD_RESULT result; - int key; - unsigned int version; - - /* - Create a System object and initialize. - */ - result = FMOD::System_Create(&system); - ERRCHECK(result); - - result = system->getVersion(&version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - getch(); - return 0; - } - - /* - Multichannel only supported in ALSA mode in 5.1 and 7.1. - If the user doesn't have 5.1 speakers then only the speakers - they have will be audible. - */ - - result = system->setOutput(FMOD_OUTPUTTYPE_ALSA); - ERRCHECK(result); - - result = system->setSpeakerMode(FMOD_SPEAKERMODE_5POINT1); - ERRCHECK(result); - - result = system->init(32, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - result = system->createSound("../media/drumloop.wav", FMOD_SOFTWARE | FMOD_2D, 0, &sound1); - ERRCHECK(result); - result = sound1->setMode(FMOD_LOOP_OFF); - ERRCHECK(result); - - - result = system->createSound("../media/stereo.ogg", FMOD_SOFTWARE | FMOD_2D, 0, &sound2); - ERRCHECK(result); - - printf("==============================================================================\n"); - printf("Multi Speaker Output Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("==============================================================================\n"); - printf("\n"); - printf("Note! You must have your speaker configuration set up correctly\n"); - printf(" in the windows control panel for this to work properly.\n"); - printf("\n"); - printf("Press '1' to play a mono sound on the FRONT LEFT speaker.\n"); - printf("Press '2' to play a mono sound on the FRONT RIGHT speaker.\n"); - printf("Press '3' to play a mono sound on the CENTER speaker.\n"); - printf("Press '4' to play a mono sound on the REAR LEFT speaker.\n"); - printf("Press '5' to play a mono sound on the REAR RIGHT speaker.\n"); - printf("Press '6' to play a mono sound on the SIDE LEFT speaker.\n"); - printf("Press '7' to play a mono sound on the SIDE RIGHT speaker.\n"); - printf("Press '8' to play a stereo sound on the front speakers.\n"); - printf("Press '9' to play a stereo sound on the front speakers but channel swapped.\n"); - printf("Press '0' to play the right part of a stereo sound on the CENTER speaker.\n"); - printf("Press 'Esc' to quit\n"); - printf("\n"); - - /* - Main loop. - */ - do - { - if (kbhit()) - { - key = getch(); - - switch (key) - { - case '1' : - { - result = system->playSound(FMOD_CHANNEL_FREE, sound1, true, &channel); - ERRCHECK(result); - - result = channel->setSpeakerMix(1.0f, 0, 0, 0, 0, 0, 0, 0); - ERRCHECK(result); - - result = channel->setPaused(false); - ERRCHECK(result); - break; - } - case '2' : - { - result = system->playSound(FMOD_CHANNEL_FREE, sound1, true, &channel); - ERRCHECK(result); - - result = channel->setSpeakerMix(0, 1.0f, 0, 0, 0, 0, 0, 0); - ERRCHECK(result); - - result = channel->setPaused(false); - ERRCHECK(result); - break; - } - case '3' : - { - result = system->playSound(FMOD_CHANNEL_FREE, sound1, true, &channel); - ERRCHECK(result); - - result = channel->setSpeakerMix(0, 0, 1.0f, 0, 0, 0, 0, 0); - ERRCHECK(result); - - result = channel->setPaused(false); - ERRCHECK(result); - break; - } - case '4' : - { - result = system->playSound(FMOD_CHANNEL_FREE, sound1, true, &channel); - ERRCHECK(result); - - result = channel->setSpeakerMix(0, 0, 0, 0, 1.0f, 0, 0, 0); - ERRCHECK(result); - - result = channel->setPaused(false); - ERRCHECK(result); - break; - } - case '5' : - { - result = system->playSound(FMOD_CHANNEL_FREE, sound1, true, &channel); - ERRCHECK(result); - - result = channel->setSpeakerMix(0, 0, 0, 0, 0, 1.0f, 0, 0); - ERRCHECK(result); - - result = channel->setPaused(false); - ERRCHECK(result); - break; - } - case '6' : - { - result = system->playSound(FMOD_CHANNEL_FREE, sound1, true, &channel); - ERRCHECK(result); - - result = channel->setSpeakerMix(0, 0, 0, 0, 0, 0, 1.0f, 0); - ERRCHECK(result); - - result = channel->setPaused(false); - ERRCHECK(result); - break; - } - case '7' : - { - result = system->playSound(FMOD_CHANNEL_FREE, sound1, true, &channel); - ERRCHECK(result); - - result = channel->setSpeakerMix(0, 0, 0, 0, 0, 0, 0, 1.0f); - ERRCHECK(result); - - result = channel->setPaused(false); - ERRCHECK(result); - - break; - } - case '8' : - { - float levels[2] = { 0, 1.0f }; - - result = system->playSound(FMOD_CHANNEL_FREE, sound2, true, &channel); - ERRCHECK(result); - - /* - By default a stereo sound would play in all right and all left speakers, so this forces it to just the front. - */ - result = channel->setSpeakerMix(1.0f, 1.0f, 0, 0, 0, 0, 0, 0); - ERRCHECK(result); - - result = channel->setPaused(false); - ERRCHECK(result); - - break; - } - case '9' : - { - result = system->playSound(FMOD_CHANNEL_FREE, sound2, true, &channel); - ERRCHECK(result); - - /* - Clear out all speakers first. - */ - result = channel->setSpeakerMix(0, 0, 0, 0, 0, 0, 0, 0); - ERRCHECK(result); - - /* - Put the left channel of the sound in the right speaker. - */ - { - float levels[2] = { 0, 1.0f }; /* This array represents the source stereo sound. l/r */ - - result = channel->setSpeakerLevels(FMOD_SPEAKER_FRONT_LEFT, levels, 2); - ERRCHECK(result); - } - /* - Put the right channel of the sound in the left speaker. - */ - { - float levels[2] = { 1.0f, 0 }; /* This array represents the source stereo sound. l/r */ - - result = channel->setSpeakerLevels(FMOD_SPEAKER_FRONT_RIGHT, levels, 2); - ERRCHECK(result); - } - - result = channel->setPaused(false); - ERRCHECK(result); - - break; - } - case '0' : - { - result = system->playSound(FMOD_CHANNEL_FREE, sound2, true, &channel); - ERRCHECK(result); - - /* - Clear out all speakers first. - */ - result = channel->setSpeakerMix(0, 0, 0, 0, 0, 0, 0, 0); - ERRCHECK(result); - - /* - Put the left channel of the sound in the right speaker. - */ - { - float levels[2] = { 0, 1.0f }; /* This array represents the source stereo sound. l/r */ - - result = channel->setSpeakerLevels(FMOD_SPEAKER_FRONT_CENTER, levels, 2); - ERRCHECK(result); - } - - result = channel->setPaused(false); - ERRCHECK(result); - - break; - } - } - } - - system->update(); - - { - unsigned int ms = 0; - unsigned int lenms = 0; - bool playing = false; - bool paused = false; - int channelsplaying = 0; - - if (channel) - { - FMOD::Sound *currentsound = 0; - - result = channel->isPlaying(&playing); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - result = channel->getPaused(&paused); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - result = channel->getPosition(&ms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - channel->getCurrentSound(¤tsound); - if (currentsound) - { - result = currentsound->getLength(&lenms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - } - } - - system->getChannelsPlaying(&channelsplaying); - - printf("Time %02d:%02d:%02d/%02d:%02d:%02d : %s : Channels Playing %2d\r", ms / 1000 / 60, ms / 1000 % 60, ms / 10 % 100, lenms / 1000 / 60, lenms / 1000 % 60, lenms / 10 % 100, paused ? "Paused " : playing ? "Playing" : "Stopped", channelsplaying); - } - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = sound1->release(); - ERRCHECK(result); - result = sound2->release(); - ERRCHECK(result); - result = system->close(); - ERRCHECK(result); - result = system->release(); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/examples/netstream/Makefile b/CocosDenshion/third_party/fmod/examples/netstream/Makefile deleted file mode 100644 index 2b3b3e0088..0000000000 --- a/CocosDenshion/third_party/fmod/examples/netstream/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -netstream_cpp: main.cpp - g++ -O3 -o netstream main.cpp ../../api/lib/libfmodex.so -pthread - -netstream_c: main.c - g++ -O3 -o netstream main.c ../../api/lib/libfmodex.so -pthread - -run: - ./netstream - -clean: - rm -f netstream diff --git a/CocosDenshion/third_party/fmod/examples/netstream/main.c b/CocosDenshion/third_party/fmod/examples/netstream/main.c deleted file mode 100644 index 66e01ad886..0000000000 --- a/CocosDenshion/third_party/fmod/examples/netstream/main.c +++ /dev/null @@ -1,174 +0,0 @@ -/*=============================================================================================== - NetStream Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to play streaming audio from the internet -===============================================================================================*/ -#include "../../api/inc/fmod.h" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD_SYSTEM *system; - FMOD_SOUND *sound; - FMOD_CHANNEL *channel = 0; - FMOD_RESULT result; - int key; - unsigned int version; - - printf("===================================================================\n"); - printf("NetStream Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("===================================================================\n\n"); - - if (argc < 2) - { - printf("Usage: netstream \n"); - printf("Example: netstream http://www.fmod.org/stream.mp3\n\n"); - return -1; - } - - /* - Create a System object and initialize. - */ - result = FMOD_System_Create(&system); - ERRCHECK(result); - - result = FMOD_System_GetVersion(system,&version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - result = FMOD_System_Init(system, 1, FMOD_INIT_NORMAL, NULL); - ERRCHECK(result); - - /* - Bump up the file buffer size a little bit for netstreams (to account for lag). Decode buffer is left at default. - */ - result = FMOD_System_SetStreamBufferSize(system, 64*1024, FMOD_TIMEUNIT_RAWBYTES); - ERRCHECK(result); - - result = FMOD_System_CreateSound(system, argv[1], FMOD_HARDWARE | FMOD_2D | FMOD_CREATESTREAM | FMOD_NONBLOCKING, 0, &sound); - ERRCHECK(result); - - printf("Press space to pause, Esc to quit\n\n"); - - /* - Main loop - */ - do - { - unsigned int ms = 0, percent = 0; - int playing = FALSE; - int paused = FALSE; - int starving = FALSE; - FMOD_OPENSTATE openstate; - - if (!channel) - { - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound, FALSE, &channel); - } - - if (kbhit()) - { - key = getch(); - - switch (key) - { - case ' ' : - { - if (channel) - { - int paused; - FMOD_Channel_GetPaused(channel, &paused); - FMOD_Channel_SetPaused(channel, !paused); - } - break; - } - } - } - - FMOD_System_Update(system); - - if (channel) - { - for (;;) - { - FMOD_TAG tag; - if (FMOD_Sound_GetTag(sound, 0, -1, &tag) != FMOD_OK) - { - break; - } - if (tag.datatype == FMOD_TAGDATATYPE_STRING) - { - printf("%s = %s (%d bytes)\n", tag.name, tag.data, tag.datalen); - } - } - result = FMOD_Channel_GetPaused(channel, &paused); - ERRCHECK(result); - result = FMOD_Channel_IsPlaying(channel, &playing); - ERRCHECK(result); - result = FMOD_Channel_GetPosition(channel, &ms, FMOD_TIMEUNIT_MS); - ERRCHECK(result); - } - - result = FMOD_Sound_GetOpenState(sound, &openstate, &percent, &starving, 0); - ERRCHECK(result); - - printf("Time %02d:%02d:%02d : %s : (%3d%%%) %s \r", ms / 1000 / 60, ms / 1000 % 60, ms / 10 % 100, openstate == FMOD_OPENSTATE_BUFFERING ? "Buffering..." : openstate == FMOD_OPENSTATE_CONNECTING ? "Connecting..." : paused ? "Paused " : playing ? "Playing " : "Stopped ", percent, starving ? "STARVING" : " "); - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - printf("Shutting down.\n"); - - /* - If we pressed escape before it is ready, wait for it to finish opening before we release it. - */ - do - { - FMOD_OPENSTATE openstate; - - result = FMOD_Sound_GetOpenState(sound, &openstate, 0, 0, 0); - ERRCHECK(result); - - if (openstate == FMOD_OPENSTATE_READY) - { - break; - } - - printf("Waiting for sound to finish opening before trying to release it....\r"); - - Sleep(10); - } while (1); - - /* - Shut down - */ - result = FMOD_Sound_Release(sound); - ERRCHECK(result); - result = FMOD_System_Close(system); - ERRCHECK(result); - result = FMOD_System_Release(system); - ERRCHECK(result); - - return 0; -} diff --git a/CocosDenshion/third_party/fmod/examples/netstream/main.cpp b/CocosDenshion/third_party/fmod/examples/netstream/main.cpp deleted file mode 100644 index 31a4dcbaaf..0000000000 --- a/CocosDenshion/third_party/fmod/examples/netstream/main.cpp +++ /dev/null @@ -1,186 +0,0 @@ -/*=============================================================================================== - NetStream Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to play streaming audio from the internet -===============================================================================================*/ -#include "../../api/inc/fmod.hpp" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD::System *system; - FMOD::Sound *sound; - FMOD::Channel *channel = 0; - FMOD_RESULT result; - int key; - unsigned int version; - - printf("===================================================================\n"); - printf("NetStream Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("===================================================================\n\n"); - - if (argc < 2) - { - printf("Usage: netstream \n"); - printf("Example: netstream http://www.fmod.org/stream.mp3\n\n"); - return -1; - } - - /* - Create a System object and initialize. - */ - result = FMOD::System_Create(&system); - ERRCHECK(result); - - result = system->getVersion(&version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - result = system->init(1, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - /* - Bump up the file buffer size a little bit for netstreams (to account for lag). Decode buffer is left at default. - */ - result = system->setStreamBufferSize(64*1024, FMOD_TIMEUNIT_RAWBYTES); - ERRCHECK(result); - - result = system->createSound(argv[1], FMOD_HARDWARE | FMOD_2D | FMOD_CREATESTREAM | FMOD_NONBLOCKING, 0, &sound); - ERRCHECK(result); - - printf("Press space to pause, Esc to quit\n\n"); - - /* - Main loop - */ - do - { - unsigned int ms = 0, percent = 0; - bool playing = false; - bool paused = false; - bool starving = false; - FMOD_OPENSTATE openstate; - - if (!channel) - { - result = system->playSound(FMOD_CHANNEL_FREE, sound, false, &channel); - } - - if (kbhit()) - { - key = getch(); - - switch (key) - { - case ' ' : - { - if (channel) - { - bool paused; - channel->getPaused(&paused); - channel->setPaused(!paused); - } - break; - } - } - } - - system->update(); - - if (channel) - { - for (;;) - { - FMOD_TAG tag; - if (sound->getTag(0, -1, &tag) != FMOD_OK) - { - break; - } - if (tag.datatype == FMOD_TAGDATATYPE_STRING) - { - printf("%s = %s (%d bytes)\n", tag.name, (char *)tag.data, tag.datalen); - } - } - - result = channel->getPaused(&paused); - ERRCHECK(result); - result = channel->isPlaying(&playing); - ERRCHECK(result); - result = channel->getPosition(&ms, FMOD_TIMEUNIT_MS); - ERRCHECK(result); - } - - result = sound->getOpenState(&openstate, &percent, &starving, 0); - ERRCHECK(result); - - channel->setMute(starving); - ERRCHECK(result); - - printf("Time %02d:%02d:%02d : %s : (%3d%%) %s \r", ms / 1000 / 60, ms / 1000 % 60, ms / 10 % 100, openstate == FMOD_OPENSTATE_BUFFERING ? "Buffering..." : openstate == FMOD_OPENSTATE_CONNECTING ? "Connecting..." : paused ? "Paused " : playing ? "Playing " : "Stopped ", percent, starving ? "STARVING" : " "); - fflush(stdout); - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - printf("Shutting down.\n"); - - if (channel) - { - result = channel->stop(); - ERRCHECK(result); - } - - /* - If we pressed escape before it is ready, wait for it to finish opening before we release it. - */ - do - { - FMOD_OPENSTATE openstate; - - result = sound->getOpenState(&openstate, 0, 0, 0); - ERRCHECK(result); - - if (openstate == FMOD_OPENSTATE_READY) - { - break; - } - - printf("Waiting for sound to finish opening before trying to release it....\r"); - fflush(stdout); - - Sleep(10); - } while (1); - - /* - Shut down - */ - result = sound->release(); - ERRCHECK(result); - result = system->close(); - ERRCHECK(result); - result = system->release(); - ERRCHECK(result); - - return 0; -} diff --git a/CocosDenshion/third_party/fmod/examples/offlinedecoding/Makefile b/CocosDenshion/third_party/fmod/examples/offlinedecoding/Makefile deleted file mode 100644 index 090b273dcf..0000000000 --- a/CocosDenshion/third_party/fmod/examples/offlinedecoding/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -offlinedecoding_cpp: main.cpp - g++ -O3 -o offlinedecoding main.cpp ../../api/lib/libfmodex.so -pthread - -offlinedecoding_c: main.c - g++ -O3 -o offlinedecoding main.c ../../api/lib/libfmodex.so -pthread - -run: - ./offlinedecoding - -clean: - rm -f offlinedecoding diff --git a/CocosDenshion/third_party/fmod/examples/offlinedecoding/main.c b/CocosDenshion/third_party/fmod/examples/offlinedecoding/main.c deleted file mode 100644 index 866f4384d9..0000000000 --- a/CocosDenshion/third_party/fmod/examples/offlinedecoding/main.c +++ /dev/null @@ -1,137 +0,0 @@ -/*=============================================================================================== - Offline Decoding Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how decode a file to PCM, without playing it. - It writes out the data as a raw data file. - The FMOD_System_CreateSound function uses FMOD_OPENONLY so that FMOD does not read any data - itself. - If this is uses then it is up to the user to use FMOD_Sound_ReadData to get the data out of - the file and into the destination buffer. -===============================================================================================*/ -#include "../../api/inc/fmod.h" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD_SYSTEM *system; - FMOD_SOUND *sound; - FMOD_RESULT result; - unsigned int version; - - /* - Create a System object and initialize. - */ - result = FMOD_System_Create(&system); - ERRCHECK(result); - - result = FMOD_System_GetVersion(system, &version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - result = FMOD_System_Init(system, 1, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - result = FMOD_System_CreateStream(system, "../media/wave.mp3", FMOD_OPENONLY | FMOD_ACCURATETIME, 0, &sound); - ERRCHECK(result); - - printf("==========================================================================\n"); - printf("Offline Decoding Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("==========================================================================\n"); - printf("\n"); - printf("This program will open wave.mp3 and decode it into wave.raw using the\n"); - printf("FMOD_Sound_ReadData function.\n"); - printf("\n"); - - /* - Decode the sound and write it to a .raw file. - */ - { - void *data; - unsigned int length = 0, read; - unsigned int bytesread; - FILE *outfp; - - #define CHUNKSIZE 4096 - - result = FMOD_Sound_GetLength(sound, &length, FMOD_TIMEUNIT_PCMBYTES); - ERRCHECK(result); - - outfp = fopen("output.raw", "wb"); - if (!outfp) - { - printf("Error! Could not open output.raw output file.\n"); - return 0; - } - - data = malloc(CHUNKSIZE); - if (!data) - { - printf("Error! Failed to allocate %d bytes.\n", CHUNKSIZE); - return 0; - } - - bytesread = 0; - do - { - result = FMOD_Sound_ReadData(sound, (char *)data, CHUNKSIZE, &read); - - fwrite((char *)data, read, 1, outfp); - - bytesread += read; - - printf("writing %d bytes of %d to output.raw\r", bytesread, length); - } - while (result == FMOD_OK && read == CHUNKSIZE); - - /* - Loop terminates when either - 1. the read function returns an error. (ie FMOD_ERR_FILE_EOF etc). - 2. the amount requested was different to the amount returned. (somehow got an EOF without the file error, maybe a non stream file format like mod/s3m/xm/it/midi). - - If 'bytesread' is bigger than 'length' then it just means that FMOD miscalculated the size, - but this will not usually happen if FMOD_ACCURATETIME is used. (this will give the correct length for VBR formats) - */ - - printf("\n"); - - if (outfp) - { - fclose(outfp); - } - } - - - printf("\n"); - - /* - Shut down - */ - result = FMOD_Sound_Release(sound); - ERRCHECK(result); - result = FMOD_System_Close(system); - ERRCHECK(result); - result = FMOD_System_Release(system); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/examples/offlinedecoding/main.cpp b/CocosDenshion/third_party/fmod/examples/offlinedecoding/main.cpp deleted file mode 100644 index 96c88065a2..0000000000 --- a/CocosDenshion/third_party/fmod/examples/offlinedecoding/main.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/*=============================================================================================== - Offline Decoding Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how decode a file to PCM, without playing it. - It writes out the data as a raw data file. - The System::createSound function uses FMOD_OPENONLY so that FMOD does not read any data - itself. - If this is uses then it is up to the user to use Sound::readData to get the data out of - the file and into the destination buffer. -===============================================================================================*/ -#include "../../api/inc/fmod.hpp" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD::System *system; - FMOD::Sound *sound; - FMOD_RESULT result; - unsigned int version; - - /* - Create a System object and initialize. - */ - result = FMOD::System_Create(&system); - ERRCHECK(result); - - result = system->getVersion(&version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - result = system->init(1, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - result = system->createStream("../media/wave.mp3", FMOD_OPENONLY | FMOD_ACCURATETIME, 0, &sound); - ERRCHECK(result); - - printf("==========================================================================\n"); - printf("Offline Decoding Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("==========================================================================\n"); - printf("\n"); - printf("This program will open wave.mp3 and decode it into wave.raw using the\n"); - printf("Sound::readData function.\n"); - printf("\n"); - - /* - Decode the sound and write it to a .raw file. - */ - { - void *data; - unsigned int length = 0, read; - unsigned int bytesread; - FILE *outfp; - - #define CHUNKSIZE 4096 - - result = sound->getLength(&length, FMOD_TIMEUNIT_PCMBYTES); - ERRCHECK(result); - - outfp = fopen("output.raw", "wb"); - if (!outfp) - { - printf("Error! Could not open output.raw output file.\n"); - return 0; - } - - data = malloc(CHUNKSIZE); - if (!data) - { - printf("Error! Failed to allocate %d bytes.\n", CHUNKSIZE); - return 0; - } - - bytesread = 0; - do - { - result = sound->readData((char *)data, CHUNKSIZE, &read); - - fwrite((char *)data, read, 1, outfp); - - bytesread += read; - - printf("writing %d bytes of %d to output.raw\r", bytesread, length); - } - while (result == FMOD_OK && read == CHUNKSIZE); - - /* - Loop terminates when either - 1. the read function returns an error. (ie FMOD_ERR_FILE_EOF etc). - 2. the amount requested was different to the amount returned. (somehow got an EOF without the file error, maybe a non stream file format like mod/s3m/xm/it/midi). - - If 'bytesread' is bigger than 'length' then it just means that FMOD miscalculated the size, - but this will not usually happen if FMOD_ACCURATETIME is used. (this will give the correct length for VBR formats) - */ - - printf("\n"); - - if (outfp) - { - fclose(outfp); - } - } - - - printf("\n"); - - /* - Shut down - */ - result = sound->release(); - ERRCHECK(result); - result = system->close(); - ERRCHECK(result); - result = system->release(); - ERRCHECK(result); - - return 0; -} diff --git a/CocosDenshion/third_party/fmod/examples/pitchdetection/Makefile b/CocosDenshion/third_party/fmod/examples/pitchdetection/Makefile deleted file mode 100644 index 19e2c34c31..0000000000 --- a/CocosDenshion/third_party/fmod/examples/pitchdetection/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -pitchdetection_cpp: main.cpp - g++ -O3 -o pitchdetection main.cpp ../../api/lib/libfmodex.so -pthread - -pitchdetection_c: main.c - g++ -O3 -o pitchdetection main.c ../../api/lib/libfmodex.so -pthread - -run: - ./pitchdetection - -clean: - rm -f pitchdetection diff --git a/CocosDenshion/third_party/fmod/examples/pitchdetection/main.c b/CocosDenshion/third_party/fmod/examples/pitchdetection/main.c deleted file mode 100644 index ab2fd6971c..0000000000 --- a/CocosDenshion/third_party/fmod/examples/pitchdetection/main.c +++ /dev/null @@ -1,309 +0,0 @@ -/*=============================================================================================== - Pitch detection example. - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example combines recording with spectrum analysis to determine the pitch of the sound - being recorded. -===============================================================================================*/ -#include "../../api/inc/fmod.h" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" - -#include -#include - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - -static const char *note[120] = -{ - "C 0", "C#0", "D 0", "D#0", "E 0", "F 0", "F#0", "G 0", "G#0", "A 0", "A#0", "B 0", - "C 1", "C#1", "D 1", "D#1", "E 1", "F 1", "F#1", "G 1", "G#1", "A 1", "A#1", "B 1", - "C 2", "C#2", "D 2", "D#2", "E 2", "F 2", "F#2", "G 2", "G#2", "A 2", "A#2", "B 2", - "C 3", "C#3", "D 3", "D#3", "E 3", "F 3", "F#3", "G 3", "G#3", "A 3", "A#3", "B 3", - "C 4", "C#4", "D 4", "D#4", "E 4", "F 4", "F#4", "G 4", "G#4", "A 4", "A#4", "B 4", - "C 5", "C#5", "D 5", "D#5", "E 5", "F 5", "F#5", "G 5", "G#5", "A 5", "A#5", "B 5", - "C 6", "C#6", "D 6", "D#6", "E 6", "F 6", "F#6", "G 6", "G#6", "A 6", "A#6", "B 6", - "C 7", "C#7", "D 7", "D#7", "E 7", "F 7", "F#7", "G 7", "G#7", "A 7", "A#7", "B 7", - "C 8", "C#8", "D 8", "D#8", "E 8", "F 8", "F#8", "G 8", "G#8", "A 8", "A#8", "B 8", - "C 9", "C#9", "D 9", "D#9", "E 9", "F 9", "F#9", "G 9", "G#9", "A 9", "A#9", "B 9" -}; - -static const float notefreq[120] = -{ - 16.35f, 17.32f, 18.35f, 19.45f, 20.60f, 21.83f, 23.12f, 24.50f, 25.96f, 27.50f, 29.14f, 30.87f, - 32.70f, 34.65f, 36.71f, 38.89f, 41.20f, 43.65f, 46.25f, 49.00f, 51.91f, 55.00f, 58.27f, 61.74f, - 65.41f, 69.30f, 73.42f, 77.78f, 82.41f, 87.31f, 92.50f, 98.00f, 103.83f, 110.00f, 116.54f, 123.47f, - 130.81f, 138.59f, 146.83f, 155.56f, 164.81f, 174.61f, 185.00f, 196.00f, 207.65f, 220.00f, 233.08f, 246.94f, - 261.63f, 277.18f, 293.66f, 311.13f, 329.63f, 349.23f, 369.99f, 392.00f, 415.30f, 440.00f, 466.16f, 493.88f, - 523.25f, 554.37f, 587.33f, 622.25f, 659.26f, 698.46f, 739.99f, 783.99f, 830.61f, 880.00f, 932.33f, 987.77f, - 1046.50f, 1108.73f, 1174.66f, 1244.51f, 1318.51f, 1396.91f, 1479.98f, 1567.98f, 1661.22f, 1760.00f, 1864.66f, 1975.53f, - 2093.00f, 2217.46f, 2349.32f, 2489.02f, 2637.02f, 2793.83f, 2959.96f, 3135.96f, 3322.44f, 3520.00f, 3729.31f, 3951.07f, - 4186.01f, 4434.92f, 4698.64f, 4978.03f, 5274.04f, 5587.65f, 5919.91f, 6271.92f, 6644.87f, 7040.00f, 7458.62f, 7902.13f, - 8372.01f, 8869.84f, 9397.27f, 9956.06f, 10548.08f, 11175.30f, 11839.82f, 12543.85f, 13289.75f, 14080.00f, 14917.24f, 15804.26f -}; - -#define OUTPUTRATE 48000 -#define SPECTRUMSIZE 8192 -#define SPECTRUMRANGE ((float)OUTPUTRATE / 2.0f) /* 0 to nyquist */ - -#define BINSIZE (SPECTRUMRANGE / (float)SPECTRUMSIZE) - -int main(int argc, char *argv[]) -{ - FMOD_SYSTEM *system = 0; - FMOD_SOUND *sound = 0; - FMOD_CHANNEL *channel = 0; - FMOD_RESULT result; - FMOD_CREATESOUNDEXINFO exinfo; - int key, driver, recorddriver, numdrivers, count, outputfreq, bin; - unsigned int version; - - /* - Create a System object and initialize. - */ - result = FMOD_System_Create(&system); - ERRCHECK(result); - - result = FMOD_System_GetVersion(system, &version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - /* - System initialization - */ - printf("---------------------------------------------------------\n"); - printf("Select OUTPUT type\n"); - printf("---------------------------------------------------------\n"); - printf("1 : OSS - Open Sound System\n"); - printf("2 : ALSA - Advanced Linux Sound Architecture\n"); - printf("3 : ESD - Enlightenment Sound Daemon\n"); - printf("4 : PULSEAUDIO - Pulse Audio Sound Server\n"); - printf("---------------------------------------------------------\n"); - printf("Press a corresponding number or ESC to quit\n"); - - do - { - key = getch(); - } while (key != 27 && key < '1' && key > '5'); - - switch (key) - { - case '1' : result = FMOD_System_SetOutput(system, FMOD_OUTPUTTYPE_OSS); - break; - case '2' : result = FMOD_System_SetOutput(system, FMOD_OUTPUTTYPE_ALSA); - break; - case '3' : result = FMOD_System_SetOutput(system, FMOD_OUTPUTTYPE_ESD); - break; - case '4' : result = FMOD_System_SetOutput(system, FMOD_OUTPUTTYPE_PULSEAUDIO); - break; - default : return 1; - } - ERRCHECK(result); - - /* - Enumerate playback devices - */ - - result = FMOD_System_GetNumDrivers(system, &numdrivers); - ERRCHECK(result); - - printf("---------------------------------------------------------\n"); - printf("Choose a PLAYBACK driver\n"); - printf("---------------------------------------------------------\n"); - for (count=0; count < numdrivers; count++) - { - char name[256]; - - result = FMOD_System_GetDriverInfo(system, count, name, 256, 0); - ERRCHECK(result); - - printf("%d : %s\n", count + 1, name); - } - printf("---------------------------------------------------------\n"); - printf("Press a corresponding number or ESC to quit\n"); - - do - { - key = getch(); - if (key == 27) - { - return 0; - } - driver = key - '1'; - } while (driver < 0 || driver >= numdrivers); - - result = FMOD_System_SetDriver(system, driver); - ERRCHECK(result); - - /* - Enumerate record devices - */ - - result = FMOD_System_GetRecordNumDrivers(system, &numdrivers); - ERRCHECK(result); - - printf("---------------------------------------------------------\n"); - printf("Choose a RECORD driver\n"); - printf("---------------------------------------------------------\n"); - for (count=0; count < numdrivers; count++) - { - char name[256]; - - result = FMOD_System_GetRecordDriverInfo(system, count, name, 256, 0); - ERRCHECK(result); - - printf("%d : %s\n", count + 1, name); - } - printf("---------------------------------------------------------\n"); - printf("Press a corresponding number or ESC to quit\n"); - - recorddriver = 0; - do - { - key = getch(); - if (key == 27) - { - return 0; - } - recorddriver = key - '1'; - } while (recorddriver < 0 || recorddriver >= numdrivers); - - printf("\n"); - - result = FMOD_System_SetSoftwareFormat(system, OUTPUTRATE, FMOD_SOUND_FORMAT_PCM16, 1, 0, FMOD_DSP_RESAMPLER_LINEAR); - ERRCHECK(result); - - result = FMOD_System_Init(system, 32, FMOD_INIT_NORMAL, NULL); - ERRCHECK(result); - - FMOD_System_GetSoftwareFormat(system, &outputfreq, 0, 0, 0, 0, 0); - ERRCHECK(result); - - /* - Create a sound to record to. - */ - memset(&exinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO)); - - exinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO); - exinfo.numchannels = 1; - exinfo.format = FMOD_SOUND_FORMAT_PCM16; - exinfo.defaultfrequency = OUTPUTRATE; - exinfo.length = exinfo.defaultfrequency * sizeof(short) * exinfo.numchannels * 5; - - result = FMOD_System_CreateSound(system, 0, FMOD_2D | FMOD_SOFTWARE | FMOD_LOOP_NORMAL | FMOD_OPENUSER, &exinfo, &sound); - ERRCHECK(result); - - /* - Start the interface - */ - printf("=========================================================================\n"); - printf("Pitch detection example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("=========================================================================\n"); - printf("\n"); - printf("Record something through the selected recording device and FMOD will\n"); - printf("Determine the pitch. Sustain the tone for at least a second to get an\n"); - printf("accurate reading.\n"); - printf("Press 'Esc' to quit\n"); - printf("\n"); - - result = FMOD_System_RecordStart(system, recorddriver, sound, TRUE); - ERRCHECK(result); - - Sleep(200); /* Give it some time to record something */ - - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_REUSE, sound, FALSE, &channel); - ERRCHECK(result); - - /* Dont hear what is being recorded otherwise it will feedback. Spectrum analysis is done before volume scaling in the DSP chain */ - result = FMOD_Channel_SetVolume(channel, 0); - ERRCHECK(result); - - bin = 0; - - /* - Main loop. - */ - do - { - static float spectrum[SPECTRUMSIZE]; - float dominanthz = 0; - float max; - int dominantnote = 0; - float binsize = BINSIZE; - - if (kbhit()) - { - key = getch(); - } - - result = FMOD_Channel_GetSpectrum(channel, spectrum, SPECTRUMSIZE, 0, FMOD_DSP_FFT_WINDOW_TRIANGLE); - ERRCHECK(result); - - max = 0; - - for (count = 0; count < SPECTRUMSIZE; count++) - { - if (spectrum[count] > 0.01f && spectrum[count] > max) - { - max = spectrum[count]; - bin = count; - } - } - - dominanthz = (float)bin * BINSIZE; /* dominant frequency min */ - - dominantnote = 0; - for (count = 0; count < 120; count++) - { - if (dominanthz >= notefreq[count] && dominanthz < notefreq[count + 1]) - { - /* which is it closer to. This note or the next note */ - if (fabs(dominanthz - notefreq[count]) < fabs(dominanthz - notefreq[count+1])) - { - dominantnote = count; - } - else - { - dominantnote = count + 1; - } - break; - } - } - - printf("Detected rate : %7.1f -> %7.1f hz. Detected musical note. %-3s (%7.1f hz)\r", dominanthz, ((float)bin + 0.99f) * BINSIZE, note[dominantnote], notefreq[dominantnote]); - fflush(stdout); - - FMOD_System_Update(system); - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = FMOD_Sound_Release(sound); - ERRCHECK(result); - - result = FMOD_System_Release(system); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/examples/pitchdetection/main.cpp b/CocosDenshion/third_party/fmod/examples/pitchdetection/main.cpp deleted file mode 100644 index 80c7bef09e..0000000000 --- a/CocosDenshion/third_party/fmod/examples/pitchdetection/main.cpp +++ /dev/null @@ -1,309 +0,0 @@ -/*=============================================================================================== - Pitch detection example. - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example combines recording with spectrum analysis to determine the pitch of the sound - being recorded. -===============================================================================================*/ -#include "../../api/inc/fmod.hpp" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" - -#include -#include - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - -static const char *note[120] = -{ - "C 0", "C#0", "D 0", "D#0", "E 0", "F 0", "F#0", "G 0", "G#0", "A 0", "A#0", "B 0", - "C 1", "C#1", "D 1", "D#1", "E 1", "F 1", "F#1", "G 1", "G#1", "A 1", "A#1", "B 1", - "C 2", "C#2", "D 2", "D#2", "E 2", "F 2", "F#2", "G 2", "G#2", "A 2", "A#2", "B 2", - "C 3", "C#3", "D 3", "D#3", "E 3", "F 3", "F#3", "G 3", "G#3", "A 3", "A#3", "B 3", - "C 4", "C#4", "D 4", "D#4", "E 4", "F 4", "F#4", "G 4", "G#4", "A 4", "A#4", "B 4", - "C 5", "C#5", "D 5", "D#5", "E 5", "F 5", "F#5", "G 5", "G#5", "A 5", "A#5", "B 5", - "C 6", "C#6", "D 6", "D#6", "E 6", "F 6", "F#6", "G 6", "G#6", "A 6", "A#6", "B 6", - "C 7", "C#7", "D 7", "D#7", "E 7", "F 7", "F#7", "G 7", "G#7", "A 7", "A#7", "B 7", - "C 8", "C#8", "D 8", "D#8", "E 8", "F 8", "F#8", "G 8", "G#8", "A 8", "A#8", "B 8", - "C 9", "C#9", "D 9", "D#9", "E 9", "F 9", "F#9", "G 9", "G#9", "A 9", "A#9", "B 9" -}; - -static const float notefreq[120] = -{ - 16.35f, 17.32f, 18.35f, 19.45f, 20.60f, 21.83f, 23.12f, 24.50f, 25.96f, 27.50f, 29.14f, 30.87f, - 32.70f, 34.65f, 36.71f, 38.89f, 41.20f, 43.65f, 46.25f, 49.00f, 51.91f, 55.00f, 58.27f, 61.74f, - 65.41f, 69.30f, 73.42f, 77.78f, 82.41f, 87.31f, 92.50f, 98.00f, 103.83f, 110.00f, 116.54f, 123.47f, - 130.81f, 138.59f, 146.83f, 155.56f, 164.81f, 174.61f, 185.00f, 196.00f, 207.65f, 220.00f, 233.08f, 246.94f, - 261.63f, 277.18f, 293.66f, 311.13f, 329.63f, 349.23f, 369.99f, 392.00f, 415.30f, 440.00f, 466.16f, 493.88f, - 523.25f, 554.37f, 587.33f, 622.25f, 659.26f, 698.46f, 739.99f, 783.99f, 830.61f, 880.00f, 932.33f, 987.77f, - 1046.50f, 1108.73f, 1174.66f, 1244.51f, 1318.51f, 1396.91f, 1479.98f, 1567.98f, 1661.22f, 1760.00f, 1864.66f, 1975.53f, - 2093.00f, 2217.46f, 2349.32f, 2489.02f, 2637.02f, 2793.83f, 2959.96f, 3135.96f, 3322.44f, 3520.00f, 3729.31f, 3951.07f, - 4186.01f, 4434.92f, 4698.64f, 4978.03f, 5274.04f, 5587.65f, 5919.91f, 6271.92f, 6644.87f, 7040.00f, 7458.62f, 7902.13f, - 8372.01f, 8869.84f, 9397.27f, 9956.06f, 10548.08f, 11175.30f, 11839.82f, 12543.85f, 13289.75f, 14080.00f, 14917.24f, 15804.26f -}; - -#define OUTPUTRATE 48000 -#define SPECTRUMSIZE 8192 -#define SPECTRUMRANGE ((float)OUTPUTRATE / 2.0f) /* 0 to nyquist */ - -#define BINSIZE (SPECTRUMRANGE / (float)SPECTRUMSIZE) - -int main(int argc, char *argv[]) -{ - FMOD::System *system = 0; - FMOD::Sound *sound = 0; - FMOD::Channel *channel = 0; - FMOD_RESULT result; - FMOD_CREATESOUNDEXINFO exinfo; - int key, driver, recorddriver, numdrivers, count, outputfreq, bin; - unsigned int version; - - /* - Create a System object and initialize. - */ - result = FMOD::System_Create(&system); - ERRCHECK(result); - - result = system->getVersion(&version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - /* - System initialization - */ - printf("---------------------------------------------------------\n"); - printf("Select OUTPUT type\n"); - printf("---------------------------------------------------------\n"); - printf("1 : OSS - Open Sound System\n"); - printf("2 : ALSA - Advanced Linux Sound Architecture\n"); - printf("3 : ESD - Enlightenment Sound Daemon\n"); - printf("4 : PULSEAUDIO - Pulse Audio Sound Server\n"); - printf("---------------------------------------------------------\n"); - printf("Press a corresponding number or ESC to quit\n"); - - do - { - key = getch(); - } while (key != 27 && key < '1' && key > '5'); - - switch (key) - { - case '1' : result = system->setOutput(FMOD_OUTPUTTYPE_OSS); - break; - case '2' : result = system->setOutput(FMOD_OUTPUTTYPE_ALSA); - break; - case '3' : result = system->setOutput(FMOD_OUTPUTTYPE_ESD); - break; - case '4' : result = system->setOutput(FMOD_OUTPUTTYPE_PULSEAUDIO); - break; - default : return 1; - } - ERRCHECK(result); - - /* - Enumerate playback devices - */ - - result = system->getNumDrivers(&numdrivers); - ERRCHECK(result); - - printf("---------------------------------------------------------\n"); - printf("Choose a PLAYBACK driver\n"); - printf("---------------------------------------------------------\n"); - for (count=0; count < numdrivers; count++) - { - char name[256]; - - result = system->getDriverInfo(count, name, 256, 0); - ERRCHECK(result); - - printf("%d : %s\n", count + 1, name); - } - printf("---------------------------------------------------------\n"); - printf("Press a corresponding number or ESC to quit\n"); - - do - { - key = getch(); - if (key == 27) - { - return 0; - } - driver = key - '1'; - } while (driver < 0 || driver >= numdrivers); - - result = system->setDriver(driver); - ERRCHECK(result); - - /* - Enumerate record devices - */ - - result = system->getRecordNumDrivers(&numdrivers); - ERRCHECK(result); - - printf("---------------------------------------------------------\n"); - printf("Choose a RECORD driver\n"); - printf("---------------------------------------------------------\n"); - for (count=0; count < numdrivers; count++) - { - char name[256]; - - result = system->getRecordDriverInfo(count, name, 256, 0); - ERRCHECK(result); - - printf("%d : %s\n", count + 1, name); - } - printf("---------------------------------------------------------\n"); - printf("Press a corresponding number or ESC to quit\n"); - - recorddriver = 0; - do - { - key = getch(); - if (key == 27) - { - return 0; - } - recorddriver = key - '1'; - } while (recorddriver < 0 || recorddriver >= numdrivers); - - printf("\n"); - - result = system->setSoftwareFormat(OUTPUTRATE, FMOD_SOUND_FORMAT_PCM16, 1, 0, FMOD_DSP_RESAMPLER_LINEAR); - ERRCHECK(result); - - result = system->init(32, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - system->getSoftwareFormat(&outputfreq, 0, 0, 0, 0, 0); - ERRCHECK(result); - - /* - Create a sound to record to. - */ - memset(&exinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO)); - - exinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO); - exinfo.numchannels = 1; - exinfo.format = FMOD_SOUND_FORMAT_PCM16; - exinfo.defaultfrequency = OUTPUTRATE; - exinfo.length = exinfo.defaultfrequency * sizeof(short) * exinfo.numchannels * 5; - - result = system->createSound(0, FMOD_2D | FMOD_SOFTWARE | FMOD_LOOP_NORMAL | FMOD_OPENUSER, &exinfo, &sound); - ERRCHECK(result); - - /* - Start the interface - */ - printf("=========================================================================\n"); - printf("Pitch detection example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("=========================================================================\n"); - printf("\n"); - printf("Record something through the selected recording device and FMOD will\n"); - printf("Determine the pitch. Sustain the tone for at least a second to get an\n"); - printf("accurate reading.\n"); - printf("Press 'Esc' to quit\n"); - printf("\n"); - - result = system->recordStart(recorddriver, sound, true); - ERRCHECK(result); - - Sleep(200); /* Give it some time to record something */ - - result = system->playSound(FMOD_CHANNEL_REUSE, sound, false, &channel); - ERRCHECK(result); - - /* Dont hear what is being recorded otherwise it will feedback. Spectrum analysis is done before volume scaling in the DSP chain */ - result = channel->setVolume(0); - ERRCHECK(result); - - bin = 0; - - /* - Main loop. - */ - do - { - static float spectrum[SPECTRUMSIZE]; - float dominanthz = 0; - float max; - int dominantnote = 0; - float binsize = BINSIZE; - - if (kbhit()) - { - key = getch(); - } - - result = channel->getSpectrum(spectrum, SPECTRUMSIZE, 0, FMOD_DSP_FFT_WINDOW_TRIANGLE); - ERRCHECK(result); - - max = 0; - - for (count = 0; count < SPECTRUMSIZE; count++) - { - if (spectrum[count] > 0.01f && spectrum[count] > max) - { - max = spectrum[count]; - bin = count; - } - } - - dominanthz = (float)bin * BINSIZE; /* dominant frequency min */ - - dominantnote = 0; - for (count = 0; count < 120; count++) - { - if (dominanthz >= notefreq[count] && dominanthz < notefreq[count + 1]) - { - /* which is it closer to. This note or the next note */ - if (fabs(dominanthz - notefreq[count]) < fabs(dominanthz - notefreq[count+1])) - { - dominantnote = count; - } - else - { - dominantnote = count + 1; - } - break; - } - } - - printf("Detected rate : %7.1f -> %7.1f hz. Detected musical note. %-3s (%7.1f hz)\r", dominanthz, ((float)bin + 0.99f) * BINSIZE, note[dominantnote], notefreq[dominantnote]); - fflush(stdout); - - system->update(); - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = sound->release(); - ERRCHECK(result); - - result = system->release(); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/examples/playlist/Makefile b/CocosDenshion/third_party/fmod/examples/playlist/Makefile deleted file mode 100644 index 965bf1fcf5..0000000000 --- a/CocosDenshion/third_party/fmod/examples/playlist/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -playlist_cpp: main.cpp - g++ -O3 -o playlist main.cpp ../../api/lib/libfmodex.so -pthread - -playlist_c: main.c - g++ -O3 -o playlist main.c ../../api/lib/libfmodex.so -pthread - -run: - ./playlist - -clean: - rm -f playlist diff --git a/CocosDenshion/third_party/fmod/examples/playlist/main.c b/CocosDenshion/third_party/fmod/examples/playlist/main.c deleted file mode 100644 index 636d5b91fc..0000000000 --- a/CocosDenshion/third_party/fmod/examples/playlist/main.c +++ /dev/null @@ -1,254 +0,0 @@ -/*=============================================================================================== - PlayList Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to load a playlist and play the sounds in a playlist. -===============================================================================================*/ -#include "../../api/inc/fmod.h" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD_SYSTEM *system = 0; - FMOD_SOUND *playlist = 0; - FMOD_SOUND *sound = 0; - FMOD_CHANNEL *channel = 0; - FMOD_TAG tag; - FMOD_RESULT result; - FMOD_SOUND_TYPE soundtype; - FMOD_BOOL isplaylist = 0; - char *title = NULL; - int count = 0; - int key; - unsigned int version; - char file[128]; - - /* - Create a System object and initialize. - */ - result = FMOD_System_Create(&system); - ERRCHECK(result); - - result = FMOD_System_GetVersion(system, &version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - result = FMOD_System_Init(system, 32, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - result = FMOD_System_CreateSound(system, "../media/playlist.m3u", FMOD_DEFAULT, 0, &playlist); - ERRCHECK(result); - - result = FMOD_Sound_GetFormat(playlist, &soundtype, 0, 0, 0); - ERRCHECK(result); - - isplaylist = (soundtype == FMOD_SOUND_TYPE_PLAYLIST); - - printf("===================================================================\n"); - printf("PlayList Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("===================================================================\n"); - printf("\n"); - printf("Press 'n' to play next sound in playlist\n"); - printf("Press 'space' to pause/unpause current sound\n"); - printf("Press 'Esc' to quit\n"); - printf("\n"); - - if (isplaylist) - { - printf("PLAYLIST loaded.\n"); - /* - Get the first song in the playlist, create the sound and then play it. - */ - result = FMOD_Sound_GetTag(playlist, "FILE", count, &tag); - ERRCHECK(result); - - sprintf(file, "../media/%s", (char *)tag.data); - - result = FMOD_System_CreateSound(system, file, FMOD_DEFAULT, 0, &sound); - ERRCHECK(result); - - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound, 0, &channel); - ERRCHECK(result); - - FMOD_Sound_GetTag(playlist, "TITLE", count, &tag); - title = (char *)tag.data; - - count++; - } - else - { - printf("SOUND loaded.\n"); - - /* - This is just a normal sound, so just play it. - */ - sound = playlist; - - result = FMOD_Sound_SetMode(sound, FMOD_LOOP_NORMAL); - ERRCHECK(result); - - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound, 0, &channel); - ERRCHECK(result); - } - - printf("\n"); - - /* - Main loop. - */ - do - { - FMOD_BOOL isplaying = 0; - - if (channel && isplaylist) - { - /* - When sound has finished playing, play the next sound in the playlist - */ - - FMOD_Channel_IsPlaying(channel, &isplaying); - if (!isplaying) - { - if (sound) - { - FMOD_Sound_Release(sound); - - sound = NULL; - } - - result = FMOD_Sound_GetTag(playlist, "FILE", count, &tag); - if (result != FMOD_OK) - { - count = 0; - } - else - { - printf("playing next song in playlist...\n"); - - sprintf(file, "../media/%s", (char *)tag.data); - - result = FMOD_System_CreateSound(system, file, FMOD_DEFAULT, 0, &sound); - ERRCHECK(result); - - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound, 0, &channel); - ERRCHECK(result); - - FMOD_Sound_GetTag(playlist, "TITLE", count, &tag); - title = (char *)tag.data; - - count++; - } - } - } - - - if (kbhit()) - { - key = getch(); - - switch (key) - { - case 'n' : - { - /* - Play the next song in the playlist - */ - if (channel && isplaylist) - { - FMOD_Channel_Stop(channel); - } - - break; - } - case ' ' : - { - if (channel) - { - FMOD_BOOL paused; - - FMOD_Channel_GetPaused(channel, &paused); - FMOD_Channel_SetPaused(channel, !paused); - } - } - } - } - - FMOD_System_Update(system); - - { - unsigned int ms = 0; - unsigned int lenms = 0; - FMOD_BOOL paused = 0; - - if (channel) - { - if (sound) - { - result = FMOD_Sound_GetLength(sound, &lenms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - } - - result = FMOD_Channel_GetPaused(channel, &paused); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - result = FMOD_Channel_GetPosition(channel, &ms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - } - - printf("Time %02d:%02d:%02d/%02d:%02d:%02d : %s : %s\r", ms / 1000 / 60, ms / 1000 % 60, ms / 10 % 100, lenms / 1000 / 60, lenms / 1000 % 60, lenms / 10 % 100, paused ? "Paused " : "Playing ", title); - fflush(stdout); - } - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - if (sound) - { - result = FMOD_Sound_Release(sound); - ERRCHECK(result); - } - if (isplaylist) - { - result = FMOD_Sound_Release(playlist); - ERRCHECK(result); - } - result = FMOD_System_Close(system); - ERRCHECK(result); - result = FMOD_System_Release(system); - ERRCHECK(result); - - return 0; -} diff --git a/CocosDenshion/third_party/fmod/examples/playlist/main.cpp b/CocosDenshion/third_party/fmod/examples/playlist/main.cpp deleted file mode 100644 index 056a816352..0000000000 --- a/CocosDenshion/third_party/fmod/examples/playlist/main.cpp +++ /dev/null @@ -1,256 +0,0 @@ -/*=============================================================================================== - PlayList Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to load a playlist and play the sounds in a playlist. -===============================================================================================*/ -#include "../../api/inc/fmod.hpp" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD::System *system = 0; - FMOD::Sound *playlist = 0; - FMOD::Sound *sound = 0; - FMOD::Channel *channel = 0; - FMOD_TAG tag; - FMOD_RESULT result; - FMOD_SOUND_TYPE soundtype; - bool isplaylist = false; - char *title = NULL; - int count = 0; - int key; - unsigned int version; - char file[128]; - - /* - Create a System object and initialize. - */ - result = FMOD::System_Create(&system); - ERRCHECK(result); - - result = system->getVersion(&version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - result = system->init(32, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - result = system->createSound("../media/playlist.m3u", FMOD_DEFAULT, 0, &playlist); - ERRCHECK(result); - - result = playlist->getFormat(&soundtype, 0, 0, 0); - ERRCHECK(result); - - isplaylist = (soundtype == FMOD_SOUND_TYPE_PLAYLIST); - - printf("===================================================================\n"); - printf("PlayList Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("===================================================================\n"); - printf("\n"); - printf("Press 'n' to play next sound in playlist\n"); - printf("Press 'space' to pause/unpause current sound\n"); - printf("Press 'Esc' to quit\n"); - printf("\n"); - - if (isplaylist) - { - printf("PLAYLIST loaded.\n"); - /* - Get the first song in the playlist, create the sound and then play it. - */ - result = playlist->getTag("FILE", count, &tag); - ERRCHECK(result); - - sprintf(file, "../media/%s", (char *)tag.data); - - result = system->createSound(file, FMOD_DEFAULT, 0, &sound); - ERRCHECK(result); - - result = system->playSound(FMOD_CHANNEL_FREE, sound, false, &channel); - ERRCHECK(result); - - playlist->getTag("TITLE", count, &tag); - title = (char *)tag.data; - - count++; - } - else - { - printf("SOUND loaded.\n"); - - /* - This is just a normal sound, so just play it. - */ - sound = playlist; - - result = sound->setMode(FMOD_LOOP_NORMAL); - ERRCHECK(result); - - result = system->playSound(FMOD_CHANNEL_FREE, sound, false, &channel); - ERRCHECK(result); - } - - printf("\n"); - - /* - Main loop. - */ - do - { - bool isplaying = false; - - if (channel && isplaylist) - { - /* - When sound has finished playing, play the next sound in the playlist - */ - - channel->isPlaying(&isplaying); - if (!isplaying) - { - if (sound) - { - sound->release(); - - sound = NULL; - } - - result = playlist->getTag("FILE", count, &tag); - if (result != FMOD_OK) - { - count = 0; - } - else - { - printf("playing next song in playlist...\n"); - - sprintf(file, "../media/%s", (char *)tag.data); - - result = system->createSound(file, FMOD_DEFAULT, 0, &sound); - ERRCHECK(result); - - result = system->playSound(FMOD_CHANNEL_FREE, sound, false, &channel); - ERRCHECK(result); - - playlist->getTag("TITLE", count, &tag); - title = (char *)tag.data; - - count++; - } - } - } - - - if (kbhit()) - { - key = getch(); - - switch (key) - { - case 'n' : - { - /* - Play the next song in the playlist - */ - if (channel && isplaylist) - { - channel->stop(); - } - - break; - } - case ' ' : - { - if (channel) - { - bool paused; - - channel->getPaused(&paused); - channel->setPaused(!paused); - } - } - } - } - - system->update(); - - { - unsigned int ms = 0; - unsigned int lenms = 0; - bool paused = 0; - - if (channel) - { - if (sound) - { - result = sound->getLength(&lenms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - } - - result = channel->getPaused(&paused); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - result = channel->getPosition(&ms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - } - - printf("Time %02d:%02d:%02d/%02d:%02d:%02d : %s : %s\r", ms / 1000 / 60, ms / 1000 % 60, ms / 10 % 100, lenms / 1000 / 60, lenms / 1000 % 60, lenms / 10 % 100, paused ? "Paused " : "Playing ", title); - fflush(stdout); - } - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - if (sound) - { - result = sound->release(); - ERRCHECK(result); - } - if (isplaylist) - { - result = playlist->release(); - ERRCHECK(result); - } - result = system->close(); - ERRCHECK(result); - result = system->release(); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/examples/playlist/playlist b/CocosDenshion/third_party/fmod/examples/playlist/playlist deleted file mode 100755 index f31d786e9d..0000000000 Binary files a/CocosDenshion/third_party/fmod/examples/playlist/playlist and /dev/null differ diff --git a/CocosDenshion/third_party/fmod/examples/playsound/Makefile b/CocosDenshion/third_party/fmod/examples/playsound/Makefile deleted file mode 100644 index 02ae25b3b3..0000000000 --- a/CocosDenshion/third_party/fmod/examples/playsound/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -playsound_cpp: main.cpp - g++ -O3 -o playsound main.cpp ../../api/lib/libfmodex.so -pthread - -playsound_c: main.c - gcc -O3 -o playsound main.c ../../api/lib/libfmodex.so -pthread - -run: - ./playsound - -clean: - rm -f playsound diff --git a/CocosDenshion/third_party/fmod/examples/playsound/main.c b/CocosDenshion/third_party/fmod/examples/playsound/main.c deleted file mode 100644 index 56a4acaaf4..0000000000 --- a/CocosDenshion/third_party/fmod/examples/playsound/main.c +++ /dev/null @@ -1,184 +0,0 @@ -/*=============================================================================================== - PlaySound Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to simply load and play multiple sounds. This is about the simplest - use of FMOD. - This makes FMOD decode the into memory when it loads. If the sounds are big and possibly take - up a lot of ram, then it would be better to use the FMOD_CREATESTREAM flag so that it is - streamed in realtime as it plays. -===============================================================================================*/ -#include "../../api/inc/fmod.h" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD_SYSTEM *system; - FMOD_SOUND *sound1, *sound2, *sound3; - FMOD_CHANNEL *channel = 0; - FMOD_RESULT result; - int key; - unsigned int version; - /* - Create a System object and initialize. - */ - result = FMOD_System_Create(&system); - ERRCHECK(result); - - result = FMOD_System_GetVersion(system, &version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - getch(); - return 0; - } - - result = FMOD_System_Init(system, 32, FMOD_INIT_NORMAL, NULL); - ERRCHECK(result); - - result = FMOD_System_CreateSound(system, "../media/drumloop.wav", FMOD_SOFTWARE, 0, &sound1); - ERRCHECK(result); - result = FMOD_Sound_SetMode(sound1, FMOD_LOOP_OFF); - ERRCHECK(result); - - result = FMOD_System_CreateSound(system, "../media/jaguar.wav", FMOD_SOFTWARE, 0, &sound2); - ERRCHECK(result); - - result = FMOD_System_CreateSound(system, "../media/swish.wav", FMOD_SOFTWARE, 0, &sound3); - ERRCHECK(result); - - printf("===================================================================\n"); - printf("PlaySound Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("===================================================================\n"); - printf("\n"); - printf("Press '1' to Play a mono sound using hardware mixing\n"); - printf("Press '2' to Play a mono sound using software mixing\n"); - printf("Press '3' to Play a stereo sound using hardware mixing\n"); - printf("Press 'Esc' to quit\n"); - printf("\n"); - - /* - Main loop. - */ - do - { - if (kbhit()) - { - key = getch(); - - switch (key) - { - case '1' : - { - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound1, 0, &channel); - ERRCHECK(result); - break; - } - case '2' : - { - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound2, 0, &channel); - ERRCHECK(result); - break; - } - case '3' : - { - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound3, 0, &channel); - ERRCHECK(result); - break; - } - } - } - - FMOD_System_Update(system); - - { - unsigned int ms = 0; - unsigned int lenms = 0; - int playing = 0; - int paused = 0; - int channelsplaying = 0; - - if (channel) - { - FMOD_SOUND *currentsound = 0; - - result = FMOD_Channel_IsPlaying(channel, &playing); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - result = FMOD_Channel_GetPaused(channel, &paused); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - result = FMOD_Channel_GetPosition(channel, &ms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - FMOD_Channel_GetCurrentSound(channel, ¤tsound); - if (currentsound) - { - result = FMOD_Sound_GetLength(currentsound, &lenms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - } - } - - result = FMOD_Sound_GetLength(sound1, &lenms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - FMOD_System_GetChannelsPlaying(system, &channelsplaying); - - printf("Time %02d:%02d:%02d/%02d:%02d:%02d : %s : Channels Playing %2d\r", ms / 1000 / 60, ms / 1000 % 60, ms / 10 % 100, lenms / 1000 / 60, lenms / 1000 % 60, lenms / 10 % 100, paused ? "Paused " : playing ? "Playing" : "Stopped", channelsplaying); - fflush(stdout); - } - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = FMOD_Sound_Release(sound1); - ERRCHECK(result); - result = FMOD_Sound_Release(sound2); - ERRCHECK(result); - result = FMOD_Sound_Release(sound3); - ERRCHECK(result); - result = FMOD_System_Close(system); - ERRCHECK(result); - result = FMOD_System_Release(system); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/examples/playsound/main.cpp b/CocosDenshion/third_party/fmod/examples/playsound/main.cpp deleted file mode 100644 index 9d979cee49..0000000000 --- a/CocosDenshion/third_party/fmod/examples/playsound/main.cpp +++ /dev/null @@ -1,182 +0,0 @@ -/*=============================================================================================== - PlaySound Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to simply load and play multiple sounds. This is about the simplest - use of FMOD. - This makes FMOD decode the into memory when it loads. If the sounds are big and possibly take - up a lot of ram, then it would be better to use the FMOD_CREATESTREAM flag so that it is - streamed in realtime as it plays. -===============================================================================================*/ -#include "../../api/inc/fmod.hpp" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD::System *system; - FMOD::Sound *sound1, *sound2, *sound3; - FMOD::Channel *channel = 0; - FMOD_RESULT result; - int key; - unsigned int version; - - /* - Create a System object and initialize. - */ - result = FMOD::System_Create(&system); - ERRCHECK(result); - - result = system->getVersion(&version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - getch(); - return 0; - } - - result = system->setOutput(FMOD_OUTPUTTYPE_ALSA); - ERRCHECK(result); - - result = system->init(32, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - result = system->createSound("../media/drumloop.wav", FMOD_SOFTWARE, 0, &sound1); - ERRCHECK(result); - result = sound1->setMode(FMOD_LOOP_OFF); - ERRCHECK(result); - - result = system->createSound("../media/jaguar.wav", FMOD_SOFTWARE, 0, &sound2); - ERRCHECK(result); - - result = system->createSound("../media/swish.wav", FMOD_SOFTWARE, 0, &sound3); - ERRCHECK(result); - - printf("===================================================================\n"); - printf("PlaySound Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("===================================================================\n"); - printf("\n"); - printf("Press '1' to Play a mono sound using software mixing\n"); - printf("Press '2' to Play a mono sound using software mixing\n"); - printf("Press '3' to Play a stereo sound using software mixing\n"); - printf("Press 'Esc' to quit\n"); - printf("\n"); - - /* - Main loop. - */ - do - { - if (kbhit()) - { - key = getch(); - - switch (key) - { - case '1' : - { - result = system->playSound(FMOD_CHANNEL_FREE, sound1, 0, &channel); - ERRCHECK(result); - break; - } - case '2' : - { - result = system->playSound(FMOD_CHANNEL_FREE, sound2, 0, &channel); - ERRCHECK(result); - break; - } - case '3' : - { - result = system->playSound(FMOD_CHANNEL_FREE, sound3, 0, &channel); - ERRCHECK(result); - break; - } - } - } - - system->update(); - - { - unsigned int ms = 0; - unsigned int lenms = 0; - bool playing = 0; - bool paused = 0; - int channelsplaying = 0; - - if (channel) - { - FMOD::Sound *currentsound = 0; - - result = channel->isPlaying(&playing); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - result = channel->getPaused(&paused); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - result = channel->getPosition(&ms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - channel->getCurrentSound(¤tsound); - if (currentsound) - { - result = currentsound->getLength(&lenms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - } - } - - system->getChannelsPlaying(&channelsplaying); - - printf("Time %02d:%02d:%02d/%02d:%02d:%02d : %s : Channels Playing %2d\r", ms / 1000 / 60, ms / 1000 % 60, ms / 10 % 100, lenms / 1000 / 60, lenms / 1000 % 60, lenms / 10 % 100, paused ? "Paused " : playing ? "Playing" : "Stopped", channelsplaying); - fflush(stdout); - } - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = sound1->release(); - ERRCHECK(result); - result = sound2->release(); - ERRCHECK(result); - result = sound3->release(); - ERRCHECK(result); - result = system->close(); - ERRCHECK(result); - result = system->release(); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/examples/playsound/playsound b/CocosDenshion/third_party/fmod/examples/playsound/playsound deleted file mode 100755 index 4264b19a3d..0000000000 Binary files a/CocosDenshion/third_party/fmod/examples/playsound/playsound and /dev/null differ diff --git a/CocosDenshion/third_party/fmod/examples/playstream/Makefile b/CocosDenshion/third_party/fmod/examples/playstream/Makefile deleted file mode 100644 index fd1ea53df3..0000000000 --- a/CocosDenshion/third_party/fmod/examples/playstream/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -playstream_cpp: main.cpp - g++ -O3 -o playstream main.cpp ../../api/lib/libfmodex.so -pthread - -playstream_c: main.c - g++ -O3 -o playstream main.c ../../api/lib/libfmodex.so -pthread - -run: - ./playstream - -clean: - rm -f playstream diff --git a/CocosDenshion/third_party/fmod/examples/playstream/main.c b/CocosDenshion/third_party/fmod/examples/playstream/main.c deleted file mode 100644 index eab0d6d12a..0000000000 --- a/CocosDenshion/third_party/fmod/examples/playstream/main.c +++ /dev/null @@ -1,149 +0,0 @@ -/*=============================================================================================== - PlayStream Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to simply play a stream, such as an mp3 or wav. - The stream behaviour is achieved by specifying FMOD_CREATESTREAM in the call to - FMOD_System_CreateSound. - This makes FMOD decode the file in realtime as it plays, instead of loading it all at once. - This uses far less memory, in exchange for a small runtime cpu hit. -===============================================================================================*/ -#include "../../api/inc/fmod.h" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD_SYSTEM *system; - FMOD_SOUND *sound; - FMOD_CHANNEL *channel = 0; - FMOD_RESULT result; - int key; - unsigned int version; - - /* - Create a System object and initialize. - */ - result = FMOD_System_Create(&system); - ERRCHECK(result); - - result = FMOD_System_GetVersion(system, &version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - getch(); - return 0; - } - - result = FMOD_System_Init(system, 1, FMOD_INIT_NORMAL, NULL); - ERRCHECK(result); - - result = FMOD_System_CreateSound(system, "../media/wave.mp3", FMOD_SOFTWARE | FMOD_2D | FMOD_CREATESTREAM, 0, &sound); - ERRCHECK(result); - - printf("====================================================================\n"); - printf("PlayStream Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("====================================================================\n"); - printf("\n"); - printf("Press space to pause, Esc to quit\n"); - printf("\n"); - - /* - Play the sound. - */ - - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound, 0, &channel); - ERRCHECK(result); - - /* - Main loop. - */ - do - { - if (kbhit()) - { - key = getch(); - - switch (key) - { - case ' ' : - { - int paused; - FMOD_Channel_GetPaused(channel, &paused); - FMOD_Channel_SetPaused(channel, !paused); - break; - } - } - } - - FMOD_System_Update(system); - - if (channel) - { - unsigned int ms; - unsigned int lenms; - int playing; - int paused; - - FMOD_Channel_IsPlaying(channel, &playing); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - result = FMOD_Channel_GetPaused(channel, &paused); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - result = FMOD_Channel_GetPosition(channel, &ms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - result = FMOD_Sound_GetLength(sound, &lenms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - printf("Time %02d:%02d:%02d/%02d:%02d:%02d : %s\r", ms / 1000 / 60, ms / 1000 % 60, ms / 10 % 100, lenms / 1000 / 60, lenms / 1000 % 60, lenms / 10 % 100, paused ? "Paused " : playing ? "Playing" : "Stopped"); - fflush(stdout); - } - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = FMOD_Sound_Release(sound); - ERRCHECK(result); - result = FMOD_System_Close(system); - ERRCHECK(result); - result = FMOD_System_Release(system); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/examples/playstream/main.cpp b/CocosDenshion/third_party/fmod/examples/playstream/main.cpp deleted file mode 100644 index 5fa8235a8d..0000000000 --- a/CocosDenshion/third_party/fmod/examples/playstream/main.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/*=============================================================================================== - PlayStream Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to simply play a stream, such as an mp3 or wav. - The stream behaviour is achieved by specifying FMOD_CREATESTREAM in the call to - System::createSound. - This makes FMOD decode the file in realtime as it plays, instead of loading it all at once. - This uses far less memory, in exchange for a small runtime cpu hit. -===============================================================================================*/ -#include "../../api/inc/fmod.hpp" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD::System *system; - FMOD::Sound *sound; - FMOD::Channel *channel = 0; - FMOD_RESULT result; - int key; - unsigned int version; - - /* - Create a System object and initialize. - */ - result = FMOD::System_Create(&system); - ERRCHECK(result); - - result = system->getVersion(&version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - getch(); - return 0; - } - - result = system->init(1, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - result = system->createSound("../media/wave.mp3", FMOD_SOFTWARE | FMOD_2D | FMOD_CREATESTREAM, 0, &sound); - ERRCHECK(result); - - printf("====================================================================\n"); - printf("PlayStream Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("====================================================================\n"); - printf("\n"); - printf("Press space to pause, Esc to quit\n"); - printf("\n"); - - /* - Play the sound. - */ - - result = system->playSound(FMOD_CHANNEL_FREE, sound, false, &channel); - ERRCHECK(result); - - /* - Main loop. - */ - do - { - if (kbhit()) - { - key = getch(); - - switch (key) - { - case ' ' : - { - bool paused; - channel->getPaused(&paused); - channel->setPaused(!paused); - break; - } - } - } - - system->update(); - - if (channel) - { - unsigned int ms; - unsigned int lenms; - bool playing; - bool paused; - - channel->isPlaying(&playing); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE)) - { - ERRCHECK(result); - } - - result = channel->getPaused(&paused); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE)) - { - ERRCHECK(result); - } - - result = channel->getPosition(&ms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE)) - { - ERRCHECK(result); - } - - result = sound->getLength(&lenms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE)) - { - ERRCHECK(result); - } - - printf("Time %02d:%02d:%02d/%02d:%02d:%02d : %s\r", ms / 1000 / 60, ms / 1000 % 60, ms / 10 % 100, lenms / 1000 / 60, lenms / 1000 % 60, lenms / 10 % 100, paused ? "Paused " : playing ? "Playing" : "Stopped"); - fflush(stdout); - } - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = sound->release(); - ERRCHECK(result); - result = system->close(); - ERRCHECK(result); - result = system->release(); - ERRCHECK(result); - - return 0; -} diff --git a/CocosDenshion/third_party/fmod/examples/plugin_dev/codec_raw/Makefile b/CocosDenshion/third_party/fmod/examples/plugin_dev/codec_raw/Makefile deleted file mode 100644 index 458ad01437..0000000000 --- a/CocosDenshion/third_party/fmod/examples/plugin_dev/codec_raw/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -all: - g++ -shared -fPIC -o codec_raw.so main.c - -clean: - rm -f codec_raw.so diff --git a/CocosDenshion/third_party/fmod/examples/plugin_dev/codec_raw/main.c b/CocosDenshion/third_party/fmod/examples/plugin_dev/codec_raw/main.c deleted file mode 100644 index 9b585b481d..0000000000 --- a/CocosDenshion/third_party/fmod/examples/plugin_dev/codec_raw/main.c +++ /dev/null @@ -1,96 +0,0 @@ -/*=============================================================================================== - CODEC_RAW.SO - Copyright (c), Firelight Technologies Pty, Ltd 2006-2011. - -===============================================================================================*/ - -#include - -#include "../../../api/inc/fmod.h" -#include "../../../api/inc/fmod_errors.h" - -FMOD_RESULT F_CALLBACK rawopen(FMOD_CODEC_STATE *codec, FMOD_MODE usermode, FMOD_CREATESOUNDEXINFO *userexinfo); -FMOD_RESULT F_CALLBACK rawclose(FMOD_CODEC_STATE *codec); -FMOD_RESULT F_CALLBACK rawread(FMOD_CODEC_STATE *codec, void *buffer, unsigned int size, unsigned int *read); -FMOD_RESULT F_CALLBACK rawsetposition(FMOD_CODEC_STATE *codec, int subsound, unsigned int position, FMOD_TIMEUNIT postype); - -FMOD_CODEC_DESCRIPTION rawcodec = -{ - "FMOD Raw player plugin example", // Name. - 0x00010000, // Version 0xAAAABBBB A = major, B = minor. - 0, // Don't force everything using this codec to be a stream - FMOD_TIMEUNIT_PCMBYTES, // The time format we would like to accept into setposition/getposition. - &rawopen, // Open callback. - &rawclose, // Close callback. - &rawread, // Read callback. - 0, // Getlength callback. (If not specified FMOD return the length in FMOD_TIMEUNIT_PCM, FMOD_TIMEUNIT_MS or FMOD_TIMEUNIT_PCMBYTES units based on the lengthpcm member of the FMOD_CODEC structure). - &rawsetposition, // Setposition callback. - 0, // Getposition callback. (only used for timeunit types that are not FMOD_TIMEUNIT_PCM, FMOD_TIMEUNIT_MS and FMOD_TIMEUNIT_PCMBYTES). - 0 // Sound create callback (don't need it) -}; - - -/* - FMODGetCodecDescription is mandatory for every fmod plugin. This is the symbol the registerplugin function searches for. - Must be declared with F_API to make it export as stdcall. - MUST BE EXTERN'ED AS C! C++ functions will be mangled incorrectly and not load in fmod. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -F_DECLSPEC F_DLLEXPORT FMOD_CODEC_DESCRIPTION * F_API FMODGetCodecDescription() -{ - return &rawcodec; -} - -#ifdef __cplusplus -} -#endif - - -static FMOD_CODEC_WAVEFORMAT rawwaveformat; - -/* - The actual codec code. - - Note that the callbacks uses FMOD's supplied file system callbacks. - - This is important as even though you might want to open the file yourself, you would lose the following benefits. - 1. Automatic support of memory files, CDDA based files, and HTTP/TCPIP based files. - 2. "fileoffset" / "length" support when user calls System::createSound with FMOD_CREATESOUNDEXINFO structure. - 3. Buffered file access. - FMOD files are high level abstracts that support all sorts of 'file', they are not just disk file handles. - If you want FMOD to use your own filesystem (and potentially lose the above benefits) use System::setFileSystem. -*/ - -FMOD_RESULT F_CALLBACK rawopen(FMOD_CODEC_STATE *codec, FMOD_MODE usermode, FMOD_CREATESOUNDEXINFO *userexinfo) -{ - rawwaveformat.channels = 2; - rawwaveformat.format = FMOD_SOUND_FORMAT_PCM16; - rawwaveformat.frequency = 44100; - rawwaveformat.blockalign = rawwaveformat.channels * 2; /* 2 = 16bit pcm */ - rawwaveformat.lengthpcm = codec->filesize / rawwaveformat.blockalign; /* bytes converted to PCM samples */; - - codec->numsubsounds = 0; /* number of 'subsounds' in this sound. For most codecs this is 0, only multi sound codecs such as FSB or CDDA have subsounds. */ - codec->waveformat = &rawwaveformat; - codec->plugindata = 0; /* user data value */ - - return FMOD_OK; -} - -FMOD_RESULT F_CALLBACK rawclose(FMOD_CODEC_STATE *codec) -{ - return FMOD_OK; -} - -FMOD_RESULT F_CALLBACK rawread(FMOD_CODEC_STATE *codec, void *buffer, unsigned int size, unsigned int *read) -{ - return codec->fileread(codec->filehandle, buffer, size, read, 0); -} - -FMOD_RESULT F_CALLBACK rawsetposition(FMOD_CODEC_STATE *codec, int subsound, unsigned int position, FMOD_TIMEUNIT postype) -{ - return codec->fileseek(codec->filehandle, position, 0); -} - diff --git a/CocosDenshion/third_party/fmod/examples/plugin_dev/dsp_gain/Makefile b/CocosDenshion/third_party/fmod/examples/plugin_dev/dsp_gain/Makefile deleted file mode 100644 index 86e326acec..0000000000 --- a/CocosDenshion/third_party/fmod/examples/plugin_dev/dsp_gain/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -all: - g++ -shared -fPIC -o dsp_gain.so main.c - -clean: - rm -f dsp_gain.so diff --git a/CocosDenshion/third_party/fmod/examples/plugin_dev/dsp_gain/main.c b/CocosDenshion/third_party/fmod/examples/plugin_dev/dsp_gain/main.c deleted file mode 100644 index d0b380f376..0000000000 --- a/CocosDenshion/third_party/fmod/examples/plugin_dev/dsp_gain/main.c +++ /dev/null @@ -1,181 +0,0 @@ -/*=============================================================================================== - DSP_GAIN.SO - Copyright (c), Firelight Technologies Pty, Ltd 2006-2011. - -===============================================================================================*/ - -#include -#include - -#include "../../../api/inc/fmod.h" -#include "../../../api/inc/fmod_errors.h" - -FMOD_RESULT F_CALLBACK dspcreate (FMOD_DSP_STATE *dsp); -FMOD_RESULT F_CALLBACK dsprelease (FMOD_DSP_STATE *dsp); -FMOD_RESULT F_CALLBACK dspreset (FMOD_DSP_STATE *dsp); -FMOD_RESULT F_CALLBACK dspread (FMOD_DSP_STATE *dsp, float *inbuffer, float *outbuffer, unsigned int length, int inchannels, int outchannels); -FMOD_RESULT F_CALLBACK dspsetparam(FMOD_DSP_STATE *dsp, int index, float value); -FMOD_RESULT F_CALLBACK dspgetparam(FMOD_DSP_STATE *dsp, int index, float *value, char *valuestr); - - -/* - DSP Parameter list. -*/ -FMOD_DSP_PARAMETERDESC dspparam[1] = -{ - { 0.0f, 1.0f, 1.0, "Level", "%", "Gain level" }, -}; - - -FMOD_DSP_DESCRIPTION dspgaindesc = -{ - "FMOD gain example", // name - 0x00010000, // version 0xAAAABBBB A = major, B = minor. - 0, // 0 = we can filter whatever you throw at us. To be most user friendly, always write a filter like this. - dspcreate, // - dsprelease, // - dspreset, // - dspread, // - 0, // This is for if you want to allow the plugin to seek, which doesnt really make sense in a gain filter so we'll just leave it out. - 1, // 1 parameter. "level" - dspparam, // pointer to the parameter list definition. - dspsetparam, // - dspgetparam, // - 0, // This is for if you want to pop up a dialog box to configure the plugin. Not doing that here. - 0, // This is for if you want to pop up a dialog box to configure the plugin. Not doing that here. - 0, // This is for if you want to pop up a dialog box to configure the plugin. Not doing that here. -}; - -/* - FMODGetDSPDescription is mandantory for every fmod plugin. This is the symbol the registerplugin function searches for. - Must be declared with F_API to make it export as stdcall. - MUST BE EXTERN'ED AS C! C++ functions will be mangled incorrectly and not load in fmod. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -F_DECLSPEC F_DLLEXPORT FMOD_DSP_DESCRIPTION * F_API FMODGetDSPDescription() -{ - return &dspgaindesc; -} - -#ifdef __cplusplus -} -#endif - - -typedef struct dspgain_state -{ - float gain; -} dspgain_state; - - -FMOD_RESULT F_CALLBACK dspcreate(FMOD_DSP_STATE *dsp) -{ - dspgain_state *state; - - /* - If we were allocating memory for buffers etc, it would be done in this function. - */ - - state = (dspgain_state *)malloc(sizeof(dspgain_state)); - if (!state) - { - return FMOD_ERR_MEMORY; - } - - state->gain = dspparam[0].defaultval; - - dsp->plugindata = state; - - return FMOD_OK; -} - -FMOD_RESULT F_CALLBACK dsprelease(FMOD_DSP_STATE *dsp) -{ - dspgain_state *state = (dspgain_state *)dsp->plugindata; - - /* - If memory was allocated in create, it would be freed in this function. - */ - - free(state); - - return FMOD_OK; -} - - -FMOD_RESULT F_CALLBACK dspreset(FMOD_DSP_STATE *dsp) -{ - dspgain_state *state = (dspgain_state *)dsp->plugindata; - - /* - This isnt really needed here. It is used to reset a filter back to it's default state. - */ - - state->gain = dspparam[0].defaultval; - - return FMOD_OK; -} - - -/* - This callback does the work. Modify data from inbuffer and send it to outbuffer. -*/ -FMOD_RESULT F_CALLBACK dspread(FMOD_DSP_STATE *dsp, float *inbuffer, float *outbuffer, unsigned int length, int inchannels, int outchannels) -{ - dspgain_state *state = (dspgain_state *)dsp->plugindata; - unsigned int count; - int count2; - int channels = inchannels; // outchannels and inchannels will always be the same because this is a flexible filter. - - for (count = 0; count < length; count++) - { - for (count2 = 0; count2 < channels; count2++) - { - outbuffer[(count * channels) + count2] = inbuffer[(count * channels) + count2] * state->gain; - } - } - - return FMOD_OK; -} - -/* - This callback is for when the user sets a parameter. It is automatically clamped between 0 and 1. -*/ -FMOD_RESULT F_CALLBACK dspsetparam(FMOD_DSP_STATE *dsp, int index, float value) -{ - dspgain_state *state = (dspgain_state *)dsp->plugindata; - - switch (index) - { - case 0: - { - state->gain = value; - break; - } - } - return FMOD_OK; -} - -/* - This callback is for when the user gets a parameter. The label for our only parameter is percent, - so when the string is requested print it out as 0 to 100. -*/ -FMOD_RESULT F_CALLBACK dspgetparam(FMOD_DSP_STATE *dsp, int index, float *value, char *valuestr) -{ - dspgain_state *state = (dspgain_state *)dsp->plugindata; - - switch (index) - { - case 0: - { - *value = state->gain; - sprintf(valuestr, "%.02f", state->gain * 100.0f); // our units are '%', so print it out as 0 to 100. - } - } - - return FMOD_OK; -} - diff --git a/CocosDenshion/third_party/fmod/examples/readtags/Makefile b/CocosDenshion/third_party/fmod/examples/readtags/Makefile deleted file mode 100644 index b30f2105b5..0000000000 --- a/CocosDenshion/third_party/fmod/examples/readtags/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -readtags_cpp: main.cpp - g++ -O3 -o readtags main.cpp ../../api/lib/libfmodex.so - -readtags_c: main.c - g++ -O3 -o readtags main.c ../../api/lib/libfmodex.so - -run: - ./readtags - -clean: - rm -f readtags diff --git a/CocosDenshion/third_party/fmod/examples/readtags/main.c b/CocosDenshion/third_party/fmod/examples/readtags/main.c deleted file mode 100644 index f164c6fd2e..0000000000 --- a/CocosDenshion/third_party/fmod/examples/readtags/main.c +++ /dev/null @@ -1,165 +0,0 @@ -/*=============================================================================================== - ReadTags Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to read tags from sound files -===============================================================================================*/ -#include "../../api/inc/fmod.h" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD_SYSTEM *system; - FMOD_SOUND *sound; - FMOD_RESULT result; - FMOD_TAG tag; - int numtags, numtagsupdated, count; - unsigned int version; - - printf("==================================================================\n"); - printf("ReadTags Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("==================================================================\n\n"); - - /* - Create a System object and initialize. - */ - result = FMOD_System_Create(&system); - ERRCHECK(result); - - result = FMOD_System_GetVersion(system, &version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - getch(); - return 0; - } - - result = FMOD_System_Init(system, 100, FMOD_INIT_NORMAL, NULL); - ERRCHECK(result); - - /* - Open the specified file. Use FMOD_CREATESTREAM and FMOD_OPENONLY so it opens quickly - */ - result = FMOD_System_CreateSound(system, "../media/wave.mp3", FMOD_SOFTWARE | FMOD_2D | FMOD_CREATESTREAM | FMOD_OPENONLY, 0, &sound); - ERRCHECK(result); - - /* - Read and display all tags associated with this file - */ - for (;;) - { - /* - An index of -1 means "get the first tag that's new or updated". - If no tags are new or updated then getTag will return FMOD_ERR_TAGNOTFOUND. - This is the first time we've read any tags so they'll all be new but after we've read them, - they won't be new any more. - */ - if (FMOD_Sound_GetTag(sound, 0, -1, &tag) != FMOD_OK) - { - break; - } - if (tag.datatype == FMOD_TAGDATATYPE_STRING) - { - printf("%s = %s (%d bytes)\n", tag.name, tag.data, tag.datalen); - } - else - { - printf("%s = (%d bytes)\n", tag.name, tag.datalen); - } - } - printf("\n"); - - /* - Read all the tags regardless of whether they're updated or not. Also show the tag type. - */ - result = FMOD_Sound_GetNumTags(sound, &numtags, &numtagsupdated); - ERRCHECK(result); - for (count=0; count < numtags; count++) - { - result = FMOD_Sound_GetTag(sound, 0, count, &tag); - ERRCHECK(result); - - switch (tag.type) - { - case FMOD_TAGTYPE_UNKNOWN : - printf("FMOD_TAGTYPE_UNKNOWN "); - break; - - case FMOD_TAGTYPE_ID3V1 : - printf("FMOD_TAGTYPE_ID3V1 "); - break; - - case FMOD_TAGTYPE_ID3V2 : - printf("FMOD_TAGTYPE_ID3V2 "); - break; - - case FMOD_TAGTYPE_VORBISCOMMENT : - printf("FMOD_TAGTYPE_VORBISCOMMENT "); - break; - - case FMOD_TAGTYPE_SHOUTCAST : - printf("FMOD_TAGTYPE_SHOUTCAST "); - break; - - case FMOD_TAGTYPE_ICECAST : - printf("FMOD_TAGTYPE_ICECAST "); - break; - - case FMOD_TAGTYPE_ASF : - printf("FMOD_TAGTYPE_ASF "); - break; - - case FMOD_TAGTYPE_FMOD : - printf("FMOD_TAGTYPE_FMOD "); - break; - - case FMOD_TAGTYPE_USER : - printf("FMOD_TAGTYPE_USER "); - break; - } - - if (tag.datatype == FMOD_TAGDATATYPE_STRING) - { - printf("%s = %s (%d bytes)\n", tag.name, tag.data, tag.datalen); - } - else - { - printf("%s = ??? (%d bytes)\n", tag.name, tag.datalen); - } - } - printf("\n"); - - /* - Find a specific tag by name. Specify an index > 0 to get access to multiple tags of the same name. - */ - result = FMOD_Sound_GetTag(sound, "ARTIST", 0, &tag); - ERRCHECK(result); - printf("%s = %s (%d bytes)\n", tag.name, tag.data, tag.datalen); - printf("\n"); - - /* - Shut down - */ - result = FMOD_Sound_Release(sound); - ERRCHECK(result); - result = FMOD_System_Close(system); - ERRCHECK(result); - result = FMOD_System_Release(system); - ERRCHECK(result); - - return 0; -} diff --git a/CocosDenshion/third_party/fmod/examples/readtags/main.cpp b/CocosDenshion/third_party/fmod/examples/readtags/main.cpp deleted file mode 100644 index 8a1ed8bdd7..0000000000 --- a/CocosDenshion/third_party/fmod/examples/readtags/main.cpp +++ /dev/null @@ -1,165 +0,0 @@ -/*=============================================================================================== - ReadTags Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to read tags from sound files -===============================================================================================*/ -#include "../../api/inc/fmod.hpp" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD::System *system; - FMOD::Sound *sound; - FMOD_RESULT result; - FMOD_TAG tag; - int numtags, numtagsupdated, count; - unsigned int version; - - printf("==================================================================\n"); - printf("ReadTags Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("==================================================================\n\n"); - - /* - Create a System object and initialize. - */ - result = FMOD::System_Create(&system); - ERRCHECK(result); - - result = system->getVersion(&version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - getch(); - return 0; - } - - result = system->init(100, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - /* - Open the specified file. Use FMOD_CREATESTREAM and FMOD_OPENONLY so it opens quickly - */ - result = system->createSound("../media/wave.mp3", FMOD_SOFTWARE | FMOD_2D | FMOD_CREATESTREAM | FMOD_OPENONLY, 0, &sound); - ERRCHECK(result); - - /* - Read and display all tags associated with this file - */ - for (;;) - { - /* - An index of -1 means "get the first tag that's new or updated". - If no tags are new or updated then getTag will return FMOD_ERR_TAGNOTFOUND. - This is the first time we've read any tags so they'll all be new but after we've read them, - they won't be new any more. - */ - if (sound->getTag(0, -1, &tag) != FMOD_OK) - { - break; - } - if (tag.datatype == FMOD_TAGDATATYPE_STRING) - { - printf("%s = %s (%d bytes)\n", tag.name, tag.data, tag.datalen); - } - else - { - printf("%s = (%d bytes)\n", tag.name, tag.datalen); - } - } - printf("\n"); - - /* - Read all the tags regardless of whether they're updated or not. Also show the tag type. - */ - result = sound->getNumTags(&numtags, &numtagsupdated); - ERRCHECK(result); - for (count=0; count < numtags; count++) - { - result = sound->getTag(0, count, &tag); - ERRCHECK(result); - - switch (tag.type) - { - case FMOD_TAGTYPE_UNKNOWN : - printf("FMOD_TAGTYPE_UNKNOWN "); - break; - - case FMOD_TAGTYPE_ID3V1 : - printf("FMOD_TAGTYPE_ID3V1 "); - break; - - case FMOD_TAGTYPE_ID3V2 : - printf("FMOD_TAGTYPE_ID3V2 "); - break; - - case FMOD_TAGTYPE_VORBISCOMMENT : - printf("FMOD_TAGTYPE_VORBISCOMMENT "); - break; - - case FMOD_TAGTYPE_SHOUTCAST : - printf("FMOD_TAGTYPE_SHOUTCAST "); - break; - - case FMOD_TAGTYPE_ICECAST : - printf("FMOD_TAGTYPE_ICECAST "); - break; - - case FMOD_TAGTYPE_ASF : - printf("FMOD_TAGTYPE_ASF "); - break; - - case FMOD_TAGTYPE_FMOD : - printf("FMOD_TAGTYPE_FMOD "); - break; - - case FMOD_TAGTYPE_USER : - printf("FMOD_TAGTYPE_USER "); - break; - } - - if (tag.datatype == FMOD_TAGDATATYPE_STRING) - { - printf("%s = %s (%d bytes)\n", tag.name, tag.data, tag.datalen); - } - else - { - printf("%s = ??? (%d bytes)\n", tag.name, tag.datalen); - } - } - printf("\n"); - - /* - Find a specific tag by name. Specify an index > 0 to get access to multiple tags of the same name. - */ - result = sound->getTag("ARTIST", 0, &tag); - ERRCHECK(result); - printf("%s = %s (%d bytes)\n", tag.name, tag.data, tag.datalen); - printf("\n"); - - /* - Shut down - */ - result = sound->release(); - ERRCHECK(result); - result = system->close(); - ERRCHECK(result); - result = system->release(); - ERRCHECK(result); - - return 0; -} diff --git a/CocosDenshion/third_party/fmod/examples/realtimestitching/Makefile b/CocosDenshion/third_party/fmod/examples/realtimestitching/Makefile deleted file mode 100644 index 38f43b13f0..0000000000 --- a/CocosDenshion/third_party/fmod/examples/realtimestitching/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -realtimestitching_cpp: main.cpp - g++ -O3 -o realtimestitching main.cpp ../../api/lib/libfmodex.so -pthread - -realtimestitching_c: main.c - g++ -O3 -o realtimestitching main.c ../../api/lib/libfmodex.so -pthread - -run: - ./realtimestitching - -clean: - rm -f realtimestitching diff --git a/CocosDenshion/third_party/fmod/examples/realtimestitching/main.c b/CocosDenshion/third_party/fmod/examples/realtimestitching/main.c deleted file mode 100644 index 52942f6c88..0000000000 --- a/CocosDenshion/third_party/fmod/examples/realtimestitching/main.c +++ /dev/null @@ -1,245 +0,0 @@ -/*=============================================================================================== - Real-time stitching example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how you can create your own multi-subsound stream, then in realtime replace - each the subsound as it plays them. Using a looping sentence, it will seamlessly stich between - 2 subsounds in this example, and each time it switches to a new sound, it will replace the old - one with another sound in our list. - - These sounds can go on forever as long as they are the same bitdepth (when decoded) and number - of channels (ie mono / stereo). The reason for this is the hardware channel cannot change - formats mid sentence, and using different hardware channels would mean it wouldn't be gapless. - -===============================================================================================*/ -#include "../../api/inc/fmod.h" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" - -#include - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - -#define NUMSOUNDS 32 - -int main(int argc, char *argv[]) -{ - FMOD_SYSTEM *system; - FMOD_SOUND *sound; - FMOD_SOUND *subsound[2]; - FMOD_CREATESOUNDEXINFO exinfo; - FMOD_CHANNEL *channel = 0; - FMOD_RESULT result; - int key; - unsigned int subsoundid, sentenceid; - unsigned int version; - const char *soundname[NUMSOUNDS] = - { - "../media/e.ogg", /* Ma- */ - "../media/d.ogg", /* ry */ - "../media/c.ogg", /* had */ - "../media/d.ogg", /* a */ - "../media/e.ogg", /* lit- */ - "../media/e.ogg", /* tle */ - "../media/e.ogg", /* lamb, */ - "../media/e.ogg", /* ..... */ - "../media/d.ogg", /* lit- */ - "../media/d.ogg", /* tle */ - "../media/d.ogg", /* lamb, */ - "../media/d.ogg", /* ..... */ - "../media/e.ogg", /* lit- */ - "../media/e.ogg", /* tle */ - "../media/e.ogg", /* lamb, */ - "../media/e.ogg", /* ..... */ - - "../media/e.ogg", /* Ma- */ - "../media/d.ogg", /* ry */ - "../media/c.ogg", /* had */ - "../media/d.ogg", /* a */ - "../media/e.ogg", /* lit- */ - "../media/e.ogg", /* tle */ - "../media/e.ogg", /* lamb, */ - "../media/e.ogg", /* its */ - "../media/d.ogg", /* fleece */ - "../media/d.ogg", /* was */ - "../media/e.ogg", /* white */ - "../media/d.ogg", /* as */ - "../media/c.ogg", /* snow. */ - "../media/c.ogg", /* ..... */ - "../media/c.ogg", /* ..... */ - "../media/c.ogg", /* ..... */ - }; - - /* - Create a System object and initialize. - */ - result = FMOD_System_Create(&system); - ERRCHECK(result); - - result = FMOD_System_GetVersion(system, &version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - result = FMOD_System_Init(system, 1, FMOD_INIT_NORMAL, NULL); - ERRCHECK(result); - - /* - Set up the FMOD_CREATESOUNDEXINFO structure for the user stream with room for 2 subsounds. (our subsound double buffer) - */ - memset(&exinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO)); - - exinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO); - exinfo.defaultfrequency = 44100; - exinfo.numsubsounds = 2; - exinfo.numchannels = 1; - exinfo.format = FMOD_SOUND_FORMAT_PCM16; - - /* - Create the 'parent' stream that contains the substreams. Set it to loop so that it loops between subsound 0 and 1. - */ - result = FMOD_System_CreateStream(system, 0, FMOD_LOOP_NORMAL | FMOD_OPENUSER, &exinfo, &sound); - ERRCHECK(result); - - /* - Add 2 of our streams as children of the parent. They should be the same format (ie mono/stereo and bitdepth) as the parent sound. - When subsound 0 has finished and it is playing subsound 1, we will swap subsound 0 with a new sound, and the same for when subsound 1 has finished, - causing a continual double buffered flip, which means continuous sound. - */ - result = FMOD_System_CreateStream(system, soundname[0], FMOD_DEFAULT, 0, &subsound[0]); - ERRCHECK(result); - - result = FMOD_System_CreateStream(system, soundname[1], FMOD_DEFAULT, 0, &subsound[1]); - ERRCHECK(result); - - result = FMOD_Sound_SetSubSound(sound, 0, subsound[0]); - ERRCHECK(result); - - result = FMOD_Sound_SetSubSound(sound, 1, subsound[1]); - ERRCHECK(result); - - /* - Set up the gapless sentence to contain these first 2 streams. - */ - { - int soundlist[2] = { 0, 1 }; - - result = FMOD_Sound_SetSubSoundSentence(sound, soundlist, 2); - ERRCHECK(result); - } - - subsoundid = 0; - sentenceid = 2; /* The next sound to be appeneded to the stream. */ - - printf("=============================================================================\n"); - printf("Real-time stitching example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("=============================================================================\n"); - printf("\n"); - printf("Press space to pause, Esc to quit\n"); - printf("\n"); - - printf("Inserted subsound %d / 2 with sound %d / %d\n", 0, 0, NUMSOUNDS); - printf("Inserted subsound %d / 2 with sound %d / %d\n", 1, 1, NUMSOUNDS); - - /* - Play the sound. - */ - - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound, FALSE, &channel); - ERRCHECK(result); - - /* - Main loop. - */ - do - { - unsigned int currentsubsoundid; - - if (kbhit()) - { - key = getch(); - - switch (key) - { - case ' ' : - { - int paused; - FMOD_Channel_GetPaused(channel, &paused); - FMOD_Channel_SetPaused(channel, !paused); - break; - } - } - } - - FMOD_System_Update(system); - - /* - Replace the subsound that just finished with a new subsound, to create endless seamless stitching! - - Note that this polls the currently playing subsound using the FMOD_TIMEUNIT_BUFFERED flag. - Remember streams are decoded / buffered ahead in advance! - Don't use the 'audible time' which is FMOD_TIMEUNIT_SENTENCE_SUBSOUND by itself. When streaming, sound is - processed ahead of time, and things like stream buffer / sentence manipulation (as done below) is required - to be in 'buffered time', or else there will be synchronization problems and you might end up releasing a - sub-sound that is still playing! - */ - result = FMOD_Channel_GetPosition(channel, ¤tsubsoundid, (FMOD_TIMEUNIT)(FMOD_TIMEUNIT_SENTENCE_SUBSOUND | FMOD_TIMEUNIT_BUFFERED)); - ERRCHECK(result); - - if (currentsubsoundid != subsoundid) - { - /* - Release the sound that isn't playing any more. - */ - result = FMOD_Sound_Release(subsound[subsoundid]); - ERRCHECK(result); - - /* - Replace it with a new sound in our list. - */ - result = FMOD_System_CreateStream(system, soundname[sentenceid], FMOD_DEFAULT, 0, &subsound[subsoundid]); - ERRCHECK(result); - - result = FMOD_Sound_SetSubSound(sound, subsoundid, subsound[subsoundid]); - ERRCHECK(result); - - printf("Replacing subsound %d / 2 with sound %d / %d\n", subsoundid, sentenceid, NUMSOUNDS); - - sentenceid++; - if (sentenceid >= NUMSOUNDS) - { - sentenceid = 0; - } - - subsoundid = currentsubsoundid; - } - - Sleep(50); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = FMOD_Sound_Release(sound); /* Freeing a parent subsound also frees its children. */ - ERRCHECK(result); - result = FMOD_System_Close(system); - ERRCHECK(result); - result = FMOD_System_Release(system); - ERRCHECK(result); - - return 0; -} diff --git a/CocosDenshion/third_party/fmod/examples/realtimestitching/main.cpp b/CocosDenshion/third_party/fmod/examples/realtimestitching/main.cpp deleted file mode 100644 index 45115f0981..0000000000 --- a/CocosDenshion/third_party/fmod/examples/realtimestitching/main.cpp +++ /dev/null @@ -1,245 +0,0 @@ -/*=============================================================================================== - Real-time stitching example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how you can create your own multi-subsound stream, then in realtime replace - each the subsound as it plays them. Using a looping sentence, it will seamlessly stich between - 2 subsounds in this example, and each time it switches to a new sound, it will replace the old - one with another sound in our list. - - These sounds can go on forever as long as they are the same bitdepth (when decoded) and number - of channels (ie mono / stereo). The reason for this is the hardware channel cannot change - formats mid sentence, and using different hardware channels would mean it wouldn't be gapless. - -===============================================================================================*/ -#include "../../api/inc/fmod.hpp" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" - -#include - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - -#define NUMSOUNDS 32 - -int main(int argc, char *argv[]) -{ - FMOD::System *system; - FMOD::Sound *sound; - FMOD::Sound *subsound[2]; - FMOD_CREATESOUNDEXINFO exinfo; - FMOD::Channel *channel = 0; - FMOD_RESULT result; - int key; - unsigned int subsoundid, sentenceid; - unsigned int version; - const char *soundname[NUMSOUNDS] = - { - "../media/e.ogg", /* Ma- */ - "../media/d.ogg", /* ry */ - "../media/c.ogg", /* had */ - "../media/d.ogg", /* a */ - "../media/e.ogg", /* lit- */ - "../media/e.ogg", /* tle */ - "../media/e.ogg", /* lamb, */ - "../media/e.ogg", /* ..... */ - "../media/d.ogg", /* lit- */ - "../media/d.ogg", /* tle */ - "../media/d.ogg", /* lamb, */ - "../media/d.ogg", /* ..... */ - "../media/e.ogg", /* lit- */ - "../media/e.ogg", /* tle */ - "../media/e.ogg", /* lamb, */ - "../media/e.ogg", /* ..... */ - - "../media/e.ogg", /* Ma- */ - "../media/d.ogg", /* ry */ - "../media/c.ogg", /* had */ - "../media/d.ogg", /* a */ - "../media/e.ogg", /* lit- */ - "../media/e.ogg", /* tle */ - "../media/e.ogg", /* lamb, */ - "../media/e.ogg", /* its */ - "../media/d.ogg", /* fleece */ - "../media/d.ogg", /* was */ - "../media/e.ogg", /* white */ - "../media/d.ogg", /* as */ - "../media/c.ogg", /* snow. */ - "../media/c.ogg", /* ..... */ - "../media/c.ogg", /* ..... */ - "../media/c.ogg", /* ..... */ - }; - - /* - Create a System object and initialize. - */ - result = FMOD::System_Create(&system); - ERRCHECK(result); - - result = system->getVersion(&version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - result = system->init(1, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - /* - Set up the FMOD_CREATESOUNDEXINFO structure for the user stream with room for 2 subsounds. (our subsound double buffer) - */ - memset(&exinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO)); - - exinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO); - exinfo.defaultfrequency = 44100; - exinfo.numsubsounds = 2; - exinfo.numchannels = 1; - exinfo.format = FMOD_SOUND_FORMAT_PCM16; - - /* - Create the 'parent' stream that contains the substreams. Set it to loop so that it loops between subsound 0 and 1. - */ - result = system->createStream(0, FMOD_LOOP_NORMAL | FMOD_OPENUSER, &exinfo, &sound); - ERRCHECK(result); - - /* - Add 2 of our streams as children of the parent. They should be the same format (ie mono/stereo and bitdepth) as the parent sound. - When subsound 0 has finished and it is playing subsound 1, we will swap subsound 0 with a new sound, and the same for when subsound 1 has finished, - causing a continual double buffered flip, which means continuous sound. - */ - result = system->createStream(soundname[0], FMOD_DEFAULT, 0, &subsound[0]); - ERRCHECK(result); - - result = system->createStream(soundname[1], FMOD_DEFAULT, 0, &subsound[1]); - ERRCHECK(result); - - result = sound->setSubSound(0, subsound[0]); - ERRCHECK(result); - - result = sound->setSubSound(1, subsound[1]); - ERRCHECK(result); - - /* - Set up the gapless sentence to contain these first 2 streams. - */ - { - int soundlist[2] = { 0, 1 }; - - result = sound->setSubSoundSentence(soundlist, 2); - ERRCHECK(result); - } - - subsoundid = 0; - sentenceid = 2; /* The next sound to be appeneded to the stream. */ - - printf("=============================================================================\n"); - printf("Real-time stitching example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("=============================================================================\n"); - printf("\n"); - printf("Press space to pause, Esc to quit\n"); - printf("\n"); - - printf("Inserted subsound %d / 2 with sound %d / %d\n", 0, 0, NUMSOUNDS); - printf("Inserted subsound %d / 2 with sound %d / %d\n", 1, 1, NUMSOUNDS); - - /* - Play the sound. - */ - - result = system->playSound(FMOD_CHANNEL_FREE, sound, false, &channel); - ERRCHECK(result); - - /* - Main loop. - */ - do - { - unsigned int currentsubsoundid; - - if (kbhit()) - { - key = getch(); - - switch (key) - { - case ' ' : - { - bool paused; - channel->getPaused(&paused); - channel->setPaused(!paused); - break; - } - } - } - - system->update(); - - /* - Replace the subsound that just finished with a new subsound, to create endless seamless stitching! - - Note that this polls the currently playing subsound using the FMOD_TIMEUNIT_BUFFERED flag. - Remember streams are decoded / buffered ahead in advance! - Don't use the 'audible time' which is FMOD_TIMEUNIT_SENTENCE_SUBSOUND by itself. When streaming, sound is - processed ahead of time, and things like stream buffer / sentence manipulation (as done below) is required - to be in 'buffered time', or else there will be synchronization problems and you might end up releasing a - sub-sound that is still playing! - */ - result = channel->getPosition(¤tsubsoundid, (FMOD_TIMEUNIT)(FMOD_TIMEUNIT_SENTENCE_SUBSOUND | FMOD_TIMEUNIT_BUFFERED)); - ERRCHECK(result); - - if (currentsubsoundid != subsoundid) - { - /* - Release the sound that isn't playing any more. - */ - result = subsound[subsoundid]->release(); - ERRCHECK(result); - - /* - Replace it with a new sound in our list. - */ - result = system->createStream(soundname[sentenceid], FMOD_DEFAULT, 0, &subsound[subsoundid]); - ERRCHECK(result); - - result = sound->setSubSound(subsoundid, subsound[subsoundid]); - ERRCHECK(result); - - printf("Replacing subsound %d / 2 with sound %d / %d\n", subsoundid, sentenceid, NUMSOUNDS); - - sentenceid++; - if (sentenceid >= NUMSOUNDS) - { - sentenceid = 0; - } - - subsoundid = currentsubsoundid; - } - - Sleep(50); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = sound->release(); /* Freeing a parent subsound also frees its children. */ - ERRCHECK(result); - result = system->close(); - ERRCHECK(result); - result = system->release(); - ERRCHECK(result); - - return 0; -} diff --git a/CocosDenshion/third_party/fmod/examples/recording/Makefile b/CocosDenshion/third_party/fmod/examples/recording/Makefile deleted file mode 100644 index b8907706bb..0000000000 --- a/CocosDenshion/third_party/fmod/examples/recording/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -recording_cpp: main.cpp - g++ -O3 -o recording main.cpp ../../api/lib/libfmodex.so -pthread - -recording_c: main.c - g++ -O3 -o recording main.c ../../api/lib/libfmodex.so -pthread - -run: - ./recording - -clean: - rm -f recording diff --git a/CocosDenshion/third_party/fmod/examples/recording/main.c b/CocosDenshion/third_party/fmod/examples/recording/main.c deleted file mode 100644 index aa0414f83d..0000000000 --- a/CocosDenshion/third_party/fmod/examples/recording/main.c +++ /dev/null @@ -1,401 +0,0 @@ -/*=============================================================================================== - Record example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to record a sound, then write it to a wav file. - It then shows how to play a sound while it is being recorded to. Because it is recording, the - sound playback has to be delayed a little bit so that the playback doesn't play part of the - buffer that is still being written to. -===============================================================================================*/ -#include "../../api/inc/fmod.h" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" - -#include - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - -#if defined(WIN32) || defined(__WATCOMC__) || defined(_WIN32) || defined(__WIN32__) - #define __PACKED /* dummy */ -#else - #define __PACKED __attribute__((packed)) /* gcc packed */ -#endif - -/* -[ - [DESCRIPTION] - Writes out the contents of a record buffer to a file. - - [PARAMETERS] - - [RETURN_VALUE] - void - - [REMARKS] -] -*/ -void SaveToWav(FMOD_SOUND *sound) -{ - FILE *fp; - int channels, bits; - float rate; - void *ptr1, *ptr2; - unsigned int lenbytes, len1, len2; - - if (!sound) - { - return; - } - - FMOD_Sound_GetFormat (sound, 0, 0, &channels, &bits); - FMOD_Sound_GetDefaults(sound, &rate, 0, 0, 0); - FMOD_Sound_GetLength (sound, &lenbytes, FMOD_TIMEUNIT_PCMBYTES); - - { - #if defined(WIN32) || defined(_WIN64) || defined(__WATCOMC__) || defined(_WIN32) || defined(__WIN32__) - #pragma pack(1) - #endif - - /* - WAV Structures - */ - typedef struct - { - signed char id[4]; - int size; - } RiffChunk; - - struct - { - RiffChunk chunk __PACKED; - unsigned short wFormatTag __PACKED; /* format type */ - unsigned short nChannels __PACKED; /* number of channels (i.e. mono, stereo...) */ - unsigned int nSamplesPerSec __PACKED; /* sample rate */ - unsigned int nAvgBytesPerSec __PACKED; /* for buffer estimation */ - unsigned short nBlockAlign __PACKED; /* block size of data */ - unsigned short wBitsPerSample __PACKED; /* number of bits per sample of mono data */ - } __PACKED FmtChunk = { {{'f','m','t',' '}, sizeof(FmtChunk) - sizeof(RiffChunk) }, 1, channels, (int)rate, (int)rate * channels * bits / 8, 1 * channels * bits / 8, bits }; - - struct - { - RiffChunk chunk; - } DataChunk = { {{'d','a','t','a'}, lenbytes } }; - - struct - { - RiffChunk chunk; - signed char rifftype[4]; - } WavHeader = { {{'R','I','F','F'}, sizeof(FmtChunk) + sizeof(RiffChunk) + lenbytes }, {'W','A','V','E'} }; - - #if defined(WIN32) || defined(_WIN64) || defined(__WATCOMC__) || defined(_WIN32) || defined(__WIN32__) - #pragma pack() - #endif - - fp = fopen("record.wav", "wb"); - - /* - Write out the WAV header. - */ - fwrite(&WavHeader, sizeof(WavHeader), 1, fp); - fwrite(&FmtChunk, sizeof(FmtChunk), 1, fp); - fwrite(&DataChunk, sizeof(DataChunk), 1, fp); - - /* - Lock the sound to get access to the raw data. - */ - FMOD_Sound_Lock(sound, 0, lenbytes, &ptr1, &ptr2, &len1, &len2); - - /* - Write it to disk. - */ - fwrite(ptr1, len1, 1, fp); - - /* - Unlock the sound to allow FMOD to use it again. - */ - FMOD_Sound_Unlock(sound, ptr1, ptr2, len1, len2); - - fclose(fp); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD_SYSTEM *system = 0; - FMOD_SOUND *sound = 0; - FMOD_CHANNEL *channel = 0; - FMOD_RESULT result; - FMOD_CREATESOUNDEXINFO exinfo; - int key, driver, recorddriver, numdrivers, count; - unsigned int version; - - /* - Create a System object and initialize. - */ - result = FMOD_System_Create(&system); - ERRCHECK(result); - - result = FMOD_System_GetVersion(system, &version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - /* - System initialization - */ - printf("---------------------------------------------------------\n"); - printf("Select OUTPUT type\n"); - printf("---------------------------------------------------------\n"); - printf("1 : OSS - Open Sound System\n"); - printf("2 : ALSA - Advanced Linux Sound Architecture\n"); - printf("3 : ESD - Enlightenment Sound Daemon\n"); - printf("4 : PULSEAUDIO - Pulse Audio Sound Server\n"); - printf("---------------------------------------------------------\n"); - printf("Press a corresponding number or ESC to quit\n"); - - do - { - key = getch(); - } while (key != 27 && key < '1' && key > '5'); - - switch (key) - { - case '1' : result = FMOD_System_SetOutput(system, FMOD_OUTPUTTYPE_OSS); - break; - case '2' : result = FMOD_System_SetOutput(system, FMOD_OUTPUTTYPE_ALSA); - break; - case '3' : result = FMOD_System_SetOutput(system, FMOD_OUTPUTTYPE_ESD); - break; - case '4' : result = FMOD_System_SetOutput(system, FMOD_OUTPUTTYPE_PULSEAUDIO); - break; - default : return 1; - } - ERRCHECK(result); - - /* - Enumerate playback devices - */ - - result = FMOD_System_GetNumDrivers(system, &numdrivers); - ERRCHECK(result); - - printf("---------------------------------------------------------\n"); - printf("Choose a PLAYBACK driver\n"); - printf("---------------------------------------------------------\n"); - for (count=0; count < numdrivers; count++) - { - char name[256]; - - result = FMOD_System_GetDriverInfo(system, count, name, 256, 0); - ERRCHECK(result); - - printf("%d : %s\n", count + 1, name); - } - printf("---------------------------------------------------------\n"); - printf("Press a corresponding number or ESC to quit\n"); - - do - { - key = getch(); - if (key == 27) - { - return 0; - } - driver = key - '1'; - } while (driver < 0 || driver >= numdrivers); - - result = FMOD_System_SetDriver(system, driver); - ERRCHECK(result); - - /* - Enumerate record devices - */ - - result = FMOD_System_GetRecordNumDrivers(system, &numdrivers); - ERRCHECK(result); - - printf("---------------------------------------------------------\n"); - printf("Choose a RECORD driver\n"); - printf("---------------------------------------------------------\n"); - for (count=0; count < numdrivers; count++) - { - char name[256]; - - result = FMOD_System_GetRecordDriverInfo(system, count, name, 256, 0); - ERRCHECK(result); - - printf("%d : %s\n", count + 1, name); - } - printf("---------------------------------------------------------\n"); - printf("Press a corresponding number or ESC to quit\n"); - - recorddriver = 0; - do - { - key = getch(); - if (key == 27) - { - return 0; - } - recorddriver = key - '1'; - } while (recorddriver < 0 || recorddriver >= numdrivers); - - printf("\n"); - - result = FMOD_System_SetRecordDriver(system, recorddriver, driver); - ERRCHECK(result); - - result = FMOD_System_Init(system, 32, FMOD_INIT_NORMAL, NULL); - ERRCHECK(result); - - memset(&exinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO)); - - exinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO); - exinfo.numchannels = 2; - exinfo.format = FMOD_SOUND_FORMAT_PCM16; - exinfo.defaultfrequency = 44100; - exinfo.length = exinfo.defaultfrequency * sizeof(short) * exinfo.numchannels * 5; - - result = FMOD_System_CreateSound(system, 0, FMOD_2D | FMOD_SOFTWARE | FMOD_OPENUSER, &exinfo, &sound); - ERRCHECK(result); - - printf("===================================================================\n"); - printf("Recording example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("===================================================================\n"); - printf("\n"); - printf("Press 'r' to record a 5 second segment of audio and write it to a wav file.\n"); - printf("Press 'p' to play the 5 second segment of audio.\n"); - printf("Press 'l' to turn looping on/off.\n"); - printf("Press 's' to stop recording and playback.\n"); - printf("Press 'w' to save the 5 second segment to a wav file.\n"); - printf("Press 'Esc' to quit\n"); - printf("\n"); - - /* - Main loop. - */ - do - { - static FMOD_CHANNEL *channel = 0; - static int looping = 0; - int recording = 0; - int playing = 0; - unsigned int recordpos = 0; - unsigned int playpos = 0; - unsigned int length; - - if (kbhit()) - { - key = getch(); - - switch (key) - { - case 'r' : - case 'R' : - { - result = FMOD_System_RecordStart(system, recorddriver, sound, looping); - ERRCHECK(result); - break; - } - case 'p' : - case 'P' : - { - if (looping) - { - FMOD_Sound_SetMode(sound, FMOD_LOOP_NORMAL); - } - else - { - FMOD_Sound_SetMode(sound, FMOD_LOOP_OFF); - } - ERRCHECK(result); - - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_REUSE, sound, 0, &channel); - ERRCHECK(result); - break; - } - case 'l' : - case 'L' : - { - looping = !looping; - break; - } - case 's' : - case 'S' : - { - result = FMOD_System_RecordStop(system, recorddriver); - if (channel) - { - FMOD_Channel_Stop(channel); - channel = 0; - } - break; - } - case 'w' : - case 'W' : - { - printf("Writing to record.wav ... \r"); - - SaveToWav(sound); - Sleep(500); - - break; - } - } - } - - FMOD_Sound_GetLength(sound, &length, FMOD_TIMEUNIT_PCM); - ERRCHECK(result); - - FMOD_System_IsRecording(system, recorddriver, &recording); - ERRCHECK(result); - - FMOD_System_GetRecordPosition(system, recorddriver, &recordpos); - ERRCHECK(result); - - if (channel) - { - FMOD_Channel_IsPlaying(channel, &playing); - ERRCHECK(result); - - FMOD_Channel_GetPosition(channel, &playpos, FMOD_TIMEUNIT_PCM); - ERRCHECK(result); - } - - printf("State: %-19s. Record pos = %6d : Play pos = %6d : Loop %-3s\r", recording ? playing ? "Recording / playing" : "Recording" : playing ? "Playing" : "Idle", recordpos, playpos, looping ? "On" : "Off"); - fflush(stdout); - - FMOD_System_Update(system); - - fflush(stdout); - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = FMOD_Sound_Release(sound); - ERRCHECK(result); - - result = FMOD_System_Release(system); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/examples/recording/main.cpp b/CocosDenshion/third_party/fmod/examples/recording/main.cpp deleted file mode 100644 index 74f45edd75..0000000000 --- a/CocosDenshion/third_party/fmod/examples/recording/main.cpp +++ /dev/null @@ -1,395 +0,0 @@ -/*=============================================================================================== - Record example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to record a sound, then write it to a wav file. - It then shows how to play a sound while it is being recorded to. Because it is recording, the - sound playback has to be delayed a little bit so that the playback doesn't play part of the - buffer that is still being written to. -===============================================================================================*/ -#include "../../api/inc/fmod.hpp" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" - -#include - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - -#if defined(WIN32) || defined(__WATCOMC__) || defined(_WIN32) || defined(__WIN32__) - #define __PACKED /* dummy */ -#else - #define __PACKED __attribute__((packed)) /* gcc packed */ -#endif - -/* -[ - [DESCRIPTION] - Writes out the contents of a record buffer to a file. - - [PARAMETERS] - - [RETURN_VALUE] - void - - [REMARKS] -] -*/ -void SaveToWav(FMOD::Sound *sound) -{ - FILE *fp; - int channels, bits; - float rate; - void *ptr1, *ptr2; - unsigned int lenbytes, len1, len2; - - if (!sound) - { - return; - } - - sound->getFormat (0, 0, &channels, &bits); - sound->getDefaults(&rate, 0, 0, 0); - sound->getLength (&lenbytes, FMOD_TIMEUNIT_PCMBYTES); - - { - #if defined(WIN32) || defined(_WIN64) || defined(__WATCOMC__) || defined(_WIN32) || defined(__WIN32__) - #pragma pack(1) - #endif - - /* - WAV Structures - */ - typedef struct - { - signed char id[4]; - int size; - } RiffChunk; - - struct - { - RiffChunk chunk __PACKED; - unsigned short wFormatTag __PACKED; /* format type */ - unsigned short nChannels __PACKED; /* number of channels (i.e. mono, stereo...) */ - unsigned int nSamplesPerSec __PACKED; /* sample rate */ - unsigned int nAvgBytesPerSec __PACKED; /* for buffer estimation */ - unsigned short nBlockAlign __PACKED; /* block size of data */ - unsigned short wBitsPerSample __PACKED; /* number of bits per sample of mono data */ - } __PACKED FmtChunk = { {{'f','m','t',' '}, sizeof(FmtChunk) - sizeof(RiffChunk) }, 1, channels, (int)rate, (int)rate * channels * bits / 8, 1 * channels * bits / 8, bits }; - - struct - { - RiffChunk chunk; - } DataChunk = { {{'d','a','t','a'}, lenbytes } }; - - struct - { - RiffChunk chunk; - signed char rifftype[4]; - } WavHeader = { {{'R','I','F','F'}, sizeof(FmtChunk) + sizeof(RiffChunk) + lenbytes }, {'W','A','V','E'} }; - - #if defined(WIN32) || defined(_WIN64) || defined(__WATCOMC__) || defined(_WIN32) || defined(__WIN32__) - #pragma pack() - #endif - - fp = fopen("record.wav", "wb"); - - /* - Write out the WAV header. - */ - fwrite(&WavHeader, sizeof(WavHeader), 1, fp); - fwrite(&FmtChunk, sizeof(FmtChunk), 1, fp); - fwrite(&DataChunk, sizeof(DataChunk), 1, fp); - - /* - Lock the sound to get access to the raw data. - */ - sound->lock(0, lenbytes, &ptr1, &ptr2, &len1, &len2); - - /* - Write it to disk. - */ - fwrite(ptr1, len1, 1, fp); - - /* - Unlock the sound to allow FMOD to use it again. - */ - sound->unlock(ptr1, ptr2, len1, len2); - - fclose(fp); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD::System *system = 0; - FMOD::Sound *sound = 0; - FMOD::Channel *channel = 0; - FMOD_RESULT result; - FMOD_CREATESOUNDEXINFO exinfo; - int key, driver, recorddriver, numdrivers, count; - unsigned int version; - - /* - Create a System object and initialize. - */ - result = FMOD::System_Create(&system); - ERRCHECK(result); - - result = system->getVersion(&version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - /* - System initialization - */ - printf("---------------------------------------------------------\n"); - printf("Select OUTPUT type\n"); - printf("---------------------------------------------------------\n"); - printf("1 : OSS - Open Sound System\n"); - printf("2 : ALSA - Advanced Linux Sound Architecture\n"); - printf("3 : ESD - Enlightenment Sound Daemon\n"); - printf("4 : PULSEAUDIO - Pulse Audio Sound Server\n"); - printf("---------------------------------------------------------\n"); - printf("Press a corresponding number or ESC to quit\n"); - - do - { - key = getch(); - } while (key != 27 && key < '1' && key > '5'); - - switch (key) - { - case '1' : result = system->setOutput(FMOD_OUTPUTTYPE_OSS); - break; - case '2' : result = system->setOutput(FMOD_OUTPUTTYPE_ALSA); - break; - case '3' : result = system->setOutput(FMOD_OUTPUTTYPE_ESD); - break; - case '4' : result = system->setOutput(FMOD_OUTPUTTYPE_PULSEAUDIO); - break; - default : return 1; - } - ERRCHECK(result); - - /* - Enumerate playback devices - */ - - result = system->getNumDrivers(&numdrivers); - ERRCHECK(result); - - printf("---------------------------------------------------------\n"); - printf("Choose a PLAYBACK driver\n"); - printf("---------------------------------------------------------\n"); - for (count=0; count < numdrivers; count++) - { - char name[256]; - - result = system->getDriverInfo(count, name, 256, 0); - ERRCHECK(result); - - printf("%d : %s\n", count + 1, name); - } - printf("---------------------------------------------------------\n"); - printf("Press a corresponding number or ESC to quit\n"); - - do - { - key = getch(); - if (key == 27) - { - return 0; - } - driver = key - '1'; - } while (driver < 0 || driver >= numdrivers); - - result = system->setDriver(driver); - ERRCHECK(result); - - /* - Enumerate record devices - */ - - result = system->getRecordNumDrivers(&numdrivers); - ERRCHECK(result); - - printf("---------------------------------------------------------\n"); - printf("Choose a RECORD driver\n"); - printf("---------------------------------------------------------\n"); - for (count=0; count < numdrivers; count++) - { - char name[256]; - - result = system->getRecordDriverInfo(count, name, 256, 0); - ERRCHECK(result); - - printf("%d : %s\n", count + 1, name); - } - printf("---------------------------------------------------------\n"); - printf("Press a corresponding number or ESC to quit\n"); - - recorddriver = 0; - do - { - key = getch(); - if (key == 27) - { - return 0; - } - recorddriver = key - '1'; - } while (recorddriver < 0 || recorddriver >= numdrivers); - - printf("\n"); - - result = system->init(32, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - memset(&exinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO)); - - exinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO); - exinfo.numchannels = 2; - exinfo.format = FMOD_SOUND_FORMAT_PCM16; - exinfo.defaultfrequency = 44100; - exinfo.length = exinfo.defaultfrequency * sizeof(short) * exinfo.numchannels * 5; - - result = system->createSound(0, FMOD_2D | FMOD_SOFTWARE | FMOD_OPENUSER, &exinfo, &sound); - ERRCHECK(result); - - printf("===================================================================\n"); - printf("Recording example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("===================================================================\n"); - printf("\n"); - printf("Press 'r' to record a 5 second segment of audio and write it to a wav file.\n"); - printf("Press 'p' to play the 5 second segment of audio.\n"); - printf("Press 'l' to turn looping on/off.\n"); - printf("Press 's' to stop recording and playback.\n"); - printf("Press 'w' to save the 5 second segment to a wav file.\n"); - printf("Press 'Esc' to quit\n"); - printf("\n"); - - /* - Main loop. - */ - do - { - static FMOD::Channel *channel = 0; - static bool looping = false; - bool recording = false; - bool playing = false; - unsigned int recordpos = 0; - unsigned int playpos = 0; - unsigned int length; - - if (kbhit()) - { - key = getch(); - - switch (key) - { - case 'r' : - case 'R' : - { - result = system->recordStart(recorddriver, sound, looping); - ERRCHECK(result); - break; - } - case 'p' : - case 'P' : - { - if (looping) - { - sound->setMode(FMOD_LOOP_NORMAL); - } - else - { - sound->setMode(FMOD_LOOP_OFF); - } - ERRCHECK(result); - - result = system->playSound(FMOD_CHANNEL_REUSE, sound, false, &channel); - ERRCHECK(result); - break; - } - case 'l' : - case 'L' : - { - looping = !looping; - break; - } - case 's' : - case 'S' : - { - result = system->recordStop(recorddriver); - if (channel) - { - channel->stop(); - channel = 0; - } - break; - } - case 'w' : - case 'W' : - { - printf("Writing to record.wav ... \r"); - - SaveToWav(sound); - Sleep(500); - break; - } - } - } - - sound->getLength(&length, FMOD_TIMEUNIT_PCM); - ERRCHECK(result); - - system->isRecording(recorddriver, &recording); - ERRCHECK(result); - - system->getRecordPosition(recorddriver, &recordpos); - ERRCHECK(result); - - if (channel) - { - channel->isPlaying(&playing); - ERRCHECK(result); - - channel->getPosition(&playpos, FMOD_TIMEUNIT_PCM); - ERRCHECK(result); - } - - printf("State: %-19s. Record pos = %6d : Play pos = %6d : Loop %-3s\r", recording ? playing ? "Recording / playing" : "Recording" : playing ? "Playing" : "Idle", recordpos, playpos, looping ? "On" : "Off"); - fflush(stdout); - - system->update(); - - fflush(stdout); - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = sound->release(); - ERRCHECK(result); - - result = system->release(); - ERRCHECK(result); - - return 0; -} diff --git a/CocosDenshion/third_party/fmod/examples/recordtodisk/Makefile b/CocosDenshion/third_party/fmod/examples/recordtodisk/Makefile deleted file mode 100644 index 7ae013409c..0000000000 --- a/CocosDenshion/third_party/fmod/examples/recordtodisk/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -recordtodisk_cpp: main.cpp - g++ -O3 -o recordtodisk main.cpp ../../api/lib/libfmodex.so -pthread - -recordtodisk_c: main.c - g++ -O3 -o recordtodisk main.c ../../api/lib/libfmodex.so -pthread - -run: - ./recordtodisk - -clean: - rm -f recordtodisk diff --git a/CocosDenshion/third_party/fmod/examples/recordtodisk/main.c b/CocosDenshion/third_party/fmod/examples/recordtodisk/main.c deleted file mode 100644 index 24671f4010..0000000000 --- a/CocosDenshion/third_party/fmod/examples/recordtodisk/main.c +++ /dev/null @@ -1,326 +0,0 @@ -/*=============================================================================================== - Record to disk example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to do a streaming record to disk. -===============================================================================================*/ -#include "../../api/inc/fmod.h" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - -#if defined(WIN32) || defined(__WATCOMC__) || defined(_WIN32) || defined(__WIN32__) - #define __PACKED /* dummy */ -#else - #define __PACKED __attribute__((packed)) /* gcc packed */ -#endif - - -/* -[ - [DESCRIPTION] - Writes out the contents of a record buffer to a file. - - [PARAMETERS] - - [RETURN_VALUE] - void - - [REMARKS] -] -*/ -void WriteWavHeader(FILE *fp, FMOD_SOUND *sound, int length) -{ - int channels, bits; - float rate; - - if (!sound) - { - return; - } - - fseek(fp, 0, SEEK_SET); - - FMOD_Sound_GetFormat (sound, 0, 0, &channels, &bits); - FMOD_Sound_GetDefaults(sound, &rate, 0, 0, 0); - - { - #if defined(WIN32) || defined(_WIN64) || defined(__WATCOMC__) || defined(_WIN32) || defined(__WIN32__) - #pragma pack(1) - #endif - - /* - WAV Structures - */ - typedef struct - { - signed char id[4]; - int size; - } RiffChunk; - - struct - { - RiffChunk chunk __PACKED; - unsigned short wFormatTag __PACKED; /* format type */ - unsigned short nChannels __PACKED; /* number of channels (i.e. mono, stereo...) */ - unsigned int nSamplesPerSec __PACKED; /* sample rate */ - unsigned int nAvgBytesPerSec __PACKED; /* for buffer estimation */ - unsigned short nBlockAlign __PACKED; /* block size of data */ - unsigned short wBitsPerSample __PACKED; /* number of bits per sample of mono data */ - } __PACKED FmtChunk = { {{'f','m','t',' '}, sizeof(FmtChunk) - sizeof(RiffChunk) }, 1, channels, (int)rate, (int)rate * channels * bits / 8, 1 * channels * bits / 8, bits }; - - struct - { - RiffChunk chunk; - } DataChunk = { {{'d','a','t','a'}, length } }; - - struct - { - RiffChunk chunk; - signed char rifftype[4]; - } WavHeader = { {{'R','I','F','F'}, sizeof(FmtChunk) + sizeof(RiffChunk) + length }, {'W','A','V','E'} }; - - #if defined(WIN32) || defined(_WIN64) || defined(__WATCOMC__) || defined(_WIN32) || defined(__WIN32__) - #pragma pack() - #endif - - /* - Write out the WAV header. - */ - fwrite(&WavHeader, sizeof(WavHeader), 1, fp); - fwrite(&FmtChunk, sizeof(FmtChunk), 1, fp); - fwrite(&DataChunk, sizeof(DataChunk), 1, fp); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD_SYSTEM *system = 0; - FMOD_SOUND *sound = 0; - FMOD_RESULT result; - FMOD_CREATESOUNDEXINFO exinfo; - int key, recorddriver, numdrivers, count; - unsigned int version; - FILE *fp; - unsigned int datalength = 0, soundlength; - - /* - Create a System object and initialize. - */ - result = FMOD_System_Create(&system); - ERRCHECK(result); - - result = FMOD_System_GetVersion(system, &version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - /* - System initialization - */ - printf("---------------------------------------------------------\n"); - printf("Select OUTPUT type\n"); - printf("---------------------------------------------------------\n"); - printf("1 : OSS - Open Sound System\n"); - printf("2 : ALSA - Advanced Linux Sound Architecture\n"); - printf("3 : ESD - Enlightenment Sound Daemon\n"); - printf("4 : PULSEAUDIO - Pulse Audio Sound Server\n"); - printf("---------------------------------------------------------\n"); - printf("Press a corresponding number or ESC to quit\n"); - - do - { - key = getch(); - } while (key != 27 && key < '1' && key > '5'); - - switch (key) - { - case '1' : result = FMOD_System_SetOutput(system, FMOD_OUTPUTTYPE_OSS); - break; - case '2' : result = FMOD_System_SetOutput(system, FMOD_OUTPUTTYPE_ALSA); - break; - case '3' : result = FMOD_System_SetOutput(system, FMOD_OUTPUTTYPE_ESD); - break; - case '4' : result = FMOD_System_SetOutput(system, FMOD_OUTPUTTYPE_PULSEAUDIO); - break; - default : return 1; - } - ERRCHECK(result); - - /* - Enumerate record devices - */ - - result = FMOD_System_GetRecordNumDrivers(system, &numdrivers); - ERRCHECK(result); - - printf("---------------------------------------------------------\n"); - printf("Choose a RECORD driver\n"); - printf("---------------------------------------------------------\n"); - for (count=0; count < numdrivers; count++) - { - char name[256]; - - result = FMOD_System_GetRecordDriverInfo(system, count, name, 256, 0); - ERRCHECK(result); - - printf("%d : %s\n", count + 1, name); - } - printf("---------------------------------------------------------\n"); - printf("Press a corresponding number or ESC to quit\n"); - - recorddriver = 0; - do - { - key = getch(); - if (key == 27) - { - return 0; - } - recorddriver = key - '1'; - } while (recorddriver < 0 || recorddriver >= numdrivers); - - printf("\n"); - - result = FMOD_System_Init(system, 32, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - memset(&exinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO)); - - exinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO); - exinfo.numchannels = 2; - exinfo.format = FMOD_SOUND_FORMAT_PCM16; - exinfo.defaultfrequency = 44100; - exinfo.length = exinfo.defaultfrequency * sizeof(short) * exinfo.numchannels * 2; - - result = FMOD_System_CreateSound(system, 0, FMOD_2D | FMOD_SOFTWARE | FMOD_OPENUSER, &exinfo, &sound); - ERRCHECK(result); - - printf("========================================================================\n"); - printf("Record to disk example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("========================================================================\n"); - printf("\n"); - printf("Press a key to start recording to record.wav\n"); - printf("\n"); - - getch(); - - result = FMOD_System_RecordStart(system, recorddriver, sound, TRUE); - ERRCHECK(result); - - printf("Press 'Esc' to quit\n"); - printf("\n"); - - fp = fopen("record.wav", "wb"); - if (!fp) - { - printf("ERROR : could not open record.wav for writing.\n"); - return 1; - } - - /* - Write out the wav header. As we don't know the length yet it will be 0. - */ - WriteWavHeader(fp, sound, datalength); - - result = FMOD_Sound_GetLength(sound, &soundlength, FMOD_TIMEUNIT_PCM); - ERRCHECK(result); - - /* - Main loop. - */ - do - { - static unsigned int lastrecordpos = 0; - unsigned int recordpos = 0; - - if (kbhit()) - { - key = getch(); - } - - FMOD_System_GetRecordPosition(system, recorddriver, &recordpos); - ERRCHECK(result); - - if (recordpos != lastrecordpos) - { - void *ptr1, *ptr2; - int blocklength; - unsigned int len1, len2; - - blocklength = (int)recordpos - (int)lastrecordpos; - if (blocklength < 0) - { - blocklength += soundlength; - } - - /* - Lock the sound to get access to the raw data. - */ - FMOD_Sound_Lock(sound, lastrecordpos * 4, blocklength * 4, &ptr1, &ptr2, &len1, &len2); /* *4 = stereo 16bit. 1 sample = 4 bytes. */ - - /* - Write it to disk. - */ - if (ptr1 && len1) - { - datalength += fwrite(ptr1, 1, len1, fp); - } - if (ptr2 && len2) - { - datalength += fwrite(ptr2, 1, len2, fp); - } - - /* - Unlock the sound to allow FMOD to use it again. - */ - FMOD_Sound_Unlock(sound, ptr1, ptr2, len1, len2); - } - - lastrecordpos = recordpos; - - printf("Record buffer pos = %6d : Record time = %02d:%02d\r", recordpos, datalength / exinfo.defaultfrequency / 4 / 60, (datalength / exinfo.defaultfrequency / 4) % 60); - fflush(stdout); - - FMOD_System_Update(system); - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Write back the wav header now that we know its length. - */ - WriteWavHeader(fp, sound, datalength); - - fclose(fp); - - /* - Shut down - */ - result = FMOD_Sound_Release(sound); - ERRCHECK(result); - - result = FMOD_System_Release(system); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/examples/recordtodisk/main.cpp b/CocosDenshion/third_party/fmod/examples/recordtodisk/main.cpp deleted file mode 100644 index fd14826c53..0000000000 --- a/CocosDenshion/third_party/fmod/examples/recordtodisk/main.cpp +++ /dev/null @@ -1,326 +0,0 @@ -/*=============================================================================================== - Record to disk example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to do a streaming record to disk. -===============================================================================================*/ -#include "../../api/inc/fmod.hpp" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - -#if defined(WIN32) || defined(__WATCOMC__) || defined(_WIN32) || defined(__WIN32__) - #define __PACKED /* dummy */ -#else - #define __PACKED __attribute__((packed)) /* gcc packed */ -#endif - - -/* -[ - [DESCRIPTION] - Writes out the contents of a record buffer to a file. - - [PARAMETERS] - - [RETURN_VALUE] - void - - [REMARKS] -] -*/ -void WriteWavHeader(FILE *fp, FMOD::Sound *sound, int length) -{ - int channels, bits; - float rate; - - if (!sound) - { - return; - } - - fseek(fp, 0, SEEK_SET); - - sound->getFormat (0, 0, &channels, &bits); - sound->getDefaults(&rate, 0, 0, 0); - - { - #if defined(WIN32) || defined(_WIN64) || defined(__WATCOMC__) || defined(_WIN32) || defined(__WIN32__) - #pragma pack(1) - #endif - - /* - WAV Structures - */ - typedef struct - { - signed char id[4]; - int size; - } RiffChunk; - - struct - { - RiffChunk chunk __PACKED; - unsigned short wFormatTag __PACKED; /* format type */ - unsigned short nChannels __PACKED; /* number of channels (i.e. mono, stereo...) */ - unsigned int nSamplesPerSec __PACKED; /* sample rate */ - unsigned int nAvgBytesPerSec __PACKED; /* for buffer estimation */ - unsigned short nBlockAlign __PACKED; /* block size of data */ - unsigned short wBitsPerSample __PACKED; /* number of bits per sample of mono data */ - } __PACKED FmtChunk = { {{'f','m','t',' '}, sizeof(FmtChunk) - sizeof(RiffChunk) }, 1, channels, (int)rate, (int)rate * channels * bits / 8, 1 * channels * bits / 8, bits }; - - struct - { - RiffChunk chunk; - } DataChunk = { {{'d','a','t','a'}, length } }; - - struct - { - RiffChunk chunk; - signed char rifftype[4]; - } WavHeader = { {{'R','I','F','F'}, sizeof(FmtChunk) + sizeof(RiffChunk) + length }, {'W','A','V','E'} }; - - #if defined(WIN32) || defined(_WIN64) || defined(__WATCOMC__) || defined(_WIN32) || defined(__WIN32__) - #pragma pack() - #endif - - /* - Write out the WAV header. - */ - fwrite(&WavHeader, sizeof(WavHeader), 1, fp); - fwrite(&FmtChunk, sizeof(FmtChunk), 1, fp); - fwrite(&DataChunk, sizeof(DataChunk), 1, fp); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD::System *system = 0; - FMOD::Sound *sound = 0; - FMOD_RESULT result; - FMOD_CREATESOUNDEXINFO exinfo; - int key, recorddriver, numdrivers, count; - unsigned int version; - FILE *fp; - unsigned int datalength = 0, soundlength; - - /* - Create a System object and initialize. - */ - result = FMOD::System_Create(&system); - ERRCHECK(result); - - result = system->getVersion(&version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - /* - System initialization - */ - printf("---------------------------------------------------------\n"); - printf("Select OUTPUT type\n"); - printf("---------------------------------------------------------\n"); - printf("1 : OSS - Open Sound System\n"); - printf("2 : ALSA - Advanced Linux Sound Architecture\n"); - printf("3 : ESD - Enlightenment Sound Daemon\n"); - printf("4 : PULSEAUDIO - Pulse Audio Sound Server\n"); - printf("---------------------------------------------------------\n"); - printf("Press a corresponding number or ESC to quit\n"); - - do - { - key = getch(); - } while (key != 27 && key < '1' && key > '5'); - - switch (key) - { - case '1' : result = system->setOutput(FMOD_OUTPUTTYPE_OSS); - break; - case '2' : result = system->setOutput(FMOD_OUTPUTTYPE_ALSA); - break; - case '3' : result = system->setOutput(FMOD_OUTPUTTYPE_ESD); - break; - case '4' : result = system->setOutput(FMOD_OUTPUTTYPE_PULSEAUDIO); - break; - default : return 1; - } - ERRCHECK(result); - - /* - Enumerate record devices - */ - - result = system->getRecordNumDrivers(&numdrivers); - ERRCHECK(result); - - printf("---------------------------------------------------------\n"); - printf("Choose a RECORD driver\n"); - printf("---------------------------------------------------------\n"); - for (count=0; count < numdrivers; count++) - { - char name[256]; - - result = system->getRecordDriverInfo(count, name, 256, 0); - ERRCHECK(result); - - printf("%d : %s\n", count + 1, name); - } - printf("---------------------------------------------------------\n"); - printf("Press a corresponding number or ESC to quit\n"); - - recorddriver = 0; - do - { - key = getch(); - if (key == 27) - { - return 0; - } - recorddriver = key - '1'; - } while (recorddriver < 0 || recorddriver >= numdrivers); - - printf("\n"); - - result = system->init(32, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - memset(&exinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO)); - - exinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO); - exinfo.numchannels = 2; - exinfo.format = FMOD_SOUND_FORMAT_PCM16; - exinfo.defaultfrequency = 44100; - exinfo.length = exinfo.defaultfrequency * sizeof(short) * exinfo.numchannels * 2; - - result = system->createSound(0, FMOD_2D | FMOD_SOFTWARE | FMOD_OPENUSER, &exinfo, &sound); - ERRCHECK(result); - - printf("========================================================================\n"); - printf("Record to disk example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("========================================================================\n"); - printf("\n"); - printf("Press a key to start recording to record.wav\n"); - printf("\n"); - - getch(); - - result = system->recordStart(recorddriver, sound, true); - ERRCHECK(result); - - printf("Press 'Esc' to quit\n"); - printf("\n"); - - fp = fopen("record.wav", "wb"); - if (!fp) - { - printf("ERROR : could not open record.wav for writing.\n"); - return 1; - } - - /* - Write out the wav header. As we don't know the length yet it will be 0. - */ - WriteWavHeader(fp, sound, datalength); - - result = sound->getLength(&soundlength, FMOD_TIMEUNIT_PCM); - ERRCHECK(result); - - /* - Main loop. - */ - do - { - static unsigned int lastrecordpos = 0; - unsigned int recordpos = 0; - - if (kbhit()) - { - key = getch(); - } - - system->getRecordPosition(recorddriver, &recordpos); - ERRCHECK(result); - - if (recordpos != lastrecordpos) - { - void *ptr1, *ptr2; - int blocklength; - unsigned int len1, len2; - - blocklength = (int)recordpos - (int)lastrecordpos; - if (blocklength < 0) - { - blocklength += soundlength; - } - - /* - Lock the sound to get access to the raw data. - */ - sound->lock(lastrecordpos * 4, blocklength * 4, &ptr1, &ptr2, &len1, &len2); /* *4 = stereo 16bit. 1 sample = 4 bytes. */ - - /* - Write it to disk. - */ - if (ptr1 && len1) - { - datalength += fwrite(ptr1, 1, len1, fp); - } - if (ptr2 && len2) - { - datalength += fwrite(ptr2, 1, len2, fp); - } - - /* - Unlock the sound to allow FMOD to use it again. - */ - sound->unlock(ptr1, ptr2, len1, len2); - } - - lastrecordpos = recordpos; - - printf("Record buffer pos = %6d : Record time = %02d:%02d\r", recordpos, datalength / exinfo.defaultfrequency / 4 / 60, (datalength / exinfo.defaultfrequency / 4) % 60); - fflush(stdout); - - system->update(); - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Write back the wav header now that we know its length. - */ - WriteWavHeader(fp, sound, datalength); - - fclose(fp); - - /* - Shut down - */ - result = sound->release(); - ERRCHECK(result); - - result = system->release(); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/examples/ripnetstream/Makefile b/CocosDenshion/third_party/fmod/examples/ripnetstream/Makefile deleted file mode 100644 index 996f54da2b..0000000000 --- a/CocosDenshion/third_party/fmod/examples/ripnetstream/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -ripnetstream_cpp: main.cpp - g++ -O3 -o ripnetstream main.cpp ../../api/lib/libfmodex.so - -ripnetstream_c: main.c - g++ -O3 -o ripnetstream main.c ../../api/lib/libfmodex.so - -run: - ./ripnetstream - -clean: - rm -f ripnetstream diff --git a/CocosDenshion/third_party/fmod/examples/ripnetstream/main.c b/CocosDenshion/third_party/fmod/examples/ripnetstream/main.c deleted file mode 100644 index 0f64c87052..0000000000 --- a/CocosDenshion/third_party/fmod/examples/ripnetstream/main.c +++ /dev/null @@ -1,332 +0,0 @@ -/*=============================================================================================== - RipNetStream Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to rip streaming audio from the internet to local files, using - System::attachFileSystem. - - This example also uses tags from the net stream to name the files as they are ripped. - - Some internet radio station only broadcast new tag information on fixed intervals. This - means that the rip might not be exactly in line with the filenames that are produced. - For example if a radio station only broadcast the track name every 10 seconds, and the - music changed half way inbetween this period, then the first file would contain 5 seconds - of the new song, and the second song would be missing the first 5 seconds of the track. - Silence detection might help this problem, but most radio stations do not offer silence - between tracks. -===============================================================================================*/ -#include "../../api/inc/fmod.h" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include -#include - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - -FMOD_SOUND_TYPE gSoundType = FMOD_SOUND_TYPE_MPEG; -int gFileBufferSize = 128*1024; -char gCurrentTrackArtist[256]; -char gCurrentTrackTitle[256]; -int gUpdateFileName = FALSE; -char gOutputFileName[1024]; -FILE *gFileHandle = 0; - - -/* - File callbacks -*/ -FMOD_RESULT F_CALLBACK myopen(const char *name, int unicode, unsigned int *filesize, void **handle, void **userdata) -{ - gFileHandle = fopen(gOutputFileName, "wb"); - if (!gFileHandle) - { - return FMOD_ERR_FILE_NOTFOUND; - } - - return FMOD_OK; -} - -FMOD_RESULT F_CALLBACK myclose(void *handle, void *userdata) -{ - if (!gFileHandle) - { - return FMOD_ERR_INVALID_PARAM; - } - - fclose(gFileHandle); - - return FMOD_OK; -} - -FMOD_RESULT F_CALLBACK myread(void *handle, void *buffer, unsigned int sizebytes, unsigned int *bytesread, void *userdata) -{ - if (!gFileHandle) - { - return FMOD_ERR_INVALID_PARAM; - } - - /* - If the main thread detected a new tag name for artist / title, close the file and open a new one with the new name. - */ - if (gUpdateFileName) - { - char *ext; - - gUpdateFileName = FALSE; - - fclose(gFileHandle); - - switch (gSoundType) - { - case FMOD_SOUND_TYPE_MPEG: /* MP2/MP3 */ - { - ext = ".mp3"; - break; - } - case FMOD_SOUND_TYPE_OGGVORBIS: /* Ogg vorbis */ - { - ext = ".ogg"; - break; - } - default: - { - ext = ".unknown"; - break; - } - } - - /* - If it is the 'temp file name' then rename the file and append to it instead of starting a new file - */ - if (!strcmp(gOutputFileName, "output.mp3")) - { - sprintf(gOutputFileName, "%s%s%s%s", gCurrentTrackArtist, strlen(gCurrentTrackTitle) ? " - " : "", gCurrentTrackTitle, ext); - rename("output.mp3", gOutputFileName); - gFileHandle = fopen(gOutputFileName, "ab+"); - } - else - { - sprintf(gOutputFileName, "%s%s%s%s", gCurrentTrackArtist, strlen(gCurrentTrackTitle) ? " - " : "", gCurrentTrackTitle, ext); - gFileHandle = fopen(gOutputFileName, "wb"); - } - - if (!gFileHandle) - { - return FMOD_ERR_FILE_NOTFOUND; - } - } - - fwrite(buffer, 1, sizebytes, gFileHandle); - - return FMOD_OK; -} - - -int main(int argc, char *argv[]) -{ - FMOD_SYSTEM *system; - FMOD_SOUND *sound; - FMOD_CHANNEL *channel = 0; - FMOD_RESULT result; - int key; - unsigned int version; - - memset(gCurrentTrackArtist, 0, 256); - memset(gCurrentTrackTitle, 0, 256); - strcpy(gOutputFileName, "output.mp3"); /* Start off like this then rename if a title tag comes along */ - - printf("======================================================================\n"); - printf("RipNetStream Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("======================================================================\n\n"); - - if (argc < 2) - { - printf("Usage: ripnetstream \n"); - return -1; - } - - /* - Create a System object and initialize. - */ - result = FMOD_System_Create(&system); - ERRCHECK(result); - - result = FMOD_System_GetVersion(system, &version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - result = FMOD_System_Init(system, 100, FMOD_INIT_NORMAL, NULL); - ERRCHECK(result); - - result = FMOD_System_SetStreamBufferSize(system, gFileBufferSize, FMOD_TIMEUNIT_RAWBYTES); - ERRCHECK(result); - - result = FMOD_System_AttachFileSystem(system, myopen, myclose, myread, 0); - ERRCHECK(result); - - printf("Buffering...\n\n"); - - result = FMOD_System_CreateSound(system, argv[1], FMOD_HARDWARE | FMOD_2D | FMOD_CREATESTREAM | FMOD_NONBLOCKING, 0, &sound); - ERRCHECK(result); - - /* - Main loop - */ - do - { - if (sound && !channel) - { - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound, FALSE, &channel); - } - - if (kbhit()) - { - key = getch(); - - switch (key) - { - case ' ' : - { - if (channel) - { - int paused; - FMOD_Channel_GetPaused(channel, &paused); - FMOD_Channel_SetPaused(channel, !paused); - } - break; - } - case 'm' : - case 'M' : - { - if (channel) - { - int mute; - FMOD_Channel_GetMute(channel, &mute); - FMOD_Channel_SetMute(channel, !mute); - } - break; - } - } - } - - FMOD_System_Update(system); - - if (channel) - { - unsigned int ms = 0; - int playing = FALSE; - int paused = FALSE; - int tagsupdated = 0; - - FMOD_Sound_GetNumTags(sound, 0, &tagsupdated); - - if (tagsupdated) - { - printf("\n"); - printf("\n"); - for (;;) - { - FMOD_TAG tag; - - if (FMOD_Sound_GetTag(sound, 0, -1, &tag) != FMOD_OK) - { - break; - } - - if (tag.datatype == FMOD_TAGDATATYPE_STRING) - { - printf("[%-11s] %s (%d bytes)\n", tag.name, tag.data, tag.datalen); - - FMOD_Sound_GetFormat(sound, &gSoundType, 0, 0, 0); - - if (!strcmp(tag.name, "ARTIST")) - { - if(strncmp(gCurrentTrackArtist, (const char *)tag.data, 256)) - { - strncpy(gCurrentTrackArtist, (const char *)tag.data, 256); - gUpdateFileName = TRUE; - } - } - if (!strcmp(tag.name, "TITLE")) - { - if (strncmp(gCurrentTrackTitle, (const char *)tag.data, 256)) - { - strncpy(gCurrentTrackTitle, (const char *)tag.data, 256); - gUpdateFileName = TRUE; - } - } - } - } - printf("\n"); - } - - result = FMOD_Channel_IsPlaying(channel, &playing); - if (result != FMOD_OK || !playing) - { - FMOD_Sound_Release(sound); - sound = 0; - channel = 0; - } - else - { - result = FMOD_Channel_GetPaused(channel, &paused); - result = FMOD_Channel_GetPosition(channel, &ms, FMOD_TIMEUNIT_MS); - printf("Time %02d:%02d:%02d : %s : Press SPACE to pause. 'm' to mute. ESC to quit.\r", ms / 1000 / 60, ms / 1000 % 60, ms / 10 % 100, paused ? "Paused " : playing ? "Playing" : "Stopped"); - fflush(stdout); - } - } - - - if (sound) - { - FMOD_OPENSTATE openstate = FMOD_OPENSTATE_READY; - - FMOD_Sound_GetOpenState(sound, &openstate, 0, 0, 0); - - if (openstate == FMOD_OPENSTATE_ERROR) - { - FMOD_Sound_Release(sound); - sound = 0; - channel = 0; - } - } - - if (!sound) - { - printf("\n"); - printf("Error occurred or stream ended. Restarting stream..\n"); - result = FMOD_System_CreateSound(system, argv[1], FMOD_HARDWARE | FMOD_2D | FMOD_CREATESTREAM | FMOD_NONBLOCKING, 0, &sound); - ERRCHECK(result); - Sleep(1000); - } - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = FMOD_Sound_Release(sound); - ERRCHECK(result); - result = FMOD_System_Close(system); - ERRCHECK(result); - result = FMOD_System_Release(system); - ERRCHECK(result); - - return 0; -} diff --git a/CocosDenshion/third_party/fmod/examples/ripnetstream/main.cpp b/CocosDenshion/third_party/fmod/examples/ripnetstream/main.cpp deleted file mode 100644 index 64b3933ff6..0000000000 --- a/CocosDenshion/third_party/fmod/examples/ripnetstream/main.cpp +++ /dev/null @@ -1,332 +0,0 @@ -/*=============================================================================================== - RipNetStream Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to rip streaming audio from the internet to local files, using - System::attachFileSystem. - - This example also uses tags from the net stream to name the files as they are ripped. - - Some internet radio station only broadcast new tag information on fixed intervals. This - means that the rip might not be exactly in line with the filenames that are produced. - For example if a radio station only broadcast the track name every 10 seconds, and the - music changed half way inbetween this period, then the first file would contain 5 seconds - of the new song, and the second song would be missing the first 5 seconds of the track. - Silence detection might help this problem, but most radio stations do not offer silence - between tracks. -===============================================================================================*/ -#include "../../api/inc/fmod.hpp" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include -#include - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - -FMOD_SOUND_TYPE gSoundType = FMOD_SOUND_TYPE_MPEG; -int gFileBufferSize = 128*1024; -char gCurrentTrackArtist[256]; -char gCurrentTrackTitle[256]; -bool gUpdateFileName = false; -char gOutputFileName[1024]; -FILE *gFileHandle = 0; - - -/* - File callbacks -*/ -FMOD_RESULT F_CALLBACK myopen(const char *name, int unicode, unsigned int *filesize, void **handle, void **userdata) -{ - gFileHandle = fopen(gOutputFileName, "wb"); - if (!gFileHandle) - { - return FMOD_ERR_FILE_NOTFOUND; - } - - return FMOD_OK; -} - -FMOD_RESULT F_CALLBACK myclose(void *handle, void *userdata) -{ - if (!gFileHandle) - { - return FMOD_ERR_INVALID_PARAM; - } - - fclose(gFileHandle); - - return FMOD_OK; -} - -FMOD_RESULT F_CALLBACK myread(void *handle, void *buffer, unsigned int sizebytes, unsigned int *bytesread, void *userdata) -{ - if (!gFileHandle) - { - return FMOD_ERR_INVALID_PARAM; - } - - /* - If the main thread detected a new tag name for artist / title, close the file and open a new one with the new name. - */ - if (gUpdateFileName) - { - char *ext; - - gUpdateFileName = false; - - fclose(gFileHandle); - - switch (gSoundType) - { - case FMOD_SOUND_TYPE_MPEG: /* MP2/MP3 */ - { - ext = ".mp3"; - break; - } - case FMOD_SOUND_TYPE_OGGVORBIS: /* Ogg vorbis */ - { - ext = ".ogg"; - break; - } - default: - { - ext = ".unknown"; - break; - } - } - - /* - If it is the 'temp file name' then rename the file and append to it instead of starting a new file - */ - if (!strcmp(gOutputFileName, "output.mp3")) - { - sprintf(gOutputFileName, "%s%s%s%s", gCurrentTrackArtist, strlen(gCurrentTrackTitle) ? " - " : "", gCurrentTrackTitle, ext); - rename("output.mp3", gOutputFileName); - gFileHandle = fopen(gOutputFileName, "ab+"); - } - else - { - sprintf(gOutputFileName, "%s%s%s%s", gCurrentTrackArtist, strlen(gCurrentTrackTitle) ? " - " : "", gCurrentTrackTitle, ext); - gFileHandle = fopen(gOutputFileName, "wb"); - } - - if (!gFileHandle) - { - return FMOD_ERR_FILE_NOTFOUND; - } - } - - fwrite(buffer, 1, sizebytes, gFileHandle); - - return FMOD_OK; -} - - -int main(int argc, char *argv[]) -{ - FMOD::System *system; - FMOD::Sound *sound; - FMOD::Channel *channel = 0; - FMOD_RESULT result; - int key; - unsigned int version; - - memset(gCurrentTrackArtist, 0, 256); - memset(gCurrentTrackTitle, 0, 256); - strcpy(gOutputFileName, "output.mp3"); /* Start off like this then rename if a title tag comes along */ - - printf("======================================================================\n"); - printf("RipNetStream Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("======================================================================\n\n"); - - if (argc < 2) - { - printf("Usage: ripnetstream \n"); - return -1; - } - - /* - Create a System object and initialize. - */ - result = FMOD::System_Create(&system); - ERRCHECK(result); - - result = system->getVersion(&version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - result = system->init(100, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - result = system->setStreamBufferSize(gFileBufferSize, FMOD_TIMEUNIT_RAWBYTES); - ERRCHECK(result); - - result = system->attachFileSystem(myopen, myclose, myread, 0); - ERRCHECK(result); - - printf("Buffering...\n\n"); - - result = system->createSound(argv[1], FMOD_HARDWARE | FMOD_2D | FMOD_CREATESTREAM | FMOD_NONBLOCKING, 0, &sound); - ERRCHECK(result); - - /* - Main loop - */ - do - { - if (sound && !channel) - { - result = system->playSound(FMOD_CHANNEL_FREE, sound, false, &channel); - } - - if (kbhit()) - { - key = getch(); - - switch (key) - { - case ' ' : - { - if (channel) - { - bool paused; - channel->getPaused(&paused); - channel->setPaused(!paused); - } - break; - } - case 'm' : - case 'M' : - { - if (channel) - { - bool mute; - channel->getMute(&mute); - channel->setMute(!mute); - } - break; - } - } - } - - system->update(); - - if (channel) - { - unsigned int ms = 0; - bool playing = false; - bool paused = false; - int tagsupdated = 0; - - sound->getNumTags(0, &tagsupdated); - - if (tagsupdated) - { - printf("\n"); - printf("\n"); - for (;;) - { - FMOD_TAG tag; - - if (sound->getTag(0, -1, &tag) != FMOD_OK) - { - break; - } - - if (tag.datatype == FMOD_TAGDATATYPE_STRING) - { - printf("[%-11s] %s (%d bytes)\n", tag.name, tag.data, tag.datalen); - - sound->getFormat(&gSoundType, 0, 0, 0); - - if (!strcmp(tag.name, "ARTIST")) - { - if (strncmp(gCurrentTrackArtist, (const char *)tag.data, 256)) - { - strncpy(gCurrentTrackArtist, (const char *)tag.data, 256); - gUpdateFileName = true; - } - } - if (!strcmp(tag.name, "TITLE")) - { - if (strncmp(gCurrentTrackTitle, (const char *)tag.data, 256)) - { - strncpy(gCurrentTrackTitle, (const char *)tag.data, 256); - gUpdateFileName = true; - } - } - } - } - printf("\n"); - } - - result = channel->isPlaying(&playing); - if (result != FMOD_OK || !playing) - { - sound->release(); - sound = 0; - channel = 0; - } - else - { - result = channel->getPaused(&paused); - result = channel->getPosition(&ms, FMOD_TIMEUNIT_MS); - printf("Time %02d:%02d:%02d : %s : Press SPACE to pause. 'm' to mute. ESC to quit.\r", ms / 1000 / 60, ms / 1000 % 60, ms / 10 % 100, paused ? "Paused " : playing ? "Playing" : "Stopped"); - } - fflush(stdout); - } - - - if (sound) - { - FMOD_OPENSTATE openstate = FMOD_OPENSTATE_READY; - - sound->getOpenState(&openstate, 0, 0, 0); - - if (openstate == FMOD_OPENSTATE_ERROR) - { - sound->release(); - sound = 0; - channel = 0; - } - } - - if (!sound) - { - printf("\n"); - printf("Error occurred or stream ended. Restarting stream..\n"); - result = system->createSound(argv[1], FMOD_HARDWARE | FMOD_2D | FMOD_CREATESTREAM | FMOD_NONBLOCKING, 0, &sound); - ERRCHECK(result); - Sleep(1000); - } - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = sound->release(); - ERRCHECK(result); - result = system->close(); - ERRCHECK(result); - result = system->release(); - ERRCHECK(result); - - return 0; -} diff --git a/CocosDenshion/third_party/fmod/examples/submixing/Makefile b/CocosDenshion/third_party/fmod/examples/submixing/Makefile deleted file mode 100644 index 62b648c89e..0000000000 --- a/CocosDenshion/third_party/fmod/examples/submixing/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -submixing_cpp: main.cpp - g++ -O3 -o submixing main.cpp ../../api/lib/libfmodex.so -pthread - -submixing_c: main.c - g++ -O3 -o submixing main.c ../../api/lib/libfmodex.so -pthread - -run: - ./submixing - -clean: - rm -f submixing diff --git a/CocosDenshion/third_party/fmod/examples/submixing/main.c b/CocosDenshion/third_party/fmod/examples/submixing/main.c deleted file mode 100644 index 163faeefca..0000000000 --- a/CocosDenshion/third_party/fmod/examples/submixing/main.c +++ /dev/null @@ -1,269 +0,0 @@ -/*=============================================================================================== - Submixing Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to put channels into channel groups, so that you can affect a group - of channels at a time instead of just one channel at a time. -===============================================================================================*/ -#include "../../api/inc/fmod.h" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD_SYSTEM *system; - FMOD_SOUND *sound[5]; - FMOD_CHANNEL *channel[5]; - FMOD_CHANNELGROUP *groupA, *groupB, *masterGroup; - FMOD_DSP *dspreverb, *dspflange, *dsplowpass; - FMOD_RESULT result; - int key, count; - unsigned int version; - - /* - Create a System object and initialize. - */ - result = FMOD_System_Create(&system); - ERRCHECK(result); - - result = FMOD_System_GetVersion(system, &version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - result = FMOD_System_Init(system, 32, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - result = FMOD_System_CreateSound(system, "../media/drumloop.wav", FMOD_SOFTWARE | FMOD_LOOP_NORMAL, 0, &sound[0]); - ERRCHECK(result); - result = FMOD_System_CreateSound(system, "../media/jaguar.wav", FMOD_SOFTWARE | FMOD_LOOP_NORMAL, 0, &sound[1]); - ERRCHECK(result); - result = FMOD_System_CreateSound(system, "../media/c.ogg", FMOD_SOFTWARE | FMOD_LOOP_NORMAL, 0, &sound[2]); - ERRCHECK(result); - result = FMOD_System_CreateSound(system, "../media/d.ogg", FMOD_SOFTWARE | FMOD_LOOP_NORMAL, 0, &sound[3]); - ERRCHECK(result); - result = FMOD_System_CreateSound(system, "../media/e.ogg", FMOD_SOFTWARE | FMOD_LOOP_NORMAL, 0, &sound[4]); - ERRCHECK(result); - - result = FMOD_System_CreateChannelGroup(system, "Group A", &groupA); - ERRCHECK(result); - - result = FMOD_System_CreateChannelGroup(system, "Group B", &groupB); - ERRCHECK(result); - - result = FMOD_System_GetMasterChannelGroup(system, &masterGroup); - ERRCHECK(result); - - result = FMOD_ChannelGroup_AddGroup(masterGroup, groupA); - ERRCHECK(result); - - result = FMOD_ChannelGroup_AddGroup(masterGroup, groupB); - ERRCHECK(result); - - printf("======================================================================\n"); - printf("Sub-mixing example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("======================================================================\n"); - printf(" (drumloop.wav) \n"); - printf(" / \n"); - printf(" (groupA) \n"); - printf(" (reverb)/ \\ \n"); - printf(" / (jaguar.wav) \n"); - printf("(soundcard)--(lowpass)--(mastergroup) \n"); - printf(" \\ (c.ogg) \n"); - printf(" (flange) / \n"); - printf(" \\(groupB)--(d.ogg) \n"); - printf(" \\ \n"); - printf(" (e.ogg) \n"); - printf("Press 'A' to mute/unmute group A\n"); - printf("Press 'B' to mute/unmute group B\n"); - printf("\n"); - printf("Press 'R' to place reverb on group A\n"); - printf("Press 'F' to place flange on group B\n"); - printf("Press 'L' to place lowpass on master group (everything)\n"); - printf("Press 'Esc' to quit\n"); - printf("\n"); - - /* - Start all the sounds! - */ - for (count = 0; count < 5; count++) - { - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound[count], TRUE, &channel[count]); - ERRCHECK(result); - if (count < 2) - { - result = FMOD_Channel_SetChannelGroup(channel[count], groupA); - } - else - { - result = FMOD_Channel_SetChannelGroup(channel[count], groupB); - } - ERRCHECK(result); - result = FMOD_Channel_SetPaused(channel[count], FALSE); - ERRCHECK(result); - } - - /* - Create the DSP effects we want to apply to our submixes. - */ - result = FMOD_System_CreateDSPByType(system, FMOD_DSP_TYPE_SFXREVERB, &dspreverb); - ERRCHECK(result); - - result = FMOD_System_CreateDSPByType(system, FMOD_DSP_TYPE_FLANGE, &dspflange); - ERRCHECK(result); - result = FMOD_DSP_SetParameter(dspflange, FMOD_DSP_FLANGE_RATE, 1.0f); - ERRCHECK(result); - - result = FMOD_System_CreateDSPByType(system, FMOD_DSP_TYPE_LOWPASS, &dsplowpass); - ERRCHECK(result); - result = FMOD_DSP_SetParameter(dsplowpass, FMOD_DSP_LOWPASS_CUTOFF, 500.0f); - ERRCHECK(result); - - /* - Main loop. - */ - do - { - if (kbhit()) - { - key = getch(); - - switch (key) - { - case 'a' : - case 'A' : - { - static int mute = TRUE; - - FMOD_ChannelGroup_SetMute(groupA, mute); - - mute = !mute; - break; - } - case 'b' : - case 'B' : - { - static int mute = TRUE; - - FMOD_ChannelGroup_SetMute(groupB, mute); - - mute = !mute; - break; - } - case 'r' : - case 'R' : - { - static int reverb = TRUE; - - if (reverb) - { - FMOD_ChannelGroup_AddDSP(groupA, dspreverb, 0); - } - else - { - FMOD_DSP_Remove(dspreverb); - } - - reverb = !reverb; - break; - } - case 'f' : - case 'F' : - { - static int flange = TRUE; - - if (flange) - { - FMOD_ChannelGroup_AddDSP(groupB, dspflange, 0); - } - else - { - FMOD_DSP_Remove(dspflange); - } - - flange = !flange; - break; - } - case 'l' : - case 'L' : - { - static int lowpass = TRUE; - - if (lowpass) - { - FMOD_ChannelGroup_AddDSP(masterGroup, dsplowpass, 0); - } - else - { - FMOD_DSP_Remove(dsplowpass); - } - - lowpass = !lowpass; - break; - } - } - } - - FMOD_System_Update(system); - - { - int channelsplaying = 0; - - FMOD_System_GetChannelsPlaying(system, &channelsplaying); - - printf("Channels Playing %2d\r", channelsplaying); - fflush(stdout); - } - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - for (count = 0; count < 5; count++) - { - result = FMOD_Sound_Release(sound[count]); - ERRCHECK(result); - } - - result = FMOD_DSP_Release(dspreverb); - ERRCHECK(result); - result = FMOD_DSP_Release(dspflange); - ERRCHECK(result); - result = FMOD_DSP_Release(dsplowpass); - ERRCHECK(result); - - result = FMOD_ChannelGroup_Release(groupA); - ERRCHECK(result); - result = FMOD_ChannelGroup_Release(groupB); - ERRCHECK(result); - - result = FMOD_System_Close(system); - ERRCHECK(result); - result = FMOD_System_Release(system); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/examples/submixing/main.cpp b/CocosDenshion/third_party/fmod/examples/submixing/main.cpp deleted file mode 100644 index 5d822fddc6..0000000000 --- a/CocosDenshion/third_party/fmod/examples/submixing/main.cpp +++ /dev/null @@ -1,269 +0,0 @@ -/*=============================================================================================== - Submixing Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to put channels into channel groups, so that you can affect a group - of channels at a time instead of just one channel at a time. -===============================================================================================*/ -#include "../../api/inc/fmod.hpp" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD::System *system; - FMOD::Sound *sound[5]; - FMOD::Channel *channel[5]; - FMOD::ChannelGroup *groupA, *groupB, *masterGroup; - FMOD::DSP *dspreverb, *dspflange, *dsplowpass; - FMOD_RESULT result; - int key, count; - unsigned int version; - - /* - Create a System object and initialize. - */ - result = FMOD::System_Create(&system); - ERRCHECK(result); - - result = system->getVersion(&version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - result = system->init(32, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - result = system->createSound("../media/drumloop.wav", FMOD_SOFTWARE | FMOD_LOOP_NORMAL, 0, &sound[0]); - ERRCHECK(result); - result = system->createSound("../media/jaguar.wav", FMOD_SOFTWARE | FMOD_LOOP_NORMAL, 0, &sound[1]); - ERRCHECK(result); - result = system->createSound("../media/c.ogg", FMOD_SOFTWARE | FMOD_LOOP_NORMAL, 0, &sound[2]); - ERRCHECK(result); - result = system->createSound("../media/d.ogg", FMOD_SOFTWARE | FMOD_LOOP_NORMAL, 0, &sound[3]); - ERRCHECK(result); - result = system->createSound("../media/e.ogg", FMOD_SOFTWARE | FMOD_LOOP_NORMAL, 0, &sound[4]); - ERRCHECK(result); - - result = system->createChannelGroup("Group A", &groupA); - ERRCHECK(result); - - result = system->createChannelGroup("Group B", &groupB); - ERRCHECK(result); - - result = system->getMasterChannelGroup(&masterGroup); - ERRCHECK(result); - - result = masterGroup->addGroup(groupA); - ERRCHECK(result); - - result = masterGroup->addGroup(groupB); - ERRCHECK(result); - - printf("======================================================================\n"); - printf("Sub-mixing example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("======================================================================\n"); - printf(" (drumloop.wav) \n"); - printf(" / \n"); - printf(" (groupA) \n"); - printf(" (reverb)/ \\ \n"); - printf(" / (jaguar.wav) \n"); - printf("(soundcard)--(lowpass)--(mastergroup) \n"); - printf(" \\ (c.ogg) \n"); - printf(" (flange) / \n"); - printf(" \\(groupB)--(d.ogg) \n"); - printf(" \\ \n"); - printf(" (e.ogg) \n"); - printf("Press 'A' to mute/unmute group A\n"); - printf("Press 'B' to mute/unmute group B\n"); - printf("\n"); - printf("Press 'R' to place reverb on group A\n"); - printf("Press 'F' to place flange on group B\n"); - printf("Press 'L' to place lowpass on master group (everything)\n"); - printf("Press 'Esc' to quit\n"); - printf("\n"); - - /* - Start all the sounds! - */ - for (count = 0; count < 5; count++) - { - result = system->playSound(FMOD_CHANNEL_FREE, sound[count], true, &channel[count]); - ERRCHECK(result); - if (count < 2) - { - result = channel[count]->setChannelGroup(groupA); - } - else - { - result = channel[count]->setChannelGroup(groupB); - } - ERRCHECK(result); - result = channel[count]->setPaused(false); - ERRCHECK(result); - } - - /* - Create the DSP effects we want to apply to our submixes. - */ - result = system->createDSPByType(FMOD_DSP_TYPE_SFXREVERB, &dspreverb); - ERRCHECK(result); - - result = system->createDSPByType(FMOD_DSP_TYPE_FLANGE, &dspflange); - ERRCHECK(result); - result = dspflange->setParameter(FMOD_DSP_FLANGE_RATE, 1.0f); - ERRCHECK(result); - - result = system->createDSPByType(FMOD_DSP_TYPE_LOWPASS, &dsplowpass); - ERRCHECK(result); - result = dsplowpass->setParameter(FMOD_DSP_LOWPASS_CUTOFF, 500.0f); - ERRCHECK(result); - - /* - Main loop. - */ - do - { - if (kbhit()) - { - key = getch(); - - switch (key) - { - case 'a' : - case 'A' : - { - static bool mute = true; - - groupA->setMute(mute); - - mute = !mute; - break; - } - case 'b' : - case 'B' : - { - static bool mute = true; - - groupB->setMute(mute); - - mute = !mute; - break; - } - case 'r' : - case 'R' : - { - static bool reverb = true; - - if (reverb) - { - groupA->addDSP(dspreverb, 0); - } - else - { - dspreverb->remove(); - } - - reverb = !reverb; - break; - } - case 'f' : - case 'F' : - { - static bool flange = true; - - if (flange) - { - groupB->addDSP(dspflange, 0); - } - else - { - dspflange->remove(); - } - - flange = !flange; - break; - } - case 'l' : - case 'L' : - { - static bool lowpass = true; - - if (lowpass) - { - masterGroup->addDSP(dsplowpass, 0); - } - else - { - dsplowpass->remove(); - } - - lowpass = !lowpass; - break; - } - } - } - - system->update(); - - { - int channelsplaying = 0; - - system->getChannelsPlaying(&channelsplaying); - - printf("Channels Playing %2d\r", channelsplaying); - fflush(stdout); - } - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - for (count = 0; count < 5; count++) - { - result = sound[count]->release(); - ERRCHECK(result); - } - - result = dspreverb->release(); - ERRCHECK(result); - result = dspflange->release(); - ERRCHECK(result); - result = dsplowpass->release(); - ERRCHECK(result); - - result = groupA->release(); - ERRCHECK(result); - result = groupB->release(); - ERRCHECK(result); - - result = system->close(); - ERRCHECK(result); - result = system->release(); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/examples/useplugins/Makefile b/CocosDenshion/third_party/fmod/examples/useplugins/Makefile deleted file mode 100644 index a943087296..0000000000 --- a/CocosDenshion/third_party/fmod/examples/useplugins/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -useplugins_cpp: main.cpp - g++ -O3 -o useplugins main.cpp ../../api/lib/libfmodex.so -pthread - -useplugins_c: main.c - g++ -O3 -o useplugins main.c ../../api/lib/libfmodex.so -pthread - -run: - ./useplugins - -clean: - rm -f useplugins diff --git a/CocosDenshion/third_party/fmod/examples/useplugins/main.c b/CocosDenshion/third_party/fmod/examples/useplugins/main.c deleted file mode 100644 index d15c6ba7cb..0000000000 --- a/CocosDenshion/third_party/fmod/examples/useplugins/main.c +++ /dev/null @@ -1,249 +0,0 @@ -/*=============================================================================================== - Use Plugins Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to use FMODEXP.DLYLIB and its associated plugins. -===============================================================================================*/ -#include "../../api/inc/fmod.h" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD_SYSTEM *system = 0; - FMOD_SOUND *sound = 0; - FMOD_CHANNEL *channel = 0; - FMOD_RESULT result; - int count; - int playing = FALSE; - int key; - unsigned int version; - int numoutputplugins = 0; - unsigned int handle = 0; - - /* - Global Settings - */ - result = FMOD_System_Create(&system); - ERRCHECK(result); - - result = FMOD_System_GetVersion(system, &version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - getch(); - return 0; - } - - /* - Set the source directory for all of the FMOD plugins. - */ - result = FMOD_System_SetPluginPath(system, "../../api/plugins"); - ERRCHECK(result); - - /* - Display plugins - */ - { - int num; - char name[256]; - - printf("Codec plugins\n"); - printf("--------------\n"); - result = FMOD_System_GetNumPlugins(system, FMOD_PLUGINTYPE_CODEC, &num); - ERRCHECK(result); - for (count = 0; count < num; count++) - { - result = FMOD_System_GetPluginHandle(system, FMOD_PLUGINTYPE_CODEC, count, &handle); - ERRCHECK(result); - - result = FMOD_System_GetPluginInfo(system, handle, 0, name, 256, 0); - ERRCHECK(result); - - printf("%2d - %-30s", count + 1, name); - - if (count % 2) - { - printf("\n"); - } - } - printf("\n"); - if (count % 2) - { - printf("\n"); - } - - printf("DSP plugins\n"); - printf("--------------\n"); - result = FMOD_System_GetNumPlugins(system, FMOD_PLUGINTYPE_DSP, &num); - ERRCHECK(result); - for (count = 0; count < num; count++) - { - result = FMOD_System_GetPluginHandle(system, FMOD_PLUGINTYPE_DSP, count, &handle); - ERRCHECK(result); - - result = FMOD_System_GetPluginInfo(system, handle, 0, name, 256, 0); - ERRCHECK(result); - - printf("%2d - %-30s", count + 1, name); - - if (count % 2) - { - printf("\n"); - } - } - printf("\n"); - if (count % 2) - { - printf("\n"); - } - - printf("Output plugins\n"); - printf("--------------\n"); - result = FMOD_System_GetNumPlugins(system, FMOD_PLUGINTYPE_OUTPUT, &num); - ERRCHECK(result); - for (count = 0; count < num; count++) - { - result = FMOD_System_GetPluginHandle(system, FMOD_PLUGINTYPE_OUTPUT, count, &handle); - ERRCHECK(result); - - result = FMOD_System_GetPluginInfo(system, handle, 0, name, 256, 0); - ERRCHECK(result); - - printf("%2d - %-30s", count + 1, name); - - if (count % 2) - { - printf("\n"); - } - } - if (count % 2) - { - printf("\n"); - } - - numoutputplugins = num; - } - - /* - System initialization - */ - printf("-----------------------------------------------------------------------\n"); // print driver names - printf("Press a corresponding number for an OUTPUT PLUGIN to use or ESC to quit\n"); - - do - { - key = getch(); - } while (!(key == 27 || (key >= '1' && key <= '0' + numoutputplugins))); - - if (key == 27) - { - return 0; - } - - result = FMOD_System_GetPluginHandle(system, FMOD_PLUGINTYPE_OUTPUT, key - '1', &handle); - ERRCHECK(result); - - result = FMOD_System_SetOutputByPlugin(system, handle); - ERRCHECK(result); - - result = FMOD_System_Init(system, 32, FMOD_INIT_NORMAL, NULL); - ERRCHECK(result); - - result = FMOD_System_CreateSound(system, "../media/wave.mp3", FMOD_SOFTWARE | FMOD_CREATESTREAM, 0, &sound); - ERRCHECK(result); - - printf("Press a key to play sound to output device.\n"); - - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound, 0, &channel); - ERRCHECK(result); - - /* - Main loop. - */ - do - { - unsigned int ms = 0; - unsigned int lenms = 0; - int paused = FALSE; - int channelsplaying = 0; - FMOD_SOUND *currentsound = 0; - - FMOD_System_Update(system); - - playing = FALSE; - - result = FMOD_Channel_IsPlaying(channel, &playing); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - result = FMOD_Channel_GetPaused(channel, &paused); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - result = FMOD_Channel_GetPosition(channel, &ms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - FMOD_Channel_GetCurrentSound(channel, ¤tsound); - if (currentsound) - { - result = FMOD_Sound_GetLength(currentsound, &lenms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - } - - FMOD_System_GetChannelsPlaying(system, &channelsplaying); - - printf("Time %02d:%02d:%02d/%02d:%02d:%02d : %s : Channels Playing %2d\r", ms / 1000 / 60, ms / 1000 % 60, ms / 10 % 100, lenms / 1000 / 60, lenms / 1000 % 60, lenms / 10 % 100, paused ? "Paused " : playing ? "Playing" : "Stopped", channelsplaying); - fflush(stdout); - - Sleep(5); - - if (kbhit()) - { - key = getch(); - if (key == 27) - { - break; - } - } - - } while (playing); - - printf("\n"); - - /* - Shut down - */ - result = FMOD_Sound_Release(sound); - ERRCHECK(result); - result = FMOD_System_Close(system); - ERRCHECK(result); - result = FMOD_System_Release(system); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/examples/useplugins/main.cpp b/CocosDenshion/third_party/fmod/examples/useplugins/main.cpp deleted file mode 100644 index 959e56fc90..0000000000 --- a/CocosDenshion/third_party/fmod/examples/useplugins/main.cpp +++ /dev/null @@ -1,249 +0,0 @@ -/*=============================================================================================== - Use Plugins Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how to use FMODEXP.DYLIB and its associated plugins. -===============================================================================================*/ -#include "../../api/inc/fmod.hpp" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD::System *system = 0; - FMOD::Sound *sound = 0; - FMOD::Channel *channel = 0; - FMOD_RESULT result; - int count; - bool playing = false; - int key; - unsigned int version; - int numoutputplugins = 0; - unsigned int handle = 0; - - /* - Global Settings - */ - result = FMOD::System_Create(&system); - ERRCHECK(result); - - result = system->getVersion(&version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - getch(); - return 0; - } - - /* - Set the source directory for all of the FMOD plugins. - */ - result = system->setPluginPath("../../api/plugins"); - ERRCHECK(result); - - /* - Display plugins - */ - { - int num; - char name[256]; - - printf("Codec plugins\n"); - printf("--------------\n"); - result = system->getNumPlugins(FMOD_PLUGINTYPE_CODEC, &num); - ERRCHECK(result); - for (count = 0; count < num; count++) - { - result = system->getPluginHandle(FMOD_PLUGINTYPE_CODEC, count, &handle); - ERRCHECK(result); - - result = system->getPluginInfo(handle, 0, name, 256, 0); - ERRCHECK(result); - - printf("%2d - %-30s", count + 1, name); - - if (count % 2) - { - printf("\n"); - } - } - printf("\n"); - if (count % 2) - { - printf("\n"); - } - - printf("DSP plugins\n"); - printf("--------------\n"); - result = system->getNumPlugins(FMOD_PLUGINTYPE_DSP, &num); - ERRCHECK(result); - for (count = 0; count < num; count++) - { - result = system->getPluginHandle(FMOD_PLUGINTYPE_DSP, count, &handle); - ERRCHECK(result); - - result = system->getPluginInfo(handle, 0, name, 256, 0); - ERRCHECK(result); - - printf("%2d - %-30s", count + 1, name); - - if (count % 2) - { - printf("\n"); - } - } - printf("\n"); - if (count % 2) - { - printf("\n"); - } - - printf("Output plugins\n"); - printf("--------------\n"); - result = system->getNumPlugins(FMOD_PLUGINTYPE_OUTPUT, &num); - ERRCHECK(result); - for (count = 0; count < num; count++) - { - result = system->getPluginHandle(FMOD_PLUGINTYPE_OUTPUT, count, &handle); - ERRCHECK(result); - - result = system->getPluginInfo(handle, 0, name, 256, 0); - ERRCHECK(result); - - printf("%2d - %-30s", count + 1, name); - - if (count % 2) - { - printf("\n"); - } - } - if (count % 2) - { - printf("\n"); - } - - numoutputplugins = num; - } - - /* - System initialization - */ - printf("-----------------------------------------------------------------------\n"); // print driver names - printf("Press a corresponding number for an OUTPUT PLUGIN to use or ESC to quit\n"); - - do - { - key = getch(); - } while (!(key == 27 || (key >= '1' && key <= '0' + numoutputplugins))); - - if (key == 27) - { - return 0; - } - - result = system->getPluginHandle(FMOD_PLUGINTYPE_OUTPUT, key - '1', &handle); - ERRCHECK(result); - - result = system->setOutputByPlugin(handle); - ERRCHECK(result); - - result = system->init(32, FMOD_INIT_NORMAL, NULL); - ERRCHECK(result); - - result = system->createSound("../media/wave.mp3", FMOD_SOFTWARE | FMOD_CREATESTREAM, 0, &sound); - ERRCHECK(result); - - printf("Press a key to play sound to output device.\n"); - - result = system->playSound(FMOD_CHANNEL_FREE, sound, 0, &channel); - ERRCHECK(result); - - /* - Main loop. - */ - do - { - unsigned int ms = 0; - unsigned int lenms = 0; - bool paused = false; - int channelsplaying = 0; - FMOD::Sound *currentsound = 0; - - system->update(); - - playing = false; - - result = channel->isPlaying(&playing); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - result = channel->getPaused(&paused); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - result = channel->getPosition(&ms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - channel->getCurrentSound(¤tsound); - if (currentsound) - { - result = currentsound->getLength(&lenms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - } - - system->getChannelsPlaying(&channelsplaying); - - printf("Time %02d:%02d:%02d/%02d:%02d:%02d : %s : Channels Playing %2d\r", ms / 1000 / 60, ms / 1000 % 60, ms / 10 % 100, lenms / 1000 / 60, lenms / 1000 % 60, lenms / 10 % 100, paused ? "Paused " : playing ? "Playing" : "Stopped", channelsplaying); - fflush(stdout); - Sleep(5); - - if (kbhit()) - { - key = getch(); - if (key == 27) - { - break; - } - } - - } while (playing); - - printf("\n"); - - /* - Shut down - */ - result = sound->release(); - ERRCHECK(result); - result = system->close(); - ERRCHECK(result); - result = system->release(); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/examples/usercreatedsound/Makefile b/CocosDenshion/third_party/fmod/examples/usercreatedsound/Makefile deleted file mode 100644 index 91ff1ee470..0000000000 --- a/CocosDenshion/third_party/fmod/examples/usercreatedsound/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -usercreatedsound_cpp: main.cpp - g++ -O3 -o usercreatedsound main.cpp ../../api/lib/libfmodex.so - -usercreatedsound_c: main.c - g++ -O3 -o usercreatedsound main.c ../../api/lib/libfmodex.so - -run: - ./usercreatedsound - -clean: - rm -f usercreatedsound diff --git a/CocosDenshion/third_party/fmod/examples/usercreatedsound/main.c b/CocosDenshion/third_party/fmod/examples/usercreatedsound/main.c deleted file mode 100644 index ddfe5474e9..0000000000 --- a/CocosDenshion/third_party/fmod/examples/usercreatedsound/main.c +++ /dev/null @@ -1,215 +0,0 @@ -/*=============================================================================================== - User Created Sound Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how create a sound with data filled by the user. - It shows a user created static sample, followed by a user created stream. - The former allocates all memory needed for the sound and is played back as a static sample, - while the latter streams the data in chunks as it plays, using far less memory. -===============================================================================================*/ -#include "../../api/inc/fmod.h" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include -#include - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - -FMOD_RESULT F_CALLBACK pcmreadcallback(FMOD_SOUND *sound, void *data, unsigned int datalen) -{ - unsigned int count; - static float t1 = 0, t2 = 0; // time - static float v1 = 0, v2 = 0; // velocity - signed short *stereo16bitbuffer = (signed short *)data; - - for (count=0; count>2; count++) // >>2 = 16bit stereo (4 bytes per sample) - { - *stereo16bitbuffer++ = (signed short)(sin(t1) * 32767.0f); // left channel - *stereo16bitbuffer++ = (signed short)(sin(t2) * 32767.0f); // right channel - - t1 += 0.01f + v1; - t2 += 0.0142f + v2; - v1 += (float)(sin(t1) * 0.002f); - v2 += (float)(sin(t2) * 0.002f); - } - - return FMOD_OK; -} - - -FMOD_RESULT F_CALLBACK pcmsetposcallback(FMOD_SOUND *sound, int subsound, unsigned int position, FMOD_TIMEUNIT postype) -{ - /* - This is useful if the user calls FMOD_Sound_SetPosition and you want to seek your data accordingly. - */ - return FMOD_OK; -} - - -int main(int argc, char *argv[]) -{ - FMOD_SYSTEM *system; - FMOD_SOUND *sound; - FMOD_CHANNEL *channel = 0; - FMOD_RESULT result; - FMOD_MODE mode = FMOD_2D | FMOD_OPENUSER | FMOD_LOOP_NORMAL | FMOD_HARDWARE; - int key; - int channels = 2; - FMOD_CREATESOUNDEXINFO createsoundexinfo; - unsigned int version; - - /* - Create a System object and initialize. - */ - result = FMOD_System_Create(&system); - ERRCHECK(result); - - result = FMOD_System_GetVersion(system, &version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - result = FMOD_System_Init(system, 32, FMOD_INIT_NORMAL, NULL); - ERRCHECK(result); - - printf("============================================================================\n"); - printf("User Created Sound Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("============================================================================\n"); - printf("Sound played here is generated in realtime. It will either play as a stream\n"); - printf("which means it is continually filled as it is playing, or it will play as a \n"); - printf("static sample, which means it is filled once as the sound is created, then \n"); - printf("when played it will just play that short loop of data. \n"); - printf("============================================================================\n"); - printf("\n"); - - do - { - printf("Press 1 to play as a runtime decoded stream. (will carry on infinitely)\n"); - printf("Press 2 to play as a static in memory sample. (loops a short block of data)\n"); - printf("Press Esc to quit.\n\n"); - key = getch(); - - } while (key != 27 && key != '1' && key != '2'); - - if (key == 27) - { - return 0; - } - else if (key == '1') - { - mode |= FMOD_CREATESTREAM; - } - - memset(&createsoundexinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO)); - createsoundexinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO); /* required. */ - createsoundexinfo.decodebuffersize = 44100; /* Chunk size of stream update in samples. This will be the amount of data passed to the user callback. */ - createsoundexinfo.length = 44100 * channels * sizeof(signed short) * 5; /* Length of PCM data in bytes of whole song (for Sound::getLength) */ - createsoundexinfo.numchannels = channels; /* Number of channels in the sound. */ - createsoundexinfo.defaultfrequency = 44100; /* Default playback rate of sound. */ - createsoundexinfo.format = FMOD_SOUND_FORMAT_PCM16; /* Data format of sound. */ - createsoundexinfo.pcmreadcallback = pcmreadcallback; /* User callback for reading. */ - createsoundexinfo.pcmsetposcallback = pcmsetposcallback; /* User callback for seeking. */ - - result = FMOD_System_CreateSound(system, 0, mode, &createsoundexinfo, &sound); - ERRCHECK(result); - - printf("Press space to pause, Esc to quit\n"); - printf("\n"); - - /* - Play the sound. - */ - - result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound, 0, &channel); - ERRCHECK(result); - - /* - Main loop. - */ - do - { - if (kbhit()) - { - key = getch(); - - switch (key) - { - case ' ' : - { - int paused; - FMOD_Channel_GetPaused(channel, &paused); - FMOD_Channel_SetPaused(channel, !paused); - break; - } - } - } - - FMOD_System_Update(system); - - if (channel) - { - unsigned int ms; - unsigned int lenms; - int playing; - int paused; - - FMOD_Channel_IsPlaying(channel, &playing); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - result = FMOD_Channel_GetPaused(channel, &paused); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - result = FMOD_Channel_GetPosition(channel, &ms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - result = FMOD_Sound_GetLength(sound, &lenms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - printf("Time %02d:%02d:%02d/%02d:%02d:%02d : %s\r", ms / 1000 / 60, ms / 1000 % 60, ms / 10 % 100, lenms / 1000 / 60, lenms / 1000 % 60, lenms / 10 % 100, paused ? "Paused " : playing ? "Playing" : "Stopped"); - fflush(stdout); - } - - Sleep(10); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = FMOD_Sound_Release(sound); - ERRCHECK(result); - result = FMOD_System_Close(system); - ERRCHECK(result); - result = FMOD_System_Release(system); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/examples/usercreatedsound/main.cpp b/CocosDenshion/third_party/fmod/examples/usercreatedsound/main.cpp deleted file mode 100644 index d0acb53a25..0000000000 --- a/CocosDenshion/third_party/fmod/examples/usercreatedsound/main.cpp +++ /dev/null @@ -1,214 +0,0 @@ -/*=============================================================================================== - User Created Sound Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - This example shows how create a sound with data filled by the user. - It shows a user created static sample, followed by a user created stream. - The former allocates all memory needed for the sound and is played back as a static sample, - while the latter streams the data in chunks as it plays, using far less memory. -===============================================================================================*/ -#include "../../api/inc/fmod.hpp" -#include "../../api/inc/fmod_errors.h" -#include "../common/wincompat.h" -#include -#include - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - -FMOD_RESULT F_CALLBACK pcmreadcallback(FMOD_SOUND *sound, void *data, unsigned int datalen) -{ - unsigned int count; - static float t1 = 0, t2 = 0; // time - static float v1 = 0, v2 = 0; // velocity - signed short *stereo16bitbuffer = (signed short *)data; - - for (count=0; count>2; count++) // >>2 = 16bit stereo (4 bytes per sample) - { - *stereo16bitbuffer++ = (signed short)(sin(t1) * 32767.0f); // left channel - *stereo16bitbuffer++ = (signed short)(sin(t2) * 32767.0f); // right channel - - t1 += 0.01f + v1; - t2 += 0.0142f + v2; - v1 += (float)(sin(t1) * 0.002f); - v2 += (float)(sin(t2) * 0.002f); - } - - return FMOD_OK; -} - - -FMOD_RESULT F_CALLBACK pcmsetposcallback(FMOD_SOUND *sound, int subsound, unsigned int position, FMOD_TIMEUNIT postype) -{ - /* - This is useful if the user calls Sound::setPosition and you want to seek your data accordingly. - */ - return FMOD_OK; -} - - -int main(int argc, char *argv[]) -{ - FMOD::System *system; - FMOD::Sound *sound; - FMOD::Channel *channel = 0; - FMOD_RESULT result; - FMOD_MODE mode = FMOD_2D | FMOD_OPENUSER | FMOD_LOOP_NORMAL | FMOD_HARDWARE; - int key; - int channels = 2; - FMOD_CREATESOUNDEXINFO createsoundexinfo; - unsigned int version; - - /* - Create a System object and initialize. - */ - result = FMOD::System_Create(&system); - ERRCHECK(result); - - result = system->getVersion(&version); - ERRCHECK(result); - - if (version < FMOD_VERSION) - { - printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION); - return 0; - } - - result = system->init(32, FMOD_INIT_NORMAL, 0); - ERRCHECK(result); - - printf("============================================================================\n"); - printf("User Created Sound Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("============================================================================\n"); - printf("Sound played here is generated in realtime. It will either play as a stream\n"); - printf("which means it is continually filled as it is playing, or it will play as a \n"); - printf("static sample, which means it is filled once as the sound is created, then \n"); - printf("when played it will just play that short loop of data. \n"); - printf("============================================================================\n"); - printf("\n"); - - do - { - printf("Press 1 to play as a runtime decoded stream. (will carry on infinitely)\n"); - printf("Press 2 to play as a static in memory sample. (loops a short block of data)\n"); - printf("Press Esc to quit.\n\n"); - key = getch(); - - } while (key != 27 && key != '1' && key != '2'); - - if (key == 27) - { - return 0; - } - else if (key == '1') - { - mode |= FMOD_CREATESTREAM; - } - - memset(&createsoundexinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO)); - createsoundexinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO); /* required. */ - createsoundexinfo.decodebuffersize = 44100; /* Chunk size of stream update in samples. This will be the amount of data passed to the user callback. */ - createsoundexinfo.length = 44100 * channels * sizeof(signed short) * 5; /* Length of PCM data in bytes of whole song (for Sound::getLength) */ - createsoundexinfo.numchannels = channels; /* Number of channels in the sound. */ - createsoundexinfo.defaultfrequency = 44100; /* Default playback rate of sound. */ - createsoundexinfo.format = FMOD_SOUND_FORMAT_PCM16; /* Data format of sound. */ - createsoundexinfo.pcmreadcallback = pcmreadcallback; /* User callback for reading. */ - createsoundexinfo.pcmsetposcallback = pcmsetposcallback; /* User callback for seeking. */ - - result = system->createSound(0, mode, &createsoundexinfo, &sound); - ERRCHECK(result); - - printf("Press space to pause, Esc to quit\n"); - printf("\n"); - - /* - Play the sound. - */ - - result = system->playSound(FMOD_CHANNEL_FREE, sound, 0, &channel); - ERRCHECK(result); - - /* - Main loop. - */ - do - { - if (kbhit()) - { - key = getch(); - - switch (key) - { - case ' ' : - { - bool paused; - channel->getPaused(&paused); - channel->setPaused(!paused); - break; - } - } - } - - system->update(); - - if (channel) - { - unsigned int ms; - unsigned int lenms; - bool playing; - bool paused; - - channel->isPlaying(&playing); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - result = channel->getPaused(&paused); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - result = channel->getPosition(&ms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - result = sound->getLength(&lenms, FMOD_TIMEUNIT_MS); - if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE) && (result != FMOD_ERR_CHANNEL_STOLEN)) - { - ERRCHECK(result); - } - - printf("Time %02d:%02d:%02d/%02d:%02d:%02d : %s\r", ms / 1000 / 60, ms / 1000 % 60, ms / 10 % 100, lenms / 1000 / 60, lenms / 1000 % 60, lenms / 10 % 100, paused ? "Paused " : playing ? "Playing" : "Stopped"); - fflush(stdout); - } - - Sleep(20); - - } while (key != 27); - - printf("\n"); - - /* - Shut down - */ - result = sound->release(); - ERRCHECK(result); - result = system->close(); - ERRCHECK(result); - result = system->release(); - ERRCHECK(result); - - return 0; -} - - diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/README.TXT b/CocosDenshion/third_party/fmod/fmoddesignerapi/README.TXT deleted file mode 100644 index f6dacfe968..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/README.TXT +++ /dev/null @@ -1,57 +0,0 @@ ----------------------------------------------------------------------------- - FMOD Designer 4.36.01 - Copyright (c) Firelight Technologies Pty, Ltd, - 2004-2011 ----------------------------------------------------------------------------- - - http://www.fmod.org - - ----------------------------------------------------------------------------- -Engine sounds by Greg Hill - Soundwave Concepts. ----------------------------------------------------------------------------- - - ----------------------------------------------------------------------------- -Platform specific issues. ----------------------------------------------------------------------------- - -Report all bugs to support@fmod.org. - - ----------------------------------------------------------------------------- -FMOD End User License Agreement ----------------------------------------------------------------------------- - -FMOD's names, sources, documentation and binaries contained within the -distributed archive are copyright © Firelight Technologies, Pty, Ltd. -1994-2011. - -The contents of the FMOD distribution archive may not be redistributed, -reproduced, modified, transmitted, broadcast, published or adapted in any -way, shape or form, without the prior written consent of the owner, -Firelight Technologies, be it by tangible or non tangible media. - -The fmod.dll file may be redistributed without the authors prior permission, -and must remain unmodified. The use of dll 'static linking' tools that aim -to hide the fmod library are forbidden. - -FMOD may not be used in a commercial product, or product that directly or -indirectly receives income with the aid of the FMOD sound library, without -a commercial license from Firelight Technologies. Releasing a product -without a commercial license in this instance is a breach of the FMOD EULA -and parties who violate this license will be prosecuted under the full -extent of the law. - - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/api/inc/fmod_event.h b/CocosDenshion/third_party/fmod/fmoddesignerapi/api/inc/fmod_event.h deleted file mode 100644 index 06125021d8..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/api/inc/fmod_event.h +++ /dev/null @@ -1,1244 +0,0 @@ -/*$ preserve start $*/ - -/* ============================================================================================ */ -/* FMOD Ex - Main C/C++ event/data driven system header file. */ -/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2011. */ -/* */ -/* This header is the base header for all other FMOD EventSystem headers. If you are */ -/* programming in C use this exclusively, or if you are programming C++ use this in */ -/* conjunction with FMOD_EVENT.HPP */ -/* ============================================================================================ */ - -#ifndef __FMOD_EVENT_H__ -#define __FMOD_EVENT_H__ - -#ifndef _FMOD_H -#include "fmod.h" -#endif - -/* - FMOD EventSystem version number. Check this against FMOD::EventSystem::getVersion. - 0xaaaabbcc -> aaaa = major version number. bb = minor version number. cc = development version number. -*/ - -#define FMOD_EVENT_VERSION 0x00043601 - -/* - FMOD event types -*/ - -typedef struct FMOD_EVENTSYSTEM FMOD_EVENTSYSTEM; -typedef struct FMOD_EVENTPROJECT FMOD_EVENTPROJECT; -typedef struct FMOD_EVENTGROUP FMOD_EVENTGROUP; -typedef struct FMOD_EVENTCATEGORY FMOD_EVENTCATEGORY; -typedef struct FMOD_EVENT FMOD_EVENT; -typedef struct FMOD_EVENTPARAMETER FMOD_EVENTPARAMETER; -typedef struct FMOD_EVENTREVERB FMOD_EVENTREVERB; -typedef struct FMOD_EVENTQUEUE FMOD_EVENTQUEUE; -typedef struct FMOD_EVENTQUEUEENTRY FMOD_EVENTQUEUEENTRY; -typedef struct FMOD_MUSICPROMPT FMOD_MUSICPROMPT; -typedef struct FMOD_MUSICSYSTEM FMOD_MUSICSYSTEM; -typedef unsigned int FMOD_EVENT_INITFLAGS; -typedef unsigned int FMOD_EVENT_MODE; -typedef unsigned int FMOD_EVENT_STATE; -typedef unsigned int FMOD_MUSIC_ID; -typedef FMOD_MUSIC_ID FMOD_MUSIC_CUE_ID; -typedef FMOD_MUSIC_ID FMOD_MUSIC_PARAM_ID; - - -/* -[DEFINE] -[ - [NAME] - FMOD_EVENT_INITFLAGS - - [DESCRIPTION] - Initialization flags. Use them with EventSystem::init in the eventflags parameter to change various behaviour. - - [REMARKS] - - [PLATFORMS] - Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android - - [SEE_ALSO] - EventSystem::init - EventSystem::getEventByGUID - FMOD_EVENT_SOUNDDEFINFO - FMOD_EVENT_CALLBACKTYPE -] -*/ -#define FMOD_EVENT_INIT_NORMAL 0x00000000 /* All platforms - Initialize normally */ -#define FMOD_EVENT_INIT_USER_ASSETMANAGER 0x00000001 /* All platforms - All wave data loading/freeing will be referred back to the programmer through the FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_CREATE/FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_RELEASE callback */ -#define FMOD_EVENT_INIT_FAIL_ON_MAXSTREAMS 0x00000002 /* All platforms - Events will fail if "Max streams" was reached when playing streamed banks, instead of going virtual. */ -#define FMOD_EVENT_INIT_DONTUSENAMES 0x00000004 /* All platforms - All event/eventgroup/eventparameter/eventcategory/eventreverb names will be discarded on load. Use getXXXByIndex to access them. This may potentially save a lot of memory at runtime. */ -#define FMOD_EVENT_INIT_UPPERCASE_FILENAMES 0x00000008 /* All platforms - All FSB filenames will be translated to upper case before being used. */ -#define FMOD_EVENT_INIT_LOWERCASE_FILENAMES 0x00000080 /* All platforms - All FSB filenames will be translated to lower case before being used. */ -#define FMOD_EVENT_INIT_SEARCH_PLUGINS 0x00000010 /* All platforms - Search the current directory for dsp/codec plugins on EventSystem::init. */ -#define FMOD_EVENT_INIT_USE_GUIDS 0x00000020 /* All platforms - Build an event GUID table when loading FEVs so that EventSystem::getEventByGUID can be used. */ -#define FMOD_EVENT_INIT_DETAILED_SOUNDDEF_INFO 0x00000040 /* All platforms - Pass an FMOD_EVENT_SOUNDDEFINFO struct to FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_SELECTINDEX callbacks rather than just the sound definition name (uses more memory for sound definition waveform names). */ -#define FMOD_EVENT_INIT_RESETPARAMSTOMINIMUM 0x00000100 /* All platforms - Reset parameters to minimum value when getting an event instance instead of using the INFO_ONLY event's values. */ -#define FMOD_EVENT_INIT_ELEVATION_AFFECTS_LISTENER_ANGLE 0x00000200 /* All platforms - The listener angle event parameters will be affected by elevation, and not just horizontal components. */ -#define FMOD_EVENT_INIT_DONTUSELOWMEM 0x00000400 /* All platforms - Instruct the event system to NOT use FMOD_LOWMEM when it opens .FSB files. Specify this flag if you need access to the names of individual subsounds in loaded .FSB files. Specifying this flag will make the event system use more memory. */ - -/* [DEFINE_END] */ - - -/* -[DEFINE] -[ - [NAME] - FMOD_EVENT_MODE - - [DESCRIPTION] - Event data loading bitfields. Bitwise OR them together for controlling how event data is loaded. - - [REMARKS] - FMOD_EVENT_NONBLOCKING_THREAD0-4. This flag extends FMOD_EVENT_NONBLOCKING to allow multiple asynchronous loads to happen on different threads at the same time.
- FMOD_EVENT_NONBLOCKING by itself will always execute on thread 0 by default. Up to 5 simultaneous threads for loading at once are supported.
- Only 1 flag should be specified at a time. If multiple flags are specified an FMOD_ERR_INVALID_PARAM error will be returned.
- FMOD_EVENT_NONBLOCKING_THREAD0-4 can be specified without the FMOD_EVENT_NONBLOCKING flag being used (it automatically includes it) - - [PLATFORMS] - Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android - - [SEE_ALSO] - EventGroup::loadEventData - EventGroup::getEvent - EventGroup::getEventByIndex -] -*/ -#define FMOD_EVENT_DEFAULT 0x00000000 /* FMOD_EVENT_DEFAULT specifies default loading behaviour i.e. event data for the whole group is NOT cached and the function that initiated the loading process will block until loading is complete. */ -#define FMOD_EVENT_NONBLOCKING 0x00000001 /* For loading event data asynchronously. FMOD will use a thread to load the data. Use Event::getState to find out when loading is complete. */ -#define FMOD_EVENT_ERROR_ON_DISKACCESS 0x00000002 /* For EventGroup::getEvent / EventGroup::getEventByIndex. If EventGroup::loadEventData has accidently been forgotten this flag will return an FMOD_ERR_FILE_UNWANTED if the getEvent function tries to load data. */ -#define FMOD_EVENT_INFOONLY 0x00000004 /* For EventGroup::getEvent / EventGroup::getEventByIndex. Don't allocate instances or load data, just get a handle to allow user to get information from the event. */ -#define FMOD_EVENT_USERDSP 0x00000008 /* For EventGroup::getEvent / EventGroup::getEventByIndex. Tells FMOD that you plan to add your own DSP effects to this event's ChannelGroup at runtime. Omitting this flag will yield a small memory gain. */ - -#define FMOD_EVENT_NONBLOCKING_THREAD0 (FMOD_EVENT_NONBLOCKING) /* FMOD_EVENT_NONBLOCKING, execute on thread 0. See remarks. (default) */ -#define FMOD_EVENT_NONBLOCKING_THREAD1 (FMOD_EVENT_NONBLOCKING | 0x00010000) /* FMOD_EVENT_NONBLOCKING, execute on thread 1. See remarks. */ -#define FMOD_EVENT_NONBLOCKING_THREAD2 (FMOD_EVENT_NONBLOCKING | 0x00020000) /* FMOD_EVENT_NONBLOCKING, execute on thread 2. See remarks. */ -#define FMOD_EVENT_NONBLOCKING_THREAD3 (FMOD_EVENT_NONBLOCKING | 0x00040000) /* FMOD_EVENT_NONBLOCKING, execute on thread 3. See remarks. */ -#define FMOD_EVENT_NONBLOCKING_THREAD4 (FMOD_EVENT_NONBLOCKING | 0x00080000) /* FMOD_EVENT_NONBLOCKING, execute on thread 4. See remarks. */ -/* [DEFINE_END] */ - - -/* -[DEFINE] -[ - [NAME] - FMOD_EVENT_STATE - - [DESCRIPTION] - These values describe what state an event is in. - - [REMARKS] - The flags below can be combined to set multiple states at once. Use bitwise AND operations to test for these. - An example of a combined flag set would be FMOD_EVENT_STATE_READY | FMOD_EVENT_STATE_PLAYING. - - [PLATFORMS] - Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android - - [SEE_ALSO] - Event::getState - FMOD_EVENT_MODE -] -*/ -#define FMOD_EVENT_STATE_READY 0x00000001 /* Event is ready to play. */ -#define FMOD_EVENT_STATE_LOADING 0x00000002 /* Loading in progress. */ -#define FMOD_EVENT_STATE_ERROR 0x00000004 /* Failed to open - file not found, out of memory etc. See return value of Event::getState for what happened. */ -#define FMOD_EVENT_STATE_PLAYING 0x00000008 /* Event has been started. This will still be true even if there are no sounds active. Event::stop must be called or the event must stop itself using a 'one shot and stop event' parameter mode. */ -#define FMOD_EVENT_STATE_CHANNELSACTIVE 0x00000010 /* Event has active voices. Use this if you want to detect if sounds are playing in the event or not. */ -#define FMOD_EVENT_STATE_INFOONLY 0x00000020 /* Event was loaded with the FMOD_EVENT_INFOONLY flag. */ -#define FMOD_EVENT_STATE_STARVING 0x00000040 /* Event is streaming but not being fed data in time, so may be stuttering. */ -/* [DEFINE_END] */ - - -/* -[ENUM] -[ - [DESCRIPTION] - Property indices for Event::getPropertyByIndex. - - [REMARKS] - - [PLATFORMS] - Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android - - [SEE_ALSO] - Event::getPropertyByIndex -] -*/ -typedef enum -{ - FMOD_EVENTPROPERTY_NAME = 0, /* Type : char * - (Readonly) Name of event. */ - FMOD_EVENTPROPERTY_VOLUME, /* Type : float - Relative volume of event. */ - FMOD_EVENTPROPERTY_VOLUMERANDOMIZATION, /* Type : float - Random deviation in volume of event. */ - FMOD_EVENTPROPERTY_PITCH, /* Type : float - Relative pitch of event in raw underlying units. */ - FMOD_EVENTPROPERTY_PITCH_OCTAVES, /* Type : float - Relative pitch of event in octaves. */ - FMOD_EVENTPROPERTY_PITCH_SEMITONES, /* Type : float - Relative pitch of event in semitones. */ - FMOD_EVENTPROPERTY_PITCH_TONES, /* Type : float - Relative pitch of event in tones. */ - FMOD_EVENTPROPERTY_PITCHRANDOMIZATION, /* Type : float - Random deviation in pitch of event in raw underlying units. */ - FMOD_EVENTPROPERTY_PITCHRANDOMIZATION_OCTAVES, /* Type : float - Random deviation in pitch of event in octaves. */ - FMOD_EVENTPROPERTY_PITCHRANDOMIZATION_SEMITONES, /* Type : float - Random deviation in pitch of event in semitones. */ - FMOD_EVENTPROPERTY_PITCHRANDOMIZATION_TONES, /* Type : float - Random deviation in pitch of event in tones. */ - FMOD_EVENTPROPERTY_PRIORITY, /* Type : int - Playback priority of event. */ - FMOD_EVENTPROPERTY_MAX_PLAYBACKS, /* Type : int - (Readonly) Maximum simultaneous playbacks of event. */ - FMOD_EVENTPROPERTY_MAX_PLAYBACKS_BEHAVIOR, /* Type : int - 1 = steal oldest, 2 = steal newest, 3 = steal quietest, 4 = just fail, 5 = just fail if quietest. */ - FMOD_EVENTPROPERTY_MODE, /* Type : FMOD_MODE - Either FMOD_3D or FMOD_2D. */ - FMOD_EVENTPROPERTY_3D_IGNORE_GEOMETRY, /* Type : int - Ignore geometry for that event. 1 = yes, 0 = no. */ - FMOD_EVENTPROPERTY_3D_ROLLOFF, /* Type : FMOD_MODE - Either FMOD_3D_INVERSEROLLOFF, FMOD_3D_LINEARROLLOFF, FMOD_3D_LINEARSQUAREROLLOFF, or none for custom rolloff. */ - FMOD_EVENTPROPERTY_3D_MINDISTANCE, /* Type : float - Minimum 3d distance of event. */ - FMOD_EVENTPROPERTY_3D_MAXDISTANCE, /* Type : float - Maximum 3d distance of event. Means different things depending on EVENTPROPERTY_3D_ROLLOFF. If event has custom rolloff, setting FMOD_EVENTPROPERTY_3D_MAXDISTANCE will scale the range of all distance parameters in this event e.g. set this property to 2.0 to double the range of all distance parameters, set it to 0.5 to halve the range of all distance parameters. */ - FMOD_EVENTPROPERTY_3D_POSITION, /* Type : FMOD_MODE - Either FMOD_3D_HEADRELATIVE or FMOD_3D_WORLDRELATIVE. */ - FMOD_EVENTPROPERTY_3D_CONEINSIDEANGLE, /* Type : float - Event cone inside angle. 0 to 360. */ - FMOD_EVENTPROPERTY_3D_CONEOUTSIDEANGLE, /* Type : float - Event cone outside angle. 0 to 360. */ - FMOD_EVENTPROPERTY_3D_CONEOUTSIDEVOLUME, /* Type : float - Event cone outside volume. 0 to 1.0. */ - FMOD_EVENTPROPERTY_3D_DOPPLERSCALE, /* Type : float - Doppler scale where 0 = no doppler, 1.0 = normal doppler, 2.0 = double doppler etc. */ - FMOD_EVENTPROPERTY_3D_SPEAKERSPREAD, /* Type : float - Angle of spread for stereo/mutlichannel source. 0 to 360. */ - FMOD_EVENTPROPERTY_3D_PANLEVEL, /* Type : float - 0 = sound pans according to speaker levels, 1 = sound pans according to 3D position. */ - FMOD_EVENTPROPERTY_SPEAKER_L, /* Type : float - 2D event volume for front left speaker. */ - FMOD_EVENTPROPERTY_SPEAKER_C, /* Type : float - 2D event volume for front center speaker. */ - FMOD_EVENTPROPERTY_SPEAKER_R, /* Type : float - 2D event volume for front right speaker. */ - FMOD_EVENTPROPERTY_SPEAKER_LS, /* Type : float - 2D event volume for side left speaker. */ - FMOD_EVENTPROPERTY_SPEAKER_RS, /* Type : float - 2D event volume for side right speaker. */ - FMOD_EVENTPROPERTY_SPEAKER_LR, /* Type : float - 2D event volume for back left speaker. */ - FMOD_EVENTPROPERTY_SPEAKER_RR, /* Type : float - 2D event volume for back right speaker. */ - FMOD_EVENTPROPERTY_SPEAKER_LFE, /* Type : float - 2D event volume for low frequency speaker. */ - FMOD_EVENTPROPERTY_REVERBWETLEVEL, /* Type : float - Reverb gain for this event where 0 = full reverb, -60 = no reverb. */ - FMOD_EVENTPROPERTY_ONESHOT, /* Type : int - Oneshot event - stops when no channels playing. 1 = yes, it's a oneshot 0 = no. it's not a oneshot. */ - FMOD_EVENTPROPERTY_FADEIN, /* Type : int - Time in milliseconds over which to fade this event in when programmer starts it. 0 = no fade in. Cannot be set while the event is playing. */ - FMOD_EVENTPROPERTY_FADEOUT, /* Type : int - Time in milliseconds over which to fade this event out when programmer stops it. 0 = no fade out. Cannot be set while the event is playing. */ - FMOD_EVENTPROPERTY_REVERBDRYLEVEL, /* Type : float - Dry reverb gain for this event where 0 = full dry, -60 = no dry. */ - FMOD_EVENTPROPERTY_TIMEOFFSET, /* Type : float - Time offset of sound start in seconds. */ - FMOD_EVENTPROPERTY_SPAWNINTENSITY, /* Type : float - Multiplier for spawn frequency of all sounds in this event. */ - FMOD_EVENTPROPERTY_SPAWNINTENSITY_RANDOMIZATION, /* Type : float - Random deviation in spawn intensity of event. */ - FMOD_EVENTPROPERTY_WII_CONTROLLERSPEAKERS, /* Type : int - Wii only. Use FMOD_WII_CONTROLLER flags defined in fmodwii.h to set which Wii Controller Speaker(s) to play this event on. */ - FMOD_EVENTPROPERTY_3D_POSRANDOMIZATION_MIN, /* Type : unsigned int - Minimum radius of random deviation in the 3D position of event. */ - FMOD_EVENTPROPERTY_3D_POSRANDOMIZATION_MAX, /* Type : unsigned int - Maximum radius of random deviation in the 3D position of event. */ - FMOD_EVENTPROPERTY_EVENTTYPE, /* Type : int - (Readonly) 0 = simple event, 1 = complex event */ - FMOD_EVENTPROPERTY_STEAL_PRIORITY, /* Type : int - 0 to 10000. How important this event is in relation to other events in the project. This event will never steal an event with a higher steal priority than this. */ - FMOD_EVENTPROPERTY_EFFECTS_AFFECT_REVERB, /* Type : int - 0 = default (no), 1 = yes. Alternate routing for reverb path of an event so it goes from the layer dsp unit instead of the channel. */ - FMOD_EVENTPROPERTY_WILL_TERMINATE, /* Type : int - (Readonly) 0 = no, 1 = yes, 2 = unknown (current event state is too complex). Whether this event will terminate (stop playing) by itself. If called on an event instance with this_instance = true, the prediction is based on the current state of that instance. This means parameter values, keyoffs etc. come into play. */ - FMOD_EVENTPROPERTY_DSPCLOCKSTART_HI, /* Type : unsigned int - High 32 bits of a 64 bit DSP clock value, for a start time for any sound in this event. */ - FMOD_EVENTPROPERTY_DSPCLOCKSTART_LO, /* Type : unsigned int - Low 32 bits of a 64 bit DSP clock value, for a start time for any sound in this event. */ - FMOD_EVENTPROPERTY_3D_AUTO_DISTANCE_FILTERING, /* Type : int - 0 = default (no), 1 = yes. Whether to automaically apply the distance effect to sounds in this event. */ - FMOD_EVENTPROPERTY_3D_AUTO_DISTANCE_CENTRE_FREQ, /* Type : float - 10 to 22050. The centre frequency for the distance effect.*/ - FMOD_EVENTPROPERTY_USER_BASE /* User created events start from here onwards. */ -} FMOD_EVENT_PROPERTY; - - -/* -[ENUM] -[ - [DESCRIPTION] - Event property types. - - [REMARKS] - - [PLATFORMS] - Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android - - [SEE_ALSO] - Event::getPropertyByIndex - Event::getPropertyInfo -] -*/ -typedef enum -{ - FMOD_EVENTPROPERTY_TYPE_INT = 0, /* Property is an int, unsigned int or other type of equivalent sizee e.g. FMOD_MODE. */ - FMOD_EVENTPROPERTY_TYPE_FLOAT, /* Property is a float. */ - FMOD_EVENTPROPERTY_TYPE_STRING /* Property is a char *. */ -} FMOD_EVENTPROPERTY_TYPE; - - -/* -[ENUM] -[ - [DESCRIPTION] - Pitch units for Event::setPitch and EventCategory::setPitch. - - [REMARKS] - - [PLATFORMS] - Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android - - [SEE_ALSO] - Event::setPitch - EventCategory::setPitch -] -*/ -typedef enum -{ - FMOD_EVENT_PITCHUNITS_RAW = 0, /* Pitch is specified in raw underlying units. */ - FMOD_EVENT_PITCHUNITS_OCTAVES, /* Pitch is specified in units of octaves. */ - FMOD_EVENT_PITCHUNITS_SEMITONES, /* Pitch is specified in units of semitones. */ - FMOD_EVENT_PITCHUNITS_TONES /* Pitch is specified in units of tones. */ -} FMOD_EVENT_PITCHUNITS; - - -/* -[ENUM] -[ - [DESCRIPTION] - Flags to pass to EventGroup::loadEventData to determine what to load at the time of calling. - - [REMARKS] - - [PLATFORMS] - Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android - - [SEE_ALSO] - EventGroup::loadEventData -] -*/ -typedef enum -{ - FMOD_EVENT_RESOURCE_STREAMS_AND_SAMPLES, /* Open all streams and load all banks into memory, under this group (recursive) */ - FMOD_EVENT_RESOURCE_STREAMS, /* Open all streams under this group (recursive). No samples are loaded. */ - FMOD_EVENT_RESOURCE_SAMPLES /* Load all banks into memory, under this group (recursive). No streams are opened. */ -} FMOD_EVENT_RESOURCE; - - -/* -[ENUM] -[ - [DESCRIPTION] - These callback types are used with FMOD_EVENT_CALLBACK. - - [REMARKS] - Note! Currently the user must call EventSystem::update for these callbacks to trigger!

- - When the event callback is called, 'param1' and 'param2' mean different things depending on the type of callback. Here is an explanation of what these parameters - mean in what context :

 

- - FMOD_EVENT_CALLBACKTYPE_SYNCPOINT -

- param1 = (char *) name of sync point
- param2 = (unsigned int) PCM offset of sync point.
-

- An FMOD_EVENT_CALLBACKTYPE_SYNCPOINT callback is generated from 'markers' embedded in .wav files. - These can be created by placing 'markers' in the original source wavs using a tool such as Sound Forge or Cooledit. - The wavs are then compiled into .FSB files when compiling the audio data using the FMOD designer tool. - Callbacks will be automatically generated at the correct place in the timeline when these markers are encountered - which makes it useful for synchronization, lip syncing etc. -

 

- - FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_START -

- param1 = (char *) name of sound definition being started
- param2 = (int) index of wave being started inside sound definition (ie for multi wave sound definitions)
-

- An FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_START callback is generated each time a sound definition is played in an event. - This happens every time a sound definition starts due to the event parameter entering the region specified in the - layer created by the sound designer. - This also happens when sounds are randomly respawned using the random respawn feature in the sound definition - properties in FMOD designer. -

 

- - FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_END -

- param1 = (char *) name of sound definition being stopped
- param2 = (int) index of wave being stopped inside sound definition (ie for multi wave sound definitions)
-

- An FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_END callback is generated when a one-shot sound definition inside an event ends, - or when a looping sound definition stops due to the event parameter leaving the region specified in the layer created - by the sound designer. -

 

- - FMOD_EVENT_CALLBACKTYPE_STOLEN -

- param1 = 0
- param2 = 0
-

- An FMOD_EVENT_CALLBACKTYPE_STOLEN callback is generated when a getEventXXX call needs to steal an event instance that is in use because - the event's "Max playbacks" has been exceeded. This callback is called before the event is stolen and before the event - is stopped (if it is playing). An FMOD_EVENT_CALLBACKTYPE_EVENTFINISHED callback will be generated when the stolen event is stopped i.e. after - the FMOD_EVENT_CALLBACKTYPE_STOLEN. If the callback function returns FMOD_ERR_EVENT_FAILED, the event will not - be stolen, and the returned value will be passed back as the return value of the getEventXXX call that triggered the steal attempt. -

 

- - FMOD_EVENT_CALLBACKTYPE_EVENTFINISHED -

- param1 = 0
- param2 = 0
-

- An FMOD_EVENT_CALLBACKTYPE_EVENTFINISHED callback is generated whenever an event is stopped for any reason including when the user - calls Event::stop(). -

 

- - FMOD_EVENT_CALLBACKTYPE_NET_MODIFIED -

- param1 = (FMOD_EVENT_PROPERTY) which property was modified
- param2 = (float) the new property value
-

- An FMOD_EVENT_CALLBACKTYPE_NET_MODIFIED callback is generated when someone has connected to your running application with - FMOD Designer and changed a property within this event, for example volume or pitch. -

 

- - FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_CREATE -

- param1 = (char *) name of sound definition
- param2 [in] = (int *) pointer to index of sound definition entry
- param2 [out] = (FMOD::Sound **) pointer to a valid lower level API FMOD Sound handle
-

- An FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_CREATE callback is generated when a "programmer" sound needs to be loaded. -

 

- - FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_RELEASE -

- param1 = (char *) name of sound definition
- param2 = (FMOD::Sound *) the FMOD sound handle that was previously created in FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_CREATE
-

- An FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_RELEASE callback is generated when a "programmer" sound needs to be unloaded. -

 

- - FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_INFO -

- param1 = (char *) name of sound definition
- param2 = (FMOD::Sound *) the FMOD sound handle that FMOD will use for this sound definition
-

- An FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_INFO callback is generated when a sound definition is loaded. It can be used to find - information about the specific sound that will be played. -

 

- - FMOD_EVENT_CALLBACKTYPE_EVENTSTARTED -

- param1 = 0
- param2 = 0
-

- An FMOD_EVENT_CALLBACKTYPE_EVENTSTARTED callback is generated whenever an event is started. This callback will be called before any sounds in the event have begun to play. -

 

- - FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_SELECTINDEX -

- param1 = (char *) name of sound definition if FMOD_EVENT_INIT_DETAILED_SOUNDDEF_INFO was not specified
- param1 = (FMOD_EVENT_SOUNDDEFINFO *) sound definition info struct if FMOD_EVENT_INIT_DETAILED_SOUNDDEF_INFO was specified
- param2 [in] = (int *) pointer to number of entries in this sound definition
- *param2 [out] = (int) index of sound definition entry to select
-

- An FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_SELECTINDEX callback is generated when a sound definition entry needs to be chosen from a "ProgrammerSelected" sound definition. -

 

- - FMOD_EVENT_CALLBACKTYPE_OCCLUSION -

- param1 = (float *) pointer to a floating point direct value that can be read and modified after the geometry engine has calculated it for this event's channel.
- param2 = (float *) pointer to a floating point reverb value that can be read and modified after the geometry engine has calculated it for this event's channel.
-

- An FMOD_EVENT_CALLBACKTYPE_OCCLUSION callback is generated whenever an channel has its occlusion updated via the geometry system. -

 

- - [PLATFORMS] - Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android - - [SEE_ALSO] - Event::setCallback - FMOD_EVENT_CALLBACK - FMOD_EVENT_SOUNDDEFINFO - FMOD_EVENT_INITFLAGS - EventSystem::update -] -*/ -typedef enum -{ - FMOD_EVENT_CALLBACKTYPE_SYNCPOINT, /* Called when a syncpoint is encountered. Can be from wav file markers. */ - FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_START, /* Called when a sound definition inside an event is triggered. */ - FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_END, /* Called when a sound definition inside an event ends or is stopped. */ - FMOD_EVENT_CALLBACKTYPE_STOLEN, /* Called when a getEventXXX call steals an event instance that is in use. */ - FMOD_EVENT_CALLBACKTYPE_EVENTFINISHED, /* Called when an event is stopped for any reason. */ - FMOD_EVENT_CALLBACKTYPE_NET_MODIFIED, /* Called when a property of the event has been modified by a network-connected host. */ - FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_CREATE, /* Called when a programmer sound definition entry is loaded. */ - FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_RELEASE, /* Called when a programmer sound definition entry is unloaded. */ - FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_INFO, /* Called when a sound definition entry is loaded. */ - FMOD_EVENT_CALLBACKTYPE_EVENTSTARTED, /* Called when an event is started. */ - FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_SELECTINDEX, /* Called when a sound definition entry needs to be chosen from a "ProgrammerSelected" sound definition. */ - FMOD_EVENT_CALLBACKTYPE_OCCLUSION /* Called when an event's channel is occluded with the geometry engine. */ -} FMOD_EVENT_CALLBACKTYPE; - - -/* -[STRUCTURE] -[ - [DESCRIPTION] - Structure containing realtime information about a wavebank. - - [REMARKS] - - [PLATFORMS] - Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android - - [SEE_ALSO] - EventSystem::getInfo - FMOD_EVENT_SYSTEMINFO -] -*/ -typedef struct FMOD_EVENT_WAVEBANKINFO -{ - char name[256]; /* [out] Name of this wave bank. */ - int streamrefcnt; /* [out] Number of stream references to this wave bank made by events in this event system. */ - int samplerefcnt; /* [out] Number of sample references to this wave bank made by events in this event system. */ - int numstreams; /* [out] Number of times this wave bank has been opened for streaming. */ - int maxstreams; /* [out] Maximum number of times this wave bank will be opened for streaming. */ - int streamsinuse; /* [out] Number of streams currently in use. */ - unsigned int streammemory; /* [out] Amount of memory (in bytes) used by streams. */ - unsigned int samplememory; /* [out] Amount of memory (in bytes) used by samples. */ - int type; /* [out] 0 = stream from disk, 1 = load into memory, 2 = decompress into memory. */ -} FMOD_EVENT_WAVEBANKINFO; - - -/* -[STRUCTURE] -[ - [DESCRIPTION] - Structure containing realtime information about an event system. - - [REMARKS] - On entry, numplayingevents should be set to the number of elements in the playingevents array. If the actual - number of playing events is greater than numplayingevents then the playingevents array will be filled with - numplayingevents entries and numplayingevents will be set to the actual number of playing events on exit. - In short, if numplayingevents on exit > numplayingevents on entry then the playingevents array wasn't large - enough and some events were unable to be added to the array. - - [PLATFORMS] - Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android - - [SEE_ALSO] - EventSystem::getInfo - EventProject::getInfo - FMOD_EVENT_WAVEBANKINFO -] -*/ -typedef struct FMOD_EVENT_SYSTEMINFO -{ -#ifdef __cplusplus - FMOD_EVENT_SYSTEMINFO() : numevents(0), numinstances(0), maxwavebanks(0), wavebankinfo(0), numplayingevents(0), playingevents(0) {} -#endif - - int numevents; /* [out] Total number of events in all event groups in this event system. */ - int numinstances; /* [out] Total number of event instances in all event groups in this event system. */ - int maxwavebanks; /* [in/out] Out, number of wavebanks loaded by the EventSystem. In. Maximum size of array of wavebankinfo structures supplied by user. Optional. */ - FMOD_EVENT_WAVEBANKINFO *wavebankinfo; /* [in] Pointer to array FMOD_EVENT_WAVEBANKINFO structures (max size defined by maxwavebanks). FMOD will fill these in with detailed information on each wave bank. Optional. */ - int numplayingevents; /* [in/out] On entry, maximum number of entries in playingevents array. On exit, actual number of entries in playingevents array, or if playingevents is null, then it is just the number of currently playing events. Optional. */ - FMOD_EVENT **playingevents; /* [in/out] Pointer to an array that will be filled with the event handles of all playing events. Optional. Specify 0 if not needed. Must be used in conjunction with numplayingevents. */ - int numloadsqueued[5]; /* [out] Current number of sound banks queued for loading due to using FMOD_EVENT_NONBLOCKING flag. Note there are 5 because there are 5 possible loading threads. Add all values together for total. */ -} FMOD_EVENT_SYSTEMINFO; - - - -/* -[STRUCTURE] -[ - [DESCRIPTION] - Structure containing realtime information about an event project. - - [REMARKS] - On entry, numplayingevents should be set to the number of elements in the playingevents array. If the actual - number of playing events is greater than numplayingevents then the playingevents array will be filled with - numplayingevents entries and numplayingevents will be set to the actual number of playing events on exit. - In short, if numplayingevents on exit > numplayingevents on entry then the playingevents array wasn't large - enough and some events were unable to be added to the array. - - [PLATFORMS] - Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android - - [SEE_ALSO] - EventProject::getInfo - EventSystem::getInfo - FMOD_EVENT_WAVEBANKINFO -] -*/ -typedef struct FMOD_EVENT_PROJECTINFO -{ -#ifdef __cplusplus - FMOD_EVENT_PROJECTINFO() : index(0), numevents(0), numinstances(0), maxwavebanks(0), wavebankinfo(0), numplayingevents(0), playingevents(0) {} -#endif - - int index; /* [out] Index of the project. */ - char name[256]; /* [out] Name of the project. */ - int numevents; /* [out] Total number of events in all event groups in this event project. */ - int numinstances; /* [out] Total number of event instances in all event groups in this event project. */ - int maxwavebanks; /* [in/out] Out, number of wavebanks loaded by the EventProject. In. Maximum size of array of wavebankinfo structures supplied by user. Optional. */ - FMOD_EVENT_WAVEBANKINFO *wavebankinfo; /* [in] Pointer to array FMOD_EVENT_WAVEBANKINFO structures (max size defined by maxwavebanks). FMOD will fill these in with detailed information on each wave bank. Optional. */ - int numplayingevents; /* [in/out] On entry, maximum number of entries in playingevents array. On exit, actual number of entries in playingevents array, or if playingevents is null, then it is just the number of currently playing events. Optional. */ - FMOD_EVENT **playingevents; /* [in/out] Pointer to an array that will be filled with the event handles of all playing events. Optional. Specify 0 if not needed. Must be used in conjunction with numplayingevents. */ - -} FMOD_EVENT_PROJECTINFO; - - -/* -[STRUCTURE] -[ - [DESCRIPTION] - Structure containing extended information about an event. - - [REMARKS] - This structure is optional! Specify 0 or NULL in Event::getInfo if you don't need it!
- This structure has members that need to be initialized before Event::getInfo is called. Always initialize this structure before calling Event::getInfo! - - [PLATFORMS] - Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android - - [SEE_ALSO] - Event::getInfo - FMOD_GUID -] -*/ -typedef struct FMOD_EVENT_INFO -{ -#ifdef __cplusplus - FMOD_EVENT_INFO() : memoryused(0), positionms(0), lengthms(0), channelsplaying(0), instancesactive(0), maxwavebanks(0), wavebankinfo(0), projectid(0), systemid(0), audibility(0), numinstances(0), instances(0), guid(0) {} -#endif - - int memoryused; /* This member has been deprecated. */ - int positionms; /* [out] Time passed in playback of this event instance in milliseconds. */ - int lengthms; /* [out] Length in milliseconds of this event. Note: lengthms will be -1 if the length of the event can't be determined i.e. if it has looping sounds. */ - int channelsplaying; /* [out] Number of channels currently playing in this event instance. */ - int instancesactive; /* [out] Number of event instances currently in use. */ - int maxwavebanks; /* [in/out] Out, number of wavebanks refered to by this event. In. Maximum size of array of wavebankinfo structures supplied by user. Optional. */ - FMOD_EVENT_WAVEBANKINFO *wavebankinfo; /* [in] Pointer to array FMOD_EVENT_WAVEBANKINFO structures (max size defined by maxwavebanks). FMOD will fill these in with detailed information on each wave bank. Optional. */ - unsigned int projectid; /* [out] The runtime 'EventProject' wide unique identifier for this event. */ - unsigned int systemid; /* [out] The runtime 'EventSystem' wide unique identifier for this event. This is calculated when single or multiple projects are loaded. */ - float audibility; /* [out] current audibility of event. */ - int numinstances; /* [in/out] On entry, maximum number of entries in instances array. On exit, actual number of entries in instances array, or if instances is null, then it is just the number of instances of this event. Optional. */ - FMOD_EVENT **instances; /* [in/out] Pointer to an array that will be filled with the current reference-counted event handles of all instances of this event. Optional. Specify 0 if not needed. Must be used in conjunction with numinstances. Note: Due to reference counting, the event instance handles returned here may be different between subsequent calls to this function. If you use these event handles, make sure your code is prepared for them to be invalid! */ - FMOD_GUID *guid; /* [out] Pointer to a structure that will be filled with the event's GUID. Optional. Specify 0 if not needed. */ - -} FMOD_EVENT_INFO; - - -/* -[ENUM] -[ - [DESCRIPTION] - Sound definition entry types for FMOD_EVENT_SOUNDDEFINFO. - - [REMARKS] - - [PLATFORMS] - Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android - - [SEE_ALSO] - FMOD_EVENT_SOUNDDEFINFO - FMOD_EVENT_CALLBACK - FMOD_EVENT_CALLBACKTYPE -] -*/ -typedef enum -{ - FMOD_EVENT_SOUNDDEF_ENTRYTYPE_WAVETABLE, /* Waveform. */ - FMOD_EVENT_SOUNDDEF_ENTRYTYPE_OSCILLATOR, /* Oscillator. */ - FMOD_EVENT_SOUNDDEF_ENTRYTYPE_NULL, /* "Don't play" entry. */ - FMOD_EVENT_SOUNDDEF_ENTRYTYPE_PROGRAMMER /* Programmer sound. */ -} FMOD_EVENT_SOUNDDEF_ENTRYTYPE; - - -/* -[STRUCTURE] -[ - [DESCRIPTION] - Structure containing information about a sound definition. - - [REMARKS] - This structure is passed as the param1 argument of all - FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_SELECTINDEX callbacks if - FMOD_EVENT_INIT_DETAILED_SOUNDDEF_INFO was passed to EventSystem::init. - - [PLATFORMS] - Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android - - [SEE_ALSO] - FMOD_EVENT_CALLBACK - FMOD_EVENT_CALLBACKTYPE - EventSystem::init - FMOD_EVENT_INITFLAGS - FMOD_EVENT_SOUNDDEF_ENTRYTYPE -] -*/ -typedef struct FMOD_EVENT_SOUNDDEFINFO -{ -#ifdef __cplusplus - FMOD_EVENT_SOUNDDEFINFO() : name(0), numentries(0), entrynames(0), entrytypes(0) {} -#endif - - char *name; /* The name of the sound definition. */ - int numentries; /* The number of entries in the sound definition. */ - const char **entrynames; /* The names of the entries in the sound definition (an array of size numentries). Note that entrynames[i] will be null if entrytypes[i] is not FMOD_EVENT_SOUNDDEF_ENTRYTYPE_WAVETABLE. */ - FMOD_EVENT_SOUNDDEF_ENTRYTYPE *entrytypes; /* The types of the entries in the sound definition (an array of size numentries). */ - -} FMOD_EVENT_SOUNDDEFINFO; - - -/* -[STRUCTURE] -[ - [DESCRIPTION] - Use this structure with EventSystem::load when more control is needed over loading. - - [REMARKS] - This structure is optional! Specify 0 or NULL in EventSystem::load if you don't need it!
-
- Members marked with [in] mean the user sets the value before passing it to the function.
- Members marked with [out] mean FMOD sets the value to be used after the function exits.
- Use sounddefentrylimit to limit the number of sound definition entries - and therefore the amount of wave data - loaded for each sound definition. This feature allows the programmer to implement a "low detail" setting at runtime without needing a seperate "low detail" set of assets. - - [PLATFORMS] - Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android - - [SEE_ALSO] - EventSystem::load -] -*/ -typedef struct FMOD_EVENT_LOADINFO -{ -#ifdef __cplusplus - FMOD_EVENT_LOADINFO() : size(0), encryptionkey(0), sounddefentrylimit(0), loadfrommemory_length(0), override_category_vals(0), sizeof_instancepool_simple(0) {} -#endif - - unsigned int size; /* [in] Size of this structure. This is used so the structure can be expanded in the future and still work on older versions of FMOD Ex. */ - char *encryptionkey; /* [in] Optional. Specify 0 to ignore. Key, or 'password' to decrypt a bank. A sound designer may have encrypted the audio data to protect their sound data from 'rippers'. */ - float sounddefentrylimit; /* [in] Optional. Specify 0 to ignore. A value between 0 -> 1 that is multiplied with the number of sound definition entries in each sound definition in the project being loaded in order to programmatically reduce the number of sound definition entries used at runtime. */ - unsigned int loadfrommemory_length; /* [in] Optional. Specify 0 to ignore. Length of memory buffer pointed to by name_or_data parameter passed to EventSystem::load. If this field is non-zero then the name_or_data parameter passed to EventSystem::load will be interpreted as a pointer to a memory buffer containing the .fev data to load. If this field is zero the name_or_data parameter is interpreted as the filename of the .fev file to load. */ - FMOD_BOOL override_category_vals; /* [in] Optional. If this member is set to true, newly-loaded categories will impart their properties (volume, pitch etc.) to existing categories of the same name. */ - unsigned int sizeof_instancepool_simple; /* [in] Optional. Specify 0 to ignore. If this value is non-zero, FMOD will create an instance pool for simple events with "sizeof_instancepool_simple" entries. Note: Event instance pools currently work for simple events only. Complex events will behave as normal and not be pooled. */ - -} FMOD_EVENT_LOADINFO; - - -typedef FMOD_RESULT (F_CALLBACK *FMOD_EVENT_CALLBACK) (FMOD_EVENT *event, FMOD_EVENT_CALLBACKTYPE type, void *param1, void *param2, void *userdata); - - -/* -[ENUM] -[ - [DESCRIPTION] - These callback types are used with FMOD_EVENTQUEUE_CALLBACK. - - [REMARKS] - Note! Currently the user must call EventSystem::update for these callbacks to trigger!

- - [PLATFORMS] - Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android - - [SEE_ALSO] - EventQueue::setCallback - FMOD_EVENTQUEUE_CALLBACK - EventSystem::update -] -*/ -typedef enum -{ - FMOD_EVENTQUEUE_CALLBACKTYPE_PREPARE, /* Called when an entry is being prepared for playback */ - FMOD_EVENTQUEUE_CALLBACKTYPE_ABOUTTOPLAY, /* Called when an entry is about to play */ - FMOD_EVENTQUEUE_CALLBACKTYPE_FINISHED, /* Called when an entry has finished playing */ - FMOD_EVENTQUEUE_CALLBACKTYPE_EXPIRED /* Called when an entry has expired before being played. See EventQueueEntry::setExpiryTime */ - -} FMOD_EVENTQUEUE_CALLBACKTYPE; - - -typedef FMOD_RESULT (F_CALLBACK *FMOD_EVENTQUEUE_CALLBACK)(FMOD_EVENTQUEUE_CALLBACKTYPE type, FMOD_EVENTQUEUE *queue, FMOD_EVENTQUEUEENTRY *entry, void *callbackuserdata); - - -/* -[STRUCTURE] -[ - [DESCRIPTION] - Structure containing realtime information about the music system. - - [REMARKS] - - [PLATFORMS] - Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android - - [SEE_ALSO] - MusicSystem::getInfo -] -*/ -typedef struct FMOD_MUSIC_INFO -{ - FMOD_BOOL starving; /* [out] True if any streams in the music system are starving. */ - FMOD_BOOL all_samples_loaded; /* [out] True if all non-streaming samples in the music system are loaded, false otherwise. */ -} FMOD_MUSIC_INFO; - - -/* -[STRUCTURE] -[ - [DESCRIPTION] - Structure used to hold information about music system entites. - - [REMARKS] - - [PLATFORMS] - Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android - - [SEE_ALSO] - FMOD_MUSIC_ITERATOR -] -*/ -typedef struct FMOD_MUSIC_ENTITY -{ - const char* name; /* The name of the music entity as a null terminated string. */ - FMOD_MUSIC_ID id; /* The ID of the music entity. */ -} FMOD_MUSIC_ENTITY; - - -/* -[STRUCTURE] -[ - [DESCRIPTION] - Structure used to enumerate entities in the music system. - - [REMARKS] - The music system provides methods to initialize and advance iterators. Iterator members should never need to be set manually. - - [PLATFORMS] - Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android - - [SEE_ALSO] - FMOD_MUSIC_ENTITY - MusicSystem::getCues - MusicSystem::getParameters -] -*/ -typedef struct FMOD_MUSIC_ITERATOR -{ - const FMOD_MUSIC_ENTITY* value; /* The music entity the iterator points to. A null value indicates an invalid iterator. */ - const char* filter; /* The string used to filter music entities. */ -} FMOD_MUSIC_ITERATOR; - - -/* -[STRUCTURE] -[ - [DESCRIPTION] - Structure containing information about a music sample, for use with - FMOD_MUSIC_CALLBACKTYPE_SEGMENT_CREATE and FMOD_MUSIC_CALLBACKTYPE_SEGMENT_RELEASE. - - [REMARKS] - - [PLATFORMS] - Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android - - [SEE_ALSO] - FMOD_MUSIC_CALLBACK - FMOD_MUSIC_CALLBACKTYPE -] -*/ -typedef struct FMOD_MUSIC_SAMPLE_INFO -{ - unsigned int segment_id; /* The ID of the parent segment. */ - unsigned int index; /* The index of the sample within the parent segment. */ - const char *filename; /* The filename of the sample.
Note: If the sample was built by a version of FMOD Designer before 4.29.09, this field will be 0. */ -} FMOD_MUSIC_SAMPLE_INFO; - - -/* -[STRUCTURE] -[ - [DESCRIPTION] - Structure containing information about a music segment, for use with - FMOD_MUSIC_CALLBACKTYPE_CHANNEL_CREATED and FMOD_MUSIC_CALLBACKTYPE_CHANNEL_DESTROYED. - - [REMARKS] - - [PLATFORMS] - Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android - - [SEE_ALSO] - FMOD_MUSIC_CALLBACK - FMOD_MUSIC_CALLBACKTYPE -] -*/ -typedef struct FMOD_MUSIC_SEGMENT_INFO -{ - unsigned int segment_id; /* The ID of the segment. */ - unsigned int theme_id; /* The ID of the parent theme. */ -} FMOD_MUSIC_SEGMENT_INFO; - - -/* -[ENUM] -[ - [DESCRIPTION] - These callback types are used with FMOD_MUSIC_CALLBACK. - - [REMARKS] - Note! Currently the user must call EventSystem::update for these callbacks to trigger!
- - [PLATFORMS] - Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android - - [SEE_ALSO] - MusicSystem::setCallback - FMOD_MUSIC_CALLBACK - EventSystem::update -] -*/ -typedef enum -{ - FMOD_MUSIC_CALLBACKTYPE_SEGMENT_START, /* Called when a segment is started. */ - FMOD_MUSIC_CALLBACKTYPE_SEGMENT_END, /* Called when a segment ends. */ - FMOD_MUSIC_CALLBACKTYPE_SAMPLE_CREATE, /* Called when a segment needs a sound created. */ - FMOD_MUSIC_CALLBACKTYPE_SAMPLE_RELEASE, /* Called when a segment is finished with a sound. */ - FMOD_MUSIC_CALLBACKTYPE_CHANNEL_CREATED, /* Called when a channel is created to play a segment. */ - FMOD_MUSIC_CALLBACKTYPE_CHANNEL_DESTROYED, /* Called when a segment channel is destroyed. */ - FMOD_MUSIC_CALLBACKTYPE_RESET, /* Called when the system is reset */ - FMOD_MUSIC_CALLBACKTYPE_BEAT /* Called each time a beat is passed (based on segment tempo and time signature) */ -} FMOD_MUSIC_CALLBACKTYPE; - - -typedef FMOD_RESULT (F_CALLBACK *FMOD_MUSIC_CALLBACK) (FMOD_MUSIC_CALLBACKTYPE type, void *param1, void *param2, void *userdata); - - -/* ========================================================================================== */ -/* FUNCTION PROTOTYPES */ -/* ========================================================================================== */ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* - FMOD EventSystem factory functions. Use this to create an FMOD EventSystem Instance. Below you will see FMOD_EventSystem_Init/Release to get started. -*/ - -FMOD_RESULT F_API FMOD_EventSystem_Create(FMOD_EVENTSYSTEM **eventsystem); - -/*$ preserve end $*/ - -/* - 'EventSystem' API -*/ - -/* - Initialization / system functions. -*/ - -FMOD_RESULT F_API FMOD_EventSystem_Init (FMOD_EVENTSYSTEM *eventsystem, int maxchannels, FMOD_INITFLAGS flags, void *extradriverdata, FMOD_EVENT_INITFLAGS eventflags); -FMOD_RESULT F_API FMOD_EventSystem_Release (FMOD_EVENTSYSTEM *eventsystem); -FMOD_RESULT F_API FMOD_EventSystem_Update (FMOD_EVENTSYSTEM *eventsystem); -FMOD_RESULT F_API FMOD_EventSystem_SetMediaPath (FMOD_EVENTSYSTEM *eventsystem, const char *path); -FMOD_RESULT F_API FMOD_EventSystem_SetPluginPath (FMOD_EVENTSYSTEM *eventsystem, const char *path); -FMOD_RESULT F_API FMOD_EventSystem_GetVersion (FMOD_EVENTSYSTEM *eventsystem, unsigned int *version); -FMOD_RESULT F_API FMOD_EventSystem_GetInfo (FMOD_EVENTSYSTEM *eventsystem, FMOD_EVENT_SYSTEMINFO *info); -FMOD_RESULT F_API FMOD_EventSystem_GetSystemObject (FMOD_EVENTSYSTEM *eventsystem, FMOD_SYSTEM **system); -FMOD_RESULT F_API FMOD_EventSystem_GetMusicSystem (FMOD_EVENTSYSTEM *eventsystem, FMOD_MUSICSYSTEM **musicsystem); -FMOD_RESULT F_API FMOD_EventSystem_SetLanguage (FMOD_EVENTSYSTEM *eventsystem, const char *language); -FMOD_RESULT F_API FMOD_EventSystem_GetLanguage (FMOD_EVENTSYSTEM *eventsystem, char *language); - -/* - FEV load/unload. -*/ - -FMOD_RESULT F_API FMOD_EventSystem_Load (FMOD_EVENTSYSTEM *eventsystem, const char *name_or_data, FMOD_EVENT_LOADINFO *loadinfo, FMOD_EVENTPROJECT **project); -FMOD_RESULT F_API FMOD_EventSystem_Unload (FMOD_EVENTSYSTEM *eventsystem); - -/* - Event,EventGroup,EventCategory Retrieval. -*/ - -FMOD_RESULT F_API FMOD_EventSystem_GetProject (FMOD_EVENTSYSTEM *eventsystem, const char *name, FMOD_EVENTPROJECT **project); -FMOD_RESULT F_API FMOD_EventSystem_GetProjectByIndex (FMOD_EVENTSYSTEM *eventsystem, int index, FMOD_EVENTPROJECT **project); -FMOD_RESULT F_API FMOD_EventSystem_GetNumProjects (FMOD_EVENTSYSTEM *eventsystem, int *numprojects); -FMOD_RESULT F_API FMOD_EventSystem_GetCategory (FMOD_EVENTSYSTEM *eventsystem, const char *name, FMOD_EVENTCATEGORY **category); -FMOD_RESULT F_API FMOD_EventSystem_GetCategoryByIndex(FMOD_EVENTSYSTEM *eventsystem, int index, FMOD_EVENTCATEGORY **category); -FMOD_RESULT F_API FMOD_EventSystem_GetMusicCategory (FMOD_EVENTSYSTEM *eventsystem, FMOD_EVENTCATEGORY **category); -FMOD_RESULT F_API FMOD_EventSystem_GetNumCategories (FMOD_EVENTSYSTEM *eventsystem, int *numcategories); -FMOD_RESULT F_API FMOD_EventSystem_GetGroup (FMOD_EVENTSYSTEM *eventsystem, const char *name, FMOD_BOOL cacheevents, FMOD_EVENTGROUP **group); -FMOD_RESULT F_API FMOD_EventSystem_GetEvent (FMOD_EVENTSYSTEM *eventsystem, const char *name, FMOD_EVENT_MODE mode, FMOD_EVENT **event); -FMOD_RESULT F_API FMOD_EventSystem_GetEventBySystemID(FMOD_EVENTSYSTEM *eventsystem, unsigned int systemid, FMOD_EVENT_MODE mode, FMOD_EVENT **event); -FMOD_RESULT F_API FMOD_EventSystem_GetEventByGUID (FMOD_EVENTSYSTEM *eventsystem, const FMOD_GUID *guid, FMOD_EVENT_MODE mode, FMOD_EVENT **event); -FMOD_RESULT F_API FMOD_EventSystem_GetEventByGUIDString(FMOD_EVENTSYSTEM *eventsystem, const char *guid, FMOD_EVENT_MODE mode, FMOD_EVENT **event); -FMOD_RESULT F_API FMOD_EventSystem_GetNumEvents (FMOD_EVENTSYSTEM *eventsystem, int *numevents); - -/* - Reverb interfaces. -*/ - -FMOD_RESULT F_API FMOD_EventSystem_SetReverbProperties(FMOD_EVENTSYSTEM *eventsystem, const FMOD_REVERB_PROPERTIES *props); -FMOD_RESULT F_API FMOD_EventSystem_GetReverbProperties(FMOD_EVENTSYSTEM *eventsystem, FMOD_REVERB_PROPERTIES *props); - -FMOD_RESULT F_API FMOD_EventSystem_GetReverbPreset (FMOD_EVENTSYSTEM *eventsystem, const char *name, FMOD_REVERB_PROPERTIES *props, int *index); -FMOD_RESULT F_API FMOD_EventSystem_GetReverbPresetByIndex(FMOD_EVENTSYSTEM *eventsystem, const int index, FMOD_REVERB_PROPERTIES *props, char **name); -FMOD_RESULT F_API FMOD_EventSystem_GetNumReverbPresets(FMOD_EVENTSYSTEM *eventsystem, int *numpresets); - -FMOD_RESULT F_API FMOD_EventSystem_CreateReverb (FMOD_EVENTSYSTEM *eventsystem, FMOD_EVENTREVERB **reverb); -FMOD_RESULT F_API FMOD_EventSystem_SetReverbAmbientProperties(FMOD_EVENTSYSTEM *eventsystem, FMOD_REVERB_PROPERTIES *props); -FMOD_RESULT F_API FMOD_EventSystem_GetReverbAmbientProperties(FMOD_EVENTSYSTEM *eventsystem, FMOD_REVERB_PROPERTIES *props); - -/* - Event queue interfaces. -*/ - -FMOD_RESULT F_API FMOD_EventSystem_CreateEventQueue (FMOD_EVENTSYSTEM *eventsystem, FMOD_EVENTQUEUE **queue); -FMOD_RESULT F_API FMOD_EventSystem_CreateEventQueueEntry(FMOD_EVENTSYSTEM *eventsystem, FMOD_EVENT *event, FMOD_EVENTQUEUEENTRY **entry); - -/* - 3D Listener interface. -*/ - -FMOD_RESULT F_API FMOD_EventSystem_Set3DNumListeners (FMOD_EVENTSYSTEM *eventsystem, int numlisteners); -FMOD_RESULT F_API FMOD_EventSystem_Get3DNumListeners (FMOD_EVENTSYSTEM *eventsystem, int *numlisteners); -FMOD_RESULT F_API FMOD_EventSystem_Set3DListenerAttributes(FMOD_EVENTSYSTEM *eventsystem, int listener, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel, const FMOD_VECTOR *forward, const FMOD_VECTOR *up); -FMOD_RESULT F_API FMOD_EventSystem_Get3DListenerAttributes(FMOD_EVENTSYSTEM *eventsystem, int listener, FMOD_VECTOR *pos, FMOD_VECTOR *vel, FMOD_VECTOR *forward, FMOD_VECTOR *up); - -/* - Get/set user data -*/ - -FMOD_RESULT F_API FMOD_EventSystem_SetUserData (FMOD_EVENTSYSTEM *eventsystem, void *userdata); -FMOD_RESULT F_API FMOD_EventSystem_GetUserData (FMOD_EVENTSYSTEM *eventsystem, void **userdata); - -/* - Pre-loading FSB files (from disk or from memory, use FMOD_OPENMEMORY_POINT to point to pre-loaded memory). -*/ - -FMOD_RESULT F_API FMOD_EventSystem_PreloadFSB (FMOD_EVENTSYSTEM *eventsystem, const char *filename, int streaminstance, FMOD_SOUND *sound); -FMOD_RESULT F_API FMOD_EventSystem_UnloadFSB (FMOD_EVENTSYSTEM *eventsystem, const char *filename, int streaminstance); - -FMOD_RESULT F_API FMOD_EventSystem_GetMemoryInfo (FMOD_EVENTSYSTEM *eventsystem, unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details); - -/* - 'EventProject' API -*/ - -FMOD_RESULT F_API FMOD_EventProject_Release (FMOD_EVENTPROJECT *eventproject); -FMOD_RESULT F_API FMOD_EventProject_GetInfo (FMOD_EVENTPROJECT *eventproject, FMOD_EVENT_PROJECTINFO *info); -FMOD_RESULT F_API FMOD_EventProject_GetGroup (FMOD_EVENTPROJECT *eventproject, const char *name, FMOD_BOOL cacheevents, FMOD_EVENTGROUP **group); -FMOD_RESULT F_API FMOD_EventProject_GetGroupByIndex (FMOD_EVENTPROJECT *eventproject, int index, FMOD_BOOL cacheevents, FMOD_EVENTGROUP **group); -FMOD_RESULT F_API FMOD_EventProject_GetNumGroups (FMOD_EVENTPROJECT *eventproject, int *numgroups); -FMOD_RESULT F_API FMOD_EventProject_GetEvent (FMOD_EVENTPROJECT *eventproject, const char *name, FMOD_EVENT_MODE mode, FMOD_EVENT **event); -FMOD_RESULT F_API FMOD_EventProject_GetEventByProjectID(FMOD_EVENTPROJECT *eventproject, unsigned int projectid, FMOD_EVENT_MODE mode, FMOD_EVENT **event); -FMOD_RESULT F_API FMOD_EventProject_GetNumEvents (FMOD_EVENTPROJECT *eventproject, int *numevents); -FMOD_RESULT F_API FMOD_EventProject_LoadSampleData (FMOD_EVENTPROJECT *eventproject, int *eventid_array, int sizeof_eventid_array, char **groupname_array, int sizeof_groupname_array, FMOD_EVENT_MODE eventmode); -FMOD_RESULT F_API FMOD_EventProject_StopAllEvents (FMOD_EVENTPROJECT *eventproject, FMOD_BOOL immediate); -FMOD_RESULT F_API FMOD_EventProject_CancelAllLoads (FMOD_EVENTPROJECT *eventproject); -FMOD_RESULT F_API FMOD_EventProject_SetUserData (FMOD_EVENTPROJECT *eventproject, void *userdata); -FMOD_RESULT F_API FMOD_EventProject_GetUserData (FMOD_EVENTPROJECT *eventproject, void **userdata); - -FMOD_RESULT F_API FMOD_EventProject_GetMemoryInfo (FMOD_EVENTPROJECT *eventproject, unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details); - -/* - 'EventGroup' API -*/ - -FMOD_RESULT F_API FMOD_EventGroup_GetInfo (FMOD_EVENTGROUP *eventgroup, int *index, char **name); -FMOD_RESULT F_API FMOD_EventGroup_LoadEventData (FMOD_EVENTGROUP *eventgroup, FMOD_EVENT_RESOURCE resource, FMOD_EVENT_MODE mode); -FMOD_RESULT F_API FMOD_EventGroup_FreeEventData (FMOD_EVENTGROUP *eventgroup, FMOD_EVENT *event, FMOD_BOOL waituntilready); -FMOD_RESULT F_API FMOD_EventGroup_GetGroup (FMOD_EVENTGROUP *eventgroup, const char *name, FMOD_BOOL cacheevents, FMOD_EVENTGROUP **group); -FMOD_RESULT F_API FMOD_EventGroup_GetGroupByIndex (FMOD_EVENTGROUP *eventgroup, int index, FMOD_BOOL cacheevents, FMOD_EVENTGROUP **group); -FMOD_RESULT F_API FMOD_EventGroup_GetParentGroup (FMOD_EVENTGROUP *eventgroup, FMOD_EVENTGROUP **group); -FMOD_RESULT F_API FMOD_EventGroup_GetParentProject (FMOD_EVENTGROUP *eventgroup, FMOD_EVENTPROJECT **project); -FMOD_RESULT F_API FMOD_EventGroup_GetNumGroups (FMOD_EVENTGROUP *eventgroup, int *numgroups); -FMOD_RESULT F_API FMOD_EventGroup_GetEvent (FMOD_EVENTGROUP *eventgroup, const char *name, FMOD_EVENT_MODE mode, FMOD_EVENT **event); -FMOD_RESULT F_API FMOD_EventGroup_GetEventByIndex (FMOD_EVENTGROUP *eventgroup, int index, FMOD_EVENT_MODE mode, FMOD_EVENT **event); -FMOD_RESULT F_API FMOD_EventGroup_GetNumEvents (FMOD_EVENTGROUP *eventgroup, int *numevents); -FMOD_RESULT F_API FMOD_EventGroup_GetProperty (FMOD_EVENTGROUP *eventgroup, const char *propertyname, void *value); -FMOD_RESULT F_API FMOD_EventGroup_GetPropertyByIndex (FMOD_EVENTGROUP *eventgroup, int propertyindex, void *value); -FMOD_RESULT F_API FMOD_EventGroup_GetNumProperties (FMOD_EVENTGROUP *eventgroup, int *numproperties); -FMOD_RESULT F_API FMOD_EventGroup_GetState (FMOD_EVENTGROUP *eventgroup, FMOD_EVENT_STATE *state); -FMOD_RESULT F_API FMOD_EventGroup_SetUserData (FMOD_EVENTGROUP *eventgroup, void *userdata); -FMOD_RESULT F_API FMOD_EventGroup_GetUserData (FMOD_EVENTGROUP *eventgroup, void **userdata); - -FMOD_RESULT F_API FMOD_EventGroup_GetMemoryInfo (FMOD_EVENTGROUP *eventgroup, unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details); - -/* - 'EventCategory' API -*/ - -FMOD_RESULT F_API FMOD_EventCategory_GetInfo (FMOD_EVENTCATEGORY *eventcategory, int *index, char **name); -FMOD_RESULT F_API FMOD_EventCategory_GetCategory (FMOD_EVENTCATEGORY *eventcategory, const char *name, FMOD_EVENTCATEGORY **category); -FMOD_RESULT F_API FMOD_EventCategory_GetCategoryByIndex(FMOD_EVENTCATEGORY *eventcategory, int index, FMOD_EVENTCATEGORY **category); -FMOD_RESULT F_API FMOD_EventCategory_GetNumCategories(FMOD_EVENTCATEGORY *eventcategory, int *numcategories); -FMOD_RESULT F_API FMOD_EventCategory_GetEventByIndex (FMOD_EVENTCATEGORY *eventcategory, int index, FMOD_EVENT_MODE mode, FMOD_EVENT **event); -FMOD_RESULT F_API FMOD_EventCategory_GetNumEvents (FMOD_EVENTCATEGORY *eventcategory, int *numevents); -FMOD_RESULT F_API FMOD_EventCategory_GetParentCategory(FMOD_EVENTCATEGORY *eventcategory, FMOD_EVENTCATEGORY **category); - -FMOD_RESULT F_API FMOD_EventCategory_StopAllEvents (FMOD_EVENTCATEGORY *eventcategory); -FMOD_RESULT F_API FMOD_EventCategory_SetVolume (FMOD_EVENTCATEGORY *eventcategory, float volume); -FMOD_RESULT F_API FMOD_EventCategory_GetVolume (FMOD_EVENTCATEGORY *eventcategory, float *volume); -FMOD_RESULT F_API FMOD_EventCategory_SetPitch (FMOD_EVENTCATEGORY *eventcategory, float pitch, FMOD_EVENT_PITCHUNITS units); -FMOD_RESULT F_API FMOD_EventCategory_GetPitch (FMOD_EVENTCATEGORY *eventcategory, float *pitch, FMOD_EVENT_PITCHUNITS units); -FMOD_RESULT F_API FMOD_EventCategory_SetPaused (FMOD_EVENTCATEGORY *eventcategory, FMOD_BOOL paused); -FMOD_RESULT F_API FMOD_EventCategory_GetPaused (FMOD_EVENTCATEGORY *eventcategory, FMOD_BOOL *paused); -FMOD_RESULT F_API FMOD_EventCategory_SetMute (FMOD_EVENTCATEGORY *eventcategory, FMOD_BOOL mute); -FMOD_RESULT F_API FMOD_EventCategory_GetMute (FMOD_EVENTCATEGORY *eventcategory, FMOD_BOOL *mute); -FMOD_RESULT F_API FMOD_EventCategory_GetChannelGroup (FMOD_EVENTCATEGORY *eventcategory, FMOD_CHANNELGROUP **channelgroup); -FMOD_RESULT F_API FMOD_EventCategory_SetUserData (FMOD_EVENTCATEGORY *eventcategory, void *userdata); -FMOD_RESULT F_API FMOD_EventCategory_GetUserData (FMOD_EVENTCATEGORY *eventcategory, void **userdata); - -FMOD_RESULT F_API FMOD_EventCategory_GetMemoryInfo (FMOD_EVENTCATEGORY *eventcategory, unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details); - -/* - 'Event' API -*/ - -FMOD_RESULT F_API FMOD_Event_Release (FMOD_EVENT *event, FMOD_BOOL freeeventdata, FMOD_BOOL waituntilready); - -FMOD_RESULT F_API FMOD_Event_Start (FMOD_EVENT *event); -FMOD_RESULT F_API FMOD_Event_Stop (FMOD_EVENT *event, FMOD_BOOL immediate); - -FMOD_RESULT F_API FMOD_Event_GetInfo (FMOD_EVENT *event, int *index, char **name, FMOD_EVENT_INFO *info); -FMOD_RESULT F_API FMOD_Event_GetState (FMOD_EVENT *event, FMOD_EVENT_STATE *state); -FMOD_RESULT F_API FMOD_Event_GetParentGroup (FMOD_EVENT *event, FMOD_EVENTGROUP **group); -FMOD_RESULT F_API FMOD_Event_GetChannelGroup (FMOD_EVENT *event, FMOD_CHANNELGROUP **channelgroup); -FMOD_RESULT F_API FMOD_Event_SetCallback (FMOD_EVENT *event, FMOD_EVENT_CALLBACK callback, void *userdata); - -FMOD_RESULT F_API FMOD_Event_GetParameter (FMOD_EVENT *event, const char *name, FMOD_EVENTPARAMETER **parameter); -FMOD_RESULT F_API FMOD_Event_GetParameterByIndex (FMOD_EVENT *event, int index, FMOD_EVENTPARAMETER **parameter); -FMOD_RESULT F_API FMOD_Event_GetNumParameters (FMOD_EVENT *event, int *numparameters); -FMOD_RESULT F_API FMOD_Event_GetProperty (FMOD_EVENT *event, const char *propertyname, void *value, FMOD_BOOL this_instance); -FMOD_RESULT F_API FMOD_Event_GetPropertyByIndex (FMOD_EVENT *event, int propertyindex, void *value, FMOD_BOOL this_instance); -FMOD_RESULT F_API FMOD_Event_SetProperty (FMOD_EVENT *event, const char *propertyname, void *value, FMOD_BOOL this_instance); -FMOD_RESULT F_API FMOD_Event_SetPropertyByIndex (FMOD_EVENT *event, int propertyindex, void *value, FMOD_BOOL this_instance); -FMOD_RESULT F_API FMOD_Event_GetNumProperties (FMOD_EVENT *event, int *numproperties); -FMOD_RESULT F_API FMOD_Event_GetPropertyInfo (FMOD_EVENT *event, int *propertyindex, char **propertyname, FMOD_EVENTPROPERTY_TYPE *type); -FMOD_RESULT F_API FMOD_Event_GetCategory (FMOD_EVENT *event, FMOD_EVENTCATEGORY **category); - -FMOD_RESULT F_API FMOD_Event_SetVolume (FMOD_EVENT *event, float volume); -FMOD_RESULT F_API FMOD_Event_GetVolume (FMOD_EVENT *event, float *volume); -FMOD_RESULT F_API FMOD_Event_SetPitch (FMOD_EVENT *event, float pitch, FMOD_EVENT_PITCHUNITS units); -FMOD_RESULT F_API FMOD_Event_GetPitch (FMOD_EVENT *event, float *pitch, FMOD_EVENT_PITCHUNITS units); -FMOD_RESULT F_API FMOD_Event_SetPaused (FMOD_EVENT *event, FMOD_BOOL paused); -FMOD_RESULT F_API FMOD_Event_GetPaused (FMOD_EVENT *event, FMOD_BOOL *paused); -FMOD_RESULT F_API FMOD_Event_SetMute (FMOD_EVENT *event, FMOD_BOOL mute); -FMOD_RESULT F_API FMOD_Event_GetMute (FMOD_EVENT *event, FMOD_BOOL *mute); -FMOD_RESULT F_API FMOD_Event_Set3DAttributes (FMOD_EVENT *event, const FMOD_VECTOR *position, const FMOD_VECTOR *velocity, const FMOD_VECTOR *orientation); -FMOD_RESULT F_API FMOD_Event_Get3DAttributes (FMOD_EVENT *event, FMOD_VECTOR *position, FMOD_VECTOR *velocity, FMOD_VECTOR *orientation); -FMOD_RESULT F_API FMOD_Event_Set3DOcclusion (FMOD_EVENT *event, float directocclusion, float reverbocclusion); -FMOD_RESULT F_API FMOD_Event_Get3DOcclusion (FMOD_EVENT *event, float *directocclusion, float *reverbocclusion); -FMOD_RESULT F_API FMOD_Event_SetReverbProperties (FMOD_EVENT *event, const FMOD_REVERB_CHANNELPROPERTIES *props); -FMOD_RESULT F_API FMOD_Event_GetReverbProperties (FMOD_EVENT *event, FMOD_REVERB_CHANNELPROPERTIES *props); -FMOD_RESULT F_API FMOD_Event_SetUserData (FMOD_EVENT *event, void *userdata); -FMOD_RESULT F_API FMOD_Event_GetUserData (FMOD_EVENT *event, void **userdata); - -FMOD_RESULT F_API FMOD_Event_GetMemoryInfo (FMOD_EVENT *event, unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details); - -/* - 'EventParameter' API -*/ - -FMOD_RESULT F_API FMOD_EventParameter_GetInfo (FMOD_EVENTPARAMETER *eventparameter, int *index, char **name); -FMOD_RESULT F_API FMOD_EventParameter_GetRange (FMOD_EVENTPARAMETER *eventparameter, float *rangemin, float *rangemax); -FMOD_RESULT F_API FMOD_EventParameter_SetValue (FMOD_EVENTPARAMETER *eventparameter, float value); -FMOD_RESULT F_API FMOD_EventParameter_GetValue (FMOD_EVENTPARAMETER *eventparameter, float *value); -FMOD_RESULT F_API FMOD_EventParameter_SetVelocity (FMOD_EVENTPARAMETER *eventparameter, float value); -FMOD_RESULT F_API FMOD_EventParameter_GetVelocity (FMOD_EVENTPARAMETER *eventparameter, float *value); -FMOD_RESULT F_API FMOD_EventParameter_SetSeekSpeed (FMOD_EVENTPARAMETER *eventparameter, float value); -FMOD_RESULT F_API FMOD_EventParameter_GetSeekSpeed (FMOD_EVENTPARAMETER *eventparameter, float *value); -FMOD_RESULT F_API FMOD_EventParameter_SetUserData (FMOD_EVENTPARAMETER *eventparameter, void *userdata); -FMOD_RESULT F_API FMOD_EventParameter_GetUserData (FMOD_EVENTPARAMETER *eventparameter, void **userdata); -FMOD_RESULT F_API FMOD_EventParameter_KeyOff (FMOD_EVENTPARAMETER *eventparameter); - -FMOD_RESULT F_API FMOD_EventParameter_GetMemoryInfo (FMOD_EVENTPARAMETER *eventparameter, unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details); - -/* - 'EventReverb' API -*/ - -FMOD_RESULT F_API FMOD_EventReverb_Release (FMOD_EVENTREVERB *eventreverb); -FMOD_RESULT F_API FMOD_EventReverb_Set3DAttributes (FMOD_EVENTREVERB *eventreverb, const FMOD_VECTOR *position, float mindistance, float maxdistance); -FMOD_RESULT F_API FMOD_EventReverb_Get3DAttributes (FMOD_EVENTREVERB *eventreverb, FMOD_VECTOR *position, float *mindistance, float *maxdistance); -FMOD_RESULT F_API FMOD_EventReverb_SetProperties (FMOD_EVENTREVERB *eventreverb, const FMOD_REVERB_PROPERTIES *props); -FMOD_RESULT F_API FMOD_EventReverb_GetProperties (FMOD_EVENTREVERB *eventreverb, FMOD_REVERB_PROPERTIES *props); -FMOD_RESULT F_API FMOD_EventReverb_SetActive (FMOD_EVENTREVERB *eventreverb, FMOD_BOOL active); -FMOD_RESULT F_API FMOD_EventReverb_GetActive (FMOD_EVENTREVERB *eventreverb, FMOD_BOOL *active); -FMOD_RESULT F_API FMOD_EventReverb_SetUserData (FMOD_EVENTREVERB *eventreverb, void *userdata); -FMOD_RESULT F_API FMOD_EventReverb_GetUserData (FMOD_EVENTREVERB *eventreverb, void **userdata); - -FMOD_RESULT F_API FMOD_EventReverb_GetMemoryInfo (FMOD_EVENTREVERB *eventreverb, unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details); - -/* - 'EventQueue' API -*/ - -FMOD_RESULT F_API FMOD_EventQueue_Release (FMOD_EVENTQUEUE *eventqueue); -FMOD_RESULT F_API FMOD_EventQueue_Add (FMOD_EVENTQUEUE *eventqueue, FMOD_EVENTQUEUEENTRY *entry, FMOD_BOOL allow_duplicates); -FMOD_RESULT F_API FMOD_EventQueue_Remove (FMOD_EVENTQUEUE *eventqueue, FMOD_EVENTQUEUEENTRY *entry); -FMOD_RESULT F_API FMOD_EventQueue_RemoveHead (FMOD_EVENTQUEUE *eventqueue); -FMOD_RESULT F_API FMOD_EventQueue_Clear (FMOD_EVENTQUEUE *eventqueue, FMOD_BOOL stopallevents); -FMOD_RESULT F_API FMOD_EventQueue_FindFirstEntry (FMOD_EVENTQUEUE *eventqueue, FMOD_EVENTQUEUEENTRY **entry); -FMOD_RESULT F_API FMOD_EventQueue_FindNextEntry (FMOD_EVENTQUEUE *eventqueue, FMOD_EVENTQUEUEENTRY **entry); -FMOD_RESULT F_API FMOD_EventQueue_SetPaused (FMOD_EVENTQUEUE *eventqueue, FMOD_BOOL paused); -FMOD_RESULT F_API FMOD_EventQueue_GetPaused (FMOD_EVENTQUEUE *eventqueue, FMOD_BOOL *paused); -FMOD_RESULT F_API FMOD_EventQueue_IncludeDuckingCategory(FMOD_EVENTQUEUE *eventqueue, FMOD_EVENTCATEGORY *category, float ducked_volume, float unducked_volume, unsigned int duck_time, unsigned int unduck_time); -FMOD_RESULT F_API FMOD_EventQueue_ExcludeDuckingCategory(FMOD_EVENTQUEUE *eventqueue, FMOD_EVENTCATEGORY *category); -FMOD_RESULT F_API FMOD_EventQueue_SetCallback (FMOD_EVENTQUEUE *eventqueue, FMOD_EVENTQUEUE_CALLBACK callback, void *callbackuserdata); -FMOD_RESULT F_API FMOD_EventQueue_SetUserData (FMOD_EVENTQUEUE *eventqueue, void *userdata); -FMOD_RESULT F_API FMOD_EventQueue_GetUserData (FMOD_EVENTQUEUE *eventqueue, void **userdata); -FMOD_RESULT F_API FMOD_EventQueue_Dump (FMOD_EVENTQUEUE *eventqueue); - -FMOD_RESULT F_API FMOD_EventQueue_GetMemoryInfo (FMOD_EVENTQUEUE *eventqueue, unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details); - -/* - 'EventQueueEntry' API -*/ - -FMOD_RESULT F_API FMOD_EventQueueEntry_Release (FMOD_EVENTQUEUEENTRY *eventqueueentry); -FMOD_RESULT F_API FMOD_EventQueueEntry_GetInfoOnlyEvent(FMOD_EVENTQUEUEENTRY *eventqueueentry, FMOD_EVENT **infoonlyevent); -FMOD_RESULT F_API FMOD_EventQueueEntry_GetRealEvent (FMOD_EVENTQUEUEENTRY *eventqueueentry, FMOD_EVENT **realevent); -FMOD_RESULT F_API FMOD_EventQueueEntry_SetPriority (FMOD_EVENTQUEUEENTRY *eventqueueentry, unsigned char priority); -FMOD_RESULT F_API FMOD_EventQueueEntry_GetPriority (FMOD_EVENTQUEUEENTRY *eventqueueentry, unsigned char *priority); -FMOD_RESULT F_API FMOD_EventQueueEntry_SetExpiryTime (FMOD_EVENTQUEUEENTRY *eventqueueentry, unsigned int expirytime); -FMOD_RESULT F_API FMOD_EventQueueEntry_GetExpiryTime (FMOD_EVENTQUEUEENTRY *eventqueueentry, unsigned int *expirytime); -FMOD_RESULT F_API FMOD_EventQueueEntry_SetDelayTime (FMOD_EVENTQUEUEENTRY *eventqueueentry, unsigned int delay); -FMOD_RESULT F_API FMOD_EventQueueEntry_GetDelayTime (FMOD_EVENTQUEUEENTRY *eventqueueentry, unsigned int *delay); -FMOD_RESULT F_API FMOD_EventQueueEntry_SetInterrupt (FMOD_EVENTQUEUEENTRY *eventqueueentry, FMOD_BOOL interrupt); -FMOD_RESULT F_API FMOD_EventQueueEntry_GetInterrupt (FMOD_EVENTQUEUEENTRY *eventqueueentry, FMOD_BOOL *interrupt); -FMOD_RESULT F_API FMOD_EventQueueEntry_SetCrossfadeTime(FMOD_EVENTQUEUEENTRY *eventqueueentry, int crossfade); -FMOD_RESULT F_API FMOD_EventQueueEntry_GetCrossfadeTime(FMOD_EVENTQUEUEENTRY *eventqueueentry, int *crossfade); -FMOD_RESULT F_API FMOD_EventQueueEntry_SetUserData (FMOD_EVENTQUEUEENTRY *eventqueueentry, void *userdata); -FMOD_RESULT F_API FMOD_EventQueueEntry_GetUserData (FMOD_EVENTQUEUEENTRY *eventqueueentry, void **userdata); - -FMOD_RESULT F_API FMOD_EventQueueEntry_GetMemoryInfo (FMOD_EVENTQUEUEENTRY *eventqueueentry, unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details); - -/* - 'MusicSystem' API -*/ - -FMOD_RESULT F_API FMOD_MusicSystem_Reset (FMOD_MUSICSYSTEM *musicsystem); -FMOD_RESULT F_API FMOD_MusicSystem_SetVolume (FMOD_MUSICSYSTEM *musicsystem, float volume); -FMOD_RESULT F_API FMOD_MusicSystem_GetVolume (FMOD_MUSICSYSTEM *musicsystem, float *volume); -FMOD_RESULT F_API FMOD_MusicSystem_SetReverbProperties(FMOD_MUSICSYSTEM *musicsystem, const FMOD_REVERB_CHANNELPROPERTIES *props); -FMOD_RESULT F_API FMOD_MusicSystem_GetReverbProperties(FMOD_MUSICSYSTEM *musicsystem, FMOD_REVERB_CHANNELPROPERTIES *props); -FMOD_RESULT F_API FMOD_MusicSystem_SetPaused (FMOD_MUSICSYSTEM *musicsystem, FMOD_BOOL paused); -FMOD_RESULT F_API FMOD_MusicSystem_GetPaused (FMOD_MUSICSYSTEM *musicsystem, FMOD_BOOL *paused); -FMOD_RESULT F_API FMOD_MusicSystem_SetMute (FMOD_MUSICSYSTEM *musicsystem, FMOD_BOOL mute); -FMOD_RESULT F_API FMOD_MusicSystem_GetMute (FMOD_MUSICSYSTEM *musicsystem, FMOD_BOOL *mute); -FMOD_RESULT F_API FMOD_MusicSystem_GetInfo (FMOD_MUSICSYSTEM *musicsystem, FMOD_MUSIC_INFO *info); -FMOD_RESULT F_API FMOD_MusicSystem_PromptCue (FMOD_MUSICSYSTEM *musicsystem, FMOD_MUSIC_CUE_ID id); -FMOD_RESULT F_API FMOD_MusicSystem_PrepareCue (FMOD_MUSICSYSTEM *musicsystem, FMOD_MUSIC_CUE_ID id, FMOD_MUSICPROMPT **prompt); -FMOD_RESULT F_API FMOD_MusicSystem_GetParameterValue (FMOD_MUSICSYSTEM *musicsystem, FMOD_MUSIC_PARAM_ID id, float *parameter); -FMOD_RESULT F_API FMOD_MusicSystem_SetParameterValue (FMOD_MUSICSYSTEM *musicsystem, FMOD_MUSIC_PARAM_ID id, float parameter); - -FMOD_RESULT F_API FMOD_MusicSystem_GetCues (FMOD_MUSICSYSTEM *musicsystem, FMOD_MUSIC_ITERATOR *it, const char *filter); -FMOD_RESULT F_API FMOD_MusicSystem_GetNextCue (FMOD_MUSICSYSTEM *musicsystem, FMOD_MUSIC_ITERATOR *it); -FMOD_RESULT F_API FMOD_MusicSystem_GetParameters (FMOD_MUSICSYSTEM *musicsystem, FMOD_MUSIC_ITERATOR *it, const char *filter); -FMOD_RESULT F_API FMOD_MusicSystem_GetNextParameter (FMOD_MUSICSYSTEM *musicsystem, FMOD_MUSIC_ITERATOR *it); - -FMOD_RESULT F_API FMOD_MusicSystem_LoadSoundData (FMOD_MUSICSYSTEM *musicsystem, FMOD_EVENT_RESOURCE resource, FMOD_EVENT_MODE mode); -FMOD_RESULT F_API FMOD_MusicSystem_FreeSoundData (FMOD_MUSICSYSTEM *musicsystem, FMOD_BOOL waituntilready); - -FMOD_RESULT F_API FMOD_MusicSystem_SetCallback (FMOD_MUSICSYSTEM *musicsystem, FMOD_MUSIC_CALLBACK callback, void *userdata); - -FMOD_RESULT F_API FMOD_MusicSystem_GetMemoryInfo (FMOD_MUSICSYSTEM *musicsystem, unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details); - -/* - 'MusicPrompt' API -*/ - -FMOD_RESULT F_API FMOD_MusicPrompt_Release (FMOD_MUSICPROMPT *musicprompt); -FMOD_RESULT F_API FMOD_MusicPrompt_Begin (FMOD_MUSICPROMPT *musicprompt); -FMOD_RESULT F_API FMOD_MusicPrompt_End (FMOD_MUSICPROMPT *musicprompt); -FMOD_RESULT F_API FMOD_MusicPrompt_IsActive (FMOD_MUSICPROMPT *musicprompt, FMOD_BOOL *active); - -FMOD_RESULT F_API FMOD_MusicPrompt_GetMemoryInfo (FMOD_MUSICPROMPT *musicprompt, unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details); -/*$ preserve start $*/ - -#ifdef __cplusplus -} -#endif - - -#endif - -/*$ preserve end $*/ diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/api/inc/fmod_event.hpp b/CocosDenshion/third_party/fmod/fmoddesignerapi/api/inc/fmod_event.hpp deleted file mode 100644 index b419d6df39..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/api/inc/fmod_event.hpp +++ /dev/null @@ -1,395 +0,0 @@ -/* - fmod_event.hpp - Data-driven event classes - Copyright (c), Firelight Technologies Pty, Ltd. 2004-2011. - - This header is the base header for all other FMOD EventSystem headers. If you are programming in C use FMOD_EVENT.H -*/ - -#ifndef __FMOD_EVENT_HPP__ -#define __FMOD_EVENT_HPP__ - -#ifndef _FMOD_HPP -#include "fmod.hpp" -#endif -#ifndef __FMOD_EVENT_H__ -#include "fmod_event.h" -#endif - -namespace FMOD -{ - class EventSystem; - class EventCategory; - class EventProject; - class EventGroup; - class Event; - class EventParameter; - class EventReverb; - class EventQueue; - class EventQueueEntry; - class MusicSystem; - class MusicPrompt; - - /* - FMOD EventSystem factory functions. - */ - inline FMOD_RESULT EventSystem_Create(EventSystem **eventsystem) { return FMOD_EventSystem_Create((FMOD_EVENTSYSTEM **)eventsystem); } - - /* - 'EventSystem' API - */ - class EventSystem - { - public : - - // Initialization / system functions. - FMOD_RESULT F_API init (int maxchannels, FMOD_INITFLAGS flags, void *extradriverdata, FMOD_EVENT_INITFLAGS eventflags = FMOD_EVENT_INIT_NORMAL); - FMOD_RESULT F_API release (); - FMOD_RESULT F_API update (); - FMOD_RESULT F_API setMediaPath (const char *path); - FMOD_RESULT F_API setPluginPath (const char *path); - FMOD_RESULT F_API getVersion (unsigned int *version); - FMOD_RESULT F_API getInfo (FMOD_EVENT_SYSTEMINFO *info); - FMOD_RESULT F_API getSystemObject (System **system); - FMOD_RESULT F_API getMusicSystem (MusicSystem **musicsystem); - FMOD_RESULT F_API setLanguage (const char *language); - FMOD_RESULT F_API getLanguage (char *language); - - // FEV load/unload. - FMOD_RESULT F_API load (const char *name_or_data, FMOD_EVENT_LOADINFO *loadinfo, EventProject **project); - FMOD_RESULT F_API unload (); - - // Event,EventGroup,EventCategory Retrieval. - FMOD_RESULT F_API getProject (const char *name, EventProject **project); - FMOD_RESULT F_API getProjectByIndex (int index, EventProject **project); - FMOD_RESULT F_API getNumProjects (int *numprojects); - FMOD_RESULT F_API getCategory (const char *name, EventCategory **category); - FMOD_RESULT F_API getCategoryByIndex (int index, EventCategory **category); - FMOD_RESULT F_API getMusicCategory (EventCategory **category); - FMOD_RESULT F_API getNumCategories (int *numcategories); - FMOD_RESULT F_API getGroup (const char *name, bool cacheevents, EventGroup **group); - FMOD_RESULT F_API getEvent (const char *name, FMOD_EVENT_MODE mode, Event **event); - FMOD_RESULT F_API getEventBySystemID (unsigned int systemid, FMOD_EVENT_MODE mode, Event **event); - FMOD_RESULT F_API getEventByGUID (const FMOD_GUID *guid, FMOD_EVENT_MODE mode, Event **event); - FMOD_RESULT F_API getEventByGUIDString (const char *guid, FMOD_EVENT_MODE mode, Event **event); - FMOD_RESULT F_API getNumEvents (int *numevents); - - // Reverb interfaces. - FMOD_RESULT F_API setReverbProperties (const FMOD_REVERB_PROPERTIES *props); - FMOD_RESULT F_API getReverbProperties (FMOD_REVERB_PROPERTIES *props); - - FMOD_RESULT F_API getReverbPreset (const char *name, FMOD_REVERB_PROPERTIES *props, int *index = 0); - FMOD_RESULT F_API getReverbPresetByIndex (const int index, FMOD_REVERB_PROPERTIES *props, char **name = 0); - FMOD_RESULT F_API getNumReverbPresets (int *numpresets); - - FMOD_RESULT F_API createReverb (EventReverb **reverb); - FMOD_RESULT F_API setReverbAmbientProperties(FMOD_REVERB_PROPERTIES *props); - FMOD_RESULT F_API getReverbAmbientProperties(FMOD_REVERB_PROPERTIES *props); - - // Event queue interfaces. - FMOD_RESULT F_API createEventQueue (EventQueue **queue); - FMOD_RESULT F_API createEventQueueEntry (Event *event, EventQueueEntry **entry); - - // 3D Listener interface. - FMOD_RESULT F_API set3DNumListeners (int numlisteners); - FMOD_RESULT F_API get3DNumListeners (int *numlisteners); - FMOD_RESULT F_API set3DListenerAttributes (int listener, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel, const FMOD_VECTOR *forward, const FMOD_VECTOR *up); - FMOD_RESULT F_API get3DListenerAttributes (int listener, FMOD_VECTOR *pos, FMOD_VECTOR *vel, FMOD_VECTOR *forward, FMOD_VECTOR *up); - - // Get/set user data - FMOD_RESULT F_API setUserData (void *userdata); - FMOD_RESULT F_API getUserData (void **userdata); - - // Pre-loading FSB files (from disk or from memory, use FMOD_OPENMEMORY_POINT to point to pre-loaded memory). - FMOD_RESULT F_API preloadFSB (const char *filename, int streaminstance, Sound *sound); - FMOD_RESULT F_API unloadFSB (const char *filename, int streaminstance); - - FMOD_RESULT F_API getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details); - }; - - /* - 'EventProject' API - */ - class EventProject - { - public : - - virtual FMOD_RESULT F_API release () = 0; - virtual FMOD_RESULT F_API getInfo (FMOD_EVENT_PROJECTINFO *info) = 0; - virtual FMOD_RESULT F_API getGroup (const char *name, bool cacheevents, EventGroup **group) = 0; - virtual FMOD_RESULT F_API getGroupByIndex (int index, bool cacheevents, EventGroup **group) = 0; - virtual FMOD_RESULT F_API getNumGroups (int *numgroups) = 0; - virtual FMOD_RESULT F_API getEvent (const char *name, FMOD_EVENT_MODE mode, Event **event) = 0; - virtual FMOD_RESULT F_API getEventByProjectID(unsigned int projectid, FMOD_EVENT_MODE mode, Event **event) = 0; - virtual FMOD_RESULT F_API getNumEvents (int *numevents) = 0; - virtual FMOD_RESULT F_API loadSampleData (int *eventid_array, int sizeof_eventid_array, char **groupname_array, int sizeof_groupname_array, FMOD_EVENT_MODE eventmode) = 0; - virtual FMOD_RESULT F_API stopAllEvents (bool immediate = false) = 0; - virtual FMOD_RESULT F_API cancelAllLoads () = 0; - virtual FMOD_RESULT F_API setUserData (void *userdata) = 0; - virtual FMOD_RESULT F_API getUserData (void **userdata) = 0; - - virtual FMOD_RESULT F_API getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details) = 0; - virtual ~EventProject(){}; - }; - - /* - 'EventGroup' API - */ - class EventGroup - { - public : - - virtual FMOD_RESULT F_API getInfo (int *index, char **name) = 0; - virtual FMOD_RESULT F_API loadEventData (FMOD_EVENT_RESOURCE resource = FMOD_EVENT_RESOURCE_STREAMS_AND_SAMPLES, FMOD_EVENT_MODE mode = FMOD_EVENT_DEFAULT) = 0; - virtual FMOD_RESULT F_API freeEventData (Event *event = 0, bool waituntilready = true) = 0; - virtual FMOD_RESULT F_API getGroup (const char *name, bool cacheevents, EventGroup **group) = 0; - virtual FMOD_RESULT F_API getGroupByIndex (int index, bool cacheevents, EventGroup **group) = 0; - virtual FMOD_RESULT F_API getParentGroup (EventGroup **group) = 0; - virtual FMOD_RESULT F_API getParentProject (EventProject **project) = 0; - virtual FMOD_RESULT F_API getNumGroups (int *numgroups) = 0; - virtual FMOD_RESULT F_API getEvent (const char *name, FMOD_EVENT_MODE mode, Event **event) = 0; - virtual FMOD_RESULT F_API getEventByIndex (int index, FMOD_EVENT_MODE mode, Event **event) = 0; - virtual FMOD_RESULT F_API getNumEvents (int *numevents) = 0; - virtual FMOD_RESULT F_API getProperty (const char *propertyname, void *value) = 0; - virtual FMOD_RESULT F_API getPropertyByIndex (int propertyindex, void *value) = 0; - virtual FMOD_RESULT F_API getNumProperties (int *numproperties) = 0; - virtual FMOD_RESULT F_API getState (FMOD_EVENT_STATE *state) = 0; - virtual FMOD_RESULT F_API setUserData (void *userdata) = 0; - virtual FMOD_RESULT F_API getUserData (void **userdata) = 0; - - virtual FMOD_RESULT F_API getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details) = 0; - virtual ~EventGroup(){}; - }; - - /* - 'EventCategory' API - */ - class EventCategory - { - public : - - virtual FMOD_RESULT F_API getInfo (int *index, char **name) = 0; - virtual FMOD_RESULT F_API getCategory (const char *name, EventCategory **category) = 0; - virtual FMOD_RESULT F_API getCategoryByIndex (int index, EventCategory **category) = 0; - virtual FMOD_RESULT F_API getNumCategories (int *numcategories) = 0; - virtual FMOD_RESULT F_API getEventByIndex (int index, FMOD_EVENT_MODE mode, Event **event) = 0; - virtual FMOD_RESULT F_API getNumEvents (int *numevents) = 0; - virtual FMOD_RESULT F_API getParentCategory (EventCategory **category) = 0; - - virtual FMOD_RESULT F_API stopAllEvents () = 0; - virtual FMOD_RESULT F_API setVolume (float volume) = 0; - virtual FMOD_RESULT F_API getVolume (float *volume) = 0; - virtual FMOD_RESULT F_API setPitch (float pitch, FMOD_EVENT_PITCHUNITS units = FMOD_EVENT_PITCHUNITS_RAW) = 0; - virtual FMOD_RESULT F_API getPitch (float *pitch, FMOD_EVENT_PITCHUNITS units = FMOD_EVENT_PITCHUNITS_RAW) = 0; - virtual FMOD_RESULT F_API setPaused (bool paused) = 0; - virtual FMOD_RESULT F_API getPaused (bool *paused) = 0; - virtual FMOD_RESULT F_API setMute (bool mute) = 0; - virtual FMOD_RESULT F_API getMute (bool *mute) = 0; - virtual FMOD_RESULT F_API getChannelGroup (ChannelGroup **channelgroup) = 0; - virtual FMOD_RESULT F_API setUserData (void *userdata) = 0; - virtual FMOD_RESULT F_API getUserData (void **userdata) = 0; - - virtual FMOD_RESULT F_API getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details) = 0; - virtual ~EventCategory(){}; - }; - - /* - 'Event' API - */ - class Event - { - public : - - FMOD_RESULT F_API release (bool freeeventdata = false, bool waituntilready = true); - - FMOD_RESULT F_API start (); - FMOD_RESULT F_API stop (bool immediate = false); - - FMOD_RESULT F_API getInfo (int *index, char **name, FMOD_EVENT_INFO *info); - FMOD_RESULT F_API getState (FMOD_EVENT_STATE *state); - FMOD_RESULT F_API getParentGroup (EventGroup **group); - FMOD_RESULT F_API getChannelGroup (ChannelGroup **channelgroup); - FMOD_RESULT F_API setCallback (FMOD_EVENT_CALLBACK callback, void *userdata); - - FMOD_RESULT F_API getParameter (const char *name, EventParameter **parameter); - FMOD_RESULT F_API getParameterByIndex (int index, EventParameter **parameter); - FMOD_RESULT F_API getNumParameters (int *numparameters); - FMOD_RESULT F_API getProperty (const char *propertyname, void *value, bool this_instance = false); - FMOD_RESULT F_API getPropertyByIndex (int propertyindex, void *value, bool this_instance = false); - FMOD_RESULT F_API setProperty (const char *propertyname, void *value, bool this_instance = false); - FMOD_RESULT F_API setPropertyByIndex (int propertyindex, void *value, bool this_instance = false); - FMOD_RESULT F_API getNumProperties (int *numproperties); - FMOD_RESULT F_API getPropertyInfo (int *propertyindex, char **propertyname, FMOD_EVENTPROPERTY_TYPE *type = 0); - FMOD_RESULT F_API getCategory (EventCategory **category); - - FMOD_RESULT F_API setVolume (float volume); - FMOD_RESULT F_API getVolume (float *volume); - FMOD_RESULT F_API setPitch (float pitch, FMOD_EVENT_PITCHUNITS units = FMOD_EVENT_PITCHUNITS_RAW); - FMOD_RESULT F_API getPitch (float *pitch, FMOD_EVENT_PITCHUNITS units = FMOD_EVENT_PITCHUNITS_RAW); - FMOD_RESULT F_API setPaused (bool paused); - FMOD_RESULT F_API getPaused (bool *paused); - FMOD_RESULT F_API setMute (bool mute); - FMOD_RESULT F_API getMute (bool *mute); - FMOD_RESULT F_API set3DAttributes (const FMOD_VECTOR *position, const FMOD_VECTOR *velocity, const FMOD_VECTOR *orientation = 0); - FMOD_RESULT F_API get3DAttributes (FMOD_VECTOR *position, FMOD_VECTOR *velocity, FMOD_VECTOR *orientation = 0); - FMOD_RESULT F_API set3DOcclusion (float directocclusion, float reverbocclusion); - FMOD_RESULT F_API get3DOcclusion (float *directocclusion, float *reverbocclusion); - FMOD_RESULT F_API setReverbProperties (const FMOD_REVERB_CHANNELPROPERTIES *props); - FMOD_RESULT F_API getReverbProperties (FMOD_REVERB_CHANNELPROPERTIES *props); - FMOD_RESULT F_API setUserData (void *userdata); - FMOD_RESULT F_API getUserData (void **userdata); - - FMOD_RESULT F_API getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details); - }; - - /* - 'EventParameter' API - */ - class EventParameter - { - public : - - FMOD_RESULT F_API getInfo (int *index, char **name); - FMOD_RESULT F_API getRange (float *rangemin, float *rangemax); - FMOD_RESULT F_API setValue (float value); - FMOD_RESULT F_API getValue (float *value); - FMOD_RESULT F_API setVelocity (float value); - FMOD_RESULT F_API getVelocity (float *value); - FMOD_RESULT F_API setSeekSpeed (float value); - FMOD_RESULT F_API getSeekSpeed (float *value); - FMOD_RESULT F_API setUserData (void *userdata); - FMOD_RESULT F_API getUserData (void **userdata); - FMOD_RESULT F_API keyOff (); - - FMOD_RESULT F_API getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details); - }; - - /* - 'EventReverb ' API - */ - class EventReverb - { - public : - - virtual FMOD_RESULT F_API release () = 0; - virtual FMOD_RESULT F_API set3DAttributes (const FMOD_VECTOR *position, float mindistance, float maxdistance) = 0; - virtual FMOD_RESULT F_API get3DAttributes (FMOD_VECTOR *position, float *mindistance,float *maxdistance) = 0; - virtual FMOD_RESULT F_API setProperties (const FMOD_REVERB_PROPERTIES *props) = 0; - virtual FMOD_RESULT F_API getProperties (FMOD_REVERB_PROPERTIES *props) = 0; - virtual FMOD_RESULT F_API setActive (bool active) = 0; - virtual FMOD_RESULT F_API getActive (bool *active) = 0; - virtual FMOD_RESULT F_API setUserData (void *userdata) = 0; - virtual FMOD_RESULT F_API getUserData (void **userdata) = 0; - - virtual FMOD_RESULT F_API getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details) = 0; - virtual ~EventReverb(){}; - }; - - /* - 'EventQueue' API - */ - class EventQueue - { - public : - - virtual FMOD_RESULT F_API release () = 0; - virtual FMOD_RESULT F_API add (EventQueueEntry *entry, bool allow_duplicates = true) = 0; - virtual FMOD_RESULT F_API remove (EventQueueEntry *entry) = 0; - virtual FMOD_RESULT F_API removeHead () = 0; - virtual FMOD_RESULT F_API clear (bool stopallevents = true) = 0; - virtual FMOD_RESULT F_API findFirstEntry (EventQueueEntry **entry) = 0; - virtual FMOD_RESULT F_API findNextEntry (EventQueueEntry **entry) = 0; - virtual FMOD_RESULT F_API setPaused (bool paused) = 0; - virtual FMOD_RESULT F_API getPaused (bool *paused) = 0; - virtual FMOD_RESULT F_API includeDuckingCategory (EventCategory *category, float ducked_volume, float unducked_volume, unsigned int duck_time, unsigned int unduck_time) = 0; - virtual FMOD_RESULT F_API excludeDuckingCategory (EventCategory *category) = 0; - virtual FMOD_RESULT F_API setCallback (FMOD_EVENTQUEUE_CALLBACK callback, void *callbackuserdata) = 0; - virtual FMOD_RESULT F_API setUserData (void *userdata) = 0; - virtual FMOD_RESULT F_API getUserData (void **userdata) = 0; - virtual FMOD_RESULT F_API dump () = 0; - - virtual FMOD_RESULT F_API getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details) = 0; - virtual ~EventQueue(){}; - }; - - /* - 'EventQueueEntry' API - */ - class EventQueueEntry - { - public : - - virtual FMOD_RESULT F_API release () = 0; - virtual FMOD_RESULT F_API getInfoOnlyEvent (Event **infoonlyevent) = 0; - virtual FMOD_RESULT F_API getRealEvent (Event **realevent) = 0; - virtual FMOD_RESULT F_API setPriority (unsigned char priority) = 0; - virtual FMOD_RESULT F_API getPriority (unsigned char *priority) = 0; - virtual FMOD_RESULT F_API setExpiryTime (unsigned int expirytime) = 0; - virtual FMOD_RESULT F_API getExpiryTime (unsigned int *expirytime) = 0; - virtual FMOD_RESULT F_API setDelayTime (unsigned int delay) = 0; - virtual FMOD_RESULT F_API getDelayTime (unsigned int *delay) = 0; - virtual FMOD_RESULT F_API setInterrupt (bool interrupt) = 0; - virtual FMOD_RESULT F_API getInterrupt (bool *interrupt) = 0; - virtual FMOD_RESULT F_API setCrossfadeTime (int crossfade) = 0; - virtual FMOD_RESULT F_API getCrossfadeTime (int *crossfade) = 0; - virtual FMOD_RESULT F_API setUserData (void *userdata) = 0; - virtual FMOD_RESULT F_API getUserData (void **userdata) = 0; - - virtual FMOD_RESULT F_API getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details) = 0; - virtual ~EventQueueEntry(){}; - }; - - /* - 'MusicSystem' API - */ - class MusicSystem - { - public : - - virtual FMOD_RESULT F_API reset () = 0; - virtual FMOD_RESULT F_API setVolume (float volume) = 0; - virtual FMOD_RESULT F_API getVolume (float *volume) = 0; - virtual FMOD_RESULT F_API setReverbProperties(const FMOD_REVERB_CHANNELPROPERTIES *props) = 0; - virtual FMOD_RESULT F_API getReverbProperties(FMOD_REVERB_CHANNELPROPERTIES *props) = 0; - virtual FMOD_RESULT F_API setPaused (bool paused) = 0; - virtual FMOD_RESULT F_API getPaused (bool *paused) = 0; - virtual FMOD_RESULT F_API setMute (bool mute) = 0; - virtual FMOD_RESULT F_API getMute (bool *mute) = 0; - virtual FMOD_RESULT F_API getInfo (FMOD_MUSIC_INFO *info) = 0; - virtual FMOD_RESULT F_API promptCue (FMOD_MUSIC_CUE_ID id) = 0; - virtual FMOD_RESULT F_API prepareCue (FMOD_MUSIC_CUE_ID id, MusicPrompt **prompt) = 0; - virtual FMOD_RESULT F_API getParameterValue (FMOD_MUSIC_PARAM_ID id, float *parameter) = 0; - virtual FMOD_RESULT F_API setParameterValue (FMOD_MUSIC_PARAM_ID id, float parameter) = 0; - - virtual FMOD_RESULT F_API getCues (FMOD_MUSIC_ITERATOR *it, const char *filter = 0) = 0; - virtual FMOD_RESULT F_API getNextCue (FMOD_MUSIC_ITERATOR *it) = 0; - virtual FMOD_RESULT F_API getParameters (FMOD_MUSIC_ITERATOR *it, const char *filter = 0) = 0; - virtual FMOD_RESULT F_API getNextParameter (FMOD_MUSIC_ITERATOR *it) = 0; - - virtual FMOD_RESULT F_API loadSoundData (FMOD_EVENT_RESOURCE resource = FMOD_EVENT_RESOURCE_SAMPLES, FMOD_EVENT_MODE mode = FMOD_EVENT_DEFAULT) = 0; - virtual FMOD_RESULT F_API freeSoundData (bool waituntilready = true) = 0; - - virtual FMOD_RESULT F_API setCallback (FMOD_MUSIC_CALLBACK callback, void *userdata) = 0; - - virtual FMOD_RESULT F_API getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details) = 0; - virtual ~MusicSystem(){}; - }; - - /* - 'MusicPrompt' API - */ - class MusicPrompt - { - public : - - virtual FMOD_RESULT F_API release () = 0; - virtual FMOD_RESULT F_API begin () = 0; - virtual FMOD_RESULT F_API end () = 0; - virtual FMOD_RESULT F_API isActive (bool *active) = 0; - - virtual FMOD_RESULT F_API getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details) = 0; - virtual ~MusicPrompt(){}; - }; -} - - -#endif diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/api/inc/fmod_event_net.h b/CocosDenshion/third_party/fmod/fmoddesignerapi/api/inc/fmod_event_net.h deleted file mode 100644 index d912355338..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/api/inc/fmod_event_net.h +++ /dev/null @@ -1,42 +0,0 @@ -/* ============================================================================================ */ -/* FMOD Ex - Main C/C++ Network event system header file. */ -/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2011. */ -/* */ -/* This header is the base header for all other FMOD NetEventSystem headers. If you are */ -/* programming in C use this exclusively, or if you are programming C++ use this in */ -/* conjunction with FMOD_EVENT_NET.HPP */ -/* ============================================================================================ */ - -#ifndef __FMOD_EVENT_NET_H__ -#define __FMOD_EVENT_NET_H__ - -#ifndef __FMOD_EVENT_H__ -#include "fmod_event.h" -#endif - -/* - FMOD NetEventSystem version number. Check this against NetEventSystem_GetVersion. - 0xaaaabbcc -> aaaa = major version number. bb = minor version number. cc = development version number. -*/ -#define FMOD_EVENT_NET_VERSION 0x00043601 - -/* - Default port that the target (game) will listen on -*/ -#define FMOD_EVENT_NET_PORT 17997 - -#ifdef __cplusplus -extern "C" -{ -#endif - -FMOD_RESULT F_API FMOD_NetEventSystem_Init (FMOD_EVENTSYSTEM *eventsystem, unsigned short port); -FMOD_RESULT F_API FMOD_NetEventSystem_Update (); -FMOD_RESULT F_API FMOD_NetEventSystem_Shutdown (); -FMOD_RESULT F_API FMOD_NetEventSystem_GetVersion (unsigned int *version); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/api/inc/fmod_event_net.hpp b/CocosDenshion/third_party/fmod/fmoddesignerapi/api/inc/fmod_event_net.hpp deleted file mode 100644 index 77a7ac16b0..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/api/inc/fmod_event_net.hpp +++ /dev/null @@ -1,26 +0,0 @@ -/* ============================================================================================ */ -/* FMOD Ex - Main C/C++ Network event system header file. */ -/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2011. */ -/* */ -/* Use this header to enable network tweaking and auditioning in realtime from FMOD Designer. */ -/* If you are programming in C use FMOD_EVENT_NET.H */ -/* ============================================================================================ */ - -#ifndef __FMOD_EVENT_NET_HPP__ -#define __FMOD_EVENT_NET_HPP__ - -#ifndef __FMOD_EVENT_NET_H__ -#include "fmod_event_net.h" -#endif - -namespace FMOD -{ - class EventSystem; - - FMOD_RESULT F_API NetEventSystem_Init (EventSystem *eventsystem, unsigned short port = FMOD_EVENT_NET_PORT); - FMOD_RESULT F_API NetEventSystem_Update (); - FMOD_RESULT F_API NetEventSystem_Shutdown (); - FMOD_RESULT F_API NetEventSystem_GetVersion (unsigned int *version); -} - -#endif diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/api/lib/libfmodevent-4.36.01.so.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/api/lib/libfmodevent-4.36.01.so.REMOVED.git-id deleted file mode 100644 index f4fa4d5f22..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/api/lib/libfmodevent-4.36.01.so.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -5de969cbd3cf8dd7afcf9ed3b5c9176e6ab4a0b8 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/api/lib/libfmodeventL-4.36.01.so.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/api/lib/libfmodeventL-4.36.01.so.REMOVED.git-id deleted file mode 100644 index 75bee35a5e..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/api/lib/libfmodeventL-4.36.01.so.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -b10592ed23696425641c66cba34a2ce7d3dd6918 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/RUN_BUILD_MEDIA_FILES.txt b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/RUN_BUILD_MEDIA_FILES.txt deleted file mode 100644 index 9ee542f148..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/RUN_BUILD_MEDIA_FILES.txt +++ /dev/null @@ -1 +0,0 @@ -Run the build_media_files.sh shell script (in the media directory ./media) to build the media files required for these examples. diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/effects/Makefile b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/effects/Makefile deleted file mode 100644 index 9dcba5c86d..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/effects/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -all: main.cpp - g++ -O3 -o effects -I../../../api/inc main.cpp ../../api/lib/libfmodevent.so -Wl,-rpath ../../../api/lib - -run: - ./effects - -clean: - rm -f effects diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/effects/main.cpp b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/effects/main.cpp deleted file mode 100644 index e9cc23b802..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/effects/main.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/*=============================================================================================== - Effects Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - Demonstrates basic usage of event effects -===============================================================================================*/ -#include "../../../examples/common/wincompat.h" - -#include "../../api/inc/fmod_event.hpp" -#include "../../../api/inc/fmod_errors.h" - -const float UPDATE_INTERVAL = 100.0f; - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD::EventSystem *eventsystem; - FMOD::Event *event; - FMOD::EventParameter *param00; - FMOD_RESULT result; - int key; - float param00_val, param00_min, param00_max, param00_increment; - - printf("======================================================================\n"); - printf("Effects Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("==============================-------=================================\n"); - printf("This demonstrates the use of FMOD event effects. It simply plays an\n"); - printf("event with effects applied and allows the user to adjust the parameters.\n"); - printf("======================================================================\n\n"); - - ERRCHECK(result = FMOD::EventSystem_Create(&eventsystem)); - ERRCHECK(result = eventsystem->init(64, FMOD_INIT_NORMAL, 0, FMOD_EVENT_INIT_NORMAL)); - ERRCHECK(result = eventsystem->setMediaPath("../media/")); - ERRCHECK(result = eventsystem->load("examples.fev", 0, 0)); - ERRCHECK(result = eventsystem->getEvent("examples/FeatureDemonstration/Effects/PropertyAutomationEffectEnvelope", FMOD_EVENT_DEFAULT, &event)); - ERRCHECK(result = event->getParameter("param00", ¶m00)); - ERRCHECK(result = param00->getRange(¶m00_min, ¶m00_max)); - ERRCHECK(result = param00->setValue(0.0f)); - ERRCHECK(result = event->start()); - - printf("======================================================================\n"); - printf("Press '<' or ',' to decrease param00\n"); - printf("Press '>' or '.' to increase param00\n"); - printf("Press ESC to quit\n"); - printf("======================================================================\n"); - - param00_increment = (param00_max - param00_min) / UPDATE_INTERVAL; - ERRCHECK(result = param00->getValue(¶m00_val)); - - key = 0; - do - { - if (_kbhit()) - { - key = _getch(); - - if (key == '<' || key == ',') - { - param00_val -= param00_increment; - if (param00_val < param00_min) - { - param00_val = param00_min; - } - - ERRCHECK(result = param00->setValue(param00_val)); - } - else if (key == '>' || key == '.') - { - param00_val += param00_increment; - if (param00_val > param00_max) - { - param00_val = param00_max; - } - - ERRCHECK(result = param00->setValue(param00_val)); - } - } - - ERRCHECK(result = eventsystem->update()); - Sleep(15); - - printf("param00 = %.4f \r", param00_val); - fflush(stdout); - - } while (key != 27); - - ERRCHECK(result = eventsystem->release()); - return 0; -} diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/examples.fdp.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/examples.fdp.REMOVED.git-id deleted file mode 100644 index 252d47f4fc..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/examples.fdp.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -43792cb1642846d4b3d83b8720e43c2e4b7730b5 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/info_only/Makefile b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/info_only/Makefile deleted file mode 100644 index 0426f8d042..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/info_only/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -all: main.cpp - g++ -O3 -o info_only -I../../../api/inc main.cpp ../../api/lib/libfmodevent.so -Wl,-rpath ../../../api/lib - -run: - ./info_only - -clean: - rm -f info_only diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/info_only/main.cpp b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/info_only/main.cpp deleted file mode 100644 index 5a8813a9c5..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/info_only/main.cpp +++ /dev/null @@ -1,210 +0,0 @@ -/*=============================================================================================== - Info-only Event Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - Demonstrates usage and functionality of info-only events -===============================================================================================*/ -#include "../../../examples/common/wincompat.h" - -#include "../../api/inc/fmod_event.hpp" -#include "../../../api/inc/fmod_errors.h" - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD::EventSystem *eventsystem; - FMOD::EventGroup *eventgroup; - FMOD::Event *event = 0; - FMOD_RESULT result; - int key; - - printf("======================================================================\n"); - printf("Info-only Event Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("==============================-------=================================\n"); - printf("This demonstrates usage and functionality of info-only events.\n"); - printf("======================================================================\n\n"); - - ERRCHECK(result = FMOD::EventSystem_Create(&eventsystem)); - ERRCHECK(result = eventsystem->init(64, FMOD_INIT_NORMAL, 0, FMOD_EVENT_INIT_NORMAL)); - ERRCHECK(result = eventsystem->setMediaPath("../media/")); - ERRCHECK(result = eventsystem->load("examples.fev", 0, 0)); - ERRCHECK(result = eventsystem->getGroup("examples/FeatureDemonstration/Basics", false, &eventgroup)); - - printf("======================================================================\n"); - printf("Press 'i' to get an info-only event\n"); - printf("Press 'e' to get an event instance\n"); - printf("Press 'u' to unload all event data\n"); - printf("Press '1' - '0' to set event volume between 10%% - 100%%\n"); - printf("Press Space to start/stop the current event\n"); - printf("Press ESC to quit\n"); - printf("======================================================================\n"); - - bool state_changed = true; - - key = 0; - do - { - if (_kbhit()) - { - - key = _getch(); - - if (key == 'i') - { - /* Get an info-only event. - Notes: - - This is the parent from which all instances of the - specified event are derived. - - This call will not allocate memory for event instances or - load sample data. - - The resulting event cannot be played, it simply allows - querying and setting of event properties. - - Any properties which are set on the info-only event will be - copied to all instances which are retrieved from then on. - */ - ERRCHECK(result = eventgroup->getEvent("BasicEventWithLooping", FMOD_EVENT_INFOONLY, &event)); - printf("getEvent(FMOD_EVENT_INFOONLY) succeeded\n"); - state_changed = true; - } - else if (key == 'e') - { - /* Get an event instance. - Notes: - - This call will allocate memory for event instances and - load sample data if required. - - The resulting event can be played. - - Any properties which have been set on the info-only event - will be copied to this instance. - */ - ERRCHECK(result = eventgroup->getEvent("BasicEventWithLooping", FMOD_EVENT_DEFAULT, &event)); - printf("getEvent(FMOD_EVENT_DEFAULT) succeeded\n"); - state_changed = true; - } - else if (key == ' ') - { - if (event) - { - FMOD_EVENT_STATE state; - - result = event->getState(&state); - if (result != FMOD_ERR_INVALID_HANDLE) - { - ERRCHECK(result); - } - - if (state & FMOD_EVENT_STATE_PLAYING) - { - /* Attempt to stop the event. - - This will fail if the event is info-only. - */ - result = event->stop(); - if(result == FMOD_OK) - { - printf("event->stop() succeeded\n"); - state_changed = true; - } - else - { - printf("event->stop() returned an error:\n\t(%d) %s\n", result, FMOD_ErrorString(result)); - } - } - else - { - /* Attempt to start the event. - - This will fail if the event is info-only. - */ - result = event->start(); - if (result == FMOD_OK) - { - printf("event->start() succeeded\n"); - state_changed = true; - } - else - { - printf("event->start() returned an error:\n\t(%d) %s\n", result, FMOD_ErrorString(result)); - } - } - } - } - else if (key >= '0' && key <= '9') - { - /* Attempt to set the event's volume. - - This will succeed on both info-only events and instances. - - Volume set on the info-only event will be copied to - all instances retrieved from now on. - - Volume set on an instance will only apply to that instance. - */ - float volume = (float)(key - '0'); - - if (volume == 0) - { - volume = 10.0f; - } - - volume /= 10.0f; - - result = event->setVolume(volume); - if (result == FMOD_OK) - { - printf("event->setVolume() succeeded\n"); - state_changed = true; - } - else - { - printf("event->setVolume() returned an error:\n\t(%d) %s\n", result, FMOD_ErrorString(result)); - } - } - else if (key == 'u') - { - ERRCHECK(result = eventgroup->freeEventData()); - printf("Event data unloaded\n"); - state_changed = true; - } - - } - - if (state_changed) - { - int memory_current, memory_max; - ERRCHECK(result = FMOD::Memory_GetStats(&memory_current, &memory_max)); - - printf("Memory usage: current = %10d, max = %10d\n", memory_current, memory_max); - - if (event) - { - /* Attempt to get the event's volume. - - This will succeed on both info-only events and instances. - */ - float volume; - - result = event->getVolume(&volume); - if (result != FMOD_ERR_INVALID_HANDLE) - { - ERRCHECK(result); - printf("Volume: %.2f\n", volume); - } - } - - state_changed = false; - } - - ERRCHECK(result = eventsystem->update()); - fflush(stdout); - Sleep(15); - - } while (key != 27); - - ERRCHECK(result = eventgroup->freeEventData()); - ERRCHECK(result = eventsystem->release()); - return 0; -} diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/load_data/Makefile b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/load_data/Makefile deleted file mode 100644 index 19f0f08447..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/load_data/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -all: main.cpp - g++ -O3 -o load_data -I../../../api/inc main.cpp ../../api/lib/libfmodevent.so -Wl,-rpath ../../../api/lib - -run: - ./load_data - -clean: - rm -f load_data diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/load_data/main.cpp b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/load_data/main.cpp deleted file mode 100644 index 352711db79..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/load_data/main.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/*=============================================================================================== - Load Event Data Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - Demonstrates basic loading and unloading of event data per event -===============================================================================================*/ -#include "../../../examples/common/wincompat.h" - -#include "../../api/inc/fmod_event.hpp" -#include "../../../api/inc/fmod_errors.h" - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD::EventSystem *eventsystem; - FMOD::EventGroup *eventgroup; - FMOD::Event *event = 0; - FMOD_RESULT result; - int key; - - printf("======================================================================\n"); - printf("Load Event Data Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("==============================-------=================================\n"); - printf("This demonstrates loading and unloading of event data per event and\n"); - printf("per group.\n"); - printf("======================================================================\n\n"); - - ERRCHECK(result = FMOD::EventSystem_Create(&eventsystem)); - ERRCHECK(result = eventsystem->init(64, FMOD_INIT_NORMAL, 0, FMOD_EVENT_INIT_NORMAL)); - ERRCHECK(result = eventsystem->setMediaPath("../media/")); - ERRCHECK(result = eventsystem->load("examples.fev", 0, 0)); - ERRCHECK(result = eventsystem->getGroup("examples/FeatureDemonstration/Basics", false, &eventgroup)); - - printf("======================================================================\n"); - printf("Press 'e' to load event data\n"); - printf("Press 'E' to unload event data\n"); - printf("Press 'g' to load group data\n"); - printf("Press 'G' to unload group data\n"); - printf("Press ESC to quit\n"); - printf("======================================================================\n"); - - bool memory_changed = true; - - key = 0; - do - { - if (_kbhit()) - { - - key = _getch(); - - if (key == 'e') - { - ERRCHECK(result = eventgroup->getEvent("SimpleEvent", FMOD_EVENT_DEFAULT, &event)); - printf("Event data loaded\n"); - memory_changed = true; - } - else if (key == 'E') - { - if (event) - { - result = eventgroup->freeEventData(event); - if (result != FMOD_ERR_INVALID_HANDLE) - { - ERRCHECK(result); - printf("Event data unloaded\n"); - memory_changed = true; - } - event = 0; - } - } - else if (key == 'g') - { - ERRCHECK(result = eventgroup->loadEventData()); - printf("Event group data loaded\n"); - memory_changed = true; - } - else if (key == 'G') - { - ERRCHECK(result = eventgroup->freeEventData()); - printf("Event group data unloaded\n"); - memory_changed = true; - } - - } - - if (memory_changed) - { - int memory_current, memory_max; - ERRCHECK(result = FMOD::Memory_GetStats(&memory_current, &memory_max)); - - printf("Memory usage: current = %10d, max = %10d\n", memory_current, memory_max); - memory_changed = false; - } - - ERRCHECK(result = eventsystem->update()); - fflush(stdout); - Sleep(15); - - } while (key != 27); - - ERRCHECK(result = eventgroup->freeEventData()); - ERRCHECK(result = eventsystem->release()); - return 0; -} diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/max_playbacks/Makefile b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/max_playbacks/Makefile deleted file mode 100644 index 1017a1819a..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/max_playbacks/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -all: main.cpp - g++ -O3 -o max_playbacks -I../../../api/inc main.cpp ../../api/lib/libfmodevent.so -Wl,-rpath ../../../api/lib - -run: - ./max_playbacks - -clean: - rm -f max_playbacks diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/max_playbacks/main.cpp b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/max_playbacks/main.cpp deleted file mode 100644 index ed846e37d6..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/max_playbacks/main.cpp +++ /dev/null @@ -1,262 +0,0 @@ -/*============================================================================= - Max Playbacks Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - Demonstrates basic usage of event max playbacks behaviour. -=============================================================================*/ -#include "../../../examples/common/wincompat.h" - -#include "../../api/inc/fmod_event.hpp" -#include "../../../api/inc/fmod_errors.h" - -const char *MEDIA_PATH = "../media/"; - -static float g_distance = 2.0f; -static float g_sound = 0.0f; - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -void setupEvent(FMOD::Event *event) -{ - FMOD_RESULT result; - FMOD::EventParameter *param; - FMOD_VECTOR pos = {0, 0, g_distance}; - - ERRCHECK(result = event->set3DAttributes(&pos, 0, 0)); - ERRCHECK(result = event->getParameter("sound", ¶m)); - ERRCHECK(result = param->setValue(g_sound)); -} - - -void stopAllEvents(FMOD::EventGroup *eventgroup) -{ - ERRCHECK(eventgroup->freeEventData()); -} - - -int main(int argc, char *argv[]) -{ - FMOD_RESULT result; - FMOD::EventSystem *eventsystem; - FMOD::EventGroup *eventgroup; - FMOD::Event *event; - int key; - - enum - { - StealOldest, - StealNewest, - StealQuietest, - JustFail, - JustFailIfQuietest - } event_behaviour = StealOldest; - - ERRCHECK(result = FMOD::EventSystem_Create(&eventsystem)); - ERRCHECK(result = eventsystem->init(64, FMOD_INIT_NORMAL, 0, FMOD_EVENT_INIT_NORMAL)); - ERRCHECK(result = eventsystem->setMediaPath((char *)MEDIA_PATH)); - ERRCHECK(result = eventsystem->load("examples.fev", 0, 0)); - ERRCHECK(result = eventsystem->getGroup("examples/FeatureDemonstration/MaxPlayback", FMOD_EVENT_DEFAULT, &eventgroup)); - ERRCHECK(result); - - printf("======================================================================\n"); - printf("Max Playbacks Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("----------------------------------------------------------------------\n"); - printf("Press '1' to select 'Steal oldest' behaviour\n"); - printf("Press '2' to select 'Steal newest' behaviour\n"); - printf("Press '3' to select 'Steal quietest' behaviour\n"); - printf("Press '4' to select 'Just fail' behaviour\n"); - printf("Press '5' to select 'Just fail if quietest' behaviour\n"); - printf("Press Space to start an event\n"); - printf("Press 's' to stop all events\n"); - printf("Press '>' to increase event distance\n"); - printf("Press '<' to decrease event distance\n"); - printf("Press ESC to quit\n"); - printf("======================================================================\n"); - - key = 0; - do - { - if (_kbhit()) - { - key = _getch(); - - switch(key) - { - case '1' : // 'Steal oldest' - event_behaviour = StealOldest; - stopAllEvents(eventgroup); - break; - - case '2' : // 'Steal newest' - event_behaviour = StealNewest; - stopAllEvents(eventgroup); - break; - - case '3' : // 'Steal quietest' - event_behaviour = StealQuietest; - stopAllEvents(eventgroup); - break; - - case '4' : // 'Just fail' - event_behaviour = JustFail; - stopAllEvents(eventgroup); - break; - - case '5' : // 'Just fail if quietest' - event_behaviour = JustFailIfQuietest; - stopAllEvents(eventgroup); - break; - - case ' ' : // Play an event - const char *name; - - switch(event_behaviour) - { - case StealOldest : - name = "MaxPlay-StealOldest"; - break; - - case StealNewest : - name = "MaxPlay-StealNewest"; - break; - - case StealQuietest : - name = "MaxPlay-StealQuietest"; - break; - - case JustFail : - name = "MaxPlay-JustFail"; - break; - - case JustFailIfQuietest : - name = "MaxPlay-JustFailIfQuietest"; - break; - } - - // Clear the line - printf("%79s\r", " "); - - if (event_behaviour == JustFailIfQuietest) - { - /* The 'Just fail if quietest' behaviour calculates the expected - volume of the event based on the properties of the info-only - event, so we have to get the info-only event first and set it - up appropriately. - */ - - // get the info-only event to set up for volume calculation - ERRCHECK(result = eventgroup->getEvent(name, FMOD_EVENT_INFOONLY, &event)); - - /* set the desired properties on the info-only event - Notes: - - distances below the event's 3D Min Distance all give the - same volume; in this case, getEvent will just fail - - we could set other volume-affecting properties here as - well (e.g. orientation if the event has a falloff cone) - */ - setupEvent(event); - - // attempt to get a real event instance - result = eventgroup->getEvent(name, FMOD_EVENT_DEFAULT, &event); - if (result == FMOD_OK) - { - printf("getEvent(\"%s\") succeeded\n", name); - - /* we don't need to set the position of the instance, - as it is copied from the info-only event, but we - do need to set the parameter value. - */ - FMOD::EventParameter *param; - ERRCHECK(result = event->getParameter("sound", ¶m)); - ERRCHECK(result = param->setValue(g_sound)); - ERRCHECK(result = event->start()); - } - else - { - printf("getEvent(\"%s\") failed\n", name); - } - } - else - { - result = eventgroup->getEvent(name, FMOD_EVENT_DEFAULT, &event); - if (result == FMOD_OK) - { - printf("getEvent(\"%s\") succeeded\n", name); - setupEvent(event); - ERRCHECK(result = event->start()); - } - else - { - printf("getEvent(\"%s\") failed\n", name); - } - } - - ++g_sound; - if(g_sound > 3) - { - g_sound = 0; - } - - break; - - case 's' : - stopAllEvents(eventgroup); - break; - - case '>' : case '.' : - g_distance += 0.1f; - break; - - case '<' : case ',' : - g_distance -= 0.1f; - g_distance = (g_distance < 0.0f) ? 0.0f : g_distance; - break; - } - - const char *name; - - switch(event_behaviour) - { - case StealOldest: - name = "Steal oldest"; - break; - - case StealNewest: - name = "Steal newest"; - break; - - case StealQuietest: - name = "Steal quietest"; - break; - - case JustFail: - name = "Just fail"; - break; - - case JustFailIfQuietest: - name = "Just fail if quietest"; - break; - } - - printf("Sound = %1.0f, Distance = %4.1f, Behaviour = %-25s\r", g_sound, g_distance, name); - } - - ERRCHECK(result = eventsystem->update()); - fflush(stdout); - Sleep(10); - - } while (key != 27); - - ERRCHECK(result = eventsystem->unload()); - ERRCHECK(result = eventsystem->release()); - return 0; -} diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/2011_cycle_sustain01.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/2011_cycle_sustain01.ogg.REMOVED.git-id deleted file mode 100644 index 97e8ab0f63..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/2011_cycle_sustain01.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -e2a2e733a0126fee306b208822686d0081e66acc \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/2011_cycle_sustain02.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/2011_cycle_sustain02.ogg.REMOVED.git-id deleted file mode 100644 index 8d0cf95680..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/2011_cycle_sustain02.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -f8dde9268e949e35010a8c8b6801359dfca04819 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/bow_still01.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/bow_still01.ogg.REMOVED.git-id deleted file mode 100644 index b71a0bdeec..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/bow_still01.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -b312cb01e5ded13da239f4d3f752a608c41b557d \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/bow_still02.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/bow_still02.ogg.REMOVED.git-id deleted file mode 100644 index 90132ecc68..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/bow_still02.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -aea098b6eb1177eb8852cbc7f444851870e9fe85 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/bow_wake01.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/bow_wake01.ogg.REMOVED.git-id deleted file mode 100644 index 84c1f794b6..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/bow_wake01.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -0c9d11aaf531a28b090a228d98ef2302dae28ef2 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/bow_wake02.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/bow_wake02.ogg.REMOVED.git-id deleted file mode 100644 index 238ba6d26e..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/bow_wake02.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -bae6f9e68daba1c6b4097453e2844cb684e24746 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/bow_wake03.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/bow_wake03.ogg.REMOVED.git-id deleted file mode 100644 index 7f8cdff633..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/bow_wake03.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -43d5e62c789f1035a0a986cb215e9d932b4ac85b \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/buzz01.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/buzz01.ogg.REMOVED.git-id deleted file mode 100644 index 136db2f2fc..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/buzz01.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -e2c58ac1956cfee7aecc8033e9fec00bf8e2497c \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/buzz02.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/buzz02.ogg.REMOVED.git-id deleted file mode 100644 index b269cb1913..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/buzz02.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -09f1efffb52749cf3c82ea1c24bf065f7056551c \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/cables_creak01.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/cables_creak01.ogg.REMOVED.git-id deleted file mode 100644 index f7e32bc4bd..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/cables_creak01.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -916e693027521346650e90bd6952793588fa0195 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/cables_creak02.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/cables_creak02.ogg.REMOVED.git-id deleted file mode 100644 index de28399f7a..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/cables_creak02.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -26761bd8578998bf074c69128737cb46a679c70d \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/cables_creak03.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/cables_creak03.ogg.REMOVED.git-id deleted file mode 100644 index 746450b9a2..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/cables_creak03.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -5ad73b03237f48954731570111e2f05c1fde8d62 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/cables_creak05.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/cables_creak05.ogg.REMOVED.git-id deleted file mode 100644 index ccdaa46c8b..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/cables_creak05.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -13ed499abdbb01ecf2e6a4bdc61808be040c3a75 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/cables_creak06.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/cables_creak06.ogg.REMOVED.git-id deleted file mode 100644 index 61e1f792a4..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/cables_creak06.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -6d10c587d407edd29d1397b29a004c778e0371e6 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/cables_creak07.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/cables_creak07.ogg.REMOVED.git-id deleted file mode 100644 index 79c12c63cc..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/cables_creak07.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -45d681f35f416ac35de5f7c01813059a79f7589d \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/engine_component01.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/engine_component01.ogg.REMOVED.git-id deleted file mode 100644 index fb746ce3b3..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/engine_component01.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -90a0062c3dca0a154495d1c333a6849b69ea8864 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/engine_component02.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/engine_component02.ogg.REMOVED.git-id deleted file mode 100644 index 9946062b14..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/engine_component02.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -e044d58c9cb09d6720fb0a1bc7bf25d3cb8ce995 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/engine_component03.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/engine_component03.ogg.REMOVED.git-id deleted file mode 100644 index c753e19a28..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/engine_component03.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -6f134247f16790f043e40e57e348417f8727be8e \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/engine_component04.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/engine_component04.ogg.REMOVED.git-id deleted file mode 100644 index e44be4527d..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/engine_component04.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -ec4c28d9c4161ea0133757690cdaddfa3f977846 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/engine_component06.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/engine_component06.ogg.REMOVED.git-id deleted file mode 100644 index 488a802e6e..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/engine_component06.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -4aaf6cb5a1b9047d51d6b621c9f9d58437840b36 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/engine_component07.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/engine_component07.ogg.REMOVED.git-id deleted file mode 100644 index 89dc7f66a6..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/engine_component07.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -b27ac42c00b2c3d4f293f7a86bf8e1ecea87b083 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/engine_load.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/engine_load.ogg.REMOVED.git-id deleted file mode 100644 index a52be6939e..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/engine_load.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -7f7e29bd67f11dc5adc0015187b6a1241a47581a \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/metal_creak_light_12.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/metal_creak_light_12.ogg.REMOVED.git-id deleted file mode 100644 index a7e3d7a741..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/metal_creak_light_12.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -a39f23108be827f9115b3b10f29f3e527f23d88b \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/metal_screech03.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/metal_screech03.ogg.REMOVED.git-id deleted file mode 100644 index f91b87255a..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/Submarine/metal_screech03.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -24fd1ca5c0103f010336d1393b1e74ccc55a6544 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/crickets.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/crickets.ogg.REMOVED.git-id deleted file mode 100644 index ec6b1d0cc8..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/2011/crickets.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -dac17685c736c9d8c4179ea8dfe981a1dfa80c0d \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/build_media_files.sh b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/build_media_files.sh deleted file mode 100644 index f49824093d..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/build_media_files.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -cd ../../../tools/fsbanklib -./example -cp *.fsb ../../fmoddesignerapi/examples/media diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/car/Readme Copyright.txt b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/car/Readme Copyright.txt deleted file mode 100644 index 2166a501ba..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/car/Readme Copyright.txt +++ /dev/null @@ -1,3 +0,0 @@ -The contents of this folder are protected by international copyright laws and are for evaluation purposes only. These files remain the property of Soundwave Concepts. - -(c) 2005 Greg Hill - Soundwave Concepts \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/examples.fev b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/examples.fev deleted file mode 100644 index bd25a10a89..0000000000 Binary files a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/examples.fev and /dev/null differ diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/interactive_music_1.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/interactive_music_1.ogg.REMOVED.git-id deleted file mode 100644 index c820803e7b..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/interactive_music_1.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -e0e59ea67518c7b05cabdf52a31d5d92c7eada49 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/interactive_music_2.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/interactive_music_2.ogg.REMOVED.git-id deleted file mode 100644 index f97d5fb08e..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/interactive_music_2.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -9dd7037ce15d071cdfe6de30460fc66289157101 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/interactive_music_3.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/interactive_music_3.ogg.REMOVED.git-id deleted file mode 100644 index 518248edc4..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/interactive_music_3.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -9c585da7ae860970ce501f1520ddb98ae6527c6a \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/interactive_music_6channel.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/interactive_music_6channel.ogg.REMOVED.git-id deleted file mode 100644 index 1fee08148e..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/interactive_music_6channel.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -0212f56337f732c62d8fab11552ae4c52a17c460 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/music/excited.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/music/excited.ogg.REMOVED.git-id deleted file mode 100644 index d0a62ddf6f..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/music/excited.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -1efc1a3905adf24cfdde46644640a93065027da5 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/music/relaxed.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/music/relaxed.ogg.REMOVED.git-id deleted file mode 100644 index c8b1304ac5..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/music/relaxed.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -f5ce0238c297f7ee359f8c9dadeeae96b1dd789b \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/music/state-idle-01.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/music/state-idle-01.ogg.REMOVED.git-id deleted file mode 100644 index 1d6c4df561..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/music/state-idle-01.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -34355c43c2a63766ed977879797d9701a956420e \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/music/state-idle-02.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/music/state-idle-02.ogg.REMOVED.git-id deleted file mode 100644 index 88863d208f..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/music/state-idle-02.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -598588a81b43a673d59bfcf8f5207d51c8a88f94 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/music/state-idle-03.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/music/state-idle-03.ogg.REMOVED.git-id deleted file mode 100644 index e0ef29c346..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/music/state-idle-03.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -80cf3d5869aedcd008977e0ff632bdbb07d4edc9 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/music/state-idle-fadeout.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/music/state-idle-fadeout.ogg.REMOVED.git-id deleted file mode 100644 index 086d78972e..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/music/state-idle-fadeout.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -6270ae17cbc368d71decdd6b1bf561e45fc8aaa5 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/music/state-race-finish.ogg.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/music/state-race-finish.ogg.REMOVED.git-id deleted file mode 100644 index d4fb1cc9c6..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/music/state-race-finish.ogg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -fd9c8bcc912ab192ce616872c9ede9b054c5a73a \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/onefootstep.wav.REMOVED.git-id b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/onefootstep.wav.REMOVED.git-id deleted file mode 100644 index 4a2ef96555..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/onefootstep.wav.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -4f9da84d59ae995355e22ad02808c196c7ebcadd \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/streaming_bank.txt b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/streaming_bank.txt deleted file mode 100644 index dd0dfc2921..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/streaming_bank.txt +++ /dev/null @@ -1 +0,0 @@ -interactive_music_6channel.ogg, quality=0, fsound_loop_normal diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/tutorial_bank.txt b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/tutorial_bank.txt deleted file mode 100644 index 80f1184baa..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/media/tutorial_bank.txt +++ /dev/null @@ -1,267 +0,0 @@ -2011\2011_cycle_off.ogg, quality=0, fsound_loop_off -2011\2011_cycle_on.ogg, quality=0, fsound_loop_off -2011\2011_cycle_sustain01.ogg, quality=0, fsound_loop_normal -2011\2011_cycle_sustain02.ogg, quality=0, fsound_loop_normal -2011\2011_cycle_sustain_spawn_grain.ogg, quality=0, fsound_loop_off -2011\beep01.ogg, quality=0, fsound_loop_off -2011\bird_call01.ogg, quality=0, fsound_loop_off -2011\bird_call02.ogg, quality=0, fsound_loop_off -2011\bird_call03.ogg, quality=0, fsound_loop_off -2011\bird_call04.ogg, quality=0, fsound_loop_off -2011\bird_call05.ogg, quality=0, fsound_loop_off -2011\bird_call06.ogg, quality=0, fsound_loop_off -2011\bird_call07.ogg, quality=0, fsound_loop_off -2011\bird_call08.ogg, quality=0, fsound_loop_off -2011\bird_call09.ogg, quality=0, fsound_loop_off -2011\bird_call10.ogg, quality=0, fsound_loop_off -2011\bird_call11.ogg, quality=0, fsound_loop_off -2011\bird_call12.ogg, quality=0, fsound_loop_off -2011\bird_call13.ogg, quality=0, fsound_loop_off -2011\bird_call14.ogg, quality=0, fsound_loop_off -2011\bird_call15.ogg, quality=0, fsound_loop_off -2011\bird_call16.ogg, quality=0, fsound_loop_off -2011\bubble_burst01.ogg, quality=0, fsound_loop_off -2011\bubble_burst02.ogg, quality=0, fsound_loop_off -2011\bubble_burst03.ogg, quality=0, fsound_loop_off -2011\bubble_burst04.ogg, quality=0, fsound_loop_off -2011\bubble_burst05.ogg, quality=0, fsound_loop_off -2011\bubble_burst06.ogg, quality=0, fsound_loop_off -2011\bubbles_close01.ogg, quality=0, fsound_loop_off -2011\bubbles_close02.ogg, quality=0, fsound_loop_off -2011\bubbles_close03.ogg, quality=0, fsound_loop_off -2011\bubbles_close04.ogg, quality=0, fsound_loop_off -2011\bubbles_close05.ogg, quality=0, fsound_loop_off -2011\bubbles_close06.ogg, quality=0, fsound_loop_off -2011\bubbles_small01.ogg, quality=0, fsound_loop_off -2011\bubbles_small02.ogg, quality=0, fsound_loop_off -2011\bubbles_small03.ogg, quality=0, fsound_loop_off -2011\bubbles_small04.ogg, quality=0, fsound_loop_off -2011\bubbles_small05.ogg, quality=0, fsound_loop_off -2011\bubbles_small06.ogg, quality=0, fsound_loop_off -2011\cricket_single_cycle.ogg, quality=0, fsound_loop_off -2011\crickets.ogg, quality=0, fsound_loop_normal -2011\decending tone.ogg, quality=0, fsound_loop_off -2011\detonation01.ogg, quality=0, fsound_loop_off -2011\detonation02.ogg, quality=0, fsound_loop_off -2011\detonation03.ogg, quality=0, fsound_loop_off -2011\detonation04.ogg, quality=0, fsound_loop_off -2011\detonation05.ogg, quality=0, fsound_loop_off -2011\detonation06.ogg, quality=0, fsound_loop_off -2011\earth_debris01.ogg, quality=0, fsound_loop_off -2011\earth_debris02.ogg, quality=0, fsound_loop_off -2011\earth_debris03.ogg, quality=0, fsound_loop_off -2011\earth_debris04.ogg, quality=0, fsound_loop_off -2011\earth_debris05.ogg, quality=0, fsound_loop_off -2011\earth_debris06.ogg, quality=0, fsound_loop_off -2011\earth_debris07.ogg, quality=0, fsound_loop_off -2011\earth_debris08.ogg, quality=0, fsound_loop_off -2011\flame_burst_long01.ogg, quality=0, fsound_loop_off -2011\flame_burst_long02.ogg, quality=0, fsound_loop_off -2011\flame_burst_long03.ogg, quality=0, fsound_loop_off -2011\flame_burst_long04.ogg, quality=0, fsound_loop_off -2011\flame_burst_long05.ogg, quality=0, fsound_loop_off -2011\flame_burst_long06.ogg, quality=0, fsound_loop_off -2011\flame_burst_short01.ogg, quality=0, fsound_loop_off -2011\flame_burst_short02.ogg, quality=0, fsound_loop_off -2011\flame_burst_short03.ogg, quality=0, fsound_loop_off -2011\flame_burst_short04.ogg, quality=0, fsound_loop_off -2011\flame_burst_short05.ogg, quality=0, fsound_loop_off -2011\flame_burst_short06.ogg, quality=0, fsound_loop_off -2011\flame_burst_small01.ogg, quality=0, fsound_loop_off -2011\flame_burst_small02.ogg, quality=0, fsound_loop_off -2011\flame_burst_small03.ogg, quality=0, fsound_loop_off -2011\flame_burst_small04.ogg, quality=0, fsound_loop_off -2011\flame_burst_small05.ogg, quality=0, fsound_loop_off -2011\flame_burst_small06.ogg, quality=0, fsound_loop_off -2011\footsteps_concrete_01.ogg, quality=0, fsound_loop_off -2011\footsteps_concrete_02.ogg, quality=0, fsound_loop_off -2011\footsteps_concrete_03.ogg, quality=0, fsound_loop_off -2011\footsteps_concrete_04.ogg, quality=0, fsound_loop_off -2011\footsteps_concrete_05.ogg, quality=0, fsound_loop_off -2011\footsteps_concrete_06.ogg, quality=0, fsound_loop_off -2011\footsteps_concrete_07.ogg, quality=0, fsound_loop_off -2011\footsteps_concrete_08.ogg, quality=0, fsound_loop_off -2011\footsteps_leaves01.ogg, quality=0 -2011\footsteps_leaves02.ogg, quality=0 -2011\footsteps_leaves03.ogg, quality=0, fsound_loop_off -2011\footsteps_leaves04.ogg, quality=0, fsound_loop_off -2011\frog01.ogg, quality=0, fsound_loop_off -2011\frog02.ogg, quality=0, fsound_loop_off -2011\frog03.ogg, quality=0, fsound_loop_off -2011\frog04.ogg, quality=0, fsound_loop_off -2011\glass_shard_smash01.ogg, quality=0, fsound_loop_off -2011\glass_shard_smash02.ogg, quality=0, fsound_loop_off -2011\glass_shard_smash03.ogg, quality=0, fsound_loop_off -2011\glass_shard_smash04.ogg, quality=0, fsound_loop_off -2011\glass_shard_smash05.ogg, quality=0, fsound_loop_off -2011\glass_shard_smash06.ogg, quality=0, fsound_loop_off -2011\glass_shard_smash07.ogg, quality=0, fsound_loop_off -2011\glass_shard_smash08.ogg, quality=0, fsound_loop_off -2011\metal_fragment01.ogg, quality=0, fsound_loop_off -2011\metal_fragment02.ogg, quality=0, fsound_loop_off -2011\metal_fragment03.ogg, quality=0, fsound_loop_off -2011\metal_fragment04.ogg, quality=0, fsound_loop_off -2011\metal_fragment05.ogg, quality=0, fsound_loop_off -2011\metal_fragment06.ogg, quality=0, fsound_loop_off -2011\metal_fragment07.ogg, quality=0, fsound_loop_off -2011\metal_fragment08.ogg, quality=0, fsound_loop_off -2011\rifle_blast01.ogg, quality=0, fsound_loop_off -2011\rifle_blast02.ogg, quality=0, fsound_loop_off -2011\rifle_blast03.ogg, quality=0, fsound_loop_off -2011\shotgun_blast01.ogg, quality=0, fsound_loop_off -2011\shotgun_blast02.ogg, quality=0, fsound_loop_off -2011\shotgun_blast03.ogg, quality=0, fsound_loop_off -2011\splash_large01.ogg, quality=0, fsound_loop_off -2011\splash_large02.ogg, quality=0, fsound_loop_off -2011\splash_large03.ogg, quality=0, fsound_loop_off -2011\splash_large04.ogg, quality=0, fsound_loop_off -2011\splash_large05.ogg, quality=0, fsound_loop_off -2011\splash_medium01.ogg, quality=0, fsound_loop_off -2011\splash_medium02.ogg, quality=0, fsound_loop_off -2011\splash_medium03.ogg, quality=0, fsound_loop_off -2011\splash_medium04.ogg, quality=0, fsound_loop_off -2011\splash_medium05.ogg, quality=0, fsound_loop_off -2011\splash_medium06.ogg, quality=0, fsound_loop_off -2011\splash_medium07.ogg, quality=0, fsound_loop_off -2011\splash_medium08.ogg, quality=0, fsound_loop_off -2011\submarine\bow_still01.ogg, quality=0, fsound_loop_off -2011\submarine\bow_still02.ogg, quality=0, fsound_loop_off -2011\submarine\bow_wake01.ogg, quality=0 -2011\submarine\bow_wake02.ogg, quality=0, fsound_loop_off -2011\submarine\bow_wake03.ogg, quality=0, fsound_loop_off -2011\submarine\buzz01.ogg, quality=0, fsound_loop_off -2011\submarine\buzz02.ogg, quality=0, fsound_loop_off -2011\submarine\cables_creak01.ogg, quality=0, fsound_loop_off -2011\submarine\cables_creak02.ogg, quality=0, fsound_loop_off -2011\submarine\cables_creak03.ogg, quality=0, fsound_loop_off -2011\submarine\cables_creak04.ogg, quality=0, fsound_loop_off -2011\submarine\cables_creak05.ogg, quality=0, fsound_loop_off -2011\submarine\cables_creak06.ogg, quality=0, fsound_loop_off -2011\submarine\cables_creak07.ogg, quality=0, fsound_loop_off -2011\submarine\cables_creak08.ogg, quality=0, fsound_loop_off -2011\submarine\clock_loop.ogg, quality=0, fsound_loop_off -2011\submarine\engine_component01.ogg, quality=0, fsound_loop_off -2011\submarine\engine_component02.ogg, quality=0, fsound_loop_off -2011\submarine\engine_component03.ogg, quality=0, fsound_loop_normal -2011\submarine\engine_component04.ogg, quality=0, fsound_loop_off -2011\submarine\engine_component05.ogg, quality=0, fsound_loop_off -2011\submarine\engine_component06.ogg, quality=0, fsound_loop_off -2011\submarine\engine_component07.ogg, quality=0, fsound_loop_off -2011\submarine\engine_component08.ogg, quality=0, fsound_loop_off -2011\submarine\engine_component09.ogg, quality=0, fsound_loop_off -2011\submarine\engine_component10.ogg, quality=0, fsound_loop_off -2011\submarine\engine_load.ogg, quality=0, fsound_loop_off -2011\submarine\hatch_door_open_close01.ogg, quality=0, fsound_loop_off -2011\submarine\hatch_door_open_close02.ogg, quality=0, fsound_loop_off -2011\submarine\hatch_door_open_close03.ogg, quality=0, fsound_loop_normal -2011\submarine\hatch_door_open_close04.ogg, quality=0, fsound_loop_off -2011\submarine\hatch_door_open_close05.ogg, quality=0, fsound_loop_off -2011\submarine\impact01.ogg, quality=0, fsound_loop_off -2011\submarine\impact02.ogg, quality=0, fsound_loop_off -2011\submarine\impact03.ogg, quality=0, fsound_loop_off -2011\submarine\impact04.ogg, quality=0, fsound_loop_off -2011\submarine\impact05.ogg, quality=0, fsound_loop_off -2011\submarine\impact06.ogg, quality=0, fsound_loop_off -2011\submarine\impact07.ogg, quality=0, fsound_loop_off -2011\submarine\impact08.ogg, quality=0, fsound_loop_off -2011\submarine\impact_heavy01.ogg, quality=0, fsound_loop_off -2011\submarine\impact_heavy02.ogg, quality=0, fsound_loop_off -2011\submarine\impact_heavy03.ogg, quality=0, fsound_loop_off -2011\submarine\impact_heavy04.ogg, quality=0, fsound_loop_off -2011\submarine\impact_heavy05.ogg, quality=0, fsound_loop_off -2011\submarine\impact_heavy06.ogg, quality=0, fsound_loop_off -2011\submarine\impact_heavy07.ogg, quality=0, fsound_loop_off -2011\submarine\metal_creak_light_01.ogg, quality=0, fsound_loop_off -2011\submarine\metal_creak_light_02.ogg, quality=0, fsound_loop_off -2011\submarine\metal_creak_light_03.ogg, quality=0, fsound_loop_off -2011\submarine\metal_creak_light_04.ogg, quality=0, fsound_loop_off -2011\submarine\metal_creak_light_05.ogg, quality=0, fsound_loop_off -2011\submarine\metal_creak_light_06.ogg, quality=0, fsound_loop_off -2011\submarine\metal_creak_light_07.ogg, quality=0, fsound_loop_off -2011\submarine\metal_creak_light_08.ogg, quality=0, fsound_loop_off -2011\submarine\metal_creak_light_09.ogg, quality=0, fsound_loop_off -2011\submarine\metal_creak_light_10.ogg, quality=0, fsound_loop_off -2011\submarine\metal_creak_light_11.ogg, quality=0, fsound_loop_off -2011\submarine\metal_creak_light_12.ogg, quality=0, fsound_loop_off -2011\submarine\metal_screech01.ogg, quality=0, fsound_loop_off -2011\submarine\metal_screech02.ogg, quality=0, fsound_loop_off -2011\submarine\metal_screech03.ogg, quality=0, fsound_loop_off -2011\submarine\metal_screech04.ogg, quality=0, fsound_loop_off -2011\submarine\morse_code_a.ogg, quality=0, fsound_loop_off -2011\submarine\morse_code_b.ogg, quality=0, fsound_loop_off -2011\submarine\morse_code_c.ogg, quality=0, fsound_loop_off -2011\submarine\morse_code_comma.ogg, quality=0, fsound_loop_off -2011\submarine\morse_code_d.ogg, quality=0, fsound_loop_off -2011\submarine\morse_code_e.ogg, quality=0, fsound_loop_off -2011\submarine\morse_code_f.ogg, quality=0, fsound_loop_off -2011\submarine\morse_code_g.ogg, quality=0, fsound_loop_off -2011\submarine\morse_code_h.ogg, quality=0, fsound_loop_off -2011\submarine\morse_code_i.ogg, quality=0, fsound_loop_off -2011\submarine\morse_code_j.ogg, quality=0, fsound_loop_off -2011\submarine\morse_code_k.ogg, quality=0, fsound_loop_off -2011\submarine\sonar.ogg, quality=0, fsound_loop_off -2011\waves_submerged_01.ogg, quality=0, fsound_loop_off -2011\waves_submerged_02.ogg, quality=0, fsound_loop_off -2011\waves_submerged_03.ogg, quality=0, fsound_loop_off -2011\waves_submerged_04.ogg, quality=0, fsound_loop_off -2011\waves_submerged_05.ogg, quality=0, fsound_loop_off -2011\waves_submerged_06.ogg, quality=0, fsound_loop_off -2011\waves_submerged_07.ogg, quality=0, fsound_loop_off -2011\waves_submerged_08.ogg, quality=0, fsound_loop_off -ambient_one_four.ogg, quality=0, fsound_loop_off -ambient_one_loop.ogg, quality=0, fsound_loop_off -ambient_three.ogg, quality=0, fsound_loop_off -ambient_two.ogg, quality=0, fsound_loop_off -car\idle.ogg, quality=0, fsound_loop_normal -car\offhigh.ogg, quality=0, fsound_loop_off -car\offlow.ogg, quality=0, fsound_loop_off -car\offmid.ogg, quality=0, fsound_loop_normal -car\onhigh.ogg, quality=0, fsound_loop_normal -car\onlow.ogg, quality=0, fsound_loop_normal -car\onmid.ogg, quality=0, fsound_loop_normal -drum-loop.ogg, quality=0, fsound_loop_normal -interactive_music_1.ogg, quality=0, fsound_loop_normal -interactive_music_2.ogg, quality=0, fsound_loop_normal -interactive_music_3.ogg, quality=0, fsound_loop_normal -max_play_behavior_four.ogg, quality=0, fsound_loop_normal -max_play_behavior_one.ogg, quality=0, fsound_loop_normal -max_play_behavior_three.ogg, quality=0, fsound_loop_normal -max_play_behavior_two.ogg, quality=0, fsound_loop_normal -music\excited.ogg, quality=0, fsound_loop_normal -music\flsh-idle-01.ogg, quality=0, fsound_loop_normal -music\flsh-idle-02.ogg, quality=0, fsound_loop_normal -music\flsh-idle-03.ogg, quality=0, fsound_loop_normal -music\flsh-idle-04.ogg, quality=0, fsound_loop_normal -music\flsh-idle-05.ogg, quality=0, fsound_loop_normal -music\layer-bass-a.ogg, quality=0, fsound_loop_normal -music\layer-drums-a.ogg, quality=0, fsound_loop_normal -music\layer-drums-b.ogg, quality=0, fsound_loop_normal -music\layer-drums-c.ogg, quality=0, fsound_loop_normal -music\layer-drums-d.ogg, quality=0, fsound_loop_normal -music\layer-guitar-a.ogg, quality=0, fsound_loop_normal -music\layer-guitar-alt-a.ogg, quality=0, fsound_loop_normal -music\layer-guitar-alt-b.ogg, quality=0, fsound_loop_normal -music\layer-guitar-alt-c.ogg, quality=0, fsound_loop_off -music\layer-guitar-alt-d.ogg, quality=0, fsound_loop_off -music\layer-guitar-b.ogg, quality=0, fsound_loop_off -music\layer-guitar-c.ogg, quality=0, fsound_loop_off -music\layer-guitar-d.ogg, quality=0, fsound_loop_off -music\relaxed.ogg, quality=0, fsound_loop_off -music\state-idle-01.ogg, quality=0, fsound_loop_off -music\state-idle-02.ogg, quality=0, fsound_loop_off -music\state-idle-03.ogg, quality=0, fsound_loop_normal -music\state-idle-fadeout.ogg, quality=0, fsound_loop_normal -music\state-race-01a.ogg, quality=0, fsound_loop_normal -music\state-race-01b.ogg, quality=0, fsound_loop_normal -music\state-race-02a.ogg, quality=0, fsound_loop_off -music\state-race-02b.ogg, quality=0, fsound_loop_normal -music\state-race-finish.ogg, quality=0, fsound_loop_normal -music\state-race-start.ogg, quality=0, fsound_loop_normal -note.ogg, quality=0, fsound_loop_normal -onefootstep.wav, quality=0, fsound_loop_off -sequence-end.ogg, quality=0, fsound_loop_off -sequence-four.ogg, quality=0, fsound_loop_off -sequence-one.ogg, quality=0, fsound_loop_off -sequence-start.ogg, quality=0, fsound_loop_off -sequence-three.ogg, quality=0, fsound_loop_normal -sequence-two.ogg, quality=0, fsound_loop_normal diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/parameters/Makefile b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/parameters/Makefile deleted file mode 100644 index 7be2e4a536..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/parameters/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -all: main.cpp - g++ -O3 -o parameters -I../../../api/inc main.cpp ../../api/lib/libfmodevent.so -Wl,-rpath ../../../api/lib - -run: - ./parameters - -clean: - rm -f parameters diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/parameters/main.cpp b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/parameters/main.cpp deleted file mode 100644 index 086284f105..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/parameters/main.cpp +++ /dev/null @@ -1,145 +0,0 @@ -/*=============================================================================================== - Parameters Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - Demonstrates basic usage of event parameters -===============================================================================================*/ -#include "../../../examples/common/wincompat.h" - -#include "../../api/inc/fmod_event.hpp" -#include "../../../api/inc/fmod_errors.h" - -const float UPDATE_INTERVAL = 100.0f; - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -int main(int argc, char *argv[]) -{ - FMOD::EventSystem *eventsystem; - FMOD::EventGroup *eventgroup; - FMOD::EventCategory *mastercategory; - FMOD::Event *car; - FMOD::EventParameter *rpm; - FMOD::EventParameter *load; - FMOD_RESULT result; - int key; - float rpm_val, rpm_min, rpm_max, rpm_increment, load_val, load_min, load_max, load_increment; - - printf("======================================================================\n"); - printf("Parameters Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("==============================-------=================================\n"); - printf("This demonstrates the use of FMOD event parameters. It simply plays an\n"); - printf("event, retrieves the parameters and allows the user to adjust them.\n"); - printf("======================================================================\n\n"); - - ERRCHECK(result = FMOD::EventSystem_Create(&eventsystem)); - ERRCHECK(result = eventsystem->init(64, FMOD_INIT_NORMAL, 0, FMOD_EVENT_INIT_NORMAL)); - ERRCHECK(result = eventsystem->setMediaPath("../media/")); - ERRCHECK(result = eventsystem->load("examples.fev", 0, 0)); - ERRCHECK(result = eventsystem->getGroup("examples/AdvancedTechniques", FMOD_EVENT_DEFAULT, &eventgroup)); - ERRCHECK(result = eventgroup->getEvent("car", FMOD_EVENT_DEFAULT, &car)); - - ERRCHECK(result = eventsystem->getCategory("master", &mastercategory)); - - ERRCHECK(result = car->getParameter("load", &load)); - ERRCHECK(result = load->getRange(&load_min, &load_max)); - ERRCHECK(result = load->setValue(load_max)); - - ERRCHECK(result = car->getParameterByIndex(0, &rpm)); - ERRCHECK(result = rpm->getRange(&rpm_min, &rpm_max)); - ERRCHECK(result = rpm->setValue(1000.0f)); - - ERRCHECK(result = car->start()); - - printf("======================================================================\n"); - printf("Press '<' or ',' to decrease RPM\n"); - printf("Press '>' or '.' to increase RPM\n"); - printf("Press '-' or '_' to decrease load\n"); - printf("Press '+' or '=' to increase load\n"); - printf("Press ESC to quit\n"); - printf("======================================================================\n"); - - rpm_increment = (rpm_max - rpm_min) / UPDATE_INTERVAL; - ERRCHECK(result = rpm->getValue(&rpm_val)); - load_increment = (load_max - load_min) / UPDATE_INTERVAL; - ERRCHECK(result = load->getValue(&load_val)); - - key = 0; - do - { - if (_kbhit()) - { - key = _getch(); - - if (key == '<' || key == ',') - { - rpm_val -= rpm_increment; - if (rpm_val < rpm_min) - { - rpm_val = rpm_min; - } - - ERRCHECK(result = rpm->setValue(rpm_val)); - } - else if (key == '>' || key == '.') - { - rpm_val += rpm_increment; - if (rpm_val > rpm_max) - { - rpm_val = rpm_max; - } - - ERRCHECK(result = rpm->setValue(rpm_val)); - } - if (key == '-' || key == '_') - { - load_val -= load_increment; - if (load_val < load_min) - { - load_val = load_min; - } - - ERRCHECK(result = load->setValue(load_val)); - } - else if (key == '+' || key == '=') - { - load_val += load_increment; - if (load_val > load_max) - { - load_val = load_max; - } - - ERRCHECK(result = load->setValue(load_val)); - } - else if (key == ' ') - { - bool paused; - - ERRCHECK(result = mastercategory->getPaused(&paused)); - paused = !paused; - ERRCHECK(result = mastercategory->setPaused(paused)); - } - - } - - ERRCHECK(result = eventsystem->update()); - Sleep(15); - - printf("RPM = %.4f, load = %.4f \r", rpm_val, load_val); - fflush(stdout); - - } while (key != 27); - - ERRCHECK(result = eventgroup->freeEventData()); - ERRCHECK(result = eventsystem->release()); - return 0; -} diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/programmer_selected/Makefile b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/programmer_selected/Makefile deleted file mode 100644 index 975fea3702..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/programmer_selected/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -all: main.cpp - g++ -O3 -o programmer_selected -I../../../api/inc main.cpp ../../api/lib/libfmodevent.so -Wl,-rpath ../../../api/lib - -run: - ./programmer_selected - -clean: - rm -f programmer_selected diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/programmer_selected/main.cpp b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/programmer_selected/main.cpp deleted file mode 100644 index edeb56629e..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/programmer_selected/main.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/*============================================================================= - Programmer Selected Sound Definition Example - Copyright (c), Firelight Technologies Pty, Ltd 2007-2011. - - Demonstrates how to use the "programmer selected sound definition" feature of - the FMOD event system -=============================================================================*/ -#include "../../../examples/common/wincompat.h" - -#include "../../api/inc/fmod_event.hpp" -#include "../../../api/inc/fmod_errors.h" - -const char *MEDIA_PATH = "../media/"; - -static int g_sounddef_entry_index = 0; - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -FMOD_RESULT F_CALLBACK eventcallback(FMOD_EVENT *event, FMOD_EVENT_CALLBACKTYPE type, void *param1, void *param2, void *userdata) -{ - switch (type) - { - case FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_SELECTINDEX : - { - char *name = (char *)param1; // [in] (char *) name of sound definition - int *index = (int *)param2; // [out] (int *) the sounddef entry index to use - - *index = (g_sounddef_entry_index < *index) ? g_sounddef_entry_index : *index - 1; - printf("FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_SELECTINDEX '%s': %d\n", name, *index); - - break; - } - } - - return FMOD_OK; -} - - -int main(int argc, char *argv[]) -{ - FMOD_RESULT result; - FMOD::EventSystem *eventsystem; - FMOD::EventGroup *eventgroup; - FMOD::Event *event; - int key; - - ERRCHECK(result = FMOD::EventSystem_Create(&eventsystem)); - ERRCHECK(result = eventsystem->init(64, FMOD_INIT_NORMAL, 0, FMOD_EVENT_INIT_NORMAL)); - ERRCHECK(result = eventsystem->setMediaPath((char *)MEDIA_PATH)); - ERRCHECK(result = eventsystem->load("examples.fev", 0, 0)); - ERRCHECK(result = eventsystem->getGroup("examples/FeatureDemonstration/SequencingAndStitching", FMOD_EVENT_DEFAULT, &eventgroup)); - - printf("======================================================================\n"); - printf("Programmer Selected Sound Definition.\n"); - printf("Copyright (c) Firelight Technologies 2006-2011.\n"); - printf("----------------------------------------------------------------------\n"); - printf("Press 'Space' to start the 'Programmer Selected' event\n"); - printf("Press '>' to increase sound definition entry index\n"); - printf("Press '<' to decrease sound definition entry index\n"); - printf("Press 'Esc' to quit\n"); - printf("======================================================================\n"); - printf("Sound definition entry index = %d\n", g_sounddef_entry_index); - - key = 0; - do - { - if (_kbhit()) - { - key = _getch(); - - switch(key) - { - case ' ' : - ERRCHECK(result = eventgroup->getEvent("ProgrammerSelected", FMOD_EVENT_DEFAULT, &event)); - ERRCHECK(result = event->setCallback(eventcallback, 0)); - ERRCHECK(result = event->start()); - break; - - case '>' : - ++g_sounddef_entry_index; - printf("Sound definition entry index = %d\n", g_sounddef_entry_index); - break; - - case '<' : - --g_sounddef_entry_index; - g_sounddef_entry_index = (g_sounddef_entry_index < 0) ? 0 : g_sounddef_entry_index; - printf("Sound definition entry index = %d\n", g_sounddef_entry_index); - break; - } - } - - ERRCHECK(result = eventsystem->update()); - fflush(stdout); - Sleep(10); - - } while (key != 27); - - ERRCHECK(result = eventsystem->unload()); - ERRCHECK(result = eventsystem->release()); - return 0; -} diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/programmer_sound/Makefile b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/programmer_sound/Makefile deleted file mode 100644 index fbcefa25bc..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/programmer_sound/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -all: main.cpp - g++ -O3 -o programmer_sound -I../../../api/inc main.cpp ../../api/lib/libfmodevent.so -Wl,-rpath ../../../api/lib - -run: - ./programmer_sound - -clean: - rm -f programmer_sound diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/programmer_sound/main.cpp b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/programmer_sound/main.cpp deleted file mode 100644 index 9ba7a97493..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/programmer_sound/main.cpp +++ /dev/null @@ -1,182 +0,0 @@ -/*============================================================================== - Programmer Sound Example - Copyright (c), Firelight Technologies Pty, Ltd 2006-2011. - - Demonstrates how to use the "programmer sound" feature of the FMOD event system -==============================================================================*/ -#include "../../../examples/common/wincompat.h" - -#include "../../api/inc/fmod_event.hpp" -#include "../../../api/inc/fmod_errors.h" - -const char *MEDIA_PATH = "../media/"; -const char *FSB_NAME = "../media/tutorial_bank.fsb"; - -static int g_sound_index = 0; -static const int SOUND_INDEX_MAX = 4; -static int g_index_map[SOUND_INDEX_MAX]; - -FMOD::Sound *fsb; -FMOD::System *sys; - - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - - -void initIndexMap(FMOD::Sound *fsb) -{ - FMOD_RESULT result; - int numsubsounds, i; - - /* Sounds aren't in a logical order in the FSB, so we need to iterate - through and assign the appropriate filenames to the index map - */ - - ERRCHECK(result = fsb->getNumSubSounds(&numsubsounds)); - - for (i = 0; i < SOUND_INDEX_MAX; ++i) - { - g_index_map[i] = -1; - } - - for (i = 0; i < numsubsounds; ++i) - { - FMOD::Sound *sound; - char name[100]; - - ERRCHECK(result = fsb->getSubSound(i, &sound)); - ERRCHECK(result = sound->getName(name, 100)); - - if(strncmp(name, "sequence-one.ogg", 100) == 0) - { - g_index_map[0] = i; - } - else if(strncmp(name, "sequence-two.ogg", 100) == 0) - { - g_index_map[1] = i; - } - else if(strncmp(name, "sequence-three.ogg", 100) == 0) - { - g_index_map[2] = i; - } - else if(strncmp(name, "sequence-four.ogg", 100) == 0) - { - g_index_map[3] = i; - } - } -} - - -FMOD_RESULT F_CALLBACK eventcallback(FMOD_EVENT *event, FMOD_EVENT_CALLBACKTYPE type, void *param1, void *param2, void *userdata) -{ - FMOD_RESULT result; - - switch (type) - { - case FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_CREATE : - { - char *name = (char *)param1; // [in] (char *) name of sound definition - int entryindex = *((int *)param2); // [in] (int) index of sound definition entry - FMOD::Sound **s = (FMOD::Sound **)param2; // [out] (FMOD::Sound *) a valid lower level API FMOD Sound handle - char sound_name[128]; - - ERRCHECK((g_index_map[g_sound_index] >= 0) ? FMOD_OK : FMOD_ERR_SUBSOUNDS); - ERRCHECK(result = fsb->getSubSound(g_index_map[g_sound_index], s)); - ERRCHECK(result = (*s)->getName(sound_name, 128)); - printf("FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_CREATE '%s' (%d)\n", sound_name, g_index_map[g_sound_index]); - break; - } - - case FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_RELEASE : - { - FMOD::Sound *s = (FMOD::Sound *)param2; // [in] (FMOD::Sound *) the FMOD sound handle that was previously created in FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_CREATE - char sound_name[128]; - - ERRCHECK(result = s->getName(sound_name, 128)); - printf("FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_RELEASE '%s'\n", sound_name); - break; - } - } - - return FMOD_OK; -} - - -int main(int argc, char *argv[]) -{ - FMOD_RESULT result; - FMOD::EventSystem *eventsystem; - FMOD::EventGroup *eventgroup; - FMOD::Event *event; - int key; - - printf("======================================================================\n"); - printf("Programmer Sound. Copyright (c) Firelight Technologies 2006-2011.\n"); - printf("======================================================================\n"); - - ERRCHECK(result = FMOD::EventSystem_Create(&eventsystem)); - ERRCHECK(result = eventsystem->init(64, FMOD_INIT_NORMAL, 0, FMOD_EVENT_INIT_NORMAL)); - ERRCHECK(result = eventsystem->setMediaPath((char *)MEDIA_PATH)); - ERRCHECK(result = eventsystem->load("examples.fev", 0, 0)); - ERRCHECK(result = eventsystem->getGroup("examples/FeatureDemonstration/SequencingAndStitching", FMOD_EVENT_DEFAULT, &eventgroup)); - - ERRCHECK(result = eventsystem->getSystemObject(&sys)); - ERRCHECK(result = sys->createStream(FSB_NAME, FMOD_2D | FMOD_SOFTWARE, 0, &fsb)); - - initIndexMap(fsb); - - printf("======================================================================\n"); - printf("Press 'Space' to start the 'Programmer Sound' event\n"); - printf("Press '>' to increase sound index\n"); - printf("Press '<' to decrease sound index\n"); - printf("Press 'Esc' to quit\n"); - printf("======================================================================\n"); - printf("Sound index = %d\n", g_sound_index + 1); - - key = 0; - do - { - if (_kbhit()) - { - key = _getch(); - - switch(key) - { - case ' ' : - ERRCHECK(result = eventgroup->getEvent("ProgrammerSounds", FMOD_EVENT_DEFAULT, &event)); - ERRCHECK(result = event->setCallback(eventcallback, 0)); - ERRCHECK(result = event->start()); - break; - - case '>' : - ++g_sound_index; - g_sound_index = (g_sound_index >= SOUND_INDEX_MAX) ? SOUND_INDEX_MAX - 1 : g_sound_index; - printf("Sound index = %d\n", g_sound_index + 1); - break; - - case '<' : - --g_sound_index; - g_sound_index = (g_sound_index < 0) ? 0 : g_sound_index; - printf("Sound index = %d\n", g_sound_index + 1); - break; - } - } - - ERRCHECK(result = eventsystem->update()); - fflush(stdout); - Sleep(10); - - } while (key != 27); - - ERRCHECK(result = eventsystem->unload()); - ERRCHECK(result = fsb->release()); - ERRCHECK(result = eventsystem->release()); - return 0; -} diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/realtime_tweaking/Makefile b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/realtime_tweaking/Makefile deleted file mode 100644 index c1e616f0ef..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/realtime_tweaking/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -all: main.cpp - g++ -O3 -o realtime_tweaking -I../../../api/inc main.cpp ../../api/lib/libfmodeventnet.so -Wl,-rpath ../../../api/lib -Wl,-rpath ../../api/lib - -run: - ./realtime_tweaking - -clean: - rm -f realtime_tweaking diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/realtime_tweaking/main.cpp b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/realtime_tweaking/main.cpp deleted file mode 100644 index c96c13f605..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/realtime_tweaking/main.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/*=============================================================================================== - Realtime Tweaking Example - Copyright (c), Firelight Technologies Pty, Ltd 2010-2011. - - Demonstrates basic usage of FMOD's network data-driven event library (fmod_event_net.dll) -===============================================================================================*/ -#include "../../../examples/common/wincompat.h" - -#include "../../api/inc/fmod_event.hpp" -#include "../../api/inc/fmod_event_net.hpp" -#include "../../../api/inc/fmod_errors.h" - -const char *MEDIA_PATH = "../media/"; -const int NUM_EVENTS = 3; - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - -FMOD_RESULT F_CALLBACK eventcallback(FMOD_EVENT *event, FMOD_EVENT_CALLBACKTYPE type, void *param1, void *param2, void *userdata) -{ - if (type == FMOD_EVENT_CALLBACKTYPE_NET_MODIFIED) - { - unsigned int t = (unsigned int)param2; - printf("%p %s %f (%d)\n", event, (unsigned int)param1 == FMOD_EVENTPROPERTY_VOLUME ? "volume" : FMOD_EVENTPROPERTY_PITCH ? "pitch" : "???", *((float *)&t), (unsigned int)userdata); - } - - return FMOD_OK; -} - -int main(int argc, char *argv[]) -{ - FMOD_RESULT result; - FMOD::EventSystem *eventsystem; - FMOD::EventGroup *eventgroup; - FMOD::Event *event[NUM_EVENTS]; - char *event_name[NUM_EVENTS] = { - "Basics/BasicEventWithLooping", - "SequencingAndStitching/LoopLogic", - "3D Events/2D-3DPanMorph" - }; - int key, i, userdata = 0; - - printf("======================================================================\n"); - printf("Realtime Tweaking. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("======================================================================\n"); - printf("This example shows how to initialize the FMOD Net Event System so that\n"); - printf("FMOD Designer can connect to your game and tweak events as they're\n"); - printf("playing.\n"); - printf("Start some events then connect to this app using the Audition menu\n"); - printf("in FMOD Designer. Load examples.fdp and change the \n"); - printf("volume of the playing events using the volume slider in the event\n"); - printf("property sheet\n"); - printf("======================================================================\n\n"); - - ERRCHECK(result = FMOD::EventSystem_Create(&eventsystem)); - ERRCHECK(result = FMOD::NetEventSystem_Init(eventsystem)); - ERRCHECK(result = eventsystem->init(64, FMOD_INIT_NORMAL, 0, FMOD_EVENT_INIT_NORMAL)); - ERRCHECK(result = eventsystem->setMediaPath((char *)MEDIA_PATH)); - ERRCHECK(result = eventsystem->load("examples.fev", 0, 0)); - ERRCHECK(result = eventsystem->getGroup("examples/FeatureDemonstration", FMOD_EVENT_DEFAULT, &eventgroup)); - - for (i=0; i < NUM_EVENTS; i++) - { - event[i] = 0; - } - - printf("======================================================================\n"); - printf("Press 1 - 3 to start/stop events\n"); - printf("Press ESC to quit\n"); - printf("======================================================================\n"); - - key = 0; - do - { - if (_kbhit()) - { - key = _getch(); - - if ((key >= '1') && (key <= '3')) - { - i = (int)(key - '1'); - - if (event[i]) - { - ERRCHECK(result = event[i]->stop()); - event[i] = 0; - printf("Stopping '%s'\n", event_name[i]); - } - else - { - ERRCHECK(result = eventgroup->getEvent(event_name[i], FMOD_EVENT_DEFAULT, &event[i])); - ERRCHECK(result = event[i]->setCallback(eventcallback, (void *)(userdata++))); - ERRCHECK(result = event[i]->start()); - printf("Starting '%s'\n", event_name[i]); - } - } - } - - ERRCHECK(result = eventsystem->update()); - ERRCHECK(result = FMOD::NetEventSystem_Update()); - Sleep(10); - - } while (key != 27); - - ERRCHECK(result = eventsystem->release()); - ERRCHECK(result = FMOD::NetEventSystem_Shutdown()); - return 0; -} - diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/simple_event/Makefile b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/simple_event/Makefile deleted file mode 100644 index aee8bf5f5a..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/simple_event/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -all: main.cpp - g++ -O3 -o simple_event -I../../../api/inc main.cpp ../../api/lib/libfmodevent.so -Wl,-rpath ../../../api/lib - -run: - ./simple_event - -clean: - rm -f simple_event diff --git a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/simple_event/main.cpp b/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/simple_event/main.cpp deleted file mode 100644 index b2bca0ccab..0000000000 --- a/CocosDenshion/third_party/fmod/fmoddesignerapi/examples/simple_event/main.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/*=============================================================================================== - SimpleEvent Example - Copyright (c), Firelight Technologies Pty, Ltd 2004-2011. - - Demonstrates basic usage of FMOD's data-driven event library (fmod_event.dll) -===============================================================================================*/ -#include "../../../examples/common/wincompat.h" - -#include "../../api/inc/fmod_event.hpp" -#include "../../../api/inc/fmod_errors.h" - -void ERRCHECK(FMOD_RESULT result) -{ - if (result != FMOD_OK) - { - printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); - exit(-1); - } -} - -int main(int argc, char *argv[]) -{ - FMOD::EventSystem *eventsystem; - FMOD::Event *event; - FMOD_RESULT result; - int key; - - printf("======================================================================\n"); - printf("Simple Event Example. Copyright (c) Firelight Technologies 2004-2011.\n"); - printf("======================================================================\n"); - printf("This example simply plays an event created with the FMOD Designer tool.\n"); - printf("======================================================================\n\n"); - - ERRCHECK(result = FMOD::EventSystem_Create(&eventsystem)); - ERRCHECK(result = eventsystem->init(64, FMOD_INIT_NORMAL, 0, FMOD_EVENT_INIT_NORMAL)); - ERRCHECK(result = eventsystem->setMediaPath("../media/")); - ERRCHECK(result = eventsystem->load("examples.fev", 0, 0)); - ERRCHECK(result = eventsystem->getEvent("examples/FeatureDemonstration/Basics/SimpleEvent", FMOD_EVENT_DEFAULT, &event)); - - printf("======================================================================\n"); - printf("Press SPACE to play the event.\n"); - printf("Press ESC to quit\n"); - printf("======================================================================\n"); - - key = 0; - do - { - if (_kbhit()) - { - key = _getch(); - - if (key == ' ') - { - ERRCHECK(result = event->start()); - } - } - - ERRCHECK(result = eventsystem->update()); - Sleep(15); - - FMOD_EVENT_STATE state; - ERRCHECK(result = event->getState(&state)); - printf("Event is %s \r", (state & FMOD_EVENT_STATE_PLAYING) ? "playing" : "stopped"); - fflush(stdout); - - } while (key != 27); - - ERRCHECK(result = eventsystem->release()); - return 0; -} diff --git a/CocosDenshion/third_party/fmod/tools/fsbanklib/Makefile b/CocosDenshion/third_party/fmod/tools/fsbanklib/Makefile deleted file mode 100644 index 513c0e5c14..0000000000 --- a/CocosDenshion/third_party/fmod/tools/fsbanklib/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -all: example.cpp - g++ -O3 -o example example.cpp libfsbankex.a ../../api/lib/libfmodex.so - -clean: - rm -f example diff --git a/CocosDenshion/third_party/fmod/tools/fsbanklib/example.REMOVED.git-id b/CocosDenshion/third_party/fmod/tools/fsbanklib/example.REMOVED.git-id deleted file mode 100644 index e7c10d0c9a..0000000000 --- a/CocosDenshion/third_party/fmod/tools/fsbanklib/example.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -fdfc1c2e53360fcdf023e23a6974107ef8f22be0 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/tools/fsbanklib/example.cpp b/CocosDenshion/third_party/fmod/tools/fsbanklib/example.cpp deleted file mode 100644 index 5035cbdafa..0000000000 --- a/CocosDenshion/third_party/fmod/tools/fsbanklib/example.cpp +++ /dev/null @@ -1,369 +0,0 @@ -/* - This example builds the FSB's required for the Designer API examples. -*/ - -#include "fsbank.h" -#include -#include -#include - -const char *gTutorialFileNames[] = -{ - "../../fmoddesignerapi/examples/media/2011/2011_cycle_off.ogg", - "../../fmoddesignerapi/examples/media/2011/2011_cycle_on.ogg", - "../../fmoddesignerapi/examples/media/2011/2011_cycle_sustain01.ogg", - "../../fmoddesignerapi/examples/media/2011/2011_cycle_sustain02.ogg", - "../../fmoddesignerapi/examples/media/2011/2011_cycle_sustain_spawn_grain.ogg", - "../../fmoddesignerapi/examples/media/2011/beep01.ogg", - "../../fmoddesignerapi/examples/media/2011/bird_call01.ogg", - "../../fmoddesignerapi/examples/media/2011/bird_call02.ogg", - "../../fmoddesignerapi/examples/media/2011/bird_call03.ogg", - "../../fmoddesignerapi/examples/media/2011/bird_call04.ogg", - "../../fmoddesignerapi/examples/media/2011/bird_call05.ogg", - "../../fmoddesignerapi/examples/media/2011/bird_call06.ogg", - "../../fmoddesignerapi/examples/media/2011/bird_call07.ogg", - "../../fmoddesignerapi/examples/media/2011/bird_call08.ogg", - "../../fmoddesignerapi/examples/media/2011/bird_call09.ogg", - "../../fmoddesignerapi/examples/media/2011/bird_call10.ogg", - "../../fmoddesignerapi/examples/media/2011/bird_call11.ogg", - "../../fmoddesignerapi/examples/media/2011/bird_call12.ogg", - "../../fmoddesignerapi/examples/media/2011/bird_call13.ogg", - "../../fmoddesignerapi/examples/media/2011/bird_call14.ogg", - "../../fmoddesignerapi/examples/media/2011/bird_call15.ogg", - "../../fmoddesignerapi/examples/media/2011/bird_call16.ogg", - "../../fmoddesignerapi/examples/media/2011/bubble_burst01.ogg", - "../../fmoddesignerapi/examples/media/2011/bubble_burst02.ogg", - "../../fmoddesignerapi/examples/media/2011/bubble_burst03.ogg", - "../../fmoddesignerapi/examples/media/2011/bubble_burst04.ogg", - "../../fmoddesignerapi/examples/media/2011/bubble_burst05.ogg", - "../../fmoddesignerapi/examples/media/2011/bubble_burst06.ogg", - "../../fmoddesignerapi/examples/media/2011/bubbles_close01.ogg", - "../../fmoddesignerapi/examples/media/2011/bubbles_close02.ogg", - "../../fmoddesignerapi/examples/media/2011/bubbles_close03.ogg", - "../../fmoddesignerapi/examples/media/2011/bubbles_close04.ogg", - "../../fmoddesignerapi/examples/media/2011/bubbles_close05.ogg", - "../../fmoddesignerapi/examples/media/2011/bubbles_close06.ogg", - "../../fmoddesignerapi/examples/media/2011/bubbles_small01.ogg", - "../../fmoddesignerapi/examples/media/2011/bubbles_small02.ogg", - "../../fmoddesignerapi/examples/media/2011/bubbles_small03.ogg", - "../../fmoddesignerapi/examples/media/2011/bubbles_small04.ogg", - "../../fmoddesignerapi/examples/media/2011/bubbles_small05.ogg", - "../../fmoddesignerapi/examples/media/2011/bubbles_small06.ogg", - "../../fmoddesignerapi/examples/media/2011/cricket_single_cycle.ogg", - "../../fmoddesignerapi/examples/media/2011/crickets.ogg", - "../../fmoddesignerapi/examples/media/2011/decending tone.ogg", - "../../fmoddesignerapi/examples/media/2011/detonation01.ogg", - "../../fmoddesignerapi/examples/media/2011/detonation02.ogg", - "../../fmoddesignerapi/examples/media/2011/detonation03.ogg", - "../../fmoddesignerapi/examples/media/2011/detonation04.ogg", - "../../fmoddesignerapi/examples/media/2011/detonation05.ogg", - "../../fmoddesignerapi/examples/media/2011/detonation06.ogg", - "../../fmoddesignerapi/examples/media/2011/earth_debris01.ogg", - "../../fmoddesignerapi/examples/media/2011/earth_debris02.ogg", - "../../fmoddesignerapi/examples/media/2011/earth_debris03.ogg", - "../../fmoddesignerapi/examples/media/2011/earth_debris04.ogg", - "../../fmoddesignerapi/examples/media/2011/earth_debris05.ogg", - "../../fmoddesignerapi/examples/media/2011/earth_debris06.ogg", - "../../fmoddesignerapi/examples/media/2011/earth_debris07.ogg", - "../../fmoddesignerapi/examples/media/2011/earth_debris08.ogg", - "../../fmoddesignerapi/examples/media/2011/flame_burst_long01.ogg", - "../../fmoddesignerapi/examples/media/2011/flame_burst_long02.ogg", - "../../fmoddesignerapi/examples/media/2011/flame_burst_long03.ogg", - "../../fmoddesignerapi/examples/media/2011/flame_burst_long04.ogg", - "../../fmoddesignerapi/examples/media/2011/flame_burst_long05.ogg", - "../../fmoddesignerapi/examples/media/2011/flame_burst_long06.ogg", - "../../fmoddesignerapi/examples/media/2011/flame_burst_short01.ogg", - "../../fmoddesignerapi/examples/media/2011/flame_burst_short02.ogg", - "../../fmoddesignerapi/examples/media/2011/flame_burst_short03.ogg", - "../../fmoddesignerapi/examples/media/2011/flame_burst_short04.ogg", - "../../fmoddesignerapi/examples/media/2011/flame_burst_short05.ogg", - "../../fmoddesignerapi/examples/media/2011/flame_burst_short06.ogg", - "../../fmoddesignerapi/examples/media/2011/flame_burst_small01.ogg", - "../../fmoddesignerapi/examples/media/2011/flame_burst_small02.ogg", - "../../fmoddesignerapi/examples/media/2011/flame_burst_small03.ogg", - "../../fmoddesignerapi/examples/media/2011/flame_burst_small04.ogg", - "../../fmoddesignerapi/examples/media/2011/flame_burst_small05.ogg", - "../../fmoddesignerapi/examples/media/2011/flame_burst_small06.ogg", - "../../fmoddesignerapi/examples/media/2011/footsteps_concrete_01.ogg", - "../../fmoddesignerapi/examples/media/2011/footsteps_concrete_02.ogg", - "../../fmoddesignerapi/examples/media/2011/footsteps_concrete_03.ogg", - "../../fmoddesignerapi/examples/media/2011/footsteps_concrete_04.ogg", - "../../fmoddesignerapi/examples/media/2011/footsteps_concrete_05.ogg", - "../../fmoddesignerapi/examples/media/2011/footsteps_concrete_06.ogg", - "../../fmoddesignerapi/examples/media/2011/footsteps_concrete_07.ogg", - "../../fmoddesignerapi/examples/media/2011/footsteps_concrete_08.ogg", - "../../fmoddesignerapi/examples/media/2011/footsteps_leaves01.ogg", - "../../fmoddesignerapi/examples/media/2011/footsteps_leaves02.ogg", - "../../fmoddesignerapi/examples/media/2011/footsteps_leaves03.ogg", - "../../fmoddesignerapi/examples/media/2011/footsteps_leaves04.ogg", - "../../fmoddesignerapi/examples/media/2011/frog01.ogg", - "../../fmoddesignerapi/examples/media/2011/frog02.ogg", - "../../fmoddesignerapi/examples/media/2011/frog03.ogg", - "../../fmoddesignerapi/examples/media/2011/frog04.ogg", - "../../fmoddesignerapi/examples/media/2011/glass_shard_smash01.ogg", - "../../fmoddesignerapi/examples/media/2011/glass_shard_smash02.ogg", - "../../fmoddesignerapi/examples/media/2011/glass_shard_smash03.ogg", - "../../fmoddesignerapi/examples/media/2011/glass_shard_smash04.ogg", - "../../fmoddesignerapi/examples/media/2011/glass_shard_smash05.ogg", - "../../fmoddesignerapi/examples/media/2011/glass_shard_smash06.ogg", - "../../fmoddesignerapi/examples/media/2011/glass_shard_smash07.ogg", - "../../fmoddesignerapi/examples/media/2011/glass_shard_smash08.ogg", - "../../fmoddesignerapi/examples/media/2011/metal_fragment01.ogg", - "../../fmoddesignerapi/examples/media/2011/metal_fragment02.ogg", - "../../fmoddesignerapi/examples/media/2011/metal_fragment03.ogg", - "../../fmoddesignerapi/examples/media/2011/metal_fragment04.ogg", - "../../fmoddesignerapi/examples/media/2011/metal_fragment05.ogg", - "../../fmoddesignerapi/examples/media/2011/metal_fragment06.ogg", - "../../fmoddesignerapi/examples/media/2011/metal_fragment07.ogg", - "../../fmoddesignerapi/examples/media/2011/metal_fragment08.ogg", - "../../fmoddesignerapi/examples/media/2011/rifle_blast01.ogg", - "../../fmoddesignerapi/examples/media/2011/rifle_blast02.ogg", - "../../fmoddesignerapi/examples/media/2011/rifle_blast03.ogg", - "../../fmoddesignerapi/examples/media/2011/shotgun_blast01.ogg", - "../../fmoddesignerapi/examples/media/2011/shotgun_blast02.ogg", - "../../fmoddesignerapi/examples/media/2011/shotgun_blast03.ogg", - "../../fmoddesignerapi/examples/media/2011/splash_large01.ogg", - "../../fmoddesignerapi/examples/media/2011/splash_large02.ogg", - "../../fmoddesignerapi/examples/media/2011/splash_large03.ogg", - "../../fmoddesignerapi/examples/media/2011/splash_large04.ogg", - "../../fmoddesignerapi/examples/media/2011/splash_large05.ogg", - "../../fmoddesignerapi/examples/media/2011/splash_medium01.ogg", - "../../fmoddesignerapi/examples/media/2011/splash_medium02.ogg", - "../../fmoddesignerapi/examples/media/2011/splash_medium03.ogg", - "../../fmoddesignerapi/examples/media/2011/splash_medium04.ogg", - "../../fmoddesignerapi/examples/media/2011/splash_medium05.ogg", - "../../fmoddesignerapi/examples/media/2011/splash_medium06.ogg", - "../../fmoddesignerapi/examples/media/2011/splash_medium07.ogg", - "../../fmoddesignerapi/examples/media/2011/splash_medium08.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/bow_still01.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/bow_still02.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/bow_wake01.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/bow_wake02.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/bow_wake03.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/buzz01.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/buzz02.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/cables_creak01.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/cables_creak02.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/cables_creak03.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/cables_creak04.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/cables_creak05.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/cables_creak06.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/cables_creak07.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/cables_creak08.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/clock_loop.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/engine_component01.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/engine_component02.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/engine_component03.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/engine_component04.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/engine_component05.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/engine_component06.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/engine_component07.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/engine_component08.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/engine_component09.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/engine_component10.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/engine_load.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/hatch_door_open_close01.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/hatch_door_open_close02.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/hatch_door_open_close03.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/hatch_door_open_close04.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/hatch_door_open_close05.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/impact01.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/impact02.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/impact03.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/impact04.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/impact05.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/impact06.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/impact07.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/impact08.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/impact_heavy01.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/impact_heavy02.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/impact_heavy03.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/impact_heavy04.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/impact_heavy05.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/impact_heavy06.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/impact_heavy07.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/metal_creak_light_01.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/metal_creak_light_02.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/metal_creak_light_03.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/metal_creak_light_04.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/metal_creak_light_05.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/metal_creak_light_06.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/metal_creak_light_07.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/metal_creak_light_08.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/metal_creak_light_09.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/metal_creak_light_10.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/metal_creak_light_11.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/metal_creak_light_12.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/metal_screech01.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/metal_screech02.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/metal_screech03.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/metal_screech04.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/morse_code_a.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/morse_code_b.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/morse_code_c.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/morse_code_comma.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/morse_code_d.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/morse_code_e.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/morse_code_f.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/morse_code_g.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/morse_code_h.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/morse_code_i.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/morse_code_j.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/morse_code_k.ogg", - "../../fmoddesignerapi/examples/media/2011/submarine/sonar.ogg", - "../../fmoddesignerapi/examples/media/2011/waves_submerged_01.ogg", - "../../fmoddesignerapi/examples/media/2011/waves_submerged_02.ogg", - "../../fmoddesignerapi/examples/media/2011/waves_submerged_03.ogg", - "../../fmoddesignerapi/examples/media/2011/waves_submerged_04.ogg", - "../../fmoddesignerapi/examples/media/2011/waves_submerged_05.ogg", - "../../fmoddesignerapi/examples/media/2011/waves_submerged_06.ogg", - "../../fmoddesignerapi/examples/media/2011/waves_submerged_07.ogg", - "../../fmoddesignerapi/examples/media/2011/waves_submerged_08.ogg", - "../../fmoddesignerapi/examples/media/ambient_one_four.ogg", - "../../fmoddesignerapi/examples/media/ambient_one_loop.ogg", - "../../fmoddesignerapi/examples/media/ambient_three.ogg", - "../../fmoddesignerapi/examples/media/ambient_two.ogg", - "../../fmoddesignerapi/examples/media/car/idle.ogg", - "../../fmoddesignerapi/examples/media/car/offhigh.ogg", - "../../fmoddesignerapi/examples/media/car/offlow.ogg", - "../../fmoddesignerapi/examples/media/car/offmid.ogg", - "../../fmoddesignerapi/examples/media/car/onhigh.ogg", - "../../fmoddesignerapi/examples/media/car/onlow.ogg", - "../../fmoddesignerapi/examples/media/car/onmid.ogg", - "../../fmoddesignerapi/examples/media/drum-loop.ogg", - "../../fmoddesignerapi/examples/media/interactive_music_1.ogg", - "../../fmoddesignerapi/examples/media/interactive_music_2.ogg", - "../../fmoddesignerapi/examples/media/interactive_music_3.ogg", - "../../fmoddesignerapi/examples/media/max_play_behavior_four.ogg", - "../../fmoddesignerapi/examples/media/max_play_behavior_one.ogg", - "../../fmoddesignerapi/examples/media/max_play_behavior_three.ogg", - "../../fmoddesignerapi/examples/media/max_play_behavior_two.ogg", - "../../fmoddesignerapi/examples/media/music/excited.ogg", - "../../fmoddesignerapi/examples/media/music/flsh-idle-01.ogg", - "../../fmoddesignerapi/examples/media/music/flsh-idle-02.ogg", - "../../fmoddesignerapi/examples/media/music/flsh-idle-03.ogg", - "../../fmoddesignerapi/examples/media/music/flsh-idle-04.ogg", - "../../fmoddesignerapi/examples/media/music/flsh-idle-05.ogg", - "../../fmoddesignerapi/examples/media/music/layer-bass-a.ogg", - "../../fmoddesignerapi/examples/media/music/layer-drums-a.ogg", - "../../fmoddesignerapi/examples/media/music/layer-drums-b.ogg", - "../../fmoddesignerapi/examples/media/music/layer-drums-c.ogg", - "../../fmoddesignerapi/examples/media/music/layer-drums-d.ogg", - "../../fmoddesignerapi/examples/media/music/layer-guitar-a.ogg", - "../../fmoddesignerapi/examples/media/music/layer-guitar-alt-a.ogg", - "../../fmoddesignerapi/examples/media/music/layer-guitar-alt-b.ogg", - "../../fmoddesignerapi/examples/media/music/layer-guitar-alt-c.ogg", - "../../fmoddesignerapi/examples/media/music/layer-guitar-alt-d.ogg", - "../../fmoddesignerapi/examples/media/music/layer-guitar-b.ogg", - "../../fmoddesignerapi/examples/media/music/layer-guitar-c.ogg", - "../../fmoddesignerapi/examples/media/music/layer-guitar-d.ogg", - "../../fmoddesignerapi/examples/media/music/relaxed.ogg", - "../../fmoddesignerapi/examples/media/music/state-idle-01.ogg", - "../../fmoddesignerapi/examples/media/music/state-idle-02.ogg", - "../../fmoddesignerapi/examples/media/music/state-idle-03.ogg", - "../../fmoddesignerapi/examples/media/music/state-idle-fadeout.ogg", - "../../fmoddesignerapi/examples/media/music/state-race-01a.ogg", - "../../fmoddesignerapi/examples/media/music/state-race-01b.ogg", - "../../fmoddesignerapi/examples/media/music/state-race-02a.ogg", - "../../fmoddesignerapi/examples/media/music/state-race-02b.ogg", - "../../fmoddesignerapi/examples/media/music/state-race-finish.ogg", - "../../fmoddesignerapi/examples/media/music/state-race-start.ogg", - "../../fmoddesignerapi/examples/media/note.ogg", - "../../fmoddesignerapi/examples/media/onefootstep.wav", - "../../fmoddesignerapi/examples/media/sequence-end.ogg", - "../../fmoddesignerapi/examples/media/sequence-four.ogg", - "../../fmoddesignerapi/examples/media/sequence-one.ogg", - "../../fmoddesignerapi/examples/media/sequence-start.ogg", - "../../fmoddesignerapi/examples/media/sequence-three.ogg", - "../../fmoddesignerapi/examples/media/sequence-two.ogg", -}; - -const char *gStreamingFileNames[] = -{ - "../../fmoddesignerapi/examples/media/interactive_music_6channel.ogg" -}; - -const unsigned int gNumTutorialFileNames = sizeof(gTutorialFileNames) / sizeof(char *); -const unsigned int gNumStreamingFileNames = sizeof(gStreamingFileNames) / sizeof(char *); - -#define CHECK_RESULT(_x) { FSBANK_RESULT _result = (_x); if (_result != FSBANK_OK) { return _result; } } - -FSBANK_RESULT printErrors(const FSBANK_SUBSOUND *subSounds) -{ - FSBANK_RESULT result = FSBANK_OK; - const FSBANK_PROGRESSITEM *item = NULL; - - printf("Build Error!\n"); - - do - { - result = FSBank_FetchNextProgressItem(&item); - CHECK_RESULT(result); - - if (item) - { - if (item->state == FSBANK_STATE_FAILED) - { - const FSBANK_STATEDATA_FAILED *failedStateData = (const FSBANK_STATEDATA_FAILED *)item->stateData; - printf("Error: %s -- \"%s\"\n", failedStateData->errorString, item->subSoundIndex < 0 ? "System" : subSounds[item->subSoundIndex].fileNames[0]); - } - - result = FSBank_ReleaseProgressItem(item); - CHECK_RESULT(result); - } - } while (item != NULL); - - return FSBANK_OK; -} - - -FSBANK_RESULT buildBank(const char **fileNames, unsigned int numFileNames, const char *outputFileName) -{ - FSBANK_RESULT result = FSBANK_OK; - FSBANK_SUBSOUND *subSounds = (FSBANK_SUBSOUND *)alloca(numFileNames * sizeof(FSBANK_SUBSOUND)); - - for (unsigned int i = 0; i < numFileNames; i++) - { - memset(&subSounds[i], 0, sizeof(FSBANK_SUBSOUND)); - - subSounds[i].fileNames = &fileNames[i]; - subSounds[i].numFileNames = 1; - subSounds[i].modeFlags = FSBANK_MODE_DEFAULT; - subSounds[i].overrideFlags = FSBANK_BUILD_DEFAULT; - subSounds[i].overrideQuality = 0; - subSounds[i].desiredSampleRate = 0; - } - - printf("Building %s...\n", outputFileName); - - result = FSBank_Build(subSounds, numFileNames, FSBANK_FORMAT_MP3, FSBANK_BUILD_DEFAULT | FSBANK_BUILD_DONTLOOP, 0, NULL, outputFileName); - if (result != FSBANK_OK) - { - printErrors(subSounds); - return result; - } - - printf("done.\n"); - return FSBANK_OK; -} - - -int main(void) -{ - FSBANK_RESULT result = FSBANK_OK; - - result = FSBank_Init(FSBANK_FSBVERSION_FSB4, FSBANK_INIT_NORMAL | FSBANK_INIT_GENERATEPROGRESSITEMS, 2, NULL); - CHECK_RESULT(result); - - result = buildBank(gTutorialFileNames, gNumTutorialFileNames, "tutorial_bank.fsb"); - CHECK_RESULT(result); - - result = buildBank(gStreamingFileNames, gNumStreamingFileNames, "streaming_bank.fsb"); - CHECK_RESULT(result); - - result = FSBank_Release(); - CHECK_RESULT(result); - - return FSBANK_OK; -} - diff --git a/CocosDenshion/third_party/fmod/tools/fsbanklib/fsbank.h b/CocosDenshion/third_party/fmod/tools/fsbanklib/fsbank.h deleted file mode 100644 index d3989c51e1..0000000000 --- a/CocosDenshion/third_party/fmod/tools/fsbanklib/fsbank.h +++ /dev/null @@ -1,258 +0,0 @@ -#ifndef _FSBANK_H -#define _FSBANK_H - -#if defined(_WIN32) - #define FB_API __declspec(dllexport) _stdcall -#else - #define FB_API -#endif - -typedef unsigned int FSBANK_INITFLAGS; - -#define FSBANK_INIT_NORMAL 0x00000000 /* Initialize normally. */ -#define FSBANK_INIT_IGNOREERRORS 0x00000001 /* Ignore individual subsound build errors, continue building for as long as possible. */ -#define FSBANK_INIT_WARNINGSASERRORS 0x00000002 /* Treat any warnings issued as errors. */ -#define FSBANK_INIT_CREATEINCLUDEHEADER 0x00000004 /* Create C header files with #defines defining indicies for each member of the FSB. */ -#define FSBANK_INIT_DONTLOADCACHEFILES 0x00000008 /* Ignore existing cache files. */ -#define FSBANK_INIT_GENERATEPROGRESSITEMS 0x00000010 /* Generate status items that can be queried by another thread to monitor the build progress and give detailed error messages. */ - - -typedef unsigned int FSBANK_BUILDFLAGS; - -#define FSBANK_BUILD_DEFAULT 0x00000000 /* Build with default settings. */ -#define FSBANK_BUILD_DISABLESYNCPOINTS 0x00000001 /* Disable the storing of syncpoints in the output */ -#define FSBANK_BUILD_DONTLOOP 0x00000002 /* Disable perfect loop encoding and sound stretching. Removes chirps from the start of oneshot MP2, MP3 and IMAADPCM sounds. */ -#define FSBANK_BUILD_FILTERHIGHFREQ 0x00000004 /* XMA only. Enable high frequency filtering. */ -#define FSBANK_BUILD_DISABLESEEKING 0x00000008 /* XMA only. Disable seek tables to save memory. */ -#define FSBANK_BUILD_OPTIMIZESAMPLERATE 0x00000010 /* Attempt to optimize the sample rate down. Ignored if format is MP2, MP3 or CELT or if FSB4 basic headers flag is used. */ -#define FSBANK_BUILD_DONTINTERLEAVE 0x00000020 /* VAG and GCADPCM only. Don't interleave the data as LRLRLRLR... instead use LLLLRRRR type encoding. Speeds up loading for samples (not streams, streams must remained interleaved), allows FMOD_OPENMEMORY_POINT. */ -#define FSBANK_BUILD_FSB4_USEBASICHEADERS 0x00000040 /* FSB4 format only. Generate FSBs with small sample header data. They only contain basic information such as sample length, and everything else has its attributes inherited from the first sample (for example the default frequency). */ - -/* Build flag mask that specifies which settings can be overriden per subsound. */ -#define FSBANK_BUILD_OVERRIDE_MASK (FSBANK_BUILD_DISABLESYNCPOINTS | FSBANK_BUILD_DONTLOOP | FSBANK_BUILD_FILTERHIGHFREQ | FSBANK_BUILD_DISABLESEEKING | FSBANK_BUILD_OPTIMIZESAMPLERATE | FSBANK_BUILD_DONTINTERLEAVE) -/* Build flag mask that specifies which settings (when changed) invalidate a cache file. */ -#define FSBANK_BUILD_CACHE_VALIDATION_MASK (FSBANK_BUILD_DONTLOOP | FSBANK_BUILD_FILTERHIGHFREQ | FSBANK_BUILD_OPTIMIZESAMPLERATE | FSBANK_BUILD_DONTINTERLEAVE) - - -typedef unsigned int FSBANK_MODEFLAGS; - -#define FSBANK_MODE_DEFAULT 0x00000000 /* Sample has default mode settings. */ -#define FSBANK_MODE_FSB4_ALLMONO 0x00000400 /* Sample is a collection of mono channels. */ -#define FSBANK_MODE_FSB4_ALLSTEREO 0x00000800 /* Sample is a collection of stereo channel pairs. */ -#define FSBANK_MODE_FSB4_PROTOOLS 0x00010000 /* Sample is 6ch and uses L C R LS RS LFE standard. */ - - -typedef enum FSBANK_RESULT -{ - FSBANK_OK, /* No errors. */ - FSBANK_ERR_CACHE_CHUNKNOTFOUND, /* An expected chunk is missing from the cache, perhaps try deleting cache files. */ - FSBANK_ERR_CANCELLED, /* The build process was cancelled during compilation by the user. */ - FSBANK_ERR_CANNOT_CONTINUE, /* The build process cannot continue due to previously ignored errors. */ - FSBANK_ERR_ENCODER, /* Encoder for chosen format has encountered an unexpected error. */ - FSBANK_ERR_ENCODER_INIT, /* Encoder initialization failed. */ - FSBANK_ERR_ENCODER_NOTSUPPORTED, /* Encoder for chosen format is not supported on this platform. */ - FSBANK_ERR_FILE_OS, /* An operating system based file error was encountered. */ - FSBANK_ERR_FILE_NOTFOUND, /* A specified file could not be found. */ - FSBANK_ERR_FMOD, /* Internal error from FMOD sub-system. */ - FSBANK_ERR_INITIALIZED, /* Already initialized. */ - FSBANK_ERR_INVALID_FORMAT, /* The format of the source file is invalid, see output for details. */ - FSBANK_ERR_INVALID_PARAM, /* An invalid parameter has been passed to this function. */ - FSBANK_ERR_MEMORY, /* Ran out of memory. */ - FSBANK_ERR_UNINITIALIZED, /* Not initialized yet. */ - FSBANK_WARN_CANNOTLOOP, /* Source file is too short for seamless looping. Looping disabled. */ - FSBANK_WARN_IGNORED_OPTIMIZESAMPLERATE, /* FSBANK_BUILD_OPTIMIZESAMPLERATE flag ignored: MP2, MP3 and CELT formats, and the USEBASICHEADERS flag make this option irrelevant. */ - FSBANK_WARN_IGNORED_FILTERHIGHFREQ, /* FSBANK_BUILD_FILTERHIGHFREQ flag ignored: feature only supported by XMA format. */ - FSBANK_WARN_IGNORED_DISABLESEEKING, /* FSBANK_BUILD_DISABLESEEKING flag ignored: feature only supported by XMA format. */ - FSBANK_WARN_IGNORED_DONTINTERLEAVE, /* FSBANK_BUILD_DONTINTERLEAVE flag ignored: feature only supported by VAG and GCADPCM formats. */ -} FSBANK_RESULT; - - -typedef enum FSBANK_FORMAT -{ - FSBANK_FORMAT_PCM, /* PCM (1:1) All platforms. */ - FSBANK_FORMAT_PCM_BIGENDIAN, /* PCM Big Endian (1:1) Xbox360 and PS3 only. */ - FSBANK_FORMAT_IMAADPCM, /* IMA ADPCM (3.5:1) All platforms. */ - FSBANK_FORMAT_MP2, /* MPEG Layer 2 (CBR) All platforms except PS3. Depends on toolame. */ - FSBANK_FORMAT_MP3, /* MPEG Layer 3 (CBR) All platforms. Depends on libmp3lame. */ - FSBANK_FORMAT_XMA, /* XMA (VBR) Xbox360 only (hardware). Depends on xmaencoder. */ - FSBANK_FORMAT_GCADPCM, /* GCADPCM (3.5:1) Wii Only (hardware). Depends on dsptool. */ - FSBANK_FORMAT_VAG, /* VAG (3.5:1) PSP and PS2 only (hardware). Depends on encvag. */ - FSBANK_FORMAT_HEVAG, /* High Efficiency VAG (3.5:1) NGP only (hardware). Depends on vagconv2. */ - FSBANK_FORMAT_CELT, /* Constrained Energy Lapped Transform (CBR) All platforms. Depends on celt_encoder. */ - - FSBANK_FORMAT_MAX /* Upper bound for this enumeration, for use with validation */ -} FSBANK_FORMAT; - - -typedef enum FSBANK_FSBVERSION -{ - FSBANK_FSBVERSION_FSB4, /* Produce FSB version 4 files. */ - - FSBANK_FSBVERSION_MAX /* Upper bound for this enumeration, for use with validation */ -} FSBANK_FSBVERSION; - - -typedef enum FSBANK_STATE -{ - FSBANK_STATE_DECODING, /* Decode a file to usable raw sample data. */ - FSBANK_STATE_ANALYSING, /* Scan sound data for details (such as optimized sample rate). */ - FSBANK_STATE_PREPROCESSING, /* Prepares sound data for encoder. */ - FSBANK_STATE_ENCODING, /* Pass the sample data to the chosen encoder. */ - FSBANK_STATE_WRITING, /* Write encoded data into an FSB. */ - FSBANK_STATE_FINISHED, /* Process complete. */ - FSBANK_STATE_FAILED, /* An error has occured, check data (as FSBANK_STATEDATA_FAILED) for details. */ - FSBANK_STATE_WARNING, /* A warning has been issued, check data (as FSBANK_STATEDATA_WARNING) for details. */ -} FSBANK_STATE; - - -typedef struct FSBANK_SUBSOUND -{ - const char* const *fileNames; /* List of file names used to produce an interleaved sound. */ - unsigned int numFileNames; /* Number of files in above file name list, up to 16. */ - FSBANK_MODEFLAGS modeFlags; /* Flags that affect the runtime mode for this subsound. */ - FSBANK_BUILDFLAGS overrideFlags; /* Flags that will reverse the equivalent flags passed to FSBank_Build. */ - unsigned int overrideQuality; /* Override the quality setting passed to FSBank_Build. */ - float desiredSampleRate; /* Resample to this sample rate (ignores optimize sample rate setting), up to 192000Hz. */ - float percentOptimizedRate; /* If using FSBANK_BUILD_OPTIMIZESAMPLERATE, this is the percentage of that rate to be used, up to 100.0%. */ -} FSBANK_SUBSOUND; - - -typedef struct FSBANK_PROGRESSITEM -{ - int subSoundIndex; /* Index into the subsound list passed to FSBank_Build that this update relates to (-1 indicates no specific subsound). */ - int threadIndex; /* Which thread index is serving this update (-1 indicates FSBank_Build / main thread). */ - FSBANK_STATE state; /* Progress through the encoding process. */ - const void *stateData; /* Cast to state specific data structure for extra information. */ -} FSBANK_PROGRESSITEM; - - -typedef struct FSBANK_STATEDATA_FAILED -{ - FSBANK_RESULT errorCode; /* Error result code. */ - char errorString[256]; /* Description for error code. */ -} FSBANK_STATEDATA_FAILED; - - -typedef struct FSBANK_STATEDATA_WARNING -{ - FSBANK_RESULT warnCode; /* Warning result code. */ - char warningString[256]; /* Description for warning code. */ -} FSBANK_STATEDATA_WARNING; - - -#ifdef __cplusplus -extern "C" { -#endif - -/* -[API] -[ - [DESCRIPTION] - Initialize the FSBank system. - - [PARAMETERS] - 'version' FSB version, currently only FSBANK_FSBVERSION_FSB4 is supported. - 'flags' Initialization flags which control how the system behaves. - 'numSimultaneousJobs' The maximum number of threads to create for parallel encoding. Set this - to your number of CPU 'cores' for best performance. - 'cacheDirectory' Optional location to store the temporary cache files, default is a - directory off the current working directory. -] -*/ -FSBANK_RESULT FB_API FSBank_Init(FSBANK_FSBVERSION version, FSBANK_INITFLAGS flags, unsigned int numSimultaneousJobs, const char *cacheDirectory); - - -/* -[API] -[ - [DESCRIPTION] - Release the FSBank system, clean up used resources. - - Note: All progress items retrieved with FSBank_FetchNextProgressItem will be released by this function. -] -*/ -FSBANK_RESULT FB_API FSBank_Release(); - - -/* -[API] -[ - [DESCRIPTION] - Begin the building process for the provided subsound descriptions, function will block until - complete. - - [PARAMETERS] - 'subSounds' An array of subsound descriptions each defining one subsound for the - final FSB. - 'numSubSounds' The number of elements in the 'subSounds' array. - 'encodeFormat' The format to be used for encoding the FSB. - 'buildFlags' Building flags which control how the sample data is encoded. - 'quality' Controls the quality level after compression from 1 (high compression - / low quality) to 100 (high quality / low compression), use 0 for - default quality. MPEG, CELT and XMA only. MPEG / CELT bitrate based on - quality * 3.2. - 'encryptKey' Optional string 'key' used to encrypt the FSB, same key is required at - runtime for decryption. - 'outputFileName' Name (and path) of the FSB to produce. -] -*/ -FSBANK_RESULT FB_API FSBank_Build(const FSBANK_SUBSOUND *subSounds, unsigned int numSubSounds, FSBANK_FORMAT encodeFormat, FSBANK_BUILDFLAGS buildFlags, unsigned int quality, const char *encryptKey, const char *outputFileName); - - -/* -[API] -[ - [DESCRIPTION] - Halt the build in progress, must be called from a different thread to FSBank_Build. -] -*/ -FSBANK_RESULT FB_API FSBank_BuildCancel(); - - -/* -[API] -[ - [DESCRIPTION] - Fetch build progress items that describe the current state of the build. Can be called while - the build is in progress to get realtime updates or after the build for a report. Call - FSBank_ReleaseProgressItem to free allocated memory. - - [PARAMETERS] - 'progressItem' One status update about the progress of a particular subsound. -] -*/ -FSBANK_RESULT FB_API FSBank_FetchNextProgressItem(const FSBANK_PROGRESSITEM **progressItem); - - -/* -[API] -[ - [DESCRIPTION] - Release memory associated with a progress item. - - [PARAMETERS] - 'progressItem' One status update about the progress of a particular subsound. -] -*/ -FSBANK_RESULT FB_API FSBank_ReleaseProgressItem(const FSBANK_PROGRESSITEM *progressItem); - - -/* -[API] -[ - [DESCRIPTION] - Query the current and maximum memory usage of the FSBank system. - FSBank_Build. - - [PARAMETERS] - 'currentAllocated' Address of a variable that receives the currently allocated memory at time of call. Optional. Specify 0 or NULL to ignore. - 'maximumAllocated' Address of a variable that receives the maximum allocated memory since FSBank_Init. Optional. Specify 0 or NULL to ignore. -] -*/ -FSBANK_RESULT FB_API FSBank_MemoryGetStats(unsigned int *currentAllocated, unsigned int *maximumAllocated); - -#ifdef __cplusplus -} -#endif - -#endif // _FSBANK_H diff --git a/CocosDenshion/third_party/fmod/tools/fsbanklib/libfsbankex.a.REMOVED.git-id b/CocosDenshion/third_party/fmod/tools/fsbanklib/libfsbankex.a.REMOVED.git-id deleted file mode 100644 index 5e3175033f..0000000000 --- a/CocosDenshion/third_party/fmod/tools/fsbanklib/libfsbankex.a.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -7c4b9fbeb5e4a11f0fe0b0086afeb806cd5cdb39 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/tools/fsbanklib/libmp3lame.so.REMOVED.git-id b/CocosDenshion/third_party/fmod/tools/fsbanklib/libmp3lame.so.REMOVED.git-id deleted file mode 100644 index fa8233dc21..0000000000 --- a/CocosDenshion/third_party/fmod/tools/fsbanklib/libmp3lame.so.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -7e13b14baadf985f33cab88cadb071baf398bb01 \ No newline at end of file diff --git a/CocosDenshion/third_party/fmod/tools/fsbanklib/twolame.so.REMOVED.git-id b/CocosDenshion/third_party/fmod/tools/fsbanklib/twolame.so.REMOVED.git-id deleted file mode 100644 index d2b6c382a7..0000000000 --- a/CocosDenshion/third_party/fmod/tools/fsbanklib/twolame.so.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -977578711cad3b8aa90c35dc191a7e38e4929eda \ No newline at end of file