MCPcopy Create free account
hub / github.com/RobLoach/raylib-cpp / Music

Class Music

include/Music.hpp:14–61  ·  view source on GitHub ↗

* Music stream type (audio file streaming from memory). * * The music stream will be unloaded on object destruction. Use raylib::MusicUnmanaged if you're looking to not unload. * * @see raylib::MusicUnmanaged */

Source from the content-addressed store, hash-verified

12 * @see raylib::MusicUnmanaged
13 */
14class Music : public MusicUnmanaged {
15public:
16 using MusicUnmanaged::MusicUnmanaged;
17
18 Music(const Music&) = delete;
19 Music& operator=(const Music&) = delete;
20
21 Music(Music&& other) noexcept {
22 set(other);
23 other.stream = {};
24 other.frameCount = 0;
25 other.looping = false;
26 other.ctxType = 0;
27 other.ctxData = nullptr;
28 }
29
30 Music& operator=(Music&& other) noexcept {
31 if (this == &other) {
32 return *this;
33 }
34 Unload();
35 set(other);
36 other.ctxType = 0;
37 other.ctxData = nullptr;
38 other.looping = false;
39 other.frameCount = 0;
40 other.stream = {};
41 return *this;
42 }
43
44 Music& operator=(const ::Music& music) {
45 Unload();
46 set(music);
47 return *this;
48 }
49
50 ~Music() { Unload(); }
51
52 void Load(const std::string& fileName) {
53 Unload();
54 MusicUnmanaged::Load(fileName);
55 }
56
57 void Load(const std::string& fileType, unsigned char* data, int dataSize) {
58 Unload();
59 MusicUnmanaged::Load(fileType, data, dataSize);
60 }
61};
62} // namespace raylib
63
64using RMusic = raylib::Music;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected