#pragma once #include #include #include #include constexpr int NUM_MIDI_NOTES = 128; typedef std::array Tuning; /** * C++ wrapper around the fluidsynth API. */ class Synth { public: Synth(); ~Synth(); struct Soundfont { std::string name; int id; }; struct Program { std::string name; int soundfontId; int bankNumber; int programNumber; }; bool loadSoundfont(const std::string& filepath); bool loadProgram(const Program& program); bool setTuning(const Tuning& pitches); bool resetTuning(); const std::vector& getPrograms() const; // TODO JMT: remove this fluid_synth_t* getSynth(); private: std::vector soundfonts; std::vector programs; fluid_settings_t* settings = NULL; fluid_synth_t* synth = NULL; fluid_audio_driver_t* adriver = NULL; };