Timeline: Add freewheel button.
This commit is contained in:
parent
c351700be0
commit
899740c2f1
|
@ -158,18 +158,25 @@ Engine::process ( nframes_t nframes )
|
||||||
if ( freewheeling() )
|
if ( freewheeling() )
|
||||||
{
|
{
|
||||||
/* freewheeling mode/export. We're actually running
|
/* freewheeling mode/export. We're actually running
|
||||||
non-RT. Assume that everything is quiescent, locking is
|
non-RT. Assume that everything is quiescent. do I/O
|
||||||
unecessary and do I/O synchronously */
|
synchronously */
|
||||||
|
|
||||||
if ( timeline )
|
if ( timeline )
|
||||||
|
{
|
||||||
|
timeline->rdlock();
|
||||||
|
|
||||||
timeline->process( nframes );
|
timeline->process( nframes );
|
||||||
|
|
||||||
/* because we're going faster than realtime. */
|
timeline->unlock();
|
||||||
timeline->wait_for_buffers();
|
|
||||||
|
/* because we're going faster than realtime. */
|
||||||
|
timeline->wait_for_buffers();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( !timeline)
|
if ( !timeline)
|
||||||
/* handle chicken/egg problem */
|
/* handle chicken/egg problem */
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if ( timeline->tryrdlock() )
|
if ( timeline->tryrdlock() )
|
||||||
|
|
|
@ -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->type(1);
|
||||||
_new_take_button->labelsize(10);
|
_new_take_button->labelsize(10);
|
||||||
} // Fl_Button* _new_take_button
|
} // 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();
|
end();
|
||||||
|
|
||||||
Fl_Button *o;
|
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->color2( fl_color_average( FL_GRAY, FL_YELLOW, 0.50 ) );
|
||||||
o->tooltip( "Toggle automatic creation of new takes for armed tracks" );
|
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 );
|
flowdown( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -272,7 +284,12 @@ Transport::start ( void )
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( engine )
|
if ( engine )
|
||||||
|
{
|
||||||
|
if ( _freewheel_button->value() )
|
||||||
|
engine->freewheeling( true );
|
||||||
|
|
||||||
engine->transport_start();
|
engine->transport_start();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -290,7 +307,15 @@ Transport::stop ( void )
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( engine )
|
if ( engine )
|
||||||
|
{
|
||||||
engine->transport_stop();
|
engine->transport_stop();
|
||||||
|
|
||||||
|
if ( _freewheel_button->value() )
|
||||||
|
{
|
||||||
|
engine->freewheeling( false );
|
||||||
|
_freewheel_button->value( false );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -50,6 +50,7 @@ private:
|
||||||
Fl_Button *_punch_button;
|
Fl_Button *_punch_button;
|
||||||
Fl_Button *_loop_button;
|
Fl_Button *_loop_button;
|
||||||
Fl_Button *_new_take_button;
|
Fl_Button *_new_take_button;
|
||||||
|
Fl_Button *_freewheel_button;
|
||||||
|
|
||||||
void update_record_state ( void );
|
void update_record_state ( void );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue