From 582621edd217fa3db2b87f423186b6ed1d8eedf5 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Mon, 17 Jun 2013 19:54:39 -0700 Subject: [PATCH] Mixer: Fixes for consolidated timeout. --- mixer/src/Mixer.C | 11 ++++++++--- mixer/src/Mixer_Strip.C | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/mixer/src/Mixer.C b/mixer/src/Mixer.C index 69cf253..6ef59ca 100644 --- a/mixer/src/Mixer.C +++ b/mixer/src/Mixer.C @@ -341,7 +341,7 @@ void Mixer::update_frequency ( float v ) { _update_interval = 1.0f / v; - Fl::remove_timeout( &Mixer::update_cb ); + Fl::remove_timeout( &Mixer::update_cb, this ); Fl::add_timeout( _update_interval, &Mixer::update_cb, this ); } @@ -356,9 +356,12 @@ Mixer::update_cb ( void ) { Fl::repeat_timeout( _update_interval, &Mixer::update_cb, this ); - for ( int i = 0; i < mixer_strips->children(); i++ ) + if ( active_r() && visible_r() ) { - ((Mixer_Strip*)mixer_strips->child(i))->update(); + for ( int i = 0; i < mixer_strips->children(); i++ ) + { + ((Mixer_Strip*)mixer_strips->child(i))->update(); + } } } @@ -537,6 +540,8 @@ Mixer::~Mixer ( ) save_options(); + Fl::remove_timeout( &Mixer::update_cb, this ); + /* FIXME: teardown */ mixer_strips->clear(); } diff --git a/mixer/src/Mixer_Strip.C b/mixer/src/Mixer_Strip.C index 6c82f03..278692a 100644 --- a/mixer/src/Mixer_Strip.C +++ b/mixer/src/Mixer_Strip.C @@ -364,6 +364,7 @@ Mixer_Strip::update ( void ) meter_indicator->update(); gain_controller->update(); + if ( _chain ) _chain->update(); }