[vlmc-devel] commit: FileRendererDialog: Check and set progress. (Rohit Yadav )

git at videolan.org git at videolan.org
Sat Oct 30 13:38:55 CEST 2010


vlmc | branch: master | Rohit Yadav <rohityadav89 at gmail.com> | Sat Oct 30 17:23:04 2010 +0530| [2b52d996a402cc8835ec8693254ae7d0c915399b] | committer: Rohit Yadav 

FileRendererDialog: Check and set progress.
Apply HACKING on function implementation.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=2b52d996a402cc8835ec8693254ae7d0c915399b
---

 src/Gui/WorkflowFileRendererDialog.cpp |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/src/Gui/WorkflowFileRendererDialog.cpp b/src/Gui/WorkflowFileRendererDialog.cpp
index 8d6fd7b..78fb0ad 100644
--- a/src/Gui/WorkflowFileRendererDialog.cpp
+++ b/src/Gui/WorkflowFileRendererDialog.cpp
@@ -43,28 +43,37 @@ WorkflowFileRendererDialog::WorkflowFileRendererDialog( WorkflowFileRenderer* re
              Qt::QueuedConnection );
 }
 
-void    WorkflowFileRendererDialog::setOutputFileName( const QString& outputFileName )
+void
+WorkflowFileRendererDialog::setOutputFileName( const QString& outputFileName )
 {
     m_ui.nameLabel->setText( outputFileName );
     m_ui.previewLabel->setMinimumSize( m_width, m_height );
     setWindowTitle( "Rendering to " + outputFileName );
 }
 
-void    WorkflowFileRendererDialog::setProgressBarValue( int val )
+void
+WorkflowFileRendererDialog::setProgressBarValue( int val )
 {
     m_ui.progressBar->setValue( val );
 }
 
-void    WorkflowFileRendererDialog::updatePreview( const uchar* buff )
+void
+WorkflowFileRendererDialog::updatePreview( const uchar* buff )
 {
     m_ui.previewLabel->setPixmap(
             QPixmap::fromImage( QImage( buff, m_width, m_height,
                                         QImage::Format_RGB32 ) ) );
 }
 
-void    WorkflowFileRendererDialog::frameChanged( qint64 frame )
+void
+WorkflowFileRendererDialog::frameChanged( qint64 frame )
 {
-    m_ui.frameCounter->setText( tr("Rendering frame %1 / %2").arg(QString::number( frame ),
-                                    QString::number(MainWorkflow::getInstance()->getLengthFrame() ) ) );
-    setProgressBarValue( frame * 100 / MainWorkflow::getInstance()->getLengthFrame() );
+    qint64 totalFrames = MainWorkflow::getInstance()->getLengthFrame();
+
+    if ( frame <= totalFrames )
+    {
+        m_ui.frameCounter->setText( tr("Rendering frame %1 / %2").arg(QString::number( frame ),
+                                        QString::number( totalFrames ) ) );
+        setProgressBarValue( frame * 100 / totalFrames );
+    }
 }



More information about the Vlmc-devel mailing list