This commit is contained in:
Stephen Birarda 2014-01-17 14:30:30 -08:00
commit 4d0aa615d6
5 changed files with 30 additions and 7 deletions

View file

@ -2168,7 +2168,6 @@ void Application::updateMouseVoxels(float deltaTime, glm::vec3& mouseRayOrigin,
_mouseVoxel.s = 0.0f;
bool wasInitialized = _mouseVoxelScaleInitialized;
_mouseVoxelScaleInitialized = false;
if (Menu::getInstance()->isVoxelModeActionChecked() &&
(fabs(_myAvatar.getVelocity().x) +
fabs(_myAvatar.getVelocity().y) +

View file

@ -530,12 +530,17 @@ void Audio::addReceivedAudioToBuffer(const QByteArray& audioByteArray) {
bool Audio::mousePressEvent(int x, int y) {
if (_iconBounds.contains(x, y)) {
_muted = !_muted;
toggleMute();
return true;
}
return false;
}
void Audio::toggleMute() {
_muted = !_muted;
muteToggled();
}
void Audio::render(int screenWidth, int screenHeight) {
if (_audioInput) {
glLineWidth(2.0);

View file

@ -62,6 +62,8 @@ public:
bool getCollisionFlashesScreen() { return _collisionFlashesScreen; }
bool getMuted() { return _muted; }
void init(QGLWidget *parent = 0);
bool mousePressEvent(int x, int y);
@ -70,8 +72,12 @@ public slots:
void addReceivedAudioToBuffer(const QByteArray& audioByteArray);
void handleAudioInput();
void reset();
void toggleMute();
virtual void handleAudioByteArray(const QByteArray& audioByteArray);
signals:
bool muteToggled();
private:
QByteArray firstInputFrame;

View file

@ -167,7 +167,9 @@ Menu::Menu() :
true,
appInstance->getAvatar(),
SLOT(setWantCollisionsOn(bool)));
addCheckableActionToQMenuAndActionHash(editMenu, MenuOption::ClickToFly);
QMenu* toolsMenu = addMenu("Tools");
_voxelModeActionsGroup = new QActionGroup(this);
@ -188,8 +190,6 @@ Menu::Menu() :
QAction* getColorMode = addCheckableActionToQMenuAndActionHash(toolsMenu, MenuOption::VoxelGetColorMode, Qt::Key_G);
_voxelModeActionsGroup->addAction(getColorMode);
addCheckableActionToQMenuAndActionHash(toolsMenu, MenuOption::ClickToFly);
// connect each of the voxel mode actions to the updateVoxelModeActionsSlot
foreach (QAction* action, _voxelModeActionsGroup->actions()) {
@ -455,13 +455,19 @@ Menu::Menu() :
QMenu* audioDebugMenu = developerMenu->addMenu("Audio Debugging Tools");
addCheckableActionToQMenuAndActionHash(audioDebugMenu, MenuOption::EchoServerAudio);
addCheckableActionToQMenuAndActionHash(audioDebugMenu, MenuOption::EchoLocalAudio);
addCheckableActionToQMenuAndActionHash(audioDebugMenu, MenuOption::MuteAudio,
Qt::CTRL | Qt::Key_M,
false,
appInstance->getAudio(),
SLOT(toggleMute()));
addActionToQMenuAndActionHash(developerMenu, MenuOption::PasteToVoxel,
Qt::CTRL | Qt::SHIFT | Qt::Key_V,
this,
SLOT(pasteToVoxel()));
connect(appInstance->getAudio(), SIGNAL(muteToggled()), this, SLOT(audioMuteToggled()));
#ifndef Q_OS_MAC
QMenu* helpMenu = addMenu("Help");
QAction* helpAction = helpMenu->addAction(MenuOption::AboutApp);
@ -1002,6 +1008,11 @@ void Menu::bandwidthDetails() {
_bandwidthDialog->raise();
}
void Menu::audioMuteToggled() {
QAction *muteAction = _actionHash.value(MenuOption::MuteAudio);
muteAction->setChecked(Application::getInstance()->getAudio()->getMuted());
}
void Menu::bandwidthDetailsClosed() {
if (_bandwidthDialog) {
delete _bandwidthDialog;

View file

@ -107,6 +107,7 @@ private slots:
void chooseVoxelPaintColor();
void runTests();
void resetSwatchColors();
void audioMuteToggled();
private:
static Menu* _instance;
@ -184,6 +185,7 @@ namespace MenuOption {
const QString EnableVoxelPacketCompression = "Enable Voxel Packet Compression";
const QString EchoServerAudio = "Echo Server Audio";
const QString EchoLocalAudio = "Echo Local Audio";
const QString MuteAudio = "Mute Microphone";
const QString ExportVoxels = "Export Voxels";
const QString DontFadeOnVoxelServerChanges = "Don't Fade In/Out on Voxel Server Changes";
const QString HeadMouse = "Head Mouse";