From 849dd8a6b30a00f45a442412adcc4a28e1760cc5 Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Thu, 23 Oct 2014 21:23:13 -0400 Subject: [PATCH 1/6] Better name for "dummy" effects --- include/DummyEffect.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/include/DummyEffect.h b/include/DummyEffect.h index 30d267cce..6c2f31a26 100644 --- a/include/DummyEffect.h +++ b/include/DummyEffect.h @@ -87,6 +87,7 @@ public: m_controls( this ), m_originalPluginData( originalPluginData ) { + setName(); } virtual ~DummyEffect() @@ -113,7 +114,28 @@ public: private: DummyEffectControls m_controls; const QDomElement m_originalPluginData; + + // Parse the display name from the dom + virtual void setName() + { + QDomNodeList keys = originalPluginData().elementsByTagName( "key" ); + for( int i = 0; !keys.item( i ).isNull(); ++i ) + { + QDomNodeList attributes = keys.item( i ).toElement().elementsByTagName( "attribute" ); + for( int j = 0; !attributes.item( j ).isNull(); ++j ) + { + QDomElement attribute = attributes.item( j ).toElement(); + if( attribute.hasAttribute( "value" ) ) + { + QString name = tr("NOT FOUND") + " (" + attribute.attribute( "value" ) + ")"; + setDisplayName(name); + return; + } + } + + } + } } ; From 4bef367b098dbfce7e72181033fb0bd1d3ddf015 Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Thu, 23 Oct 2014 22:00:57 -0400 Subject: [PATCH 2/6] Make "dummy" effects stand out in color --- src/gui/widgets/EffectView.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gui/widgets/EffectView.cpp b/src/gui/widgets/EffectView.cpp index e4c01bed8..1421439d2 100644 --- a/src/gui/widgets/EffectView.cpp +++ b/src/gui/widgets/EffectView.cpp @@ -31,6 +31,7 @@ #include #include "EffectView.h" +#include "DummyEffect.h" #include "caption_menu.h" #include "EffectControls.h" #include "EffectControlDialog.h" @@ -270,8 +271,14 @@ void EffectView::paintEvent( QPaintEvent * ) p.setPen( palette().shadow().color() ); p.drawText( 6, 55, model()->displayName() ); - p.setPen( palette().text().color() ); - p.drawText( 5, 54, model()->displayName() ); + + // Make dummy effects stand out + if( dynamic_cast( effect() ) ) { + p.setPen( Qt::red ); + } else { + p.setPen( palette().text().color() ); + } + p.drawText( 5, 54, model()->displayName() ); } From 8288185dac2da6012f6872b9da7b1b4c5f971ea5 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Fri, 24 Oct 2014 09:10:17 -0400 Subject: [PATCH 3/6] 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() ); } From f601e018115baea67e3b097d73361aaa4cd71ebb Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Fri, 24 Oct 2014 09:12:07 -0400 Subject: [PATCH 4/6] Turn carla back on :) --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9cd0e594b..31670495a 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" OFF) +OPTION(WANT_CARLA "Include Carla plugin" ON) 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) From 6db78be8ff4cb599804b30732a6fd1e8cc48ff48 Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Fri, 24 Oct 2014 09:13:17 -0400 Subject: [PATCH 5/6] Fix whitespace --- src/gui/widgets/EffectView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widgets/EffectView.cpp b/src/gui/widgets/EffectView.cpp index 87d1d280f..e8714d5be 100644 --- a/src/gui/widgets/EffectView.cpp +++ b/src/gui/widgets/EffectView.cpp @@ -280,7 +280,7 @@ void EffectView::paintEvent( QPaintEvent * ) p.setPen( palette().shadow().color() ); p.drawText( 6, 55, model()->displayName() ); p.setPen( palette().text().color() ); - p.drawText( 5, 54, model()->displayName() ); + p.drawText( 5, 54, model()->displayName() ); } From deae0883d22aeca3a91d101551876f0a1223c19d Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Fri, 24 Oct 2014 09:13:45 -0400 Subject: [PATCH 6/6] Fix more whitespace --- src/gui/widgets/EffectView.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/widgets/EffectView.cpp b/src/gui/widgets/EffectView.cpp index e8714d5be..07de31ff9 100644 --- a/src/gui/widgets/EffectView.cpp +++ b/src/gui/widgets/EffectView.cpp @@ -56,7 +56,6 @@ EffectView::EffectView( Effect * _model, QWidget * _parent ) : // 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." ) );