From 37383c6d27e4a1780e3111a98fad953aeb75cd56 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Thu, 3 Jan 2008 00:50:24 +0000 Subject: [PATCH] make dummyEffect really work in case we need it git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@635 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 6 ++++++ include/dummy_effect.h | 28 +++++++++++++++++++++++++--- src/core/effect.cpp | 2 +- 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index de4dbdf9d..984a9cb23 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-01-02 Tobias Doerffel + + * include/dummy_effect.h: + * src/core/effect.cpp: + make dummyEffect really work in case we need it + 2008-01-02 Tobias Doerffel * src/widgets/rack_plugin.cpp: diff --git a/include/dummy_effect.h b/include/dummy_effect.h index 274c179e3..435b4ae00 100644 --- a/include/dummy_effect.h +++ b/include/dummy_effect.h @@ -1,7 +1,7 @@ /* * dummy_effect.h - effect used as fallback if an effect couldn't be loaded * - * Copyright (c) 2006 Tobias Doerffel + * Copyright (c) 2006-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -27,6 +27,29 @@ #define _DUMMY_EFFECT_H #include "effect.h" +#include "effect_control_dialog.h" + + +class dummyEffectControlDialog : public effectControlDialog +{ +public: + dummyEffectControlDialog( effect * _eff ) : + effectControlDialog( NULL, _eff ) + { + } + + virtual ch_cnt_t getControlCount( void ) + { + return( 0 ); + } + + inline virtual QString nodeName( void ) const + { + return( "dummycontrols" ); + } + +} ; + class dummyEffect : public effect @@ -57,8 +80,7 @@ public: inline virtual effectControlDialog * createControlDialog( track * ) { - // TODO: setup a dummy control-dialog for not crashing LMMS - return( NULL ); + return( new dummyEffectControlDialog( this ) ); } } ; diff --git a/src/core/effect.cpp b/src/core/effect.cpp index 1a091b204..6e18d2c97 100644 --- a/src/core/effect.cpp +++ b/src/core/effect.cpp @@ -35,7 +35,7 @@ effect::effect( const plugin::descriptor * _desc, const descriptor::subPluginFeatures::key * _key ) : plugin( _desc ), - m_key( *_key ), + m_key( _key ? *_key : descriptor::subPluginFeatures::key() ), m_okay( TRUE ), m_noRun( FALSE ), m_running( FALSE ),