Files
kichikuou_system3-sdl2/src/sys/music_decoder.h
T
kichikuou bdb93bf7ed Add SDL3 support alongside SDL2
Centralize the differences between SDL2 and SDL3 behind compatibility
interfaces and select the appropriate implementations with the
SYSTEM3_SDL_VERSION CMake option. The default is SDL2 except on Android,
which supports only SDL3.
2026-09-15 15:21:22 +09:00

25 lines
525 B
C++

#ifndef MAKO_MUSIC_DECODER_H_
#define MAKO_MUSIC_DECODER_H_
#include <memory>
#include <string>
#include "sdl_compat.h"
struct DecodedChunk {
const Uint8* data;
int frames;
};
class MusicDecoder {
public:
virtual ~MusicDecoder() = default;
virtual bool is_open() const = 0;
virtual const SDL_AudioSpec& spec() const = 0;
virtual DecodedChunk decode(int max_frames) = 0;
virtual void seek_start() = 0;
};
std::unique_ptr<MusicDecoder> create_music_decoder(const std::string& path);
#endif // MAKO_MUSIC_DECODER_H_