From eb4adb15577c585bc265969ceb3063fdea24e8ae Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Sat, 7 Nov 2015 18:15:27 +0000 Subject: [PATCH] Update window instead of applying module --- app/PlaYUVerAppModuleIf.cpp | 8 ++++++++ app/PlaYUVerAppModuleIf.h | 1 + app/VideoSubWindow.cpp | 13 +++++++------ app/VideoSubWindow.h | 2 +- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/app/PlaYUVerAppModuleIf.cpp b/app/PlaYUVerAppModuleIf.cpp index 9f53fcd..600900b 100644 --- a/app/PlaYUVerAppModuleIf.cpp +++ b/app/PlaYUVerAppModuleIf.cpp @@ -47,6 +47,14 @@ PlaYUVerAppModuleIf::PlaYUVerAppModuleIf( QObject* parent, QAction* action, PlaY } } +Void PlaYUVerAppModuleIf::update() +{ + if( m_pcDisplaySubWindow ) + { + m_pcDisplaySubWindow->refreshFrame(); + } +} + Bool PlaYUVerAppModuleIf::apply( Bool isPlaying, Bool disableThreads ) { Bool bRet = false; diff --git a/app/PlaYUVerAppModuleIf.h b/app/PlaYUVerAppModuleIf.h index 0654b10..3bfb424 100644 --- a/app/PlaYUVerAppModuleIf.h +++ b/app/PlaYUVerAppModuleIf.h @@ -111,6 +111,7 @@ public: return m_pcModule->m_uiModuleRequirements; } + Void update(); Bool apply( Bool isPlaying = false, Bool disableThreads = false ); Void show(); Void destroy(); diff --git a/app/VideoSubWindow.cpp b/app/VideoSubWindow.cpp index 27cd1de..d6aab36 100644 --- a/app/VideoSubWindow.cpp +++ b/app/VideoSubWindow.cpp @@ -598,13 +598,11 @@ Void VideoSubWindow::setFillWindow( Bool bFlag ) { m_pcVideoInfo->setBusyWindow( bFlag ); } + Void VideoSubWindow::setCurrFrame( PlaYUVerFrame* pcCurrFrame ) { -// if( m_pcCurrFrame ) - { - m_pcCurrFrame = pcCurrFrame; - m_cViewArea->setImage( m_pcCurrFrame ); - } + m_pcCurrFrame = pcCurrFrame; + m_cViewArea->setImage( m_pcCurrFrame ); } Void VideoSubWindow::refreshFrameOperation() @@ -625,7 +623,10 @@ Void VideoSubWindow::refreshFrameOperation() { m_cViewArea->setImage( m_pcCurrFrame ); } - ModulesHandle::applyModuleIf( m_apcCurrentModule, m_bIsPlaying ); + for( Int i = 0; i < m_apcCurrentModule.size() && !m_bIsPlaying; i++ ) + { + m_apcCurrentModule.at( i )->update(); + } } Void VideoSubWindow::refreshFrame( Bool bThreaded ) diff --git a/app/VideoSubWindow.h b/app/VideoSubWindow.h index 977ed27..3ea074c 100644 --- a/app/VideoSubWindow.h +++ b/app/VideoSubWindow.h @@ -103,7 +103,6 @@ private: QFuture m_cRefreshResult; QFuture m_cReadResult; - Void refreshFrame( Bool bThreaded = false ); Void refreshFrameOperation(); static Bool guessFormat( QString filename, UInt& rWidth, UInt& rHeight, Int& rInputFormat, UInt& rFrameRate ); @@ -132,6 +131,7 @@ public: Bool save( QString filename ); Void refreshSubWindow(); + Void refreshFrame( Bool bThreaded = false ); Bool play(); Void pause();