From ba430eb2363a3bb2145c4f560ccc7cb812e21c6b Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Sat, 24 May 2008 22:27:23 -0500 Subject: [PATCH] Add 't' key on timeline to add a tempo point using the current range as the beat length. --- Timeline/Timeline.C | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Timeline/Timeline.C b/Timeline/Timeline.C index dd0f3ad..c006edb 100644 --- a/Timeline/Timeline.C +++ b/Timeline/Timeline.C @@ -924,6 +924,24 @@ Timeline::handle ( int m ) redraw(); return 1; } + case 't': + { + if ( p1 != p2 ) + { + if ( p1 > p2 ) + { + nframes_t t = p2; + p2 = p1; + p1 = t; + } + + beats_per_minute( p1, sample_rate() * 60 / (float)( p2 - p1 ) ); + + p2 = p1; + } + + return 1; + } default: return Fl_Overlay_Window::handle( m ); }