diff --git a/Timeline/Audio_Region.C b/Timeline/Audio_Region.C index 61d7da9..8b35345 100644 --- a/Timeline/Audio_Region.C +++ b/Timeline/Audio_Region.C @@ -265,6 +265,8 @@ Audio_Region::menu_cb ( const Fl_Menu_ *m ) _loop = 0; else if ( ! strcmp( picked, "/Normalize" ) ) normalize(); + else if ( ! strcmp( picked, "/Range from" ) ) + timeline->range( start(), length() ); else if ( ! strcmp( picked, "/Remove" ) ) remove(); else @@ -307,6 +309,7 @@ Audio_Region::menu ( void ) { "Loop point to mouse", 'l', 0, 0 }, { "Clear loop point", FL_SHIFT + 'l', 0, 0 }, { "Normalize", 'n', 0, 0 }, + { "Range from", FL_CTRL + 'r', 0, 0 }, { "Remove", 0, 0, 0 }, { 0 }, }; diff --git a/Timeline/Timeline.C b/Timeline/Timeline.C index f2df608..c00eba0 100644 --- a/Timeline/Timeline.C +++ b/Timeline/Timeline.C @@ -173,6 +173,16 @@ Timeline::fix_range ( void ) } } +/** set the range to /start/ + /length/ */ +void +Timeline::range ( nframes_t start, nframes_t length ) +{ + p1 = start; + p2 = start + length; + + redraw(); +} + void Timeline::menu_cb ( Fl_Menu_ *m ) { diff --git a/Timeline/Timeline.H b/Timeline/Timeline.H index 8c67a41..73b15f2 100644 --- a/Timeline/Timeline.H +++ b/Timeline/Timeline.H @@ -144,7 +144,7 @@ public: void update_tempomap ( void ); nframes_t fpp ( void ) const { return 1 << _fpp; } - + void range ( nframes_t start, nframes_t length ); nframes_t length ( void ) const; void sample_rate ( nframes_t r ) { _sample_rate = r; } nframes_t sample_rate ( void ) const { return _sample_rate; }