47 lines
1.6 KiB
C++
47 lines
1.6 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 "file_backend.hpp"
|
|
class FluidSynthBackend : public PlaybackBackend {
|
|
File *file;
|
|
void seek_internal(double position, bool loop = true);
|
|
std::vector<Property> fluidsynth_properties;
|
|
fluid_settings_t *settings;
|
|
void fluidsynth_get_property_list(const char *name, int type);
|
|
public:
|
|
uint64_t get_min_samples() override;
|
|
void set_fluidsynth_property_str(std::string path, std::string val);
|
|
void set_fluidsynth_property_num(std::string path, double val);
|
|
void set_fluidsynth_property_int(std::string path, int val);
|
|
std::string get_fluidsynth_property_str(std::string path);
|
|
double get_fluidsynth_property_num(std::string path);
|
|
int get_fluidsynth_property_int(std::string path);
|
|
std::optional<uint64_t> get_max_samples() override;
|
|
inline std::string get_id() override {
|
|
return "fluidsynth";
|
|
}
|
|
inline std::string get_name() override {
|
|
return "MIDI player";
|
|
}
|
|
std::vector<Property> get_property_list() override;
|
|
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 double get_length() override {
|
|
return length;
|
|
}
|
|
inline ~ZsmBackend() override { }
|
|
};
|