From 89a833a33d2b1ba5b96129175672436494926925 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Sun, 24 Jan 2010 19:47:10 -0600 Subject: [PATCH] Mixer: Make insert-before work for meter indicator module. --- Mixer/Meter_Indicator_Module.C | 17 ++++++++++++++++- Mixer/Meter_Module.C | 19 ++++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/Mixer/Meter_Indicator_Module.C b/Mixer/Meter_Indicator_Module.C index 6fbe90e..c5571de 100644 --- a/Mixer/Meter_Indicator_Module.C +++ b/Mixer/Meter_Indicator_Module.C @@ -38,6 +38,8 @@ const float CONTROL_UPDATE_FREQ = 0.1f; +#include "FL/test_press.H" + @@ -198,7 +200,20 @@ Meter_Indicator_Module::connect_to ( Port *p ) int Meter_Indicator_Module::handle ( int m ) { - return Fl_Group::handle( m ); + switch ( m ) + { + case FL_PUSH: + { + if ( test_press( FL_BUTTON1 ) ) + { + /* don't let Module::handle eat our click */ + return Fl_Group::handle( m ); + } + return Module::handle( m ); + } + } + + return Module::handle( m ); } diff --git a/Mixer/Meter_Module.C b/Mixer/Meter_Module.C index f8bf6e9..5f6447e 100644 --- a/Mixer/Meter_Module.C +++ b/Mixer/Meter_Module.C @@ -24,6 +24,7 @@ #include #include "JACK/Port.H" #include +#include "FL/test_press.H" @@ -70,6 +71,8 @@ Meter_Module::~Meter_Module ( ) log_destroy(); } + + void Meter_Module::update_cb ( void *v ) { @@ -152,8 +155,22 @@ Meter_Module::configure_inputs ( int n ) int Meter_Module::handle ( int m ) { - return Fl_Group::handle( m ); + switch ( m ) + { + case FL_PUSH: + { + if ( test_press( FL_BUTTON1 ) ) + { + /* don't let Module::handle eat our click */ + return Fl_Group::handle( m ); + } + return Module::handle( m ); + } + } + + return Module::handle( m ); } + static float