mapcreator git · master
SDL3 2.5D game and engine using assets, with map editor
C++ 99.3%git clone https://git.christianimmanuel.de/sdl-graphics/mapcreator.gitwget https://git.christianimmanuel.de/sdl-graphics/mapcreator/archive/mapcreator.tar.gzsrc/audio/audio.hpp raw
#pragma once
#include <SDL3_mixer/SDL_mixer.h>
#define AUDIO_MAX_SOUNDS 64
#define AUDIO_ID_LEN 64
struct AudioSound {
char id[AUDIO_ID_LEN];
MIX_Audio* audio;
MIX_Track* track;
};
class Audio {
public:
Audio();
bool RegisterSound(const char* id, const char* filename);
bool Play(const char* id, SDL_PropertiesID options = 0);
bool Stop(const char* id, SDL_PropertiesID options = 0);
bool is_Playing(const char* id);
void Quit();
private:
MIX_Mixer* mixer;
AudioSound sounds[AUDIO_MAX_SOUNDS];
int sound_count;
AudioSound* Find(const char* id);
Audio(const Audio&) = delete;
Audio& operator=(const Audio&) = delete;
};