X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Ftime_axis_view_item.h;h=f6f72b77bda6af0f5f8f70f82ae4a6eb1c603969;hb=74126c48c0726e5491a160d2b0f04e406fc80231;hp=6b4bc09ec1710e7ae65d39b9415cc28b06e8bccb;hpb=cc7d4db5fe9132c38b919ab073b91d442abad9b6;p=ardour.git diff --git a/gtk2_ardour/time_axis_view_item.h b/gtk2_ardour/time_axis_view_item.h index 6b4bc09ec1..f6f72b77bd 100644 --- a/gtk2_ardour/time_axis_view_item.h +++ b/gtk2_ardour/time_axis_view_item.h @@ -21,17 +21,21 @@ #define __gtk_ardour_time_axis_view_item_h__ #include - -#include - +#include +#include #include "pbd/signals.h" - #include "selectable.h" -#include "simplerect.h" -#include "canvas.h" class TimeAxisView; +namespace ArdourCanvas { + class Pixbuf; + class Rectangle; + class Item; + class Group; + class Text; +} + using ARDOUR::framepos_t; using ARDOUR::framecnt_t; @@ -72,11 +76,14 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList ArdourCanvas::Item* get_canvas_frame(); ArdourCanvas::Group* get_canvas_group(); ArdourCanvas::Item* get_name_highlight(); - ArdourCanvas::Pixbuf* get_name_pixbuf(); - virtual void set_samples_per_unit(double spu); + virtual void set_samples_per_pixel (double); + + double get_samples_per_pixel () const; - double get_samples_per_unit(); + virtual void drag_start() { _dragging = true; } + virtual void drag_end() { _dragging = false; } + bool dragging() const { return _dragging; } virtual void raise () { return; } virtual void raise_to_top () { return; } @@ -93,7 +100,8 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList static Pango::FontDescription NAME_FONT; static void set_constant_heights (); static const double NAME_X_OFFSET; - static const double GRAB_HANDLE_LENGTH; + static const double GRAB_HANDLE_TOP; + static const double GRAB_HANDLE_WIDTH; /* these are not constant, but vary with the pixel size of the font used to display the item name. @@ -153,11 +161,12 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList virtual void compute_colors (Gdk::Color const &); virtual void set_colors(); virtual void set_frame_color(); + virtual void set_frame_gradient (); void set_trim_handle_colors(); virtual void reset_width_dependent_items (double); void reset_name_width (double); - void update_name_pixbuf_visibility (); + void update_name_text_visibility (); static gint idle_remove_this_item(TimeAxisViewItem*, void*); @@ -185,8 +194,8 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList /** indicates whether the min duration constraint is active */ bool min_duration_active; - /** samples per canvas unit */ - double samples_per_unit; + /** frames per canvas pixel */ + double samples_per_pixel; /** should the item respond to events */ bool _sensitive; @@ -220,25 +229,26 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList uint32_t lock_handle_color_g; uint32_t lock_handle_color_b; uint32_t last_item_width; - int name_pixbuf_width; + int name_text_width; bool wide_enough_for_name; bool high_enough_for_name; bool rect_visible; ArdourCanvas::Group* group; - ArdourCanvas::SimpleRect* vestigial_frame; - ArdourCanvas::SimpleRect* frame; - ArdourCanvas::Pixbuf* name_pixbuf; - ArdourCanvas::SimpleRect* name_highlight; + ArdourCanvas::Rectangle* vestigial_frame; + ArdourCanvas::Rectangle* frame; + ArdourCanvas::Text* name_text; + ArdourCanvas::Rectangle* name_highlight; /* with these two values, if frame_handle_start == 0 then frame_handle_end will also be 0 */ - ArdourCanvas::SimpleRect* frame_handle_start; ///< `frame' (fade) handle for the start of the item, or 0 - ArdourCanvas::SimpleRect* frame_handle_end; ///< `frame' (fade) handle for the end of the item, or 0 + ArdourCanvas::Rectangle* frame_handle_start; ///< `frame' (fade) handle for the start of the item, or 0 + ArdourCanvas::Rectangle* frame_handle_end; ///< `frame' (fade) handle for the end of the item, or 0 double _height; Visibility visibility; bool _recregion; bool _automation; ///< true if this is an automation region view + bool _dragging; private: