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
This commit is contained in:
Carl Hetherington 2009-10-20 18:20:38 +00:00
parent b488867f32
commit 2898c4fa70
5 changed files with 5 additions and 17 deletions

View 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;

View 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);

View 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);

View 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

View 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);
}