13
0

add FluidSynth Lua Bindings

This commit is contained in:
Robin Gareus 2016-08-23 22:18:04 +02:00
parent 2d5166606b
commit 5d597cdfeb
2 changed files with 18 additions and 0 deletions

View File

@ -36,6 +36,7 @@
#include "ardour/chan_mapping.h"
#include "ardour/dB.h"
#include "ardour/dsp_filter.h"
#include "ardour/fluid_synth.h"
#include "ardour/interthread_info.h"
#include "ardour/lua_api.h"
#include "ardour/luabindings.h"
@ -169,6 +170,7 @@ CLASSKEYS(ARDOUR::LuaOSC::Address);
CLASSKEYS(ARDOUR::Session);
CLASSKEYS(ARDOUR::BufferSet);
CLASSKEYS(ARDOUR::ChanMapping);
CLASSKEYS(ARDOUR::FluidSynth);
CLASSKEYS(ARDOUR::DSP::DspShm);
CLASSKEYS(ARDOUR::LuaTableRef);
CLASSKEYS(PBD::Configuration);
@ -1479,6 +1481,20 @@ LuaBindings::dsp (lua_State* L)
.endClass ()
.endNamespace ();
luabridge::getGlobalNamespace (L)
.beginNamespace ("ARDOUR")
.beginClass <FluidSynth> ("FluidSynth")
.addConstructor <void (*) (float, int)> ()
.addFunction ("load_sf2", &FluidSynth::load_sf2)
.addFunction ("synth", &FluidSynth::synth)
.addFunction ("midi_event", &FluidSynth::midi_event)
.addFunction ("panic", &FluidSynth::panic)
.addFunction ("select_program", &FluidSynth::select_program)
.addFunction ("program_count", &FluidSynth::program_count)
.addFunction ("program_name", &FluidSynth::program_name)
.endClass ()
.endNamespace ();
luabridge::getGlobalNamespace (L)
.beginNamespace ("ARDOUR")
.beginNamespace ("DSP")

View File

@ -664,6 +664,8 @@ LuaProc::connect_and_run (BufferSet& bufs,
luabridge::LuaRef lua_midi_event (luabridge::newTable (L));
lua_midi_event["time"] = 1 + (*m).time();
lua_midi_event["data"] = lua_midi_data;
lua_midi_event["bytes"] = data;
lua_midi_event["size"] = ev.size();
lua_midi_src_tbl[e] = lua_midi_event;
}
}