Improve histogram drawing and refresh of module window

- Now histogram update if some windows is playing but not the current window
- If the current window is a module window it will check if the source
  window is playing
- The white fill of the window is only drawn after 500ms. Trying to
  reduce the continuous refreshing even on simple modules
This commit is contained in:
jfmcarreira committed 2021-06-10 02:16:04 +01:00
1 parent cad1f6d7a6
commit 2a1b0abb2f
5 files changed
+59 -16

No files matched your search

+15 -7
View File
@@ -31,7 +31,7 @@
#include "lib/CalypStream.h"
FramePropertiesDock::FramePropertiesDock( QWidget* parent, bool* pbMainPlaySwitch )
: QWidget( parent ), m_pbIsPlaying( pbMainPlaySwitch ), m_bHasFrame( false )
: QWidget( parent ), m_bIsPlaying( false ), m_bHasFrame( false )
{
// -------------- Variables definition --------------
m_iLastFrameType = -1;
@@ -297,7 +297,7 @@ void FramePropertiesDock::reset()
setEnabled( false );
}
void FramePropertiesDock::setFrame( CalypFrame* pcFrame )
void FramePropertiesDock::setFrame( CalypFrame* pcFrame, bool isPlaying )
{
int colorSpace = pcFrame->getColorSpace();
if( m_iLastFrameType != colorSpace )
@@ -359,12 +359,20 @@ void FramePropertiesDock::setFrame( CalypFrame* pcFrame )
}
}
setEnabled( true );
if( pcFrame && !( *m_pbIsPlaying ) )
m_bIsPlaying = isPlaying;
if( !m_bIsPlaying )
{
m_bHasFrame = true;
m_cFrame = CalypFrame( pcFrame );
updateDataHistogram();
if( pcFrame )
{
m_bHasFrame = true;
m_cFrame = CalypFrame( pcFrame );
}
else
{
m_bHasFrame = false;
}
}
updateDataHistogram();
}
void FramePropertiesDock::setSelection( const QRect& selectionArea )
@@ -401,7 +409,7 @@ void FramePropertiesDock::updateDataHistogram()
{
if( m_bHasFrame && isVisible() )
{
if( !*m_pbIsPlaying )
if( !m_bIsPlaying )
{
if( m_cSelectionArea.isValid() )
{