audio system basic interface

This commit is contained in:
MihailRis
2024-02-27 03:31:57 +03:00
parent 7cde1e8ac9
commit 97539aa9f4
12 changed files with 528 additions and 320 deletions
+44
View File
@@ -0,0 +1,44 @@
#ifndef AUDIO_NOAUDIO_H_
#define AUDIO_NOAUDIO_H_
#include "audio.h"
namespace audio {
class NoSound : public Sound {
std::shared_ptr<PCM> pcm;
duration_t duration;
public:
NoSound(std::shared_ptr<PCM> pcm, bool keepPCM);
~NoSound() {}
duration_t getDuration() const override {
return duration;
}
std::shared_ptr<PCM> getPCM() const override {
return pcm;
}
speakerid_t newInstance(int priority) const override {
return 0;
}
};
class NoAudio : public Backend {
public:
~NoAudio() {}
Sound* createSound(std::shared_ptr<PCM> pcm, bool keepPCM) override;
void setListener(
glm::vec3 position,
glm::vec3 velocity,
glm::vec3 at,
glm::vec3 up
) override {}
static NoAudio* create();
};
}
#endif // AUDIO_NOAUDIO_H_