--- linuxsampler/trunk/src/engines/AbstractEngineChannel.cpp 2012/03/04 09:01:40 2325 +++ linuxsampler/trunk/src/engines/AbstractEngineChannel.cpp 2012/03/08 19:40:14 2326 @@ -191,6 +191,17 @@ return (pEngine) ? pEngine->pAudioOutputDevice : NULL; } + /** + * Gets thread safe access to the currently connected audio output + * device from other threads than the lscp thread. + */ + AudioOutputDevice* AbstractEngineChannel::GetAudioOutputDeviceSafe() { + EngineMutex.Lock(); + AudioOutputDevice* res = GetAudioOutputDevice(); + EngineMutex.Unlock(); + return res; + } + void AbstractEngineChannel::SetOutputChannel(uint EngineAudioChannel, uint AudioDeviceChannel) { if (!pEngine || !pEngine->pAudioOutputDevice) throw AudioOutputException("No audio output device connected yet.");