Zachary Hall
8d9cf9372e
Some checks failed
Build / build-gentoo (push) Failing after 14s
Build / download-system-deps (push) Successful in 4m36s
Build / get-source-code (push) Successful in 17m33s
Build / build-deb (push) Failing after 12m45s
Build / build-appimage (push) Successful in 5m23s
Build / build-android (push) Failing after 3m11s
Build / build-windows (push) Failing after 7m37s
44 lines
1.2 KiB
C++
44 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 { }
|
|
};
|