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

Method startTask

Gui/ProgressPanel.cpp:427–492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

onRenderStartedMethod · 0.45

Calls 13

connectProcessSlotsFunction · 0.85
getGuiFunction · 0.85
findTaskMethod · 0.80
cancelTaskMethod · 0.80
getEffectInstanceMethod · 0.80
createItemsMethod · 0.80
isGUIFrozenMethod · 0.80
isAutoTurboEnabledMethod · 0.80
getCurrentSettingsMethod · 0.80
resetMethod · 0.45
isOutputMethod · 0.45

Tested by

no test coverage detected