MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / startTask

Method startTask

Gui/ProgressPanel.cpp:435–501  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

433}
434
435void
436ProgressPanel::startTask(const NodePtr& node,
437 const int firstFrame,
438 const int lastFrame,
439 const int frameStep,
440 const bool canPause,
441 const bool canCancel,
442 const QString& message,
443 const ProcessHandlerPtr& process)
444{
445 assert( QThread::currentThread() == qApp->thread() );
446 if (!node) {
447 return;
448 }
449 assert( (canPause && firstFrame != std::numeric_limits<int>::min() && lastFrame != std::numeric_limits<int>::max()) || !canPause );
450
451 ProgressTaskInfoPtr task;
452 {
453 QMutexLocker k(&_imp->tasksMutex);
454 task = _imp->findTask(node);
455 }
456 if (task) {
457 task->cancelTask(false, 1);
458 removeTaskFromTable(task);
459 }
460
461
462 QMutexLocker k(&_imp->tasksMutex);
463
464 task.reset( new ProgressTaskInfo(this,
465 node,
466 firstFrame,
467 lastFrame,
468 frameStep,
469 canPause,
470 canCancel,
471 message, process) );
472
473 task->setTaskBar(_taskbar);
474
475 if ( canPause || node->getEffectInstance()->isOutput() ) {
476 task->createItems();
477 QTimer::singleShot( NATRON_DISPLAY_PROGRESS_PANEL_AFTER_MS, this, SLOT(onShowProgressPanelTimerTriggered()) );
478 }
479
480 if (process) {
481 connectProcessSlots( task.get(), process.get() );
482 }
483 if (!process) {
484 if ( node->getEffectInstance()->isOutput() ) {
485 OutputEffectInstance* isOutput = dynamic_cast<OutputEffectInstance*>( node->getEffectInstance().get() );
486 if (isOutput) {
487
488 if ( getGui() && !getGui()->isGUIFrozen() && appPTR->getCurrentSettings()->isAutoTurboEnabled() ) {
489 getGui()->onFreezeUIButtonClicked(true);
490 }
491
492 RenderEnginePtr engine = isOutput->getRenderEngine();

Callers 1

onRenderStartedMethod · 0.45

Calls 15

maxFunction · 0.85
connectProcessSlotsFunction · 0.85
getGuiFunction · 0.85
findTaskMethod · 0.80
cancelTaskMethod · 0.80
setTaskBarMethod · 0.80
getEffectInstanceMethod · 0.80
createItemsMethod · 0.80
isGUIFrozenMethod · 0.80
isAutoTurboEnabledMethod · 0.80
getCurrentSettingsMethod · 0.80

Tested by

no test coverage detected