make route group master a real property.
[ardour.git] / libs / ardour / session.cc
index 6ef78eacb63231ddd755f1f04e3b4b88291e49c4..767971fe722414d1aa2ae8b339e23e52570ef127 100644 (file)
@@ -237,7 +237,7 @@ Session::Session (AudioEngine &eng,
        , pending_locate_flush (false)
        , pending_abort (false)
        , pending_auto_loop (false)
-       , _mempool ("Session", 1048576)
+       , _mempool ("Session", 2097152)
        , lua (lua_newstate (&PBD::ReallocPool::lalloc, &_mempool))
        , _n_lua_scripts (0)
        , _butler (new Butler (*this))
@@ -2938,17 +2938,18 @@ Session::ensure_route_presentation_info_gap (PresentationInfo::order_t first_new
        /* create a gap in the presentation info to accomodate @param how_many
         * new objects.
         */
-       boost::shared_ptr <RouteList> rd = routes.reader();
+       StripableList sl;
+       get_stripables (sl);
 
-       for (RouteList::iterator ri = rd->begin(); ri != rd->end(); ++ri) {
-               boost::shared_ptr<Route> rt (*ri);
+       for (StripableList::iterator si = sl.begin(); si != sl.end(); ++si) {
+               boost::shared_ptr<Stripable> s (*si);
 
-               if (rt->presentation_info().special()) {
+               if (s->is_monitor() || s->is_auditioner()) {
                        continue;
                }
 
-               if (rt->presentation_info().order () >= first_new_order) {
-                       rt->set_presentation_order (rt->presentation_info().order () + how_many);
+               if (s->presentation_info().order () >= first_new_order) {
+                       s->set_presentation_order (s->presentation_info().order () + how_many);
                }
        }
 }
@@ -4229,24 +4230,6 @@ Session::get_remote_nth_route (PresentationInfo::order_t n) const
        return boost::dynamic_pointer_cast<Route> (get_remote_nth_stripable (n, PresentationInfo::Route));
 }
 
-boost::shared_ptr<Stripable>
-Session::get_nth_stripable (PresentationInfo::order_t n) const
-{
-       StripableList sl;
-
-       get_stripables (sl);
-
-       for (StripableList::const_iterator s = sl.begin(); s != sl.end(); ++s) {
-               if ((*s)->presentation_info().order() == n) {
-                       return *s;
-               }
-       }
-
-       /* there is no nth stripable */
-
-       return boost::shared_ptr<Stripable>();
-}
-
 boost::shared_ptr<Stripable>
 Session::get_remote_nth_stripable (PresentationInfo::order_t n, PresentationInfo::Flag flags) const
 {
@@ -5186,6 +5169,7 @@ Session::try_run_lua (pframes_t nframes)
        Glib::Threads::Mutex::Lock tm (lua_lock, Glib::Threads::TRY_LOCK);
        if (tm.locked ()) {
                try { (*_lua_run)(nframes); } catch (luabridge::LuaException const& e) { }
+               lua.collect_garbage_step ();
        }
 }
 
@@ -5195,6 +5179,7 @@ Session::setup_lua ()
 #ifndef NDEBUG
        lua.Print.connect (&_lua_print);
 #endif
+       lua.tweak_rt_gc ();
        lua.do_command (
                        "function ArdourSession ()"
                        "  local self = { scripts = {}, instances = {} }"