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(const Stream *stream);
00096
00101 const SoundData *getSound() const;
00102
00108 void play(const std::string& filename);
00109
00115 void play(const Sample *buffer);
00116
00122 void play(const Stream *stream);
00123
00128 void play();
00129
00134 void stop();
00135
00140 void pause();
00141
00142
00147 bool isStreaming();
00148
00152 Source &operator=(const Source &source);
00153
00154 protected:
00158 virtual ~Source();
00159
00160 private:
00164 openalpp::ref_ptr<SoundData> sounddata_;
00165 };
00166
00167 }
00168
00169 #endif