void ViewerTab::manageSlotsForInfoWidget(int textureIndex, bool connect) { RenderEnginePtr engine = _imp->viewerNode.lock()->getNode()->getRenderEngine(); assert(engine); if (connect) { QObject::connect( engine.get(), SIGNAL(fpsChanged(double,double)), _imp->infoWidget[textureIndex], SLOT(setFps(double,double)) ); QObject::connect( engine.get(), SIGNAL(renderFinished(int)), _imp->infoWidget[textureIndex], SLOT(hideFps()) ); } else {
void ViewerTab::abortViewersAndRefresh() { Gui* gui = getGui(); if (!gui) { return; } const std::list<ViewerTab*> & activeNodes = gui->getViewersList(); for (std::list<ViewerTab*>::const_iterator it = activeNodes.begin(); it != activeNodes.end(); ++it) { ViewerNodePtr viewer = (*it)->getInternalNode(); if (viewer) { ViewerInstancePtr instance = viewer->getInternalViewerNode(); if (instance) { RenderEnginePtr engine = instance->getRenderEngine(); if ( engine ) { engine->abortRenderingAutoRestart(); engine->renderCurrentFrame(false, true); } } } } }
void ProgressPanel::startTask(const NodePtr& node, const TimeValue firstFrame, const TimeValue lastFrame, const TimeValue frameStep, const bool canPause, const bool canCancel, const QString& message, const ProcessHandlerPtr& process) { assert( QThread::currentThread() == qApp->thread() ); if (!node) { return; } assert( (canPause && firstFrame != INT_MIN && lastFrame != INT_MAX) || !canPause ); ProgressTaskInfoPtr task; { QMutexLocker k(&_imp->tasksMutex); task = _imp->findTask(node); } if (task) { task->cancelTask(false, 1); removeTaskFromTable(task); } QMutexLocker k(&_imp->tasksMutex); task.reset( new ProgressTaskInfo(this, node, firstFrame, lastFrame, frameStep, canPause, canCancel, message, process) ); if ( canPause || node->getEffectInstance()->isOutput() ) { task->createItems(); QTimer::singleShot( NATRON_DISPLAY_PROGRESS_PANEL_AFTER_MS, this, SLOT(onShowProgressPanelTimerTriggered()) ); } if (process) { connectProcessSlots( task.get(), process.get() ); } if (!process) { if ( node->getEffectInstance()->isOutput() ) { if ( getGui() && !getGui()->isGUIFrozen() && appPTR->getCurrentSettings()->isAutoTurboEnabled() ) { getGui()->onFreezeUIButtonClicked(true); } RenderEnginePtr engine = node->getRenderEngine(); assert(engine); QObject::connect( engine.get(), SIGNAL(frameRendered(int,double)), task.get(), SLOT(onRenderEngineFrameComputed(int,double)) ); QObject::connect( engine.get(), SIGNAL(renderFinished(int)), task.get(), SLOT(onRenderEngineStopped(int)) ); QObject::connect( task.get(), SIGNAL(taskCanceled()), engine.get(), SLOT(abortRendering_non_blocking()) ); } } _imp->tasks[node] = task; } // ProgressPanel::startTask