00001 #ifndef _MERCURY_SOUND_H 00002 #define _MERCURY_SOUND_H 00003 00004 #include "MercuryFiles.h" 00005 00007 typedef void (*MercurySoundOutCallback)( void *, long ); 00008 00009 struct MercurySoundChannel 00010 { 00011 bool bEnabled; 00012 float fQ; 00013 float fAngleActive; 00014 float fPhi; 00015 float fTheta; 00016 MString sName; 00017 }; 00018 00019 class MercurySoundOutDriver 00020 { 00021 public: 00022 bool Open( MercurySoundCallback cb ) = 0; 00023 void Close() = 0; 00024 int GetSampleRate() = 0; 00025 int GetChannelInfo( MVector< MercurySoundChannel > & out ); 00026 }; 00027 00028 class MercurySoundInDriver 00029 { 00030 public: 00031 bool Open( MercuryFile & fMusic ) = 0; 00032 void Close() = 0; 00033 bool Decode( void * Buffer, long BufLen ) = 0; 00034 }; 00035 00036 class SoundDriversManager 00037 { 00038 public: 00039 MercurySoundOutDriver * GetSoundOutDriver(); 00040 00041 private: 00042 map< MercurySoundOutDriver, MString > * m_mSoundOutDrivers; 00043 map< MercurySoundInDriver, MString > * m_mSoundInDrivers; 00044 }; 00045 00046 extern SoundDriversManager SOUNDDRIVERS; 00047 00048 00049 00050 #endif 00051 00052 00053 /* 00054 * Copyright (c) 2006 Charles Lohr 00055 * All rights reserved. 00056 * 00057 * Redistribution and use in source and binary forms, with or 00058 * without modification, are permitted provided that the following 00059 * conditions are met: 00060 * - Redistributions of source code must retain the above 00061 * copyright notice, this list of conditions and the following disclaimer. 00062 * - Redistributions in binary form must reproduce the above copyright 00063 * notice, this list of conditions and the following disclaimer in 00064 * the documentation and/or other materials provided with the distribution. 00065 * - Neither the name of the Mercury Engine nor the names of its 00066 * contributors may be used to endorse or promote products derived from 00067 * this software without specific prior written permission. 00068 * 00069 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00070 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00071 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00072 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 00073 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00074 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00075 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00076 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00077 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 00078 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00079 */