snd.hh

Go to the documentation of this file.
00001 /*
00010  * LEGAL:   COPYRIGHT (C) 2007 JIM E. BROOKS
00011  *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
00012  *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
00013  *****************************************************************************/
00014 
00015 #ifndef SND_HH
00016 #define SND_HH 1
00017 
00018 namespace snd {
00019 
00020 const fp DEFAULT_VOLUME = 1.0;
00021 
00041 class SoundAbstract
00042 {
00043 public:
00044     enum { LOOP = true, ONCE = false };  
00045 
00046 protected:
00047                 SoundAbstract( void ) { }
00048     virtual     ~SoundAbstract( void ) { }
00049 
00050 public:
00051     CLASS_METHOD SoundAbstract& GetInstance( void ) { PERSISTENT SoundAbstract sDummy; return sDummy; }  // but it works
00052     CLASS_METHOD void           Disable( void ) { }
00053     virtual void                Play( const string& filename, const bool loop, const fp volume = DEFAULT_VOLUME ) { }
00054     virtual void                Stop( const string& filename ) { }
00055     virtual void                SetVolume( const string& filename, const fp volume ) { }
00056 };
00057 
00058 } // namespace snd
00059 
00060 //------------------------------------------------------------------------------
00061 
00062 #if SOUND_PLIB
00063 #include "snd_plib.hh"
00064 #endif
00065 
00066 //------------------------------------------------------------------------------
00067 
00068 namespace snd {
00069 
00070 #if SOUND_PLIB
00071     typedef SoundPlib Sound;
00072 #else
00073     typedef SoundAbstract Sound;  // abstract class also used as a NOP class
00074 #endif
00075 
00076 } // namespace snd
00077 
00078 #endif // SND_HH
Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:13 2007