rewrote effect-framework, changes in plugin-instantiation
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/branches/lmms-mv@656 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* audio_port.h - base-class for objects providing sound at a port
|
||||
*
|
||||
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -34,7 +34,7 @@
|
||||
class audioPort
|
||||
{
|
||||
public:
|
||||
audioPort( const QString & _name );
|
||||
audioPort( const QString & _name, track * _track );
|
||||
~audioPort();
|
||||
|
||||
inline surroundSampleFrame * firstBuffer( void )
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
|
||||
inline effectChain * getEffects( void )
|
||||
{
|
||||
return( m_effects );
|
||||
return( &m_effects );
|
||||
}
|
||||
|
||||
void setNextFxChannel( const fx_ch_t _chnl )
|
||||
@@ -88,7 +88,11 @@ public:
|
||||
NONE, FIRST, BOTH
|
||||
} m_bufferUsage;
|
||||
|
||||
inline bool processEffects( void ) { return( m_effects->processAudioBuffer( m_firstBuffer, m_frames ) ); };
|
||||
inline bool processEffects( void )
|
||||
{
|
||||
return( m_effects.processAudioBuffer( m_firstBuffer,
|
||||
m_frames ) );
|
||||
}
|
||||
|
||||
private:
|
||||
surroundSampleFrame * m_firstBuffer;
|
||||
@@ -98,7 +102,7 @@ private:
|
||||
|
||||
QString m_name;
|
||||
|
||||
effectChain * m_effects;
|
||||
effectChain m_effects;
|
||||
fpp_t m_frames;
|
||||
|
||||
} ;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* automatable_model.h - declaration of class automatableModel
|
||||
*
|
||||
* Copyright (c) 2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2007-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -247,7 +247,8 @@ public:
|
||||
typedef automatableModel<T, EDIT_STEP_TYPE> autoModel;
|
||||
typedef automatableModelView<T, EDIT_STEP_TYPE> autoModelView;
|
||||
|
||||
automatableModelView( void ) : modelView()
|
||||
automatableModelView( ::model * _model ) :
|
||||
modelView( _model )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -55,8 +55,8 @@ public:
|
||||
class dummyEffect : public effect
|
||||
{
|
||||
public:
|
||||
inline dummyEffect( void ) :
|
||||
effect( NULL, NULL )
|
||||
inline dummyEffect( model * _parent ) :
|
||||
effect( NULL, _parent, NULL )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
return( "dummyinstrument" );
|
||||
}
|
||||
|
||||
virtual instrumentView * createView( QWidget * _parent )
|
||||
virtual pluginView * instantiateView( QWidget * _parent )
|
||||
{
|
||||
return( new instrumentView( this, _parent ) );
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* dummy_plugin.h - empty plugin which is used as fallback if a plugin couldn't
|
||||
* be found
|
||||
*
|
||||
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -28,13 +28,14 @@
|
||||
#define _DUMMY_PLUGIN_H
|
||||
|
||||
#include "plugin.h"
|
||||
#include "plugin_view.h"
|
||||
|
||||
|
||||
class dummyPlugin : public plugin
|
||||
{
|
||||
public:
|
||||
inline dummyPlugin( void ) :
|
||||
plugin( NULL )
|
||||
plugin( NULL, NULL )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -56,6 +57,12 @@ public:
|
||||
return( "dummyplugin" );
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual pluginView * instantiateView( QWidget * _parent )
|
||||
{
|
||||
return( new pluginView( this, _parent ) );
|
||||
}
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* effect.h - base class for effects
|
||||
*
|
||||
* Copyright (c) 2006-2007 Danny McRae <khjklujn/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -39,83 +39,91 @@
|
||||
#include "automatable_model.h"
|
||||
|
||||
|
||||
class effectChain;
|
||||
class effectControlDialog;
|
||||
class track;
|
||||
class rackPlugin;
|
||||
|
||||
|
||||
class effect : public plugin
|
||||
{
|
||||
public:
|
||||
effect( const plugin::descriptor * _desc,
|
||||
model * _parent,
|
||||
const descriptor::subPluginFeatures::key * _key );
|
||||
virtual ~effect();
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
|
||||
inline virtual QString nodeName( void ) const
|
||||
{
|
||||
return( "effect" );
|
||||
}
|
||||
|
||||
|
||||
virtual bool FASTCALL processAudioBuffer(
|
||||
virtual bool processAudioBuffer(
|
||||
surroundSampleFrame * _buf, const fpp_t _frames );
|
||||
|
||||
|
||||
inline ch_cnt_t getProcessorCount( void ) const
|
||||
{
|
||||
return( m_processors );
|
||||
}
|
||||
|
||||
|
||||
inline void setProcessorCount( ch_cnt_t _processors )
|
||||
{
|
||||
m_processors = _processors;
|
||||
}
|
||||
|
||||
|
||||
inline bool isOkay( void ) const
|
||||
{
|
||||
return( m_okay );
|
||||
}
|
||||
|
||||
|
||||
inline void setOkay( bool _state )
|
||||
{
|
||||
m_okay = _state;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
inline bool isRunning( void ) const
|
||||
{
|
||||
return( m_running );
|
||||
}
|
||||
|
||||
|
||||
inline void startRunning( void )
|
||||
{
|
||||
m_bufferCount = 0;
|
||||
m_running = TRUE;
|
||||
}
|
||||
|
||||
|
||||
inline void stopRunning( void )
|
||||
{
|
||||
m_running = FALSE;
|
||||
}
|
||||
|
||||
|
||||
inline bool isEnabled( void ) const
|
||||
{
|
||||
return( m_enabledModel.value() );
|
||||
}
|
||||
|
||||
inline Uint32 getTimeout( void ) const
|
||||
|
||||
inline f_cnt_t getTimeout( void ) const
|
||||
{
|
||||
return( m_silenceTimeout );
|
||||
const float samples = engine::getMixer()->sampleRate() *
|
||||
m_autoQuitModel.value() / 1000.0f;
|
||||
return( 1 + ( static_cast<Uint32>( samples ) /
|
||||
engine::getMixer()->framesPerPeriod() ) );
|
||||
}
|
||||
|
||||
inline void setTimeout( Uint32 _time_out )
|
||||
{
|
||||
m_silenceTimeout = _time_out;
|
||||
}
|
||||
|
||||
|
||||
inline float getWetLevel( void ) const
|
||||
{
|
||||
return( m_wetDryModel.value() );
|
||||
}
|
||||
|
||||
|
||||
inline float getDryLevel( void ) const
|
||||
{
|
||||
return( 1.0f - m_wetDryModel.value() );
|
||||
}
|
||||
|
||||
|
||||
inline float getGate( void ) const
|
||||
{
|
||||
const float level = m_gateModel.value();
|
||||
@@ -123,7 +131,7 @@ public:
|
||||
engine::getMixer()->framesPerPeriod() );
|
||||
}
|
||||
|
||||
inline Uint32 getBufferCount( void ) const
|
||||
inline f_cnt_t getBufferCount( void ) const
|
||||
{
|
||||
return( m_bufferCount );
|
||||
}
|
||||
@@ -135,7 +143,7 @@ public:
|
||||
|
||||
inline void incrementBufferCount( void )
|
||||
{
|
||||
m_bufferCount++;
|
||||
++m_bufferCount;
|
||||
}
|
||||
|
||||
inline bool dontRun( void ) const
|
||||
@@ -156,9 +164,14 @@ public:
|
||||
virtual effectControlDialog * createControlDialog( track * _track ) = 0;
|
||||
|
||||
static effect * instantiate( const QString & _plugin_name,
|
||||
model * _parent,
|
||||
descriptor::subPluginFeatures::key * _key );
|
||||
|
||||
|
||||
protected:
|
||||
virtual pluginView * instantiateView( QWidget * );
|
||||
|
||||
|
||||
private:
|
||||
descriptor::subPluginFeatures::key m_key;
|
||||
|
||||
@@ -167,16 +180,16 @@ private:
|
||||
bool m_okay;
|
||||
bool m_noRun;
|
||||
bool m_running;
|
||||
f_cnt_t m_bufferCount;
|
||||
|
||||
boolModel m_enabledModel;
|
||||
|
||||
Uint32 m_bufferCount;
|
||||
Uint32 m_silenceTimeout;
|
||||
|
||||
floatModel m_wetDryModel;
|
||||
floatModel m_gateModel;
|
||||
floatModel m_autoQuitModel;
|
||||
|
||||
|
||||
friend class rackPlugin;
|
||||
friend class effectView;
|
||||
friend class effectChain;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* effect_chain.h - class for processing and effects chain
|
||||
*
|
||||
* Copyright (c) 2006-2008 Danny McRae <khjklujn/at/users.sourceforge.net>
|
||||
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -28,37 +29,48 @@
|
||||
#include "effect.h"
|
||||
|
||||
|
||||
typedef QVector<effect *> effect_list_t;
|
||||
|
||||
|
||||
class effectChain
|
||||
class effectChain : public journallingObject, public model
|
||||
{
|
||||
public:
|
||||
effectChain( void );
|
||||
effectChain( audioPort * _port, track * _track );
|
||||
virtual ~effectChain();
|
||||
|
||||
void FASTCALL appendEffect( effect * _effect );
|
||||
void FASTCALL removeEffect( effect * _effect );
|
||||
void FASTCALL moveDown( effect * _effect );
|
||||
void FASTCALL moveUp( effect * _effect );
|
||||
bool FASTCALL processAudioBuffer( surroundSampleFrame * _buf,
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
|
||||
inline virtual QString nodeName( void ) const
|
||||
{
|
||||
return( "fxchain" );
|
||||
}
|
||||
|
||||
void appendEffect( effect * _effect );
|
||||
void removeEffect( effect * _effect );
|
||||
void moveDown( effect * _effect );
|
||||
void moveUp( effect * _effect );
|
||||
bool processAudioBuffer( surroundSampleFrame * _buf,
|
||||
const fpp_t _frames );
|
||||
void startRunning( void );
|
||||
bool isRunning( void );
|
||||
|
||||
inline const effect_list_t & getEffects( void )
|
||||
/* inline const effect_list_t & getEffects( void )
|
||||
{
|
||||
return( m_effects );
|
||||
}
|
||||
}*/
|
||||
|
||||
void deleteAllPlugins( void );
|
||||
|
||||
|
||||
private:
|
||||
effect_list_t m_effects;
|
||||
typedef QVector<effect *> effectList;
|
||||
effectList m_effects;
|
||||
|
||||
audioPort * m_port;
|
||||
track * m_track;
|
||||
|
||||
boolModel m_enabledModel;
|
||||
|
||||
|
||||
friend class effectTabWidget;
|
||||
friend class effectRackView;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* effect_control_dialog.h - base-class for effect-dialogs for displaying and
|
||||
* editing control port values
|
||||
*
|
||||
* Copyright (c) 2006-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -28,14 +28,15 @@
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
#include "journalling_object.h"
|
||||
#include "mv_base.h"
|
||||
#include "types.h"
|
||||
|
||||
|
||||
class effect;
|
||||
class track;
|
||||
|
||||
|
||||
class effectControlDialog : public QWidget, public journallingObject
|
||||
class effectControlDialog : public QWidget, public modelView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* offers access to an effect rack
|
||||
*
|
||||
* Copyright (c) 2006-2007 Danny McRae <khjklujn/at/users.sourceforge.net>
|
||||
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -28,18 +29,15 @@
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
#include "journalling_object.h"
|
||||
|
||||
|
||||
class QLabel;
|
||||
class QPushButton;
|
||||
|
||||
class effectTabWidget;
|
||||
class effectRackView;
|
||||
class sampleTrack;
|
||||
class tabWidget;
|
||||
|
||||
|
||||
class effectLabel: public QWidget, public journallingObject
|
||||
class effectLabel: public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -48,22 +46,14 @@ public:
|
||||
virtual ~effectLabel();
|
||||
|
||||
QString text( void ) const;
|
||||
void FASTCALL setText( const QString & _text );
|
||||
|
||||
virtual void FASTCALL saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent );
|
||||
virtual void FASTCALL loadSettings( const QDomElement & _this );
|
||||
inline virtual QString nodeName( void ) const
|
||||
{
|
||||
return( "sample_track" );
|
||||
}
|
||||
void setText( const QString & _text );
|
||||
|
||||
|
||||
|
||||
public slots:
|
||||
void showEffects( void );
|
||||
void rename( void );
|
||||
|
||||
|
||||
|
||||
signals:
|
||||
void clicked( void );
|
||||
void nameChanged( void );
|
||||
@@ -78,13 +68,12 @@ protected:
|
||||
|
||||
private:
|
||||
sampleTrack * m_track;
|
||||
|
||||
|
||||
QLabel * m_label;
|
||||
QPushButton * m_effectBtn;
|
||||
tabWidget * m_tabWidget;
|
||||
effectTabWidget * m_effWidget;
|
||||
QWidget * m_effWindow;
|
||||
effectRackView * m_effectRack;
|
||||
|
||||
};
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/*
|
||||
* right_frame.h - provides the display for the rackInsert instances
|
||||
* effect_rack_view.h - view for effectChain-model
|
||||
*
|
||||
* Copyright (c) 2006-2007 Danny McRae <khjklujn@netscape.net>
|
||||
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -22,63 +23,61 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _RACK_VIEW_H
|
||||
#define _RACK_VIEW_H
|
||||
#ifndef _EFFECT_RACK_VIEW_H
|
||||
#define _EFFECT_RACK_VIEW_H
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
#include <QtGui/QLayout>
|
||||
#include <QtGui/QScrollArea>
|
||||
#include <QtGui/QVBoxLayout>
|
||||
|
||||
|
||||
#include "effect_chain.h"
|
||||
#include "types.h"
|
||||
#include "journalling_object.h"
|
||||
|
||||
class QPushButton;
|
||||
class QScrollArea;
|
||||
class QVBoxLayout;
|
||||
|
||||
class effectView;
|
||||
class groupBox;
|
||||
|
||||
|
||||
class audioPort;
|
||||
class effect;
|
||||
class rackPlugin;
|
||||
class track;
|
||||
|
||||
|
||||
class rackView: public QWidget, public journallingObject
|
||||
class effectRackView : public QWidget, public modelView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
rackView( QWidget * _parent, track * _track, audioPort * _port );
|
||||
~rackView();
|
||||
|
||||
void addEffect( effect * _e );
|
||||
|
||||
virtual void FASTCALL saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent );
|
||||
virtual void FASTCALL loadSettings( const QDomElement & _this );
|
||||
inline virtual QString nodeName( void ) const
|
||||
{
|
||||
return( "rack" );
|
||||
}
|
||||
|
||||
void deleteAllPlugins( void );
|
||||
effectRackView( effectChain * _model, QWidget * _parent );
|
||||
virtual ~effectRackView();
|
||||
|
||||
|
||||
public slots:
|
||||
void moveUp( rackPlugin * _plugin );
|
||||
void moveDown( rackPlugin * _plugin );
|
||||
void deletePlugin( rackPlugin * _plugin );
|
||||
void moveUp( effectView * _view );
|
||||
void moveDown( effectView * _view );
|
||||
void deletePlugin( effectView * _view );
|
||||
|
||||
|
||||
private slots:
|
||||
void updateView( void );
|
||||
void addEffect( void );
|
||||
|
||||
|
||||
private:
|
||||
void redraw();
|
||||
virtual void modelChanged( void );
|
||||
|
||||
inline effectChain * fxChain( void )
|
||||
{
|
||||
return( castModel<effectChain>() );
|
||||
}
|
||||
|
||||
inline const effectChain * fxChain( void ) const
|
||||
{
|
||||
return( castModel<effectChain>() );
|
||||
}
|
||||
|
||||
|
||||
QVector<rackPlugin *> m_rackInserts;
|
||||
|
||||
QVector<effectView *> m_effectViews;
|
||||
|
||||
QVBoxLayout * m_mainLayout;
|
||||
groupBox * m_effectsGroupBox;
|
||||
QScrollArea * m_scrollArea;
|
||||
|
||||
track * m_track;
|
||||
audioPort * m_port;
|
||||
QPushButton * m_addButton;
|
||||
|
||||
Uint32 m_lastY;
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <QtGui/QDialog>
|
||||
#include <QtGui/QListWidget>
|
||||
|
||||
#include "effect.h"
|
||||
#include "effect_chain.h"
|
||||
|
||||
|
||||
class effectSelectDialog : public QDialog
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
effectSelectDialog( QWidget * _parent );
|
||||
virtual ~effectSelectDialog();
|
||||
|
||||
effect * instantiateSelectedPlugin( void );
|
||||
effect * instantiateSelectedPlugin( effectChain * _parent );
|
||||
|
||||
public slots:
|
||||
void showPorts( void );
|
||||
@@ -53,13 +53,13 @@ private:
|
||||
|
||||
|
||||
|
||||
class effectList : public QWidget
|
||||
class effectListWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
effectList( QWidget * _parent );
|
||||
effectListWidget( QWidget * _parent );
|
||||
|
||||
virtual ~effectList();
|
||||
virtual ~effectListWidget();
|
||||
|
||||
inline effectKey getSelected( void )
|
||||
{
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
/*
|
||||
* effect_tab_widget.h - tab-widget in channel-track-window for setting up
|
||||
* effects
|
||||
*
|
||||
* Copyright (c) 2006-2008 Danny McRae <khjklujn/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_TAB_WIDGET_H
|
||||
#define _EFFECT_TAB_WIDGET_H
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
#include "journalling_object.h"
|
||||
#include "rack_view.h"
|
||||
|
||||
|
||||
class QPushButton;
|
||||
|
||||
class audioPort;
|
||||
class groupBox;
|
||||
class instrumentTrack;
|
||||
class sampleTrack;
|
||||
class track;
|
||||
|
||||
|
||||
class effectTabWidget : public QWidget, public journallingObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
effectTabWidget( instrumentTrack * _track, audioPort * _port );
|
||||
effectTabWidget( QWidget * _parent, sampleTrack * _track,
|
||||
audioPort * _port );
|
||||
virtual ~effectTabWidget();
|
||||
|
||||
|
||||
virtual void FASTCALL saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent );
|
||||
virtual void FASTCALL loadSettings( const QDomElement & _this );
|
||||
inline virtual QString nodeName( void ) const
|
||||
{
|
||||
return( "fx" );
|
||||
}
|
||||
|
||||
void setupWidget( void );
|
||||
|
||||
inline void deleteAllEffects( void )
|
||||
{
|
||||
m_rack->deleteAllPlugins();
|
||||
}
|
||||
|
||||
|
||||
private slots:
|
||||
void addEffect( void );
|
||||
|
||||
|
||||
private:
|
||||
track * m_track;
|
||||
audioPort * m_port;
|
||||
|
||||
groupBox * m_effectsGroupBox;
|
||||
QPushButton * m_addButton;
|
||||
|
||||
rackView * m_rack;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* rack_plugin.h - tab-widget in channel-track-window for setting up
|
||||
* effects
|
||||
* effect_view.h - view-component for an effect
|
||||
*
|
||||
* Copyright (c) 2006-2007 Danny McRae <khjklujn/at/users.sourceforge.net>
|
||||
* Copyright (c) 2007-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -23,13 +23,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _RACK_PLUGIN_H
|
||||
#define _RACK_PLUGIN_H
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
#ifndef _EFFECT_VIEW_H
|
||||
#define _EFFECT_VIEW_H
|
||||
|
||||
#include "automatable_model.h"
|
||||
|
||||
#include "plugin_view.h"
|
||||
|
||||
class QGroupBox;
|
||||
class QLabel;
|
||||
@@ -45,51 +43,44 @@ class tempoSyncKnob;
|
||||
class track;
|
||||
|
||||
|
||||
class rackPlugin: public QWidget, public journallingObject
|
||||
class effectView : public pluginView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
rackPlugin( QWidget * _parent, effect * _eff, track * _track,
|
||||
audioPort * _port );
|
||||
virtual ~rackPlugin();
|
||||
effectView( effect * _model, QWidget * _parent );
|
||||
virtual ~effectView();
|
||||
|
||||
inline effect * getEffect()
|
||||
inline effect * getEffect( void )
|
||||
{
|
||||
return( m_effect );
|
||||
return( castModel<effect>() );
|
||||
}
|
||||
inline const effect * getEffect( void ) const
|
||||
{
|
||||
return( castModel<effect>() );
|
||||
}
|
||||
|
||||
virtual void FASTCALL saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent );
|
||||
virtual void FASTCALL loadSettings( const QDomElement & _this );
|
||||
inline virtual QString nodeName( void ) const
|
||||
{
|
||||
return( "effect" );
|
||||
}
|
||||
|
||||
public slots:
|
||||
void editControls( void );
|
||||
void updateAutoQuit( void );
|
||||
/* void bypassChanged( void );
|
||||
void updateWetDry( void );
|
||||
void updateGate( void );*/
|
||||
void moveUp( void );
|
||||
void moveDown( void );
|
||||
void deletePlugin( void );
|
||||
void displayHelp( void );
|
||||
void closeEffects( void );
|
||||
|
||||
|
||||
signals:
|
||||
void moveUp( rackPlugin * _plugin );
|
||||
void moveDown( rackPlugin * _plugin );
|
||||
void deletePlugin( rackPlugin * _plugin );
|
||||
void moveUp( effectView * _plugin );
|
||||
void moveDown( effectView * _plugin );
|
||||
void deletePlugin( effectView * _plugin );
|
||||
|
||||
|
||||
protected:
|
||||
void contextMenuEvent( QContextMenuEvent * _me );
|
||||
|
||||
private:
|
||||
floatModel m_autoQuitModel;
|
||||
virtual void modelChanged( void );
|
||||
|
||||
|
||||
private:
|
||||
ledCheckBox * m_bypass;
|
||||
knob * m_wetDry;
|
||||
tempoSyncKnob * m_autoQuit;
|
||||
@@ -99,10 +90,7 @@ private:
|
||||
QLabel * m_label;
|
||||
QPushButton * m_editButton;
|
||||
QMdiSubWindow * m_subWindow;
|
||||
effect * m_effect;
|
||||
effectControlDialog * m_controlView;
|
||||
track * m_track;
|
||||
audioPort * m_port;
|
||||
bool m_show;
|
||||
|
||||
} ;
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
|
||||
#include "plugin.h"
|
||||
#include "mixer.h"
|
||||
#include "mv_base.h"
|
||||
|
||||
|
||||
// forward-declarations
|
||||
@@ -43,7 +42,7 @@ class notePlayHandle;
|
||||
class track;
|
||||
|
||||
|
||||
class instrument : public plugin, public model
|
||||
class instrument : public plugin
|
||||
{
|
||||
public:
|
||||
instrument( instrumentTrack * _instrument_track,
|
||||
@@ -117,8 +116,6 @@ public:
|
||||
|
||||
virtual bool isFromTrack( const track * _track ) const;
|
||||
|
||||
instrumentView * createEditor( QWidget * _parent );
|
||||
|
||||
|
||||
protected:
|
||||
inline instrumentTrack * getInstrumentTrack( void ) const
|
||||
@@ -131,38 +128,10 @@ protected:
|
||||
// desiredReleaseFrames() frames are left
|
||||
void applyRelease( sampleFrame * buf, const notePlayHandle * _n );
|
||||
|
||||
// instruments have to implement this to create an according view for
|
||||
// themselves
|
||||
virtual instrumentView * createView( QWidget * _parent ) = 0;
|
||||
|
||||
|
||||
private:
|
||||
instrumentTrack * m_instrumentTrack;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
class instrumentView : public QWidget, public modelView
|
||||
{
|
||||
public:
|
||||
instrumentView( instrument * _instrument, QWidget * _parent );
|
||||
virtual ~instrumentView();
|
||||
|
||||
instrument * model( void )
|
||||
{
|
||||
return( castModel<instrument>() );
|
||||
}
|
||||
|
||||
const instrument * model( void ) const
|
||||
{
|
||||
return( castModel<instrument>() );
|
||||
}
|
||||
|
||||
virtual void setModel( ::model * _model, bool = FALSE );
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* instrument_track.h - declaration of class instrumentTrack, a track + window
|
||||
* which holds an instrument-plugin
|
||||
*
|
||||
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -30,18 +30,20 @@
|
||||
#include <QtGui/QPushButton>
|
||||
#include <QtGui/QPainter>
|
||||
|
||||
#include "audio_port.h"
|
||||
#include "automatable_model.h"
|
||||
#include "lcd_spinbox.h"
|
||||
#include "midi_event_processor.h"
|
||||
#include "mixer.h"
|
||||
#include "effect_chain.h"
|
||||
#include "surround_area.h"
|
||||
#include "tab_widget.h"
|
||||
#include "track.h"
|
||||
|
||||
|
||||
class QLineEdit;
|
||||
class arpAndChordsTabWidget;
|
||||
class audioPort;
|
||||
class effectTabWidget;
|
||||
class effectRackView;
|
||||
class envelopeTabWidget;
|
||||
class fadeButton;
|
||||
class instrument;
|
||||
@@ -158,7 +160,7 @@ public:
|
||||
|
||||
inline audioPort * getAudioPort( void )
|
||||
{
|
||||
return( m_audioPort );
|
||||
return( &m_audioPort );
|
||||
}
|
||||
|
||||
intModel * baseNoteModel( void )
|
||||
@@ -207,7 +209,7 @@ private:
|
||||
|
||||
midiPort * m_midiPort;
|
||||
|
||||
audioPort * m_audioPort;
|
||||
audioPort m_audioPort;
|
||||
|
||||
|
||||
notePlayHandle * m_notes[NOTES_PER_OCTAVE * OCTAVES];
|
||||
@@ -237,7 +239,11 @@ private:
|
||||
envelopeTabWidget * m_envWidget;
|
||||
arpAndChordsTabWidget * m_arpWidget;
|
||||
midiTabWidget * m_midiWidget;
|
||||
effectTabWidget * m_effWidget;
|
||||
|
||||
pluginView * m_instrumentView;
|
||||
effectRackView * m_effectRack;
|
||||
|
||||
// effectChain m_effects;
|
||||
|
||||
// test-piano at the bottom of every instrument-settings-window
|
||||
pianoWidget * m_pianoWidget;
|
||||
|
||||
@@ -37,7 +37,7 @@ class QMdiArea;
|
||||
class QSplashScreen;
|
||||
|
||||
class configManager;
|
||||
class tool;
|
||||
class pluginView;
|
||||
class toolButton;
|
||||
|
||||
|
||||
@@ -155,8 +155,8 @@ private:
|
||||
bool m_alt;
|
||||
} m_keyMods;
|
||||
|
||||
QMenu * m_tools_menu;
|
||||
QList<tool *> m_tools;
|
||||
QMenu * m_toolsMenu;
|
||||
QList<pluginView *> m_tools;
|
||||
|
||||
bool m_modified;
|
||||
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
|
||||
#include <QtCore/QObject>
|
||||
|
||||
class modelView;
|
||||
|
||||
|
||||
class model : public QObject
|
||||
{
|
||||
@@ -71,8 +73,8 @@ signals:
|
||||
class modelView
|
||||
{
|
||||
public:
|
||||
modelView() :
|
||||
m_model( NULL )
|
||||
modelView( model * _model ) :
|
||||
m_model( _model )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <QtCore/QVector>
|
||||
|
||||
#include "journalling_object.h"
|
||||
#include "mv_base.h"
|
||||
#include "base64.h"
|
||||
|
||||
|
||||
@@ -42,8 +43,10 @@
|
||||
class QPixmap;
|
||||
class QWidget;
|
||||
|
||||
class pluginView;
|
||||
|
||||
class plugin : public journallingObject
|
||||
|
||||
class plugin : public journallingObject, public model
|
||||
{
|
||||
public:
|
||||
enum pluginTypes
|
||||
@@ -150,7 +153,7 @@ public:
|
||||
} ;
|
||||
|
||||
// contructor of a plugin
|
||||
plugin( const descriptor * _descriptor );
|
||||
plugin( const descriptor * _descriptor, model * _parent );
|
||||
virtual ~plugin();
|
||||
|
||||
// returns public-name out of descriptor
|
||||
@@ -184,6 +187,7 @@ public:
|
||||
// returns an instance of a plugin whose name matches to given one
|
||||
// if specified plugin couldn't be loaded, it creates a dummy-plugin
|
||||
static plugin * FASTCALL instantiate( const QString & _plugin_name,
|
||||
model * _parent,
|
||||
void * _data );
|
||||
|
||||
// some plugins run external programs for doing their actual work
|
||||
@@ -194,21 +198,29 @@ public:
|
||||
// of course isn't that efficient
|
||||
virtual bool supportsParallelizing( void ) const;
|
||||
|
||||
// plugins supporting parallelizing, should re-implement that as the
|
||||
// plugins supporting parallelization, should re-implement that as the
|
||||
// mixer will call this at the end of processing according chain
|
||||
// of plugins
|
||||
virtual void waitForWorkerThread( void );
|
||||
|
||||
|
||||
// fills given vector with descriptors of all available plugins
|
||||
static void FASTCALL getDescriptorsOfAvailPlugins(
|
||||
QVector<descriptor> & _plugin_descs );
|
||||
|
||||
// create a view for the model
|
||||
pluginView * createView( QWidget * _parent );
|
||||
|
||||
|
||||
protected:
|
||||
// create a view for the model
|
||||
virtual pluginView * instantiateView( QWidget * ) = 0;
|
||||
|
||||
|
||||
private:
|
||||
const descriptor * m_descriptor;
|
||||
|
||||
// pointer to instantiation-function in plugin
|
||||
typedef plugin * ( * instantiationHook )( void * );
|
||||
typedef plugin * ( * instantiationHook )( model *, void * );
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* sample_track.h - class sampleTrack, a track which provides arrangement of
|
||||
* samples
|
||||
*
|
||||
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -29,11 +29,11 @@
|
||||
|
||||
#include <QtGui/QDialog>
|
||||
|
||||
#include "audio_port.h"
|
||||
#include "track.h"
|
||||
#include "volume_knob.h"
|
||||
|
||||
class QLabel;
|
||||
class audioPort;
|
||||
class effectLabel;
|
||||
class sampleBuffer;
|
||||
|
||||
@@ -133,7 +133,7 @@ public:
|
||||
|
||||
inline audioPort * getAudioPort( void )
|
||||
{
|
||||
return( m_audioPort );
|
||||
return( &m_audioPort );
|
||||
}
|
||||
|
||||
virtual QString nodeName( void ) const
|
||||
@@ -144,7 +144,7 @@ public:
|
||||
|
||||
private:
|
||||
effectLabel * m_trackLabel;
|
||||
audioPort * m_audioPort;
|
||||
audioPort m_audioPort;
|
||||
|
||||
volumeKnob * m_volumeKnob;
|
||||
knobModel m_volumeModel;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* tab_widget.h - LMMS-tabwidget
|
||||
*
|
||||
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -35,10 +35,9 @@ class tabWidget : public QWidget
|
||||
Q_OBJECT
|
||||
public:
|
||||
tabWidget( const QString & _caption, QWidget * _parent );
|
||||
~tabWidget();
|
||||
virtual ~tabWidget();
|
||||
|
||||
void addTab( QWidget * _w, const QString & _name,
|
||||
int _idx = -1 );
|
||||
void addTab( QWidget * _w, const QString & _name, int _idx = -1 );
|
||||
|
||||
void setActiveTab( int _idx );
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* tool.h - declaration of class tool, standard interface for all tool plugins
|
||||
*
|
||||
* Copyright (c) 2006-2007 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
|
||||
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -26,24 +27,31 @@
|
||||
#ifndef _TOOL_H
|
||||
#define _TOOL_H
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
#include "plugin.h"
|
||||
#include "plugin_view.h"
|
||||
|
||||
|
||||
class tool : public QWidget, public plugin
|
||||
class tool : public plugin
|
||||
{
|
||||
public:
|
||||
tool( const descriptor * _descriptor );
|
||||
tool( const descriptor * _descriptor, model * _parent );
|
||||
virtual ~tool();
|
||||
|
||||
// instantiate tool-plugin with given name or return NULL
|
||||
// on failure
|
||||
static tool * FASTCALL instantiate( const QString & _plugin_name );
|
||||
static tool * FASTCALL instantiate( const QString & _plugin_name,
|
||||
model * _parent );
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
class toolView : public pluginView
|
||||
{
|
||||
public:
|
||||
toolView( tool * _tool, QWidget * _parent );
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user