From aa2377be6cb9272222165958bff58c697ff701a8 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Tue, 19 Jan 2010 01:46:49 -0600 Subject: [PATCH] Timeline: Add a blinker for pending seek. --- Timeline/Engine/Engine.C | 2 +- Timeline/Engine/Timeline.C | 12 ++++++------ Timeline/TLE.fl | 19 ++++++++++++++----- Timeline/Timeline.H | 2 +- 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/Timeline/Engine/Engine.C b/Timeline/Engine/Engine.C index 323c734..87c693e 100644 --- a/Timeline/Engine/Engine.C +++ b/Timeline/Engine/Engine.C @@ -100,7 +100,7 @@ Engine::sync ( jack_transport_state_t state, jack_position_t *pos ) seeking = true; } - int r = true; + bool r = true; if ( timeline ) r = timeline->seek_pending(); diff --git a/Timeline/Engine/Timeline.C b/Timeline/Engine/Timeline.C index c0acba8..d09452b 100644 --- a/Timeline/Engine/Timeline.C +++ b/Timeline/Engine/Timeline.C @@ -126,22 +126,22 @@ Timeline::resize_buffers ( nframes_t nframes ) } } -int +/** return true if any playback stream's buffer is less than 50% full */ +bool Timeline::seek_pending ( void ) { - THREAD_ASSERT( RT ); - - int r = 0; +// THREAD_ASSERT( RT ); for ( int i = tracks->children(); i-- ; ) { Track *t = (Track*)tracks->child( i ); if ( t->playback_ds ) - r += t->playback_ds->buffer_percent() < 50; + if ( t->playback_ds->buffer_percent() < 50 ) + return true; } - return r; + return false; } diff --git a/Timeline/TLE.fl b/Timeline/TLE.fl index 28d4356..7391808 100644 --- a/Timeline/TLE.fl +++ b/Timeline/TLE.fl @@ -22,7 +22,7 @@ comment {// } {in_source in_header } -decl {const float STATUS_UPDATE_FREQ = 0.5f;} {} +decl {const float STATUS_UPDATE_FREQ = 0.1f;} {} decl {\#include "Fl_Menu_Settings.H"} {} @@ -220,7 +220,7 @@ Loggable::progress_callback( &TLE::progress_cb, this );} {} label Timeline callback {if ( Fl::event_key() != FL_Escape ) o->hide();} open - private xywh {701 103 1025 770} type Double resizable xclass Non_DAW visible + private xywh {703 114 1025 770} type Double resizable xclass Non_DAW visible } { Fl_Menu_Bar menubar {open private xywh {0 0 1024 25} @@ -657,7 +657,7 @@ ab.run();} } Fl_Box {} { label {} - xywh {487 27 203 42} resizable + xywh {487 27 148 42} resizable code0 {o->labeltype( FL_NO_LABEL );} } Fl_Group {} {open @@ -720,6 +720,13 @@ ab.run();} code0 {\#include "FL/Fl_Blinker.H"} class Fl_Blinker } + Fl_Button seek_blinker { + label SEEK + xywh {640 50 50 15} box ROUNDED_BOX down_box ROUNDED_BOX color 10 selection_color 2 labelfont 2 labelcolor 39 deactivate + code0 {\#include "FL/Fl_Blinker.H"} + code1 {o->interval( Fl_Blinker::FAST );} + class Fl_Blinker + } Fl_Box stats_box { label {} xywh {810 1 215 21} labelsize 13 labelcolor 53 align 88 @@ -829,6 +836,8 @@ rec_blinker->value( transport->rolling && transport->rec_enabled() ); sm_blinker->value( timeline->session_manager_name() != NULL ); sm_blinker->tooltip( timeline->session_manager_name() ); selected_blinker->value( timeline->nselected() );} {selected +seek_blinker->value( timeline->seek_pending() ); +project_name->redraw();} {selected } } Function {update_cb( void *v )} {open private return_type {static void} @@ -917,7 +926,7 @@ if ( logo_box->image() ) ((Fl_Shared_Image*)logo_box->image())->release(); logo_box->image( NULL ); }} open - private xywh {653 248 520 740} type Double modal visible + private xywh {655 259 520 740} type Double modal visible } { Fl_Value_Output {} { label {Sample Rate} @@ -1017,7 +1026,7 @@ if ( logo_box->image() ) ((Fl_Shared_Image*)logo_box->image())->release(); logo_box->image( NULL ); }} open - private xywh {1344 87 495 655} type Double xclass {Non-DAW} visible + private xywh {1346 98 495 655} type Double xclass {Non-DAW} visible } { Fl_Tabs {} {open xywh {0 264 497 392} diff --git a/Timeline/Timeline.H b/Timeline/Timeline.H index d1686ac..e1ec7cf 100644 --- a/Timeline/Timeline.H +++ b/Timeline/Timeline.H @@ -215,6 +215,7 @@ public: void stop ( void ); void wait_for_buffers ( void ); + bool seek_pending ( void ); private: @@ -230,5 +231,4 @@ private: void resize_buffers ( nframes_t nframes ); nframes_t process ( nframes_t nframes ); void seek ( nframes_t frame ); - int seek_pending ( void ); };