Improve modules handle in order to be compatible with new windows
This commit is contained in:
1 parent
769bcead86
commit
78d09e03af
7 files changed
+101
-79
No files matched your search
+38
-35
@@ -224,6 +224,8 @@ void plaYUVerApp::selectModule( QAction *curr_action )
|
||||
if( interfaceChild )
|
||||
{
|
||||
mdiArea->addSubWindow( interfaceChild );
|
||||
interfaceChild->show();
|
||||
interfaceChild->zoomToFit();
|
||||
interfaceChild->getViewArea()->setTool( m_appTool );
|
||||
}
|
||||
return;
|
||||
@@ -247,7 +249,7 @@ Void plaYUVerApp::updateFrameProperties()
|
||||
{
|
||||
if( m_pcCurrentSubWindow )
|
||||
{
|
||||
m_pcFrameProperties->setData( m_pcCurrentSubWindow->getInputStream()->getCurrFrame() );
|
||||
m_pcFrameProperties->setData( m_pcCurrentSubWindow->getCurrFrame() );
|
||||
//m_pcFrameProperties->setSelection( m_pcCurrentSubWindow->getViewArea()->selectedArea() );
|
||||
}
|
||||
else
|
||||
@@ -297,47 +299,51 @@ Void plaYUVerApp::setTimerStatus()
|
||||
|
||||
void plaYUVerApp::play()
|
||||
{
|
||||
if( m_pcCurrentSubWindow )
|
||||
if( !m_pcCurrentSubWindow )
|
||||
return;
|
||||
|
||||
if( !m_pcCurrentSubWindow->getInputStream() )
|
||||
return;
|
||||
|
||||
if( actionVideoLock->isChecked() && m_acPlayingSubWindows.size() )
|
||||
{
|
||||
if( actionVideoLock->isChecked() && m_acPlayingSubWindows.size() )
|
||||
Bool bFind = false;
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
{
|
||||
Bool bFind = false;
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
if( m_acPlayingSubWindows.at( i ) == m_pcCurrentSubWindow )
|
||||
{
|
||||
if( m_acPlayingSubWindows.at( i ) == m_pcCurrentSubWindow )
|
||||
{
|
||||
bFind = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( !bFind )
|
||||
{
|
||||
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 ) );
|
||||
bFind = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
if( !bFind )
|
||||
{
|
||||
playingTimer->stop();
|
||||
m_acPlayingSubWindows.clear();
|
||||
m_acPlayingSubWindows.append( m_pcCurrentSubWindow );
|
||||
m_pcCurrentSubWindow->seekAbsoluteEvent( m_acPlayingSubWindows.at( 0 )->getInputStream()->getCurrFrameNum() );
|
||||
m_pcCurrentSubWindow->play();
|
||||
m_uiAveragePlayInterval = 0;
|
||||
m_bIsPlaying = false;
|
||||
}
|
||||
if( !m_bIsPlaying )
|
||||
{
|
||||
UInt frameRate = m_acPlayingSubWindows.at( 0 )->getInputStream()->getFrameRate();
|
||||
UInt timeInterval = ( UInt )( 1000.0 / frameRate + 0.5 );
|
||||
qDebug( ) << "Desired frame rate: "
|
||||
<< QString::number( 1000 / timeInterval )
|
||||
<< " fps";
|
||||
playingTimer->start( timeInterval );
|
||||
m_cTimer.start();
|
||||
m_pcFrameSlider->setMaximum( qMin( m_pcFrameSlider->maximum(), ( Int )m_pcCurrentSubWindow->getInputStream()->getFrameNum() - 1 ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
playingTimer->stop();
|
||||
m_acPlayingSubWindows.clear();
|
||||
m_acPlayingSubWindows.append( m_pcCurrentSubWindow );
|
||||
m_pcCurrentSubWindow->play();
|
||||
m_uiAveragePlayInterval = 0;
|
||||
m_bIsPlaying = false;
|
||||
}
|
||||
if( !m_bIsPlaying )
|
||||
{
|
||||
UInt frameRate = m_acPlayingSubWindows.at( 0 )->getInputStream()->getFrameRate();
|
||||
UInt timeInterval = ( UInt )( 1000.0 / frameRate + 0.5 );
|
||||
qDebug( ) << "Desired frame rate: "
|
||||
<< QString::number( 1000 / timeInterval )
|
||||
<< " fps";
|
||||
playingTimer->start( timeInterval );
|
||||
m_cTimer.start();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void plaYUVerApp::pause()
|
||||
@@ -453,7 +459,6 @@ void plaYUVerApp::seekEvent( int direction )
|
||||
else
|
||||
{
|
||||
m_pcCurrentSubWindow->seekRelativeEvent( direction > 0 ? true : false );
|
||||
|
||||
}
|
||||
updateFrameProperties();
|
||||
updateCurrFrameNum();
|
||||
@@ -536,8 +541,6 @@ void plaYUVerApp::chageSubWindowSelection()
|
||||
if( activeSubWindow() )
|
||||
{
|
||||
m_pcCurrentSubWindow = new_window;
|
||||
m_pcStreamProperties->setData( m_pcCurrentSubWindow->getInputStream() );
|
||||
m_pcFrameProperties->setData( m_pcCurrentSubWindow->getInputStream()->getCurrFrame() );
|
||||
updateCurrFrameNum();
|
||||
updateTotalFrameNum();
|
||||
updateStreamProperties();
|
||||
|
||||
Reference in new issue
Block a user