diff --git a/source/app/SubWindowHandle.cpp b/source/app/SubWindowHandle.cpp index bb8b2e0..92464cd 100644 --- a/source/app/SubWindowHandle.cpp +++ b/source/app/SubWindowHandle.cpp @@ -202,6 +202,12 @@ Int SubWindowHandle::playEvent() return -1; } +Void SubWindowHandle::pause() +{ + m_bIsPlaying = false; + return; +} + Void SubWindowHandle::seekAbsoluteEvent( UInt new_frame_num ) { m_pCurrStream->seekInput( new_frame_num ); diff --git a/source/app/SubWindowHandle.h b/source/app/SubWindowHandle.h index 154a355..928cdfe 100644 --- a/source/app/SubWindowHandle.h +++ b/source/app/SubWindowHandle.h @@ -68,6 +68,7 @@ public: Bool save(); Void play(); + Void pause(); Int playEvent(); Void stop(); diff --git a/source/app/plaYUVerApp.cpp b/source/app/plaYUVerApp.cpp index 3c37f83..6e3bc5e 100644 --- a/source/app/plaYUVerApp.cpp +++ b/source/app/plaYUVerApp.cpp @@ -263,33 +263,30 @@ void plaYUVerApp::play() void plaYUVerApp::pause() { + for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ ) + { + m_acPlayingSubWindows.at( i )->pause(); + } playingTimer->stop(); } void plaYUVerApp::stop() { - if( m_acPlayingSubWindows.size() ) + for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ ) { - for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ ) - { - m_acPlayingSubWindows.at( i )->stop(); - } - m_acPlayingSubWindows.clear(); - playingTimer->stop(); - m_pcFrameSlider->setValue( m_pcCurrentSubWindow->getInputStream()->getCurrFrameNum() ); + m_acPlayingSubWindows.at( i )->stop(); + } + m_acPlayingSubWindows.clear(); + playingTimer->stop(); + m_pcFrameSlider->setValue( m_pcCurrentSubWindow->getInputStream()->getCurrFrameNum() ); + + if( m_uiAveragePlayInterval ) + qDebug( ) << "Real display time: " + << QString::number( 1000 / m_uiAveragePlayInterval ) + << " fps"; + m_uiAveragePlayInterval = 0; + - if( m_uiAveragePlayInterval ) - qDebug( ) << "Real display time: " - << QString::number( 1000 / m_uiAveragePlayInterval ) - << " fps"; - m_uiAveragePlayInterval = 0; - } - else - { - m_pcCurrentSubWindow->stop(); - playingTimer->stop(); - m_pcFrameSlider->setValue( m_pcCurrentSubWindow->getInputStream()->getCurrFrameNum() ); - } } void plaYUVerApp::playEvent()