Add support to sincronize the zoom buttons to all windows playing
syncronized
This commit is contained in:
1 parent
973ec81725
commit
e2b22889cd
4 files changed
+53
-16
No files matched your search
@@ -102,6 +102,12 @@ public:
|
||||
{
|
||||
return m_cViewArea;
|
||||
}
|
||||
|
||||
Double getZoomFactor()
|
||||
{
|
||||
return m_cViewArea->getZoomFactor();
|
||||
}
|
||||
|
||||
Void setModule( PlaYUVerModuleIf* pcCurrentModule )
|
||||
{
|
||||
m_pcCurrentModule = pcCurrentModule;
|
||||
|
||||
@@ -102,12 +102,6 @@ void ViewArea::clearMask()
|
||||
m_mask.clear();
|
||||
}
|
||||
|
||||
Double ViewArea::getZoomFactor()
|
||||
{
|
||||
return m_zoomFactor;
|
||||
}
|
||||
|
||||
|
||||
// QSize ViewArea::sizeHint() const
|
||||
// {
|
||||
// int w = m_pixmap.width()*m_zoomFactor;
|
||||
|
||||
@@ -99,11 +99,15 @@ public:
|
||||
return m_maskColor;
|
||||
}
|
||||
|
||||
Double getZoomFactor()
|
||||
{
|
||||
return m_zoomFactor;
|
||||
}
|
||||
|
||||
void setInputStream( PlaYUVerStream *stream );
|
||||
PlaYUVerStream* getInputStream();
|
||||
|
||||
Void zoomChangeEvent(Double factor, QPoint center);
|
||||
Double getZoomFactor();
|
||||
void setTool( enum eTool tool );
|
||||
|
||||
// QSize sizeHint() const;
|
||||
|
||||
@@ -616,6 +616,7 @@ Void plaYUVerApp::videoSelectionButtonEvent()
|
||||
m_acPlayingSubWindows.clear();
|
||||
SubWindowHandle *subWindow;
|
||||
QString windowName;
|
||||
Double scaleFactor = qobject_cast<SubWindowHandle *>( mdiArea->subWindowList().at( 0 ) )->getZoomFactor();
|
||||
for( Int i = 0; i < mdiArea->subWindowList().size(); i++ )
|
||||
{
|
||||
subWindow = qobject_cast<SubWindowHandle *>( mdiArea->subWindowList().at( i ) );
|
||||
@@ -624,6 +625,7 @@ Void plaYUVerApp::videoSelectionButtonEvent()
|
||||
{
|
||||
m_acPlayingSubWindows.append( subWindow );
|
||||
subWindow->seekAbsoluteEvent( m_acPlayingSubWindows.at( 0 )->getInputStream()->getCurrFrameNum() );
|
||||
subWindow->scaleView( scaleFactor );
|
||||
subWindow->play();
|
||||
m_pcFrameSlider->setMaximum( qMin( m_pcFrameSlider->maximum(), ( Int )subWindow->getInputStream()->getFrameNum() - 1 ) );
|
||||
}
|
||||
@@ -638,14 +640,38 @@ Void plaYUVerApp::videoSelectionButtonEvent()
|
||||
|
||||
Void plaYUVerApp::normalSize()
|
||||
{
|
||||
if( activeSubWindow() )
|
||||
activeSubWindow()->normalSize();
|
||||
if( m_pcCurrentSubWindow )
|
||||
{
|
||||
if( m_acPlayingSubWindows.contains( m_pcCurrentSubWindow ) )
|
||||
{
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
{
|
||||
m_acPlayingSubWindows.at( i )->normalSize();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pcCurrentSubWindow->normalSize();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Void plaYUVerApp::zoomToFit()
|
||||
{
|
||||
if( activeSubWindow() )
|
||||
activeSubWindow()->zoomToFit();
|
||||
if( m_pcCurrentSubWindow )
|
||||
{
|
||||
if( m_acPlayingSubWindows.contains( m_pcCurrentSubWindow ) )
|
||||
{
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
{
|
||||
m_acPlayingSubWindows.at( i )->zoomToFit();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pcCurrentSubWindow->zoomToFit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Void plaYUVerApp::zoomToFitAll()
|
||||
@@ -660,12 +686,19 @@ Void plaYUVerApp::zoomToFitAll()
|
||||
|
||||
Void plaYUVerApp::scaleFrame( Int ratio )
|
||||
{
|
||||
if( activeSubWindow() )
|
||||
if( m_pcCurrentSubWindow )
|
||||
{
|
||||
activeSubWindow()->scaleViewByRatio( ( Double )( ratio ) / 100.0 );
|
||||
|
||||
// m_arrayActions[ZOOM_IN_ACT]->setEnabled( activeSubWindow()->getScaleFactor() < 3.0 );
|
||||
// m_arrayActions[ZOOM_OUT_ACT]->setEnabled( activeSubWindow()->getScaleFactor() > 0.333 );
|
||||
if( m_acPlayingSubWindows.contains( m_pcCurrentSubWindow ) )
|
||||
{
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
{
|
||||
m_acPlayingSubWindows.at( i )->scaleViewByRatio( ( Double )( ratio ) / 100.0 );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pcCurrentSubWindow->scaleViewByRatio( ( Double )( ratio ) / 100.0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user