diff options
author | James Cook <james@lindenlab.com> | 2008-04-30 23:30:09 +0000 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2008-04-30 23:30:09 +0000 |
commit | 36fccc3888c5dc318a8a235da8a5cae4faeb637d (patch) | |
tree | 021e439fe9fa3a285062d70bf0b8c0f799471681 /indra/newview/llfloatersnapshot.cpp | |
parent | cf2a96375f62316b98c2dddd57f812f7565584be (diff) |
svn merge -r 86190:86191 maint-ui-11-merge (EFFECTIVE MERGE: -r 84579:85724 maint-ui-11-qa).
Diffstat (limited to 'indra/newview/llfloatersnapshot.cpp')
-rw-r--r-- | indra/newview/llfloatersnapshot.cpp | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 6f31508fb8..e5b9eef72a 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -183,6 +183,7 @@ protected: LLQuaternion mCameraRot; BOOL mSnapshotActive; LLViewerWindow::ESnapshotType mSnapshotBufferType; + bool mSnapshotSoundPlayed; public: static std::set<LLSnapshotLivePreview*> sList; @@ -208,7 +209,8 @@ LLSnapshotLivePreview::LLSnapshotLivePreview (const LLRect& rect) : mCameraPos(LLViewerCamera::getInstance()->getOrigin()), mCameraRot(LLViewerCamera::getInstance()->getQuaternion()), mSnapshotActive(FALSE), - mSnapshotBufferType(LLViewerWindow::SNAPSHOT_TYPE_COLOR) + mSnapshotBufferType(LLViewerWindow::SNAPSHOT_TYPE_COLOR), + mSnapshotSoundPlayed(false) { mSnapshotDelayTimer.setTimerExpirySec(0.0f); mSnapshotDelayTimer.start(); @@ -764,6 +766,19 @@ void LLSnapshotLivePreview::onIdle( void* snapshot_preview ) { previewp->mRawImageEncoded->resize(previewp->mRawImage->getWidth(), previewp->mRawImage->getHeight(), previewp->mRawImage->getComponents()); + if (!gSavedSettings.getBOOL("QuietSnapshotsToDisk")) + { + // Always play the sound once, on window open. + // Don't keep playing if automatic + // updates are enabled. It's too invasive. JC + if (!previewp->mSnapshotSoundPlayed + || !gSavedSettings.getBOOL("AutoSnapshot") ) + { + gViewerWindow->playSnapshotAnimAndSound(); + previewp->mSnapshotSoundPlayed = true; + } + } + if (previewp->getSnapshotType() == SNAPSHOT_POSTCARD) { // *FIX: just resize and reuse existing jpeg? @@ -923,7 +938,9 @@ BOOL LLSnapshotLivePreview::saveLocal() class LLFloaterSnapshot::Impl { public: - Impl() : mLastToolset(NULL) + Impl() + : mAvatarPauseHandles(), + mLastToolset(NULL) { } ~Impl() @@ -1054,7 +1071,13 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp) previewp->setSize(gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight()); } - if (floaterp->childGetValue("freeze_frame_check").asBoolean()) + bool use_freeze_frame = floaterp->childGetValue("freeze_frame_check").asBoolean(); + // For now, auto-snapshot only works in freeze frame mode. + // This can be changed in the future by taking the FreezeTime check + // out of the onIdle() camera movement detection. JC + floaterp->childSetEnabled("auto_snapshot_check", use_freeze_frame); + + if (use_freeze_frame) { // stop all mouse events at fullscreen preview layer floaterp->getParent()->setMouseOpaque(TRUE); @@ -1089,6 +1112,9 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp) } else // turning off freeze frame mode { + // Force off auto-snapshot, see comment above about onIdle. JC + gSavedSettings.setBOOL("AutoSnapshot", FALSE); + floaterp->getParent()->setMouseOpaque(FALSE); floaterp->reshape(floaterp->getRect().getWidth(), floaterp->getUIWinHeightLong() + delta_height); if (previewp) @@ -1287,12 +1313,6 @@ void LLFloaterSnapshot::Impl::onClickKeep(void* data) if (gSavedSettings.getBOOL("CloseSnapshotOnKeep")) { view->close(); - // only plays sound and anim when keeping a snapshot, and closing the snapshot UI, - // and only if the save succeeded (i.e. was not canceled) - if (succeeded) - { - gViewerWindow->playSnapshotAnimAndSound(); - } } else { |