tweak cases where pin-mapping is reset & always sanitize map
[ardour.git] / libs / lua / LuaBridge / LuaBridge.h
index d03120ae0066626c245a2c9853141ec251dd1323..706e77cbfdb7dae7101e8fe83986a40fb1925a3b 100644 (file)
@@ -51,6 +51,8 @@
 #include <boost/type_traits.hpp>
 #include <boost/shared_ptr.hpp>
 
+#include "lua/luastate.h"
+
 #define LUABRIDGE_MAJOR_VERSION 2
 #define LUABRIDGE_MINOR_VERSION 0
 #define LUABRIDGE_VERSION 200
@@ -113,6 +115,40 @@ private:
   }
 };
 
+//------------------------------------------------------------------------------
+
+#ifdef LUABINDINGDOC
+class LuaBindingDoc
+{
+public:
+       static bool printBindings ()
+       {
+               return getSettings().print_bindings;
+       }
+
+       static void setPrintBindings (bool en)
+       {
+               getSettings().print_bindings = en;
+       }
+
+private:
+       struct Settings
+       {
+               Settings () : print_bindings (false) { }
+               bool print_bindings;
+       };
+
+       static Settings& getSettings ()
+       {
+               static Settings settings;
+               return settings;
+       }
+};
+#endif
+
+//------------------------------------------------------------------------------
+
+
 #include "detail/Userdata.h"
 #include "detail/CFunctions.h"
 #include "detail/Namespace.h"
@@ -150,6 +186,13 @@ inline void setHideMetatables (bool shouldHide)
   Security::setHideMetatables (shouldHide);
 }
 
+#ifdef LUABINDINGDOC
+inline void setPrintBindings (bool en)
+{
+  LuaBindingDoc::setPrintBindings (en);
+}
+#endif
+
 } // end Namespace
 
 #endif