Add action to set range from region position and length.

This commit is contained in:
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; _loop = 0;
else if ( ! strcmp( picked, "/Normalize" ) ) else if ( ! strcmp( picked, "/Normalize" ) )
normalize(); normalize();
else if ( ! strcmp( picked, "/Range from" ) )
timeline->range( start(), length() );
else if ( ! strcmp( picked, "/Remove" ) ) else if ( ! strcmp( picked, "/Remove" ) )
remove(); remove();
else else
@ -307,6 +309,7 @@ Audio_Region::menu ( void )
{ "Loop point to mouse", 'l', 0, 0 }, { "Loop point to mouse", 'l', 0, 0 },
{ "Clear loop point", FL_SHIFT + 'l', 0, 0 }, { "Clear loop point", FL_SHIFT + 'l', 0, 0 },
{ "Normalize", 'n', 0, 0 }, { "Normalize", 'n', 0, 0 },
{ "Range from", FL_CTRL + 'r', 0, 0 },
{ "Remove", 0, 0, 0 }, { "Remove", 0, 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 void
Timeline::menu_cb ( Fl_Menu_ *m ) Timeline::menu_cb ( Fl_Menu_ *m )
{ {

View File

@ -144,7 +144,7 @@ public:
void update_tempomap ( void ); void update_tempomap ( void );
nframes_t fpp ( void ) const { return 1 << _fpp; } nframes_t fpp ( void ) const { return 1 << _fpp; }
void range ( nframes_t start, nframes_t length );
nframes_t length ( void ) const; nframes_t length ( void ) const;
void sample_rate ( nframes_t r ) { _sample_rate = r; } void sample_rate ( nframes_t r ) { _sample_rate = r; }
nframes_t sample_rate ( void ) const { return _sample_rate; } nframes_t sample_rate ( void ) const { return _sample_rate; }