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:
@@ -216,7 +216,7 @@ Uint32 audioFileProcessor::getBeatLen( notePlayHandle * _n ) const
|
||||
|
||||
|
||||
|
||||
instrumentView * audioFileProcessor::createView( QWidget * _parent )
|
||||
pluginView * audioFileProcessor::instantiateView( QWidget * _parent )
|
||||
{
|
||||
return( new audioFileProcessorView( this, _parent ) );
|
||||
}
|
||||
@@ -600,7 +600,7 @@ extern "C"
|
||||
{
|
||||
|
||||
// neccessary for getting instance out of shared lib
|
||||
plugin * lmms_plugin_main( void * _data )
|
||||
plugin * lmms_plugin_main( model *, void * _data )
|
||||
{
|
||||
return( new audioFileProcessor(
|
||||
static_cast<instrumentTrack *>( _data ) ) );
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <QtGui/QPixmap>
|
||||
|
||||
#include "instrument.h"
|
||||
#include "instrument_view.h"
|
||||
#include "sample_buffer.h"
|
||||
#include "volume_knob.h"
|
||||
#include "pixmap_button.h"
|
||||
@@ -73,7 +74,7 @@ public:
|
||||
return( 128 );
|
||||
}
|
||||
|
||||
virtual instrumentView * createView( QWidget * _parent );
|
||||
virtual pluginView * instantiateView( QWidget * _parent );
|
||||
|
||||
|
||||
public slots:
|
||||
|
||||
@@ -51,9 +51,9 @@ plugin::descriptor bassbooster_plugin_descriptor =
|
||||
|
||||
|
||||
|
||||
bassBoosterEffect::bassBoosterEffect(
|
||||
bassBoosterEffect::bassBoosterEffect( model * _parent,
|
||||
const descriptor::subPluginFeatures::key * _key ) :
|
||||
effect( &bassbooster_plugin_descriptor, _key ),
|
||||
effect( &bassbooster_plugin_descriptor, _parent, _key ),
|
||||
m_bbFX( effectLib::fastBassBoost<>( 70.0f, 1.0f, 2.8f ) )
|
||||
{
|
||||
}
|
||||
@@ -71,7 +71,7 @@ bassBoosterEffect::~bassBoosterEffect()
|
||||
bool FASTCALL bassBoosterEffect::processAudioBuffer( surroundSampleFrame * _buf,
|
||||
const fpp_t _frames )
|
||||
{
|
||||
if( isBypassed() || !isRunning () )
|
||||
if( !isEnabled() || !isRunning () )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
@@ -114,9 +114,9 @@ extern "C"
|
||||
{
|
||||
|
||||
// neccessary for getting instance out of shared lib
|
||||
plugin * lmms_plugin_main( void * _data )
|
||||
plugin * lmms_plugin_main( model * _parent, void * _data )
|
||||
{
|
||||
return( new bassBoosterEffect(
|
||||
return( new bassBoosterEffect( _parent,
|
||||
static_cast<const plugin::descriptor::subPluginFeatures::key *>(
|
||||
_data ) ) );
|
||||
}
|
||||
|
||||
@@ -40,7 +40,8 @@
|
||||
class bassBoosterEffect : public effect
|
||||
{
|
||||
public:
|
||||
bassBoosterEffect( const descriptor::subPluginFeatures::key * _key );
|
||||
bassBoosterEffect( model * _parent,
|
||||
const descriptor::subPluginFeatures::key * _key );
|
||||
virtual ~bassBoosterEffect();
|
||||
virtual bool FASTCALL processAudioBuffer( surroundSampleFrame * _buf,
|
||||
const fpp_t _frames );
|
||||
|
||||
@@ -178,7 +178,7 @@ void kickerInstrument::deleteNotePluginData( notePlayHandle * _n )
|
||||
|
||||
|
||||
|
||||
instrumentView * kickerInstrument::createView( QWidget * _parent )
|
||||
pluginView * kickerInstrument::instantiateView( QWidget * _parent )
|
||||
{
|
||||
return( new kickerInstrumentView( this, _parent ) );
|
||||
}
|
||||
@@ -255,7 +255,7 @@ extern "C"
|
||||
{
|
||||
|
||||
// neccessary for getting instance out of shared lib
|
||||
plugin * lmms_plugin_main( void * _data )
|
||||
plugin * lmms_plugin_main( model *, void * _data )
|
||||
{
|
||||
return( new kickerInstrument(
|
||||
static_cast<instrumentTrack *>( _data ) ) );
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#define _KICKER_H
|
||||
|
||||
#include "instrument.h"
|
||||
#include "instrument_view.h"
|
||||
#include "knob.h"
|
||||
|
||||
|
||||
@@ -56,7 +57,7 @@ public:
|
||||
return( 512 );
|
||||
}
|
||||
|
||||
virtual instrumentView * createView( QWidget * _parent );
|
||||
virtual pluginView * instantiateView( QWidget * _parent );
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* ladspa_browser.cpp - dialog to display information about installed LADSPA
|
||||
* plugins
|
||||
*
|
||||
* Copyright (c) 2006-2007 Danny McRae <khjklujn/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2008 Danny McRae <khjklujn/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -73,7 +73,32 @@ plugin * lmms_plugin_main( void * _data )
|
||||
|
||||
|
||||
ladspaBrowser::ladspaBrowser( void ) :
|
||||
tool( &ladspa_browser_plugin_descriptor )
|
||||
tool( &ladspa_browser_plugin_descriptor, NULL )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
ladspaBrowser::~ladspaBrowser()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
QString ladspaBrowser::nodeName( void ) const
|
||||
{
|
||||
return( ladspa_browser_plugin_descriptor.name );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ladspaBrowserView::ladspaBrowserView( tool * _tool, QWidget * _parent ) :
|
||||
toolView( _tool, _parent )
|
||||
{
|
||||
QHBoxLayout * hlayout = new QHBoxLayout( this );
|
||||
hlayout->setSpacing( 0 );
|
||||
@@ -160,22 +185,14 @@ ladspaBrowser::ladspaBrowser( void ) :
|
||||
|
||||
|
||||
|
||||
ladspaBrowser::~ladspaBrowser()
|
||||
ladspaBrowserView::~ladspaBrowserView()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
QString ladspaBrowser::nodeName( void ) const
|
||||
{
|
||||
return( ladspa_browser_plugin_descriptor.name );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
QWidget * ladspaBrowser::createTab( QWidget * _parent, const QString & _txt,
|
||||
QWidget * ladspaBrowserView::createTab( QWidget * _parent, const QString & _txt,
|
||||
ladspaPluginType _type )
|
||||
{
|
||||
QWidget * tab = new QWidget( _parent );
|
||||
@@ -205,7 +222,7 @@ QWidget * ladspaBrowser::createTab( QWidget * _parent, const QString & _txt,
|
||||
|
||||
|
||||
|
||||
void ladspaBrowser::showPorts( const ladspa_key_t & _key )
|
||||
void ladspaBrowserView::showPorts( const ladspa_key_t & _key )
|
||||
{
|
||||
ladspaPortDialog ports( _key );
|
||||
ports.exec();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* ladspa_browser.h - dialog to display information about installed LADSPA
|
||||
* plugins
|
||||
*
|
||||
* Copyright (c) 2006-2007 Danny McRae <khjklujn/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2008 Danny McRae <khjklujn/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -35,14 +35,12 @@
|
||||
class tabBar;
|
||||
|
||||
|
||||
class ladspaBrowser : public tool
|
||||
class ladspaBrowserView : public toolView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ladspaBrowser( void );
|
||||
virtual ~ladspaBrowser();
|
||||
|
||||
virtual QString nodeName( void ) const;
|
||||
ladspaBrowserView( tool * _tool, QWidget * _parent );
|
||||
virtual ~ladspaBrowserView();
|
||||
|
||||
|
||||
public slots:
|
||||
@@ -59,4 +57,20 @@ private:
|
||||
} ;
|
||||
|
||||
|
||||
class ladspaBrowser : public tool
|
||||
{
|
||||
public:
|
||||
ladspaBrowser( void );
|
||||
virtual ~ladspaBrowser();
|
||||
|
||||
virtual pluginView * instantiateView( QWidget * _parent )
|
||||
{
|
||||
return( new ladspaBrowserView( this, _parent ) );
|
||||
}
|
||||
|
||||
virtual QString nodeName( void ) const;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -59,8 +59,9 @@ plugin::descriptor ladspaeffect_plugin_descriptor =
|
||||
}
|
||||
|
||||
|
||||
ladspaEffect::ladspaEffect( const descriptor::subPluginFeatures::key * _key ) :
|
||||
effect( &ladspaeffect_plugin_descriptor, _key ),
|
||||
ladspaEffect::ladspaEffect( model * _parent,
|
||||
const descriptor::subPluginFeatures::key * _key ) :
|
||||
effect( &ladspaeffect_plugin_descriptor, _parent, _key ),
|
||||
m_effName( "none" ),
|
||||
m_key( ladspaSubPluginFeatures::subPluginKeyToLadspaKey( _key )
|
||||
/* ladspa_key_t( _cdata->settings.attribute( "label" ),
|
||||
@@ -464,15 +465,13 @@ void FASTCALL ladspaEffect::setControl( Uint16 _control, LADSPA_Data _value )
|
||||
}
|
||||
|
||||
|
||||
#undef indexOf
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
// neccessary for getting instance out of shared lib
|
||||
plugin * lmms_plugin_main( void * _data )
|
||||
plugin * lmms_plugin_main( model * _parent, void * _data )
|
||||
{
|
||||
return( new ladspaEffect(
|
||||
return( new ladspaEffect( _parent,
|
||||
static_cast<const plugin::descriptor::subPluginFeatures::key *>(
|
||||
_data ) ) );
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* ladspa_effect.h - class for handling LADSPA effect plugins
|
||||
*
|
||||
* Copyright (c) 2006-2007 Danny McRae <khjklujn/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2008 Danny McRae <khjklujn/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -41,7 +41,8 @@ typedef QVector<port_desc_t *> multi_proc_t;
|
||||
class ladspaEffect : public effect
|
||||
{
|
||||
public:
|
||||
ladspaEffect( const descriptor::subPluginFeatures::key * _key );
|
||||
ladspaEffect( model * _parent,
|
||||
const descriptor::subPluginFeatures::key * _key );
|
||||
virtual ~ladspaEffect();
|
||||
|
||||
virtual bool FASTCALL processAudioBuffer( surroundSampleFrame * _buf,
|
||||
@@ -84,7 +85,7 @@ private:
|
||||
Uint16 m_effectChannels;
|
||||
Uint16 m_portCount;
|
||||
fpp_t m_bufferSize;
|
||||
|
||||
|
||||
const LADSPA_Descriptor * m_descriptor;
|
||||
QVector<LADSPA_Handle> m_handles;
|
||||
|
||||
|
||||
@@ -58,8 +58,8 @@ plugin::descriptor malletsstk_plugin_descriptor =
|
||||
}
|
||||
|
||||
|
||||
malletsInstrument::malletsInstrument( instrumentTrack * _channel_track ):
|
||||
instrument( _channel_track, &malletsstk_plugin_descriptor ),
|
||||
malletsInstrument::malletsInstrument( instrumentTrack * _instrument_track ):
|
||||
instrument( _instrument_track, &malletsstk_plugin_descriptor ),
|
||||
m_hardnessModel(64.0f, 0.0f, 128.0f, 0.1f, this),
|
||||
m_positionModel(64.0f, 0.0f, 128.0f, 0.1f, this),
|
||||
m_vibratoGainModel(64.0f, 0.0f, 128.0f, 0.1f, this),
|
||||
@@ -77,21 +77,21 @@ malletsInstrument::malletsInstrument( instrumentTrack * _channel_track ):
|
||||
m_presetsModel(this),
|
||||
m_spreadModel(0, 0, 255, 1, this)
|
||||
{
|
||||
m_hardnessModel.setTrack( _channel_track );
|
||||
m_positionModel.setTrack( _channel_track );
|
||||
m_vibratoGainModel.setTrack( _channel_track );
|
||||
m_vibratoFreqModel.setTrack( _channel_track );
|
||||
m_stickModel.setTrack( _channel_track );
|
||||
m_modulatorModel.setTrack( _channel_track );
|
||||
m_crossfadeModel.setTrack( _channel_track );
|
||||
m_lfoSpeedModel.setTrack( _channel_track );
|
||||
m_lfoDepthModel.setTrack( _channel_track );
|
||||
m_adsrModel.setTrack( _channel_track );
|
||||
m_pressureModel.setTrack( _channel_track );
|
||||
m_motionModel.setTrack( _channel_track );
|
||||
m_velocityModel.setTrack( _channel_track );
|
||||
m_strikeModel.setTrack( _channel_track );
|
||||
m_spreadModel.setTrack( _channel_track );
|
||||
m_hardnessModel.setTrack( _instrument_track );
|
||||
m_positionModel.setTrack( _instrument_track );
|
||||
m_vibratoGainModel.setTrack( _instrument_track );
|
||||
m_vibratoFreqModel.setTrack( _instrument_track );
|
||||
m_stickModel.setTrack( _instrument_track );
|
||||
m_modulatorModel.setTrack( _instrument_track );
|
||||
m_crossfadeModel.setTrack( _instrument_track );
|
||||
m_lfoSpeedModel.setTrack( _instrument_track );
|
||||
m_lfoDepthModel.setTrack( _instrument_track );
|
||||
m_adsrModel.setTrack( _instrument_track );
|
||||
m_pressureModel.setTrack( _instrument_track );
|
||||
m_motionModel.setTrack( _instrument_track );
|
||||
m_velocityModel.setTrack( _instrument_track );
|
||||
m_strikeModel.setTrack( _instrument_track );
|
||||
m_spreadModel.setTrack( _instrument_track );
|
||||
|
||||
// ModalBar
|
||||
m_presetsModel.addItem( tr( "Marimba" ) );
|
||||
@@ -299,7 +299,7 @@ void malletsInstrument::deleteNotePluginData( notePlayHandle * _n )
|
||||
|
||||
|
||||
|
||||
instrumentView * malletsInstrument::createView( QWidget * _parent )
|
||||
pluginView * malletsInstrument::instantiateView( QWidget * _parent )
|
||||
{
|
||||
return( new malletsInstrumentView( this, _parent ) );
|
||||
}
|
||||
@@ -307,7 +307,8 @@ instrumentView * malletsInstrument::createView( QWidget * _parent )
|
||||
|
||||
|
||||
|
||||
malletsInstrumentView::malletsInstrumentView( malletsInstrument * _instrument, QWidget * _parent ) :
|
||||
malletsInstrumentView::malletsInstrumentView( malletsInstrument * _instrument,
|
||||
QWidget * _parent ) :
|
||||
instrumentView( _instrument, _parent )
|
||||
{
|
||||
_instrument->m_filesMissing =
|
||||
@@ -673,7 +674,7 @@ extern "C"
|
||||
{
|
||||
|
||||
// neccessary for getting instance out of shared lib
|
||||
plugin * lmms_plugin_main( void * _data )
|
||||
plugin * lmms_plugin_main( model *, void * _data )
|
||||
{
|
||||
return( new malletsInstrument( static_cast<instrumentTrack *>( _data ) ) );
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
|
||||
#include "combobox.h"
|
||||
#include "instrument.h"
|
||||
#include "instrument_view.h"
|
||||
#include "knob.h"
|
||||
#include "note_play_handle.h"
|
||||
#include "led_checkbox.h"
|
||||
@@ -133,7 +134,7 @@ public:
|
||||
|
||||
virtual QString nodeName( void ) const;
|
||||
|
||||
virtual instrumentView * createView( QWidget * _parent );
|
||||
virtual pluginView * instantiateView( QWidget * _parent );
|
||||
|
||||
private:
|
||||
knobModel m_hardnessModel;
|
||||
|
||||
@@ -82,7 +82,7 @@ vstEffect::~vstEffect()
|
||||
bool FASTCALL vstEffect::processAudioBuffer( surroundSampleFrame * _buf,
|
||||
const fpp_t _frames )
|
||||
{
|
||||
if( isBypassed() || !isRunning () )
|
||||
if( !isEnabled() || !isRunning () )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user