cut buffer must not mess around with libardour selection
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 7 Jun 2017 16:14:44 +0000 (12:14 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 7 Jun 2017 16:28:53 +0000 (12:28 -0400)
Fixes range mode selection/cut/copy that would previously clear track selection

gtk2_ardour/editor.cc
gtk2_ardour/selection.cc
gtk2_ardour/selection.h

index b16bce984704ba2de44ce5b6abae3b5dbbcdbffa..2ba470853acb2e47a078dcaa9d645605cd2a13ae 100644 (file)
@@ -390,8 +390,8 @@ Editor::Editor ()
        , _visible_track_count (-1)
        ,  toolbar_selection_clock_table (2,3)
        ,  automation_mode_button (_("mode"))
-       , selection (new Selection (this))
-       , cut_buffer (new Selection (this))
+       , selection (new Selection (this, true))
+       , cut_buffer (new Selection (this, false))
        , _selection_memento (new SelectionMemento())
        , _all_region_actions_sensitized (false)
        , _ignore_region_action (false)
index 54dc7a664427b6258b405208b6be5f22b52bc790..7639d47dbc58b4b278d8b1009d3e51bfb28ae4dd 100644 (file)
@@ -57,10 +57,11 @@ struct AudioRangeComparator {
        }
 };
 
-Selection::Selection (const PublicEditor* e)
+Selection::Selection (const PublicEditor* e, bool mls)
        : tracks (e)
        , editor (e)
        , next_time_id (0)
+       , manage_libardour_selection (mls)
 {
        clear ();
 
@@ -1544,6 +1545,10 @@ Selection::set (const TrackViewList& track_list)
 void
 Selection::clear_tracks (bool)
 {
+       if (!manage_libardour_selection) {
+               return;
+       }
+
        Session* s = editor->session();
        if (s) {
                CoreSelection& selection (s->selection());
index 7e8ba19d7b34a3bd4ebcc90e3ca3222c748301fa..307a148c85be528871e29c1560aa8a98b2ba440c 100644 (file)
@@ -90,7 +90,7 @@ class Selection : public sigc::trackable, public PBD::ScopedConnectionList
        /** only used when this class is used as a cut buffer */
        MidiNoteSelection    midi_notes;
 
-       Selection (PublicEditor const * e);
+       Selection (PublicEditor const * e, bool manage_libardour_selection);
 
        // Selection& operator= (const Selection& other);
 
@@ -230,6 +230,7 @@ class Selection : public sigc::trackable, public PBD::ScopedConnectionList
   private:
        PublicEditor const * editor;
        uint32_t next_time_id;
+       bool     manage_libardour_selection;
 
        TrackViewList add_grouped_tracks (TrackViewList const & t);
 };