init commit

This commit is contained in:
Alex Lardner
2026-07-04 19:08:19 -07:00
parent 40dc51d21a
commit d7890c9808
106 changed files with 13653 additions and 0 deletions
+55
View File
@@ -0,0 +1,55 @@
#ifndef RAYLIB_CPP_INCLUDE_AUDIOSTREAM_HPP_
#define RAYLIB_CPP_INCLUDE_AUDIOSTREAM_HPP_
#include "./AudioStreamUnmanaged.hpp"
namespace raylib {
/**
* AudioStream management functions.
*
* The audio stream will be unloaded on object destruction. Use raylib::AudioStreamUnmanaged if you're looking to not unload.
*
* @see raylib::AudioStreamUnmanaged
*/
class AudioStream : public AudioStreamUnmanaged {
public:
using AudioStreamUnmanaged::AudioStreamUnmanaged;
AudioStream(const AudioStream&) = delete;
AudioStream& operator=(const AudioStream&) = delete;
AudioStream(AudioStream&& other) noexcept {
set(other);
other.buffer = nullptr;
other.processor = nullptr;
other.sampleRate = 0;
other.sampleSize = 0;
other.channels = 0;
}
AudioStream& operator=(AudioStream&& other) noexcept {
if (this == &other) {
return *this;
}
Unload();
set(other);
other.buffer = nullptr;
other.processor = nullptr;
other.sampleRate = 0;
other.sampleSize = 0;
other.channels = 0;
return *this;
}
~AudioStream() { Unload(); }
void Load(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels = 2) {
Unload();
AudioStreamUnmanaged::Load(sampleRate, sampleSize, channels);
}
};
} // namespace raylib
using RAudioStream = raylib::AudioStream;
#endif // RAYLIB_CPP_INCLUDE_AUDIOSTREAM_HPP_