summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-04-11 14:04:45 +0200
committerRobin Gareus <robin@gareus.org>2016-04-11 14:04:45 +0200
commitab01d150be6ba8f7f4a9359586cf19fd604115d6 (patch)
treeb98b675d3ecebdf1ba395fb6eb0e4f144028249a
parent04c9b3155cedcdd69e0ad4bc2154cae96d4c8a2d (diff)
clean up lua-class inheritance
Implicit casts of derived classes only work for the first parent. other parent classes require dedicated casts
-rw-r--r--libs/ardour/luabindings.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/libs/ardour/luabindings.cc b/libs/ardour/luabindings.cc
index 227c6ced9c..cf429ea5d7 100644
--- a/libs/ardour/luabindings.cc
+++ b/libs/ardour/luabindings.cc
@@ -151,6 +151,7 @@ LuaBindings::common (lua_State* L)
.endClass ()
.deriveWSPtrClass <PBD::Controllable, PBD::StatefulDestructible> ("Controllable")
+ .addFunction ("name", &PBD::Controllable::name)
.addFunction ("get_value", &PBD::Controllable::get_value)
.endClass ()
@@ -317,9 +318,10 @@ LuaBindings::common (lua_State* L)
.addFunction ("first_mark_after", &Locations::first_mark_after)
.endClass ()
- .deriveWSPtrClass <SessionObject, PBD::StatefulDestructible> ("SessionObject")
- /* multiple inheritance is not covered by luabridge,
- * we need explicit casts :( */
+ .beginWSPtrClass <SessionObject> ("SessionObject")
+ /* SessionObject is-a PBD::StatefulDestructible,
+ * but multiple inheritance is not covered by luabridge,
+ * we need explicit casts */
.addCast<PBD::Stateful> ("to_stateful")
.addCast<PBD::StatefulDestructible> ("to_statefuldestructible")
.addFunction ("name", &SessionObject::name)
@@ -530,8 +532,8 @@ LuaBindings::common (lua_State* L)
.addData ("logarithmic", &ParameterDescriptor::logarithmic)
.endClass ()
- .deriveWSPtrClass <Processor, Automatable> ("Processor")
- .addCast<SessionObject> ("to_sessionobject")
+ .deriveWSPtrClass <Processor, SessionObject> ("Processor")
+ .addCast<Automatable> ("to_automatable")
.addCast<PluginInsert> ("to_insert")
.addCast<SideChain> ("to_sidechain")
.addCast<IOProcessor> ("to_ioprocessor")
@@ -583,7 +585,7 @@ LuaBindings::common (lua_State* L)
.endClass ()
- .deriveWSPtrClass <AutomationControl, Evoral::Control> ("AutomationControl")
+ .deriveWSPtrClass <AutomationControl, PBD::Controllable> ("AutomationControl")
.addCast<Evoral::Control> ("to_ctrl")
.addFunction ("automation_state", &AutomationControl::automation_state)
.addFunction ("automation_style", &AutomationControl::automation_style)