looper/backends/playback/gme/gme_backend.hpp
Zachary Hall c2a971d225
Some checks failed
Build / download-system-deps (push) Successful in 5m0s
Build / build-gentoo (push) Failing after 14s
Build / get-source-code (push) Successful in 12m59s
Build / build-deb (push) Failing after 5m28s
Build / build-appimage (push) Successful in 4m46s
Build / build-android (push) Failing after 3m22s
Build / build-windows (push) Failing after 7m54s
Use system game-music-emu
2025-01-18 09:59:06 -08:00

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/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 { }
};