#ifndef IW_VACORE_BINAURALCLUSTERING #define IW_VACORE_BINAURALCLUSTERING #include // VA Includes #include #include // Utils #include "VABinauralCluster.h" #include "VABinauralClusteringState.h" #include "../BinauralListener/VABinauralListener.h" #include "../BinauralSoundSource/VABinauralSoundSource.h" #include "../BinauralTimeOfArrivalEstimator/VABinauralTOAEstimator.h" class VABinauralClustering : public CVAPoolObject { // friend VABinauralClusteringState; public: IVAObjectPool* clusterPool; std::map< int, ITAUPConvolution* > FIRConvolverChL; std::map< int, ITAUPConvolution* > FIRConvolverChR; ~VABinauralClustering(); VABinauralClustering(int blocklength); void init(int listenerID, VABinauralListener* listener, int numClusters, int HRIRFilterLength); ITASampleFrame* getOutput(); void update(); void addSource( int sourceID, VABinauralSoundSource* source ); void removeSource(int sourceID); private: int _HRIRFilterLength; int _blocklength; int _listenerID; int _numClusters; double _threshold; ITASampleFrame* _output; VABinauralListener* _listener; std::set< int > _delSourceIDs; std::unique_ptr _curState; std::unique_ptr _nextState; std::map< int, VABinauralSoundSource* > _unassignedSources; std::map< int, VABinauralSoundSource* > _assignedSources; std::pair< int, VABinauralCluster* > assignCluster(VABinauralClusteringState* clustering, VABinauralSoundSource* source, double threshold, int numFreeClusters); void PreRequest(); void PreRelease(); }; #endif // IW_VACORE_BINAURALCLUSTERING