mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 21:11:50 +00:00
audio system basic interface
This commit is contained in:
parent
7cde1e8ac9
commit
97539aa9f4
12 changed files with 528 additions and 320 deletions
44
src/audio/NoAudio.h
Normal file
44
src/audio/NoAudio.h
Normal 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_
|
||||
Loading…
Add table
Add a link
Reference in a new issue