streamupdater.h

Go to the documentation of this file.
00001 
00024 #ifndef STREAMUPDATER_H_INCLUDED_C419FA12
00025 #define STREAMUPDATER_H_INCLUDED_C419FA12
00026 
00027 
00028 //#include <cc++/thread.h>
00029 #include <vector>
00030 
00031 #ifdef WIN32
00032 // Ignore the dll interface warning using std::vector members
00033 #pragma warning(disable : 4251)
00034 #endif
00035 
00036 extern "C" {
00037 #include <AL/al.h>
00038 }
00039 
00040 #include "openalpp/export.h"
00041 
00042 
00043 #include "openalpp/audiobase.h"
00044 #include "openalpp/error.h"
00045 #include "openalpp/windowsstuff.h"
00046 #include "OpenThreads/Thread"
00047 #include "OpenThreads/Mutex"
00048 #include "openalpp/referenced.h"
00049 
00050 namespace openalpp {
00051 
00055   class OPENALPP_API StreamUpdater : public OpenThreads::Thread, public OpenThreads::Mutex, public openalpp::Referenced { //ost::Mutex {
00060   //int nrefs_;
00061  public:
00069   StreamUpdater(ALuint buffer1,ALuint buffer2,
00070                 ALenum format,unsigned int frequency);
00071 
00072 
00077   void addSource(ALuint sourcename);
00078 
00083   void removeSource(ALuint sourcename);
00084 
00088   virtual void seek(float time_s) {};
00089 
00090 
00098   bool update(void *buffer,unsigned int length); 
00099 
00104   void cancelCleanup();
00105 
00110   //StreamUpdater *reference();
00111 
00115 //   void deReference() throw (FatalError);
00116  protected:
00117 
00121   virtual ~StreamUpdater();
00122 
00123    
00127   ALuint buffers_[2];
00128 
00132   ALenum format_;
00133 
00137   unsigned int frequency_;
00138 
00143    std::vector<ALuint> sources_,newsources_,removesources_;
00147   bool stoprunning_;
00148 
00152   OpenThreads::Mutex runmutex_;
00153 
00154 };
00155 
00156 }
00157 
00158 #endif /* STREAMUPDATER_H_INCLUDED_C419FA12 */

Generated on Thu May 18 00:49:37 2006 for openalpp by  doxygen 1.4.6