AudioDevice.h

Go to the documentation of this file.
00001 /*
00002  * This file is part of Micole Architecture
00003  *
00004  * Copyright (C) 2007 Micole partners
00005  *
00006  * Micole Architecture is free software: you can redistribute it 
00007  * and/or modify it under the terms of the GNU Lesser General 
00008  * Public License as published by the Free Software Foundation, 
00009  * either version 3 of the License, or (at your option) any 
00010  * later version.
00011  *
00012  * Micole Architecture is distributed in the hope that it will be 
00013  * useful, * but WITHOUT ANY WARRANTY; without even the implied 
00014  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00015  * PURPOSE.  See the GNU Lesser General Public License for more 
00016  * details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with Micole Architecture.  If not, see
00020  * <http://www.gnu.org/licenses/>.
00021  */
00022 
00023 #ifndef AUDIODEVICE_H
00024 #define AUDIODEVICE_H
00025 
00026 #pragma warning(disable:4786)
00027 
00028 #include <string>
00029 #include <map>
00030 #include <bass.h>
00031 
00032 #include "AudioStream.h"
00033 #include "util.h"
00034 
00035 typedef std::map<std::string, AudioStream*> AudioStreamMap;
00036 
00038 class AudioDevice {
00039 
00040         private:
00041 
00042                 static uint8 nextDevice;
00043                 static uint8 activeDevice;
00044 
00045                 AudioStreamMap audioStreamMap;
00046                 std::string id;
00047                 uint8 currDevice;
00048                 BASS_INFO info;
00049 
00050                 uint16 vol;
00051 
00052         public:
00053 
00055                 AudioDevice (std::string id);
00056 
00058                 ~AudioDevice (void);
00059 
00061 
00068                 AudioStream*    CreateStream (std::string id, const char* filename, uint32 speakers, bool mono = true, bool looped = false);
00069 
00071 
00074                 AudioStream*    GetStream (std::string id);
00075 
00077 
00080                 void                    RemoveStream (std::string id);
00081 
00083 
00086                 void                    SetVolume (uint16 volume);
00087 
00089                 uint16                  GetVolume (void);
00090 
00092                 uint8                   GetDeviceID (void);
00093 
00095                 std::string             GetDeviceDescription (void);
00096 
00098 
00103                 void                    Start (void);
00104 
00106                 void                    Pause (void);
00107 
00109                 void                    Stop (void);
00110 
00112                 uint8                   GetSpeakersNum (void);
00113 };
00114 
00115 #endif // Do not add stuff beyond this point

Generated on Tue Oct 16 17:10:42 2007 for Micole by  doxygen 1.4.7