, range_mark_label (_("Range Markers"))
, transport_mark_label (_("Loop/Punch Ranges"))
, cd_mark_label (_("CD Markers"))
-#ifdef WITH_VIDEOTIMELINE
, videotl_label (_("Video Timeline"))
-#endif
, edit_packer (4, 4, true)
/* the values here don't matter: layout widgets
cd_mark_label.hide();
cd_mark_label.set_no_show_all();
-#ifdef WITH_VIDEOTIMELINE
videotl_bar_height = 4;
videotl_label.set_name ("EditorRulerLabel");
videotl_label.set_size_request (-1, (int)timebar_height * videotl_bar_height);
videotl_label.set_padding (5,0);
videotl_label.hide();
videotl_label.set_no_show_all();
-#endif
range_mark_label.set_name ("EditorRulerLabel");
range_mark_label.set_size_request (-1, (int)timebar_height);
time_bars_event_box.set_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
time_bars_event_box.signal_button_release_event().connect (sigc::mem_fun(*this, &Editor::ruler_label_button_release));
- /* these enable us to have a dedicated window (for cursor setting, etc.)
- for the canvas areas.
- */
-
- track_canvas_event_box.add (*_track_canvas_viewport);
-
time_canvas_event_box.add (time_canvas_vbox);
time_canvas_event_box.set_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::POINTER_MOTION_MASK);
/* time bars canvas */
edit_packer.attach (*_time_bars_canvas_viewport, 2, 3, 1, 2, FILL, FILL, 0, 0);
/* track canvas */
- edit_packer.attach (track_canvas_event_box, 2, 3, 2, 3, FILL|EXPAND, FILL|EXPAND, 0, 0);
+ edit_packer.attach (*_track_canvas_viewport, 2, 3, 2, 3, FILL|EXPAND, FILL|EXPAND, 0, 0);
bottom_hbox.set_border_width (2);
bottom_hbox.set_spacing (3);
delete button_bindings;
delete _routes;
delete _route_groups;
+ delete _time_bars_canvas_viewport;
delete _track_canvas_viewport;
delete _drags;
}
return;
}
- double step = fraction * current_page_frames();
+ double step = fraction * current_page_samples();
/*
_control_scroll_target is an optional<T>
if ((fraction < 0.0f) && (*_control_scroll_target < (framepos_t) fabs(step))) {
*_control_scroll_target = 0;
} else if ((fraction > 0.0f) && (max_framepos - *_control_scroll_target < step)) {
- *_control_scroll_target = max_framepos - (current_page_frames()*2); // allow room for slop in where the PH is on the screen
+ *_control_scroll_target = max_framepos - (current_page_samples()*2); // allow room for slop in where the PH is on the screen
} else {
*_control_scroll_target += (framepos_t) floor (step);
}
playhead_cursor->set_position (*_control_scroll_target);
UpdateAllTransportClocks (*_control_scroll_target);
- if (*_control_scroll_target > (current_page_frames() / 2)) {
+ if (*_control_scroll_target > (current_page_samples() / 2)) {
/* try to center PH in window */
- reset_x_origin (*_control_scroll_target - (current_page_frames()/2));
+ reset_x_origin (*_control_scroll_target - (current_page_samples()/2));
} else {
reset_x_origin (0);
}
ARDOUR::TempoMap::BBTPointList::const_iterator current_bbt_points_begin;
ARDOUR::TempoMap::BBTPointList::const_iterator current_bbt_points_end;
- compute_current_bbt_points (leftmost_frame, leftmost_frame + current_page_frames(),
+ compute_current_bbt_points (leftmost_frame, leftmost_frame + current_page_samples(),
current_bbt_points_begin, current_bbt_points_end);
- compute_bbt_ruler_scale (leftmost_frame, leftmost_frame + current_page_frames(),
+ compute_bbt_ruler_scale (leftmost_frame, leftmost_frame + current_page_samples(),
current_bbt_points_begin, current_bbt_points_end);
update_tempo_based_rulers (current_bbt_points_begin, current_bbt_points_end);
break;
case SnapMagnetic:
if (presnap > start) {
- if (presnap > (start + unit_to_frame(snap_threshold))) {
+ if (presnap > (start + pixel_to_sample(snap_threshold))) {
start = presnap;
}
} else if (presnap < start) {
- if (presnap < (start - unit_to_frame(snap_threshold))) {
+ if (presnap < (start - pixel_to_sample(snap_threshold))) {
start = presnap;
}
}
instant_save ();
}
-#ifdef WITH_VIDEOTIMELINE
void
Editor::queue_visual_videotimeline_update ()
{
*/
ensure_visual_change_idle_handler ();
}
-#endif
void
Editor::ensure_visual_change_idle_handler ()
ARDOUR::TempoMap::BBTPointList::const_iterator current_bbt_points_begin;
ARDOUR::TempoMap::BBTPointList::const_iterator current_bbt_points_end;
- compute_current_bbt_points (pending_visual_change.time_origin, pending_visual_change.time_origin + current_page_frames(),
+ compute_current_bbt_points (pending_visual_change.time_origin, pending_visual_change.time_origin + current_page_samples(),
current_bbt_points_begin, current_bbt_points_end);
- compute_bbt_ruler_scale (pending_visual_change.time_origin, pending_visual_change.time_origin + current_page_frames(),
+ compute_bbt_ruler_scale (pending_visual_change.time_origin, pending_visual_change.time_origin + current_page_samples(),
current_bbt_points_begin, current_bbt_points_end);
update_tempo_based_rulers (current_bbt_points_begin, current_bbt_points_end);
}
-#ifdef WITH_VIDEOTIMELINE
if (p & VisualChange::ZoomLevel) {
update_video_timeline();
}
-#endif
if (p & VisualChange::TimeOrigin) {
set_horizontal_position (pending_visual_change.time_origin / frames_per_pixel);
update_fixed_rulers ();
redisplay_tempo (true);
}
-#ifdef WITH_VIDEOTIMELINE
+
if (!(p & VisualChange::ZoomLevel)) {
update_video_timeline();
}
-#endif
_summary->set_overlays_dirty ();
EditPoint ep = _edit_point;
if (from_context_menu && (ep == EditAtMouse)) {
- return event_frame (&context_click_event, 0, 0);
+ return window_event_frame (&context_click_event, 0, 0);
}
if (entered_marker) {
{
framepos_t const frame = playhead_cursor->current_frame ();
- if (frame < leftmost_frame || frame > leftmost_frame + current_page_frames()) {
+ if (frame < leftmost_frame || frame > leftmost_frame + current_page_samples()) {
if (_session->transport_speed() < 0) {
- if (frame > (current_page_frames() / 2)) {
- center_screen (frame-(current_page_frames()/2));
+ if (frame > (current_page_samples() / 2)) {
+ center_screen (frame-(current_page_samples()/2));
} else {
- center_screen (current_page_frames()/2);
+ center_screen (current_page_samples()/2);
}
} else {
/* moving left */
if (_session->transport_rolling()) {
/* rolling; end up with the playhead at the right of the page */
- l = frame - current_page_frames ();
+ l = frame - current_page_samples ();
} else {
/* not rolling: end up with the playhead 1/4 of the way along the page */
- l = frame - current_page_frames() / 4;
+ l = frame - current_page_samples() / 4;
}
} else {
/* moving right */
l = frame;
} else {
/* not rolling: end up with the playhead 3/4 of the way along the page */
- l = frame - 3 * current_page_frames() / 4;
+ l = frame - 3 * current_page_samples() / 4;
}
}
l = 0;
}
- center_screen_internal (l + (current_page_frames() / 2), current_page_frames ());
+ center_screen_internal (l + (current_page_samples() / 2), current_page_samples ());
}
}
}
*/
#if 0
// FIXME DO SOMETHING THAT WORKS HERE - this is 2.X code
- double target = ((double)frame - (double)current_page_frames()/2.0) / frames_per_pixel;
+ double target = ((double)frame - (double)current_page_samples()/2.0) / frames_per_pixel;
if (target <= 0.0) {
target = 0.0;
}
- if (fabs(target - current) < current_page_frames() / frames_per_pixel) {
+ if (fabs(target - current) < current_page_samples() / frames_per_pixel) {
target = (target * 0.15) + (current * 0.85);
} else {
/* relax */