X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=inline;f=gtk2_ardour%2Fmarker.h;h=e80b87e9c8b15874a6d73534fd325f1fe886c94f;hb=7f280e2bed51cfa56fedeaf08f28b6040c93b5b1;hp=efe2c8ee78b8d89ad7e234dc97fa8fde77252886;hpb=8496f57fd49f1fd74d2c8662a91088374fb662ba;p=ardour.git diff --git a/gtk2_ardour/marker.h b/gtk2_ardour/marker.h index efe2c8ee78..e80b87e9c8 100644 --- a/gtk2_ardour/marker.h +++ b/gtk2_ardour/marker.h @@ -23,13 +23,13 @@ #include #include -#include #include #include "ardour/ardour.h" #include "pbd/signals.h" -#include "canvas.h" +#include "canvas/fwd.h" +#include "canvas/types.h" namespace ARDOUR { class TempoSection; @@ -38,7 +38,11 @@ namespace ARDOUR { class PublicEditor; -class Marker : public sigc::trackable +/** Location Marker + * + * Editor ruler representation of a location marker or range on the timeline. + */ +class ArdourMarker : public sigc::trackable { public: enum Type { @@ -56,12 +60,14 @@ 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); + ArdourMarker (PublicEditor& editor, ArdourCanvas::Container &, guint32 rgba, const std::string& text, Type, + framepos_t frame = 0, bool handle_events = true); - virtual ~Marker (); + virtual ~ArdourMarker (); - static PBD::Signal1 CatchDeletion; + static PBD::Signal1 CatchDeletion; + + static void setup_sizes (const double timebar_height); ArdourCanvas::Item& the_item() const; @@ -76,8 +82,8 @@ class Marker : public sigc::trackable framepos_t position() const { return frame_position; } - ArdourCanvas::Group * get_parent() { return _parent; } - void reparent (ArdourCanvas::Group & parent); + ArdourCanvas::Container * get_parent() { return _parent; } + void reparent (ArdourCanvas::Container & parent); void hide (); void show (); @@ -92,20 +98,19 @@ class Marker : public sigc::trackable } 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::Container* _parent; + ArdourCanvas::Container *group; ArdourCanvas::Polygon *mark; - ArdourCanvas::Pixbuf *name_pixbuf; + ArdourCanvas::Text *_name_item; ArdourCanvas::Points *points; - ArdourCanvas::SimpleLine* _line; - ArdourCanvas::Points *line_points; + ArdourCanvas::Line* _track_canvas_line; + ArdourCanvas::Rectangle* _name_background; std::string _name; double unit_position; @@ -120,28 +125,35 @@ class Marker : public sigc::trackable 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_pixbuf (); + void setup_name_display (); + +private: + /* disallow copy construction */ + ArdourMarker (ArdourMarker const &); + ArdourMarker & operator= (ArdourMarker const &); }; -class TempoMarker : public Marker +class TempoMarker : public ArdourMarker { public: - TempoMarker (PublicEditor& editor, ArdourCanvas::Group &, ArdourCanvas::Group &, guint32 rgba, const std::string& text, ARDOUR::TempoSection&); + TempoMarker (PublicEditor& editor, ArdourCanvas::Container &, guint32 rgba, const std::string& text, ARDOUR::TempoSection&); ~TempoMarker (); ARDOUR::TempoSection& tempo() const { return _tempo; } + void update_height_mark (const double ratio); private: ARDOUR::TempoSection& _tempo; }; -class MeterMarker : public Marker +class MeterMarker : public ArdourMarker { public: - MeterMarker (PublicEditor& editor, ArdourCanvas::Group &, ArdourCanvas::Group &, guint32 rgba, const std::string& text, ARDOUR::MeterSection&); + MeterMarker (PublicEditor& editor, ArdourCanvas::Container &, guint32 rgba, const std::string& text, ARDOUR::MeterSection&); ~MeterMarker (); ARDOUR::MeterSection& meter() const { return _meter; }