void zoom_to_region (bool both_axes);
void temporal_zoom_session ();
void temporal_zoom (gdouble scale);
- void temporal_zoom_by_frame (framepos_t start, framepos_t end, const std::string & op);
+ void temporal_zoom_by_frame (framepos_t start, framepos_t end);
void temporal_zoom_to_frame (bool coarser, framepos_t frame);
void insert_region_list_drag (boost::shared_ptr<ARDOUR::Region>, int x, int y);
void marker_menu_set_from_playhead ();
void marker_menu_set_from_selection ();
void marker_menu_range_to_next ();
+ void marker_menu_zoom_to_range ();
void new_transport_marker_menu_set_loop ();
void new_transport_marker_menu_set_punch ();
void update_loop_range_view (bool visibility=false);
motion (event, false);
if (grab_frame() < last_pointer_frame()) {
- _editor->temporal_zoom_by_frame (grab_frame(), last_pointer_frame(), "mouse zoom");
+ _editor->temporal_zoom_by_frame (grab_frame(), last_pointer_frame());
} else {
- _editor->temporal_zoom_by_frame (last_pointer_frame(), grab_frame(), "mouse zoom");
+ _editor->temporal_zoom_by_frame (last_pointer_frame(), grab_frame());
}
} else {
if (Keyboard::the_keyboard().key_is_down (GDK_Shift_L)) {
items.push_back (MenuElem (_("Set Range from Range Selection"), sigc::mem_fun(*this, &Editor::marker_menu_set_from_selection)));
}
+ items.push_back (MenuElem (_("Zoom to Range"), sigc::mem_fun (*this, &Editor::marker_menu_zoom_to_range)));
+
items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Export Range..."), sigc::mem_fun(*this, &Editor::export_range)));
items.push_back (SeparatorElem());
}
}
+/** Temporal zoom to the range of the marker_menu_item (plus 5% either side) */
+void
+Editor::marker_menu_zoom_to_range ()
+{
+ Marker* marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"));
+ assert (marker);
+
+ bool is_start;
+ Location* l = find_location_from_marker (marker, is_start);
+ if (l == 0) {
+ return;
+ }
+
+ framecnt_t const extra = l->length() * 0.05;
+ framepos_t a = l->start ();
+ if (a >= extra) {
+ a -= extra;
+ }
+
+ framepos_t b = l->end ();
+ if (b < (max_framepos - extra)) {
+ b += extra;
+ }
+
+ temporal_zoom_by_frame (a, b);
+}
+
void
Editor::dynamic_cast_marker_object (void* p, MeterMarker** m, TempoMarker** t) const
{
PBD::Unwinder<bool> nsv (no_save_visual, true);
- temporal_zoom_by_frame (start, end, "zoom to region");
+ temporal_zoom_by_frame (start, end);
if (both_axes) {
uint32_t per_track_height = (uint32_t) floor ((_canvas_height - canvas_timebars_vsize - 10.0) / tracks.size());
framepos_t start = selection->time[clicked_selection].start;
framepos_t end = selection->time[clicked_selection].end;
- temporal_zoom_by_frame (start, end, "zoom to selection");
+ temporal_zoom_by_frame (start, end);
}
void
s = 0;
}
framecnt_t const e = _session->current_end_frame() + l * 0.01;
- temporal_zoom_by_frame (framecnt_t (s), e, "zoom to _session");
+ temporal_zoom_by_frame (framecnt_t (s), e);
}
}
void
-Editor::temporal_zoom_by_frame (framepos_t start, framepos_t end, const string & /*op*/)
+Editor::temporal_zoom_by_frame (framepos_t start, framepos_t end)
{
if (!_session) return;