#ifndef IW_VACORE_BINAURALCLUSTER #define IW_VACORE_BINAURALCLUSTER // VA Includes #include // Utils #include "../BinauralSoundSource/VABinauralSoundSource.h" #include "../BinauralListener/VABinauralListener.h" class VABinauralCluster : public CVAPoolObject { public: double maxError; VABinauralCluster(); VABinauralCluster(const VABinauralCluster& cluster); ~VABinauralCluster(); void init(int sourceID, VABinauralSoundSource* source, VABinauralListener* listener); ITASampleFrame* getOutput(); double getDistError(VABinauralSoundSource* source); void addSource(int sourceID, VABinauralSoundSource* source); void addSource(int sourceID, VABinauralSoundSource* source, double error); void removeSource(); void reset(); private: int _numSources; ITASampleBuffer _tmpChL; ITASampleBuffer _tmpChR; ITASampleFrame* _output; VABinauralListener* _listener; VAVec3 _listenerPos; VAVec3 _clusterSourcePos; VAVec3 _clusterSourceToListenerPos; std::map _sources; double cummulativeMovingAverage(int n, double average, double value); }; #endif // IW_VACORE_BINAURALCLUSTER