From a4b140c7c8734342a8b507a2aa4ba8681b570eb1 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Fri, 10 Apr 2015 01:57:42 +0100 Subject: [PATCH] Rename some class and files --- app/CMakeLists.txt | 4 +- app/DialogSubWindowSelector.cpp | 4 +- app/DialogSubWindowSelector.h | 10 +- ...iesSidebar.cpp => FramePropertiesDock.cpp} | 40 +++--- ...pertiesSidebar.h => FramePropertiesDock.h} | 14 +-- app/ModulesHandle.cpp | 7 +- app/PlaYUVerApp.cpp | 114 ++++++++++-------- app/PlaYUVerApp.h | 32 +++-- app/PlaYUVerAppAdaptor.cpp | 2 +- app/PlaYUVerAppAdaptor.h | 6 +- app/PlaYUVerAppModuleIf.cpp | 1 + app/PlaYUVerMdiSubWindow.cpp | 5 +- app/PlaYUVerMdiSubWindow.h | 7 +- app/PlaYUVerSubWindowHandle.cpp | 44 +++---- app/PlaYUVerSubWindowHandle.h | 22 ++-- app/PlotSubWindow.cpp | 2 +- app/PlotSubWindow.h | 6 +- app/QualityHandle.cpp | 6 +- app/QualityMeasurementSidebar.cpp | 2 +- ...WindowHandle.cpp => SubWindowAbstract.cpp} | 43 ++++--- ...{SubWindowHandle.h => SubWindowAbstract.h} | 36 +++--- app/VideoHandle.cpp | 35 ++++-- app/VideoHandle.h | 26 ++-- app/VideoSubWindow.cpp | 6 +- app/VideoSubWindow.h | 17 ++- app/main.cpp | 10 +- lib/LibAvContextHandle.cpp | 14 +-- 27 files changed, 275 insertions(+), 240 deletions(-) rename app/{FramePropertiesSidebar.cpp => FramePropertiesDock.cpp} (94%) rename app/{FramePropertiesSidebar.h => FramePropertiesDock.h} (91%) rename app/{SubWindowHandle.cpp => SubWindowAbstract.cpp} (82%) rename app/{SubWindowHandle.h => SubWindowAbstract.h} (87%) diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 6f4c803..7eccdda 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -48,13 +48,13 @@ set(plaYUVer_App_SRCS PlaYUVerApp.cpp PlaYUVerSubWindowHandle.cpp PlaYUVerMdiSubWindow.cpp - SubWindowHandle.cpp + SubWindowAbstract.cpp Settings.cpp # Module Video VideoSubWindow.cpp ViewArea.cpp VideoHandle.cpp - FramePropertiesSidebar.cpp + FramePropertiesDock.cpp # Module Quality QualityHandle.cpp QualityMeasurementSidebar.cpp diff --git a/app/DialogSubWindowSelector.cpp b/app/DialogSubWindowSelector.cpp index d340242..fd9a644 100644 --- a/app/DialogSubWindowSelector.cpp +++ b/app/DialogSubWindowSelector.cpp @@ -84,7 +84,7 @@ DialogSubWindowSelector::DialogSubWindowSelector( QWidget *parent, PlaYUVerSubWi m_mapperWindowsList = new QSignalMapper( this ); connect( m_mapperWindowsList, SIGNAL( mapped(int) ), this, SLOT( toggleSubWindow(int) ) ); - SubWindowHandle *subWindow; + SubWindowAbstract *subWindow; QString currSubWindowName; QCheckBox* windowCheckBox; m_apcSubWindowList = m_pcMainWindowManager->findSubWindow( m_uiCategory ); @@ -143,7 +143,7 @@ Void DialogSubWindowSelector::updateSubWindowList() // << m_apcSelectedSubWindowList.size(); } -Void DialogSubWindowSelector::selectSubWindow( SubWindowHandle * subWindow ) +Void DialogSubWindowSelector::selectSubWindow( SubWindowAbstract * subWindow ) { Int iIdx = m_apcSubWindowList.indexOf( subWindow ); if( iIdx >= 0 ) diff --git a/app/DialogSubWindowSelector.h b/app/DialogSubWindowSelector.h index eb1fa7c..619b508 100644 --- a/app/DialogSubWindowSelector.h +++ b/app/DialogSubWindowSelector.h @@ -45,7 +45,7 @@ namespace plaYUVer { class PlaYUVerSubWindowHandle; -class SubWindowHandle; +class SubWindowAbstract; /** * Class to define the dialog box to select sub windows @@ -58,8 +58,8 @@ Q_OBJECT public: DialogSubWindowSelector( QWidget *parent, PlaYUVerSubWindowHandle *windowManager, UInt uiCategory, Int minWindowsSelected = 1, Int maxWindowsSelected = -1 ); - Void selectSubWindow( SubWindowHandle* subWindow ); - QList getSelectedWindows() + Void selectSubWindow( SubWindowAbstract* subWindow ); + QList getSelectedWindows() { return m_apcSelectedSubWindowList; } @@ -69,8 +69,8 @@ private: Int m_iMaxSlectedWindows; PlaYUVerSubWindowHandle* m_pcMainWindowManager; - QList m_apcSubWindowList; - QList m_apcSelectedSubWindowList; + QList m_apcSubWindowList; + QList m_apcSelectedSubWindowList; QSignalMapper* m_mapperWindowsList; QGroupBox* m_pcGroupCheckBox; diff --git a/app/FramePropertiesSidebar.cpp b/app/FramePropertiesDock.cpp similarity index 94% rename from app/FramePropertiesSidebar.cpp rename to app/FramePropertiesDock.cpp index bd271f3..dfa2c33 100644 --- a/app/FramePropertiesSidebar.cpp +++ b/app/FramePropertiesDock.cpp @@ -18,19 +18,19 @@ */ /** - * \file FramePropertiesSideBar.cpp + * \file FramePropertiesDock.cpp * \brief Main side bar definition */ #include #include #include -#include "FramePropertiesSidebar.h" +#include "FramePropertiesDock.h" namespace plaYUVer { -FramePropertiesSideBar::FramePropertiesSideBar( QWidget* parent, Bool* pbMainPlaySwitch ) : +FramePropertiesDock::FramePropertiesDock( QWidget* parent, Bool* pbMainPlaySwitch ) : QWidget( parent ), pbMainPlaySwitch( pbMainPlaySwitch ) { @@ -242,7 +242,7 @@ FramePropertiesSideBar::FramePropertiesSideBar( QWidget* parent, Bool* pbMainPla } -FramePropertiesSideBar::~FramePropertiesSideBar() +FramePropertiesDock::~FramePropertiesDock() { // If there is a currently histogram computation when dialog is closed, // stop it before the image data are deleted automatically! @@ -251,7 +251,7 @@ FramePropertiesSideBar::~FramePropertiesSideBar() delete histogramWidget; } -QSize FramePropertiesSideBar::sizeHint() const +QSize FramePropertiesDock::sizeHint() const { QSize currSize = size(); QSize bestSize( 180, currSize.height() ); @@ -260,7 +260,7 @@ QSize FramePropertiesSideBar::sizeHint() const return currSize; } -Void FramePropertiesSideBar::setData( PlaYUVerFrame* pcFrame, Bool isPlaying ) +Void FramePropertiesDock::setData( PlaYUVerFrame* pcFrame, Bool isPlaying ) { m_pbIsPlaying = isPlaying; if( !pcFrame ) @@ -348,7 +348,7 @@ Void FramePropertiesSideBar::setData( PlaYUVerFrame* pcFrame, Bool isPlaying ) } } -Void FramePropertiesSideBar::setSelection( const QRect &selectionArea ) +Void FramePropertiesDock::setSelection( const QRect &selectionArea ) { // This is necessary to stop computation because image.bits() is // currently used by threaded histogram algorithm. @@ -376,7 +376,7 @@ Void FramePropertiesSideBar::setSelection( const QRect &selectionArea ) } } -Void FramePropertiesSideBar::updateDataHistogram() +Void FramePropertiesDock::updateDataHistogram() { if( m_pcFrame->isValid() && isVisible() ) { @@ -403,7 +403,7 @@ Void FramePropertiesSideBar::updateDataHistogram() } } -Void FramePropertiesSideBar::updateStatistiques() +Void FramePropertiesDock::updateStatistiques() { QString value; @@ -444,7 +444,7 @@ Void FramePropertiesSideBar::updateStatistiques() } } -Void FramePropertiesSideBar::stopHistogram() +Void FramePropertiesDock::stopHistogram() { histogramWidget->stopHistogramComputation(); } @@ -453,7 +453,7 @@ Void FramePropertiesSideBar::stopHistogram() // SLOTS //////////////////////////////////////////////////////////////////////////////// -Void FramePropertiesSideBar::slotRefreshOptions( int range ) +Void FramePropertiesDock::slotRefreshOptions( int range ) { if( !isVisible() ) return; @@ -476,12 +476,12 @@ Void FramePropertiesSideBar::slotRefreshOptions( int range ) } } -Void FramePropertiesSideBar::slotHistogramComputationFailed() +Void FramePropertiesDock::slotHistogramComputationFailed() { m_pcFrame = NULL; } -Void FramePropertiesSideBar::slotChannelChanged( Int channel ) +Void FramePropertiesDock::slotChannelChanged( Int channel ) { if( m_pcFrame->getColorSpace() == PlaYUVerFrame::COLOR_YUV ) channel += 1; @@ -519,13 +519,13 @@ Void FramePropertiesSideBar::slotChannelChanged( Int channel ) updateStatistiques(); } -Void FramePropertiesSideBar::slotScaleChanged( Int scale ) +Void FramePropertiesDock::slotScaleChanged( Int scale ) { histogramWidget->m_scaleType = scale; histogramWidget->update(); } -Void FramePropertiesSideBar::slotColorsChanged( Int color ) +Void FramePropertiesDock::slotColorsChanged( Int color ) { switch( color ) { @@ -544,14 +544,14 @@ Void FramePropertiesSideBar::slotColorsChanged( Int color ) updateStatistiques(); } -Void FramePropertiesSideBar::slotRenderingChanged( Int rendering ) +Void FramePropertiesDock::slotRenderingChanged( Int rendering ) { histogramWidget->m_renderingType = rendering; histogramWidget->update(); updateStatistiques(); } -Void FramePropertiesSideBar::slotMinValueChanged( Int min ) +Void FramePropertiesDock::slotMinValueChanged( Int min ) { // Called when user changes values of spin box. // Communicate the change to histogram widget. @@ -565,7 +565,7 @@ Void FramePropertiesSideBar::slotMinValueChanged( Int min ) updateStatistiques(); } -Void FramePropertiesSideBar::slotMaxValueChanged( Int max ) +Void FramePropertiesDock::slotMaxValueChanged( Int max ) { if( max == minInterv->value() - 1 ) minInterv->setValue( max ); @@ -575,7 +575,7 @@ Void FramePropertiesSideBar::slotMaxValueChanged( Int max ) updateStatistiques(); } -Void FramePropertiesSideBar::slotUpdateInterval( Int min, Int max ) +Void FramePropertiesDock::slotUpdateInterval( Int min, Int max ) { // Called when value is set from within histogram widget. // Block signals to prevent slotMinValueChanged and @@ -593,7 +593,7 @@ Void FramePropertiesSideBar::slotUpdateInterval( Int min, Int max ) updateStatistiques(); } -Void FramePropertiesSideBar::slotUpdateIntervRange( Int range ) +Void FramePropertiesDock::slotUpdateIntervRange( Int range ) { maxInterv->blockSignals( true ); maxInterv->setMaximum( range ); diff --git a/app/FramePropertiesSidebar.h b/app/FramePropertiesDock.h similarity index 91% rename from app/FramePropertiesSidebar.h rename to app/FramePropertiesDock.h index 7120acf..dbb34ad 100644 --- a/app/FramePropertiesSidebar.h +++ b/app/FramePropertiesDock.h @@ -18,12 +18,12 @@ */ /** - * \file FramePropertiesSidebar.h + * \file FramePropertiesDock.h * \brief Main side bar definition */ -#ifndef __FRAMEPROPERTIESSIDEBAR_H__ -#define __FRAMEPROPERTIESSIDEBAR_H__ +#ifndef __FRAMEPROPERTIESDOCK_H__ +#define __FRAMEPROPERTIESDOCK_H__ #include "config.h" #include "PlaYUVerAppDefs.h" @@ -40,12 +40,12 @@ namespace plaYUVer { -class FramePropertiesSideBar: public QWidget +class FramePropertiesDock: public QWidget { Q_OBJECT public: - FramePropertiesSideBar( QWidget* parent, Bool* pbMainPlaySwitch ); - ~FramePropertiesSideBar(); + FramePropertiesDock( QWidget* parent, Bool* pbMainPlaySwitch ); + ~FramePropertiesDock(); QSize sizeHint() const; @@ -132,4 +132,4 @@ private Q_SLOTS: } // NAMESPACE -#endif // __FRAMEPROPERTIESSIDEBAR_H__ +#endif // __FRAMEPROPERTIESDOCK_H__ diff --git a/app/ModulesHandle.cpp b/app/ModulesHandle.cpp index c051662..d2ff4b0 100644 --- a/app/ModulesHandle.cpp +++ b/app/ModulesHandle.cpp @@ -25,6 +25,7 @@ #include #include "ModulesHandle.h" #include "PlaYUVerSubWindowHandle.h" +#include "VideoSubWindow.h" #include "VideoHandle.h" #include "PlaYUVerModuleFactory.h" #include "DialogSubWindowSelector.h" @@ -251,8 +252,8 @@ Void ModulesHandle::enableModuleIf( PlaYUVerAppModuleIf *pcCurrModuleIf ) Int numberOfFrames = pcCurrModuleIf->m_pcModule->m_uiNumberOfFrames; if( numberOfFrames > MODULE_REQUIRES_ONE_FRAME ) // Show dialog to select sub windows { - DialogSubWindowSelector dialogWindowsSelection( m_pcParent, m_pcMainWindowManager, SubWindowHandle::VIDEO_SUBWINDOW, numberOfFrames, numberOfFrames ); - QList windowsList = m_pcMainWindowManager->findSubWindow( SubWindowHandle::VIDEO_SUBWINDOW ); + DialogSubWindowSelector dialogWindowsSelection( m_pcParent, m_pcMainWindowManager, SubWindowAbstract::VIDEO_SUBWINDOW, numberOfFrames, numberOfFrames ); + QList windowsList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW ); if( windowsList.size() <= numberOfFrames ) { @@ -269,7 +270,7 @@ Void ModulesHandle::enableModuleIf( PlaYUVerAppModuleIf *pcCurrModuleIf ) if( dialogWindowsSelection.exec() == QDialog::Accepted ) { VideoSubWindow *videoSubWindow; - QList subWindowList = dialogWindowsSelection.getSelectedWindows(); + QList subWindowList = dialogWindowsSelection.getSelectedWindows(); for( Int i = 0; i < subWindowList.size(); i++ ) { videoSubWindow = qobject_cast( subWindowList.at( i ) ); diff --git a/app/PlaYUVerApp.cpp b/app/PlaYUVerApp.cpp index 8a3e74c..298179c 100644 --- a/app/PlaYUVerApp.cpp +++ b/app/PlaYUVerApp.cpp @@ -19,16 +19,26 @@ /** * \file PlaYUVerApp.cpp - * \brief Main definition of the plaYUVerApp app + * \brief Main definition of the PlaYUVerApp app */ #include +#include +#include +#include +#include +#include +#include +#include #include "PlaYUVerApp.h" #ifdef USE_FERVOR #include "fvupdater.h" #endif #include "lib/PlaYUVerCmdParser.h" #include "PlaYUVerSubWindowHandle.h" +#include "AboutDialog.h" +#include "SubWindowAbstract.h" +#include "VideoSubWindow.h" #include "VideoHandle.h" #include "QualityHandle.h" #include "ModulesHandle.h" @@ -39,7 +49,7 @@ namespace plaYUVer { -plaYUVerApp::plaYUVerApp() : +PlaYUVerApp::PlaYUVerApp() : m_pcCurrentSubWindow( NULL ), m_pcCurrentVideoSubWindow( NULL ), m_pcAboutDialog( NULL ) @@ -83,7 +93,7 @@ plaYUVerApp::plaYUVerApp() : } -Bool plaYUVerApp::parseArgs( Int argc, Char *argv[] ) +Bool PlaYUVerApp::parseArgs( Int argc, Char *argv[] ) { Bool bRet = false; m_pcCmdParser = new PlaYUVerCmdParser(); @@ -126,19 +136,19 @@ Bool plaYUVerApp::parseArgs( Int argc, Char *argv[] ) return bRet; } -Void plaYUVerApp::about() +Void PlaYUVerApp::about() { if( !m_pcAboutDialog ) m_pcAboutDialog = new AboutDialog( this ); m_pcAboutDialog->exec(); } -Void plaYUVerApp::closeEvent( QCloseEvent *event ) +Void PlaYUVerApp::closeEvent( QCloseEvent *event ) { Int mayCloseAll = true; Int msgBoxCloseRet = QMessageBox::Yes; - QList subWindowList = m_pcWindowHandle->findSubWindow(); + QList subWindowList = m_pcWindowHandle->findSubWindow(); if( subWindowList.size() >= 1 ) { QMessageBox msgBoxClose( QMessageBox::Question, "PlaYUVer", "There are open files!", QMessageBox::Yes | QMessageBox::No, this ); @@ -173,26 +183,26 @@ Void plaYUVerApp::closeEvent( QCloseEvent *event ) } } -Void plaYUVerApp::closeAll() +Void PlaYUVerApp::closeAll() { m_pcWindowHandle->removeAllSubWindow(); } -Void plaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo ) +Void PlaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo ) { if( !QFileInfo( fileName ).exists() ) { statusBar()->showMessage( "File " + fileName + " do not exist!", 2000 ); return; } - VideoSubWindow *videoSubWindow = plaYUVerApp::findVideoStreamSubWindow( m_pcWindowHandle, fileName ); + VideoSubWindow *videoSubWindow = PlaYUVerApp::findVideoStreamSubWindow( m_pcWindowHandle, fileName ); if( videoSubWindow ) { m_pcWindowHandle->setActiveSubWindow( videoSubWindow ); return; } videoSubWindow = new VideoSubWindow( VideoSubWindow::VIDEO_STREAM_SUBWINDOW ); //createSubWindow(); - SubWindowHandle *subWindow = videoSubWindow; + SubWindowAbstract *subWindow = videoSubWindow; if( !pStreamInfo ) { Int idx = findPlaYUVerStreamInfo( m_aRecentFileStreamInfo, fileName ); @@ -216,7 +226,7 @@ Void plaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo ) connect( videoSubWindow->getViewArea(), SIGNAL( selectionChanged( QRect ) ), m_appModuleVideo, SLOT( updateSelectionArea( QRect ) ) ); - connect( subWindow, SIGNAL( aboutToClose( SubWindowHandle* ) ), m_appModuleVideo, SLOT( closeSubWindow( SubWindowHandle* ) ) ); + connect( subWindow, SIGNAL( aboutToClose( SubWindowAbstract* ) ), m_appModuleVideo, SLOT( closeSubWindow( SubWindowAbstract* ) ) ); connect( subWindow, SIGNAL( zoomFactorChanged_SWindow( const double, const QPoint ) ), m_appModuleVideo, SLOT( zoomToFactorAll( double, QPoint ) ) ); connect( subWindow, SIGNAL( scrollBarMoved_SWindow( const QPoint ) ), m_appModuleVideo, SLOT( moveAllScrollBars( const QPoint ) ) ); @@ -246,7 +256,7 @@ Void plaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo ) // ----------------------- File Functions ----------------------- -Void plaYUVerApp::open() +Void PlaYUVerApp::open() { QString supported = tr( "Supported Files (" ); QStringList formatsList; @@ -282,7 +292,7 @@ Void plaYUVerApp::open() } } -Void plaYUVerApp::openRecent() +Void PlaYUVerApp::openRecent() { QAction *action = qobject_cast( sender() ); PlaYUVerStreamInfo recentFile = action->data().value(); @@ -290,7 +300,7 @@ Void plaYUVerApp::openRecent() loadFile( recentFile.m_cFilename, &recentFile ); } -Void plaYUVerApp::save() +Void PlaYUVerApp::save() { if( m_pcCurrentVideoSubWindow ) { @@ -333,7 +343,7 @@ Void plaYUVerApp::save() } } -Void plaYUVerApp::format() +Void PlaYUVerApp::format() { if( m_pcCurrentVideoSubWindow ) { @@ -358,7 +368,7 @@ Void plaYUVerApp::format() } } -Void plaYUVerApp::reload() +Void PlaYUVerApp::reload() { if( m_pcCurrentSubWindow ) { @@ -368,17 +378,17 @@ Void plaYUVerApp::reload() } } -Void plaYUVerApp::reloadAll() +Void PlaYUVerApp::reloadAll() { UInt windowCategoryOrder[] = { - SubWindowHandle::VIDEO_STREAM_SUBWINDOW, - SubWindowHandle::MODULE_SUBWINDOW, - SubWindowHandle::MODULE_SUBWINDOW }; + SubWindowAbstract::VIDEO_STREAM_SUBWINDOW, + SubWindowAbstract::MODULE_SUBWINDOW, + SubWindowAbstract::MODULE_SUBWINDOW }; for( UInt c = 0; c < 3; c++ ) { - QList subWindowList = m_pcWindowHandle->findSubWindow( windowCategoryOrder[c] ); + QList subWindowList = m_pcWindowHandle->findSubWindow( windowCategoryOrder[c] ); for( Int i = 0; i < subWindowList.size(); i++ ) { subWindowList.at( i )->refreshSubWindow(); @@ -388,7 +398,7 @@ Void plaYUVerApp::reloadAll() update(); } -Void plaYUVerApp::loadAll() +Void PlaYUVerApp::loadAll() { if( m_pcCurrentVideoSubWindow ) { @@ -398,11 +408,11 @@ Void plaYUVerApp::loadAll() } } -Void plaYUVerApp::setTool( Int idxTool ) +Void PlaYUVerApp::setTool( Int idxTool ) { m_uiViewTool = idxTool; actionGroupTools->actions().at( m_uiViewTool )->setChecked( true ); - QList subWindowList = m_pcWindowHandle->findSubWindow(); + QList subWindowList = m_pcWindowHandle->findSubWindow(); for( Int i = 0; i < subWindowList.size(); i++ ) { subWindowList.at( i )->setTool( m_uiViewTool ); @@ -411,7 +421,7 @@ Void plaYUVerApp::setTool( Int idxTool ) // ----------------------- Zoom Functions ----------------------- -Void plaYUVerApp::normalSize() +Void PlaYUVerApp::normalSize() { if( m_pcCurrentSubWindow ) { @@ -420,7 +430,7 @@ Void plaYUVerApp::normalSize() } } -Void plaYUVerApp::zoomToFit() +Void PlaYUVerApp::zoomToFit() { if( m_pcCurrentSubWindow ) { @@ -429,10 +439,10 @@ Void plaYUVerApp::zoomToFit() } } -Void plaYUVerApp::zoomToFitAll() +Void PlaYUVerApp::zoomToFitAll() { VideoSubWindow *videoSubWindow; - QList subWindowList = m_pcWindowHandle->findSubWindow( SubWindowHandle::VIDEO_SUBWINDOW ); + QList subWindowList = m_pcWindowHandle->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW ); for( Int i = 0; i < subWindowList.size(); i++ ) { videoSubWindow = qobject_cast( subWindowList.at( i ) ); @@ -443,7 +453,7 @@ Void plaYUVerApp::zoomToFitAll() updateZoomFactorSBox(); } -Void plaYUVerApp::scaleFrame( int ratio ) +Void PlaYUVerApp::scaleFrame( int ratio ) { if( m_pcCurrentSubWindow ) { @@ -452,9 +462,9 @@ Void plaYUVerApp::scaleFrame( int ratio ) } } -Void plaYUVerApp::zoomFromSBox( double zoom ) +Void PlaYUVerApp::zoomFromSBox( double zoom ) { - SubWindowHandle *activeSubWindow = m_pcWindowHandle->activeSubWindow(); + SubWindowAbstract *activeSubWindow = m_pcWindowHandle->activeSubWindow(); Double factor = zoom / 100; if( activeSubWindow ) { @@ -462,7 +472,7 @@ Void plaYUVerApp::zoomFromSBox( double zoom ) } } -Void plaYUVerApp::updateZoomFactorSBox() +Void PlaYUVerApp::updateZoomFactorSBox() { Double factor; if( m_pcCurrentSubWindow ) @@ -474,14 +484,14 @@ Void plaYUVerApp::updateZoomFactorSBox() // ----------------------- Drag and drop functions ---------------------- -Void plaYUVerApp::dragEnterEvent( QDragEnterEvent *event ) +Void PlaYUVerApp::dragEnterEvent( QDragEnterEvent *event ) { //setText(tr("")); //mdiArea->setBackgroundRole( QPalette::Highlight ); event->acceptProposedAction(); } -Void plaYUVerApp::dropEvent( QDropEvent *event ) +Void PlaYUVerApp::dropEvent( QDropEvent *event ) { const QMimeData *mimeData = event->mimeData(); QList urlList = mimeData->urls(); @@ -495,11 +505,11 @@ Void plaYUVerApp::dropEvent( QDropEvent *event ) // ----------------------- Sub Window Functions ----------------------- -VideoSubWindow* plaYUVerApp::findVideoStreamSubWindow( const PlaYUVerSubWindowHandle* windowManager, const QString& fileName ) +VideoSubWindow* PlaYUVerApp::findVideoStreamSubWindow( const PlaYUVerSubWindowHandle* windowManager, const QString& fileName ) { QString canonicalFilePath = QFileInfo( fileName ).canonicalFilePath(); VideoSubWindow* pcSubWindow; - QList subWindowList = windowManager->findSubWindow( SubWindowHandle::VIDEO_STREAM_SUBWINDOW ); + QList subWindowList = windowManager->findSubWindow( SubWindowAbstract::VIDEO_STREAM_SUBWINDOW ); for( Int i = 0; i < subWindowList.size(); i++ ) { pcSubWindow = qobject_cast( subWindowList.at( i ) ); @@ -511,9 +521,9 @@ VideoSubWindow* plaYUVerApp::findVideoStreamSubWindow( const PlaYUVerSubWindowHa // ----------------------- Update Functions ----------------------- -Void plaYUVerApp::update() +Void PlaYUVerApp::update() { - SubWindowHandle *activeSubWindow = m_pcWindowHandle->activeSubWindow(); + SubWindowAbstract *activeSubWindow = m_pcWindowHandle->activeSubWindow(); QCoreApplication::processEvents(); //if( activeSubWindow() != m_pcCurrentSubWindow ) { @@ -523,7 +533,7 @@ Void plaYUVerApp::update() { m_pcCurrentSubWindow = activeSubWindow; - if( m_pcCurrentSubWindow->getCategory() & SubWindowHandle::VIDEO_SUBWINDOW ) + if( m_pcCurrentSubWindow->getCategory() & SubWindowAbstract::VIDEO_SUBWINDOW ) { m_pcCurrentVideoSubWindow = qobject_cast( m_pcCurrentSubWindow ); } @@ -543,7 +553,7 @@ Void plaYUVerApp::update() updateMenus(); } -Void plaYUVerApp::updateStatusBar( const QString& statusBarString ) +Void PlaYUVerApp::updateStatusBar( const QString& statusBarString ) { if( !statusBarString.isEmpty() ) { @@ -555,13 +565,13 @@ Void plaYUVerApp::updateStatusBar( const QString& statusBarString ) } } -Void plaYUVerApp::updateMenus() +Void PlaYUVerApp::updateMenus() { Bool hasSubWindow = ( m_pcWindowHandle->activeSubWindow() != 0 ); Bool hasVideoStreamSubWindow = false; if( m_pcCurrentSubWindow ) - if( m_pcCurrentSubWindow->getCategory() & SubWindowHandle::VIDEO_STREAM_SUBWINDOW ) + if( m_pcCurrentSubWindow->getCategory() & SubWindowAbstract::VIDEO_STREAM_SUBWINDOW ) hasVideoStreamSubWindow = true; m_arrayMenu[RECENT_MENU]->setEnabled( m_aRecentFileStreamInfo.size() > 0 ? true : false ); @@ -592,7 +602,7 @@ Void plaYUVerApp::updateMenus() // ----------------------- Create Functions ----------------------- -Void plaYUVerApp::createActions() +Void PlaYUVerApp::createActions() { m_arrayActions.resize( TOTAL_ACT ); @@ -732,7 +742,7 @@ Void plaYUVerApp::createActions() connect( m_arrayActions[ABOUTQT_ACT], SIGNAL( triggered() ), qApp, SLOT( aboutQt() ) ); } -Void plaYUVerApp::createMenus() +Void PlaYUVerApp::createMenus() { m_arrayMenu.resize( TOTAL_MENUS ); @@ -800,7 +810,7 @@ Void plaYUVerApp::createMenus() } -Void plaYUVerApp::createToolBars() +Void PlaYUVerApp::createToolBars() { m_arrayToolBars.resize( TOTAL_TOOLBAR ); @@ -835,7 +845,7 @@ Void plaYUVerApp::createToolBars() } -Void plaYUVerApp::createDockWidgets() +Void PlaYUVerApp::createDockWidgets() { // Properties Dock Window m_arraySideBars.resize( TOTAL_DOCK ); @@ -843,14 +853,14 @@ Void plaYUVerApp::createDockWidgets() addDockWidget( Qt::RightDockWidgetArea, m_appModuleQuality->createDock() ); } -Void plaYUVerApp::createStatusBar() +Void PlaYUVerApp::createStatusBar() { //! Warning: the following widget cannot change size too much statusBar()->addPermanentWidget( m_appModuleVideo->createStatusBarMessage() ); statusBar()->showMessage( tr( "Ready" ) ); } -Void plaYUVerApp::addStreamInfoToRecentList( PlaYUVerStreamInfo streamInfo ) +Void PlaYUVerApp::addStreamInfoToRecentList( PlaYUVerStreamInfo streamInfo ) { Int idx = findPlaYUVerStreamInfo( m_aRecentFileStreamInfo, streamInfo.m_cFilename ); if( idx >= 0 ) @@ -861,7 +871,7 @@ Void plaYUVerApp::addStreamInfoToRecentList( PlaYUVerStreamInfo streamInfo ) updateRecentFileActions(); } -Void plaYUVerApp::updateRecentFileActions() +Void PlaYUVerApp::updateRecentFileActions() { Int numRecentFiles = m_aRecentFileStreamInfo.size(); numRecentFiles = qMin( numRecentFiles, MAX_RECENT_FILES ); @@ -884,7 +894,7 @@ Void plaYUVerApp::updateRecentFileActions() m_arrayMenu[RECENT_MENU]->setEnabled( m_aRecentFileStreamInfo.size() > 0 ? true : false ); } -Void plaYUVerApp::checkRecentFileActions() +Void PlaYUVerApp::checkRecentFileActions() { Int i = 0; while( i < m_aRecentFileStreamInfo.size() ) @@ -907,7 +917,7 @@ Void plaYUVerApp::checkRecentFileActions() } } -Void plaYUVerApp::readSettings() +Void PlaYUVerApp::readSettings() { QSettings appSettings; @@ -932,7 +942,7 @@ Void plaYUVerApp::readSettings() m_pcWindowHandle->readSettings(); } -Void plaYUVerApp::writeSettings() +Void PlaYUVerApp::writeSettings() { QSettings appSettings; diff --git a/app/PlaYUVerApp.h b/app/PlaYUVerApp.h index c980297..8160ed1 100644 --- a/app/PlaYUVerApp.h +++ b/app/PlaYUVerApp.h @@ -20,7 +20,7 @@ /** * \file PlaYUVerApp.h * \ingroup PlaYUVerApp - * \brief Main definition of the plaYUVerApp app + * \brief Main definition of the PlaYUVerApp app * * @defgroup PlaYUVerApp PlaYUVer App (GUI) * @{ @@ -37,21 +37,23 @@ #define __PLAYUVERAPP_H__ #include "config.h" +#include +#include +#include #include "PlaYUVerAppDefs.h" -#if( QT_VERSION_PLAYUVER == 5 ) -#include -#elif( QT_VERSION_PLAYUVER == 4 ) -#include -#endif #ifdef USE_QTDBUS #include "PlaYUVerAppAdaptor.h" #endif -#include - -#include "SubWindowHandle.h" -#include "AboutDialog.h" #include "VideoSubWindow.h" +class QCloseEvent; +class QDragEnterEvent; +class QDropEvent; +class QDoubleSpinBox; +class QActionGroup; +class QAction; +class QSignalMapper; + namespace plaYUVer { @@ -62,13 +64,16 @@ class VideoHandle; class QualityHandle; class ModulesHandle; class PlaYUVerAppAdaptor; +class VideoSubWindow; +class SubWindowAbstract; +class AboutDialog; -class plaYUVerApp: public QMainWindow +class PlaYUVerApp: public QMainWindow { Q_OBJECT public: - plaYUVerApp(); + PlaYUVerApp(); Bool parseArgs( Int argc, Char *argv[] ); Void loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo = NULL ); @@ -118,7 +123,7 @@ private: /** * Save the current subwindow for every category */ - SubWindowHandle* m_pcCurrentSubWindow; //!< General always set + SubWindowAbstract* m_pcCurrentSubWindow; //!< General always set VideoSubWindow* m_pcCurrentVideoSubWindow; QString m_cLastOpenPath; @@ -247,3 +252,4 @@ private: } // NAMESPACE #endif // __PLAYUVERAPP_H__ + diff --git a/app/PlaYUVerAppAdaptor.cpp b/app/PlaYUVerAppAdaptor.cpp index fb40288..ff1d86d 100644 --- a/app/PlaYUVerAppAdaptor.cpp +++ b/app/PlaYUVerAppAdaptor.cpp @@ -29,7 +29,7 @@ namespace plaYUVer { -PlaYUVerAppAdaptor::PlaYUVerAppAdaptor( plaYUVerApp *app ) : +PlaYUVerAppAdaptor::PlaYUVerAppAdaptor( PlaYUVerApp *app ) : QDBusAbstractAdaptor( app ), m_app( app ) { diff --git a/app/PlaYUVerAppAdaptor.h b/app/PlaYUVerAppAdaptor.h index 4210724..ae64e69 100644 --- a/app/PlaYUVerAppAdaptor.h +++ b/app/PlaYUVerAppAdaptor.h @@ -38,7 +38,7 @@ namespace plaYUVer #define PLAYUVER_DBUS_SESSION_NAME "org.pixlra.PlaYUVer.application" #define PLAYUVER_DBUS_PATH "/MainApplication" -class plaYUVerApp; +class PlaYUVerApp; class PlaYUVerAppAdaptor: public QDBusAbstractAdaptor { @@ -46,7 +46,7 @@ Q_OBJECT Q_CLASSINFO("D-Bus Interface", "org.pixlra.PlaYUVer.application") Q_PROPERTY(QString activeSession READ activeSession) public: - PlaYUVerAppAdaptor( plaYUVerApp *app ); + PlaYUVerAppAdaptor( PlaYUVerApp *app ); ~PlaYUVerAppAdaptor(); /** * emit the exiting signal @@ -78,7 +78,7 @@ Q_SIGNALS: public: QString activeSession(); private: - plaYUVerApp *m_app; + PlaYUVerApp *m_app; }; } // NAMESPACE diff --git a/app/PlaYUVerAppModuleIf.cpp b/app/PlaYUVerAppModuleIf.cpp index 9428850..1732cf9 100644 --- a/app/PlaYUVerAppModuleIf.cpp +++ b/app/PlaYUVerAppModuleIf.cpp @@ -24,6 +24,7 @@ #include "PlaYUVerAppModuleIf.h" #include "VideoSubWindow.h" +#include "VideoSubWindow.h" namespace plaYUVer { diff --git a/app/PlaYUVerMdiSubWindow.cpp b/app/PlaYUVerMdiSubWindow.cpp index e29348f..e84d946 100644 --- a/app/PlaYUVerMdiSubWindow.cpp +++ b/app/PlaYUVerMdiSubWindow.cpp @@ -22,8 +22,9 @@ * \brief Re-implementation QMdiSubWindow */ +#include #include "PlaYUVerMdiSubWindow.h" -#include "SubWindowHandle.h" +#include "SubWindowAbstract.h" namespace plaYUVer { @@ -38,7 +39,7 @@ QSize PlaYUVerMdiSubWindow::sizeHint() const QSize maxSize; if( parent() ) maxSize = parentWidget()->size(); - QSize sizeHint = qobject_cast( widget() )->sizeHint( maxSize ); + QSize sizeHint = qobject_cast( widget() )->sizeHint( maxSize ); return sizeHint; } diff --git a/app/PlaYUVerMdiSubWindow.h b/app/PlaYUVerMdiSubWindow.h index 5b78920..6982339 100644 --- a/app/PlaYUVerMdiSubWindow.h +++ b/app/PlaYUVerMdiSubWindow.h @@ -27,11 +27,8 @@ #include "config.h" #include "PlaYUVerAppDefs.h" -#if( QT_VERSION_PLAYUVER == 5 ) -#include -#elif( QT_VERSION_PLAYUVER == 4 ) -#include -#endif +#include + namespace plaYUVer { diff --git a/app/PlaYUVerSubWindowHandle.cpp b/app/PlaYUVerSubWindowHandle.cpp index 117f171..275bf78 100644 --- a/app/PlaYUVerSubWindowHandle.cpp +++ b/app/PlaYUVerSubWindowHandle.cpp @@ -25,7 +25,7 @@ #include "PlaYUVerApp.h" #include "PlaYUVerSubWindowHandle.h" #include "PlaYUVerMdiSubWindow.h" -#include "SubWindowHandle.h" +#include "SubWindowAbstract.h" namespace plaYUVer { @@ -72,7 +72,7 @@ PlaYUVerSubWindowHandle::PlaYUVerSubWindowHandle( QWidget *parent ) : Void PlaYUVerSubWindowHandle::resetWindowMode() { - QList apcSubWindowList = m_apcSubWindowList; + QList apcSubWindowList = m_apcSubWindowList; if( m_iWindowMode == NormalSubWindows ) { @@ -146,7 +146,7 @@ Void PlaYUVerSubWindowHandle::setWindowMode( Int iWindowMode ) qApp->processEvents(); } -Void PlaYUVerSubWindowHandle::updateActiveSubWindow( SubWindowHandle *window ) +Void PlaYUVerSubWindowHandle::updateActiveSubWindow( SubWindowAbstract *window ) { if( m_iWindowMode == NormalSubWindows ) { @@ -164,7 +164,7 @@ Void PlaYUVerSubWindowHandle::updateActiveSubWindow( SubWindowHandle *window ) if( mdiSubWindow ) { QWidget* activeWidget = m_pcMdiArea->activeSubWindow()->widget(); - Int windowIdx = m_apcSubWindowList.indexOf( qobject_cast( activeWidget ) ); + Int windowIdx = m_apcSubWindowList.indexOf( qobject_cast( activeWidget ) ); if( windowIdx >= 0 ) { m_pcActiveWindow = m_apcSubWindowList.at( windowIdx ); @@ -180,7 +180,7 @@ Void PlaYUVerSubWindowHandle::updateActiveSubWindow( SubWindowHandle *window ) } -Void PlaYUVerSubWindowHandle::addMdiSubWindow( SubWindowHandle *window ) +Void PlaYUVerSubWindowHandle::addMdiSubWindow( SubWindowAbstract *window ) { PlaYUVerMdiSubWindow* mdiSubWindow = new PlaYUVerMdiSubWindow; mdiSubWindow->setWidget( window ); @@ -190,17 +190,17 @@ Void PlaYUVerSubWindowHandle::addMdiSubWindow( SubWindowHandle *window ) connect( mdiSubWindow, SIGNAL( aboutToClose( PlaYUVerMdiSubWindow* ) ), this, SLOT( removeMdiSubWindow( PlaYUVerMdiSubWindow* ) ) ); } -Void PlaYUVerSubWindowHandle::addSubWindow( SubWindowHandle *window, Qt::WindowFlags flags ) +Void PlaYUVerSubWindowHandle::addSubWindow( SubWindowAbstract *window, Qt::WindowFlags flags ) { if( window ) { - connect( window, SIGNAL( updateStatusBar( const QString& ) ), qobject_cast( parent() ), SLOT( updateStatusBar( const QString& ) ) ); - connect( window, SIGNAL( zoomFactorChanged_SWindow( const double, const QPoint ) ), qobject_cast( parent() ), + connect( window, SIGNAL( updateStatusBar( const QString& ) ), qobject_cast( parent() ), SLOT( updateStatusBar( const QString& ) ) ); + connect( window, SIGNAL( zoomFactorChanged_SWindow( const double, const QPoint ) ), qobject_cast( parent() ), SLOT( updateZoomFactorSBox() ) ); if( m_iWindowMode == NormalSubWindows ) { - connect( window, SIGNAL( aboutToActivate( SubWindowHandle* ) ), this, SLOT( updateActiveSubWindow( SubWindowHandle* ) ) ); - connect( window, SIGNAL( aboutToClose( SubWindowHandle* ) ), this, SLOT( removeSubWindow( SubWindowHandle* ) ) ); + connect( window, SIGNAL( aboutToActivate( SubWindowAbstract* ) ), this, SLOT( updateActiveSubWindow( SubWindowAbstract* ) ) ); + connect( window, SIGNAL( aboutToClose( SubWindowAbstract* ) ), this, SLOT( removeSubWindow( SubWindowAbstract* ) ) ); } if( m_iWindowMode == MdiWSubWindows ) { @@ -216,7 +216,7 @@ Void PlaYUVerSubWindowHandle::removeSubWindow( Int windowIdx ) { if( m_iWindowMode == NormalSubWindows ) { - SubWindowHandle* subWindow = m_apcSubWindowList.at( windowIdx ); + SubWindowAbstract* subWindow = m_apcSubWindowList.at( windowIdx ); m_apcSubWindowList.removeAt( windowIdx ); subWindow->close(); } @@ -238,7 +238,7 @@ Void PlaYUVerSubWindowHandle::removeSubWindow( Int windowIdx ) } } -Void PlaYUVerSubWindowHandle::removeSubWindow( SubWindowHandle* window ) +Void PlaYUVerSubWindowHandle::removeSubWindow( SubWindowAbstract* window ) { removeSubWindow( m_apcSubWindowList.indexOf( window ) ); } @@ -261,14 +261,14 @@ Void PlaYUVerSubWindowHandle::removeActiveSubWindow() removeSubWindow( m_pcActiveWindow ); } -SubWindowHandle* PlaYUVerSubWindowHandle::activeSubWindow() const +SubWindowAbstract* PlaYUVerSubWindowHandle::activeSubWindow() const { return m_pcActiveWindow; } -QList PlaYUVerSubWindowHandle::findSubWindow( const UInt uiCategory ) const +QList PlaYUVerSubWindowHandle::findSubWindow( const UInt uiCategory ) const { - QList apcSubWindowList; + QList apcSubWindowList; if( uiCategory == 0 ) { apcSubWindowList = m_apcSubWindowList; @@ -284,10 +284,10 @@ QList PlaYUVerSubWindowHandle::findSubWindow( const UInt uiCat return apcSubWindowList; } -QList PlaYUVerSubWindowHandle::findSubWindow( const QString &windowName, const UInt uiCategory ) const +QList PlaYUVerSubWindowHandle::findSubWindow( const QString &windowName, const UInt uiCategory ) const { - QList subWindowList = findSubWindow( uiCategory ); - QList apcSubWindowList; + QList subWindowList = findSubWindow( uiCategory ); + QList apcSubWindowList; if( !windowName.isEmpty() ) { for( Int i = 0; i < subWindowList.size(); i++ ) @@ -299,9 +299,9 @@ QList PlaYUVerSubWindowHandle::findSubWindow( const QString &w return apcSubWindowList; } -SubWindowHandle* PlaYUVerSubWindowHandle::findSubWindow( const SubWindowHandle* subWindow ) const +SubWindowAbstract* PlaYUVerSubWindowHandle::findSubWindow( const SubWindowAbstract* subWindow ) const { - QList subWindowList = findSubWindow(); + QList subWindowList = findSubWindow(); for( Int i = 0; i < subWindowList.size(); i++ ) { if( subWindow == subWindowList.at( i ) ) @@ -315,7 +315,7 @@ Void PlaYUVerSubWindowHandle::setActiveSubWindow( QWidget *window ) if( !window ) return; - m_pcActiveWindow = qobject_cast( window ); + m_pcActiveWindow = qobject_cast( window ); if( m_iWindowMode == NormalSubWindows ) { @@ -453,7 +453,7 @@ Void PlaYUVerSubWindowHandle::updateMenu() for( Int i = 0; i < number_windows; ++i ) { - SubWindowHandle *subWindow = m_apcSubWindowList.at( i ); + SubWindowAbstract *subWindow = m_apcSubWindowList.at( i ); QString text; if( i < 9 ) diff --git a/app/PlaYUVerSubWindowHandle.h b/app/PlaYUVerSubWindowHandle.h index 1070e52..0741f03 100644 --- a/app/PlaYUVerSubWindowHandle.h +++ b/app/PlaYUVerSubWindowHandle.h @@ -36,7 +36,7 @@ namespace plaYUVer { -class SubWindowHandle; +class SubWindowAbstract; class PlaYUVerMdiArea; class PlaYUVerMdiSubWindow; @@ -47,13 +47,13 @@ Q_OBJECT public: PlaYUVerSubWindowHandle( QWidget *parent ); - Void addSubWindow( SubWindowHandle *widget, Qt::WindowFlags flags = 0 ); + Void addSubWindow( SubWindowAbstract *widget, Qt::WindowFlags flags = 0 ); - SubWindowHandle *activeSubWindow() const; + SubWindowAbstract *activeSubWindow() const; - QList findSubWindow( const UInt uiCategory = 0 ) const; - QList findSubWindow( const QString &aName, const UInt uiCategory = 0 ) const; - SubWindowHandle* findSubWindow( const SubWindowHandle* subWindow ) const; + QList findSubWindow( const UInt uiCategory = 0 ) const; + QList findSubWindow( const QString &aName, const UInt uiCategory = 0 ) const; + SubWindowAbstract* findSubWindow( const SubWindowAbstract* subWindow ) const; Void createActions(); QMenu* createMenu(); @@ -69,13 +69,13 @@ public: private: Int m_iWindowMode; - QList m_apcSubWindowList; + QList m_apcSubWindowList; QHBoxLayout* m_pcWindowManagerLayout; PlaYUVerMdiArea* m_pcMdiArea; QList m_apcMdiSubWindowList; - SubWindowHandle* m_pcActiveWindow; + SubWindowAbstract* m_pcActiveWindow; QPoint m_cMdiModeWindowPosition; QSize m_cMdiModeWindowSize; @@ -102,15 +102,15 @@ private: /** * Internal functions */ - Void addMdiSubWindow( SubWindowHandle *window ); + Void addMdiSubWindow( SubWindowAbstract *window ); Void resetWindowMode(); Void removeSubWindow( Int windowIdx ); public Q_SLOTS: void setWindowMode( int iWindowMode ); - void updateActiveSubWindow( SubWindowHandle *window = 0 ); + void updateActiveSubWindow( SubWindowAbstract *window = 0 ); void setActiveSubWindow( QWidget *window ); - void removeSubWindow( SubWindowHandle *window ); + void removeSubWindow( SubWindowAbstract *window ); void removeMdiSubWindow( PlaYUVerMdiSubWindow* window ); void removeActiveSubWindow(); void removeAllSubWindow(); diff --git a/app/PlotSubWindow.cpp b/app/PlotSubWindow.cpp index ba0bc4d..1941b0c 100644 --- a/app/PlotSubWindow.cpp +++ b/app/PlotSubWindow.cpp @@ -48,7 +48,7 @@ Void PlotSubWindow::definePlotColors() } PlotSubWindow::PlotSubWindow( const QString& windowTitle, QWidget * parent ) : - SubWindowHandle( parent, SubWindowHandle::PLOT_SUBWINDOW ) + SubWindowAbstract( parent, SubWindowAbstract::PLOT_SUBWINDOW ) { definePlotColors(); diff --git a/app/PlotSubWindow.h b/app/PlotSubWindow.h index add5937..81538a6 100644 --- a/app/PlotSubWindow.h +++ b/app/PlotSubWindow.h @@ -32,14 +32,14 @@ #elif( QT_VERSION_PLAYUVER == 4 ) #include #endif -#include "SubWindowHandle.h" +#include "SubWindowAbstract.h" class QCustomPlot; namespace plaYUVer { -class PlotSubWindow: public SubWindowHandle +class PlotSubWindow: public SubWindowAbstract { Q_OBJECT @@ -75,7 +75,7 @@ public: } /** - * Virtual functions from SubWindowHandle + * Virtual functions from SubWindowAbstract */ Void normalSize(); Void zoomToFit(); diff --git a/app/QualityHandle.cpp b/app/QualityHandle.cpp index 554b70e..ab20471 100644 --- a/app/QualityHandle.cpp +++ b/app/QualityHandle.cpp @@ -117,7 +117,7 @@ Void QualityHandle::updateMenus() if( hasSubWindow && !hasReference ) { VideoSubWindow* pcVideoSubWindow; - QList subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowHandle::VIDEO_STREAM_SUBWINDOW ); + QList subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_STREAM_SUBWINDOW ); for( Int i = 0; i < subWindowList.size(); i++ ) { pcVideoSubWindow = qobject_cast( subWindowList.at( i ) ); @@ -255,7 +255,7 @@ Void QualityHandle::slotSelectCurrentAsReference() if( pcRefSubWindow ) { VideoSubWindow* pcVideoSubWindow; - QList subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowHandle::VIDEO_SUBWINDOW ); + QList subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW ); for( Int i = 0; i < subWindowList.size(); i++ ) { pcVideoSubWindow = qobject_cast( subWindowList.at( i ) ); @@ -305,7 +305,7 @@ Void QualityHandle::slotPlotQualitySeveral() } VideoSubWindow* pcVideoSubWindow; - QList subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowHandle::VIDEO_STREAM_SUBWINDOW ); + QList subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_STREAM_SUBWINDOW ); for( Int i = 0; i < subWindowList.size(); i++ ) { pcVideoSubWindow = qobject_cast( subWindowList.at( i ) ); diff --git a/app/QualityMeasurementSidebar.cpp b/app/QualityMeasurementSidebar.cpp index 04d6770..b8772bc 100644 --- a/app/QualityMeasurementSidebar.cpp +++ b/app/QualityMeasurementSidebar.cpp @@ -136,7 +136,7 @@ Void QualityMeasurementSidebar::updateSubWindowList() m_pcVideoWindowList.clear(); VideoSubWindow* pcVideoSubWindow; - QList subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowHandle::VIDEO_SUBWINDOW ); + QList subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW ); for( Int i = 0; i < subWindowList.size(); i++ ) { pcVideoSubWindow = qobject_cast( subWindowList.at( i ) ); diff --git a/app/SubWindowHandle.cpp b/app/SubWindowAbstract.cpp similarity index 82% rename from app/SubWindowHandle.cpp rename to app/SubWindowAbstract.cpp index 10622ab..43ee401 100644 --- a/app/SubWindowHandle.cpp +++ b/app/SubWindowAbstract.cpp @@ -18,16 +18,21 @@ */ /** - * \file SubWindowHandle.cpp - * \brief Sub windows handling + * \file SubWindowAbstract.cpp + * \brief Abstract class to handle subwindows */ -#include "SubWindowHandle.h" +#include +#include +#include +#include +#include "SubWindowAbstract.h" #include "PlaYUVerMdiSubWindow.h" + namespace plaYUVer { -SubWindowHandle::SubWindowHandle( QWidget * parent, UInt category ) : +SubWindowAbstract::SubWindowAbstract( QWidget * parent, UInt category ) : QScrollArea( parent ), m_cSubWindow( NULL ) { @@ -52,22 +57,22 @@ SubWindowHandle::SubWindowHandle( QWidget * parent, UInt category ) : connect(this, SIGNAL(destroyed()), this, SLOT(onDestroyed())); } -void SubWindowHandle::onDestroyed() +void SubWindowAbstract::onDestroyed() { return; } -SubWindowHandle::~SubWindowHandle() +SubWindowAbstract::~SubWindowAbstract() { return; } -QSize SubWindowHandle::getScrollSize() +QSize SubWindowAbstract::getScrollSize() { return QSize( viewport()->size().width() - 5, viewport()->size().height() - 5 ); } -Void SubWindowHandle::adjustScrollBarByOffset( QPoint Offset ) +Void SubWindowAbstract::adjustScrollBarByOffset( QPoint Offset ) { QPoint cLastScroll = m_cCurrScroll; QScrollBar *scrollBarH, *scrollBarV; @@ -97,7 +102,7 @@ Void SubWindowHandle::adjustScrollBarByOffset( QPoint Offset ) // This function was developed with help of the schematics presented in // http://stackoverflow.com/questions/13155382/jscrollpane-zoom-relative-to-mouse-position -Void SubWindowHandle::adjustScrollBarByScale( Double scale, QPoint center ) +Void SubWindowAbstract::adjustScrollBarByScale( Double scale, QPoint center ) { QPoint cLastScroll = m_cCurrScroll; QScrollBar *scrollBarH, *scrollBarV; @@ -140,7 +145,7 @@ Void SubWindowHandle::adjustScrollBarByScale( Double scale, QPoint center ) } -Void SubWindowHandle::updateCurScrollValues() +Void SubWindowAbstract::updateCurScrollValues() { QScrollBar *scrollBar = horizontalScrollBar(); m_cCurrScroll.setX( scrollBar->value() ); @@ -148,7 +153,7 @@ Void SubWindowHandle::updateCurScrollValues() m_cCurrScroll.setY( scrollBar->value() ); } -Void SubWindowHandle::setCurScrollValues() +Void SubWindowAbstract::setCurScrollValues() { QScrollBar *scrollBar = horizontalScrollBar(); scrollBar->setValue(m_cCurrScroll.x() ); @@ -156,44 +161,44 @@ Void SubWindowHandle::setCurScrollValues() scrollBar->setValue(m_cCurrScroll.y() ); } -Void SubWindowHandle::setWindowName( QString name ) +Void SubWindowAbstract::setWindowName( QString name ) { m_cWindowName = name; setWindowTitle( m_cWindowName ); } -QString SubWindowHandle::getWindowName() +QString SubWindowAbstract::getWindowName() { return m_cWindowName; } -Bool SubWindowHandle::mayClose() +Bool SubWindowAbstract::mayClose() { return true; } -QSize SubWindowHandle::sizeHint( ) const +QSize SubWindowAbstract::sizeHint( ) const { return QSize(); } -QSize SubWindowHandle::sizeHint( const QSize & ) const +QSize SubWindowAbstract::sizeHint( const QSize & ) const { return QSize(); } -Void SubWindowHandle::focusInEvent( QFocusEvent * event ) +Void SubWindowAbstract::focusInEvent( QFocusEvent * event ) { emit aboutToActivate( this ); } -Void SubWindowHandle::closeEvent( QCloseEvent *event ) +Void SubWindowAbstract::closeEvent( QCloseEvent *event ) { emit aboutToClose( this ); event->accept(); } -Void SubWindowHandle::closeSubWindow() +Void SubWindowAbstract::closeSubWindow() { close(); if( m_cSubWindow ) diff --git a/app/SubWindowHandle.h b/app/SubWindowAbstract.h similarity index 87% rename from app/SubWindowHandle.h rename to app/SubWindowAbstract.h index 63e6431..a795851 100644 --- a/app/SubWindowHandle.h +++ b/app/SubWindowAbstract.h @@ -18,9 +18,9 @@ */ /** - * \file SubWindowHandle.h + * \file SubWindowAbstract.h * \ingroup PlaYUVerApp PlaYUVerApp_Subwindow - * \brief Sub windows handling + * \brief Abstract class to handle subwindows * * @defgroup PlaYUVerApp_Subwindow SubWindow definition * @{ @@ -34,23 +34,25 @@ * @} */ -#ifndef __SUBWINDOWHANDLE_H__ -#define __SUBWINDOWHANDLE_H__ +#ifndef __SUBWINDOWABSTRACT_H__ +#define __SUBWINDOWABSTRACT_H__ #include "config.h" #include "PlaYUVerAppDefs.h" -#if( QT_VERSION_PLAYUVER == 5 ) -#include -#elif( QT_VERSION_PLAYUVER == 4 ) -#include -#endif +#include +#include +#include +#include + +class QFocusEvent; +class QCloseEvent; namespace plaYUVer { class PlaYUVerMdiSubWindow; -class SubWindowHandle: public QScrollArea +class SubWindowAbstract: public QScrollArea { Q_OBJECT @@ -73,8 +75,8 @@ public: PLOT_SUBWINDOW = 8, }; - SubWindowHandle( QWidget *, UInt ); - ~SubWindowHandle(); + SubWindowAbstract( QWidget *, UInt ); + ~SubWindowAbstract(); /** * Show the image at its original size @@ -152,8 +154,8 @@ public: Void closeSubWindow(); protected: - void focusInEvent( QFocusEvent * event ); - void closeEvent( QCloseEvent *event ); + void focusInEvent( QFocusEvent* event ); + void closeEvent( QCloseEvent* event ); QSize getScrollSize(); Q_SIGNALS: @@ -170,8 +172,8 @@ Q_SIGNALS: */ void updateStatusBar( const QString& ); - void aboutToActivate( SubWindowHandle* ); - void aboutToClose( SubWindowHandle* ); + void aboutToActivate( SubWindowAbstract* ); + void aboutToClose( SubWindowAbstract* ); public Q_SLOTS: void onDestroyed(); @@ -184,5 +186,5 @@ public Q_SLOTS: } // NAMESPACE -#endif // __SUBWINDOWHANDLE_H__ +#endif // __SUBWINDOWABSTRACT_H__ diff --git a/app/VideoHandle.cpp b/app/VideoHandle.cpp index 144f829..8fc0233 100644 --- a/app/VideoHandle.cpp +++ b/app/VideoHandle.cpp @@ -22,10 +22,19 @@ * \brief Class to handle video playback */ -#include -#include "PlaYUVerSubWindowHandle.h" #include "VideoHandle.h" +#include "VideoSubWindow.h" +#include "PlaYUVerSubWindowHandle.h" #include "DialogSubWindowSelector.h" +#include "FramePropertiesDock.h" +#include "WidgetFrameNumber.h" +#include +#include +#include +#include +#include +#include +#include #if( _CONTROL_PLAYING_TIME_ == 1 ) #include #endif @@ -137,7 +146,7 @@ QToolBar* VideoHandle::createToolBar() QDockWidget* VideoHandle::createDock() { - m_pcFramePropertiesSideBar = new FramePropertiesSideBar( this, &m_bIsPlaying ); + m_pcFramePropertiesSideBar = new FramePropertiesDock( this, &m_bIsPlaying ); m_pcFramePropertiesDock = new QDockWidget( tr( "Frame Information" ), this ); m_pcFramePropertiesDock->setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea ); m_pcFramePropertiesDock->setWidget( m_pcFramePropertiesSideBar ); @@ -278,7 +287,7 @@ Void VideoHandle::updateSelectionArea( QRect area ) } } -Void VideoHandle::closeSubWindow( SubWindowHandle* subWindow ) +Void VideoHandle::closeSubWindow( SubWindowAbstract* subWindow ) { VideoSubWindow* videoSubWindow = qobject_cast( subWindow ); @@ -303,8 +312,8 @@ Void VideoHandle::zoomToFactorAll( const Double scale, const QPoint center ) factor = m_pcCurrentVideoSubWindow->getScaleFactor(); - SubWindowHandle *subWindow; - QList subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowHandle::VIDEO_SUBWINDOW ); + SubWindowAbstract *subWindow; + QList subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW ); for( Int i = 0; i < subWindowList.size(); i++ ) { subWindow = subWindowList.at( i ); @@ -323,8 +332,8 @@ Void VideoHandle::moveAllScrollBars( const QPoint offset ) QPoint newOffset = offset; if( m_arrayActions[VIDEO_ZOOM_LOCK_ACT]->isChecked() ) { - SubWindowHandle *subWindow; - QList subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowHandle::VIDEO_SUBWINDOW ); + SubWindowAbstract *subWindow; + QList subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW ); QScrollBar *scrollBar; scrollBar = m_pcCurrentVideoSubWindow->horizontalScrollBar(); @@ -408,9 +417,9 @@ Void VideoHandle::setTimerStatus() if( m_pcPlayControlTimer && m_pcPlayingTimer->interval() > 0 ) { qDebug( ) << "Desired Fps: " - << 1000 / m_pcPlayingTimer->interval() - << "Real Fps: " - << 1000 / m_dAverageFps; + << 1000 / m_pcPlayingTimer->interval() + << "Real Fps: " + << 1000 / m_dAverageFps; delete m_pcPlayControlTimer; m_pcPlayControlTimer = NULL; @@ -574,7 +583,7 @@ Void VideoHandle::seekSliderEvent( Int new_frame_num ) Void VideoHandle::videoSelectionButtonEvent() { - DialogSubWindowSelector dialogWindowsSelection( this, m_pcMainWindowManager, SubWindowHandle::VIDEO_STREAM_SUBWINDOW ); + DialogSubWindowSelector dialogWindowsSelection( this, m_pcMainWindowManager, SubWindowAbstract::VIDEO_STREAM_SUBWINDOW ); QStringList cWindowListNames; for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ ) { @@ -584,7 +593,7 @@ Void VideoHandle::videoSelectionButtonEvent() { m_acPlayingSubWindows.clear(); VideoSubWindow *videoSubWindow; - QList selectedSubWindowList = dialogWindowsSelection.getSelectedWindows(); + QList selectedSubWindowList = dialogWindowsSelection.getSelectedWindows(); for( Int i = 0; i < selectedSubWindowList.size(); i++ ) { videoSubWindow = qobject_cast( selectedSubWindowList.at( i ) ); diff --git a/app/VideoHandle.h b/app/VideoHandle.h index 8a8c23b..60d6c90 100644 --- a/app/VideoHandle.h +++ b/app/VideoHandle.h @@ -27,25 +27,29 @@ #include "config.h" #include "PlaYUVerAppDefs.h" -#include -#if( QT_VERSION_PLAYUVER == 5 ) -#include -#elif( QT_VERSION_PLAYUVER == 4 ) -#include -#endif -#include "VideoSubWindow.h" -#include "WidgetFrameNumber.h" -#include "FramePropertiesSidebar.h" + +#include +#include +#include +#include #define _CONTROL_PLAYING_TIME_ 0 +class QToolBar; +class QDockWidget; +class QSignalMapper; +class QLabel; +class QSlider; class QElapsedTimer; namespace plaYUVer { class PlaYUVerSubWindowHandle; +class SubWindowAbstract; class VideoSubWindow; +class FramePropertiesDock; +class WidgetFrameNumber; class VideoHandle: public QWidget { @@ -91,7 +95,7 @@ private: QToolBar* m_toolbarVideo; QDockWidget* m_pcFramePropertiesDock; - FramePropertiesSideBar* m_pcFramePropertiesSideBar; + FramePropertiesDock* m_pcFramePropertiesSideBar; QLabel* m_pcVideoFormatLabel; QLabel* m_pcResolutionLabel; @@ -117,7 +121,7 @@ Q_SIGNALS: private Q_SLOTS: void update(); void updateSelectionArea( QRect area ); - void closeSubWindow( SubWindowHandle* subWindow ); + void closeSubWindow( SubWindowAbstract* subWindow ); void zoomToFactorAll( const double factor, const QPoint center = QPoint() ); void moveAllScrollBars( const QPoint offset ); void play(); diff --git a/app/VideoSubWindow.cpp b/app/VideoSubWindow.cpp index 39ba15f..fea5e35 100644 --- a/app/VideoSubWindow.cpp +++ b/app/VideoSubWindow.cpp @@ -24,8 +24,8 @@ #include "VideoSubWindow.h" #include "ModulesHandle.h" -#include "SubWindowHandle.h" #include "ConfigureFormatDialog.h" +#include "SubWindowAbstract.h" #if( QT_VERSION_PLAYUVER == 5 ) #include "QtConcurrent/qtconcurrentrun.h" #endif @@ -78,7 +78,7 @@ Int findPlaYUVerStreamInfo( PlaYUVerStreamInfoVector array, QString filename ) } VideoSubWindow::VideoSubWindow( enum VideoSubWindowCategories category, QWidget * parent ) : - SubWindowHandle( parent, SubWindowHandle::VIDEO_SUBWINDOW | category ), + SubWindowAbstract( parent, SubWindowAbstract::VIDEO_SUBWINDOW | category ), m_pCurrStream( NULL ), m_pcCurrFrame( NULL ), m_pcCurrentDisplayModule( NULL ), @@ -128,7 +128,7 @@ Void VideoSubWindow::loadAll() Void VideoSubWindow::refreshSubWindow() { - if( getCategory() & SubWindowHandle::VIDEO_STREAM_SUBWINDOW ) + if( getCategory() & SubWindowAbstract::VIDEO_STREAM_SUBWINDOW ) { Int currFrameNum = m_pCurrStream->getCurrFrameNum(); if( !loadFile( m_cFilename, false ) ) diff --git a/app/VideoSubWindow.h b/app/VideoSubWindow.h index 16241bf..b0d5966 100644 --- a/app/VideoSubWindow.h +++ b/app/VideoSubWindow.h @@ -26,15 +26,14 @@ #define __VIDEOSUBWINDOW_H__ #include "config.h" +#include +#include +#include +#include +#include #include "PlaYUVerAppDefs.h" -#if( QT_VERSION_PLAYUVER == 5 ) -#include -#elif( QT_VERSION_PLAYUVER == 4 ) -#include -#endif -#include "QFuture" #include "lib/PlaYUVerStream.h" -#include "SubWindowHandle.h" +#include "SubWindowAbstract.h" #include "ViewArea.h" namespace plaYUVer @@ -59,7 +58,7 @@ QDataStream& operator<<( QDataStream& out, const PlaYUVerStreamInfoVector& d ); QDataStream& operator>>( QDataStream& in, PlaYUVerStreamInfoVector& d ); Int findPlaYUVerStreamInfo( PlaYUVerStreamInfoVector array, QString filename ); -class VideoSubWindow: public SubWindowHandle +class VideoSubWindow: public SubWindowAbstract { Q_OBJECT @@ -202,7 +201,7 @@ public: } /** - * Virtual functions from SubWindowHandle + * Virtual functions from SubWindowAbstract */ Void normalSize(); Void zoomToFit(); diff --git a/app/main.cpp b/app/main.cpp index abc4855..458419f 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -23,10 +23,10 @@ */ #include "config.h" -#include "PlaYUVerAppDefs.h" #include +#include "PlaYUVerAppDefs.h" #include "PlaYUVerApp.h" -#include "SubWindowHandle.h" +#include "VideoSubWindow.h" #ifdef USE_QTDBUS #include "PlaYUVerAppAdaptor.h" #endif @@ -128,7 +128,7 @@ int main( int argc, char *argv[] ) */ QDBusConnection::sessionBus().registerService( PLAYUVER_DBUS_SESSION_NAME ); #endif - plaYUVerApp mainwindow; + PlaYUVerApp mainwindow; mainwindow.show(); if( mainwindow.parseArgs( argc, argv ) ) { @@ -136,8 +136,8 @@ int main( int argc, char *argv[] ) } #ifdef USE_FERVOR - FvUpdater::sharedUpdater()->SetFeedURL("http://192.168.96.201/share/PlaYUVerProject/PlaYUVerUpdate-" UPDATE_CHANNEL ".xml"); - FvUpdater::sharedUpdater()->SetDependencies("ALL"); + FvUpdater::sharedUpdater()->SetFeedURL( "http://192.168.96.201/share/PlaYUVerProject/PlaYUVerUpdate-" UPDATE_CHANNEL ".xml" ); + FvUpdater::sharedUpdater()->SetDependencies( "ALL" ); #endif return application.exec(); diff --git a/lib/LibAvContextHandle.cpp b/lib/LibAvContextHandle.cpp index f9c5055..4c0c3aa 100644 --- a/lib/LibAvContextHandle.cpp +++ b/lib/LibAvContextHandle.cpp @@ -216,10 +216,10 @@ Bool LibAvContextHandle::initAvFormat( const char* filename, UInt& width, UInt& frame_rate = fr; /*if( video_stream->nb_frames ) - { - num_frames = video_stream->nb_frames; - } - else*/ if( fmt_ctx->duration != AV_NOPTS_VALUE ) + { + num_frames = video_stream->nb_frames; + } + else*/if( fmt_ctx->duration != AV_NOPTS_VALUE ) { Int64 duration = fmt_ctx->duration + 5000; m_uiSecs = duration / AV_TIME_BASE; @@ -316,8 +316,7 @@ Bool LibAvContextHandle::decodeVideoPkt() { pkt.size = 0; } - Bool bRet = got_frame > 0 ? true : false; - return bRet; + return got_frame > 0 ? true : false; } Bool LibAvContextHandle::decodeAvFormat() @@ -356,7 +355,8 @@ Bool LibAvContextHandle::decodeAvFormat() av_image_copy_to_buffer( m_pchFrameBuffer, m_uiFrameBufferSize, frame->data, frame->linesize, video_dec_ctx->pix_fmt, video_dec_ctx->width, video_dec_ctx->height, 1 ); - av_free_packet( &orig_pkt ); + if( orig_pkt.size ) + av_free_packet( &orig_pkt ); return true; }