/*! update the frame range according to the current frame type */ void ComboViewerPanel::updateFrameRange() { TFrameHandle *fh = TApp::instance()->getCurrentFrame(); int frameIndex = fh->getFrameIndex(); int maxFrameIndex = fh->getMaxFrameIndex(); if (frameIndex > maxFrameIndex) frameIndex = maxFrameIndex; m_flipConsole->setFrameRange(1, maxFrameIndex + 1, 1, frameIndex + 1); }
void ComboViewerPanel::onSceneChanged() { TFrameHandle *fh = TApp::instance()->getCurrentFrame(); int frameIndex = fh->getFrameIndex(); int maxFrameIndex = fh->getMaxFrameIndex(); if (frameIndex > maxFrameIndex) maxFrameIndex = frameIndex; // set the FPS for new scene m_flipConsole->setFrameRate(TApp::instance() ->getCurrentScene() ->getScene() ->getProperties() ->getOutputProperties() ->getFrameRate()); // update the frame slider's range with new frameHandle m_flipConsole->setFrameRange(1, maxFrameIndex + 1, 1, frameIndex + 1); // set the markers int fromIndex, toIndex, dummy; XsheetGUI::getPlayRange(fromIndex, toIndex, dummy); m_flipConsole->setMarkers(fromIndex, toIndex); // update the key frames if (m_keyFrameButton && (m_keyFrameButton->getCurrentFrame() != frameIndex)) m_keyFrameButton->setCurrentFrame(frameIndex); }
void ComboViewerPanel::onDrawFrame( int frame, const ImagePainter::VisualSettings &settings) { TApp *app = TApp::instance(); m_sceneViewer->setVisual(settings); TFrameHandle *frameHandle = app->getCurrentFrame(); if (m_sceneViewer->isPreviewEnabled()) { class Previewer *pr = Previewer::instance(m_sceneViewer->getPreviewMode() == SceneViewer::SUBCAMERA_PREVIEW); pr->getRaster(frame - 1); // the 'getRaster' starts the render of the frame // is not already started int curFrame = frame; if (frameHandle->isPlaying() && !pr->isFrameReady( frame - 1)) // stops on last rendered frame until current is ready! { while (frame > 0 && !pr->isFrameReady(frame - 1)) frame--; if (frame == 0) frame = curFrame; // if no frame is ready, I stay on current...no use // to rewind m_flipConsole->setCurrentFrame(frame); } } assert(frame >= 0); if (frame != frameHandle->getFrameIndex() + 1) { if (frameHandle->isEditingScene()) { TXshColumn *column = app->getCurrentXsheet()->getXsheet()->getColumn( app->getCurrentColumn()->getColumnIndex()); if (column) { TXshSoundColumn *soundColumn = column->getSoundColumn(); if (soundColumn && !soundColumn->isPlaying()) app->getCurrentFrame()->scrubColumn(frame, frame, soundColumn); } } frameHandle->setCurrentFrame(frame); } else if (settings.m_blankColor != TPixel::Transparent) m_sceneViewer->update(); }