From 76901f5bf91dec7520448b15184dd22d32c70e6c Mon Sep 17 00:00:00 2001 From: Patrick Manalich Date: Fri, 2 Jun 2017 14:08:56 -0700 Subject: [PATCH] Final Application.cpp change --- interface/src/Application.cpp | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index bdefbc6773..d3ad850733 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2780,6 +2780,17 @@ void Application::keyPressEvent(QKeyEvent* event) { if (isShifted && isMeta && !isOption) { Menu::getInstance()->triggerOption(MenuOption::SuppressShortTimings); } else if (!isOption && !isShifted && isMeta) { + AudioInjectorOptions options; + options.localOnly = true; + options.stereo = true; + + if (_snapshotSoundInjector) { + _snapshotSoundInjector->setOptions(options); + _snapshotSoundInjector->restart(); + } else { + QByteArray samples = _snapshotSound->getByteArray(); + _snapshotSoundInjector = AudioInjector::playSound(samples, options); + } takeSnapshot(true); } break; @@ -6312,21 +6323,6 @@ void Application::loadAddAvatarBookmarkDialog() const { } void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRatio) { - - //keep sound thread out of event loop scope - - AudioInjectorOptions options; - options.localOnly = true; - options.stereo = true; - - if (_snapshotSoundInjector) { - _snapshotSoundInjector->setOptions(options); - _snapshotSoundInjector->restart(); - } else { - QByteArray samples = _snapshotSound->getByteArray(); - _snapshotSoundInjector = AudioInjector::playSound(samples, options); - } - postLambdaEvent([notify, includeAnimated, aspectRatio, this] { // Get a screenshot and save it QString path = Snapshot::saveSnapshot(getActiveDisplayPlugin()->getScreenshot(aspectRatio));