19 #ifndef HEADER_MUSICOGG_HPP
20 #define HEADER_MUSICOGG_HPP
28 #if defined(WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__)
29 # pragma warning(disable:4244)
31 # include <vorbis/vorbisfile.h>
32 #if defined(WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__)
33 # pragma warning(default:4244)
37 #include "audio/music.hpp"
45 class MusicOggStream :
public Music
48 MusicOggStream(
float loop_start,
float loop_end);
49 virtual ~MusicOggStream();
53 virtual bool load(
const std::string& filename);
55 virtual bool playMusic();
56 virtual bool stopMusic();
57 virtual bool pauseMusic();
58 virtual bool resumeMusic();
59 virtual void setVolume(
float volume);
60 virtual bool isPlaying();
64 bool check(
const char* what);
65 std::string errorString(
int code);
69 bool streamIntoBuffer(ALuint buffer);
73 std::string m_fileName;
75 OggVorbis_File m_oggStream;
76 vorbis_info* m_vorbisInfo;
79 std::atomic_bool m_playing;
80 std::atomic_bool m_play_initialized;
82 ALuint m_soundBuffers[2];
89 static const int m_buffer_size = 11025*4;
Abstract interface for classes that can handle music playback.
Definition: music.hpp:30
void update(float dt)
Updates all widgets that need to be updated.
Definition: engine.cpp:872