From e07c7fccee6d5c550f22d5b12c339928a1509989 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Thu, 3 Jan 2008 00:55:21 +0000 Subject: [PATCH] make dummyEffect really work in case we need it git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/branches/lmms-mv@637 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 6 ++++++ include/dummy_effect.h | 28 +++++++++++++++++++++++++--- src/core/effect.cpp | 4 ++-- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index dd04c8d47..e54b56753 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 * include/knob.h: 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 16a150137..57dd9b1ea 100644 --- a/src/core/effect.cpp +++ b/src/core/effect.cpp @@ -4,7 +4,7 @@ * effect.cpp - base-class for effects * * Copyright (c) 2006-2007 Danny McRae - * Copyright (c) 2006-2007 Tobias Doerffel + * Copyright (c) 2006-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -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 ),