00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00024
00025 #ifndef SFML_MUSIC_HPP
00026 #define SFML_MUSIC_HPP
00027
00029
00031 #include <SFML/Audio/SoundStream.hpp>
00032 #include <string>
00033 #include <vector>
00034
00035 namespace sf_private
00036 {
00037 class sfSoundFile;
00038 }
00039
00040
00045 class SFML_API sfMusic : public sfSoundStream
00046 {
00047 public :
00048
00056 sfMusic(std::size_t BufferSize = 44100);
00057
00062 ~sfMusic();
00063
00072 bool Open(const std::string& Filename);
00073
00080 void SetLoop(bool Loop);
00081
00088 bool GetLoop() const;
00089
00096 float GetDuration() const;
00097
00098 private :
00099
00104 virtual bool OnStart();
00105
00110 virtual bool OnGetData(Chunk& Data);
00111
00113
00115 sf_private::sfSoundFile* myFile;
00116 std::string myFilename;
00117 bool myLoop;
00118 float myDuration;
00119 std::vector<sfInt16> mySamples;
00120 };
00121
00122 #endif // SFML_MUSIC_HPP