13
0

Add Lua API to list all available plugins

This commit is contained in:
Robin Gareus 2018-05-31 16:01:35 +02:00
parent 1e5813cf18
commit d95df91642
3 changed files with 32 additions and 0 deletions

View File

@ -65,6 +65,10 @@ namespace ARDOUR { namespace LuaAPI {
*/
boost::shared_ptr<ARDOUR::Processor> new_luaproc (ARDOUR::Session *s, const std::string& p);
/** return a PluginInfoList (all plugin)
*/
std::list<boost::shared_ptr<ARDOUR::PluginInfo> > list_plugins ();
/** search a Plugin
*
* @param id Plugin Name, ID or URI

View File

@ -103,6 +103,30 @@ ARDOUR::LuaAPI::new_luaproc (Session *s, const string& name)
return boost::shared_ptr<Processor> (new PluginInsert (*s, p));
}
PluginInfoList
ARDOUR::LuaAPI::list_plugins ()
{
PluginManager& manager = PluginManager::instance ();
PluginInfoList all_plugs;
all_plugs.insert (all_plugs.end (), manager.ladspa_plugin_info ().begin (), manager.ladspa_plugin_info ().end ());
all_plugs.insert (all_plugs.end (), manager.lua_plugin_info ().begin (), manager.lua_plugin_info ().end ());
#ifdef WINDOWS_VST_SUPPORT
all_plugs.insert (all_plugs.end (), manager.windows_vst_plugin_info ().begin (), manager.windows_vst_plugin_info ().end ());
#endif
#ifdef LXVST_SUPPORT
all_plugs.insert (all_plugs.end (), manager.lxvst_plugin_info ().begin (), manager.lxvst_plugin_info ().end ());
#endif
#ifdef AUDIOUNIT_SUPPORT
all_plugs.insert (all_plugs.end (), manager.au_plugin_info ().begin (), manager.au_plugin_info ().end ());
#endif
#ifdef LV2_SUPPORT
all_plugs.insert (all_plugs.end (), manager.lv2_plugin_info ().begin (), manager.lv2_plugin_info ().end ());
#endif
all_plugs.insert (all_plugs.end (), manager.lua_plugin_info ().begin (), manager.lua_plugin_info ().end ());
return all_plugs;
}
PluginInfoPtr
ARDOUR::LuaAPI::new_plugin_info (const string& name, ARDOUR::PluginType type)
{

View File

@ -199,6 +199,7 @@ CLASSKEYS(ARDOUR::RouteGroup);
CLASSKEYS(ARDOUR::ParameterDescriptor);
CLASSKEYS(ARDOUR::PeakMeter);
CLASSKEYS(ARDOUR::PluginInfo);
CLASSKEYS(ARDOUR::PluginInfo);
CLASSKEYS(ARDOUR::Plugin::PresetRecord);
CLASSKEYS(ARDOUR::PortEngine);
CLASSKEYS(ARDOUR::PortManager);
@ -232,6 +233,7 @@ CLASSKEYS(std::list<Evoral::ControlEvent*>);
CLASSKEYS(std::vector<ARDOUR::Plugin::PresetRecord>);
CLASSKEYS(std::vector<boost::shared_ptr<ARDOUR::Processor> >);
CLASSKEYS(std::vector<boost::shared_ptr<ARDOUR::Source> >);
CLASSKEYS(std::list<boost::shared_ptr<ARDOUR::PluginInfo> >); // PluginInfoList
CLASSKEYS(std::list<ArdourMarker*>);
CLASSKEYS(std::list<TimeAxisView*>);
@ -1324,6 +1326,7 @@ LuaBindings::common (lua_State* L)
.endClass ()
.beginStdVector <Plugin::PresetRecord> ("PresetVector").endClass ()
.beginStdList <boost::shared_ptr<ARDOUR::PluginInfo> > ("PluginInfoList").endClass ()
.deriveClass <ParameterDescriptor, Evoral::ParameterDescriptor> ("ParameterDescriptor")
.addVoidConstructor ()
@ -2303,6 +2306,7 @@ LuaBindings::common (lua_State* L)
.beginNamespace ("LuaAPI")
.addFunction ("nil_proc", ARDOUR::LuaAPI::nil_processor)
.addFunction ("new_luaproc", ARDOUR::LuaAPI::new_luaproc)
.addFunction ("list_plugins", ARDOUR::LuaAPI::list_plugins)
.addFunction ("new_plugin_info", ARDOUR::LuaAPI::new_plugin_info)
.addFunction ("new_plugin", ARDOUR::LuaAPI::new_plugin)
.addFunction ("set_processor_param", ARDOUR::LuaAPI::set_processor_param)