lock audioPort-buffers before writing them
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/branches/lmms-mv@725 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
@@ -27,6 +27,8 @@
|
||||
#define _AUDIO_PORT_H
|
||||
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QMutex>
|
||||
#include <QtCore/QMutexLocker>
|
||||
|
||||
#include "effect_chain.h"
|
||||
|
||||
@@ -46,6 +48,26 @@ public:
|
||||
return( m_secondBuffer );
|
||||
}
|
||||
|
||||
inline void lockFirstBuffer( void )
|
||||
{
|
||||
m_firstBufferLock.lock();
|
||||
}
|
||||
|
||||
inline void lockSecondBuffer( void )
|
||||
{
|
||||
m_secondBufferLock.lock();
|
||||
}
|
||||
|
||||
inline void unlockFirstBuffer( void )
|
||||
{
|
||||
m_firstBufferLock.unlock();
|
||||
}
|
||||
|
||||
inline void unlockSecondBuffer( void )
|
||||
{
|
||||
m_secondBufferLock.unlock();
|
||||
}
|
||||
|
||||
void nextPeriod( void );
|
||||
|
||||
|
||||
@@ -85,11 +107,14 @@ public:
|
||||
|
||||
enum bufferUsages
|
||||
{
|
||||
NONE, FIRST, BOTH
|
||||
NoUsage,
|
||||
FirstBuffer,
|
||||
BothBuffers
|
||||
} m_bufferUsage;
|
||||
|
||||
inline bool processEffects( void )
|
||||
{
|
||||
QMutexLocker m( &m_firstBufferLock );
|
||||
return( m_effects.processAudioBuffer( m_firstBuffer,
|
||||
m_frames ) );
|
||||
}
|
||||
@@ -97,6 +122,9 @@ public:
|
||||
private:
|
||||
surroundSampleFrame * m_firstBuffer;
|
||||
surroundSampleFrame * m_secondBuffer;
|
||||
QMutex m_firstBufferLock;
|
||||
QMutex m_secondBufferLock;
|
||||
|
||||
bool m_extOutputEnabled;
|
||||
fx_ch_t m_nextFxChannel;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user