fix crash when copy'ing latent plugins
[ardour.git] / libs / ardour / luabindings.cc
index f7ac8ec6331fb4aa855a2f65ddfb8c4e0749a9d6..0bbfb11624cbd164e55119d73cd4eda20307a2e6 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "timecode/bbt_time.h"
 #include "pbd/stateful_diff_command.h"
+#include "pbd/openuri.h"
 #include "evoral/Control.hpp"
 #include "evoral/ControlList.hpp"
 #include "evoral/Range.hpp"
@@ -154,7 +155,7 @@ namespace Cairo {
 CLASSKEYS(Cairo::Context);
 CLASSKEYS(std::vector<double>);
 CLASSKEYS(std::list<ArdourMarker*>);
-CLASSKEYS(std::bitset<46ul>); // LuaSignal::LAST_SIGNAL
+CLASSKEYS(std::bitset<47ul>); // LuaSignal::LAST_SIGNAL
 CLASSKEYS(ArdourMarker*);
 CLASSKEYS(ARDOUR::RouteGroup);
 CLASSKEYS(ARDOUR::LuaProc);
@@ -245,6 +246,10 @@ LuaBindings::common (lua_State* L)
 {
        luabridge::getGlobalNamespace (L)
                .beginNamespace ("PBD")
+
+               .addFunction ("open_uri", (bool (*) (const std::string&))&PBD::open_uri)
+               .addFunction ("open_uri", &PBD::open_folder)
+
                .beginClass <PBD::ID> ("ID")
                .addConstructor <void (*) (std::string)> ()
                .addFunction ("to_s", &PBD::ID::to_s) // TODO special case LUA __tostring ?
@@ -486,6 +491,7 @@ LuaBindings::common (lua_State* L)
                .deriveClass <Location, PBD::StatefulDestructible> ("Location")
                .addFunction ("locked", &Location::locked)
                .addFunction ("lock", &Location::lock)
+               .addFunction ("unlock", &Location::unlock)
                .addFunction ("start", &Location::start)
                .addFunction ("_end", &Location::end) // XXX "end" is a lua reserved word
                .addFunction ("length", &Location::length)
@@ -493,9 +499,19 @@ LuaBindings::common (lua_State* L)
                .addFunction ("set_end", &Location::set_end)
                .addFunction ("set_length", &Location::set)
                .addFunction ("move_to", &Location::move_to)
+               .addFunction ("matches", &Location::matches)
+               .addFunction ("flags", &Location::flags)
+               .addFunction ("is_auto_punch", &Location::is_auto_punch)
+               .addFunction ("is_auto_loop", &Location::is_auto_loop)
+               .addFunction ("is_mark", &Location::is_mark)
+               .addFunction ("is_hidden", &Location::is_hidden)
+               .addFunction ("is_cd_marker", &Location::is_cd_marker)
+               .addFunction ("is_session_range", &Location::is_session_range)
+               .addFunction ("is_range_marker", &Location::is_range_marker)
                .endClass ()
 
                .deriveClass <Locations, PBD::StatefulDestructible> ("Locations")
+               .addFunction ("list", static_cast<Locations::LocationList (Locations::*)()>(&Locations::list))
                .addFunction ("auto_loop_location", &Locations::auto_loop_location)
                .addFunction ("auto_punch_location", &Locations::auto_punch_location)
                .addFunction ("session_range_location", &Locations::session_range_location)