Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

mixer.h

Go to the documentation of this file.
00001 /*
00002         ClanSound, sound mixing library written for ClanLib.
00003         Copyright (c)1998 Magnus Norddahl / ClanSoft.
00004 */
00005 
00006 #ifndef header_mixer
00007 #define header_mixer
00008 
00009 #ifdef WIN32
00010 #include "directsound.h"
00011 #else
00012 #include "oss.h"
00013 #endif
00014 
00015 #include <list>
00016 
00017 class CL_CardPlayback_ClanSound;
00018 
00019 class CL_CSMixer
00020 {
00021 public:
00022         CL_CSMixer();
00023         ~CL_CSMixer();
00024 
00025         void mix(class CL_Mutex *mutex);
00026         // Mix one fragment.
00027         
00028         void wait();
00029         // Waits until output source isn't full anymore.
00030         
00031         void add(CL_CardPlayback_ClanSound *playback);
00032         // Adds a playback session to the mixer.
00033 
00034         void remove(CL_CardPlayback_ClanSound *playback);
00035         // Removes a playback session from the mixer.
00036 
00037 private:
00038         std::list<CL_CardPlayback_ClanSound*> playbacks;
00039         CL_CSOutput output;
00040 
00041         short *mix_buffer;
00042         int *mix_buffer2;
00043         int mix_buffer_size;
00044 };
00045 
00046 #endif

Generated at Wed Apr 4 19:54:01 2001 for ClanLib by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001