diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2007-11-12 22:23:01 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2007-11-12 22:23:01 +0000 |
commit | b01bdb7e70f021da764e81a4b55722e746e4885d (patch) | |
tree | 3f22af0fc8399bedd6843f7a9a4383295ac7b3cb /gtk2_ardour/marker.cc | |
parent | 99d002dbdf2563bcad880628e7876aebe191ba0c (diff) |
merged with trunk revs 2605-2627
git-svn-id: svn://localhost/ardour2/trunk@2628 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/marker.cc')
-rw-r--r-- | gtk2_ardour/marker.cc | 62 |
1 files changed, 60 insertions, 2 deletions
diff --git a/gtk2_ardour/marker.cc b/gtk2_ardour/marker.cc index a0f91d2a2a..de2ceb554e 100644 --- a/gtk2_ardour/marker.cc +++ b/gtk2_ardour/marker.cc @@ -252,9 +252,9 @@ Marker::Marker (PublicEditor& ed, ArdourCanvas::Group& parent, guint32 rgba, con delete font; if (annotate_left) { - text->property_x() = -(text->property_text_width()); + text->property_x() = -(text->property_text_width()); } else { - text->property_x() = label_offset; + text->property_x() = label_offset; } text->property_y() = 0.0; text->property_anchor() = Gtk::ANCHOR_NW; @@ -268,14 +268,66 @@ Marker::Marker (PublicEditor& ed, ArdourCanvas::Group& parent, guint32 rgba, con group->signal_event().connect (bind (mem_fun (editor, &PublicEditor::canvas_marker_event), mark, this)); } + line = 0; + line_points = 0; + } Marker::~Marker () { + drop_references (); + /* destroying the parent group destroys its contents, namely any polygons etc. that we added */ delete text; delete mark; delete points; + + if (line) { + delete line; + delete line_points; + } +} + +void +Marker::add_line (ArdourCanvas::Group* group, double initial_height) +{ + if (!line) { + + line_points = new ArdourCanvas::Points (); + line_points->push_back (Gnome::Art::Point (unit_position + shift, 0.0)); + line_points->push_back (Gnome::Art::Point (unit_position + shift, initial_height)); + + line = new ArdourCanvas::Line (*group); + line->property_width_pixels() = 1; + line->property_points() = *line_points; + line->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_EditPoint.get(); + line->property_first_arrowhead() = TRUE; + line->property_last_arrowhead() = TRUE; + line->property_arrow_shape_a() = 11.0; + line->property_arrow_shape_b() = 0.0; + line->property_arrow_shape_c() = 9.0; + + line->signal_event().connect (bind (mem_fun (editor, &PublicEditor::canvas_marker_event), mark, this)); + } + + show_line (); +} + +void +Marker::show_line () +{ + if (line) { + line->raise_to_top(); + line->show (); + } +} + +void +Marker::hide_line () +{ + if (line) { + line->hide (); + } } ArdourCanvas::Item& @@ -301,6 +353,12 @@ Marker::set_position (nframes_t frame) group->move (new_unit_position - unit_position, 0.0); frame_position = frame; unit_position = new_unit_position; + + if (line) { + (*line_points)[0].set_x (unit_position + shift); + (*line_points)[1].set_x (unit_position + shift); + line->property_points() = *line_points; + } } void |