implemented parallelization of FX-channel-processing

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@887 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-04-04 16:55:47 +00:00
parent ed7bbe04a3
commit f8369195a0
2 changed files with 27 additions and 9 deletions

View File

@@ -1,5 +1,8 @@
2008-04-04 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
* src/core/mixer.cpp:
implemented parallelization of FX-channel-processing
* include/automatable_model.h:
* include/automatable_model_templates.h:
cleanups and optimizations in value( int )

View File

@@ -147,8 +147,9 @@ private:
m_idle = FALSE;
m_sem->acquire();
m_jobAccepted.release();
for( jobQueueItems::iterator it = m_jobQueue->items.begin();
it != m_jobQueue->items.end(); ++it )
for( jobQueueItems::iterator it =
m_jobQueue->items.begin();
it != m_jobQueue->items.end(); ++it )
{
m_jobQueue->lock.lock();
if( !it->done )
@@ -161,7 +162,7 @@ private:
( (playHandle *) it->job )->play();
break;
case AudioPortEffects:
{
{
audioPort * a = (audioPort *) it->job;
bool me = a->processEffects();
if( a->m_bufferUsage != audioPort::NoUsage || me )
@@ -170,8 +171,11 @@ private:
a->nextFxChannel() );
a->nextPeriod();
}
}
}
break;
case EffectChannel:
engine::getFxMixer()->processChannel(
(fx_ch_t) (int) it->job );
default:
break;
}
@@ -333,7 +337,7 @@ bool mixer::criticalXRuns( void ) const
{ \
_jq.items.push_back( \
mixerWorkerThread::jobQueueItem( _job_type, \
*it ) );\
(void *)*it ) );\
} \
}
@@ -504,6 +508,17 @@ if( COND_NPH )
mixerWorkerThread::AudioPortEffects,1);
DISTRIBUTE_JOB_QUEUE(jq);
WAIT_FOR_JOBS();
jq.items.clear();
QVector<fx_ch_t> fx_channels( NumFxChannels );
for( int i = 1; i < NumFxChannels+1; ++i )
{
fx_channels[i-1] = i;
}
FILL_JOB_QUEUE(jq,QVector<fx_ch_t>,fx_channels,
mixerWorkerThread::EffectChannel,1);
DISTRIBUTE_JOB_QUEUE(jq);
WAIT_FOR_JOBS();
}
else
{
@@ -523,10 +538,10 @@ if( COND_NPH )
( *it )->nextPeriod();
}
}
}
for( int i = 1; i < NumFxChannels+1; ++i )
{
engine::getFxMixer()->processChannel( i );
for( int i = 1; i < NumFxChannels+1; ++i )
{
engine::getFxMixer()->processChannel( i );
}
}
const surroundSampleFrame * buf =
engine::getFxMixer()->masterMix();