2 Copyright (C) 2001 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __gtk_ardour_marker_h__
21 #define __gtk_ardour_marker_h__
26 #include <libgnomecanvasmm/pixbuf.h>
27 #include <sigc++/signal.h>
29 #include "ardour/ardour.h"
30 #include "pbd/signals.h"
41 class Marker : public sigc::trackable
48 Start, ///< session start
57 Marker (PublicEditor& editor, ArdourCanvas::Group &, ArdourCanvas::Group &, guint32 rgba, const std::string& text, Type,
58 nframes_t frame = 0, bool handle_events = true);
62 static PBD::Signal1<void,Marker*> CatchDeletion;
64 ArdourCanvas::Item& the_item() const;
66 void set_selected (bool);
67 void set_show_line (bool);
68 void canvas_height_set (double);
70 void set_position (framepos_t);
71 void set_name (const std::string&);
72 void set_color_rgba (uint32_t rgba);
75 framepos_t position() const { return frame_position; }
77 ArdourCanvas::Group * get_parent() { return _parent; }
78 void reparent (ArdourCanvas::Group & parent);
83 Type type () { return _type; }
88 Pango::FontDescription* name_font;
90 ArdourCanvas::Group* _parent;
91 ArdourCanvas::Group* _line_parent;
92 ArdourCanvas::Group *group;
93 ArdourCanvas::Polygon *mark;
94 ArdourCanvas::Pixbuf *name_pixbuf;
95 ArdourCanvas::Points *points;
96 ArdourCanvas::SimpleLine* _line;
97 ArdourCanvas::Points *line_points;
100 framepos_t frame_position;
107 double _canvas_height;
111 void setup_line_x ();
114 class TempoMarker : public Marker
117 TempoMarker (PublicEditor& editor, ArdourCanvas::Group &, ArdourCanvas::Group &, guint32 rgba, const std::string& text, ARDOUR::TempoSection&);
120 ARDOUR::TempoSection& tempo() const { return _tempo; }
123 ARDOUR::TempoSection& _tempo;
126 class MeterMarker : public Marker
129 MeterMarker (PublicEditor& editor, ArdourCanvas::Group &, ArdourCanvas::Group &, guint32 rgba, const std::string& text, ARDOUR::MeterSection&);
132 ARDOUR::MeterSection& meter() const { return _meter; }
135 ARDOUR::MeterSection& _meter;
138 #endif /* __gtk_ardour_marker_h__ */