45 lines
1.2 KiB
C++
45 lines
1.2 KiB
C++
|
#pragma once
|
||
|
#include "playback_backend.hpp"
|
||
|
#include <omp.h>
|
||
|
#include <cstdint>
|
||
|
#include <stddef.h>
|
||
|
#include <stdint.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <string.h>
|
||
|
#include <streambuf>
|
||
|
#include <vector>
|
||
|
#include <util.hpp>
|
||
|
#include <SDL.h>
|
||
|
#include <gme.h>
|
||
|
#include "file_backend.hpp"
|
||
|
class GmeBackend : public PlaybackBackend {
|
||
|
File *file;
|
||
|
Fifo<int16_t> audio_buf;
|
||
|
Music_Emu *gme_backend;
|
||
|
int streamidx;
|
||
|
int loop_len, loop_start;
|
||
|
std::map<std::string, int> voices;
|
||
|
public:
|
||
|
uint64_t get_min_samples() override;
|
||
|
std::optional<uint64_t> get_max_samples() override;
|
||
|
inline std::string get_id() override {
|
||
|
return "gme";
|
||
|
}
|
||
|
inline std::string get_name() override {
|
||
|
return "Game Music Emu";
|
||
|
}
|
||
|
void add_licenses() override;
|
||
|
//std::vector<Property> get_property_list() override;
|
||
|
void seek_samples(uint64_t position) override;
|
||
|
void load(const char *filename) override;
|
||
|
void switch_stream(int idx) override;
|
||
|
void cleanup() override;
|
||
|
int get_stream_idx() override;
|
||
|
size_t render(void *buf, size_t maxlen) override;
|
||
|
uint64_t get_position_samples() override;
|
||
|
inline uint64_t get_length_samples() override {
|
||
|
return length;
|
||
|
}
|
||
|
inline ~GmeBackend() override { }
|
||
|
};
|