2024-08-08 13:12:37 -07:00
|
|
|
#pragma once
|
|
|
|
#include "playback_backend.hpp"
|
|
|
|
#include <SDL_mixer.h>
|
|
|
|
#include "file_backend.hpp"
|
|
|
|
class SDLMixerXBackend : public PlaybackBackend {
|
|
|
|
Mix_Music *music;
|
|
|
|
Mix_CommonMixer_t mixer;
|
|
|
|
File *file;
|
2024-09-28 10:31:06 -07:00
|
|
|
bool initial = false;
|
2024-08-08 13:12:37 -07:00
|
|
|
public:
|
|
|
|
inline std::string get_id() override {
|
|
|
|
return "sdl_mixer_x";
|
|
|
|
}
|
|
|
|
inline std::string get_name() override {
|
|
|
|
return "SDL Mixer X";
|
|
|
|
}
|
|
|
|
std::optional<uint64_t> get_max_samples() override;
|
|
|
|
void seek(double position) override;
|
|
|
|
double get_position() override;
|
|
|
|
void load(const char *filename) override;
|
|
|
|
void switch_stream(int idx) override;
|
|
|
|
void cleanup() override;
|
|
|
|
size_t render(void *buf, size_t maxlen) override;
|
2024-09-28 10:31:06 -07:00
|
|
|
SDLMixerXBackend();
|
|
|
|
~SDLMixerXBackend() override;
|
2024-08-08 13:12:37 -07:00
|
|
|
};
|