Browse Source

Timeline: Add freewheel button.

tags/non-daw-v1.2.0
Jonathan Moore Liles 12 years ago
parent
commit
899740c2f1
3 changed files with 38 additions and 5 deletions
  1. +12
    -5
      timeline/src/Engine/Engine.C
  2. +25
    -0
      timeline/src/Transport.C
  3. +1
    -0
      timeline/src/Transport.H

+ 12
- 5
timeline/src/Engine/Engine.C View File

@@ -158,18 +158,25 @@ 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 );

/* because we're going faster than realtime. */
timeline->wait_for_buffers();
timeline->unlock();

/* because we're going faster than realtime. */
timeline->wait_for_buffers();
}
}
else
{
if ( !timeline)
/* handle chicken/egg problem */
/* handle chicken/egg problem */
return 0;

if ( timeline->tryrdlock() )


+ 25
- 0
timeline/src/Transport.C 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,7 +284,12 @@ Transport::start ( void )
}

if ( engine )
{
if ( _freewheel_button->value() )
engine->freewheeling( true );

engine->transport_start();
}
}

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


+ 1
- 0
timeline/src/Transport.H 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 );



Loading…
Cancel
Save