summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/ardour/ardour/luaproc.h7
-rw-r--r--libs/ardour/luabindings.cc9
-rw-r--r--libs/ardour/luaproc.cc11
3 files changed, 23 insertions, 4 deletions
diff --git a/libs/ardour/ardour/luaproc.h b/libs/ardour/ardour/luaproc.h
index d0d919b6c3..423a960feb 100644
--- a/libs/ardour/ardour/luaproc.h
+++ b/libs/ardour/ardour/luaproc.h
@@ -125,6 +125,9 @@ public:
bool has_inline_display () { return _lua_has_inline_display; }
void setup_lua_inline_gui (LuaState *lua_gui);
+ DSP::DspShm* instance_shm () { return &lshm; }
+ LuaTableRef* instance_ref () { return &lref; }
+
private:
void find_presets ();
@@ -146,12 +149,12 @@ private:
bool _lua_has_inline_display;
void queue_draw () { QueueDraw(); /* EMIT SIGNAL */ }
- DSP::DspShm* instance_shm () { return &lshm; }
DSP::DspShm lshm;
- LuaTableRef* instance_ref () { return &lref; }
LuaTableRef lref;
+ boost::weak_ptr<Route> route () const;
+
void init ();
bool load_script ();
void lua_print (std::string s);
diff --git a/libs/ardour/luabindings.cc b/libs/ardour/luabindings.cc
index b19ca57cfd..52e313d879 100644
--- a/libs/ardour/luabindings.cc
+++ b/libs/ardour/luabindings.cc
@@ -1095,8 +1095,8 @@ LuaBindings::common (lua_State* L)
#if 0 // those objects are not yet bound
.addCast<CapturingProcessor> ("to_capturingprocessor")
.addCast<DelayLine> ("to_delayline")
- .addCast<PeakMeter> ("to_meter")
#endif
+ .addCast<PeakMeter> ("to_meter")
.addFunction ("display_name", &Processor::display_name)
.addFunction ("active", &Processor::active)
.addFunction ("activate", &Processor::activate)
@@ -1117,6 +1117,8 @@ LuaBindings::common (lua_State* L)
.endClass ()
.deriveWSPtrClass <Plugin, PBD::StatefulDestructible> ("Plugin")
+ .addCast<LuaProc> ("to_luaproc")
+ .addFunction ("unique_id", &Plugin::unique_id)
.addFunction ("label", &Plugin::label)
.addFunction ("name", &Plugin::name)
.addFunction ("maker", &Plugin::maker)
@@ -1132,6 +1134,11 @@ LuaBindings::common (lua_State* L)
.addRefFunction ("get_parameter_descriptor", &Plugin::get_parameter_descriptor)
.endClass ()
+ .deriveWSPtrClass <LuaProc, Plugin> ("LuaProc")
+ .addFunction ("shmem", &LuaProc::instance_shm)
+ .addFunction ("table", &LuaProc::instance_ref)
+ .endClass ()
+
.deriveWSPtrClass <PluginInsert, Processor> ("PluginInsert")
.addFunction ("plugin", &PluginInsert::plugin)
.addFunction ("activate", &PluginInsert::activate)
diff --git a/libs/ardour/luaproc.cc b/libs/ardour/luaproc.cc
index e679589e4b..0a17b70f4f 100644
--- a/libs/ardour/luaproc.cc
+++ b/libs/ardour/luaproc.cc
@@ -144,10 +144,13 @@ LuaProc::init ()
luabridge::getGlobalNamespace (L)
.beginNamespace ("Ardour")
- .beginClass <LuaProc> ("LuaProc")
+ .deriveClass <LuaProc, PBD::StatefulDestructible> ("LuaProc")
.addFunction ("queue_draw", &LuaProc::queue_draw)
.addFunction ("shmem", &LuaProc::instance_shm)
.addFunction ("table", &LuaProc::instance_ref)
+ .addFunction ("route", &LuaProc::route)
+ .addFunction ("unique_id", &LuaProc::unique_id)
+ .addFunction ("name", &LuaProc::name)
.endClass ()
.endNamespace ();
@@ -167,6 +170,12 @@ LuaProc::init ()
lua.do_command ("function ardour () end");
}
+boost::weak_ptr<Route>
+LuaProc::route () const
+{
+ return static_cast<Route*>(_owner)->weakroute ();
+}
+
void
LuaProc::lua_print (std::string s) {
std::cout <<"LuaProc: " << s << "\n";