once the user has explicitly set the session range end, playlist/range changes do...
authorPaul Davis <paul@linuxaudiosystems.com>
Tue, 12 Jul 2016 15:19:15 +0000 (11:19 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 12 Jul 2016 15:19:49 +0000 (11:19 -0400)
The user may drag the marker, edit in the Location UI, or use nudge, to set the end

libs/ardour/ardour/session.h
libs/ardour/session.cc
libs/ardour/session_state.cc

index 2f2b774c30c8c654185032c31c52c101e887bc52..696e97ca9d5ae063d1c785b1c345255a032be45e 100644 (file)
@@ -459,6 +459,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
        void set_auto_punch_location (Location *);
        void set_auto_loop_location (Location *);
        void set_session_extents (framepos_t start, framepos_t end);
+       void set_end_is_free (bool);
        int location_name(std::string& result, std::string base = std::string(""));
 
        pframes_t get_block_size()        const { return current_block_size; }
@@ -1175,6 +1176,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
        mutable gint            _record_status;
        framepos_t              _transport_frame;
        Location*               _session_range_location; ///< session range, or 0 if there is nothing in the session yet
+       bool                    _session_range_end_is_free;
        Slave*                  _slave;
        bool                    _silent;
 
index 043d72d1283bed0edb34d445094a579f4ce5d25f..9e9b530ce3bf0de1a19ea78f72d17d3f25090689 100644 (file)
@@ -178,6 +178,7 @@ Session::Session (AudioEngine &eng,
        , _record_status (Disabled)
        , _transport_frame (0)
        , _session_range_location (0)
+       , _session_range_end_is_free (true)
        , _slave (0)
        , _silent (false)
        , _transport_speed (0)
@@ -4389,12 +4390,18 @@ Session::maybe_update_session_range (framepos_t a, framepos_t b)
                        _session_range_location->set_start (a);
                }
 
-               if (b > _session_range_location->end()) {
+               if (_session_range_end_is_free && (b > _session_range_location->end())) {
                        _session_range_location->set_end (b);
                }
        }
 }
 
+void
+Session::set_end_is_free (bool yn)
+{
+       _session_range_end_is_free = yn;
+}
+
 void
 Session::playlist_ranges_moved (list<Evoral::RangeMove<framepos_t> > const & ranges)
 {
index 752c8d03c956a171f3dfebc8461a707afa5cd11f..1aafd7118b4464e68a012282ecae986206af019b 100644 (file)
@@ -1095,6 +1095,8 @@ Session::state (bool full_state)
                }
        }
 
+       node->add_property ("end-is-free", _session_range_end_is_free ? X_("yes") : X_("no"));
+
        /* save the ID counter */
 
        snprintf (buf, sizeof (buf), "%" PRIu64, ID::counter());
@@ -1358,6 +1360,10 @@ Session::set_state (const XMLNode& node, int version)
 
        setup_raid_path(_session_dir->root_path());
 
+       if ((prop = node.property (X_("end-is-free"))) != 0) {
+               _session_range_end_is_free = string_is_affirmative (prop->value());
+       }
+
        if ((prop = node.property (X_("id-counter"))) != 0) {
                uint64_t x;
                sscanf (prop->value().c_str(), "%" PRIu64, &x);