* 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
This commit is contained in:
Tobias Doerffel
2008-09-07 22:35:58 +00:00
parent 8c3adbdc34
commit 49cdd498c3
2 changed files with 13 additions and 47 deletions

View File

@@ -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"

View File

@@ -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 );