summaryrefslogtreecommitdiff
path: root/gtk2_ardour/midi_region_view.h
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-08-16 14:24:41 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-08-16 14:24:41 +0000
commitf6951c92f04ed17ec98a2d1cd9bcf535ce6f037c (patch)
tree135769f8d8d18e6004fffd37671cc678f7ab3e2e /gtk2_ardour/midi_region_view.h
parent6a3ce666c6716ceb9378e508d6116f83c32957c7 (diff)
attempt to fix deep confusion in GUI code about converting between musical and audio time (should have beneficial effects on #4257); change ghost note drawing when in MIDI note draw/add mode so that its start is aligned with the mouse cursor
git-svn-id: svn://localhost/ardour2/branches/3.0@9998 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/midi_region_view.h')
-rw-r--r--gtk2_ardour/midi_region_view.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/gtk2_ardour/midi_region_view.h b/gtk2_ardour/midi_region_view.h
index e407b2ab4d..69cddd2fc5 100644
--- a/gtk2_ardour/midi_region_view.h
+++ b/gtk2_ardour/midi_region_view.h
@@ -255,11 +255,23 @@ public:
ARDOUR::frameoffset_t snap_frame_to_frame (ARDOUR::frameoffset_t);
- /** Convert a timestamp in beats to frames (both relative to region start) */
- framepos_t beats_to_frames(double beats) const;
-
+ /** Convert a timestamp in beats into frames (both relative to region start) */
+ framepos_t region_beats_to_region_frames(double beats) const;
+ /** Convert a timestamp in beats into absolute frames */
+ framepos_t region_beats_to_absolute_frames(double beats) const {
+ return _region->position() + region_beats_to_region_frames (beats);
+ }
/** Convert a timestamp in frames to beats (both relative to region start) */
- double frames_to_beats(framepos_t) const;
+ double region_frames_to_region_beats(framepos_t) const;
+
+ /** Convert a timestamp in beats measured from source start into absolute frames */
+ framepos_t source_beats_to_absolute_frames(double beats) const;
+ /** Convert a timestamp in beats measured from source start into region-relative frames */
+ framepos_t source_beats_to_region_frames(double beats) const {
+ return source_beats_to_absolute_frames (beats) - _region->position();
+ }
+ /** Convert a timestamp in absolute frames to beats measured from source start*/
+ double absolute_frames_to_source_beats(framepos_t) const;
void goto_previous_note (bool add_to_selection);
void goto_next_note (bool add_to_selection);