Incorporate the DialogSubWindowSelector into the main app

This commit is contained in:
jfmcarreira committed 2014-05-09 05:14:13 +01:00
1 parent 8f7120f062
commit 6fc7001fa3
3 files changed
+44 -14

No files matched your search

+6 -1
View File
@@ -52,7 +52,10 @@ Q_OBJECT
public:
DialogSubWindowSelector( QWidget *parent = 0, QMdiArea *mdiArea = 0 );
QStringList getSelectedWindows()
{
return m_pcSelectedWindowListNames;
}
private:
QMdiArea* m_pcMainWindowMdiArea;
QStringList m_pcWindowListNames;
@@ -65,6 +68,8 @@ private:
Void updateSubWindowList();
private Q_SLOTS:
void addSubWindow();
void removeSubWindow();
+37 -13
View File
@@ -314,6 +314,20 @@ Void plaYUVerApp::setTimerStatus()
}
}
Void plaYUVerApp::startPlay()
{
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::play()
{
if( !m_pcCurrentSubWindow )
@@ -350,17 +364,7 @@ void plaYUVerApp::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();
}
startPlay();
}
void plaYUVerApp::pause()
@@ -523,8 +527,28 @@ void plaYUVerApp::lockButtonEvent()
void plaYUVerApp::videoSelectionButtonEvent()
{
DialogSubWindowSelector dialogWindowsSelection( this, mdiArea );
dialogWindowsSelection.exec();
if( dialogWindowsSelection.exec() == QDialog::Accepted )
{
QStringList selectedWindows = dialogWindowsSelection.getSelectedWindows();
m_acPlayingSubWindows.clear();
SubWindowHandle *subWindow;
QString windowName;
for( Int i = 0; i < mdiArea->subWindowList().size(); i++ )
{
subWindow = qobject_cast<SubWindowHandle *>( mdiArea->subWindowList().at( i ) );
windowName = subWindow->getWindowName();
if( selectedWindows.contains( windowName ) )
{
m_acPlayingSubWindows.append( subWindow );
subWindow->seekAbsoluteEvent( m_acPlayingSubWindows.at( 0 )->getInputStream()->getCurrFrameNum() );
subWindow->play();
m_pcFrameSlider->setMaximum( qMin( m_pcFrameSlider->maximum(), ( Int )subWindow->getInputStream()->getFrameNum() - 1 ) );
}
}
m_arrayActions[VIDEO_LOCK_ACT]->setChecked( true );
startPlay();
return;
}
}
// ----------------------- Zoom Functions -----------------------
+1
View File
@@ -122,6 +122,7 @@ private:
Void zoomToFitAll();
//! Playing functions
Void startPlay();
Void setTimerStatus();
Void updateCurrFrameNum();
Void updateTotalFrameNum( UInt total_frame_num = 0 );