From 1783305077a2a7be98203bb4ecf0edb66613daa5 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 28 Feb 2020 23:33:33 -0700 Subject: provide mechanism to report on destructive tracks presence in a session --- libs/ardour/ardour/session.h | 5 +++++ libs/ardour/session.cc | 13 +++++++++++++ libs/ardour/source.cc | 5 ++++- 3 files changed, 22 insertions(+), 1 deletion(-) (limited to 'libs') diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 954e428d2f..3ab11aee91 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -466,6 +466,9 @@ public: bool declick_in_progress () const; bool transport_locked () const; + bool had_destructive_tracks () const; + void set_had_destructive_tracks (bool yn); + int wipe (); samplepos_t current_end_sample () const; @@ -2134,6 +2137,8 @@ private: bool _global_locate_pending; boost::optional _nominal_jack_transport_sample; + + bool _had_destructive_tracks; }; diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 25fba565aa..767f3a424d 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -319,6 +319,7 @@ Session::Session (AudioEngine &eng, , _vca_manager (new VCAManager (*this)) , _selection (new CoreSelection (*this)) , _global_locate_pending (false) + , _had_destructive_tracks (false) { created_with = string_compose ("%1 %2", PROGRAM_NAME, revision); @@ -7005,3 +7006,15 @@ Session::maybe_update_tempo_from_midiclock_tempo (float bpm) } } } + +void +Session::set_had_destructive_tracks (bool yn) +{ + _had_destructive_tracks = yn; +} + +bool +Session::had_destructive_tracks() const +{ + return _had_destructive_tracks; +} diff --git a/libs/ardour/source.cc b/libs/ardour/source.cc index 2bbfe843ac..ebee48d2f0 100644 --- a/libs/ardour/source.cc +++ b/libs/ardour/source.cc @@ -169,6 +169,9 @@ Source::set_state (const XMLNode& node, int version) /* Destructive is no longer valid */ + if (_flags & Destructive) { + _session.set_had_destructive_tracks (true); + } _flags = Flag (_flags & ~Destructive); if (!node.get_property (X_("take-id"), _take_id)) { @@ -177,7 +180,7 @@ Source::set_state (const XMLNode& node, int version) /* old style, from the period when we had DestructiveFileSource */ if (node.get_property (X_("destructive"), str)) { - throw (SessionException (_("This session uses destructive tracks, which are no longer supported. Please use an older version of Ardour to work with this session"))); + _session.set_had_destructive_tracks (true); } if (version < 3000) { -- cgit v1.2.3