mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:23:54 +02:00
Merge pull request #450 from birarda/master
make audio echo a menu option instead of forcing it with the mirror mode
This commit is contained in:
commit
408fef0de8
5 changed files with 11 additions and 14 deletions
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue