00001
00024 #ifndef SOURCE_H_INCLUDED_C419B739
00025 #define SOURCE_H_INCLUDED_C419B739
00026
00027 #include "openalpp/export.h"
00028 #include "openalpp/stream.h"
00029 #include "openalpp/sourcebase.h"
00030 #include "openalpp/sample.h"
00031
00032 namespace openalpp {
00033
00038 class OPENALPP_API Source : public SourceBase {
00039 public:
00047 Source(float x = 0.0, float y = 0.0, float z = 0.0);
00048
00054 Source(const std::string& filename,float x=0.0,float y=0.0,float z=0.0);
00055
00061 Source(const Sample &buffer,float x=0.0,float y=0.0,float z=0.0);
00062
00068 Source(const Stream &stream,float x=0.0,float y=0.0,float z=0.0);
00069
00073 Source(const Source &source);
00074
00075
00081 void setSound(const std::string& filename);
00082
00088 void setSound(const Sample *buffer);
00089
00095 void setSound(Stream *stream);
00096
00097 void setSound(const Stream *stream);
00098
00103 const SoundData *getSound() const;
00104
00110 void play(const std::string& filename);
00111
00117 void play(const Sample *buffer);
00118
00124 void play(const Stream *stream);
00125
00130 void play();
00131
00136 void stop();
00137
00142 void pause();
00143
00144
00149 void seek(float time_s);
00150
00155 bool isStreaming();
00156
00160 Source &operator=(const Source &source);
00161
00162 protected:
00166 virtual ~Source();
00167
00168 private:
00172 openalpp::ref_ptr<SoundData> sounddata_;
00173 };
00174
00175 }
00176
00177 #endif