Disable controls on "dummy" effects

This commit is contained in:
Ubuntu
2014-10-24 09:10:17 -04:00
parent 4bef367b09
commit 8288185dac
2 changed files with 12 additions and 10 deletions

View File

@@ -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)

View File

@@ -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<DummyEffect *>( 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<DummyEffect *>( effect() ) ) {
p.setPen( Qt::red );
} else {
p.setPen( palette().text().color() );
}
p.setPen( palette().text().color() );
p.drawText( 5, 54, model()->displayName() );
}