Don't scroll-jump when selecting all tracks

This commit is contained in:
Robin Gareus 2017-02-18 01:25:13 +01:00
parent 85e3d2158e
commit c8d6ddfd10
5 changed files with 15 additions and 2 deletions

View file

@ -393,6 +393,7 @@ Editor::Editor ()
, _all_region_actions_sensitized (false) , _all_region_actions_sensitized (false)
, _ignore_region_action (false) , _ignore_region_action (false)
, _last_region_menu_was_main (false) , _last_region_menu_was_main (false)
, _track_selection_change_without_scroll (false)
, cd_marker_bar_drag_rect (0) , cd_marker_bar_drag_rect (0)
, range_bar_drag_rect (0) , range_bar_drag_rect (0)
, transport_bar_drag_rect (0) , transport_bar_drag_rect (0)

View file

@ -1606,6 +1606,10 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void queue_visual_videotimeline_update (); void queue_visual_videotimeline_update ();
void embed_audio_from_video (std::string, framepos_t n = 0, bool lock_position_to_video = true); void embed_audio_from_video (std::string, framepos_t n = 0, bool lock_position_to_video = true);
bool track_selection_change_without_scroll () const {
return _track_selection_change_without_scroll;
}
PBD::Signal0<void> EditorFreeze; PBD::Signal0<void> EditorFreeze;
PBD::Signal0<void> EditorThaw; PBD::Signal0<void> EditorThaw;
@ -1856,6 +1860,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void point_selection_changed (); void point_selection_changed ();
void marker_selection_changed (); void marker_selection_changed ();
bool _track_selection_change_without_scroll;
void cancel_selection (); void cancel_selection ();
void cancel_time_selection (); void cancel_time_selection ();

View file

@ -21,6 +21,7 @@
#include <cstdlib> #include <cstdlib>
#include "pbd/stacktrace.h" #include "pbd/stacktrace.h"
#include "pbd/unwind.h"
#include "ardour/midi_region.h" #include "ardour/midi_region.h"
#include "ardour/playlist.h" #include "ardour/playlist.h"
@ -174,6 +175,7 @@ Editor::select_all_tracks ()
visible_views.push_back (*i); visible_views.push_back (*i);
} }
} }
PBD::Unwinder<bool> uw (_track_selection_change_without_scroll, true);
selection->set (visible_views); selection->set (visible_views);
} }
@ -966,7 +968,9 @@ Editor::track_selection_changed ()
* selected, because we always append to that list. * selected, because we always append to that list.
*/ */
set_selected_mixer_strip (*(selection->tracks.back())); set_selected_mixer_strip (*(selection->tracks.back()));
if (!_track_selection_change_without_scroll) {
ensure_time_axis_view_is_visible (*(selection->tracks.back()), false); ensure_time_axis_view_is_visible (*(selection->tracks.back()), false);
}
break; break;
} }

View file

@ -857,7 +857,7 @@ Mixer_UI::sync_treeview_from_presentation_info (PropertyChange const & what_chan
} }
} }
if (!_selection.axes.empty()) { if (!_selection.axes.empty() && !PublicEditor::instance().track_selection_change_without_scroll ()) {
move_stripable_into_view ((*_selection.axes.begin())->stripable()); move_stripable_into_view ((*_selection.axes.begin())->stripable());
} }
} }

View file

@ -343,6 +343,8 @@ class PublicEditor : public Gtkmm2ext::Tabbable {
virtual void set_video_timeline_height (const int h) = 0; virtual void set_video_timeline_height (const int h) = 0;
virtual void embed_audio_from_video (std::string, framepos_t n = 0, bool lock_position_to_video = true) = 0; virtual void embed_audio_from_video (std::string, framepos_t n = 0, bool lock_position_to_video = true) = 0;
virtual bool track_selection_change_without_scroll () const = 0;
virtual RouteTimeAxisView* get_route_view_by_route_id (const PBD::ID& id) const = 0; virtual RouteTimeAxisView* get_route_view_by_route_id (const PBD::ID& id) const = 0;
virtual void get_equivalent_regions (RegionView* rv, std::vector<RegionView*>&, PBD::PropertyID) const = 0; virtual void get_equivalent_regions (RegionView* rv, std::vector<RegionView*>&, PBD::PropertyID) const = 0;