diff --git a/libs/ardour/ardour/location.h b/libs/ardour/ardour/location.h index d31277ee71..f55f931731 100644 --- a/libs/ardour/ardour/location.h +++ b/libs/ardour/ardour/location.h @@ -23,6 +23,7 @@ #include #include #include +#include #include @@ -69,6 +70,7 @@ public: void lock (); void unlock (); + time_t timestamp() { return _timestamp; }; samplepos_t start() const { return _start; } samplepos_t end() const { return _end; } samplecnt_t length() const { return _end - _start; } @@ -160,6 +162,7 @@ private: bool _locked; PositionLockStyle _position_lock_style; boost::shared_ptr _scene_change; + time_t _timestamp; void set_mark (bool yn); bool set_flag_internal (bool yn, Flags flag); diff --git a/libs/ardour/location.cc b/libs/ardour/location.cc index 24774c5fec..1b4b5a87c1 100644 --- a/libs/ardour/location.cc +++ b/libs/ardour/location.cc @@ -65,6 +65,7 @@ Location::Location (Session& s) , _flags (Flags (0)) , _locked (false) , _position_lock_style (AudioTime) + , _timestamp(time(0)) { assert (_start >= 0); assert (_end >= 0); @@ -79,7 +80,7 @@ Location::Location (Session& s, samplepos_t sample_start, samplepos_t sample_end , _flags (bits) , _locked (false) , _position_lock_style (s.config.get_glue_new_markers_to_bars_and_beats() ? MusicTime : AudioTime) - + , _timestamp(time(0)) { recompute_beat_from_samples (sub_num); @@ -97,7 +98,7 @@ Location::Location (const Location& other) , _end_beat (other._end_beat) , _flags (other._flags) , _position_lock_style (other._position_lock_style) - + , _timestamp(time(0)) { /* copy is not locked even if original was */ @@ -113,6 +114,7 @@ Location::Location (Session& s, const XMLNode& node) : SessionHandleRef (s) , _flags (Flags (0)) , _position_lock_style (AudioTime) + , _timestamp(time(0)) { /* Note: _position_lock_style is initialised above in case set_state doesn't set it (for 2.X session file compatibility). @@ -599,7 +601,7 @@ Location::get_state () node->set_property ("flags", _flags); node->set_property ("locked", _locked); node->set_property ("position-lock-style", _position_lock_style); - + node->set_property ("timestamp", _timestamp); if (_scene_change) { node->add_child_nocopy (_scene_change->get_state()); } @@ -648,6 +650,8 @@ Location::set_state (const XMLNode& node, int version) return -1; } + node.get_property ("timestamp", _timestamp); + Flags old_flags (_flags); if (!node.get_property ("flags", _flags)) {