Add flag to mark playing sequence

This commit is contained in:
jfmcarreira committed 2014-04-03 05:14:54 +01:00
1 parent 7e32bab5db
commit dd2f66b57e
3 files changed
+19 -5

No files matched your search

+13 -2
View File
@@ -176,6 +176,11 @@ Bool SubWindowHandle::save()
return true;
}
Void SubWindowHandle::play()
{
m_bIsPlaying = true;
}
Int SubWindowHandle::playEvent()
{
if( m_bIsPlaying )
@@ -209,8 +214,9 @@ Void SubWindowHandle::seekRelativeEvent( Bool bIsFoward )
refreshFrame();
}
Void SubWindowHandle::stopEvent()
Void SubWindowHandle::stop()
{
m_bIsPlaying = false;
seekAbsoluteEvent( 0 );
return;
}
@@ -321,7 +327,12 @@ Bool SubWindowHandle::mayClose()
void SubWindowHandle::closeEvent( QCloseEvent *event )
{
event->accept();
Bool bAccept = true;
bAccept = m_bIsPlaying ? false : bAccept;
if( bAccept )
event->accept();
else
event->ignore();
}
} // NAMESPACE
+2 -1
View File
@@ -67,8 +67,9 @@ public:
Bool loadFile( const QString &fileName );
Bool save();
Void play();
Int playEvent();
Void stopEvent();
Void stop();
Void seekAbsoluteEvent( UInt new_frame_num );
Void seekRelativeEvent( Bool bIsFoward );
+4 -2
View File
@@ -235,6 +235,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 ) );
}
}
@@ -243,6 +244,7 @@ void plaYUVerApp::play()
playingTimer->stop();
m_acPlayingSubWindows.clear();
m_acPlayingSubWindows.append( m_pcCurrentSubWindow );
m_pcCurrentSubWindow->play();
m_uiAveragePlayInterval = 0;
m_bIsPlaying = false;
}
@@ -270,7 +272,7 @@ void plaYUVerApp::stop()
{
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
{
m_acPlayingSubWindows.at( i )->stopEvent();
m_acPlayingSubWindows.at( i )->stop();
}
m_acPlayingSubWindows.clear();
playingTimer->stop();
@@ -284,7 +286,7 @@ void plaYUVerApp::stop()
}
else
{
m_pcCurrentSubWindow->stopEvent();
m_pcCurrentSubWindow->stop();
playingTimer->stop();
m_pcFrameSlider->setValue( m_pcCurrentSubWindow->getInputStream()->getCurrFrameNum() );
}