Edit: Snapshot will make sound when initially clicked

This commit is contained in:
Patrick Manalich 2017-06-01 14:26:39 -07:00
parent 4e61db8263
commit 0c71cf4bda
2 changed files with 9 additions and 9 deletions

View file

@ -591,8 +591,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
_aboutToQuit(false), _aboutToQuit(false),
_notifiedPacketVersionMismatchThisDomain(false), _notifiedPacketVersionMismatchThisDomain(false),
_maxOctreePPS(maxOctreePacketsPerSecond.get()), _maxOctreePPS(maxOctreePacketsPerSecond.get()),
_lastFaceTrackerUpdate(0)/*, _lastFaceTrackerUpdate(0),
_snapshotSound(nullptr)*/ _snapshotSound(nullptr)
{ {
auto steamClient = PluginManager::getInstance()->getSteamClientPlugin(); auto steamClient = PluginManager::getInstance()->getSteamClientPlugin();
setProperty(hifi::properties::STEAM, (steamClient && steamClient->isRunning())); setProperty(hifi::properties::STEAM, (steamClient && steamClient->isRunning()));
@ -1421,8 +1421,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
return entityServerNode && !isPhysicsEnabled(); return entityServerNode && !isPhysicsEnabled();
}); });
/*QFileInfo inf = QFileInfo(PathUtils::resourcesPath() + "sounds/snap.wav"); QFileInfo inf = QFileInfo(PathUtils::resourcesPath() + "sounds/snap.wav");
_snapshotSound = DependencyManager::get<SoundCache>()->getSound(QUrl::fromLocalFile(inf.absoluteFilePath()));*/ _snapshotSound = DependencyManager::get<SoundCache>()->getSound(QUrl::fromLocalFile(inf.absoluteFilePath()));
QVariant testProperty = property(hifi::properties::TEST); QVariant testProperty = property(hifi::properties::TEST);
qDebug() << testProperty; qDebug() << testProperty;
@ -1656,9 +1656,9 @@ void Application::cleanupBeforeQuit() {
// stop QML // stop QML
DependencyManager::destroy<OffscreenUi>(); DependencyManager::destroy<OffscreenUi>();
/*if (_snapshotSoundInjector != nullptr) { if (_snapshotSoundInjector != nullptr) {
_snapshotSoundInjector->stop(); _snapshotSoundInjector->stop();
}*/ }
// FIXME: something else is holding a reference to AudioClient, // FIXME: something else is holding a reference to AudioClient,
// so it must be explicitly synchronously stopped here // so it must be explicitly synchronously stopped here
@ -6315,7 +6315,7 @@ void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRa
//keep sound thread out of event loop scope //keep sound thread out of event loop scope
/*AudioInjectorOptions options; AudioInjectorOptions options;
options.localOnly = true; options.localOnly = true;
options.stereo = true; options.stereo = true;
@ -6325,7 +6325,7 @@ void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRa
} else { } else {
QByteArray samples = _snapshotSound->getByteArray(); QByteArray samples = _snapshotSound->getByteArray();
_snapshotSoundInjector = AudioInjector::playSound(samples, options); _snapshotSoundInjector = AudioInjector::playSound(samples, options);
}*/ }
postLambdaEvent([notify, includeAnimated, aspectRatio, this] { postLambdaEvent([notify, includeAnimated, aspectRatio, this] {
// Get a screenshot and save it // Get a screenshot and save it

View file

@ -13,7 +13,7 @@
(function() { // BEGIN LOCAL_SCOPE (function() { // BEGIN LOCAL_SCOPE
var SNAPSHOT_DELAY = 500; // 500ms var SNAPSHOT_DELAY = 500; // 500ms
var FINISH_SOUND_DELAY = 350; //350ms var FINISH_SOUND_DELAY = 350;
var resetOverlays; var resetOverlays;
var reticleVisible; var reticleVisible;
var clearOverlayWhenMoving; var clearOverlayWhenMoving;