Add stop function. Trying to implement a different playing behaviour with a direct connection to the SubWindow class

This commit is contained in:
2014-02-07 23:49:58 +00:00
parent 05e007c135
commit 3ee9a4b277
3 changed files with 42 additions and 25 deletions
+24 -11
View File
@@ -47,6 +47,7 @@ SubWindowHandle::SubWindowHandle( QWidget * parent ) :
m_cScrollArea->setWidget( m_cViewArea );
m_cWindowName = QString( " " );
m_bIsPlaying = true;
m_dScaleFactor = 1;
}
@@ -93,7 +94,7 @@ bool SubWindowHandle::loadFile( const QString &fileName )
normalSize();
m_cWindowName = QString("ola");
m_cWindowName = QString( "ola" );
m_cWindowName = m_currStream.getStreamInformationString();
m_cCurrFileName = fileName;
@@ -133,23 +134,35 @@ bool SubWindowHandle::save()
return true;
}
bool SubWindowHandle::playEvent()
int SubWindowHandle::playEvent()
{
m_currStream.readFrame();
if( m_currStream.checkErrors( READING ) )
{
QMessageBox::warning( this, tr( "plaYUVer" ), tr( "Cannot read %1." ).arg( m_cCurrFileName ) );
return false;
}
else if( m_currStream.checkErrors( END_OF_SEQ ) )
if( m_bIsPlaying )
{
m_currStream.readFrame();
if( m_currStream.checkErrors( READING ) )
{
QMessageBox::warning( this, tr( "plaYUVer" ), tr( "Cannot read %1." ).arg( m_cCurrFileName ) );
return false;
}
else if( m_currStream.checkErrors( END_OF_SEQ ) )
{
m_cViewArea->setImage( QPixmap::fromImage( m_currStream.getFrameQImage() ) );
return false;
}
m_cViewArea->setImage( QPixmap::fromImage( m_currStream.getFrameQImage() ) );
return false;
}
m_cViewArea->setImage( QPixmap::fromImage( m_currStream.getFrameQImage() ) );
return true;
}
Void SubWindowHandle::stopEvent()
{
m_currStream.seekInput( 0 );
m_currStream.readFrame();
m_cViewArea->setImage( QPixmap::fromImage( m_currStream.getFrameQImage() ) );
return;
}
Void SubWindowHandle::normalSize()
{
m_dScaleFactor = 1.0;