Modified Manager in the tutorials was renamed to audioMgr

This commit is contained in:
Raynaldo Rivera 2011-06-26 16:04:55 +00:00
parent a585385f46
commit 8a2f85bb50
7 changed files with 47 additions and 82 deletions

View File

@ -20,9 +20,9 @@ int main(int argc, char* argv[]) {
cout << "cAudio 2.2.0 Tutorial 1: Basic 2D Audio. \n \n";
//Create an uninitialized Audio Manager
cAudio::IAudioManager* manager = cAudio::createAudioManager(false);
cAudio::IAudioaudioMgr* audioMgr = cAudio::createAudioManager(false);
if(manager)
if(audioMgr)
{
//Allow the user to choose a playback device
cout << "\nAvailable Playback Devices: \n";
@ -43,24 +43,24 @@ int main(int argc, char* argv[]) {
cin >> deviceSelection;
cout << std::endl;
//Initialize the manager with the user settings
manager->initialize(pDeviceList->getDeviceName(deviceSelection).c_str());
//Initialize the Audio Manager with the user settings
audioMgr->initialize(pDeviceList->getDeviceName(deviceSelection).c_str());
CAUDIO_DELETE pDeviceList;
pDeviceList = 0;
//Create a IAudio object and load a sound from a file
#ifdef CAUDIO_PLATFORM_WIN
cAudio::IAudioSource* mysound = manager->create("bling", AUDIO_FILE("cAudioTheme1.ogg"),true);
cAudio::IAudioSource* mysound = audioMgr->create("bling", AUDIO_FILE("cAudioTheme1.ogg"),true);
#else
cAudio::IAudioSource* mysound = manager->create("bling", AUDIO_FILE(cAudioTheme1.ogg),true);
cAudio::IAudioSource* mysound = audioMgr->create("bling", AUDIO_FILE(cAudioTheme1.ogg),true);
#endif
for (size_t i=0; i<10; i++)
{
#ifdef CAUDIO_PLATFORM_WIN
manager->play2D(AUDIO_FILE("bling.ogg"));
audioMgr->play2D(AUDIO_FILE("bling.ogg"));
#else
manager->play2D(AUDIO_FILE(bling.ogg));
audioMgr->play2D(AUDIO_FILE(bling.ogg));
#endif
}
@ -76,14 +76,11 @@ int main(int argc, char* argv[]) {
}
//Shutdown cAudio
manager->shutDown();
cAudio::destroyAudioManager(manager);
cAudio::destroyAudioManager(audioMgr);
}
else
{
std::cout << "Failed to create audio playback manager. \n";
std::cout << "Failed to create audio playback audioMgr. \n";
}
std::cout << "Press any key to quit \n";

View File

@ -25,9 +25,9 @@ int main(int argc, char* argv[])
float rot = 0;
//Create an uninitialized Audio Manager
cAudio::IAudioManager* manager = cAudio::createAudioManager(false);
cAudio::IAudioManager* audioMgr = cAudio::createAudioManager(false);
if(manager)
if(audioMgr)
{
//Allow the user to choose a playback device
cout << "\nAvailable Playback Devices: \n";
@ -49,19 +49,19 @@ int main(int argc, char* argv[])
cout << std::endl;
//Initialize the manager with the user settings
manager->initialize(pDeviceList->getDeviceName(deviceSelection).c_str());
audioMgr->initialize(pDeviceList->getDeviceName(deviceSelection).c_str());
CAUDIO_DELETE pDeviceList;
pDeviceList = 0;
//Grab the listener object, which allows us to manipulate where "we" are in the world
//It's useful to bind this to a camera if you are using a 3d graphics engine
cAudio::IListener* listener = manager->getListener();
cAudio::IListener* listener = audioMgr->getListener();
//Create a IAudio object and load a sound from a file
#ifdef CAUDIO_PLATFORM_WIN
cAudio::IAudioSource* mysound = manager->create("bling", AUDIO_FILE("bling.ogg"), false);
cAudio::IAudioSource* mysound = audioMgr->create("bling", AUDIO_FILE("bling.ogg"), false);
#else
cAudio::IAudioSource* mysound = manager->create("bling", AUDIO_FILE(bling.ogg), false);
cAudio::IAudioSource* mysound = audioMgr->create("bling", AUDIO_FILE(bling.ogg), false);
#endif
//Set the IAudio Sound to play3d and loop
//play3d takes 4 arguments play3d(toloop,x,y,z,strength)
@ -103,12 +103,7 @@ int main(int argc, char* argv[])
std::cout << std::endl;
//Delete all IAudio sounds
manager->releaseAllSources();
//Shutdown cAudio
manager->shutDown();
cAudio::destroyAudioManager(manager);
cAudio::destroyAudioManager(audioMgr);
}
else
{

View File

@ -25,9 +25,9 @@ int main(int argc, char* argv[])
cout << "cAudio 2.1.0 Tutorial 3: Memory Playback. \n \n";
//Create an uninitialized Audio Manager
cAudio::IAudioManager* manager = cAudio::createAudioManager(false);
cAudio::IAudioManager* audioMgr = cAudio::createAudioManager(false);
if(manager)
if(audioMgr)
{
//Allow the user to choose a playback device
cout << "\nAvailable Playback Devices: \n";
@ -49,12 +49,12 @@ int main(int argc, char* argv[])
cout << std::endl;
//Initialize the manager with the user settings
manager->initialize(pDeviceList->getDeviceName(deviceSelection).c_str());
audioMgr->initialize(pDeviceList->getDeviceName(deviceSelection).c_str());
CAUDIO_DELETE pDeviceList;
pDeviceList = 0;
//Create a IAudio object and load a sound from memory. using the bling array and bling size generated by bin2h.
cAudio::IAudioSource* mysound = manager->createFromMemory("bling",(const char*)bling,bling_size,"wav");
cAudio::IAudioSource* mysound = audioMgr->createFromMemory("bling",(const char*)bling,bling_size,"wav");
if(mysound)
{
@ -64,15 +64,8 @@ int main(int argc, char* argv[])
//Sleep for 10,000 ms to free some CPU, also makes the example only last 10 seconds
cAudio::cAudioSleep(10000);
}
mysound->drop();
//Delete all IAudio sounds
manager->releaseAllSources();
//Shutdown cAudio
manager->shutDown();
cAudio::destroyAudioManager(manager);
cAudio::destroyAudioManager(audioMgr);
}
else
{

View File

@ -36,9 +36,9 @@ int main(int argc, char* argv[])
formatName = "16 Bit Stereo";
//Create an Audio Manager with default settings
cAudio::IAudioManager* manager = cAudio::createAudioManager();
cAudio::IAudioManager* audioMgr = cAudio::createAudioManager();
if(manager)
if(audioMgr)
{
//! The capture interface can be gotten at any time, and can even be used completely seperate from the manager
// Also it is possible to have more than one capture interface at the same time, useful for recording from multiple sources
@ -112,7 +112,7 @@ int main(int argc, char* argv[])
cAudio::AudioCaptureBuffer* buff = capture->getCapturedAudioBuffer();
//Create a IAudio object and load a sound from a file
cAudio::IAudioSource* mysound = manager->createFromRaw("sound1", buff->getReadBuffer(), buff->getLength(), CAPTURE_FREQUENCY, CAPTURE_FORMAT);
cAudio::IAudioSource* mysound = audioMgr->createFromRaw("sound1", buff->getReadBuffer(), buff->getLength(), CAPTURE_FREQUENCY, CAPTURE_FORMAT);
delete buff;
@ -136,12 +136,7 @@ int main(int argc, char* argv[])
capture = 0x0;
}
//Delete all IAudio sounds
manager->releaseAllSources();
//Shutdown cAudio
manager->shutDown();
cAudio::destroyAudioManager(manager);
cAudio::destroyAudioManager(audioMgr);
}
else
{

View File

@ -22,9 +22,9 @@ int main(int argc, char* argv[])
cout << "cAudio 2.2.0 Tutorial 5: Basic Audio Effects. \n \n";
//Create an uninitialized Audio Manager
cAudio::IAudioManager* manager = cAudio::createAudioManager(false);
cAudio::IAudioManager* audioMgr = cAudio::createAudioManager(false);
if(manager)
if(audioMgr)
{
//Allow the user to choose a playback device
cout << "\nAvailable Playback Devices: \n";
@ -46,12 +46,12 @@ int main(int argc, char* argv[])
cout << std::endl;
//Initialize the manager with the user settings
manager->initialize(pDeviceList->getDeviceName(deviceSelection).c_str());
audioMgr->initialize(pDeviceList->getDeviceName(deviceSelection).c_str());
CAUDIO_DELETE pDeviceList;
pDeviceList = 0;
#if CAUDIO_EFX_ENABLED == 1
cAudio::IAudioEffects* effects = manager->getEffects();
cAudio::IAudioEffects* effects = audioMgr->getEffects();
if(effects)
{
cAudio::IEffect* effect = effects->createEffect();
@ -64,9 +64,9 @@ int main(int argc, char* argv[])
//Create a IAudio object and load a sound from a file
#ifdef CAUDIO_PLATFORM_WIN
cAudio::IAudioSource* mysound = manager->create("bling", AUDIO_FILE("Footsteps.wav"),false);
cAudio::IAudioSource* mysound = audioMgr->create("bling", AUDIO_FILE("Footsteps.wav"),false);
#else
cAudio::IAudioSource* mysound = manager->create("bling", AUDIO_FILE(Footsteps.wav),false);
cAudio::IAudioSource* mysound = audioMgr->create("bling", AUDIO_FILE(Footsteps.wav),false);
#endif
if(mysound)
{
@ -349,19 +349,14 @@ int main(int argc, char* argv[])
std::cout << "Equalizer effect not supported by this OpenAL device. \n";
}
}
manager->release(mysound);
audioMgr->release(mysound);
filter->drop();
effect->drop();
}
}
#endif
//Delete all IAudio sounds
manager->releaseAllSources();
//Shutdown cAudio
manager->shutDown();
cAudio::destroyAudioManager(manager);
cAudio::destroyAudioManager(audioMgr);
}
else
{

View File

@ -25,12 +25,12 @@ int main(int argc, char* argv[])
cout << "cAudio 2.1.0 Tutorial 6: Custom event handler. \n \n";
//Create an uninitialized Audio Manager
cAudio::IAudioManager* manager = cAudio::createAudioManager(false);
cAudio::IAudioManager* audioMgr = cAudio::createAudioManager(false);
//Make a pointer to our handler
cTestHandler *handle = new cTestHandler;
if(manager)
if(audioMgr)
{
//Allow the user to choose a playback device
cout << "\nAvailable Playback Devices: \n";
@ -52,15 +52,15 @@ int main(int argc, char* argv[])
cout << std::endl;
//Initialize the manager with the user settings
manager->initialize(pDeviceList->getDeviceName(deviceSelection).c_str());
audioMgr->initialize(pDeviceList->getDeviceName(deviceSelection).c_str());
CAUDIO_DELETE pDeviceList;
pDeviceList = 0;
//Create a IAudio object and load a sound from a file
#ifdef CAUDIO_PLATFORM_WIN
cAudio::IAudioSource* mysound = manager->create("bling", AUDIO_FILE("cAudioTheme1.ogg"),true);
cAudio::IAudioSource* mysound = audioMgr->create("bling", AUDIO_FILE("cAudioTheme1.ogg"),true);
#else
cAudio::IAudioSource* mysound = manager->create("bling", AUDIO_FILE(cAudioTheme1.ogg),true);
cAudio::IAudioSource* mysound = audioMgr->create("bling", AUDIO_FILE(cAudioTheme1.ogg),true);
#endif
mysound->registerEventHandler(handle);
@ -76,12 +76,7 @@ int main(int argc, char* argv[])
}
//Delete all IAudio sounds
manager->releaseAllSources();
//Shutdown cAudio
manager->shutDown();
cAudio::destroyAudioManager(manager);
cAudio::destroyAudioManager(audioMgr);
}
else
{

View File

@ -25,7 +25,7 @@ int main(int argc, char* argv[])
cout << "cAudio 2.1.0 Tutorial 7: Custom log recevier. \n \n";
//Create an uninitialized Audio Manager
cAudio::IAudioManager* manager = cAudio::createAudioManager(false);
cAudio::IAudioManager* audioMgr = cAudio::createAudioManager(false);
//Now we make a new pointer to our receiver
cTestLogReceiver *loggin = new cTestLogReceiver;
@ -37,7 +37,7 @@ int main(int argc, char* argv[])
//Then we pass our new receiver to it with a unique name
log->registerLogReceiver(loggin,"Loggin");
if(manager)
if(audioMgr)
{
//Allow the user to choose a playback device
cout << "\nAvailable Playback Devices: \n";
@ -59,15 +59,15 @@ int main(int argc, char* argv[])
cout << std::endl;
//Initialize the manager with the user settings
manager->initialize(pDeviceList->getDeviceName(deviceSelection).c_str());
audioMgr->initialize(pDeviceList->getDeviceName(deviceSelection).c_str());
CAUDIO_DELETE pDeviceList;
pDeviceList = 0;
//Create a IAudio object and load a sound from a file
#ifdef CAUDIO_PLATFORM_WIN
cAudio::IAudioSource* mysound = manager->create("bling", AUDIO_FILE("cAudioTheme1.ogg"),true);
cAudio::IAudioSource* mysound = audioMgr->create("bling", AUDIO_FILE("cAudioTheme1.ogg"),true);
#else
cAudio::IAudioSource* mysound = manager->create("bling", AUDIO_FILE(cAudioTheme1.ogg),true);
cAudio::IAudioSource* mysound = audioMgr->create("bling", AUDIO_FILE(cAudioTheme1.ogg),true);
#endif
if(mysound)
{
@ -81,12 +81,7 @@ int main(int argc, char* argv[])
}
//Delete all IAudio sounds
manager->releaseAllSources();
//Shutdown cAudio
manager->shutDown();
cAudio::destroyAudioManager(manager);
cAudio::destroyAudioManager(audioMgr);
}
else
{