Make the behaviour zoom to region more intuitive (IMHO); ie always zoom to the select...
authorCarl Hetherington <carl@carlh.net>
Tue, 20 Oct 2009 18:20:38 +0000 (18:20 +0000)
committerCarl Hetherington <carl@carlh.net>
Tue, 20 Oct 2009 18:20:38 +0000 (18:20 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@5823 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/editor.cc
gtk2_ardour/editor.h
gtk2_ardour/editor_actions.cc
gtk2_ardour/editor_ops.cc
gtk2_ardour/editor_selection.cc

index b6da4b0bbfe22c840cf91bf261a958f1189c3a80..05bae8a9e575b03a8c296ace2b43649fe9f8658d 100644 (file)
@@ -338,7 +338,6 @@ Editor::Editor ()
        _dragging_edit_point = false;
        _dragging_hscrollbar = false;
        select_new_marker = false;
-       zoomed_to_region = false;
        rhythm_ferret = 0;
        _bundle_manager = 0;
        for (ARDOUR::DataType::iterator i = ARDOUR::DataType::begin(); i != ARDOUR::DataType::end(); ++i) {
@@ -4182,7 +4181,6 @@ Editor::current_visual_state (bool with_tracks)
        vs->frames_per_unit = frames_per_unit;
        vs->leftmost_frame = leftmost_frame;
        vs->zoom_focus = zoom_focus;
-       vs->zoomed_to_region = zoomed_to_region;
 
        if (with_tracks) {
                for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
@@ -4240,7 +4238,6 @@ Editor::use_visual_state (VisualState& vs)
 
        set_zoom_focus (vs.zoom_focus);
        reposition_and_zoom (vs.leftmost_frame, vs.frames_per_unit);
-       zoomed_to_region = vs.zoomed_to_region;
 
        for (list<TAVState>::iterator i = vs.track_states.begin(); i != vs.track_states.end(); ++i) {
                TrackViewList::iterator t;
index 34d402c049717f78edf52ea718b0283b9cd4398f..c4f2d9f8875d82d42bd83134a528318d72c2dad6 100644 (file)
@@ -448,7 +448,6 @@ class Editor : public PublicEditor
            double              frames_per_unit;
            nframes64_t         leftmost_frame;
            Editing::ZoomFocus  zoom_focus;
-           bool                zoomed_to_region;
            std::list<TAVState> track_states;
        };
 
@@ -1127,8 +1126,7 @@ class Editor : public PublicEditor
 
        void temporal_zoom_selection ();
        void temporal_zoom_region (bool both_axes);
-       void toggle_zoom_region (bool both_axes);
-       bool zoomed_to_region;
+       void zoom_to_region (bool both_axes);
        void temporal_zoom_session ();
        void temporal_zoom (gdouble scale);
        void temporal_zoom_by_frame (nframes64_t start, nframes64_t end, const std::string & op);
index 937743d62b0c433b96b6ff60f9f1da79c514f348..b750dd46f7ca7a8c7068a48167075b6bd131717b 100644 (file)
@@ -310,9 +310,9 @@ Editor::register_actions ()
        ActionManager::session_sensitive_actions.push_back (act);
        act = ActionManager::register_action (editor_actions, "zoom-to-session", _("Zoom to Session"), mem_fun(*this, &Editor::temporal_zoom_session));
        ActionManager::session_sensitive_actions.push_back (act);
-       act = ActionManager::register_action (editor_actions, "zoom-to-region", _("Zoom to Region"), bind (mem_fun(*this, &Editor::toggle_zoom_region), false));
+       act = ActionManager::register_action (editor_actions, "zoom-to-region", _("Zoom to Region"), bind (mem_fun(*this, &Editor::zoom_to_region), false));
        ActionManager::session_sensitive_actions.push_back (act);
-       act = ActionManager::register_action (editor_actions, "zoom-to-region-both-axes", _("Zoom to Region (W&H)"), bind (mem_fun(*this, &Editor::toggle_zoom_region), true));
+       act = ActionManager::register_action (editor_actions, "zoom-to-region-both-axes", _("Zoom to Region (W&H)"), bind (mem_fun(*this, &Editor::zoom_to_region), true));
        ActionManager::session_sensitive_actions.push_back (act);
        act = ActionManager::register_action (editor_actions, "toggle-zoom", _("Toggle Zoom State"), mem_fun(*this, &Editor::swap_visual_state));
        ActionManager::session_sensitive_actions.push_back (act);
index 0e1c4d12e4069677f3a4397ab1334e156c29626f..a727e1610aef5c0d043452701afb2e15b7769cdf 100644 (file)
@@ -1766,18 +1766,13 @@ Editor::temporal_zoom_region (bool both_axes)
                no_save_visual = false;
        }
 
-       zoomed_to_region = true;
        redo_visual_stack.push_back (current_visual_state());
 }
 
 void
-Editor::toggle_zoom_region (bool both_axes)
+Editor::zoom_to_region (bool both_axes)
 {
-       if (zoomed_to_region) {
-               swap_visual_state ();
-       } else {
-               temporal_zoom_region (both_axes);
-       }
+       temporal_zoom_region (both_axes);
 }
 
 void
index b77d1b4935d78bece208589feb7a5422a07ec901..3894a96d520f41df4773e9ac496255708e02f947 100644 (file)
@@ -893,8 +893,6 @@ Editor::region_selection_changed ()
 
        sensitize_the_right_region_actions (!selection->regions.empty());
 
-       zoomed_to_region = false;
-
        _regions->block_change_connection (false);
        editor_regions_selection_changed_connection.block(false);
 }