Mark session as modified when stripable order chanes

Previously this was handled by the Editor/Mixer Treeviews,
centralizing it in Session makes more sense.
This commit is contained in:
Robin Gareus 2022-01-26 04:17:22 +01:00
parent 5b3eacd421
commit 729ff35faf
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
2 changed files with 12 additions and 5 deletions

View file

@ -355,7 +355,7 @@ public:
return _bundles.reader (); return _bundles.reader ();
} }
void notify_presentation_info_change (); void notify_presentation_info_change (PBD::PropertyChange const&);
template<class T> void foreach_route (T *obj, void (T::*func)(Route&), bool sort = true); template<class T> void foreach_route (T *obj, void (T::*func)(Route&), bool sort = true);
template<class T> void foreach_route (T *obj, void (T::*func)(boost::shared_ptr<Route>), bool sort = true); template<class T> void foreach_route (T *obj, void (T::*func)(boost::shared_ptr<Route>), bool sort = true);
@ -1906,6 +1906,7 @@ private:
bool _adding_routes_in_progress; bool _adding_routes_in_progress;
bool _reconnecting_routes_in_progress; bool _reconnecting_routes_in_progress;
bool _route_deletion_in_progress; bool _route_deletion_in_progress;
bool _route_reorder_in_progress;
void load_and_connect_instruments (RouteList&, void load_and_connect_instruments (RouteList&,
bool strict_io, bool strict_io,

View file

@ -281,6 +281,7 @@ Session::Session (AudioEngine &eng,
, _adding_routes_in_progress (false) , _adding_routes_in_progress (false)
, _reconnecting_routes_in_progress (false) , _reconnecting_routes_in_progress (false)
, _route_deletion_in_progress (false) , _route_deletion_in_progress (false)
, _route_reorder_in_progress (false)
, _track_number_decimals(1) , _track_number_decimals(1)
, default_fade_steepness (0) , default_fade_steepness (0)
, default_fade_msecs (0) , default_fade_msecs (0)
@ -468,7 +469,7 @@ Session::Session (AudioEngine &eng,
bool was_dirty = dirty(); bool was_dirty = dirty();
unset_dirty (); unset_dirty ();
PresentationInfo::Change.connect_same_thread (*this, boost::bind (&Session::notify_presentation_info_change, this)); PresentationInfo::Change.connect_same_thread (*this, boost::bind (&Session::notify_presentation_info_change, this, _1));
Config->ParameterChanged.connect_same_thread (*this, boost::bind (&Session::config_changed, this, _1, false)); Config->ParameterChanged.connect_same_thread (*this, boost::bind (&Session::config_changed, this, _1, false));
config.ParameterChanged.connect_same_thread (*this, boost::bind (&Session::config_changed, this, _1, true)); config.ParameterChanged.connect_same_thread (*this, boost::bind (&Session::config_changed, this, _1, true));
@ -6968,13 +6969,18 @@ Session::session_name_is_legal (const string& path)
} }
void void
Session::notify_presentation_info_change () Session::notify_presentation_info_change (PropertyChange const& what_changed)
{ {
if (deletion_in_progress()) { if (deletion_in_progress() || _route_reorder_in_progress) {
return; return;
} }
if (what_changed.contains (Properties::order)) {
PBD::Unwinder<bool> uw (_route_reorder_in_progress, true);
ensure_stripable_sort_order ();
reassign_track_numbers (); reassign_track_numbers ();
set_dirty ();
}
} }
void void