Add action to set range from region position and length.

pull/3/head
Jonathan Moore Liles 2008-07-21 22:20:38 -05:00
parent 869cf25b3b
commit 00aeaff29b
3 changed files with 14 additions and 1 deletions

View File

@ -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 },
};

View File

@ -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 )
{

View File

@ -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; }