summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2009-10-20 18:20:38 +0000
committerCarl Hetherington <carl@carlh.net>2009-10-20 18:20:38 +0000
commit2898c4fa70805135a59739646fb476359e2e3fef (patch)
tree650653e7e854e3e0688c69d1ce5f29fdb5ed5540
parentb488867f32b1ae46a776a3e1c3c1c8eb3b4ce419 (diff)
Make the behaviour zoom to region more intuitive (IMHO); ie always zoom to the selected region. Not quite sure what the zoomed_to_region flag was intended to achieve. Fixes mantis 2154.
git-svn-id: svn://localhost/ardour2/branches/3.0@5823 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/editor.cc3
-rw-r--r--gtk2_ardour/editor.h4
-rw-r--r--gtk2_ardour/editor_actions.cc4
-rw-r--r--gtk2_ardour/editor_ops.cc9
-rw-r--r--gtk2_ardour/editor_selection.cc2
5 files changed, 5 insertions, 17 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index b6da4b0bbf..05bae8a9e5 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -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;
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index 34d402c049..c4f2d9f887 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -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);
diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc
index 937743d62b..b750dd46f7 100644
--- a/gtk2_ardour/editor_actions.cc
+++ b/gtk2_ardour/editor_actions.cc
@@ -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);
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index 0e1c4d12e4..a727e1610a 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -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
diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc
index b77d1b4935..3894a96d52 100644
--- a/gtk2_ardour/editor_selection.cc
+++ b/gtk2_ardour/editor_selection.cc
@@ -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);
}