From 3a4ae3a434418b2dbfb6694176cafe983e124aea Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sun, 3 May 2009 15:13:22 +0200 Subject: [PATCH] VstEffect: check whether VST effect has an editor Depending on whether VST effect has an editor return 1 or 0 in VstEffectControls::getControlCount(). This prevents the EffectView in the effect rack from showing a "Controls" button and creating an empty subwindow. --- plugins/vst_effect/vst_effect.h | 6 +++--- plugins/vst_effect/vst_effect_controls.cpp | 11 ++++++++++- plugins/vst_effect/vst_effect_controls.h | 11 ++++------- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/plugins/vst_effect/vst_effect.h b/plugins/vst_effect/vst_effect.h index 10734759a..244a35995 100644 --- a/plugins/vst_effect/vst_effect.h +++ b/plugins/vst_effect/vst_effect.h @@ -1,7 +1,7 @@ /* * vst_effect.h - class for handling VST effect plugins * - * Copyright (c) 2006-2008 Tobias Doerffel + * Copyright (c) 2006-2009 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -47,13 +47,13 @@ public: virtual effectControls * getControls( void ) { - return( &m_vstControls ); + return &m_vstControls; } virtual inline QString publicName( void ) const { - return( m_plugin->name() ); + return m_plugin->name(); } diff --git a/plugins/vst_effect/vst_effect_controls.cpp b/plugins/vst_effect/vst_effect_controls.cpp index f44b5deb3..278e0625b 100644 --- a/plugins/vst_effect/vst_effect_controls.cpp +++ b/plugins/vst_effect/vst_effect_controls.cpp @@ -1,7 +1,7 @@ /* * vst_effect_controls.cpp - controls for VST effect plugins * - * Copyright (c) 2008 Tobias Doerffel + * Copyright (c) 2008-2009 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -67,5 +67,14 @@ void vstEffectControls::saveSettings( QDomDocument & _doc, QDomElement & _this ) + +int vstEffectControls::getControlCount( void ) +{ + return m_effect->m_plugin != NULL && + m_effect->m_plugin->hasEditor() ? 1 : 0; +} + + + #include "moc_vst_effect_controls.cxx" diff --git a/plugins/vst_effect/vst_effect_controls.h b/plugins/vst_effect/vst_effect_controls.h index bc756d4c5..36408fe3b 100644 --- a/plugins/vst_effect/vst_effect_controls.h +++ b/plugins/vst_effect/vst_effect_controls.h @@ -1,7 +1,7 @@ /* * vst_effect_controls.h - controls for VST effect plugins * - * Copyright (c) 2008 Tobias Doerffel + * Copyright (c) 2008-2009 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -46,17 +46,14 @@ public: virtual void loadSettings( const QDomElement & _this ); inline virtual QString nodeName( void ) const { - return( "vsteffectcontrols" ); + return "vsteffectcontrols"; } - virtual int getControlCount( void ) - { - return( 1 ); - } + virtual int getControlCount( void ); virtual effectControlDialog * createView( void ) { - return( new vstEffectControlDialog( this ) ); + return new vstEffectControlDialog( this ); }