Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Jeffrey Ventrella 2013-05-29 11:51:34 -07:00
commit ab1c00dac6
5 changed files with 11 additions and 14 deletions

View file

@ -965,11 +965,7 @@ void Application::pair() {
PairingHandler::sendPairRequest();
}
void Application::setHead(bool head) {
#ifndef _WIN32
_audio.setMixerLoopbackFlag(head);
#endif
void Application::setHead(bool head) {
if (head) {
_myCamera.setMode(CAMERA_MODE_MIRROR);
_myCamera.setModeShiftRate(100.0f);
@ -1133,6 +1129,8 @@ void Application::initMenu() {
QMenu* optionsMenu = menuBar->addMenu("Options");
(_lookingInMirror = optionsMenu->addAction("Mirror", this, SLOT(setHead(bool)), Qt::Key_H))->setCheckable(true);
(_echoAudioMode = optionsMenu->addAction("Echo Audio"))->setCheckable(true);
optionsMenu->addAction("Noise", this, SLOT(setNoise(bool)), Qt::Key_N)->setCheckable(true);
(_gyroLook = optionsMenu->addAction("Gyro Look"))->setCheckable(true);
_gyroLook->setChecked(true);

View file

@ -13,6 +13,7 @@
#include <time.h>
#include <QApplication>
#include <QAction>
#include <AgentList.h>
@ -64,6 +65,7 @@ public:
Avatar* getAvatar() { return &_myAvatar; }
VoxelSystem* getVoxels() { return &_voxels; }
Environment* getEnvironment() { return &_environment; }
bool shouldEchoAudio() { return _echoAudioMode->isChecked(); }
private slots:
@ -137,7 +139,8 @@ private:
QMainWindow* _window;
QGLWidget* _glWidget;
QAction* _lookingInMirror; // Are we currently rendering one's own head as if in mirror?
QAction* _lookingInMirror; // Are we currently rendering one's own head as if in mirror?
QAction* _echoAudioMode; // Are we asking the mixer to echo back our audio?
QAction* _gyroLook; // Whether to allow the gyro data from head to move your view
QAction* _mouseLook; // Whether the have the mouse near edge of screen move your view
QAction* _showHeadMouse; // Whether the have the mouse near edge of screen move your view

View file

@ -158,10 +158,10 @@ int audioCallback (const void* inputBuffer,
correctedYaw += 360;
}
if (parentAudio->_mixerLoopbackFlag) {
if (Application::getInstance()->shouldEchoAudio()) {
correctedYaw = correctedYaw > 0
? correctedYaw + AGENT_LOOPBACK_MODIFIER
: correctedYaw - AGENT_LOOPBACK_MODIFIER;
? correctedYaw + AGENT_LOOPBACK_MODIFIER
: correctedYaw - AGENT_LOOPBACK_MODIFIER;
}
memcpy(currentPacketPtr, &correctedYaw, sizeof(float));
@ -310,7 +310,6 @@ Audio::Audio(Oscilloscope* scope) :
NUM_AUDIO_CHANNELS * (SAMPLE_RATE / 1000.0)),
_wasStarved(0),
_lastInputLoudness(0),
_mixerLoopbackFlag(false),
_lastVelocity(0),
_lastAcceleration(0),
_totalPacketsReceived(0),

View file

@ -24,8 +24,6 @@ public:
void render(int screenWidth, int screenHeight);
void setMixerLoopbackFlag(bool mixerLoopbackFlag) { _mixerLoopbackFlag = mixerLoopbackFlag; }
float getLastInputLoudness() const { return _lastInputLoudness; };
void setLastAcceleration(glm::vec3 lastAcceleration) { _lastAcceleration = lastAcceleration; };
@ -52,7 +50,6 @@ private:
short _jitterBufferSamples;
int _wasStarved;
float _lastInputLoudness;
bool _mixerLoopbackFlag;
glm::vec3 _lastVelocity;
glm::vec3 _lastAcceleration;
int _totalPacketsReceived;

View file

@ -40,8 +40,8 @@ vector<unsigned char> irisTexture;
Head::Head(Avatar* owningAvatar) :
HeadData((AvatarData*)owningAvatar),
_renderAlpha(0.0),
yawRate(0.0f),
_renderAlpha(0.0),
_returnHeadToCenter(false),
_skinColor(0.0f, 0.0f, 0.0f),
_position(0.0f, 0.0f, 0.0f),