Browse Source

Timeline: Add more more keybindings, particularly of performing actions at the location of the playhead.

tags/non-daw-v1.2.0
Jonathan Moore Liles 9 years ago
parent
commit
9d39699950
2 changed files with 47 additions and 6 deletions
  1. +44
    -3
      timeline/src/Audio_Region.C
  2. +3
    -3
      timeline/src/Sequence.C

+ 44
- 3
timeline/src/Audio_Region.C View File

@@ -296,6 +296,41 @@ Audio_Region::menu_cb ( const Fl_Menu_ *m )
_scale = 1.0;
else if ( ! strcmp( picked, "/Range from" ) )
timeline->range( start(), length() );
else if ( ! strcmp( picked, "/Trim left to playhead" ) )
{
redraw();
trim_left( transport->frame );
}
else if ( ! strcmp( picked, "/Trim right to playhead" ) )
{
redraw();
trim_right( transport->frame );
}
else if ( ! strcmp( picked, "/Split at playhead" ) )
{
redraw();
split( transport->frame );
}
else if ( ! strcmp( picked, "/Loop point at playhead" ) )
{
nframes_t f = transport->frame;

_loop = f - _r->start;
}
else if ( ! strcmp( picked, "/Fade in to playhead" ) )
{
nframes_t offset = transport->frame - _r->start;

if ( offset < length() )
_fade_in.length = offset;
}
else if ( ! strcmp( picked, "/Fade out to playhead" ) )
{
nframes_t offset = _r->start + _r->length - transport->frame;
if ( offset > 0 )
_fade_out.length = offset;
}
else if ( ! strcmp( picked, "/Remove" ) )
remove();
else
@@ -333,16 +368,22 @@ Audio_Region::menu ( void )
{ 0 },
{ 0 },
{ "Color", 0, 0, 0, inherit_track_color ? FL_MENU_INACTIVE : 0 },
{ "Crop to range", 'c', 0, 0, FL_MENU_DIVIDER },
{ "Split at mouse", 's', 0, 0 },
{ "Crop to range", 'c', 0, 0 },
{ "Gain with mouse vertical drag", 'g', 0, 0 },
{ "Fade in to mouse", FL_F + 3, 0, 0 },
{ "Fade out to mouse", FL_F + 4, 0, 0 },
{ "Loop point to mouse", 'l', 0, 0 },
{ "Clear loop point", FL_SHIFT + 'l', 0, 0, 0 == _loop ? FL_MENU_INACTIVE : 0 },
{ "Clear loop point", 0, 0, 0, 0 == _loop ? FL_MENU_INACTIVE : 0 },
{ "Normalize", 'n', 0, 0 },
{ "Denormalize", FL_SHIFT + 'n', 0, 0, 1.0 == _scale ? FL_MENU_INACTIVE : 0 },
{ "Range from", FL_CTRL + 'r', 0, 0 },
{ "Range from", FL_CTRL + 'r', 0, 0, FL_MENU_DIVIDER },
{ "Trim left to playhead", '{', 0, 0 },
{ "Trim right to playhead", '}', 0, 0 },
{ "Split at playhead", FL_SHIFT + 's', 0, 0 },
{ "Loop point at playhead", FL_SHIFT + 'l', 0, 0 },
{ "Fade in to playhead", FL_F + 3 + FL_SHIFT, 0, 0 },
{ "Fade out to playhead", FL_F + 4 + FL_SHIFT, 0, 0 },
{ "Remove", 0, 0, 0 },
{ 0 },
};


+ 3
- 3
timeline/src/Sequence.C View File

@@ -331,7 +331,7 @@ Sequence::handle ( int m )
case FL_SHORTCUT:
if ( Fl::test_shortcut( FL_CTRL + FL_Right ) )
{
const Sequence_Widget *w = next( transport->frame + 1 );
const Sequence_Widget *w = next( transport->frame );
if ( w )
transport->locate( w->start() );
@@ -564,8 +564,8 @@ const Sequence_Widget *
Sequence::next ( nframes_t from ) const
{
for ( list <Sequence_Widget*>::const_iterator i = _widgets.begin(); i != _widgets.end(); i++ )
if ( (*i)->start() >= from )
// if ( (*i)->start() > from )
// if ( (*i)->start() >= from )
if ( (*i)->start() > from )
return *i;

if ( _widgets.size() )


Loading…
Cancel
Save