Showing the changes to interface/src/Application.cpp (1 of 14 files). Show all
Unified · Split
| @@ -8428,6 +8428,17 @@ bool Application::takeSnapshotOperators(std::queue<SnapshotOperator>& snapshotOp · 8427 unmodified lines | |||
| 8428 | return !snapshotOperators.empty(); | 8428 | return !snapshotOperators.empty(); |
| 8429 | } | 8429 | } |
| 8430 | 8430 | ||
| 8431 | void Application::addSecondarySnapshotOperator(const SecondarySnapshotOperator& snapshotOperator) { | ||
| 8432 | std::lock_guard<std::mutex> lock(_snapshotMutex); | ||
| 8433 | _secondarySnapshotOperators.push(snapshotOperator); | ||
| 8434 | } | ||
| 8435 | |||
| 8436 | bool Application::takeSecondarySnapshotOperators(std::queue<SecondarySnapshotOperator>& snapshotOperators) { | ||
| 8437 | std::lock_guard<std::mutex> lock(_snapshotMutex); | ||
| 8438 | _secondarySnapshotOperators.swap(snapshotOperators); | ||
| 8439 | return !snapshotOperators.empty(); | ||
| 8440 | } | ||
| 8441 | |||
| 8431 | void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRatio, const QString& filename) { | 8442 | void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRatio, const QString& filename) { |
| 8432 | addSnapshotOperator({ [notify, includeAnimated, aspectRatio, filename](const QImage& snapshot) { | 8443 | addSnapshotOperator({ [notify, includeAnimated, aspectRatio, filename](const QImage& snapshot) { |
| 8433 | QString path = DependencyManager::get<Snapshot>()->saveSnapshot(snapshot, filename, TestScriptingInterface::getInstance()->getTestResultsLocation()); | 8444 | QString path = DependencyManager::get<Snapshot>()->saveSnapshot(snapshot, filename, TestScriptingInterface::getInstance()->getTestResultsLocation()); |
| @@ -8439,16 +8450,17 @@ void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRa · 5 unmodified lines | |||
| 8439 | emit DependencyManager::get<WindowScriptingInterface>()->stillSnapshotTaken(path, notify); | 8450 | emit DependencyManager::get<WindowScriptingInterface>()->stillSnapshotTaken(path, notify); |
| 8440 | } | 8451 | } |
| 8441 | } else if (!SnapshotAnimated::isAlreadyTakingSnapshotAnimated()) { | 8452 | } else if (!SnapshotAnimated::isAlreadyTakingSnapshotAnimated()) { |
| 8442 | // Get an animated GIF snapshot and save it | 8453 | qApp->postLambdaEvent([path, aspectRatio] { |
| 8443 | SnapshotAnimated::saveSnapshotAnimated(path, aspectRatio, qApp, DependencyManager::get<WindowScriptingInterface>()); | 8454 | // Get an animated GIF snapshot and save it |
| 8455 | SnapshotAnimated::saveSnapshotAnimated(path, aspectRatio, DependencyManager::get<WindowScriptingInterface>()); | ||
| 8456 | }); | ||
| 8444 | } | 8457 | } |
| 8445 | }, aspectRatio }); | 8458 | }, aspectRatio }); |
| 8446 | } | 8459 | } |
| 8447 | 8460 | ||
| 8448 | void Application::takeSecondaryCameraSnapshot(const bool& notify, const QString& filename) { | 8461 | void Application::takeSecondaryCameraSnapshot(const bool& notify, const QString& filename) { |
| 8449 | postLambdaEvent([notify, filename, this] { | 8462 | addSecondarySnapshotOperator([notify, filename](const QImage& snapshot) { |
| 8450 | QString snapshotPath = DependencyManager::get<Snapshot>()->saveSnapshot(getActiveDisplayPlugin()->getSecondaryCameraScreenshot(), filename, | 8463 | QString snapshotPath = DependencyManager::get<Snapshot>()->saveSnapshot(snapshot, filename, TestScriptingInterface::getInstance()->getTestResultsLocation()); |
| 8451 | TestScriptingInterface::getInstance()->getTestResultsLocation()); | ||
| 8452 | 8464 | ||
| 8453 | emit DependencyManager::get<WindowScriptingInterface>()->stillSnapshotTaken(snapshotPath, notify); | 8465 | emit DependencyManager::get<WindowScriptingInterface>()->stillSnapshotTaken(snapshotPath, notify); |
| 8454 | }); | 8466 | }); |