From 81808ac866724dbb710c67523189f748666d43f2 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 22 Oct 2011 23:18:59 +0000 Subject: [PATCH] Fix up some comments. git-svn-id: svn://localhost/ardour2/branches/3.0@10289 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/midi_region_view.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 59bef05a32..fcab483287 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -2397,6 +2397,9 @@ MidiRegionView::note_dropped(CanvasNoteEvent *, frameoffset_t dt, int8_t dnote) } } +/** @param x Pixel relative to the region position. + * @return Snapped frame relative to the region position. + */ framepos_t MidiRegionView::snap_pixel_to_frame(double x) { @@ -2404,6 +2407,9 @@ MidiRegionView::snap_pixel_to_frame(double x) return snap_frame_to_frame (editor.pixel_to_frame (x)); } +/** @param x Pixel relative to the region position. + * @return Snapped pixel relative to the region position. + */ double MidiRegionView::snap_to_pixel(double x) { @@ -2543,9 +2549,6 @@ MidiRegionView::update_resizing (ArdourCanvas::CanvasNoteEvent* primary, bool at double beats; beats = snap_pixel_to_frame (current_x); - /* XXX not sure this is correct - snap_pixel_to_frame() - returns an absolute frame. - */ beats = region_frames_to_region_beats (beats); double len; @@ -2608,13 +2611,10 @@ MidiRegionView::commit_resizing (ArdourCanvas::CanvasNoteEvent* primary, bool at } } - /* Convert that to a frame within the region */ + /* Convert that to a frame within the source */ current_x = snap_pixel_to_frame (current_x) + _region->start (); /* and then to beats */ - /* XXX not sure this is correct - snap_pixel_to_frame() - returns an absolute frame. - */ current_x = region_frames_to_region_beats (current_x); if (at_front && current_x < canvas_note->note()->end_time()) {