From 8288185dac2da6012f6872b9da7b1b4c5f971ea5 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Fri, 24 Oct 2014 09:10:17 -0400 Subject: [PATCH] Disable controls on "dummy" effects --- CMakeLists.txt | 2 +- src/gui/widgets/EffectView.cpp | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 31670495a..9cd0e594b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,7 @@ INCLUDE(DetectMachine) OPTION(WANT_ALSA "Include ALSA (Advanced Linux Sound Architecture) support" ON) OPTION(WANT_CALF "Include CALF LADSPA plugins" ON) OPTION(WANT_CAPS "Include C* Audio Plugin Suite (LADSPA plugins)" ON) -OPTION(WANT_CARLA "Include Carla plugin" ON) +OPTION(WANT_CARLA "Include Carla plugin" OFF) OPTION(WANT_CMT "Include Computer Music Toolkit LADSPA plugins" ON) OPTION(WANT_JACK "Include JACK (Jack Audio Connection Kit) support" ON) OPTION(WANT_OGGVORBIS "Include OGG/Vorbis support" ON) diff --git a/src/gui/widgets/EffectView.cpp b/src/gui/widgets/EffectView.cpp index 1421439d2..87d1d280f 100644 --- a/src/gui/widgets/EffectView.cpp +++ b/src/gui/widgets/EffectView.cpp @@ -52,16 +52,22 @@ EffectView::EffectView( Effect * _model, QWidget * _parent ) : m_controlView( NULL ) { setFixedSize( 210, 60 ); - - m_bypass = new ledCheckBox( "", this ); + + // Disable effects that are of type "DummyEffect" + bool isEnabled = !dynamic_cast( effect() ); + m_bypass = new ledCheckBox( this, "", isEnabled ? ledCheckBox::Green : ledCheckBox::Red ); + m_bypass->move( 3, 3 ); + m_bypass->setEnabled( isEnabled ); m_bypass->setWhatsThis( tr( "Toggles the effect on or off." ) ); + toolTip::add( m_bypass, tr( "On/Off" ) ); m_wetDry = new knob( knobBright_26, this ); m_wetDry->setLabel( tr( "W/D" ) ); m_wetDry->move( 27, 5 ); + m_wetDry->setEnabled( isEnabled ); m_wetDry->setHintText( tr( "Wet Level:" ) + " ", "" ); m_wetDry->setWhatsThis( tr( "The Wet/Dry knob sets the ratio between " "the input signal and the effect signal that " @@ -71,6 +77,7 @@ EffectView::EffectView( Effect * _model, QWidget * _parent ) : m_autoQuit = new TempoSyncKnob( knobBright_26, this ); m_autoQuit->setLabel( tr( "DECAY" ) ); m_autoQuit->move( 60, 5 ); + m_autoQuit->setEnabled( isEnabled ); m_autoQuit->setHintText( tr( "Time:" ) + " ", "ms" ); m_autoQuit->setWhatsThis( tr( "The Decay knob controls how many buffers of silence must pass before the " @@ -81,6 +88,7 @@ EffectView::EffectView( Effect * _model, QWidget * _parent ) : m_gate = new knob( knobBright_26, this ); m_gate->setLabel( tr( "GATE" ) ); m_gate->move( 93, 5 ); + m_gate->setEnabled( isEnabled ); m_gate->setHintText( tr( "Gate:" ) + " ", "" ); m_gate->setWhatsThis( tr( "The Gate knob controls the signal level that is considered to be 'silence' " @@ -271,13 +279,7 @@ void EffectView::paintEvent( QPaintEvent * ) p.setPen( palette().shadow().color() ); p.drawText( 6, 55, model()->displayName() ); - - // Make dummy effects stand out - if( dynamic_cast( effect() ) ) { - p.setPen( Qt::red ); - } else { - p.setPen( palette().text().color() ); - } + p.setPen( palette().text().color() ); p.drawText( 5, 54, model()->displayName() ); }