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"
45class MusicOggStream :
public Music
48 MusicOggStream(
float loop_start,
float loop_end);
49 virtual ~MusicOggStream();
52 virtual void updateFaster(
float percent,
float max_pitch);
54 virtual bool load(
const std::string& filename);
56 virtual bool playMusic();
57 virtual bool stopMusic();
58 virtual bool pauseMusic();
59 virtual bool resumeMusic();
60 virtual void setVolume(
float volume);
61 virtual bool isPlaying();
65 bool check(
const char* what);
66 std::string errorString(
int code);
70 bool streamIntoBuffer(ALuint buffer);
74 std::string m_fileName;
76 OggVorbis_File m_oggStream;
77 vorbis_info* m_vorbisInfo;
80 std::atomic_bool m_playing;
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