VABinauralClustering.h 1.13 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
#ifndef IW_VACORE_BINAURALCLUSTERING
#define IW_VACORE_BINAURALCLUSTERING

#include <queue>

// VA Includes
#include <VA.h>
#include <VAPoolObject.h>

// Utils
#include "VABinauralCluster.h"
#include "VABinauralClusteringState.h"
#include "../BinauralListener/VABinauralListener.h"
#include "../BinauralSoundSource/VABinauralSoundSource.h"

class VABinauralClustering : public CVAPoolObject
{
public:
	~VABinauralClustering();
	
	VABinauralClustering();

	void
	init(int listenerID, VABinauralListener* listener, int numClusters);

	void
	update();

	void
	addSource(int sourceID, VABinauralSoundSource* source);


private:
	int _listenerID;
	int _numClusters;
	double _threshold;

	VABinauralClusteringState* _clustering;
	VABinauralListener* _listener;
	IVAObjectPool* _clusterPool;

	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