From 49cdd498c35f9ed0dad9b7479e0084102a8580cf Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sun, 7 Sep 2008 22:35:58 +0000 Subject: [PATCH] * apply release of 128 frames * enable loop mode per default git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1580 0778d3d1-df1d-0410-868b-ea421aaaa00d --- plugins/patman/patman.cpp | 37 +++++++------------------------------ plugins/patman/patman.h | 23 ++++++----------------- 2 files changed, 13 insertions(+), 47 deletions(-) diff --git a/plugins/patman/patman.cpp b/plugins/patman/patman.cpp index fbb51b468..0f3b8dde0 100644 --- a/plugins/patman/patman.cpp +++ b/plugins/patman/patman.cpp @@ -58,8 +58,8 @@ plugin::descriptor PLUGIN_EXPORT patman_plugin_descriptor = 0x0100, plugin::Instrument, new pluginPixmapLoader( "logo" ), - NULL, - new patmanInstrument::subPluginFeatures( plugin::Instrument ) + "pat", + NULL } ; @@ -77,8 +77,8 @@ plugin * PLUGIN_EXPORT lmms_plugin_main( model *, void * _data ) patmanInstrument::patmanInstrument( instrumentTrack * _instrument_track ) : instrument( _instrument_track, &patman_plugin_descriptor ), m_patchFile( QString::null ), - m_loopedModel( FALSE, this ), - m_tunedModel( TRUE, this ) + m_loopedModel( true, this ), + m_tunedModel( true, this ) { } @@ -113,13 +113,9 @@ void patmanInstrument::loadSettings( const QDomElement & _this ) -void patmanInstrument::setParameter( const QString & _param, - const QString & _value ) +void patmanInstrument::loadFile( const QString & _file ) { - if( _param == "samplefile" ) - { - setFile( _value ); - } + setFile( _file ); } @@ -155,6 +151,7 @@ void patmanInstrument::playNote( notePlayHandle * _n, bool, if( hdata->sample->play( _working_buffer, hdata->state, frames, play_freq, m_loopedModel.value() ) ) { + applyRelease( _working_buffer, _n ); getInstrumentTrack()->processAudioBuffer( _working_buffer, frames, _n ); } @@ -656,24 +653,4 @@ void patmanView::modelChanged( void ) - -patmanInstrument::subPluginFeatures::subPluginFeatures( - plugin::PluginTypes _type ) : - plugin::descriptor::subPluginFeatures( _type ) -{ -} - - - - -const QStringList & patmanInstrument::subPluginFeatures::supported_extensions( - void ) -{ - static QStringList extension( "pat" ); - return( extension ); -} - - - - #include "moc_patman.cxx" diff --git a/plugins/patman/patman.h b/plugins/patman/patman.h index 4bc77be5e..541038230 100644 --- a/plugins/patman/patman.h +++ b/plugins/patman/patman.h @@ -50,21 +50,6 @@ class patmanInstrument : public instrument { Q_OBJECT public: - class subPluginFeatures : public plugin::descriptor::subPluginFeatures - { - public: - subPluginFeatures( plugin::PluginTypes _type ); - - virtual const QStringList & supportedExtensions( void ) - { - return( supported_extensions() ); - } - - static const QStringList & supported_extensions( void ); - - } ; - - patmanInstrument( instrumentTrack * _track ); virtual ~patmanInstrument(); @@ -76,11 +61,15 @@ public: virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); virtual void loadSettings( const QDomElement & _this ); - virtual void setParameter( const QString & _param, - const QString & _value ); + virtual void loadFile( const QString & _file ); virtual QString nodeName( void ) const; + virtual f_cnt_t desiredReleaseFrames( void ) const + { + return( 128 ); + } + virtual pluginView * instantiateView( QWidget * _parent );