more MIDI paste improvements, plus move region-mute binding to PRIMARY-m and use...
[ardour.git] / gtk2_ardour / time_axis_view_item.h
index 18d6638738cab141d121db24249593da17462e28..97e7a73745eb5b1dff8a0229b8f04a4223dcc27a 100644 (file)
@@ -23,7 +23,7 @@
 #include <jack/jack.h>
 #include <string>
 
-#include <libgnomecanvasmm/text.h>
+#include <libgnomecanvasmm/pixbuf.h>
 
 #include "selectable.h"
 #include "simplerect.h"
@@ -38,7 +38,7 @@ class TimeAxisView;
 class TimeAxisViewItem : public Selectable
 {
    public:
-       virtual ~TimeAxisViewItem() ;
+       virtual ~TimeAxisViewItem() ;
     
     /**
      * Set the position of this item upon the timeline to the specified value
@@ -201,12 +201,19 @@ class TimeAxisViewItem : public Selectable
      */
     void set_name_text(const Glib::ustring& new_name) ;
     
-    virtual void set_y_position_and_height(double y, double h) ;
-    
+    /**
+     * Set the height of this item
+     *
+     * @param h the new height
+     */
+    virtual void set_height(double h) ;
+
+    void set_y (double);
+
     /**
      * 
      */
-    void set_color(Gdk::Color& color) ;
+    void set_color (Gdk::Color const &);
     
     /**
      * 
@@ -216,7 +223,7 @@ class TimeAxisViewItem : public Selectable
     /**
      * 
      */
-    ArdourCanvas::Item* get_canvas_group();
+    ArdourCanvas::Group* get_canvas_group();
 
     /**
      * 
@@ -226,7 +233,7 @@ class TimeAxisViewItem : public Selectable
     /**
      * 
      */
-    ArdourCanvas::Text* get_name_text();
+    ArdourCanvas::Pixbuf* get_name_pixbuf();
 
 
     /**
@@ -291,6 +298,7 @@ class TimeAxisViewItem : public Selectable
      * the destructor, this allows us to capture the source of the deletion
      * event
      */
+
     sigc::signal<void,std::string,void*> ItemRemoved ;
     
     /** Emitted when the name/Id of this item is changed */
@@ -311,8 +319,6 @@ class TimeAxisViewItem : public Selectable
     /** Emitted when the mionimum item duration is changed */
     sigc::signal<void,nframes_t,void*> MinDurationChanged ;
     
-  protected:
-    
     enum Visibility {
            ShowFrame = 0x1,
            ShowNameHighlight = 0x2,
@@ -323,7 +329,7 @@ class TimeAxisViewItem : public Selectable
            HideFrameTB = 0x40,
            FullWidthNameHighlight = 0x80
     };
-
+  protected:
     /**
      * Constructs a new TimeAxisViewItem.
      *
@@ -335,19 +341,19 @@ class TimeAxisViewItem : public Selectable
      * @param start the start point of this item
      * @param duration the duration of this item
      */
-    TimeAxisViewItem(const std::string & it_name, ArdourCanvas::Group& parent, TimeAxisView& tv, double spu, Gdk::Color& base_color, 
-                    nframes_t start, nframes_t duration, Visibility v = Visibility (0));
+    TimeAxisViewItem(const std::string & it_name, ArdourCanvas::Group& parent, TimeAxisView& tv, double spu, Gdk::Color const & base_color, 
+                    nframes_t start, nframes_t duration, bool recording = false, Visibility v = Visibility (0));
 
     TimeAxisViewItem (const TimeAxisViewItem& other);
 
-    void init (const std::string& it_name, double spu, Gdk::Color& base_color, nframes_t start, nframes_t duration, Visibility vis);
+    void init (const std::string& it_name, double spu, Gdk::Color const & base_color, nframes_t start, nframes_t duration, Visibility vis);
     
     /**
      * Calculates some contrasting color for displaying various parts of this item, based upon the base color
      *
      * @param color the base color of the item
      */
-    virtual void compute_colors(Gdk::Color& color) ;
+    virtual void compute_colors (Gdk::Color const & color);
     
     /**
      * convenience method to set the various canvas item colors
@@ -451,17 +457,14 @@ class TimeAxisViewItem : public Selectable
     ArdourCanvas::Group*      group;
     ArdourCanvas::SimpleRect* vestigial_frame;
     ArdourCanvas::SimpleRect* frame;
-    ArdourCanvas::Text*       name_text;
+    ArdourCanvas::Pixbuf*     name_pixbuf;
     ArdourCanvas::SimpleRect* name_highlight;
     ArdourCanvas::SimpleRect* frame_handle_start;
     ArdourCanvas::SimpleRect* frame_handle_end;
 
-    int name_text_width;
-    double last_name_text_width;
-
-    std::map<Glib::ustring::size_type,int> name_text_size_cache;
-    
     Visibility visibility;
+    bool _recregion;
+
 
 }; /* class TimeAxisViewItem */