From ab01d150be6ba8f7f4a9359586cf19fd604115d6 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 11 Apr 2016 14:04:45 +0200 Subject: [PATCH] clean up lua-class inheritance Implicit casts of derived classes only work for the first parent. other parent classes require dedicated casts --- libs/ardour/luabindings.cc | 14 ++++++++------ 1 file 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 ("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") - /* multiple inheritance is not covered by luabridge, - * we need explicit casts :( */ + .beginWSPtrClass ("SessionObject") + /* SessionObject is-a PBD::StatefulDestructible, + * but multiple inheritance is not covered by luabridge, + * we need explicit casts */ .addCast ("to_stateful") .addCast ("to_statefuldestructible") .addFunction ("name", &SessionObject::name) @@ -530,8 +532,8 @@ LuaBindings::common (lua_State* L) .addData ("logarithmic", &ParameterDescriptor::logarithmic) .endClass () - .deriveWSPtrClass ("Processor") - .addCast ("to_sessionobject") + .deriveWSPtrClass ("Processor") + .addCast ("to_automatable") .addCast ("to_insert") .addCast ("to_sidechain") .addCast ("to_ioprocessor") @@ -583,7 +585,7 @@ LuaBindings::common (lua_State* L) .endClass () - .deriveWSPtrClass ("AutomationControl") + .deriveWSPtrClass ("AutomationControl") .addCast ("to_ctrl") .addFunction ("automation_state", &AutomationControl::automation_state) .addFunction ("automation_style", &AutomationControl::automation_style)