split off effectControlDialog into effectControlDialog and effectControls, made work with M/V as well as rewritten effect-framework, fixed bug in songEditor-engine
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/branches/lmms-mv@664 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
@@ -27,14 +27,30 @@
|
||||
#define _DUMMY_EFFECT_H
|
||||
|
||||
#include "effect.h"
|
||||
#include "effect_controls.h"
|
||||
#include "effect_control_dialog.h"
|
||||
|
||||
|
||||
class dummyEffectControlDialog : public effectControlDialog
|
||||
{
|
||||
public:
|
||||
dummyEffectControlDialog( effect * _eff ) :
|
||||
effectControlDialog( NULL, _eff )
|
||||
dummyEffectControlDialog( effectControls * _controls ) :
|
||||
effectControlDialog( _controls )
|
||||
{
|
||||
}
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
class dummyEffectControls : public effectControls
|
||||
{
|
||||
public:
|
||||
dummyEffectControls( effect * _eff ) :
|
||||
effectControls( _eff )
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~dummyEffectControls()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -43,28 +59,6 @@ public:
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
inline virtual QString nodeName( void ) const
|
||||
{
|
||||
return( "dummycontrols" );
|
||||
}
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
class dummyEffect : public effect
|
||||
{
|
||||
public:
|
||||
inline dummyEffect( model * _parent ) :
|
||||
effect( NULL, _parent, NULL )
|
||||
{
|
||||
}
|
||||
|
||||
inline virtual ~dummyEffect()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
inline virtual void saveSettings( QDomDocument &, QDomElement & )
|
||||
{
|
||||
}
|
||||
@@ -75,13 +69,37 @@ public:
|
||||
|
||||
inline virtual QString nodeName( void ) const
|
||||
{
|
||||
return( "dummyeffect" );
|
||||
return( "dummycontrols" );
|
||||
}
|
||||
|
||||
inline virtual effectControlDialog * createControlDialog( track * )
|
||||
virtual effectControlDialog * createView( void )
|
||||
{
|
||||
return( new dummyEffectControlDialog( this ) );
|
||||
}
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
class dummyEffect : public effect
|
||||
{
|
||||
public:
|
||||
inline dummyEffect( model * _parent ) :
|
||||
effect( NULL, _parent, NULL ),
|
||||
m_controls( this )
|
||||
{
|
||||
}
|
||||
|
||||
inline virtual ~dummyEffect()
|
||||
{
|
||||
}
|
||||
|
||||
inline virtual effectControls * getControls( void )
|
||||
{
|
||||
return( &m_controls );
|
||||
}
|
||||
|
||||
private:
|
||||
dummyEffectControls m_controls;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
|
||||
class effectChain;
|
||||
class effectControlDialog;
|
||||
class effectControls;
|
||||
class track;
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ public:
|
||||
return( m_key );
|
||||
}
|
||||
|
||||
virtual effectControlDialog * createControlDialog( track * _track ) = 0;
|
||||
virtual effectControls * getControls( void ) = 0;
|
||||
|
||||
static effect * instantiate( const QString & _plugin_name,
|
||||
model * _parent,
|
||||
|
||||
@@ -29,22 +29,18 @@
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
#include "mv_base.h"
|
||||
#include "types.h"
|
||||
|
||||
|
||||
class effect;
|
||||
class track;
|
||||
class effectControls;
|
||||
|
||||
|
||||
class effectControlDialog : public QWidget, public modelView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
effectControlDialog( QWidget * _parent, effect * _eff );
|
||||
effectControlDialog( effectControls * _controls );
|
||||
virtual ~effectControlDialog();
|
||||
|
||||
virtual ch_cnt_t getControlCount( void ) = 0;
|
||||
|
||||
|
||||
signals:
|
||||
void closed();
|
||||
@@ -52,15 +48,10 @@ signals:
|
||||
|
||||
protected:
|
||||
virtual void closeEvent( QCloseEvent * _ce );
|
||||
template<class T>
|
||||
T * getEffect( void )
|
||||
{
|
||||
return( dynamic_cast<T *>( m_effect ) );
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
effect * m_effect;
|
||||
effectControls * m_effectControls;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
68
include/effect_controls.h
Normal file
68
include/effect_controls.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* effect_controls.h - model for effect-controls
|
||||
*
|
||||
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _EFFECT_CONTROLS_H
|
||||
#define _EFFECT_CONTROLS_H
|
||||
|
||||
#include "mv_base.h"
|
||||
#include "journalling_object.h"
|
||||
#include "effect.h"
|
||||
|
||||
|
||||
class track;
|
||||
class effectControlDialog;
|
||||
|
||||
|
||||
class effectControls : public journallingObject, public model
|
||||
{
|
||||
public:
|
||||
effectControls( effect * _eff ) :
|
||||
journallingObject(),
|
||||
model( _eff ),
|
||||
m_effect( _eff )
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~effectControls()
|
||||
{
|
||||
}
|
||||
|
||||
virtual ch_cnt_t getControlCount( void ) = 0;
|
||||
virtual effectControlDialog * createView( void ) = 0;
|
||||
|
||||
|
||||
// template<class T>
|
||||
effect * getEffect( void )
|
||||
{
|
||||
return( m_effect );
|
||||
//return( dynamic_cast<T *>( m_effect ) );
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
effect * m_effect;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user