13
0

add commentary on why PublicEditor::{_,}ensure_time_axis_view_is_visible() both exist

This commit is contained in:
Paul Davis 2014-06-27 10:48:04 -04:00
parent c2dcd7eacd
commit 242181dc10

View File

@ -271,8 +271,10 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible, publi
virtual framecnt_t current_page_samples() const = 0; virtual framecnt_t current_page_samples() const = 0;
virtual double visible_canvas_height () const = 0; virtual double visible_canvas_height () const = 0;
virtual void temporal_zoom_step (bool coarser) = 0; virtual void temporal_zoom_step (bool coarser) = 0;
virtual void ensure_time_axis_view_is_visible (const TimeAxisView& tav, bool at_top = false) { /* The virtual version, without a default argument, is protected below.
_ensure_time_axis_view_is_visible (tav, at_top); */
void ensure_time_axis_view_is_visible (TimeAxisView const & tav, bool at_top = false) {
_ensure_time_axis_view_is_visible (tav, at_top);
} }
virtual void override_visible_track_count () = 0; virtual void override_visible_track_count () = 0;
virtual void scroll_tracks_down_line () = 0; virtual void scroll_tracks_down_line () = 0;
@ -420,7 +422,12 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible, publi
PBD::Signal0<void> MouseModeChanged; PBD::Signal0<void> MouseModeChanged;
protected: protected:
virtual void _ensure_time_axis_view_is_visible (const TimeAxisView& tav, bool at_top) = 0; /* This _ variant of ensure_time_axis_view_is_visible exists because
C++ doesn't really like default values for virtual methods. So the
public version is non-virtual, with a default value; the virtual
(and protected) method here does not have a default value.
*/
virtual void _ensure_time_axis_view_is_visible (TimeAxisView const & tav, bool at_top) = 0;
}; };
#endif // __gtk_ardour_public_editor_h__ #endif // __gtk_ardour_public_editor_h__