Making sound constructor more generalised(probably will make it public soon)

This commit is contained in:
2025-09-08 00:37:10 +03:00
parent 146bd49b36
commit 13a21387df
3 changed files with 23 additions and 19 deletions

View File

@@ -3,6 +3,7 @@
#include <Corrade/Containers/Containers.h>
#include <Magnum/Magnum.h>
#include <Magnum/Math/Vector.h>
#include <functional>
#include <string>
namespace ChargeAudio {
@@ -27,8 +28,8 @@ public:
float GetVolume();
private:
Sound(class Engine *engine);
void init(std::string additionalErrorMessage = "");
Sound(class Engine *engine, std::function<void(Sound *)> setupFunction,
std::string additionalErrorMessage = "");
static void onSoundFinish(void *customData, ma_sound *);
class Engine *baseEngine;
@@ -61,7 +62,8 @@ public:
~Engine();
// Creating tools
Containers::Pointer<Sound> CreateSound(std::string filepath);
Containers::Pointer<Sound> CreateSound(std::string filepath,
bool streamFile = false);
Containers::Pointer<Listener> CreateListener();
void SetVolume(float value);