MSVC 14 compat and removing ITA atomic types and replacing them with c++11 atomics

parent 9360463a
......@@ -23,12 +23,12 @@
#include <ITACriticalSection.h>
#include <ITASampleBuffer.h>
#include <ITAAtomicPrimitives.h>
#include <VistaInterProcComm/Concurrency/VistaThreadEvent.h>
#include <tbb/concurrent_queue.h>
#include <atomic>
#include <map>
#include <string>
#include <vector>
......@@ -182,7 +182,7 @@ private:
tbb::concurrent_queue<CAudioSignalSource*> m_qpNewSources; //!< Lock-free queue: New sources
tbb::concurrent_queue<CAudioSignalSource*> m_qpDelReqSources; //!< Lock-free queue: Request delete sources
ITAAtomicInt m_iStreamCounter; //!< Counts the number of processed stream blocks
std::atomic< int > m_iStreamCounter; //!< Counts the number of processed stream blocks
VistaThreadEvent m_evStreamCounterInc; //!< Event: Stream counter incremented
//! Signal source find by ID
......
......@@ -16,11 +16,11 @@
#include <VAAudioSignalSource.h>
#include <ITAAtomicPrimitives.h>
#include <ITADataSourceDelegator.h>
#include <ITASampleBuffer.h>
#include <ITASampleFrame.h>
#include <atomic>
#include <string>
class ITABufferDatasource;
......@@ -57,8 +57,8 @@ public:
private:
IVAInterface* m_pAssociatedCore;
ITABufferDatasource* m_pBufferDataSource;
ITAAtomicInt m_iCurrentPlayState;
ITAAtomicInt m_iRequestedPlaybackAction; //!< User-triggered playback action
std::atomic< int > m_iCurrentPlayState;
std::atomic< int > m_iRequestedPlaybackAction; //!< User-triggered playback action
ITASampleBuffer m_sbOutBuffer;
ITASampleFrame m_sfAudioBuffer; //!< Audio buffer with multiple channels for smooth switching on update
int m_iActiveAudioBufferChannel;
......
......@@ -19,8 +19,8 @@
#include <ITADataSourceRealization.h>
#include <ITASampleBuffer.h>
#include <ITAAtomicPrimitives.h>
#include <atomic>
#include <map>
class CVACoreImpl;
......@@ -62,7 +62,7 @@ private:
Config m_oConfig;
ITASampleBuffer m_sbBuffer;
std::map< double, double > m_lFreqModesPhase;
ITAAtomicFloat m_fK; // engine number
std::atomic< float > m_fK; // engine number
};
#endif // IW_VACORE_ENGINESIGNALSOURCE
......@@ -246,7 +246,8 @@ void CVAMachineSignalSource::HandleUnregistration( IVAInterface* )
std::string CVAMachineSignalSource::GetStateString() const
{
return GetMachineStateString( MachineState( m_iCurrentState.get() ) );
MachineState iState = (MachineState) (int) m_iCurrentState;
return GetMachineStateString( iState );
}
std::string CVAMachineSignalSource::GetMachineStateString( MachineState iState ) const
......
......@@ -19,7 +19,8 @@
#include <ITADataSourceRealization.h>
#include <ITASampleBuffer.h>
#include <ITAAtomicPrimitives.h>
#include <atomic>
class CVACoreImpl;
class IITASampleInterpolationRoutine;
......@@ -145,15 +146,15 @@ private:
ITASampleBuffer m_sbIdleSound, m_sbIdleSoundNew;
ITASampleBuffer m_sbStopSound, m_sbStopSoundNew;
ITASampleBuffer m_sbInterpolationSrc;
ITAAtomicBool m_bStartSoundNew, m_bIdleSoundNew, m_bStopSoundNew;
std::atomic< bool > m_bStartSoundNew, m_bIdleSoundNew, m_bStopSoundNew;
ITASampleBuffer m_sbOut;
ITAAtomicInt m_iCurrentState;
ITAAtomicInt m_iNewTransition;
ITAAtomicFloat m_fMachineSpeed;
ITAAtomicBool m_bHasStartSound;
ITAAtomicBool m_bHasIdleSound;
ITAAtomicBool m_bHasStopSound;
ITAAtomicBool m_bCrossfadeSounds;
std::atomic< int > m_iCurrentState;
std::atomic< int > m_iNewTransition;
std::atomic< float > m_fMachineSpeed;
std::atomic< bool > m_bHasStartSound;
std::atomic< bool > m_bHasIdleSound;
std::atomic< bool > m_bHasStopSound;
std::atomic< bool > m_bCrossfadeSounds;
int m_iStartingSoundCursor;
int m_iIdlingSoundCursor;
......
......@@ -22,8 +22,8 @@
#include <ITADataSourceRealization.h>
#include <ITASampleBuffer.h>
#include <ITAAudioSample.h>
#include <ITAAtomicPrimitives.h>
#include <atomic>
#include <unordered_set>
class ITABufferDatasource;
......@@ -137,7 +137,7 @@ private:
ITASampleBuffer m_sbOut;
//this mutable keyword here is necessary since the inherited method GetParameters() is const, however we want to be able to change some parts (not very clean code, sorry)
ITAAtomicInt m_iCurrentPlayState;
std::atomic< int > m_iCurrentPlayState;
ITABufferDatasource* m_pBufferDataSource;
ITASampleFrame* m_pFrameToDelete;//this is set if the sample should be freed after playback
......
......@@ -17,13 +17,14 @@
#include "VAAudioDriverBackend.h"
#include "VAAudioDriverConfig.h"
#include <ITAAtomicPrimitives.h>
#include <ITAException.h>
#include <ITAStreamProperties.h>
#include <VistaInterProcComm/Concurrency/VistaThreadLoop.h>
#include <VistaInterProcComm/Concurrency/VistaThreadEvent.h>
#include <atomic>
/**
* Diese Klasse implementiert die Schnittstelle IVAAudioDriverArchBackend
* fr ASIO mittels des ITAsioInterface
......@@ -91,7 +92,7 @@ private:
};
CVAASIOBackend* m_pParent;
ITAAtomicInt m_iOperation;
std::atomic< int > m_iOperation;
int m_iResult;
ITAException m_oException;
VistaThreadEvent m_evStart;
......@@ -107,7 +108,7 @@ private:
MediatorThread* m_pMediator;
CVAAudioDriverConfig* m_pConfig;
ITAStreamProperties m_oOutputStreamProps;
ITAAtomicBool m_bStreaming;
std::atomic< bool > m_bStreaming;
};
#endif // IW_VACORE_ASIOBACKEND
......@@ -17,12 +17,13 @@
#include "VAAudioDriverBackend.h"
#include "VAAudioDriverConfig.h"
#include <ITAAtomicPrimitives.h>
#include <ITAException.h>
#include <ITAStreamProperties.h>
#include <VistaInterProcComm/Concurrency/VistaThreadLoop.h>
#include <VistaInterProcComm/Concurrency/VistaThreadEvent.h>
#include <atomic>
class ITAPortaudioInterface;
//! VA Portaudio Backend Klasse
......@@ -83,7 +84,7 @@ private:
CVAPortaudioBackend* m_pParent;
ITAPortaudioInterface* m_pPA;
ITAAtomicInt m_iOperation;
std::atomic< int > m_iOperation;
int m_iResult;
ITAException m_oException;
VistaThreadEvent m_evStart;
......@@ -100,7 +101,7 @@ private:
ITAPortaudioInterface* m_pITAPA;
CVAAudioDriverConfig* m_pConfig;
ITAStreamProperties m_oOutputStreamProps;
ITAAtomicBool m_bStreaming;
std::atomic< bool > m_bStreaming;
};
#endif // IW_VACORE_PORTAUDIOBACKEND
......@@ -74,7 +74,8 @@ private:
CVASceneState* m_pNewSceneState;
CVASceneState* m_pCurSceneState;
std::atomic< bool > m_bIndicateReset, m_bResetAck;
std::atomic< bool > m_bIndicateReset;
std::atomic< bool > m_bResetAck;
inline CVAAmbientMixerAudioRenderer operator=( const CVAAmbientMixerAudioRenderer & ) { VA_EXCEPT_NOT_IMPLEMENTED; };
};
......
......@@ -35,7 +35,6 @@
#include <ITAUPConvolution.h>
#include <ITAUPFilter.h>
#include <ITAUPFilterPool.h>
#include <ITAAtomicPrimitives.h>
#include <ITAClock.h>
#include <ITACriticalSection.h>
#include <ITADataSourceRealization.h>
......@@ -53,6 +52,7 @@
#include <VistaInterProcComm/Concurrency/VistaThreadEvent.h>
// STL includes
#include <atomic>
#include <algorithm>
#include <cassert>
#include <fstream>
......@@ -108,7 +108,7 @@ public:
CDirectivityState oDirectivityStateCur;
CDirectivityState oDirectivityStateNew;
ITAAtomicBool bDelete;
std::atomic< bool > bDelete;
CITAThirdOctaveFilterbank* pThirdOctaveFilterBank;
CITAVariableDelayLine* pVariableDelayLineCh;
......
......@@ -313,7 +313,7 @@ private:
int m_iNumChannels;
bool m_bDumpListeners;
double m_dDumpListenersGain;
ITAAtomicInt m_iDumpListenersFlag;
std::atomic< int > m_iDumpListenersFlag;
int m_iDefaultVDLSwitchingAlgorithm;
double m_dAdditionalStaticDelaySeconds; //!< Additional delay in seconds for delay compensation
......@@ -353,8 +353,8 @@ private:
std::list< CVAAFFSource* > m_lSources; //!< List of sources
std::list< CVAAFFListener* > m_lListeners; //!< List of listeners
ITASampleBuffer m_sbTemp; //!< Temporally used buffer to store a block of samples during processing
ITAAtomicInt m_iResetFlag; //!< Reset status flag: 0=normal_op, 1=reset_request, 2=reset_ack
ITAAtomicInt m_iStatus; //!< Current status flag: 0=stopped, 1=running
std::atomic< int > m_iResetFlag; //!< Reset status flag: 0=normal_op, 1=reset_request, 2=reset_ack
std::atomic< int > m_iStatus; //!< Current status flag: 0=stopped, 1=running
} ctxAudio;
void Init( const CVAStruct& oArgs );
......
......@@ -38,7 +38,6 @@
#include <ITAUPConvolution.h>
#include <ITAUPFilter.h>
#include <ITAUPFilterPool.h>
#include <ITAAtomicPrimitives.h>
#include <ITAThirdOctaveFilterbank.h>
#include <ITAClock.h>
#include <ITACriticalSection.h>
......@@ -54,7 +53,8 @@
#include <VistaInterProcComm/Concurrency/VistaThreadEvent.h>
// STL includes
#include <assert.h>
#include <atomic>
#include <cassert>
#include <fstream>
#include <iomanip>
......@@ -169,7 +169,7 @@ public:
double dGroundReflectionPlanePosition; //!< Height of ground, defaults to 0
ITAAtomicBool bDelete; //!< Schallpfad zur Lschung markiert?
std::atomic< bool > bDelete; //!< Schallpfad zur Lschung markiert?
inline void PreRequest()
{
......
......@@ -287,8 +287,8 @@ private:
std::list< CVABATNSoundReceiver* > m_lListener; //!< List of listeners
ITASampleBuffer m_sbTempBufD; //!< Temporally used buffer to store a block of samples during processing (direct sound)
ITASampleBuffer m_sbTempBufR; //!< Temporally used buffer to store a block of samples during processing (reflected sound)
ITAAtomicInt m_iResetFlag; //!< Reset status flag: 0=normal_op, 1=reset_request, 2=reset_ack
ITAAtomicInt m_iStatus; //!< Current status flag: 0=stopped, 1=running
std::atomic< int > m_iResetFlag; //!< Reset status flag: 0=normal_op, 1=reset_request, 2=reset_ack
std::atomic< int > m_iStatus; //!< Current status flag: 0=stopped, 1=running
} ctxAudio;
void Init( const CVAStruct& oArgs );
......
......@@ -34,7 +34,6 @@
#include <ITAUPConvolution.h>
#include <ITAUPFilter.h>
#include <ITAUPFilterPool.h>
#include <ITAAtomicPrimitives.h>
#include <ITAVariableDelayLine.h>
#include <ITAThirdOctaveFilterbank.h>
#include <ITAClock.h>
......@@ -49,7 +48,8 @@
#include <ITAFastMath.h>
// STL includes
#include <assert.h>
#include <atomic>
#include <cassert>
#include <algorithm>
#include <iomanip>
#include <set>
......@@ -82,7 +82,7 @@ public:
CITAVariableDelayLine* pVariableDelayLine; //!< DSP
ITAAtomicBool bMarkedForDeletion;
std::atomic< bool > bMarkedForDeletion;
void PreRequest()
{
......@@ -207,7 +207,7 @@ public:
private:
tbb::concurrent_queue< CVABinauralArtificialReverbAudioRenderer::Listener* > m_lTasks;
CVABinauralArtificialReverbAudioRenderer* m_pParentRenderer;
ITAAtomicInt m_iState;
std::atomic< int > m_iState;
};
......@@ -714,7 +714,7 @@ void CVABinauralArtificialReverbAudioRenderer::ManageArtificialReverbPaths( cons
void CVABinauralArtificialReverbAudioRenderer::ProcessStream( const ITAStreamInfo* pStreamInfo )
{
// If streaming is active, set
ctxAudio.m_iStatus.set( 1 );
ctxAudio.m_iStatus = 1;
// Swap forced update and check later if another process requests another forced update
bool bForceARUpdateOnceLocalCopy = m_bForceARUpdateOnce;
......
......@@ -112,7 +112,7 @@ protected:
IVADirectivity* pCurHRIR;
IVADirectivity* pNewHRIR;
ITAAtomicBool bARFilterUpdateRequired;
std::atomic< bool > bARFilterUpdateRequired;
void PreRequest()
{
......@@ -215,7 +215,7 @@ private:
IVAObjectPool* m_pListenerPool; //!< Storage manager for listener
CBARSimulator* m_pARSimulator; //!< Artificial reverberation simulation instance
ITAAtomicBool m_bForceARUpdateOnce; //!< Triggers a forced AR update on next stream process loop
std::atomic< bool > m_bForceARUpdateOnce; //!< Triggers a forced AR update on next stream process loop
std::map< int, Source* > m_mSources; //!< Internal list of sources
std::map< int, Listener* > m_mListener; //!< Internal list of listener
......@@ -234,8 +234,8 @@ private:
tbb::concurrent_queue< Listener* > m_qpNewListeners; //!< Lock-free queue: new listener
tbb::concurrent_queue< Listener* > m_qpDelListeners; //!< Lock-free queue: removed listener
ITASampleBuffer m_sbTempBuf1;
ITAAtomicInt m_iResetFlag; // 0=normal_op, 1=reset_request, 2=reset_ack
ITAAtomicInt m_iStatus; // 0=stopped, 1=running
std::atomic< int > m_iResetFlag; // 0=normal_op, 1=reset_request, 2=reset_ack
std::atomic< int > m_iStatus; // 0=stopped, 1=running
} ctxAudio;
......
......@@ -38,7 +38,6 @@
#include <ITAUPConvolution.h>
#include <ITAUPFilter.h>
#include <ITAUPFilterPool.h>
#include <ITAAtomicPrimitives.h>
#include <ITAClock.h>
#include <ITACriticalSection.h>
#include <ITADataSourceRealization.h>
......@@ -57,6 +56,7 @@
#include <VistaBase/VistaQuaternion.h>
// STL includes
#include <atomic>
#include <algorithm>
#include <cassert>
#include <fstream>
......@@ -140,7 +140,7 @@ public:
CHRIRState oHRIRStateCur;
CHRIRState oHRIRStateNew;
ITAAtomicBool bDelete;
std::atomic< bool > bDelete;
CITAThirdOctaveFilterbank* pThirdOctaveFilterBank;
CITAVariableDelayLine* pVariableDelayLineChL;
......
......@@ -295,7 +295,7 @@ private:
bool m_bDumpListeners;
double m_dDumpListenersGain;
ITAAtomicInt m_iDumpListenersFlag;
std::atomic< int > m_iDumpListenersFlag;
int m_iHRIRFilterLength; //!< Length of the HRIR filter DSP module
......@@ -338,8 +338,8 @@ private:
std::list< CVABFFListener* > m_lListeners; //!< List of listeners
ITASampleBuffer m_sbTempL; //!< Temporally used buffer to store a block of samples during processing (left ear)
ITASampleBuffer m_sbTempR; //!< Temporally used buffer to store a block of samples during processing (right ear)
ITAAtomicInt m_iResetFlag; //!< Reset status flag: 0=normal_op, 1=reset_request, 2=reset_ack
ITAAtomicInt m_iStatus; //!< Current status flag: 0=stopped, 1=running
std::atomic< int > m_iResetFlag; //!< Reset status flag: 0=normal_op, 1=reset_request, 2=reset_ack
std::atomic< int > m_iStatus; //!< Current status flag: 0=stopped, 1=running
} ctxAudio;
void Init( const CVAStruct& oArgs );
......
......@@ -39,7 +39,6 @@
#include <ITAUPConvolution.h>
#include <ITAUPFilter.h>
#include <ITAUPFilterPool.h>
#include <ITAAtomicPrimitives.h>
#include <ITAThirdOctaveFilterbank.h>
#include <ITAClock.h>
#include <ITACriticalSection.h>
......@@ -55,7 +54,8 @@
#include <VistaInterProcComm/Concurrency/VistaThreadEvent.h>
// STL includes
#include <assert.h>
#include <atomic>
#include <cassert>
#include <fstream>
#include <iomanip>
......
#ifndef IW_VACORE_BINAURALREALTIMERENDERER
#define IW_VACORE_BINAURALREALTIMERENDERER
// VA Includes
#include <VA.h>
#include "../../VAAudioRenderer.h"
// ITA includes
#include <ITADataSourceRealization.h>
// Other
#include "./Utils/BinauralClusterEngine/VABinauralClusterEngine.h"
#include "./Utils/BinauralSoundSource/VABinauralSoundSource.h"
#include "./Utils/BinauralListener/VABinauralListener.h"
class VABinauralRealTimeRenderer : public IVAAudioRenderer, public CVAObject, public ITADatasourceRealization
{
public:
VABinauralRealTimeRenderer( const CVAAudioRendererInitParams& );
~VABinauralRealTimeRenderer();
inline void
LoadScene( const std::string& ) {};
void
ProcessStream( const ITAStreamInfo* pStreamInfo );
void
UpdateScene( CVASceneState* newSceneState );
// Resets the renderer to it's initial state
void
Reset();
// Returns the renderers output stream datasource
// ITADatasource* GetOutputDatasource();
void UpdateGlobalAuralizationMode(int iGlobalAuralizationMode);
ITADatasource*
GetOutputDatasource();
CVAStruct
CallObject(const CVAStruct& oArgs);
private:
const CVAAudioRendererInitParams _params;
std::map< int, VABinauralSoundSource* > _sources;
std::map< int, VABinauralListener* > _listeners;
VABinauralClusterEngine* _clusterEngine;
CVACoreImpl* _core;
CVASceneState* _newSceneState;
CVASceneState* _curSceneState;
IVAObjectPool* _sourcePool;
IVAObjectPool* _listenerPool;
std::atomic< bool > _indicateReset, _resetAck;
VABinauralListener::config_t _defaultListenerConf; //!< Default listener config for factory object creation
VABinauralSoundSource::config_t _defaultSourceConf;
// CVABFFUpdateMessage* _updateMessage;
int _defaultVDLSwitchingAlgorithm;
int _hrirFilterLength;
int _curGlobalAuralizationMode;
double _additionalStaticDelaySeconds;
void
init( const CVAStruct& oArgs );
void
updateListeners( CVASceneStateDiff* diff );
void
updateSources( CVASceneStateDiff* diff );
void
createListener( const int listenerID, const CVAReceiverState* receiverState );
void
createSource( const int sourceID, const CVASoundSourceState* sourceState );
void
deleteListener( const int listenerID );
void
deleteSource( const int sourceID );
void
updateMotionStates();
void
updateTrajectories(double time);
};
#endif // IW_VACORE_BINAURALREALTIMERENDERER
\ No newline at end of file
......@@ -47,13 +47,13 @@
#include <ITAUPFilterPool.h>
#include <ITANumericUtils.h>
#include <ITAFastMath.h>
#include <ITAAtomicPrimitives.h>
#include <ITAAudiofileWriter.h>
#include <ITASampleFrame.h>
#include <ITASimpleConvolution.h>
#include <ITAStreamInfo.h>
#include <ITAISO9613.h>
#include <atomic>
#include <iostream>
#include <complex>
......@@ -446,7 +446,7 @@ public:
CVARoomAcousticsAudioRenderer* m_pRenderer; // const?
ITAAtomicBool bDelete; //!< Schallpfad zur Lschung markiert?
std::atomic< bool > bDelete; //!< Schallpfad zur Lschung markiert?
Source* pSource; //!< Verknpfte Quelle
Listener* pListener; //!< Verknpfter Hrer
......
......@@ -21,7 +21,6 @@
// ITA includes
#include <ITASampleFrame.h>
#include <ITAAtomicPrimitives.h>
// Vista includes
#include <VistaInterProcComm/Concurrency/VistaThreadEvent.h>
......@@ -32,7 +31,8 @@
#include <tbb/concurrent_queue.h>
// STL includes
#include <assert.h>
#include <atomic>
#include <cassert>
#include <list>
// VA includes
......@@ -108,7 +108,8 @@ private:
VistaThreadEvent m_evTrigger;
ITAAtomicBool m_bStop, m_bIndicateReset;
std::atomic< bool > m_bStop;
std::atomic< bool > m_bIndicateReset;
//! Filtert und weist Tasks ab, die gar nicht erst zu den Schedulern geleitet werden mssen
void FilterAndReplaceTasks( TaskList& , CVARoomAcousticsSimulationTask* );
......
......@@ -20,7 +20,6 @@
// ITA includes
#include <ITASampleFrame.h>
#include <ITAAtomicPrimitives.h>
// Vista includes
#include <VistaInterProcComm/Concurrency/VistaThreadEvent.h>
......@@ -31,7 +30,8 @@
#include <tbb/concurrent_queue.h>
// STL includes
#include <assert.h>
#include <atomic>
#include <cassert>
#include <list>
// VA includes
......
......@@ -20,7 +20,6 @@
// ITA includes
#include <ITASampleFrame.h>
#include <ITAAtomicPrimitives.h>
// Vista includes
#include <VistaInterProcComm/Concurrency/VistaThreadEvent.h>
......@@ -31,7 +30,8 @@
#include <tbb/concurrent_queue.h>
// STL includes
#include <assert.h>
#include <atomic>
#include <cassert>
#include <list>
// VA includes
......@@ -90,7 +90,7 @@ private:
VistaThreadEvent m_evTrigger;
ITAAtomicBool m_bStop, m_bIndicateReset, m_bResetAck;
std::atomic< bool > m_bStop, m_bIndicateReset, m_bResetAck;
void FilterAndReplaceTasks( TaskList& , CVARoomAcousticsSimulationTask* );
};
......
......@@ -33,7 +33,6 @@
// ITA includes
#include <DAFF.h>
#include <ITAAtomicPrimitives.h>
#include <ITAThirdOctaveFilterbank.h>
#include <ITAUPConvolution.h>
#include <ITAUPFilter.h>
......@@ -55,6 +54,7 @@
#include <VistaTools/VistaFileSystemDirectory.h>
// STL includes
#include <atomic>
#include <algorithm>
#include <cassert>
#include <fstream>
......@@ -134,7 +134,7 @@ public:
CSoundReceiverDirectivityState oSoundReceiverDirectivityStateCur;
CSoundReceiverDirectivityState oSoundReceiverDirectivityStateNew;
ITAAtomicBool bDelete;
std::atomic< bool > bDelete;
CITAThirdOctaveFilterbank* pThirdOctaveFilterBank;
CITAVariableDelayLine* pVariableDelayLine;
......
......@@ -310,8 +310,8 @@ private:
std::list< CVAPFFSource* > m_lSources; //!< List of sources
std::list< CVAPFFReceiver* > m_lReceivers; //!< List of receivers
ITASampleBuffer m_sbTemp; //!< Temporally used buffer to store a block of samples during processing
ITAAtomicInt m_iResetFlag; //!< Reset status flag: 0=normal_op, 1=reset_request, 2=reset_ack
ITAAtomicInt m_iStatus; //!< Current status flag: 0=stopped, 1=running
std::atomic< int > m_iResetFlag; //!< Reset status flag: 0=normal_op, 1=reset_request, 2=reset_ack
std::atomic< int > m_iStatus; //!< Current status flag: 0=stopped, 1=running