various tweaks to get clicks on processor "buttons" to work right and to keep track...
[ardour.git] / gtk2_ardour / marker.h
index 18eea0963eebbb16a1a1c248220a6a44b00847b9..6bf6d08f5132a6bb697ff36bbf4bba073e51fb18 100644 (file)
@@ -56,8 +56,8 @@ class Marker : public sigc::trackable
        };
 
 
-       Marker (PublicEditor& editor, ArdourCanvas::Group &, ArdourCanvas::Group &, guint32 rgba, const std::string& text, Type,
-               nframes_t frame = 0, bool handle_events = true);
+       Marker (PublicEditor& editor, ArdourCanvas::Group &, guint32 rgba, const std::string& text, Type,
+               framepos_t frame = 0, bool handle_events = true);
 
        virtual ~Marker ();
 
@@ -84,20 +84,30 @@ class Marker : public sigc::trackable
 
        Type type () { return _type; }
 
+       void set_left_label_limit (double);
+       void set_right_label_limit (double);
+
+       std::string name () const {
+               return _name;
+       }
+
+       bool label_on_left () const;
+
   protected:
        PublicEditor& editor;
 
-       Pango::FontDescription* name_font;
+       Pango::FontDescription name_font;
 
        ArdourCanvas::Group* _parent;
-       ArdourCanvas::Group* _line_parent;
        ArdourCanvas::Group *group;
        ArdourCanvas::Polygon *mark;
        ArdourCanvas::Pixbuf *name_pixbuf;
        ArdourCanvas::Points *points;
        ArdourCanvas::SimpleLine* _line;
        ArdourCanvas::Points *line_points;
+       ArdourCanvas::SimpleRect* _name_background;
 
+       std::string  _name;
        double        unit_position;
        framepos_t    frame_position;
        double       _shift;
@@ -108,15 +118,24 @@ class Marker : public sigc::trackable
        bool         _line_shown;
        double       _canvas_height;
        uint32_t     _color;
+       double       _left_label_limit; ///< the number of pixels available to the left of this marker for a label
+       double       _right_label_limit; ///< the number of pixels available to the right of this marker for a label
+       double       _label_offset;
 
        void reposition ();
        void setup_line_x ();
+       void setup_name_display ();
+
+private:
+       /* disallow copy construction */
+       Marker (Marker const &);
+       Marker & operator= (Marker const &);
 };
 
 class TempoMarker : public Marker
 {
   public:
-        TempoMarker (PublicEditor& editor, ArdourCanvas::Group &, ArdourCanvas::Group &, guint32 rgba, const std::string& text, ARDOUR::TempoSection&);
+        TempoMarker (PublicEditor& editor, ArdourCanvas::Group &, guint32 rgba, const std::string& text, ARDOUR::TempoSection&);
        ~TempoMarker ();
 
        ARDOUR::TempoSection& tempo() const { return _tempo; }
@@ -128,7 +147,7 @@ class TempoMarker : public Marker
 class MeterMarker : public Marker
 {
   public:
-        MeterMarker (PublicEditor& editor, ArdourCanvas::Group &, ArdourCanvas::Group &, guint32 rgba, const std::string& text, ARDOUR::MeterSection&);
+        MeterMarker (PublicEditor& editor, ArdourCanvas::Group &, guint32 rgba, const std::string& text, ARDOUR::MeterSection&);
        ~MeterMarker ();
 
        ARDOUR::MeterSection& meter() const { return _meter; }