Timeline: Add freewheel button.

This commit is contained in:
Jonathan Moore Liles 2013-05-01 22:04:16 -07:00
parent c351700be0
commit 899740c2f1
3 changed files with 38 additions and 5 deletions

View File

@ -158,14 +158,21 @@ Engine::process ( nframes_t nframes )
if ( freewheeling() )
{
/* freewheeling mode/export. We're actually running
non-RT. Assume that everything is quiescent, locking is
unecessary and do I/O synchronously */
non-RT. Assume that everything is quiescent. do I/O
synchronously */
if ( timeline )
{
timeline->rdlock();
timeline->process( nframes );
timeline->unlock();
/* because we're going faster than realtime. */
timeline->wait_for_buffers();
}
}
else
{
if ( !timeline)

View File

@ -65,6 +65,10 @@ Transport::Transport ( int X, int Y, int W, int H, const char *L )
_new_take_button->type(1);
_new_take_button->labelsize(10);
} // Fl_Button* _new_take_button
{ _freewheel_button = new Fl_Button(225, 5, 60, 21, "Freewheel");
_freewheel_button->type(1);
_freewheel_button->labelsize(10);
} // Fl_Button* _new_take_button
end();
Fl_Button *o;
@ -112,6 +116,14 @@ Transport::Transport ( int X, int Y, int W, int H, const char *L )
o->color2( fl_color_average( FL_GRAY, FL_YELLOW, 0.50 ) );
o->tooltip( "Toggle automatic creation of new takes for armed tracks" );
o = _freewheel_button;
o->type( FL_TOGGLE_BUTTON );
o->shortcut( 'T' );
o->callback( cb_button, this );
o->when( FL_WHEN_CHANGED );
o->color2( fl_color_average( FL_GRAY, FL_BLUE, 0.50 ) );
o->tooltip( "When active, the next playback will be done in freewheeling mode" );
flowdown( true );
}
@ -272,8 +284,13 @@ Transport::start ( void )
}
if ( engine )
{
if ( _freewheel_button->value() )
engine->freewheeling( true );
engine->transport_start();
}
}
void
Transport::stop ( void )
@ -290,7 +307,15 @@ Transport::stop ( void )
}
if ( engine )
{
engine->transport_stop();
if ( _freewheel_button->value() )
{
engine->freewheeling( false );
_freewheel_button->value( false );
}
}
}
void

View File

@ -50,6 +50,7 @@ private:
Fl_Button *_punch_button;
Fl_Button *_loop_button;
Fl_Button *_new_take_button;
Fl_Button *_freewheel_button;
void update_record_state ( void );