diff options
author | Robin Gareus <robin@gareus.org> | 2016-08-15 22:13:29 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-08-15 22:25:56 +0200 |
commit | 3b7dbdfeb84b08426d315f62b65cfe1d33ae457b (patch) | |
tree | 85c4e208a72618cc48b95cb33310f8663d008a29 /libs/lua | |
parent | 9421e0b4a7c021ef6ac19fe7d003767a986deb4e (diff) |
Re-enable luabridge addProperty()
In preparation to expose ARDOUR::SessionConfiguration.
Also change the return-type to bool to match Ardour's set/get API
Diffstat (limited to 'libs/lua')
-rw-r--r-- | libs/lua/LuaBridge/detail/Namespace.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libs/lua/LuaBridge/detail/Namespace.h b/libs/lua/LuaBridge/detail/Namespace.h index 92aed81530..0be54456b3 100644 --- a/libs/lua/LuaBridge/detail/Namespace.h +++ b/libs/lua/LuaBridge/detail/Namespace.h @@ -783,13 +783,12 @@ private: return *this; } -#if 0 // unused //-------------------------------------------------------------------------- /** Add or replace a property member. */ template <class TG, class TS> - Class <T>& addProperty (char const* name, TG (T::* get) () const, void (T::* set) (TS)) + Class <T>& addProperty (char const* name, TG (T::* get) () const, bool (T::* set) (TS)) { // Add to __propget in class and const tables. { @@ -808,7 +807,7 @@ private: // Add to __propset in class table. rawgetfield (L, -2, "__propset"); assert (lua_istable (L, -1)); - typedef void (T::* set_t) (TS); + typedef bool (T::* set_t) (TS); new (lua_newuserdata (L, sizeof (set_t))) set_t (set); lua_pushcclosure (L, &CFunc::CallMember <set_t>::f, 1); rawsetfield (L, -2, name); @@ -818,6 +817,7 @@ private: return *this; } +#if 0 // unused // read-only template <class TG> Class <T>& addProperty (char const* name, TG (T::* get) () const) @@ -835,6 +835,7 @@ private: return *this; } +#endif //-------------------------------------------------------------------------- /** @@ -848,7 +849,7 @@ private: argument respectively. */ template <class TG, class TS> - Class <T>& addProperty (char const* name, TG (*get) (T const*), void (*set) (T*, TS)) + Class <T>& addProperty (char const* name, TG (*get) (T const*), bool (*set) (T*, TS)) { // Add to __propget in class and const tables. { @@ -878,6 +879,7 @@ private: return *this; } +#if 0 // unused // read-only template <class TG, class TS> Class <T>& addProperty (char const* name, TG (*get) (T const*)) @@ -1545,6 +1547,7 @@ public: If the set function is omitted or null, the property is read-only. */ +#if 0 // unused template <class TG, class TS> Namespace& addProperty (char const* name, TG (*get) (), void (*set)(TS) = 0) { @@ -1576,6 +1579,7 @@ public: return *this; } +#endif //---------------------------------------------------------------------------- /** |