From 875ebfd79a31f52d2396f16ab02d4a5fa5bc6494 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Wed, 26 Mar 2014 05:04:03 +0000 Subject: [PATCH] Modification of files location --- CMakeLists.txt | 9 +++---- cmake/CMakeMacros.cmake | 10 ++++++-- cmake/ModuleFilterFrame.cmake | 2 +- source/{ => app}/ConfigureFormatDialog.cpp | 0 source/{ => app}/ConfigureFormatDialog.h | 0 source/{ => app}/GridManager.cpp | 0 source/{ => app}/GridManager.h | 0 source/{ => app}/InputStream.cpp | 2 +- source/{ => app}/InputStream.h | 0 source/{ => app}/ModulesHandle.cpp | 0 source/{ => app}/ModulesHandle.h | 0 source/{ => app}/PlaYUVerModuleIf.h | 0 source/{ => app}/PlaYUVerSettings.cpp | 0 source/{ => app}/PlaYUVerSettings.h | 0 source/{ => app}/SubWindowHandle.cpp | 4 +-- source/{ => app}/SubWindowHandle.h | 2 +- source/{ => app}/TypeDef.h | 0 source/{ => app}/ViewArea.cpp | 0 source/{ => app}/ViewArea.h | 0 source/{ => app}/main.cpp | 0 source/{ => app}/plaYUVerApp.cpp | 30 +++++++++++++++++----- source/{ => app}/plaYUVerApp.h | 0 source/{ => lib}/LibMemAlloc.cpp | 0 source/{ => lib}/LibMemAlloc.h | 0 source/{ => lib}/LibMemory.h | 0 source/{ => lib}/PlaYUVerFrame.cpp | 24 ----------------- source/{ => lib}/PlaYUVerFrame.h | 2 -- 27 files changed, 41 insertions(+), 44 deletions(-) rename source/{ => app}/ConfigureFormatDialog.cpp (100%) rename source/{ => app}/ConfigureFormatDialog.h (100%) rename source/{ => app}/GridManager.cpp (100%) rename source/{ => app}/GridManager.h (100%) rename source/{ => app}/InputStream.cpp (99%) rename source/{ => app}/InputStream.h (100%) rename source/{ => app}/ModulesHandle.cpp (100%) rename source/{ => app}/ModulesHandle.h (100%) rename source/{ => app}/PlaYUVerModuleIf.h (100%) rename source/{ => app}/PlaYUVerSettings.cpp (100%) rename source/{ => app}/PlaYUVerSettings.h (100%) rename source/{ => app}/SubWindowHandle.cpp (97%) rename source/{ => app}/SubWindowHandle.h (98%) rename source/{ => app}/TypeDef.h (100%) rename source/{ => app}/ViewArea.cpp (100%) rename source/{ => app}/ViewArea.h (100%) rename source/{ => app}/main.cpp (100%) rename source/{ => app}/plaYUVerApp.cpp (96%) rename source/{ => app}/plaYUVerApp.h (100%) rename source/{ => lib}/LibMemAlloc.cpp (100%) rename source/{ => lib}/LibMemAlloc.h (100%) rename source/{ => lib}/LibMemory.h (100%) rename source/{ => lib}/PlaYUVerFrame.cpp (96%) rename source/{ => lib}/PlaYUVerFrame.h (98%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d73f16..c4d05ff 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,6 @@ SET( PROJECT_NAME playuver ) # Project directories SET( SRC_DIR source ) -SET( INC_DIR source ) SET( LIB_DIR ${SRC_DIR}/lib ) SET( RSC_DIR resources ) SET( UI_DIR ui ) @@ -28,10 +27,9 @@ SET( CMAKE_INCLUDE_CURRENT_DIR ON ) # Instruct CMake to run moc automatically when needed. SET( CMAKE_AUTOMOC ON ) -INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${INC_DIR} ) +INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${SRC_DIR}/app ${SRC_DIR}/lib ) -FILE( GLOB SOURCES_FILES ${SRC_DIR}/*.cpp ) -FILE( GLOB HEADERS_FILES ${INC_DIR}/*.h ) +FILE( GLOB SOURCES_FILES ${SRC_DIR}/app/*.cpp ${SRC_DIR}/lib/*.cpp ) FILE( GLOB FORMS_FILES ${UI_DIR}/*.ui ) FILE( GLOB RESOURCES_FILES ${RSC_DIR}/*.qrc ) @@ -82,9 +80,10 @@ IF( USE_WERROR ) SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror" ) ENDIF() + ADD_EXECUTABLE( ${PROJECT_NAME} ${SOURCES_FILES} ${HEADERS_MOC_FILES} ${FORMS_HEADERS_FILES} ${RESOURCES_RCC_FILES} ) -TARGET_LINK_LIBRARIES( ${PROJECT_NAME} ${MODULES_LIBS} ${LINKER_LIBS} ) +TARGET_LINK_LIBRARIES( ${PROJECT_NAME} ${PLAYUVER_LIBS} ${MODULES_LIBS} ${LINKER_LIBS} ) IF( NOT USE_QT4) QT5_USE_MODULES( ${PROJECT_NAME} ${CURR_QT_MODULES} ) diff --git a/cmake/CMakeMacros.cmake b/cmake/CMakeMacros.cmake index bd11e8c..7396746 100644 --- a/cmake/CMakeMacros.cmake +++ b/cmake/CMakeMacros.cmake @@ -97,10 +97,16 @@ function(status text) endfunction() -macro(ADD_MODULE name files ) +macro(ADD_MODULE name file ) set(__modulename "Module${name}") - add_library( ${__modulename} ${files} ) + add_library( ${__modulename} ${SRC_DIR}/modules/${file} ) set(MODULES_LIBS ${MODULES_LIBS} ${__modulename}) ADD_DEFINITIONS( -DUSE_${name} ) unset(__modulename) +endmacro() + +macro(ADD_LIB name ) + include_directories( ${SRC_DIR}/lib/${name} ) + add_library( ${name} ${SRC_DIR}/lib/${files} ) + set(PLAYUVER_LIBS ${PLAYUVER_LIBS} ${name}) endmacro() \ No newline at end of file diff --git a/cmake/ModuleFilterFrame.cmake b/cmake/ModuleFilterFrame.cmake index a443698..0281056 100644 --- a/cmake/ModuleFilterFrame.cmake +++ b/cmake/ModuleFilterFrame.cmake @@ -2,5 +2,5 @@ # Filter frame module ###################################################################################### -ADD_MODULE( FilterFrame "${MODULES_DIR}/FilterFrame.cpp" ) +ADD_MODULE( FilterFrame "FilterFrame.cpp" ) diff --git a/source/ConfigureFormatDialog.cpp b/source/app/ConfigureFormatDialog.cpp similarity index 100% rename from source/ConfigureFormatDialog.cpp rename to source/app/ConfigureFormatDialog.cpp diff --git a/source/ConfigureFormatDialog.h b/source/app/ConfigureFormatDialog.h similarity index 100% rename from source/ConfigureFormatDialog.h rename to source/app/ConfigureFormatDialog.h diff --git a/source/GridManager.cpp b/source/app/GridManager.cpp similarity index 100% rename from source/GridManager.cpp rename to source/app/GridManager.cpp diff --git a/source/GridManager.h b/source/app/GridManager.h similarity index 100% rename from source/GridManager.h rename to source/app/GridManager.h diff --git a/source/InputStream.cpp b/source/app/InputStream.cpp similarity index 99% rename from source/InputStream.cpp rename to source/app/InputStream.cpp index 2805aa8..d074fc9 100755 --- a/source/InputStream.cpp +++ b/source/app/InputStream.cpp @@ -270,7 +270,7 @@ Void InputStream::readNextFrame() Bool InputStream::writeFrame( const QString& filename ) { - m_pcCurrFrame->getQimage().save( filename ); + //m_pcCurrFrame->getQimage().save( filename ); return true; } diff --git a/source/InputStream.h b/source/app/InputStream.h similarity index 100% rename from source/InputStream.h rename to source/app/InputStream.h diff --git a/source/ModulesHandle.cpp b/source/app/ModulesHandle.cpp similarity index 100% rename from source/ModulesHandle.cpp rename to source/app/ModulesHandle.cpp diff --git a/source/ModulesHandle.h b/source/app/ModulesHandle.h similarity index 100% rename from source/ModulesHandle.h rename to source/app/ModulesHandle.h diff --git a/source/PlaYUVerModuleIf.h b/source/app/PlaYUVerModuleIf.h similarity index 100% rename from source/PlaYUVerModuleIf.h rename to source/app/PlaYUVerModuleIf.h diff --git a/source/PlaYUVerSettings.cpp b/source/app/PlaYUVerSettings.cpp similarity index 100% rename from source/PlaYUVerSettings.cpp rename to source/app/PlaYUVerSettings.cpp diff --git a/source/PlaYUVerSettings.h b/source/app/PlaYUVerSettings.h similarity index 100% rename from source/PlaYUVerSettings.h rename to source/app/PlaYUVerSettings.h diff --git a/source/SubWindowHandle.cpp b/source/app/SubWindowHandle.cpp similarity index 97% rename from source/SubWindowHandle.cpp rename to source/app/SubWindowHandle.cpp index 7a25c88..8df8f29 100644 --- a/source/SubWindowHandle.cpp +++ b/source/app/SubWindowHandle.cpp @@ -241,7 +241,7 @@ Void SubWindowHandle::normalSize() Void SubWindowHandle::zoomToFit() { // Scale to a smaller size that the real to a nicer look - QSize niceFit( m_cScrollArea->viewport()->size().width() - 10, m_cScrollArea->viewport()->size().height() - 10 ); + QSize niceFit( m_cScrollArea->viewport()->size().width() - 5, m_cScrollArea->viewport()->size().height() - 5 ); if( (Int)m_pCurrStream->getWidth() <= niceFit.width() && (Int)m_pCurrStream->getHeight() <= niceFit.height() ) { normalSize(); @@ -316,7 +316,7 @@ QSize SubWindowHandle::sizeHint() const return maxSize; } -Void SubWindowHandle::closeEvent( QCloseEvent *event ) +void SubWindowHandle::closeEvent( QCloseEvent *event ) { event->accept(); } diff --git a/source/SubWindowHandle.h b/source/app/SubWindowHandle.h similarity index 98% rename from source/SubWindowHandle.h rename to source/app/SubWindowHandle.h index 298c6ff..577204b 100644 --- a/source/SubWindowHandle.h +++ b/source/app/SubWindowHandle.h @@ -142,7 +142,7 @@ public: } protected: - Void closeEvent( QCloseEvent *event ); + void closeEvent( QCloseEvent *event ); public Q_SLOTS: bool playEvent(); diff --git a/source/TypeDef.h b/source/app/TypeDef.h similarity index 100% rename from source/TypeDef.h rename to source/app/TypeDef.h diff --git a/source/ViewArea.cpp b/source/app/ViewArea.cpp similarity index 100% rename from source/ViewArea.cpp rename to source/app/ViewArea.cpp diff --git a/source/ViewArea.h b/source/app/ViewArea.h similarity index 100% rename from source/ViewArea.h rename to source/app/ViewArea.h diff --git a/source/main.cpp b/source/app/main.cpp similarity index 100% rename from source/main.cpp rename to source/app/main.cpp diff --git a/source/plaYUVerApp.cpp b/source/app/plaYUVerApp.cpp similarity index 96% rename from source/plaYUVerApp.cpp rename to source/app/plaYUVerApp.cpp index d74a443..6a1a01b 100644 --- a/source/plaYUVerApp.cpp +++ b/source/app/plaYUVerApp.cpp @@ -81,15 +81,33 @@ plaYUVerApp::plaYUVerApp() Void plaYUVerApp::closeEvent( QCloseEvent *event ) { - mdiArea->closeAllSubWindows(); - if( mdiArea->currentSubWindow() ) + Int msgBoxCloseRet = QMessageBox::Yes; + if( mdiArea->subWindowList().size() >= 1 ) { - event->ignore(); + QMessageBox msgBoxClose; + msgBoxClose.setText( "There are sub windows opened." ); + msgBoxClose.setInformativeText( "Close all?" ); + msgBoxClose.setStandardButtons( QMessageBox::Yes | QMessageBox::No ); + msgBoxClose.setDefaultButton( QMessageBox::No ); + msgBoxCloseRet = msgBoxClose.exec(); } - else + switch( msgBoxCloseRet ) { - writeSettings(); - event->accept(); + case QMessageBox::Yes: + mdiArea->closeAllSubWindows(); + if( mdiArea->subWindowList().isEmpty() ) + { + writeSettings(); + event->accept(); + } + else + { + event->ignore(); + } + break; + case QMessageBox::No: + default: + event->ignore(); } } diff --git a/source/plaYUVerApp.h b/source/app/plaYUVerApp.h similarity index 100% rename from source/plaYUVerApp.h rename to source/app/plaYUVerApp.h diff --git a/source/LibMemAlloc.cpp b/source/lib/LibMemAlloc.cpp similarity index 100% rename from source/LibMemAlloc.cpp rename to source/lib/LibMemAlloc.cpp diff --git a/source/LibMemAlloc.h b/source/lib/LibMemAlloc.h similarity index 100% rename from source/LibMemAlloc.h rename to source/lib/LibMemAlloc.h diff --git a/source/LibMemory.h b/source/lib/LibMemory.h similarity index 100% rename from source/LibMemory.h rename to source/lib/LibMemory.h diff --git a/source/PlaYUVerFrame.cpp b/source/lib/PlaYUVerFrame.cpp similarity index 96% rename from source/PlaYUVerFrame.cpp rename to source/lib/PlaYUVerFrame.cpp index b63b04b..6bfd032 100755 --- a/source/PlaYUVerFrame.cpp +++ b/source/lib/PlaYUVerFrame.cpp @@ -26,8 +26,6 @@ #include "LibMemAlloc.h" #include "LibMemory.h" -#include - namespace plaYUVer { @@ -368,28 +366,6 @@ Void PlaYUVerFrame::CopyFrom( PlaYUVerFrame* input_frame ) } -QImage PlaYUVerFrame::getQimage() -{ - QImage img( m_uiWidth, m_uiHeight, QImage::Format_RGB888 ); - Pel*** bufferRGB = getPelBufferRGB(); - - if( sizeof(Pel) == sizeof(unsigned char) ) - { - for( UInt y = 0; y < m_uiHeight; y++ ) - { - for( UInt x = 0; x < m_uiWidth; x++ ) - { - img.setPixel( x, y, qRgb( bufferRGB[COLOR_R][y][x], bufferRGB[COLOR_G][y][x], bufferRGB[COLOR_B][y][x] ) ); - } - } - } - else - { - Q_ASSERT( 0 ); - } - return img; -} - UInt64 PlaYUVerFrame::getBytesPerFrame() { switch( m_iPixelFormat ) diff --git a/source/PlaYUVerFrame.h b/source/lib/PlaYUVerFrame.h similarity index 98% rename from source/PlaYUVerFrame.h rename to source/lib/PlaYUVerFrame.h index 6b40e05..3ea455c 100755 --- a/source/PlaYUVerFrame.h +++ b/source/lib/PlaYUVerFrame.h @@ -65,8 +65,6 @@ public: static Pixel ConvertPixel( Pixel sInputPixel, ColorSpace eOutputSpace ); Pixel getPixelValue(const QPoint &pos, ColorSpace color); - QImage getQimage(); - UChar* getQImageBuffer() { return m_pcRGBPelInterlaced;