From 681e8c0d6b6498a1867fabedda64e54d3c877a97 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Fri, 9 May 2014 05:21:04 +0100 Subject: [PATCH] Add function to return the max number of frames of the sequences in the display list --- source/app/plaYUVerApp.cpp | 15 +++++++++++++-- source/app/plaYUVerApp.h | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/source/app/plaYUVerApp.cpp b/source/app/plaYUVerApp.cpp index c574d69..6905c5a 100644 --- a/source/app/plaYUVerApp.cpp +++ b/source/app/plaYUVerApp.cpp @@ -296,6 +296,18 @@ void plaYUVerApp::updatePropertiesSelectedArea( QRect area ) // ----------------------- Playing Functions -------------------- +UInt plaYUVerApp::getMaxFrameNumber() +{ + UInt currFrames; + UInt maxFrames = INT_MAX; + for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ ) + { + currFrames = m_acPlayingSubWindows.at( i )->getInputStream()->getFrameNum(); + if( currFrames < maxFrames ) + maxFrames = currFrames; + } + return maxFrames; +} Void plaYUVerApp::setTimerStatus() { Bool status = false; @@ -337,7 +349,7 @@ void plaYUVerApp::play() m_acPlayingSubWindows.append( m_pcCurrentSubWindow ); m_pcCurrentSubWindow->seekAbsoluteEvent( m_acPlayingSubWindows.at( 0 )->getInputStream()->getCurrFrameNum() ); m_pcCurrentSubWindow->play(); - m_pcFrameSlider->setMaximum( qMin( m_pcFrameSlider->maximum(), ( Int )m_pcCurrentSubWindow->getInputStream()->getFrameNum() - 1 ) ); + m_pcFrameSlider->setMaximum( getMaxFrameNumber() - 1 ); } } else @@ -543,7 +555,6 @@ Void plaYUVerApp::zoomToFitAll() } } - void plaYUVerApp::scaleFrame( int ratio ) { if( activeSubWindow() ) diff --git a/source/app/plaYUVerApp.h b/source/app/plaYUVerApp.h index 4aa9bab..aa1cfe8 100644 --- a/source/app/plaYUVerApp.h +++ b/source/app/plaYUVerApp.h @@ -121,6 +121,7 @@ private: Void zoomToFitAll(); //! Playing functions + UInt getMaxFrameNumber(); Void setTimerStatus(); Void updateCurrFrameNum(); Void updateTotalFrameNum( UInt total_frame_num = 0 );