Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals   Related Pages  

sound.h

Go to the documentation of this file.
00001 // OMICRON ENGINE HEADER FILE
00002 //
00003 // --------------------------------------------------------------------------
00004 // Copyright (C) 2001-2002 by Bjoern Paetzel <kolrabi@gmx.de>
00005 //
00006 // This file is part of the Omicron Engine.
00007 //
00008 // The Omicron Engine is free software; you can redistribute it and/or modify
00009 // it under the terms of the  GNU General Public License  as published by the
00010 // Free Software Foundation;  either version  2  of the License,  or (at your
00011 // option) any later version.
00012 //
00013 // The Omicron Engine  is distributed in the hope that it will be useful, but
00014 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00015 // or  FITNESS FOR A PARTICULAR PURPOSE.  See the  GNU General Public License
00016 // for more details.
00017 //
00018 // You should have  received a copy of the  GNU General Public License  along
00019 // with The Omicron Engine;  if not,  write to the  Free Software Foundation,
00020 // Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
00021 //
00022 // --------------------------------------------------------------------------
00023 // Last modified:       $Date: 2002/12/18 14:12:16 $
00024 // By           :       $Author: kolrabi $
00025 // $Id: sound.h,v 1.4 2002/12/18 14:12:16 kolrabi Exp $ 
00026 
00027 /*
00028 
00029   $Log: sound.h,v $
00030   Revision 1.4  2002/12/18 14:12:16  kolrabi
00031   *** empty log message ***
00032 
00033   Revision 1.3  2002/12/13 15:59:47  kolrabi
00034   several bug fixes
00035 
00036   Revision 1.2  2002/12/13 10:20:16  kolrabi
00037   no message
00038 
00039   Revision 1.1  2002/12/12 11:44:04  kolrabi
00040   *** empty log message ***
00041 
00042 
00043 
00044 */
00045  
00052 #if !defined(NOSOUND)
00053 
00054 #include <AL/al.h>
00055 #include <AL/alut.h>
00056 #include <AL/alc.h>
00057 
00058 #endif
00059 
00060 #if !defined(WIN32)
00061 #define ALCcontext void
00062 #define alGetSourcei alGetSourceiv
00063 #endif
00064 
00065 // sound channels
00066 
00067 #if !defined(OMICRONTYPES_SOUND_DEFINED)
00068 #define OMICRONTYPES_SOUND_DEFINED
00069 
00074 class sound_manager_c
00075 {
00076 protected:
00077 
00078 
00083     typedef struct sound_s
00084     {
00085         unsigned int buffer;           
00086         unsigned int source;           
00087         bool    iscopy;                
00088         bool    temporary;             
00089 
00090         sound_s() { iscopy = temporary = false; buffer = 0; source = 0; };
00091     } sound_t;
00092 
00093     array_c<sound_t> *sounds;          
00094 
00095     ALCdevice  *sounddevice;           
00096     ALCcontext *soundcontext;          
00097 
00098 public:
00099 
00100     sound_manager_c();
00101     ~sound_manager_c();
00102 
00103     static const char *                
00104         sound_alerror(ALenum e);
00105 
00106     sshort                             
00107         load_wav(const char *fname);
00108 
00109     void                               
00110         unload(sshort num);
00111 
00112     sshort                             
00113         duplicate(sshort);
00114 
00115     void                               
00116         play(sshort);
00117 
00118     void                               
00119         play_copy(sshort);
00120 
00121     void                               
00122         stop(sshort num);
00123 
00124     void                               
00125         update();
00126 };
00127 
00128 #endif

Generated on Wed Dec 18 15:48:48 2002 for omicron engine by doxygen1.2.18