| 258 | } |
| 259 | |
| 260 | std::shared_ptr<pag::File> PAGExport::exportAsFile() { |
| 261 | auto id = GetItemID(itemHandle); |
| 262 | |
| 263 | PAGExportSessionManager::GetInstance()->setCurrentSession(session); |
| 264 | ScopedAssign<pag::ID> arCI(session->compID, id); |
| 265 | session->progressModel.addTotalSteps(1); |
| 266 | |
| 267 | ExportComposition(session, itemHandle); |
| 268 | AdjustTrackMatteLayer(session); |
| 269 | if (session->stopExport) { |
| 270 | return nullptr; |
| 271 | } |
| 272 | |
| 273 | pag::Codec::InstallReferences(session->compositions); |
| 274 | addRootComposition(); |
| 275 | if (session->stopExport) { |
| 276 | return nullptr; |
| 277 | } |
| 278 | |
| 279 | auto compositions = session->compositions; |
| 280 | if (session->exportAudio && session->configParam.isTagCodeSupport(pag::TagCode::AudioBytes)) { |
| 281 | GetAudioSequence(itemHandle, session->outputPath, compositions[compositions.size() - 1]); |
| 282 | CombineAudioMarkers(compositions); |
| 283 | } |
| 284 | if (session->stopExport) { |
| 285 | return nullptr; |
| 286 | } |
| 287 | |
| 288 | std::vector<pag::ImageBytes*> images = getRefImages(compositions); |
| 289 | CheckBeforeExport(session, compositions, images); |
| 290 | |
| 291 | if (session->stopExport || |
| 292 | (session->showAlertInfo && !AlertInfoManager::GetInstance().showAlertInfo())) { |
| 293 | canceled = true; |
| 294 | return nullptr; |
| 295 | } |
| 296 | |
| 297 | exportResources(compositions); |
| 298 | if (session->stopExport) { |
| 299 | return nullptr; |
| 300 | } |
| 301 | |
| 302 | AdjustCompositionSize(compositions); |
| 303 | CheckAfterExport(session, compositions); |
| 304 | if (session->stopExport) { |
| 305 | return nullptr; |
| 306 | } |
| 307 | |
| 308 | if (!session->configParam.exportLayerName || |
| 309 | !session->configParam.isTagCodeSupport(pag::TagCode::LayerAttributesV2)) { |
| 310 | ClearLayerName(compositions.back()); |
| 311 | } |
| 312 | |
| 313 | if (!session->exportActually) { |
| 314 | return nullptr; |
| 315 | } |
| 316 | |
| 317 | auto pagFile = pag::Codec::VerifyAndMake(compositions, images); |
nothing calls this directly
no test coverage detected