History

Merge branch 'master' of ssh://github.com/highfidelity/hifi into fix-particle-avatar-collisions

Andrew Meadows committed 12 years ago

Commit c4f429d2 parents 2b5675b f2cfb1611 files · +191 −51Browse files

Showing the changes to interface/src/Application.cpp (1 of 11 files). Show all

Unified · Split

interface/src/Application.cpp+15−0
@@ -47,6 +47,7 @@ · 46 unmodified lines
4747 #include <QDesktopServices>
4848 #include <QXmlStreamReader>
4949 #include <QXmlStreamAttributes>
50+#include <QMediaPlayer>
5051
5152 #include <AudioInjector.h>
5253 #include <NodeTypes.h>
@@ -70,6 +71,7 @@ · 17 unmodified lines
7071 #include "renderer/ProgramObject.h"
7172 #include "ui/TextRenderer.h"
7273 #include "InfoView.h"
74+#include "ui/Snapshot.h"
7375
7476 using namespace std;
7577
@@ -773,6 +775,8 @@ void Application::keyPressEvent(QKeyEvent* event) { · 697 unmodified lines
773775 _voxels.collectStatsForTreesAndVBOs();
774776 } else if (isShifted && isMeta) {
775777 Menu::getInstance()->triggerOption(MenuOption::SuppressShortTimings);
778+ } else if (!isShifted && isMeta) {
779+ takeSnapshot();
776780 } else if (_nudgeStarted) {
777781 if (_lookingAlongX) {
778782 if (_lookingAwayFromOrigin) {
@@ -4346,3 +4350,14 @@ void Application::skipVersion(QString latestVersion) { · 3567 unmodified lines
43464350 skipFile.seek(0);
43474351 skipFile.write(latestVersion.toStdString().c_str());
43484352 }
4353+
4354+void Application::takeSnapshot() {
4355+ switchToResourcesParentIfRequired();
4356+ QMediaPlayer* player = new QMediaPlayer();
4357+ QFileInfo inf = QFileInfo("resources/sounds/snap.wav");
4358+ player->setMedia(QUrl::fromLocalFile(inf.absoluteFilePath()));
4359+ player->play();
4360+
4361+ Snapshot::saveSnapshot(_glWidget, _profile.getUsername(), _myAvatar.getPosition());
4362+}
4363+

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