29 lines
754 B
C++
29 lines
754 B
C++
|
#pragma once
|
||
|
#include "playback_backend.hpp"
|
||
|
extern "C" {
|
||
|
#include "vgmstream.h"
|
||
|
}
|
||
|
#include <stddef.h>
|
||
|
#include <stdint.h>
|
||
|
#include "file_backend.hpp"
|
||
|
class VgmStreamBackend : public PlaybackBackend {
|
||
|
STREAMFILE *sf;
|
||
|
VGMSTREAM *vf;
|
||
|
File *file;
|
||
|
public:
|
||
|
inline std::string get_id() override {
|
||
|
return "vgmstream";
|
||
|
}
|
||
|
inline std::string get_name() override {
|
||
|
return "VGMStream";
|
||
|
}
|
||
|
void seek(double 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;
|
||
|
double get_position() override;
|
||
|
inline ~VgmStreamBackend() override { }
|
||
|
};
|