#pragma once #include "playback_backend.hpp" #include #include #include #include #include #include #include #include #include #include #include "file_backend.hpp" class FluidSynthBackend : public PlaybackBackend { File *file; void seek_internal(double position, bool loop = true); std::vector 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 get_max_samples() override; inline std::string get_id() override { return "fluidsynth"; } inline std::string get_name() override { return "MIDI player"; } std::vector 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 { } };