From ddff60f236199d9c654453cd58b221007f64162f Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 15 May 2013 16:40:39 -0700 Subject: [PATCH 1/2] remove the unused temporary UDP Socket --- eve/src/main.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/eve/src/main.cpp b/eve/src/main.cpp index 92b693dc15..33d5a016be 100644 --- a/eve/src/main.cpp +++ b/eve/src/main.cpp @@ -36,9 +36,6 @@ const float AUDIO_INJECT_PROXIMITY = 0.4f; bool stopReceiveAgentDataThread; -int TEMP_AUDIO_LISTEN_PORT = 55439; -UDPSocket audioSocket(TEMP_AUDIO_LISTEN_PORT); - void *receiveAgentData(void *args) { sockaddr senderAddress; ssize_t bytesReceived; From d78daf53e982979e778f77ea9216a46defa6d07f Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 15 May 2013 17:28:27 -0700 Subject: [PATCH 2/2] fix copy of Avatar object for use in Audio class --- audio-mixer/src/main.cpp | 4 +--- eve/src/main.cpp | 2 +- interface/src/Application.h | 2 +- interface/src/Audio.cpp | 8 ++++---- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/audio-mixer/src/main.cpp b/audio-mixer/src/main.cpp index d8a0384b69..444edd1393 100644 --- a/audio-mixer/src/main.cpp +++ b/audio-mixer/src/main.cpp @@ -149,9 +149,7 @@ int main(int argc, const char* argv[]) { int numSamplesDelay = 0; float weakChannelAmplitudeRatio = 1.f; - if (otherAgent != agent) { - printf("DEBUG: The bearing for this agent is %f\n", agentRingBuffer->getBearing()); - + if (otherAgent != agent) { Position agentPosition = agentRingBuffer->getPosition(); Position otherAgentPosition = otherAgentBuffer->getPosition(); diff --git a/eve/src/main.cpp b/eve/src/main.cpp index 33d5a016be..777cce4048 100644 --- a/eve/src/main.cpp +++ b/eve/src/main.cpp @@ -148,7 +148,7 @@ int main(int argc, const char* argv[]) { // use the UDPSocket instance attached to our agent list to send avatar data to mixer agentList->getAgentSocket()->send(avatarMixer->getActiveSocket(), broadcastPacket, packetPosition - broadcastPacket); - } + } if (!eveAudioInjector.isInjectingAudio()) { // enumerate the other agents to decide if one is close enough that eve should talk diff --git a/interface/src/Application.h b/interface/src/Application.h index 241771bf31..777aaf61bd 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -59,7 +59,7 @@ public: void wheelEvent(QWheelEvent* event); - const Avatar& getAvatar() const { return _myAvatar; } + Avatar* getAvatar() { return &_myAvatar; } private slots: diff --git a/interface/src/Audio.cpp b/interface/src/Audio.cpp index cb02364e58..7308b35963 100644 --- a/interface/src/Audio.cpp +++ b/interface/src/Audio.cpp @@ -85,7 +85,7 @@ int audioCallback (const void* inputBuffer, AgentList* agentList = AgentList::getInstance(); Application* interface = (Application*) QCoreApplication::instance(); - Avatar interfaceAvatar = interface->getAvatar(); + Avatar* interfaceAvatar = interface->getAvatar(); int16_t *inputLeft = ((int16_t **) inputBuffer)[0]; @@ -119,14 +119,14 @@ int audioCallback (const void* inputBuffer, unsigned char *currentPacketPtr = dataPacket + 1; // memcpy the three float positions - memcpy(currentPacketPtr, &interfaceAvatar.getHeadPosition(), sizeof(float) * 3); + memcpy(currentPacketPtr, &interfaceAvatar->getHeadPosition(), sizeof(float) * 3); currentPacketPtr += (sizeof(float) * 3); // tell the mixer not to add additional attenuation to our source *(currentPacketPtr++) = 255; // memcpy the corrected render yaw - float correctedYaw = fmodf(-1 * interfaceAvatar.getAbsoluteHeadYaw(), 360); + float correctedYaw = fmodf(-1 * interfaceAvatar->getAbsoluteHeadYaw(), 360); if (correctedYaw > 180) { correctedYaw -= 360; @@ -188,7 +188,7 @@ int audioCallback (const void* inputBuffer, // if we haven't fired off the flange effect, check if we should // TODO: lastMeasuredHeadYaw is now relative to body - check if this still works. - int lastYawMeasured = fabsf(interfaceAvatar.getLastMeasuredHeadYaw()); + int lastYawMeasured = fabsf(interfaceAvatar->getLastMeasuredHeadYaw()); if (!::samplesLeftForFlange && lastYawMeasured > MIN_FLANGE_EFFECT_THRESHOLD) { // we should flange for one second