History

Merge branch 'master' of github.com:/worklist/hifi

Leonardo Murillo committed 12 years ago

Commit 91defcf2 parents a13d7b0 bb41fe65 files · +30 −7Browse files

Unified · Split

5 files
  1. interface/src/Application.cpp +0 −1
  2. interface/src/Audio.cpp +6 −1
  3. interface/src/Audio.h +6 −0
  4. interface/src/Menu.cpp +16 −5
  5. interface/src/Menu.h +2 −0
interface/src/Application.cpp+0−1
@@ -2176,7 +2176,6 @@ void Application::updateMouseVoxels(float deltaTime, glm::vec3& mouseRayOrigin, · 2175 unmodified lines
2176 2176
2177 _mouseVoxel.s = 0.0f;2177 _mouseVoxel.s = 0.0f;
2178 bool wasInitialized = _mouseVoxelScaleInitialized;2178 bool wasInitialized = _mouseVoxelScaleInitialized;
2179 _mouseVoxelScaleInitialized = false;
2180 if (Menu::getInstance()->isVoxelModeActionChecked() &&2179 if (Menu::getInstance()->isVoxelModeActionChecked() &&
2181 (fabs(_myAvatar.getVelocity().x) +2180 (fabs(_myAvatar.getVelocity().x) +
2182 fabs(_myAvatar.getVelocity().y) +2181 fabs(_myAvatar.getVelocity().y) +
interface/src/Audio.cpp+6−1
@@ -530,12 +530,17 @@ void Audio::addReceivedAudioToBuffer(const QByteArray& audioByteArray) { · 529 unmodified lines
530 530
531bool Audio::mousePressEvent(int x, int y) {531bool Audio::mousePressEvent(int x, int y) {
532 if (_iconBounds.contains(x, y)) {532 if (_iconBounds.contains(x, y)) {
533 _muted = !_muted;533 toggleMute();
534 return true;534 return true;
535 }535 }
536 return false;536 return false;
537}537}
538 538
539void Audio::toggleMute() {
540 _muted = !_muted;
541 muteToggled();
542}
543
539void Audio::render(int screenWidth, int screenHeight) {544void Audio::render(int screenWidth, int screenHeight) {
540 if (_audioInput) {545 if (_audioInput) {
541 glLineWidth(2.0);546 glLineWidth(2.0);
interface/src/Audio.h+6−0
@@ -62,6 +62,8 @@ public: · 61 unmodified lines
62 62
63 bool getCollisionFlashesScreen() { return _collisionFlashesScreen; }63 bool getCollisionFlashesScreen() { return _collisionFlashesScreen; }
64 64
65 bool getMuted() { return _muted; }
66
65 void init(QGLWidget *parent = 0);67 void init(QGLWidget *parent = 0);
66 bool mousePressEvent(int x, int y);68 bool mousePressEvent(int x, int y);
67 69
@@ -70,8 +72,12 @@ public slots: · 2 unmodified lines
70 void addReceivedAudioToBuffer(const QByteArray& audioByteArray);72 void addReceivedAudioToBuffer(const QByteArray& audioByteArray);
71 void handleAudioInput();73 void handleAudioInput();
72 void reset();74 void reset();
75 void toggleMute();
73 76
74 virtual void handleAudioByteArray(const QByteArray& audioByteArray);77 virtual void handleAudioByteArray(const QByteArray& audioByteArray);
78
79signals:
80 bool muteToggled();
75 81
76private:82private:
77 QByteArray firstInputFrame;83 QByteArray firstInputFrame;
interface/src/Menu.cpp+16−5
@@ -167,7 +167,9 @@ Menu::Menu() : · 166 unmodified lines
167 true,167 true,
168 appInstance->getAvatar(),168 appInstance->getAvatar(),
169 SLOT(setWantCollisionsOn(bool)));169 SLOT(setWantCollisionsOn(bool)));
170 170
171 addCheckableActionToQMenuAndActionHash(editMenu, MenuOption::ClickToFly);
172
171 QMenu* toolsMenu = addMenu("Tools");173 QMenu* toolsMenu = addMenu("Tools");
172 174
173 _voxelModeActionsGroup = new QActionGroup(this);175 _voxelModeActionsGroup = new QActionGroup(this);
@@ -188,8 +190,6 @@ Menu::Menu() : · 14 unmodified lines
188 QAction* getColorMode = addCheckableActionToQMenuAndActionHash(toolsMenu, MenuOption::VoxelGetColorMode, Qt::Key_G);190 QAction* getColorMode = addCheckableActionToQMenuAndActionHash(toolsMenu, MenuOption::VoxelGetColorMode, Qt::Key_G);
189 _voxelModeActionsGroup->addAction(getColorMode);191 _voxelModeActionsGroup->addAction(getColorMode);
190 192
191 addCheckableActionToQMenuAndActionHash(toolsMenu, MenuOption::ClickToFly);
192
193 193
194 // connect each of the voxel mode actions to the updateVoxelModeActionsSlot194 // connect each of the voxel mode actions to the updateVoxelModeActionsSlot
195 foreach (QAction* action, _voxelModeActionsGroup->actions()) {195 foreach (QAction* action, _voxelModeActionsGroup->actions()) {
@@ -455,13 +455,19 @@ Menu::Menu() : · 259 unmodified lines
455 QMenu* audioDebugMenu = developerMenu->addMenu("Audio Debugging Tools");455 QMenu* audioDebugMenu = developerMenu->addMenu("Audio Debugging Tools");
456 addCheckableActionToQMenuAndActionHash(audioDebugMenu, MenuOption::EchoServerAudio);456 addCheckableActionToQMenuAndActionHash(audioDebugMenu, MenuOption::EchoServerAudio);
457 addCheckableActionToQMenuAndActionHash(audioDebugMenu, MenuOption::EchoLocalAudio);457 addCheckableActionToQMenuAndActionHash(audioDebugMenu, MenuOption::EchoLocalAudio);
458 458 addCheckableActionToQMenuAndActionHash(audioDebugMenu, MenuOption::MuteAudio,
459 Qt::CTRL | Qt::Key_M,
460 false,
461 appInstance->getAudio(),
462 SLOT(toggleMute()));
463
459 addActionToQMenuAndActionHash(developerMenu, MenuOption::PasteToVoxel,464 addActionToQMenuAndActionHash(developerMenu, MenuOption::PasteToVoxel,
460 Qt::CTRL | Qt::SHIFT | Qt::Key_V,465 Qt::CTRL | Qt::SHIFT | Qt::Key_V,
461 this,466 this,
462 SLOT(pasteToVoxel()));467 SLOT(pasteToVoxel()));
463 468
464 469 connect(appInstance->getAudio(), SIGNAL(muteToggled()), this, SLOT(audioMuteToggled()));
470
465#ifndef Q_OS_MAC471#ifndef Q_OS_MAC
466 QMenu* helpMenu = addMenu("Help");472 QMenu* helpMenu = addMenu("Help");
467 QAction* helpAction = helpMenu->addAction(MenuOption::AboutApp);473 QAction* helpAction = helpMenu->addAction(MenuOption::AboutApp);
@@ -1002,6 +1008,11 @@ void Menu::bandwidthDetails() { · 534 unmodified lines
1002 _bandwidthDialog->raise();1008 _bandwidthDialog->raise();
1003}1009}
1004 1010
1011void Menu::audioMuteToggled() {
1012 QAction *muteAction = _actionHash.value(MenuOption::MuteAudio);
1013 muteAction->setChecked(Application::getInstance()->getAudio()->getMuted());
1014}
1015
1005void Menu::bandwidthDetailsClosed() {1016void Menu::bandwidthDetailsClosed() {
1006 if (_bandwidthDialog) {1017 if (_bandwidthDialog) {
1007 delete _bandwidthDialog;1018 delete _bandwidthDialog;
interface/src/Menu.h+2−0
@@ -107,6 +107,7 @@ private slots: · 106 unmodified lines
107 void chooseVoxelPaintColor();107 void chooseVoxelPaintColor();
108 void runTests();108 void runTests();
109 void resetSwatchColors();109 void resetSwatchColors();
110 void audioMuteToggled();
110 111
111private:112private:
112 static Menu* _instance;113 static Menu* _instance;
@@ -184,6 +185,7 @@ namespace MenuOption { · 71 unmodified lines
184 const QString EnableVoxelPacketCompression = "Enable Voxel Packet Compression";185 const QString EnableVoxelPacketCompression = "Enable Voxel Packet Compression";
185 const QString EchoServerAudio = "Echo Server Audio";186 const QString EchoServerAudio = "Echo Server Audio";
186 const QString EchoLocalAudio = "Echo Local Audio";187 const QString EchoLocalAudio = "Echo Local Audio";
188 const QString MuteAudio = "Mute Microphone";
187 const QString ExportVoxels = "Export Voxels";189 const QString ExportVoxels = "Export Voxels";
188 const QString DontFadeOnVoxelServerChanges = "Don't Fade In/Out on Voxel Server Changes";190 const QString DontFadeOnVoxelServerChanges = "Don't Fade In/Out on Voxel Server Changes";
189 const QString HeadMouse = "Head Mouse";191 const QString HeadMouse = "Head Mouse";

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t