looper/backends/playback/fluidsynth/fluidsynth_backend.hpp
Zachary Hall f91ff0f36f
Some checks failed
Build / download-system-deps (push) Successful in 1m12s
Build / build-gentoo (push) Successful in 1m25s
Build / get-source-code (push) Successful in 6m49s
Build / build-appimage (push) Successful in 2m46s
Build / build-android (push) Failing after 7m18s
Build / build-windows (push) Failing after 6m33s
Update
2024-10-26 09:01:16 -07:00

46 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"
#include <fluidsynth.h>
class FluidSynthBackend : public PlaybackBackend {
File *file;
static void fluidsynth_get_property_list_wrapper(void *udata, const char *name, int type);
std::vector<Property> fluidsynth_properties;
fluid_settings_t *settings;
void fluidsynth_get_property_list(const char *name, int type);
public:
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);
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 ~FluidSynthBackend() override { }
};