#include "ardour/plugin_insert.h"
#include "ardour/plugin_manager.h"
+#include "LuaBridge/LuaBridge.h"
+
#include "i18n.h"
using namespace ARDOUR;
return boost::shared_ptr<Processor> (new PluginInsert (*s, p));
}
-
-boost::shared_ptr<Processor>
-ARDOUR::LuaAPI::new_plugin (Session *s, const string& name, ARDOUR::PluginType type, const string& preset)
+PluginInfoPtr
+ARDOUR::LuaAPI::new_plugin_info (const string& name, ARDOUR::PluginType type)
{
- if (!s) {
- return boost::shared_ptr<Processor> ();
- }
-
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.lv2_plugin_info().begin(), manager.lv2_plugin_info().end());
#endif
- PluginInfoPtr pip;
for (PluginInfoList::const_iterator i = all_plugs.begin(); i != all_plugs.end(); ++i) {
if (((*i)->name == name || (*i)->unique_id == name) && (*i)->type == type) {
- pip = *i;
- break;
+ return *i;
}
}
+ return PluginInfoPtr ();
+}
+
+boost::shared_ptr<Processor>
+ARDOUR::LuaAPI::new_plugin (Session *s, const string& name, ARDOUR::PluginType type, const string& preset)
+{
+ if (!s) {
+ return boost::shared_ptr<Processor> ();
+ }
+
+ PluginInfoPtr pip = new_plugin_info (name, type);
+
if (!pip) {
return boost::shared_ptr<Processor> ();
}
}
int
-ARDOUR::LuaAPI::LuaOSCAddress::send (lua_State *L)
+ARDOUR::LuaOSC::Address::send (lua_State *L)
{
- LuaOSCAddress * const luaosc = luabridge::Userdata::get <LuaOSCAddress> (L, 1, false);
+ Address * const luaosc = luabridge::Userdata::get <Address> (L, 1, false);
if (!luaosc) {
return luaL_error (L, "Invalid pointer to OSC.Address");
}
int rv = lo_send_message (luaosc->_addr, path, msg);
lo_message_free (msg);
- luabridge::Stack<int>::push (L, rv);
+ luabridge::Stack<bool>::push (L, (rv == 0));
return 1;
}