}
initial_ruler_update_required = false;
-
track_canvas_size_allocated ();
}
reset_hscrollbar_stepping ();
reset_scrolling_region ();
- guint track_canvas_width,track_canvas_height;
- track_canvas.get_size(track_canvas_width,track_canvas_height);
+ if (playhead_cursor) playhead_cursor->set_length (canvas_height);
- if (playhead_cursor) playhead_cursor->set_length (track_canvas_height);
+ double y1 = vertical_adjustment.get_value ();
for (MarkerSelection::iterator x = selection->markers.begin(); x != selection->markers.end(); ++x) {
- (*x)->set_line_length (track_canvas_height);
+ (*x)->set_line_vpos (y1, canvas_height);
}
- range_marker_drag_rect->property_y2() = track_canvas_height;
- transport_loop_range_rect->property_y2() = track_canvas_height;
- transport_punch_range_rect->property_y2() = track_canvas_height;
- transport_punchin_line->property_y2() = track_canvas_height;
- transport_punchout_line->property_y2() = track_canvas_height;
+ range_marker_drag_rect->property_y1() = y1;
+ range_marker_drag_rect->property_y2() = full_canvas_height;
+ transport_loop_range_rect->property_y1() = y1;
+ transport_loop_range_rect->property_y2() = full_canvas_height;
+ transport_punch_range_rect->property_y1() = y1;
+ transport_punch_range_rect->property_y2() = full_canvas_height;
+ transport_punchin_line->property_y1() = y1;
+ transport_punchin_line->property_y2() = full_canvas_height;
+ transport_punchout_line->property_y1() = y1;
+ transport_punchout_line->property_y2() = full_canvas_height;
update_fixed_rulers();
redisplay_tempo (true);
- if (logo_item) {
- // logo_item->property_height() = canvas_height;
- // logo_item->property_width() = canvas_width;
- }
-
Resized (); /* EMIT_SIGNAL */
return false;
}
}
- double last_canvas_unit = last_canvas_frame / frames_per_unit;
+ double last_canvas_unit = max ((last_canvas_frame / frames_per_unit), canvas_width);
- track_canvas.set_scroll_region (0.0, 0.0, max (last_canvas_unit, canvas_width), pos);
+ track_canvas.set_scroll_region (0.0, 0.0, last_canvas_unit, pos);
// XXX what is the correct height value for the time canvas ? this overstates it
- time_canvas.set_scroll_region ( 0.0, 0.0, max (last_canvas_unit, canvas_width), canvas_height);
-
- guint track_canvas_width,track_canvas_height;
- track_canvas.get_size(track_canvas_width,track_canvas_height);
- range_marker_drag_rect->property_y2() = track_canvas_height;
- transport_loop_range_rect->property_y2() = track_canvas_height;
- transport_punch_range_rect->property_y2() = track_canvas_height;
- transport_punchin_line->property_y2() = track_canvas_height;
- transport_punchout_line->property_y2() = track_canvas_height;
+ time_canvas.set_scroll_region ( 0.0, 0.0, last_canvas_unit, canvas_height);
+
+ range_marker_drag_rect->property_y2() = canvas_height;
+ transport_loop_range_rect->property_y2() = canvas_height;
+ transport_punch_range_rect->property_y2() = canvas_height;
+ transport_punchin_line->property_y2() = canvas_height;
+ transport_punchout_line->property_y2() = canvas_height;
- update_punch_range_view(true);
+ update_punch_range_view (true);
controls_layout.queue_resize();
}
TreeModel::Children::iterator i;
double pos;
- for (pos = 0, i = rows.begin(); i != rows.end(); ++i) {
- TimeAxisView *tv = (*i)[route_display_columns.tv];
+ for (pos = 0, i = rows.begin(); i != rows.end(); ++i) {
+ TimeAxisView *tv = (*i)[route_display_columns.tv];
if (tv != 0) {
pos += tv->effective_height;
}
screen = Gdk::Screen::get_default();
}
- /* never let the width of the controls area shrink horizontally */
-
edit_controls_vbox.check_resize();
-
req->width = max (edit_controls_vbox.get_width(), controls_layout.get_width());
-
+
/* don't get too big. the fudge factors here are just guesses */
req->width = min (req->width, screen->get_width() - 300);
/* this one is important: it determines how big the layout thinks it really is, as
opposed to what it displays on the screen
*/
+
+ controls_layout.set_size (edit_controls_vbox.get_width(), (gint) pos);
+ controls_layout.set_size_request(edit_controls_vbox.get_width(), -1);
+ zoom_box.set_size_request(edit_controls_vbox.get_width(), -1);
+ time_button_frame.set_size_request(edit_controls_vbox.get_width() + edit_vscrollbar.get_width(), -1);
- controls_layout.set_size (req->width, (gint) pos);
+ //cerr << "sizes = " << req->width << " " << edit_controls_vbox.get_width() << " " << controls_layout.get_width() << " " << zoom_box.get_width() << " " << time_button_frame.get_width() << endl;//DEBUG
}
bool
const SelectionData& data,
guint info, guint time)
{
+ cerr << "drop on canvas, target = " << data.get_target() << endl;
+
if (data.get_target() == "regions") {
drop_regions (context, x, y, data, info, time);
} else {
return FALSE;
}
+void
+Editor::tie_vertical_scrolling ()
+{
+ double y1 = vertical_adjustment.get_value();
+
+ playhead_cursor->set_y_axis (y1);
+
+ range_marker_drag_rect->property_y1() = y1;
+ range_marker_drag_rect->property_y2() = full_canvas_height;
+ transport_loop_range_rect->property_y1() = y1;
+ transport_loop_range_rect->property_y2() = full_canvas_height;
+ transport_punch_range_rect->property_y1() = y1;
+ transport_punch_range_rect->property_y2() = full_canvas_height;
+ transport_punchin_line->property_y1() = y1;
+ transport_punchin_line->property_y2() = full_canvas_height;
+ transport_punchout_line->property_y1() = y1;
+ transport_punchout_line->property_y2() = full_canvas_height;
+
+ if (!selection->markers.empty()) {
+ for (MarkerSelection::iterator x = selection->markers.begin(); x != selection->markers.end(); ++x) {
+ (*x)->set_line_vpos (y1, canvas_height);
+ }
+ }
+
+ if (logo_item) {
+ logo_item->property_y() = y1;
+ }
+
+ /* this will do an immediate redraw */
+
+ controls_layout.get_vadjustment()->set_value (y1);
+}
void
Editor::canvas_horizontally_scrolled ()
{
- /* this is the core function that controls horizontal scrolling of the canvas. it is called
- whenever the horizontal_adjustment emits its "value_changed" signal. it typically executes in an
- idle handler, which is important because tempo_map_changed() should issue redraws immediately
- and not defer them to an idle handler.
- */
+ nframes64_t time_origin = (nframes_t) floor (horizontal_adjustment.get_value() * frames_per_unit);
+
+ if (time_origin != leftmost_frame) {
+ canvas_scroll_to (time_origin);
+ }
+}
- leftmost_frame = (nframes_t) floor (horizontal_adjustment.get_value() * frames_per_unit);
+void
+Editor::canvas_scroll_to (nframes64_t time_origin)
+{
+ leftmost_frame = time_origin;
nframes_t rightmost_frame = leftmost_frame + current_page_frames ();
-
+
if (rightmost_frame > last_canvas_frame) {
last_canvas_frame = rightmost_frame;
reset_scrolling_region ();