 |
raylib-cpp
C++ object-oriented wrapper library for raylib.
|
25 #ifndef RAYLIB_CPP_INCLUDE_MUSIC_HPP_
26 #define RAYLIB_CPP_INCLUDE_MUSIC_HPP_
30 #include "./raylib.hpp"
31 #include "./raylib-cpp-utils.hpp"
43 Music(
const std::string& fileName) {
44 set(::LoadMusicStream(fileName.c_str()));
55 GETTERSETTER(
unsigned int, SampleCount, sampleCount)
56 GETTERSETTER(
bool, Looping, looping)
57 GETTERSETTER(
int, CtxType, ctxType)
58 GETTERSETTER(
void*, CtxData, ctxData)
69 ::UnloadMusicStream(*
this);
76 ::PlayMusicStream(*
this);
84 ::UpdateMusicStream(*
this);
92 ::StopMusicStream(*
this);
100 ::PauseMusicStream(*
this);
108 ::ResumeMusicStream(*
this);
116 return ::IsMusicPlaying(*
this);
123 ::SetMusicVolume(*
this, volume);
131 ::SetMusicPitch(*
this, pitch);
139 return ::GetMusicTimeLength(*
this);
146 return ::GetMusicTimePlayed(*
this);
150 inline void set(const ::Music& music) {
151 ctxType = music.ctxType;
152 ctxData = music.ctxData;
153 looping = music.looping;
154 sampleCount = music.sampleCount;
155 stream = music.stream;
160 #endif // RAYLIB_CPP_INCLUDE_MUSIC_HPP_
Provides all the classes associated with raylib-cpp.
Music & SetPitch(float pitch)
Set pitch for music.
Music & Stop()
Stop music playing.
Music & SetVolume(float volume)
Set volume for music.
Music & Resume()
Resume music playing.
Music & Play()
Start music playing.
Music & Pause()
Pause music playing.
bool IsPlaying() const
Check if music is playing.
void set(const ::Music &music)
~Music()
Unload music stream.
Music(const std::string &fileName)
Load music stream from file.
void Unload()
Unload music stream.
AudioStream management functions.
Music(const ::Music &music)
Music & Update()
Updates buffers for music streaming.
float GetTimeLength() const
Get music time length (in seconds)
float GetTimePlayed() const
Get current music time played (in seconds)