add a map for TwoPole objects to AvatarAudioRingBuffer

This commit is contained in:
Stephen Birarda 2013-06-11 14:49:56 -07:00
parent 676ca9cf76
commit 1e0dcd0eae
2 changed files with 17 additions and 0 deletions

View file

@ -11,10 +11,18 @@
#include "AvatarAudioRingBuffer.h"
AvatarAudioRingBuffer::AvatarAudioRingBuffer() :
_twoPoles(),
_shouldLoopbackForAgent(false) {
}
AvatarAudioRingBuffer::~AvatarAudioRingBuffer() {
// enumerate the freeVerbs map and delete the FreeVerb objects
for (TwoPoleAgentMap::iterator poleIterator = _twoPoles.begin(); poleIterator != _twoPoles.end(); poleIterator++) {
delete poleIterator->second;
}
}
int AvatarAudioRingBuffer::parseData(unsigned char* sourceBuffer, int numBytes) {
_shouldLoopbackForAgent = (sourceBuffer[0] == PACKET_HEADER_MICROPHONE_AUDIO_WITH_ECHO);
return PositionalAudioRingBuffer::parseData(sourceBuffer, numBytes);

View file

@ -9,20 +9,29 @@
#ifndef __hifi__AvatarAudioRingBuffer__
#define __hifi__AvatarAudioRingBuffer__
#include <Stk.h>
#include <TwoPole.h>
#include "PositionalAudioRingBuffer.h"
typedef std::map<uint16_t, stk::TwoPole*> TwoPoleAgentMap;
class AvatarAudioRingBuffer : public PositionalAudioRingBuffer {
public:
AvatarAudioRingBuffer();
~AvatarAudioRingBuffer();
int parseData(unsigned char* sourceBuffer, int numBytes);
TwoPoleAgentMap& getTwoPoles() { return _twoPoles; }
bool shouldLoopbackForAgent() const { return _shouldLoopbackForAgent; }
private:
// disallow copying of AvatarAudioRingBuffer objects
AvatarAudioRingBuffer(const AvatarAudioRingBuffer&);
AvatarAudioRingBuffer& operator= (const AvatarAudioRingBuffer&);
TwoPoleAgentMap _twoPoles;
bool _shouldLoopbackForAgent;
};