From b0b5a1f5100f664d3543415b966bacd5e375ecb2 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Fri, 29 Jan 2010 14:12:24 -0600 Subject: [PATCH] Make it optional (Options/Behavior/...) wether or not stopping the transport disables global record. --- Timeline/TLE.fl | 28 ++++++++++++++++++++-------- Timeline/Transport.C | 9 ++++++--- Timeline/Transport.H | 5 +++++ 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/Timeline/TLE.fl b/Timeline/TLE.fl index 41a25fb..ee46b14 100644 --- a/Timeline/TLE.fl +++ b/Timeline/TLE.fl @@ -1,6 +1,6 @@ # data file for the Fltk User Interface Designer (fluid) -version 1.0108 -header_name {.H} +version 1.0110 +header_name {.H} code_name {.C} comment {// // Copyright (C) 2008-2010 Jonathan Moore Liles @@ -20,7 +20,7 @@ comment {// // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // } {in_source in_header -} +} decl {const float STATUS_UPDATE_FREQ = 0.5f;} {} @@ -144,9 +144,7 @@ Fl::lock(); } Function {TLE()} {open } { - code { - -Fl::visual( FL_DOUBLE | FL_RGB8 ); + code {Fl::visual( FL_DOUBLE | FL_RGB8 ); make_window(); @@ -575,6 +573,21 @@ Fl::scheme( Fl::scheme() );} } } } + Submenu {} { + label {&Behavior} open + xywh {0 0 74 25} + } { + Submenu {} { + label {&Transport} open + xywh {0 0 74 25} + } { + MenuItem {} { + label {Stop Disables Record} + callback {transport->stop_disables_record( ((Fl_Menu_*)o)->mvalue()->flags & FL_MENU_VALUE );} selected + xywh {5 5 40 25} type Toggle value 1 + } + } + } } Submenu {} { label {&Help} open @@ -800,8 +813,7 @@ if ( engine->zombified() && ! zombie ) solo_blinker->value( Track::soloing() ); rec_blinker->value( transport->rolling && transport->rec_enabled() ); lash_blinker->value( lash->enabled() ); -selected_blinker->value( timeline->nselected() );} {selected - } +selected_blinker->value( timeline->nselected() );} {} } Function {update_cb( void *v )} {open private return_type {static void} } { diff --git a/Timeline/Transport.C b/Timeline/Transport.C index 7d516f6..f89bc23 100644 --- a/Timeline/Transport.C +++ b/Timeline/Transport.C @@ -34,6 +34,7 @@ Transport::Transport ( int X, int Y, int W, int H, const char *L ) { recording = false; rolling = false; + _stop_disables_record = true; const int bw = W / 3; @@ -96,12 +97,12 @@ Transport::update_record_state ( void ) * should begin or end on the next frame */ if ( rolling ) { - if ( w->value() ) + if ( ! recording && w->value() ) { timeline->record(); recording = true; } - else + else if ( recording ) { timeline->stop(); recording = false; @@ -190,7 +191,9 @@ Transport::stop ( void ) // MESSAGE( "Stopping transport" ); if ( _record_button->value() ) { - _record_button->value( 0 ); + if ( _stop_disables_record ) + _record_button->value( 0 ); + update_record_state(); } diff --git a/Timeline/Transport.H b/Timeline/Transport.H index 1e33004..563fa2d 100644 --- a/Timeline/Transport.H +++ b/Timeline/Transport.H @@ -35,6 +35,8 @@ struct Transport : public jack_position_t, public Fl_Pack private: + bool _stop_disables_record; + static void cb_button ( Fl_Widget *w, void *arg ); void cb_button ( Fl_Widget *w ); @@ -55,6 +57,9 @@ public: bool rec_enabled ( void ) const; + void stop_disables_record ( bool b ) { _stop_disables_record = b; } + bool stop_disables_record ( void ) const { return _stop_disables_record; } + void toggle_record ( void ); int handle ( int m );