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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user