#include "editor_drag.h"
#include "editor_regions.h"
#include "editor_routes.h"
-#include "gtk-custom-hruler.h"
#include "gui_thread.h"
#include "insert_time_dialog.h"
#include "interthread_progress_window.h"
bool
Editor::scroll_down_one_track ()
{
- double vertical_pos = vertical_adjustment.get_value () + vertical_adjustment.get_page_size() - 1.0;
-
TrackViewList::reverse_iterator next = track_views.rend();
std::pair<TimeAxisView*,double> res;
continue;
}
- res = (*t)->covers_y_position (vertical_pos);
+ /* find the trackview at the bottom of the trackview group */
+ res = (*t)->covers_y_position (_visible_canvas_height);
if (res.first) {
break;
bool
Editor::scroll_up_one_track ()
{
- double vertical_pos = vertical_adjustment.get_value ();
+ // double vertical_pos = vertical_adjustment.get_value ();
TrackViewList::iterator prev = track_views.end();
std::pair<TimeAxisView*,double> res;
continue;
}
- res = (*t)->covers_y_position(vertical_pos);
+ /* find the trackview at the top of the trackview group */
+ res = (*t)->covers_y_position (0);
if (res.first) {
break;
clamped = true;
}
- if (max_framepos / fpp < 800) {
- fpp = max_framepos / 800;
+ framecnt_t sr;
+
+ if (_session) {
+ sr = _session->frame_rate ();
+ } else {
+ sr = 48000;
+ }
+
+ const framecnt_t three_days = 3 * 24 * 60 * 60 * sr;
+ const framecnt_t lots_of_pixels = 4000;
+
+ /* if the zoom level is greater than what you'd get trying to display 3
+ * days of audio on a really big screen, scale it down.
+ */
+
+ if (fpp * lots_of_pixels > three_days) {
+ fpp = three_days / _track_canvas->width();
clamped = true;
}
++visible_tracks;
}
- uint32_t h = (uint32_t) floor ((_visible_canvas_height - child_heights) / visible_tracks);
+ /* compute the per-track height from:
+
+ total canvas visible height -
+ height that will be taken by visible children of selected
+ tracks - height of the ruler/hscroll area
+ */
+ uint32_t h = (uint32_t) floor ((_visible_canvas_height - (child_heights + _trackview_group->canvas_origin().y)) / visible_tracks);
double first_y_pos = DBL_MAX;
if (h < TimeAxisView::preset_height (HeightSmall)) {
/* operate on all tracks, hide unselected ones that are in the middle of selected ones */
- bool prev_was_selected = false;
- bool is_selected = tracks.contains (all.front());
- bool next_is_selected;
+ bool within_selected = false;
for (TrackViewList::iterator t = all.begin(); t != all.end(); ++t) {
next = t;
++next;
-
- if (next != all.end()) {
- next_is_selected = tracks.contains (*next);
- } else {
- next_is_selected = false;
- }
-
+
if ((*t)->marked_for_display ()) {
- if (is_selected) {
+ if (tracks.contains (*t)) {
(*t)->set_height (h);
first_y_pos = std::min ((*t)->y_position (), first_y_pos);
- } else {
- if (prev_was_selected && next_is_selected) {
- hide_track_in_display (*t);
- }
+ within_selected = true;
+ } else if (within_selected) {
+ hide_track_in_display (*t);
}
}
-
- prev_was_selected = is_selected;
- is_selected = next_is_selected;
}
/*