added simple way for plugins to process at lower sample-rates

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@967 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-05-13 17:44:00 +00:00
parent 5f2b5500a4
commit c9d55d262b
2 changed files with 81 additions and 0 deletions

View File

@@ -173,8 +173,36 @@ public:
protected:
virtual pluginView * instantiateView( QWidget * );
// some effects might not be capable of higher sample-rates so they can
// sample it down before processing and back after processing
inline void sampleDown( const sampleFrame * _src_buf,
sampleFrame * _dst_buf,
sample_rate_t _dst_sr )
{
resample( 0, _src_buf,
engine::getMixer()->processingSampleRate(),
_dst_buf, _dst_sr,
engine::getMixer()->framesPerPeriod() );
}
inline void sampleBack( const sampleFrame * _src_buf,
sampleFrame * _dst_buf,
sample_rate_t _src_sr )
{
resample( 1, _src_buf, _src_sr, _dst_buf,
engine::getMixer()->processingSampleRate(),
engine::getMixer()->framesPerPeriod() * _src_sr /
engine::getMixer()->processingSampleRate() );
}
void reinitSRC( void );
private:
void resample( int _i, const sampleFrame * _src_buf,
sample_rate_t _src_sr,
sampleFrame * _dst_buf, sample_rate_t _dst_sr,
const fpp_t _frames );
descriptor::subPluginFeatures::key m_key;
ch_cnt_t m_processors;
@@ -189,6 +217,9 @@ private:
floatModel m_gateModel;
tempoSyncKnobModel m_autoQuitModel;
SRC_DATA m_srcData[2];
SRC_STATE * m_srcState[2];
friend class effectView;
friend class effectChain;