void first_idle ();
virtual bool have_idled () const { return _have_idled; }
- framepos_t leftmost_position() const { return leftmost_frame; }
+ framepos_t leftmost_sample() const { return leftmost_frame; }
- framecnt_t current_page_frames() const {
- return (framecnt_t) floor (_visible_canvas_width * frames_per_pixel);
+ framecnt_t current_page_samples() const {
+ return (framecnt_t) floor (_visible_canvas_width * samples_per_pixel);
}
double visible_canvas_height () const {
void separate_regions_using_location (ARDOUR::Location&);
void transition_to_rolling (bool forward);
- /* undo related */
-
- framepos_t unit_to_frame (double unit) const {
- return (framepos_t) rint (unit * frames_per_pixel);
- }
-
- double frame_to_unit (framepos_t frame) const {
- return rint ((double) frame / (double) frames_per_pixel);
- }
-
- double frame_to_unit_unrounded (framepos_t frame) const {
- return frame / frames_per_pixel;
- }
-
- double frame_to_unit (double frame) const {
- return rint (frame / frames_per_pixel);
- }
-
/* NOTE: these functions assume that the "pixel" coordinate is
- the result of using the world->canvas affine transform on a
- world coordinate. These coordinates already take into
- account any scrolling carried out by adjusting the
- xscroll_adjustment.
+ in canvas coordinates. These coordinates already take into
+ account any scrolling offsets.
*/
- framepos_t pixel_to_frame (double pixel) const {
+ framepos_t pixel_to_sample (double pixel) const {
/* pixel can be less than zero when motion events
are processed. since we've already run the world->canvas
*/
if (pixel >= 0) {
- return (framepos_t) rint (pixel * frames_per_pixel);
+ return (framepos_t) rint (pixel * samples_per_pixel);
} else {
return 0;
}
}
- gulong frame_to_pixel (framepos_t frame) const {
- return (gulong) rint (frame / frames_per_pixel);
+ double sample_to_pixel (framepos_t sample) const {
+ return rint (sample / samples_per_pixel);
}
- void flush_canvas ();
+ double sample_to_pixel_unrounded (framepos_t sample) const {
+ return sample / samples_per_pixel;
+ }
/* selection */
void set_zoom_focus (Editing::ZoomFocus);
Editing::ZoomFocus get_zoom_focus () const { return zoom_focus; }
- double get_current_zoom () const { return frames_per_pixel; }
+ double get_current_zoom () const { return samples_per_pixel; }
void cycle_zoom_focus ();
void temporal_zoom_step (bool coarser);
void tav_zoom_step (bool coarser);
VisualState (bool with_tracks);
~VisualState ();
double y_position;
- double frames_per_pixel;
+ double samples_per_pixel;
framepos_t leftmost_frame;
Editing::ZoomFocus zoom_focus;
GUIObjectState* gui_state;
void cancel_visual_state_op (uint32_t n);
framepos_t leftmost_frame;
- double frames_per_pixel;
+ double samples_per_pixel;
Editing::ZoomFocus zoom_focus;
- void set_frames_per_pixel (double);
- bool clamp_frames_per_pixel (double &) const;
+ void set_samples_per_pixel (double);
+ bool clamp_samples_per_pixel (double &) const;
Editing::MouseMode mouse_mode;
Editing::MouseMode pre_internal_mouse_mode;
ArdourCanvas::GtkCanvas* _track_canvas;
ArdourCanvas::GtkCanvasViewport* _track_canvas_viewport;
- Gtk::Adjustment* _track_canvas_hadj;
- Gtk::Adjustment* _track_canvas_vadj;
ArdourCanvas::GtkCanvas* _time_bars_canvas;
ArdourCanvas::GtkCanvasViewport* _time_bars_canvas_viewport;
- Gtk::Adjustment* _time_bars_canvas_hadj;
Gtk::Adjustment* _time_bars_canvas_vadj;
bool within_track_canvas;
bool track_canvas_motion (GdkEvent*);
Gtk::EventBox time_canvas_event_box;
- Gtk::EventBox track_canvas_event_box;
Gtk::EventBox time_bars_event_box;
Gtk::EventBox ruler_label_event_box;
ruler_time_range_marker = 7,
ruler_time_transport_marker = 8,
ruler_time_cd_marker = 9,
-#ifdef WITH_VIDEOTIMELINE
ruler_video_timeline = 10,
-#endif
};
static GtkCustomMetric ruler_metrics[4];
Gtk::Label transport_mark_label;
Gtk::Label cd_mark_label;
-#ifdef WITH_VIDEOTIMELINE
- ArdourCanvas::Rectangle* videotl_bar;
+ /* videtimline related actions */
+ ArdourCanvas::Rectangle* videotl_bar;
Gtk::Label videotl_label;
ArdourCanvas::Group* videotl_bar_group;
ArdourCanvas::Group* videotl_group;
int get_videotl_bar_height () const { return videotl_bar_height; }
void export_video ();
void toggle_region_video_lock ();
-#endif
Gtk::VBox time_bars_vbox;
/** the adjustment that controls the overall editor vertical scroll position */
Gtk::Adjustment vertical_adjustment;
+ Gtk::Adjustment horizontal_adjustment;
+ Gtk::Adjustment unused_adjustment; // yes, really; Gtk::Layout constructor requires refs
Gtk::Layout controls_layout;
bool control_layout_scroll (GdkEventScroll* ev);
void reset_controls_layout_width ();
Type pending;
framepos_t time_origin;
- double frames_per_pixel;
+ double samples_per_pixel;
double y_origin;
int idle_handler_id;
/** true if we are currently in the idle handler */
bool being_handled;
- VisualChange() : pending ((VisualChange::Type) 0), time_origin (0), frames_per_pixel (0), idle_handler_id (-1), being_handled (false) {}
+ VisualChange() : pending ((VisualChange::Type) 0), time_origin (0), samples_per_pixel (0), idle_handler_id (-1), being_handled (false) {}
void add (Type t) {
pending = Type (pending | t);
}
bool canvas_range_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
bool canvas_transport_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
bool canvas_cd_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
-#ifdef WITH_VIDEOTIMELINE
+
bool canvas_videotl_bar_event (GdkEvent* event, ArdourCanvas::Item*);
void update_video_timeline (bool flush = false);
void set_video_timeline_height (const int);
void set_video_timeline_locked (const bool);
void queue_visual_videotimeline_update ();
void embed_audio_from_video (std::string, framepos_t n = 0);
-#endif
bool canvas_imageframe_item_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
bool canvas_imageframe_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameTimeAxis*);
void duplicate_range (bool with_dialog);
- framepos_t event_frame (GdkEvent const *, double* px = 0, double* py = 0) const;
+ /** computes the timeline frame (sample) of an event whose coordinates
+ * are in canvas units (pixels, scroll offset included).
+ */
+ framepos_t canvas_event_frame (GdkEvent const *, double* px = 0, double* py = 0) const;
+
+ /** computes the timeline frame (sample) of an event whose coordinates
+ * are in window units (pixels, no scroll offset).
+ */
+ framepos_t window_event_frame (GdkEvent const *, double* px = 0, double* py = 0) const;
/* returns false if mouse pointer is not in track or marker canvas
*/
void region_view_added (RegionView *);
void region_view_removed ();
- void update_canvas_now ();
-
EditorGroupTabs* _group_tabs;
void fit_route_group (ARDOUR::RouteGroup *);
friend class RegionCreateDrag;
friend class RegionMotionDrag;
friend class RegionInsertDrag;
-#ifdef WITH_VIDEOTIMELINE
friend class VideoTimeLineDrag;
-#endif
friend class EditorSummary;
friend class EditorGroupTabs;