diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2007-11-08 05:06:23 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2007-11-08 05:06:23 +0000 |
commit | 62941af2cf8da4c5424afb9173fdb310c2c23eef (patch) | |
tree | f671f3a58da36af1694375054c2dfd6a2724aa52 /gtk2_ardour/marker.cc | |
parent | c61de034c7271b0334ade1325a674702e026bc13 (diff) |
change kbd selection to F1 & F2; make kbd selection differentiate between rolling and not rolling conditions, using mouse location for not rolling; marker selection starts tobe used; markers get lines when selected; hide marker_grab_line now
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2608 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/marker.cc')
-rw-r--r-- | gtk2_ardour/marker.cc | 53 |
1 files changed, 51 insertions, 2 deletions
diff --git a/gtk2_ardour/marker.cc b/gtk2_ardour/marker.cc index 4065ad978b..880e02b5e9 100644 --- a/gtk2_ardour/marker.cc +++ b/gtk2_ardour/marker.cc @@ -250,9 +250,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; @@ -266,6 +266,9 @@ 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 () @@ -274,6 +277,46 @@ Marker::~Marker () 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, 0.0)); + line_points->push_back (Gnome::Art::Point (unit_position, 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_EditCursor.get(); + } + + show_line (); +} + +void +Marker::show_line () +{ + if (line) { + line->raise_to_top(); + line->show (); + } +} + +void +Marker::hide_line () +{ + if (line) { + line->hide (); + } } ArdourCanvas::Item& @@ -299,6 +342,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); + (*line_points)[1].set_x (unit_position); + line->property_points() = *line_points; + } } void |