From 0bb3e132e861efb52eb8ff6debb372e00ce5be7b Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Wed, 5 Feb 2014 02:51:21 +0000 Subject: [PATCH 1/7] Add a slider on the bottom of the subwindow --- source/SubWindowHandle.cpp | 27 ++++++++++++++++++++++----- source/SubWindowHandle.h | 2 ++ 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/source/SubWindowHandle.cpp b/source/SubWindowHandle.cpp index 4d21efe..1017952 100644 --- a/source/SubWindowHandle.cpp +++ b/source/SubWindowHandle.cpp @@ -31,21 +31,38 @@ namespace plaYUVer SubWindowHandle::SubWindowHandle( QWidget * parent ) : QMdiSubWindow( parent ) { - setParent( parent ); + setParent( parent ); setAttribute( Qt::WA_DeleteOnClose ); setBackgroundRole( QPalette::Light ); // Create a new scroll area inside the sub-window - m_cScrollArea = new QScrollArea( this ); - setWidget( m_cScrollArea ); + m_cScrollArea = new QScrollArea; // Create a new interface to show images - m_cViewArea = new ViewArea( m_cScrollArea ); + m_cViewArea = new ViewArea; // Define the cViewArea as the widget inside the scroll area m_cScrollArea->setWidget( m_cViewArea ); + // Create Layout for the playing config + QHBoxLayout *pcHeadLayout = new QHBoxLayout; + pcHeadLayout->setObjectName( QStringLiteral( "HeadLayout" ) ); + m_pcFrameSlider = new QSlider(this); + QSpacerItem * headerSpacer0 = new QSpacerItem( 30, 2, QSizePolicy::Fixed, QSizePolicy::Minimum ); + m_pcFrameSlider->setObjectName( QStringLiteral( "FrameSlider" ) ); + m_pcFrameSlider->setOrientation( Qt::Horizontal ); + m_pcFrameSlider->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Minimum ); + QSpacerItem * headerSpacer1 = new QSpacerItem( 30, 2, QSizePolicy::Fixed, QSizePolicy::Minimum ); + pcHeadLayout->addSpacerItem( headerSpacer0 ); + pcHeadLayout->addWidget( m_pcFrameSlider, 5 ); + pcHeadLayout->addSpacerItem( headerSpacer1 ); + + //setWidget( m_cScrollArea ); + QLayout *pcMainLayout = layout(); + pcMainLayout->addWidget( m_cScrollArea ); + pcMainLayout->addItem( pcHeadLayout ); + m_cWindowName = QString( " " ); m_dScaleFactor = 1; @@ -93,7 +110,7 @@ bool SubWindowHandle::loadFile( const QString &fileName ) normalSize(); - m_cWindowName = QString("ola"); + m_cWindowName = QString( "ola" ); m_cWindowName = m_currStream.getStreamInformationString(); m_cCurrFileName = fileName; diff --git a/source/SubWindowHandle.h b/source/SubWindowHandle.h index 99d0de7..2a0b69f 100644 --- a/source/SubWindowHandle.h +++ b/source/SubWindowHandle.h @@ -50,6 +50,8 @@ private: QScrollArea* m_cScrollArea; ViewArea* m_cViewArea; + QSlider* m_pcFrameSlider; + InputStream m_currStream; QString m_cWindowName; From 4b164efd3bd6329254b4083cf648aeef9bffbe87 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Wed, 5 Feb 2014 03:09:53 +0000 Subject: [PATCH 2/7] Implemente slider function! Applications looks slower --- source/SubWindowHandle.cpp | 17 ++++++++++++++--- source/SubWindowHandle.h | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/source/SubWindowHandle.cpp b/source/SubWindowHandle.cpp index 1017952..fdb139a 100644 --- a/source/SubWindowHandle.cpp +++ b/source/SubWindowHandle.cpp @@ -48,11 +48,13 @@ SubWindowHandle::SubWindowHandle( QWidget * parent ) : // Create Layout for the playing config QHBoxLayout *pcHeadLayout = new QHBoxLayout; pcHeadLayout->setObjectName( QStringLiteral( "HeadLayout" ) ); - m_pcFrameSlider = new QSlider(this); QSpacerItem * headerSpacer0 = new QSpacerItem( 30, 2, QSizePolicy::Fixed, QSizePolicy::Minimum ); + m_pcFrameSlider = new QSlider( this ); m_pcFrameSlider->setObjectName( QStringLiteral( "FrameSlider" ) ); m_pcFrameSlider->setOrientation( Qt::Horizontal ); m_pcFrameSlider->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Minimum ); + m_pcFrameSlider->setEnabled( true ); + m_pcFrameSlider->setTracking( true ); QSpacerItem * headerSpacer1 = new QSpacerItem( 30, 2, QSizePolicy::Fixed, QSizePolicy::Minimum ); pcHeadLayout->addSpacerItem( headerSpacer0 ); pcHeadLayout->addWidget( m_pcFrameSlider, 5 ); @@ -63,6 +65,8 @@ SubWindowHandle::SubWindowHandle( QWidget * parent ) : pcMainLayout->addWidget( m_cScrollArea ); pcMainLayout->addItem( pcHeadLayout ); + connect( m_pcFrameSlider, SIGNAL( valueChanged(int) ), this, SLOT( seekSliderEvent() ) ); + m_cWindowName = QString( " " ); m_dScaleFactor = 1; @@ -110,9 +114,8 @@ bool SubWindowHandle::loadFile( const QString &fileName ) normalSize(); - m_cWindowName = QString( "ola" ); + m_pcFrameSlider->setRange( 0, m_currStream.getFrameNum() ); m_cWindowName = m_currStream.getStreamInformationString(); - m_cCurrFileName = fileName; setWindowTitle( m_cWindowName ); @@ -150,6 +153,13 @@ bool SubWindowHandle::save() return true; } +void SubWindowHandle::seekSliderEvent() +{ + m_currStream.seekInput( m_pcFrameSlider->sliderPosition() ); + m_currStream.readFrame(); + m_cViewArea->setImage( QPixmap::fromImage( m_currStream.getFrameQImage() ) ); +} + bool SubWindowHandle::playEvent() { m_currStream.readFrame(); @@ -164,6 +174,7 @@ bool SubWindowHandle::playEvent() return false; } m_cViewArea->setImage( QPixmap::fromImage( m_currStream.getFrameQImage() ) ); + m_pcFrameSlider->setSliderPosition( m_currStream.getCurrFrameNum() ); return true; } diff --git a/source/SubWindowHandle.h b/source/SubWindowHandle.h index 2a0b69f..d791922 100644 --- a/source/SubWindowHandle.h +++ b/source/SubWindowHandle.h @@ -127,7 +127,7 @@ protected: Void closeEvent( QCloseEvent *event ); private slots: - + void seekSliderEvent(); }; } // NAMESPACE From 2c854c07e1a968410c8dd71666b66a5077b3b435 Mon Sep 17 00:00:00 2001 From: Luis Lucas Date: Sat, 8 Feb 2014 19:27:41 +0000 Subject: [PATCH 3/7] Undo erroneous merge changes. --- source/SubWindowHandle.cpp | 37 +++++-------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/source/SubWindowHandle.cpp b/source/SubWindowHandle.cpp index 009f43c..9ea4ca6 100644 --- a/source/SubWindowHandle.cpp +++ b/source/SubWindowHandle.cpp @@ -31,42 +31,21 @@ namespace plaYUVer SubWindowHandle::SubWindowHandle( QWidget * parent ) : QMdiSubWindow( parent ) { - setParent( parent ); + setAttribute( Qt::WA_DeleteOnClose ); setBackgroundRole( QPalette::Light ); // Create a new scroll area inside the sub-window - m_cScrollArea = new QScrollArea; + m_cScrollArea = new QScrollArea( this ); + setWidget( m_cScrollArea ); // Create a new interface to show images - m_cViewArea = new ViewArea; + m_cViewArea = new ViewArea( m_cScrollArea ); // Define the cViewArea as the widget inside the scroll area m_cScrollArea->setWidget( m_cViewArea ); - // Create Layout for the playing config - QHBoxLayout *pcHeadLayout = new QHBoxLayout; - pcHeadLayout->setObjectName( QStringLiteral( "HeadLayout" ) ); - QSpacerItem * headerSpacer0 = new QSpacerItem( 30, 2, QSizePolicy::Fixed, QSizePolicy::Minimum ); - m_pcFrameSlider = new QSlider( this ); - m_pcFrameSlider->setObjectName( QStringLiteral( "FrameSlider" ) ); - m_pcFrameSlider->setOrientation( Qt::Horizontal ); - m_pcFrameSlider->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Minimum ); - m_pcFrameSlider->setEnabled( true ); - m_pcFrameSlider->setTracking( true ); - QSpacerItem * headerSpacer1 = new QSpacerItem( 30, 2, QSizePolicy::Fixed, QSizePolicy::Minimum ); - pcHeadLayout->addSpacerItem( headerSpacer0 ); - pcHeadLayout->addWidget( m_pcFrameSlider, 5 ); - pcHeadLayout->addSpacerItem( headerSpacer1 ); - - //setWidget( m_cScrollArea ); - QLayout *pcMainLayout = layout(); - pcMainLayout->addWidget( m_cScrollArea ); - pcMainLayout->addItem( pcHeadLayout ); - - connect( m_pcFrameSlider, SIGNAL( valueChanged(int) ), this, SLOT( seekSliderEvent() ) ); - m_cWindowName = QString( " " ); m_bIsPlaying = true; m_dScaleFactor = 1; @@ -122,6 +101,7 @@ bool SubWindowHandle::loadFile( const QString &fileName ) m_cWindowName = QString( " " ); m_cWindowName = m_pCurrStream->getStreamInformationString(); + m_cCurrFileName = fileName; setWindowTitle( m_cWindowName ); @@ -159,13 +139,6 @@ bool SubWindowHandle::save() return true; } -void SubWindowHandle::seekSliderEvent() -{ - m_currStream.seekInput( m_pcFrameSlider->sliderPosition() ); - m_currStream.readFrame(); - m_cViewArea->setImage( QPixmap::fromImage( m_currStream.getFrameQImage() ) ); -} - bool SubWindowHandle::playEvent() { bool iRet = true; From c2c3d8d80d6753f051bf9fb98956f970d4dc5d44 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Sat, 8 Feb 2014 22:36:36 +0000 Subject: [PATCH 4/7] Add refresh frame function --- source/SubWindowHandle.cpp | 19 ++++++++++--------- source/SubWindowHandle.h | 2 ++ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/source/SubWindowHandle.cpp b/source/SubWindowHandle.cpp index 9ea4ca6..7ac4e09 100644 --- a/source/SubWindowHandle.cpp +++ b/source/SubWindowHandle.cpp @@ -94,9 +94,7 @@ bool SubWindowHandle::loadFile( const QString &fileName ) QApplication::restoreOverrideCursor(); - m_pCurrStream->getFrame( m_pCurrFrameQImage ); - m_cViewArea->setImage( QPixmap::fromImage( *m_pCurrFrameQImage ) ); - + refreshFrame(); normalSize(); m_cWindowName = QString( " " ); @@ -109,6 +107,12 @@ bool SubWindowHandle::loadFile( const QString &fileName ) return true; } +Void SubWindowHandle::refreshFrame() +{ + m_pCurrStream->getFrame( m_pCurrFrameQImage ); + m_cViewArea->setImage( QPixmap::fromImage( *m_pCurrFrameQImage ) ); +} + bool SubWindowHandle::save() { QString supported = tr( "Supported Files" ); @@ -154,8 +158,7 @@ bool SubWindowHandle::playEvent() { iRet = false; } - m_pCurrStream->getFrame( m_pCurrFrameQImage ); - m_cViewArea->setImage( QPixmap::fromImage( *m_pCurrFrameQImage ) ); + refreshFrame(); return iRet; } return false; @@ -165,16 +168,14 @@ Void SubWindowHandle::seekEvent( UInt new_frame_num ) { m_pCurrStream->seekInput( new_frame_num ); m_pCurrStream->readFrame(); - m_pCurrStream->getFrame( m_pCurrFrameQImage ); - m_cViewArea->setImage( QPixmap::fromImage( *m_pCurrFrameQImage ) ); + refreshFrame(); } Void SubWindowHandle::stopEvent() { m_pCurrStream->seekInput( 0 ); m_pCurrStream->readFrame(); - m_pCurrStream->getFrame( m_pCurrFrameQImage ); - m_cViewArea->setImage( QPixmap::fromImage( *m_pCurrFrameQImage ) ); + refreshFrame(); return; } diff --git a/source/SubWindowHandle.h b/source/SubWindowHandle.h index e92233b..985bc2e 100644 --- a/source/SubWindowHandle.h +++ b/source/SubWindowHandle.h @@ -70,6 +70,8 @@ public: Void stopEvent(); Void seekEvent( UInt new_frame_num ); + Void refreshFrame(); + InputStream* getInputStream() { return m_pCurrStream; From de147bbd92bba3bf501501aaf2c0667f5ffc04da Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Fri, 21 Feb 2014 18:58:26 +0000 Subject: [PATCH 5/7] Increase the resolution limit --- source/ConfigureFormatDialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ConfigureFormatDialog.cpp b/source/ConfigureFormatDialog.cpp index 31848df..1c068af 100755 --- a/source/ConfigureFormatDialog.cpp +++ b/source/ConfigureFormatDialog.cpp @@ -124,7 +124,7 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget *parent ) : widthLabel->setText( QApplication::translate( "ConfigureFormat", "Width", 0 ) ); widthSpinBox = new QSpinBox(); widthSpinBox->setObjectName( QStringLiteral( "widthSpinBox" ) ); - widthSpinBox->setRange( 0, 5000 ); + widthSpinBox->setRange( 0, 7240 ); widthSpinBox->setValue( 0 ); heightLabel = new QLabel(); @@ -132,7 +132,7 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget *parent ) : heightLabel->setText( QApplication::translate( "ConfigureFormat", "Height", 0 ) ); heightSpinBox = new QSpinBox(); heightSpinBox->setObjectName( QStringLiteral( "heightSpinBox" ) ); - heightSpinBox->setRange( 0, 5000 ); + heightSpinBox->setRange( 0, 5432 ); heightSpinBox->setValue( 0 ); pixelsLabel = new QLabel(); From fbb91b24f35d07468b78bd1afc0faa6510ce30f2 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Wed, 5 Mar 2014 17:45:29 +0000 Subject: [PATCH 6/7] Add a new report line into cmake output --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d1d0719..7173a79 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,6 +83,7 @@ IF( NOT USE_QT4) ENDIF() -status("Using third-party libraries:") +status("Dependencies:") +status(" QT:" USE_QT4 THEN "QT4" ELSE "QT5" ) status(" Use OpenCV:" USE_OPENCV THEN YES ELSE NO) status(" FFMPEG:" USE_FFMPEG THEN YES ELSE NO) From 3d76888a998c4ab65f5c4076094d8e36f9bf36c8 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Wed, 5 Mar 2014 17:53:36 +0000 Subject: [PATCH 7/7] Fix compatibility with QT4 in QTimer usage --- source/plaYUVerApp.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/plaYUVerApp.cpp b/source/plaYUVerApp.cpp index 53580c5..7bd192f 100644 --- a/source/plaYUVerApp.cpp +++ b/source/plaYUVerApp.cpp @@ -64,7 +64,9 @@ plaYUVerApp::plaYUVerApp() setUnifiedTitleAndToolBarOnMac( true ); playingTimer = new QTimer; +#if( QT_VERSION_PLAYUVER == 5 ) playingTimer->setTimerType( Qt::CoarseTimer ); +#endif connect( playingTimer, SIGNAL( timeout() ), this, SLOT( playEvent() ) ); setAcceptDrops( true );