X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fmini_timeline.h;h=21b316df396ff8b53bd26b2e4095d905f531e0dc;hb=c6e53e778593b900f49d17ac3eb2189f3739a208;hp=63f34f714e50be8c247aaafc8f276d7e5f4972ae;hpb=f80fb029e22a5bde240b523370b831fbe3e620d8;p=ardour.git diff --git a/gtk2_ardour/mini_timeline.h b/gtk2_ardour/mini_timeline.h index 63f34f714e..21b316df39 100644 --- a/gtk2_ardour/mini_timeline.h +++ b/gtk2_ardour/mini_timeline.h @@ -25,6 +25,7 @@ #include "pbd/signals.h" #include "ardour/ardour.h" +#include "ardour/types.h" #include "ardour/session_handle.h" #include "gtkmm2ext/cairo_widget.h" @@ -36,6 +37,10 @@ namespace ARDOUR { class Session; } +namespace Gtk { + class Menu; +} + class MiniTimeline : public CairoWidget, public ARDOUR::SessionHandlePtr, public PBD::ScopedConnectionList { @@ -50,38 +55,59 @@ private: void super_rapid_update (); void on_size_request (Gtk::Requisition*); + void on_size_allocate (Gtk::Allocation&); void on_style_changed (const Glib::RefPtr&); void on_name_changed (); void set_colors (); void parameter_changed (std::string const &); void calculate_time_width (); + void calculate_time_spacing (); void update_minitimeline (); - void draw_dots (cairo_t*, int left, int right, int y); - int draw_mark (cairo_t*, int x0, int x1, int h, const std::string&); + void draw_dots (cairo_t*, int left, int right, int y, Gtkmm2ext::Color); + int draw_mark (cairo_t*, int x0, int x1, const std::string&, bool& prelight); + int draw_edge (cairo_t*, int x0, int x1, bool left, const std::string&, bool& prelight); - void render (cairo_t*, cairo_rectangle_t*); - void format_time (framepos_t when); + void render (Cairo::RefPtr const&, cairo_rectangle_t*); + void format_time (samplepos_t when); - bool on_button_release_event (GdkEventButton *ev); + bool on_button_press_event (GdkEventButton*); + bool on_button_release_event (GdkEventButton*); bool on_scroll_event (GdkEventScroll*); + bool on_motion_notify_event (GdkEventMotion*); + bool on_leave_notify_event (GdkEventCrossing*); + + void build_minitl_context_menu (); + void set_span (ARDOUR::samplecnt_t); Glib::RefPtr _layout; sigc::connection super_rapid_connection; PBD::ScopedConnectionList marker_connection; - PBD::ScopedConnection session_connection; + PBD::ScopedConnectionList session_connection; - framepos_t _last_update_frame; + samplepos_t _last_update_sample; AudioClock::Mode _clock_mode; int _time_width; int _time_height; + int _n_labels; + double _px_per_sample; + ARDOUR::samplecnt_t _time_granularity; + ARDOUR::samplecnt_t _time_span_samples; + int _marker_height; + + int _pointer_x; + int _pointer_y; + + Gtk::Menu* _minitl_context_menu; + struct JumpRange { - JumpRange (int l, int r, framepos_t t) - : left (l), right (r), to (t) {} + JumpRange (int l, int r, samplepos_t t, bool p = false) + : left (l), right (r), to (t), prelight (p) {} int left; int right; - framepos_t to; + samplepos_t to; + bool prelight; }; typedef std::list JumpList;