Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

/home/rdbrown/doxygen/cse125g1/src/modules/audio/audioint.h

00001 #ifndef MM_AUDIO_INT_H
00002 #define MM_AUDIO_INT_H
00003 /*
00004  *  audioint.h
00005  *  MMAudio
00006  *
00007  *  Created by Rib Rdb on 4/3/05.
00008  *  Copyright 2005 __MyCompanyName__. All rights reserved.
00009  *
00010  */
00011 
00012 #include "audiocore.h"
00013 #include <math.h>
00014 #include <stdlib.h>
00015 #include <stdio.h>
00016 #include "AudioException.h"
00017 #include "tnl/tnlThread.h"
00018 
00019 #define BUFFER_SIZE 4096
00020 #define BUFFER_COUNT 16
00021 
00022 namespace MMAudio {
00023     extern ALenum alError;
00024         extern TNL::Mutex alLock;
00025 
00026         class ALLock {
00027         public:
00028                 ALLock() { alLock.lock(); }
00029                 ~ALLock() { alLock.unlock(); }
00030         };
00031 
00032 
00033         class AlException : public AudioException {
00034                 ALenum errnum;
00035         public:
00036                 AlException(ALenum err, const char *func, const char *file, int line)
00037             : AudioException(func, file, line), errnum(err) {
00038                 }
00039                         const char *getMessage(void) const;
00040                         ALenum getAlError(void) {
00041                                 return errnum;
00042                         }
00043         };
00044 
00045 }
00046 
00047 #define audioResetAlErrors() alGetError()
00048 #define audioCheckAlErrors() do { \
00049     if ((alError = alGetError()) != AL_NO_ERROR) { \
00050           throw AlException(MMAudio::alError, __FUNCTION__, __FILE__, __LINE__);        \
00051     } \
00052 } while (0)
00053 
00054 #define audioError(msg) do {throw AudioException(msg, __FUNCTION__, __FILE__, __LINE__); } while (0)
00055     
00056 #endif /* MM_AUDIO_INT_H */

Generated on Thu Aug 18 16:03:10 2005 for Robin Hood: Thieves & Knights by doxygen1.2.18