diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 5612ff3c0d..d4bd0ac566 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -261,6 +261,7 @@ public: bool cannot_save () const { return _state_of_the_state & CannotSave; } bool in_cleanup () const { return _state_of_the_state & InCleanup; } bool inital_connect_or_deletion_in_progress () const { return _state_of_the_state & (InitialConnecting | Deletion); } + bool have_external_connections_for_current_backend (bool tracks_only = true) const; bool unnamed() const; void end_unnamed_status () const; diff --git a/libs/ardour/disk_reader.cc b/libs/ardour/disk_reader.cc index 55374b5175..d812648759 100644 --- a/libs/ardour/disk_reader.cc +++ b/libs/ardour/disk_reader.cc @@ -1375,7 +1375,7 @@ DiskReader::playlist_ranges_moved (list const& movements, b return; } - /* move panner automation */ + /* move panner automation (route owned control) */ std::shared_ptr pannable = _track.pannable (); Evoral::ControlSet::Controls& c (pannable->controls ()); @@ -1395,6 +1395,18 @@ DiskReader::playlist_ranges_moved (list const& movements, b *alist.get (), &before, &alist->get_state ())); } } + + /* move mute automation (route owned control) */ + std::shared_ptr alist = _track.mute_control ()->alist (); + if (alist->size ()) { + XMLNode& before = alist->get_state (); + bool const things_moved = alist->move_ranges (movements); + if (things_moved) { + _session.add_command (new MementoCommand ( + *alist.get (), &before, &alist->get_state ())); + } + } + /* move processor automation */ _track.foreach_processor (boost::bind (&DiskReader::move_processor_automation, this, _1, movements)); } diff --git a/libs/ardour/luabindings.cc b/libs/ardour/luabindings.cc index 57605d6576..f10e97de01 100644 --- a/libs/ardour/luabindings.cc +++ b/libs/ardour/luabindings.cc @@ -3442,6 +3442,9 @@ LuaBindings::session (lua_State* L) .addFunction ("unknown_processors", &Session::unknown_processors) .addFunction ("export_track_state", &Session::export_track_state) .addFunction ("selection", &Session::selection) + .addFunction ("have_external_connections_for_current_backend", &Session::have_external_connections_for_current_backend) + .addFunction ("unnamed", &Session::unnamed) + .addFunction ("writable", &Session::writable) .addFunction ("new_route_from_template", &Session::new_route_from_template) // TODO session_add_audio_track session_add_midi_track session_add_mixed_track diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 71d6b9e8fa..d4ce806828 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -8413,6 +8413,31 @@ Session::foreach_route (void (Route::*method)()) } } +bool +Session::have_external_connections_for_current_backend (bool tracks_only) const +{ + std::shared_ptr rl = routes.reader(); + for (auto const& r : *rl) { + if (tracks_only && !std::dynamic_pointer_cast (r)) { + continue; + } + if (r->is_singleton ()) { + continue; + } + for (auto const& p : *r->input()->ports()) { + if (p->has_ext_connection ()) { + return true; + } + } + for (auto const& p : *r->output()->ports()) { + if (p->has_ext_connection ()) { + return true; + } + } + } + return false; +} + void Session::enable_virtual_soundcheck () {