Add action to set range from region position and length.
This commit is contained in:
parent
869cf25b3b
commit
00aeaff29b
|
@ -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 },
|
||||
};
|
||||
|
|
|
@ -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 )
|
||||
{
|
||||
|
|
|
@ -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; }
|
||||
|
|
Loading…
Reference in New Issue