Change format ext api and re-format code
This commit is contained in:
62 files changed
+1422
-2579
No files matched your search
+6
-9
@@ -37,16 +37,14 @@
|
||||
|
||||
AboutDialog::AboutDialog( QWidget* parent ) : QDialog( parent )
|
||||
{
|
||||
QPixmap logo = QPixmap( ":/images/playuver-backgroud-logo.png" )
|
||||
.scaled( QSize( 500, 350 ), Qt::KeepAspectRatio );
|
||||
QPixmap logo = QPixmap( ":/images/playuver-backgroud-logo.png" ).scaled( QSize( 500, 350 ), Qt::KeepAspectRatio );
|
||||
QLabel* pixmapLabel = new QLabel;
|
||||
pixmapLabel->setPixmap( logo );
|
||||
|
||||
QLabel* label =
|
||||
new QLabel( QString( "<h1 style='text-align:center'>%1 Version %2</h1><h2>%3</h2>" )
|
||||
.arg( QApplication::applicationName() )
|
||||
.arg( QApplication::applicationVersion() )
|
||||
.arg( tr( "Enhanced open-source Qt-based raw video player" ) ) );
|
||||
QLabel* label = new QLabel( QString( "<h1 style='text-align:center'>%1 Version %2</h1><h2>%3</h2>" )
|
||||
.arg( QApplication::applicationName() )
|
||||
.arg( QApplication::applicationVersion() )
|
||||
.arg( tr( "Enhanced open-source Qt-based raw video player" ) ) );
|
||||
label->setWordWrap( true );
|
||||
|
||||
QString featuresList = QStringLiteral( "<p><b>Features:</b><ul>" );
|
||||
@@ -64,8 +62,7 @@ AboutDialog::AboutDialog( QWidget* parent ) : QDialog( parent )
|
||||
|
||||
QLabel* labelFeatures = new QLabel( featuresList );
|
||||
|
||||
QLabel* labelCopyright =
|
||||
new QLabel( QStringLiteral( "Copyright © 2014–2017 Luis Lucas and Joao Carreira" ) );
|
||||
QLabel* labelCopyright = new QLabel( QStringLiteral( "Copyright © 2014–2017 Luis Lucas and Joao Carreira" ) );
|
||||
|
||||
QWidget* topWidget = new QWidget;
|
||||
QVBoxLayout* topLayout = new QVBoxLayout;
|
||||
|
||||
@@ -147,20 +147,17 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget* parent ) : QDialog( paren
|
||||
Name = QString::fromStdString( aRCustomFileFormats[i].shortName );
|
||||
uiWidth = aRCustomFileFormats[i].uiWidth;
|
||||
uiHeight = aRCustomFileFormats[i].uiHeight;
|
||||
standardResolutionNames.append(
|
||||
QString( "%1 (%2x%3)" ).arg( Name ).arg( uiWidth ).arg( uiHeight ) );
|
||||
standardResolutionNames.append( QString( "%1 (%2x%3)" ).arg( Name ).arg( uiWidth ).arg( uiHeight ) );
|
||||
standardResolutionSizes.append( QSize( uiWidth, uiHeight ) );
|
||||
}
|
||||
|
||||
std::vector<PlaYUVerStdResolution> listPlaYUVerStdResolution =
|
||||
PlaYUVerStream::stdResolutionSizes();
|
||||
std::vector<PlaYUVerStdResolution> listPlaYUVerStdResolution = PlaYUVerStream::stdResolutionSizes();
|
||||
for( UInt i = 0; i < listPlaYUVerStdResolution.size(); i++ )
|
||||
{
|
||||
Name = QString::fromStdString( listPlaYUVerStdResolution[i].shortName );
|
||||
uiWidth = listPlaYUVerStdResolution[i].uiWidth;
|
||||
uiHeight = listPlaYUVerStdResolution[i].uiHeight;
|
||||
standardResolutionNames.append(
|
||||
QString( "%1 (%2x%3)" ).arg( Name ).arg( uiWidth ).arg( uiHeight ) );
|
||||
standardResolutionNames.append( QString( "%1 (%2x%3)" ).arg( Name ).arg( uiWidth ).arg( uiHeight ) );
|
||||
standardResolutionSizes.append( QSize( uiWidth, uiHeight ) );
|
||||
}
|
||||
|
||||
@@ -208,8 +205,7 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget* parent ) : QDialog( paren
|
||||
m_labelFilename = new QLabel();
|
||||
m_labelFilename->setFont( titleFont );
|
||||
filenameLayout->addWidget( filenameLabel );
|
||||
filenameLayout->addItem(
|
||||
new QSpacerItem( 20, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
|
||||
filenameLayout->addItem( new QSpacerItem( 20, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
|
||||
filenameLayout->addWidget( m_labelFilename );
|
||||
MainLayout->addLayout( filenameLayout );
|
||||
|
||||
@@ -287,19 +283,16 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget* parent ) : QDialog( paren
|
||||
|
||||
for( UInt i = 0; i < PlaYUVerFrame::supportedColorSpacesListNames().size(); i++ )
|
||||
{
|
||||
m_comboBoxColorSpace->insertItem( i,
|
||||
PlaYUVerFrame::supportedColorSpacesListNames()[i].c_str() );
|
||||
m_comboBoxColorSpace->insertItem( i, PlaYUVerFrame::supportedColorSpacesListNames()[i].c_str() );
|
||||
}
|
||||
m_comboBoxColorSpace->setCurrentIndex( 1 );
|
||||
|
||||
pixelGridLayout->addWidget( colorSpaceLabel, 0, 0 );
|
||||
pixelGridLayout->addItem( new QSpacerItem( 10, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ),
|
||||
0, 1 );
|
||||
pixelGridLayout->addItem( new QSpacerItem( 10, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
|
||||
pixelGridLayout->addWidget( m_comboBoxColorSpace, 0, 2 );
|
||||
|
||||
pixelGridLayout->addWidget( pixelFormatLabel, 1, 0 );
|
||||
pixelGridLayout->addItem( new QSpacerItem( 10, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ),
|
||||
1, 1 );
|
||||
pixelGridLayout->addItem( new QSpacerItem( 10, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ), 1, 1 );
|
||||
pixelGridLayout->addWidget( m_comboBoxPixelFormat, 1, 2 );
|
||||
|
||||
QLabel* bitsPerPelLabel = new QLabel();
|
||||
@@ -311,8 +304,7 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget* parent ) : QDialog( paren
|
||||
m_spinBoxBits->setRange( 0, 16 );
|
||||
m_spinBoxBits->setValue( 8 );
|
||||
pixelGridLayout->addWidget( bitsPerPelLabel, 2, 0 );
|
||||
pixelGridLayout->addItem( new QSpacerItem( 20, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ),
|
||||
2, 1 );
|
||||
pixelGridLayout->addItem( new QSpacerItem( 20, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ), 2, 1 );
|
||||
pixelGridLayout->addWidget( m_spinBoxBits, 2, 2 );
|
||||
|
||||
/*
|
||||
@@ -329,8 +321,7 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget* parent ) : QDialog( paren
|
||||
m_comboBoxEndianness->addItem( QStringLiteral( "Big Endian" ) );
|
||||
m_comboBoxEndianness->addItem( QStringLiteral( "Little Endian" ) );
|
||||
endiannessLayout->addWidget( endiannessLabel );
|
||||
endiannessLayout->addItem(
|
||||
new QSpacerItem( 20, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
|
||||
endiannessLayout->addItem( new QSpacerItem( 20, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
|
||||
endiannessLayout->addWidget( m_comboBoxEndianness );
|
||||
m_widgetEndianness = new QWidget();
|
||||
m_widgetEndianness->setContentsMargins( 0, 0, 0, 0 );
|
||||
@@ -350,8 +341,7 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget* parent ) : QDialog( paren
|
||||
m_spinBoxFrameRate->setRange( 0, 1000 );
|
||||
m_spinBoxFrameRate->setValue( 30 );
|
||||
framerateFormatLayout->addWidget( framerateFormatLabel );
|
||||
framerateFormatLayout->addItem(
|
||||
new QSpacerItem( 20, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
|
||||
framerateFormatLayout->addItem( new QSpacerItem( 20, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
|
||||
framerateFormatLayout->addWidget( m_spinBoxFrameRate );
|
||||
QWidget* framerateWidget = new QWidget();
|
||||
framerateWidget->setContentsMargins( 0, 0, 0, 0 );
|
||||
@@ -375,12 +365,10 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget* parent ) : QDialog( paren
|
||||
MainLayout->addItem( new QSpacerItem( 10, 5, QSizePolicy::Minimum, QSizePolicy::Expanding ) );
|
||||
MainLayout->addWidget( dialogButtonOkCancel );
|
||||
|
||||
connect( m_comboBoxStandardResolution, SIGNAL( currentIndexChanged( int ) ), this,
|
||||
SLOT( slotStandardResolutionSelected( int ) ) );
|
||||
connect( m_comboBoxStandardResolution, SIGNAL( currentIndexChanged( int ) ), this, SLOT( slotStandardResolutionSelected( int ) ) );
|
||||
connect( m_spinBoxWidth, SIGNAL( valueChanged( int ) ), this, SLOT( slotResolutionChange() ) );
|
||||
connect( m_spinBoxheight, SIGNAL( valueChanged( int ) ), this, SLOT( slotResolutionChange() ) );
|
||||
connect( m_comboBoxColorSpace, SIGNAL( currentIndexChanged( int ) ), this,
|
||||
SLOT( slotColorSpaceChange( int ) ) );
|
||||
connect( m_comboBoxColorSpace, SIGNAL( currentIndexChanged( int ) ), this, SLOT( slotColorSpaceChange( int ) ) );
|
||||
connect( m_spinBoxBits, SIGNAL( valueChanged( int ) ), this, SLOT( slotBitsChange( int ) ) );
|
||||
|
||||
connect( dialogButtonOkCancel, SIGNAL( accepted() ), this, SLOT( accept() ) );
|
||||
@@ -482,11 +470,9 @@ void ConfigureFormatDialog::slotStandardResolutionSelected( Int idx )
|
||||
if( customResolution.shortName != "" )
|
||||
{
|
||||
QString name = QString::fromStdString( customResolution.shortName );
|
||||
name.append(
|
||||
QString( " (%2x%3)" ).arg( customResolution.uiWidth ).arg( customResolution.uiHeight ) );
|
||||
name.append( QString( " (%2x%3)" ).arg( customResolution.uiWidth ).arg( customResolution.uiHeight ) );
|
||||
standardResolutionNames.insert( 0, name );
|
||||
standardResolutionSizes.insert(
|
||||
0, QSize( customResolution.uiWidth, customResolution.uiHeight ) );
|
||||
standardResolutionSizes.insert( 0, QSize( customResolution.uiWidth, customResolution.uiHeight ) );
|
||||
|
||||
m_comboBoxStandardResolution->blockSignals( true );
|
||||
m_comboBoxStandardResolution->insertItem( 0, name );
|
||||
@@ -512,8 +498,7 @@ void ConfigureFormatDialog::slotResolutionChange()
|
||||
Int newIdx = -1;
|
||||
for( Int i = 0; i < standardResolutionSizes.size(); i++ )
|
||||
{
|
||||
if( standardResolutionSizes.at( i ) ==
|
||||
QSize( m_spinBoxWidth->value(), m_spinBoxheight->value() ) )
|
||||
if( standardResolutionSizes.at( i ) == QSize( m_spinBoxWidth->value(), m_spinBoxheight->value() ) )
|
||||
{
|
||||
newIdx = i;
|
||||
break;
|
||||
@@ -531,8 +516,7 @@ Void ConfigureFormatDialog::slotColorSpaceChange( Int idx )
|
||||
m_comboBoxPixelFormat->clear();
|
||||
for( UInt i = 0; i < PlaYUVerFrame::supportedPixelFormatListNames( idx ).size(); i++ )
|
||||
{
|
||||
m_comboBoxPixelFormat->insertItem(
|
||||
i, PlaYUVerFrame::supportedPixelFormatListNames( idx )[i].c_str() );
|
||||
m_comboBoxPixelFormat->insertItem( i, PlaYUVerFrame::supportedPixelFormatListNames( idx )[i].c_str() );
|
||||
}
|
||||
m_comboBoxPixelFormat->setCurrentIndex( 0 );
|
||||
}
|
||||
|
||||
@@ -27,8 +27,7 @@
|
||||
#include <QtGui>
|
||||
#include <cmath>
|
||||
|
||||
FramePropertiesDock::FramePropertiesDock( QWidget* parent, Bool* pbMainPlaySwitch )
|
||||
: QWidget( parent ), m_pbIsPlaying( pbMainPlaySwitch )
|
||||
FramePropertiesDock::FramePropertiesDock( QWidget* parent, Bool* pbMainPlaySwitch ) : QWidget( parent ), m_pbIsPlaying( pbMainPlaySwitch )
|
||||
{
|
||||
// -------------- Variables definition --------------
|
||||
m_pcFrame = NULL;
|
||||
@@ -240,19 +239,13 @@ FramePropertiesDock::FramePropertiesDock( QWidget* parent, Bool* pbMainPlaySwitc
|
||||
setEnabled( false );
|
||||
|
||||
connect( channelCB, SIGNAL( activated( int ) ), this, SLOT( slotChannelChanged( int ) ) );
|
||||
connect( scaleButtonGroup, SIGNAL( buttonClicked( int ) ), this,
|
||||
SLOT( slotScaleChanged( int ) ) );
|
||||
connect( scaleButtonGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( slotScaleChanged( int ) ) );
|
||||
connect( colorsCB, SIGNAL( activated( int ) ), this, SLOT( slotColorsChanged( int ) ) );
|
||||
connect( renderingButtonGroup, SIGNAL( buttonClicked( int ) ), this,
|
||||
SLOT( slotRenderingChanged( int ) ) );
|
||||
connect( histogramWidget, SIGNAL( signalIntervalChanged( int, int ) ), this,
|
||||
SLOT( slotUpdateInterval( int, int ) ) );
|
||||
connect( histogramWidget, SIGNAL( signalMaximumValueChanged( int ) ), this,
|
||||
SLOT( slotUpdateIntervRange( int ) ) );
|
||||
connect( histogramWidget, SIGNAL( signalHistogramComputationDone( int ) ), this,
|
||||
SLOT( slotRefreshOptions( int ) ) );
|
||||
connect( histogramWidget, SIGNAL( signalHistogramComputationFailed( void ) ), this,
|
||||
SLOT( slotHistogramComputationFailed( void ) ) );
|
||||
connect( renderingButtonGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( slotRenderingChanged( int ) ) );
|
||||
connect( histogramWidget, SIGNAL( signalIntervalChanged( int, int ) ), this, SLOT( slotUpdateInterval( int, int ) ) );
|
||||
connect( histogramWidget, SIGNAL( signalMaximumValueChanged( int ) ), this, SLOT( slotUpdateIntervRange( int ) ) );
|
||||
connect( histogramWidget, SIGNAL( signalHistogramComputationDone( int ) ), this, SLOT( slotRefreshOptions( int ) ) );
|
||||
connect( histogramWidget, SIGNAL( signalHistogramComputationFailed( void ) ), this, SLOT( slotHistogramComputationFailed( void ) ) );
|
||||
connect( minInterv, SIGNAL( valueChanged( int ) ), this, SLOT( slotMinValueChanged( int ) ) );
|
||||
connect( maxInterv, SIGNAL( valueChanged( int ) ), this, SLOT( slotMaxValueChanged( int ) ) );
|
||||
}
|
||||
@@ -392,8 +385,7 @@ Void FramePropertiesDock::setSelection( const QRect& selectionArea )
|
||||
{
|
||||
delete m_pcSelectedFrame;
|
||||
}
|
||||
m_pcSelectedFrame = new PlaYUVerFrame( m_pcFrame, selectionArea.x(), selectionArea.y(),
|
||||
selectionArea.width(), selectionArea.height() );
|
||||
m_pcSelectedFrame = new PlaYUVerFrame( m_pcFrame, selectionArea.x(), selectionArea.y(), selectionArea.width(), selectionArea.height() );
|
||||
}
|
||||
updateDataHistogram();
|
||||
selectionImageButton->click();
|
||||
@@ -460,8 +452,7 @@ Void FramePropertiesDock::updateStatistiques()
|
||||
|
||||
if( frame )
|
||||
{
|
||||
QString rangeText = "[" + QString::number( frame->getMin( channel ) ) + ":" +
|
||||
QString::number( frame->getMax( channel ) ) + "]";
|
||||
QString rangeText = "[" + QString::number( frame->getMin( channel ) ) + ":" + QString::number( frame->getMax( channel ) ) + "]";
|
||||
labelRangeValue->setText( rangeText );
|
||||
|
||||
double mean = frame->getMean( channel, min, max );
|
||||
|
||||
+9
-14
@@ -177,8 +177,7 @@ HistogramWidget::HistogramWidget( Int width, Int height, QWidget* parent ) : QWi
|
||||
m_colorType = FirstChannelColor;
|
||||
m_renderingType = FullImageHistogram;
|
||||
|
||||
setOptions( HistogramWidget::BlinkComputation | HistogramWidget::SelectMode |
|
||||
HistogramWidget::ShowLumaChannel );
|
||||
setOptions( HistogramWidget::BlinkComputation | HistogramWidget::SelectMode | HistogramWidget::ShowLumaChannel );
|
||||
|
||||
setMouseTracking( true );
|
||||
setMinimumSize( width, height );
|
||||
@@ -434,22 +433,21 @@ Void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
// or loading, but no message shall be drawn:
|
||||
// Drawing grayed frame.
|
||||
if( !isEnabled() || d->clearFlag == HistogramWidgetPrivate::HistogramNone ||
|
||||
( !d->blinkComputation && ( d->clearFlag == HistogramWidgetPrivate::HistogramStarted ||
|
||||
d->clearFlag == HistogramWidgetPrivate::HistogramDataLoading ) ) )
|
||||
( !d->blinkComputation &&
|
||||
( d->clearFlag == HistogramWidgetPrivate::HistogramStarted || d->clearFlag == HistogramWidgetPrivate::HistogramDataLoading ) ) )
|
||||
{
|
||||
QPainter p1( this );
|
||||
|
||||
p1.fillRect( 0, 0, maxX, maxY, palette().color( QPalette::Disabled, QPalette::Window ) );
|
||||
p1.setPen(
|
||||
QPen( palette().color( QPalette::Disabled, QPalette::WindowText ), 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( palette().color( QPalette::Disabled, QPalette::WindowText ), 1, Qt::SolidLine ) );
|
||||
p1.drawRect( 0, 0, maxX, maxY );
|
||||
|
||||
return;
|
||||
}
|
||||
// Image data is loading or histogram is being computed:
|
||||
// Draw message.
|
||||
else if( d->blinkComputation && ( d->clearFlag == HistogramWidgetPrivate::HistogramStarted ||
|
||||
d->clearFlag == HistogramWidgetPrivate::HistogramDataLoading ) )
|
||||
else if( d->blinkComputation &&
|
||||
( d->clearFlag == HistogramWidgetPrivate::HistogramStarted || d->clearFlag == HistogramWidgetPrivate::HistogramDataLoading ) )
|
||||
{
|
||||
QPainter p1( this );
|
||||
|
||||
@@ -463,8 +461,7 @@ Void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
if( d->clearFlag == HistogramWidgetPrivate::HistogramDataLoading )
|
||||
p1.drawText( 0, 0, maxX, maxY, Qt::AlignCenter, tr( "Loading image..." ) );
|
||||
else
|
||||
p1.drawText( 0, 0, maxX, maxY, Qt::AlignCenter,
|
||||
tr( "Histogram\ncalculation\nin progress..." ) );
|
||||
p1.drawText( 0, 0, maxX, maxY, Qt::AlignCenter, tr( "Histogram\ncalculation\nin progress..." ) );
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -529,8 +526,7 @@ Void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
break;
|
||||
|
||||
case HistogramWidget::ColorChannelsHistogram: // All color channels.
|
||||
max = qMax( qMax( frame->getMaximum( LUMA ), frame->getMaximum( CHROMA_U ) ),
|
||||
frame->getMaximum( CHROMA_V ) );
|
||||
max = qMax( qMax( frame->getMaximum( LUMA ), frame->getMaximum( CHROMA_U ) ), frame->getMaximum( CHROMA_V ) );
|
||||
break;
|
||||
// case HistogramWidget::LumaHistogram: // Luminance.
|
||||
// max = frame->getMaximum( LUMA );
|
||||
@@ -1058,8 +1054,7 @@ Void HistogramWidget::mouseMoveEvent( QMouseEvent* e )
|
||||
|
||||
Void HistogramWidget::notifyValuesChanged()
|
||||
{
|
||||
emit signalIntervalChanged( (int)( d->xmin * d->range ),
|
||||
d->xmax == 0.0 ? d->range : (int)( d->xmax * d->range ) );
|
||||
emit signalIntervalChanged( (int)( d->xmin * d->range ), d->xmax == 0.0 ? d->range : (int)( d->xmax * d->range ) );
|
||||
}
|
||||
|
||||
Void HistogramWidget::slotMinValueChanged( int min )
|
||||
|
||||
@@ -27,8 +27,7 @@
|
||||
#include "PlaYUVerAppModuleIf.h"
|
||||
#include <QtGui>
|
||||
|
||||
ModuleHandleDock::ModuleHandleDock( QWidget* parent, PlaYUVerAppModuleIf* moduleIf )
|
||||
: QWidget( parent ), m_pcCurrModuleIf( moduleIf )
|
||||
ModuleHandleDock::ModuleHandleDock( QWidget* parent, PlaYUVerAppModuleIf* moduleIf ) : QWidget( parent ), m_pcCurrModuleIf( moduleIf )
|
||||
{
|
||||
// ----------------- Dock definition -----------------
|
||||
|
||||
|
||||
+54
-85
@@ -32,13 +32,8 @@
|
||||
#include "modules/PlaYUVerModuleFactory.h"
|
||||
#include <cstdio>
|
||||
|
||||
ModulesHandle::ModulesHandle( QWidget* parent,
|
||||
PlaYUVerSubWindowHandle* windowManager,
|
||||
VideoHandle* moduleVideo )
|
||||
: QWidget( parent )
|
||||
, m_pcParent( parent )
|
||||
, m_pcMainWindowManager( windowManager )
|
||||
, m_appModuleVideo( moduleVideo )
|
||||
ModulesHandle::ModulesHandle( QWidget* parent, PlaYUVerSubWindowHandle* windowManager, VideoHandle* moduleVideo )
|
||||
: QWidget( parent ), m_pcParent( parent ), m_pcMainWindowManager( windowManager ), m_appModuleVideo( moduleVideo )
|
||||
{
|
||||
setParent( m_pcParent );
|
||||
}
|
||||
@@ -60,8 +55,7 @@ Void ModulesHandle::createActions()
|
||||
|
||||
m_arrayActions[LOAD_EXTERNAL_ACT] = new QAction( "Load external module", parent() );
|
||||
m_arrayActions[LOAD_EXTERNAL_ACT]->setStatusTip( "Load an externally build module" );
|
||||
connect( m_arrayActions[LOAD_EXTERNAL_ACT], SIGNAL( triggered() ), this,
|
||||
SLOT( loadExternalModule() ) );
|
||||
connect( m_arrayActions[LOAD_EXTERNAL_ACT], SIGNAL( triggered() ), this, SLOT( loadExternalModule() ) );
|
||||
|
||||
m_arrayActions[APPLY_ALL_ACT] = new QAction( "Apply to All", parent() );
|
||||
m_arrayActions[APPLY_ALL_ACT]->setStatusTip( "Apply module to all frames and save the result" );
|
||||
@@ -70,17 +64,14 @@ Void ModulesHandle::createActions()
|
||||
|
||||
m_arrayActions[SWAP_FRAMES_ACT] = new QAction( "Swap frames", parent() );
|
||||
m_arrayActions[SWAP_FRAMES_ACT]->setStatusTip( "Swap Sub Window order" );
|
||||
connect( m_arrayActions[SWAP_FRAMES_ACT], SIGNAL( triggered() ), m_pcActionMapper,
|
||||
SLOT( map() ) );
|
||||
connect( m_arrayActions[SWAP_FRAMES_ACT], SIGNAL( triggered() ), m_pcActionMapper, SLOT( map() ) );
|
||||
m_pcActionMapper->setMapping( m_arrayActions[SWAP_FRAMES_ACT], SWAP_FRAMES_ACT );
|
||||
|
||||
m_arrayActions[DISABLE_ACT] = new QAction( "Disable Modules", parent() );
|
||||
connect( m_arrayActions[DISABLE_ACT], SIGNAL( triggered() ), this,
|
||||
SLOT( destroyWindowModules() ) );
|
||||
connect( m_arrayActions[DISABLE_ACT], SIGNAL( triggered() ), this, SLOT( destroyWindowModules() ) );
|
||||
|
||||
m_arrayActions[DISABLE_ALL_ACT] = new QAction( "Disable All Modules", parent() );
|
||||
connect( m_arrayActions[DISABLE_ALL_ACT], SIGNAL( triggered() ), this,
|
||||
SLOT( destroyAllModulesIf() ) );
|
||||
connect( m_arrayActions[DISABLE_ALL_ACT], SIGNAL( triggered() ), this, SLOT( destroyAllModulesIf() ) );
|
||||
|
||||
m_arrayActions[FORCE_NEW_WINDOW_ACT] = new QAction( "Use New Window", parent() );
|
||||
m_arrayActions[FORCE_NEW_WINDOW_ACT]->setStatusTip(
|
||||
@@ -123,8 +114,7 @@ Void ModulesHandle::buildMenu()
|
||||
{
|
||||
for( Int j = 0; j < m_pcModulesSubMenuList.size(); j++ )
|
||||
{
|
||||
if( m_pcModulesSubMenuList.at( j )->title() ==
|
||||
QString( pcCurrModuleIf->m_pchModuleCategory ) )
|
||||
if( m_pcModulesSubMenuList.at( j )->title() == QString( pcCurrModuleIf->m_pchModuleCategory ) )
|
||||
{
|
||||
currSubMenu = m_pcModulesSubMenuList.at( j );
|
||||
break;
|
||||
@@ -163,8 +153,7 @@ Void ModulesHandle::buildMenu()
|
||||
|
||||
Void ModulesHandle::updateMenus()
|
||||
{
|
||||
VideoSubWindow* pcSubWindow =
|
||||
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
VideoSubWindow* pcSubWindow = qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
Bool hasSubWindow = pcSubWindow ? true : false;
|
||||
QAction* currModuleAction;
|
||||
|
||||
@@ -207,21 +196,18 @@ Void ModulesHandle::updateMenus()
|
||||
Void ModulesHandle::readSettings()
|
||||
{
|
||||
QSettings appSettings;
|
||||
m_arrayActions[FORCE_NEW_WINDOW_ACT]->setChecked(
|
||||
appSettings.value( "ModulesHandle/UseNewWindow", false ).toBool() );
|
||||
m_arrayActions[FORCE_NEW_WINDOW_ACT]->setChecked( appSettings.value( "ModulesHandle/UseNewWindow", false ).toBool() );
|
||||
}
|
||||
|
||||
Void ModulesHandle::writeSettings()
|
||||
{
|
||||
QSettings appSettings;
|
||||
appSettings.setValue( "ModulesHandle/UseNewWindow",
|
||||
m_arrayActions[FORCE_NEW_WINDOW_ACT]->isChecked() );
|
||||
appSettings.setValue( "ModulesHandle/UseNewWindow", m_arrayActions[FORCE_NEW_WINDOW_ACT]->isChecked() );
|
||||
}
|
||||
|
||||
Void ModulesHandle::processOpt( Int index )
|
||||
{
|
||||
VideoSubWindow* pcSubWindow =
|
||||
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
VideoSubWindow* pcSubWindow = qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
if( pcSubWindow )
|
||||
{
|
||||
PlaYUVerAppModuleIf* pcCurrentModule = pcSubWindow->getDisplayModule();
|
||||
@@ -254,8 +240,7 @@ Void ModulesHandle::loadExternalModule()
|
||||
formatsList << "Shared Libraries (*.so)";
|
||||
QStringList filter;
|
||||
filter << supported << formatsList << tr( "All Files (*)" );
|
||||
QStringList fileNames = QFileDialog::getOpenFileNames( m_pcParent, tr( "Open File" ), QString(),
|
||||
filter.join( ";;" ) );
|
||||
QStringList fileNames = QFileDialog::getOpenFileNames( m_pcParent, tr( "Open File" ), QString(), filter.join( ";;" ) );
|
||||
|
||||
for( Int i = 0; i < fileNames.size(); i++ )
|
||||
{
|
||||
@@ -271,24 +256,20 @@ Void ModulesHandle::activateModule()
|
||||
Qt::KeyboardModifiers keyModifiers = QApplication::keyboardModifiers();
|
||||
Bool bTmpForceNewWindow = false;
|
||||
|
||||
VideoSubWindow* pcVideoSubWindow =
|
||||
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
VideoSubWindow* pcVideoSubWindow = qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
if( !pcVideoSubWindow )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if( ( keyModifiers & Qt::ControlModifier ) ||
|
||||
pcVideoSubWindow->checkCategory( VideoSubWindow::MODULE_SUBWINDOW ) )
|
||||
if( ( keyModifiers & Qt::ControlModifier ) || pcVideoSubWindow->checkCategory( VideoSubWindow::MODULE_SUBWINDOW ) )
|
||||
{
|
||||
bTmpForceNewWindow = true;
|
||||
}
|
||||
|
||||
QString ModuleIfName = pcAction->data().toString();
|
||||
PlaYUVerModuleIf* pcCurrModuleIf =
|
||||
PlaYUVerModuleFactory::Get()->CreateModule( ModuleIfName.toLocal8Bit().constData() );
|
||||
PlaYUVerAppModuleIf* pcCurrAppModuleIf =
|
||||
new PlaYUVerAppModuleIf( this, pcAction, pcCurrModuleIf );
|
||||
PlaYUVerModuleIf* pcCurrModuleIf = PlaYUVerModuleFactory::Get()->CreateModule( ModuleIfName.toLocal8Bit().constData() );
|
||||
PlaYUVerAppModuleIf* pcCurrAppModuleIf = new PlaYUVerAppModuleIf( this, pcAction, pcCurrModuleIf );
|
||||
|
||||
QList<VideoSubWindow*> videoSubWindowList;
|
||||
Int numberOfFrames = pcCurrAppModuleIf->m_pcModule->m_uiNumberOfFrames;
|
||||
@@ -301,11 +282,9 @@ Void ModulesHandle::activateModule()
|
||||
minNumFrames = 0;
|
||||
maxNumFrames = 255;
|
||||
}
|
||||
DialogSubWindowSelector dialogWindowsSelection( m_pcParent, m_pcMainWindowManager,
|
||||
SubWindowAbstract::VIDEO_SUBWINDOW,
|
||||
minNumFrames, maxNumFrames );
|
||||
QList<SubWindowAbstract*> windowsList =
|
||||
m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
DialogSubWindowSelector dialogWindowsSelection( m_pcParent, m_pcMainWindowManager, SubWindowAbstract::VIDEO_SUBWINDOW, minNumFrames,
|
||||
maxNumFrames );
|
||||
QList<SubWindowAbstract*> windowsList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
|
||||
if( windowsList.size() == minNumFrames && windowsList.size() == maxNumFrames )
|
||||
{
|
||||
@@ -343,12 +322,10 @@ Void ModulesHandle::activateModule()
|
||||
// Check for same fmt in more than one frame modules
|
||||
for( Int i = 1; i < videoSubWindowList.size(); i++ )
|
||||
{
|
||||
if( !videoSubWindowList.at( i )->getCurrFrame()->haveSameFmt(
|
||||
videoSubWindowList.at( 0 )->getCurrFrame() ) )
|
||||
if( !videoSubWindowList.at( i )->getCurrFrame()->haveSameFmt( videoSubWindowList.at( 0 )->getCurrFrame() ) )
|
||||
{
|
||||
videoSubWindowList.clear();
|
||||
qobject_cast<PlaYUVerApp*>( m_pcParent )
|
||||
->printMessage( "Error! Incompatible frames", LOG_ERROR );
|
||||
qobject_cast<PlaYUVerApp*>( m_pcParent )->printMessage( "Error! Incompatible frames", LOG_ERROR );
|
||||
destroyModuleIf( pcCurrAppModuleIf );
|
||||
return;
|
||||
}
|
||||
@@ -362,8 +339,7 @@ Void ModulesHandle::activateModule()
|
||||
|
||||
if( videoSubWindowList.size() == 0 )
|
||||
{
|
||||
qobject_cast<PlaYUVerApp*>( m_pcParent )
|
||||
->printMessage( "Error! There is no windows to apply the module", LOG_ERROR );
|
||||
qobject_cast<PlaYUVerApp*>( m_pcParent )->printMessage( "Error! There is no windows to apply the module", LOG_ERROR );
|
||||
destroyModuleIf( pcCurrAppModuleIf );
|
||||
return;
|
||||
}
|
||||
@@ -378,34 +354,29 @@ Void ModulesHandle::activateModule()
|
||||
ModulesHandleOptDialog moduleOptDialog( m_pcParent, pcCurrAppModuleIf );
|
||||
if( moduleOptDialog.runConfiguration() == QDialog::Rejected )
|
||||
{
|
||||
qobject_cast<PlaYUVerApp*>( m_pcParent )
|
||||
->printMessage( "Module canceled by user!", LOG_WARNINGS );
|
||||
qobject_cast<PlaYUVerApp*>( m_pcParent )->printMessage( "Module canceled by user!", LOG_WARNINGS );
|
||||
destroyModuleIf( pcCurrAppModuleIf );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Bool bShowModulesNewWindow =
|
||||
m_arrayActions[FORCE_NEW_WINDOW_ACT]->isChecked() | bTmpForceNewWindow;
|
||||
Bool bShowModulesNewWindow = m_arrayActions[FORCE_NEW_WINDOW_ACT]->isChecked() | bTmpForceNewWindow;
|
||||
|
||||
QString windowName;
|
||||
|
||||
VideoSubWindow* pcModuleSubWindow = NULL;
|
||||
if( pcCurrAppModuleIf->m_pcModule->m_iModuleType == FRAME_PROCESSING_MODULE )
|
||||
{
|
||||
if( ( pcCurrAppModuleIf->m_pcModule->m_uiModuleRequirements & MODULE_REQUIRES_NEW_WINDOW ) ||
|
||||
bShowModulesNewWindow )
|
||||
if( ( pcCurrAppModuleIf->m_pcModule->m_uiModuleRequirements & MODULE_REQUIRES_NEW_WINDOW ) || bShowModulesNewWindow )
|
||||
{
|
||||
pcModuleSubWindow = new VideoSubWindow( VideoSubWindow::MODULE_SUBWINDOW );
|
||||
windowName.append( QStringLiteral( "Module " ) );
|
||||
windowName.append( pcCurrAppModuleIf->m_pcModule->m_pchModuleName );
|
||||
|
||||
connect( pcModuleSubWindow->getViewArea(), SIGNAL( selectionChanged( QRect ) ),
|
||||
m_appModuleVideo, SLOT( updateSelectionArea( QRect ) ) );
|
||||
connect( pcModuleSubWindow, SIGNAL( zoomFactorChanged_SWindow( const double, const QPoint ) ),
|
||||
m_appModuleVideo, SLOT( zoomToFactorAll( double, QPoint ) ) );
|
||||
connect( pcModuleSubWindow, SIGNAL( scrollBarMoved_SWindow( const QPoint ) ),
|
||||
m_appModuleVideo, SLOT( moveAllScrollBars( const QPoint ) ) );
|
||||
connect( pcModuleSubWindow->getViewArea(), SIGNAL( selectionChanged( QRect ) ), m_appModuleVideo, SLOT( updateSelectionArea( QRect ) ) );
|
||||
connect( pcModuleSubWindow, SIGNAL( zoomFactorChanged_SWindow( const double, const QPoint ) ), m_appModuleVideo,
|
||||
SLOT( zoomToFactorAll( double, QPoint ) ) );
|
||||
connect( pcModuleSubWindow, SIGNAL( scrollBarMoved_SWindow( const QPoint ) ), m_appModuleVideo, SLOT( moveAllScrollBars( const QPoint ) ) );
|
||||
|
||||
pcCurrAppModuleIf->m_pcDisplaySubWindow = pcModuleSubWindow;
|
||||
}
|
||||
@@ -418,13 +389,10 @@ Void ModulesHandle::activateModule()
|
||||
titleDockWidget.append( pcCurrAppModuleIf->m_pcModule->m_pchModuleName );
|
||||
titleDockWidget.append( " Information" );
|
||||
pcCurrAppModuleIf->m_pcDockWidget = new QDockWidget( titleDockWidget, m_pcParent );
|
||||
pcCurrAppModuleIf->m_pcDockWidget->setFeatures( QDockWidget::DockWidgetMovable |
|
||||
QDockWidget::DockWidgetFloatable );
|
||||
pcCurrAppModuleIf->m_pcDockWidget->setAllowedAreas( Qt::LeftDockWidgetArea |
|
||||
Qt::RightDockWidgetArea );
|
||||
pcCurrAppModuleIf->m_pcDockWidget->setFeatures( QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable );
|
||||
pcCurrAppModuleIf->m_pcDockWidget->setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );
|
||||
pcCurrAppModuleIf->m_pcDockWidget->setWidget( pcCurrAppModuleIf->m_pcModuleDock );
|
||||
qobject_cast<QMainWindow*>( m_pcParent )
|
||||
->addDockWidget( Qt::RightDockWidgetArea, pcCurrAppModuleIf->m_pcDockWidget );
|
||||
qobject_cast<QMainWindow*>( m_pcParent )->addDockWidget( Qt::RightDockWidgetArea, pcCurrAppModuleIf->m_pcDockWidget );
|
||||
}
|
||||
|
||||
// Associate module with subwindows
|
||||
@@ -461,8 +429,7 @@ Void ModulesHandle::activateModule()
|
||||
|
||||
if( !moduleCreated )
|
||||
{
|
||||
qobject_cast<PlaYUVerApp*>( m_pcParent )
|
||||
->printMessage( "Error! Module cannot be created", LOG_ERROR );
|
||||
qobject_cast<PlaYUVerApp*>( m_pcParent )->printMessage( "Error! Module cannot be created", LOG_ERROR );
|
||||
destroyModuleIf( pcCurrAppModuleIf );
|
||||
return;
|
||||
}
|
||||
@@ -499,8 +466,7 @@ Void ModulesHandle::destroyModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf )
|
||||
|
||||
Void ModulesHandle::destroyWindowModules()
|
||||
{
|
||||
VideoSubWindow* pcVideoSubWindow =
|
||||
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
VideoSubWindow* pcVideoSubWindow = qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
if( pcVideoSubWindow )
|
||||
{
|
||||
pcVideoSubWindow->disableModule();
|
||||
@@ -517,9 +483,7 @@ Void ModulesHandle::destroyAllModulesIf()
|
||||
emit changed();
|
||||
}
|
||||
|
||||
Void ModulesHandle::applyModuleIf( QList<PlaYUVerAppModuleIf*> pcCurrModuleIfList,
|
||||
Bool isPlaying,
|
||||
Bool disableThreads )
|
||||
Void ModulesHandle::applyModuleIf( QList<PlaYUVerAppModuleIf*> pcCurrModuleIfList, Bool isPlaying, Bool disableThreads )
|
||||
{
|
||||
for( Int i = 0; i < pcCurrModuleIfList.size() && !isPlaying; i++ )
|
||||
{
|
||||
@@ -538,26 +502,32 @@ Void ModulesHandle::applyAllModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf )
|
||||
|
||||
QString supported = tr( "Supported Files (" );
|
||||
QStringList formatsList;
|
||||
|
||||
std::vector<PlaYUVerSupportedFormat> supportedFmts = PlaYUVerStream::supportedWriteFormats();
|
||||
|
||||
for( UInt i = 0; i < supportedFmts.size(); i++ )
|
||||
{
|
||||
QString currFmt;
|
||||
supported.append( " *." );
|
||||
supported.append( QString::fromStdString( supportedFmts[i].formatExt ) );
|
||||
currFmt.append( QString::fromStdString( supportedFmts[i].formatName ) );
|
||||
currFmt.append( " (*." );
|
||||
currFmt.append( QString::fromStdString( supportedFmts[i].formatExt ) );
|
||||
currFmt.append( ")" );
|
||||
formatsList << currFmt;
|
||||
std::vector<String> arrayExt = supportedFmts[i].getExts();
|
||||
if( arrayExt.size() > 0 )
|
||||
{
|
||||
QString currFmt( QString::fromStdString( supportedFmts[i].formatName ) );
|
||||
currFmt.append( " (" );
|
||||
for( std::vector<String>::iterator e = arrayExt.begin(); e != arrayExt.end(); ++e )
|
||||
{
|
||||
supported.append( " *." );
|
||||
currFmt.append( "*." );
|
||||
supported.append( QString::fromStdString( *e ) );
|
||||
currFmt.append( QString::fromStdString( *e ) );
|
||||
}
|
||||
currFmt.append( ")" );
|
||||
formatsList << currFmt;
|
||||
}
|
||||
}
|
||||
supported.append( " )" );
|
||||
|
||||
QStringList filter;
|
||||
filter << supported << formatsList << tr( "All Files (*)" );
|
||||
|
||||
QString fileName = QFileDialog::getSaveFileName( m_pcParent, tr( "Open File" ), QString(),
|
||||
filter.join( ";;" ) );
|
||||
QString fileName = QFileDialog::getSaveFileName( m_pcParent, tr( "Open File" ), QString(), filter.join( ";;" ) );
|
||||
|
||||
Width = pcCurrModuleIf->m_pcProcessedFrame->getWidth();
|
||||
Height = pcCurrModuleIf->m_pcProcessedFrame->getHeight();
|
||||
@@ -566,9 +536,8 @@ Void ModulesHandle::applyAllModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf )
|
||||
FrameRate = pcCurrModuleIf->m_pcSubWindow[0]->getInputStream()->getFrameRate();
|
||||
|
||||
pcCurrModuleIf->m_pcModuleStream = new PlaYUVerStream;
|
||||
if( !pcCurrModuleIf->m_pcModuleStream->open( fileName.toStdString(), Width, Height,
|
||||
InputFormat, BitsPixel, PLAYUVER_LITTLE_ENDIAN,
|
||||
FrameRate, false ) )
|
||||
if( !pcCurrModuleIf->m_pcModuleStream->open( fileName.toStdString(), Width, Height, InputFormat, BitsPixel, PLAYUVER_LITTLE_ENDIAN, FrameRate,
|
||||
false ) )
|
||||
{
|
||||
delete pcCurrModuleIf->m_pcModuleStream;
|
||||
pcCurrModuleIf->m_pcModuleStream = NULL;
|
||||
|
||||
+1
-3
@@ -61,9 +61,7 @@ public:
|
||||
Void writeSettings();
|
||||
|
||||
static Void destroyModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf );
|
||||
static Void applyModuleIf( QList<PlaYUVerAppModuleIf*> pcCurrModuleIfList,
|
||||
Bool isPlaying = false,
|
||||
Bool disableThreads = false );
|
||||
static Void applyModuleIf( QList<PlaYUVerAppModuleIf*> pcCurrModuleIfList, Bool isPlaying = false, Bool disableThreads = false );
|
||||
|
||||
private:
|
||||
QWidget* m_pcParent;
|
||||
|
||||
@@ -76,20 +76,17 @@ private:
|
||||
String m_cName;
|
||||
};
|
||||
|
||||
ModulesHandleOptDialog::ModulesHandleOptDialog( QWidget* parent,
|
||||
PlaYUVerAppModuleIf* pcCurrModuleIf )
|
||||
ModulesHandleOptDialog::ModulesHandleOptDialog( QWidget* parent, PlaYUVerAppModuleIf* pcCurrModuleIf )
|
||||
: QDialog( parent ), m_pcCurrModuleIf( pcCurrModuleIf )
|
||||
{
|
||||
resize( 400, 10 );
|
||||
setWindowTitle( "Select module parameters" );
|
||||
|
||||
const PlaYUVerOptions::OptionsList& moduleOptions =
|
||||
m_pcCurrModuleIf->m_pcModule->m_cModuleOptions.getOptionList();
|
||||
const PlaYUVerOptions::OptionsList& moduleOptions = m_pcCurrModuleIf->m_pcModule->m_cModuleOptions.getOptionList();
|
||||
|
||||
QVBoxLayout* optionsLayout = new QVBoxLayout;
|
||||
OpionConfiguration* pcOption;
|
||||
for( PlaYUVerOptions::OptionsList::const_iterator it = moduleOptions.begin();
|
||||
it != moduleOptions.end(); ++it )
|
||||
for( PlaYUVerOptions::OptionsList::const_iterator it = moduleOptions.begin(); it != moduleOptions.end(); ++it )
|
||||
{
|
||||
pcOption = new OpionConfiguration( ( *it )->opt );
|
||||
m_apcOptionList.append( pcOption );
|
||||
|
||||
+55
-86
@@ -46,13 +46,12 @@
|
||||
|
||||
#define SYNCHRONISED_ZOON 1
|
||||
|
||||
PlaYUVerApp::PlaYUVerApp()
|
||||
: m_pcCurrentSubWindow( NULL ), m_pcCurrentVideoSubWindow( NULL ), m_pcAboutDialog( NULL )
|
||||
PlaYUVerApp::PlaYUVerApp() : m_pcCurrentSubWindow( NULL ), m_pcCurrentVideoSubWindow( NULL ), m_pcAboutDialog( NULL )
|
||||
{
|
||||
setWindowModality( Qt::ApplicationModal );
|
||||
setWindowModality( Qt::NonModal );
|
||||
|
||||
// DBus
|
||||
// DBus
|
||||
#ifdef USE_QTDBUS
|
||||
m_pDBusAdaptor = new PlaYUVerAppAdaptor( this );
|
||||
#endif
|
||||
@@ -119,8 +118,7 @@ Bool PlaYUVerApp::parseArgs( Int argc, Char* argv[] )
|
||||
}
|
||||
}
|
||||
std::list<const Char*>& argv_unhandled = pcCmdParser.getUnhandledArgs();
|
||||
for( std::list<const Char*>::const_iterator it = argv_unhandled.begin();
|
||||
it != argv_unhandled.end(); it++ )
|
||||
for( std::list<const Char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++ )
|
||||
{
|
||||
loadFile( QString::fromStdString( *it ) );
|
||||
}
|
||||
@@ -144,8 +142,7 @@ Void PlaYUVerApp::closeEvent( QCloseEvent* event )
|
||||
QList<SubWindowAbstract*> subWindowList = m_pcWindowHandle->findSubWindow();
|
||||
if( subWindowList.size() >= 1 )
|
||||
{
|
||||
QMessageBox msgBoxClose( QMessageBox::Question, "PlaYUVer", "There are open files!",
|
||||
QMessageBox::Yes | QMessageBox::No, this );
|
||||
QMessageBox msgBoxClose( QMessageBox::Question, "PlaYUVer", "There are open files!", QMessageBox::Yes | QMessageBox::No, this );
|
||||
msgBoxClose.setDefaultButton( QMessageBox::No );
|
||||
msgBoxClose.setInformativeText( "Close all?" );
|
||||
msgBoxCloseRet = msgBoxClose.exec();
|
||||
@@ -189,15 +186,13 @@ Void PlaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo )
|
||||
printMessage( "File " + fileName + " do not exist!", LOG_ERROR );
|
||||
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();
|
||||
videoSubWindow = new VideoSubWindow( VideoSubWindow::VIDEO_STREAM_SUBWINDOW ); // createSubWindow();
|
||||
SubWindowAbstract* subWindow = videoSubWindow;
|
||||
if( !pStreamInfo )
|
||||
{
|
||||
@@ -220,12 +215,10 @@ Void PlaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo )
|
||||
m_pcWindowHandle->addSubWindow( videoSubWindow );
|
||||
videoSubWindow->show();
|
||||
|
||||
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 ) ) );
|
||||
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 ) ) );
|
||||
|
||||
videoSubWindow->zoomToFit();
|
||||
updateZoomFactorSBox();
|
||||
@@ -245,8 +238,7 @@ Void PlaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo )
|
||||
catch( PlaYUVerFailure& e )
|
||||
{
|
||||
videoSubWindow->close();
|
||||
QString warningMsg = "Cannot open file " + QFileInfo( fileName ).fileName() +
|
||||
" with the following error: \n" + e.what();
|
||||
QString warningMsg = "Cannot open file " + QFileInfo( fileName ).fileName() + " with the following error: \n" + e.what();
|
||||
QMessageBox::warning( this, QApplication::applicationName(), warningMsg );
|
||||
printMessage( warningMsg, LOG_ERROR );
|
||||
}
|
||||
@@ -254,22 +246,31 @@ Void PlaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo )
|
||||
|
||||
// ----------------------- File Functions -----------------------
|
||||
|
||||
Void PlaYUVerApp::open()
|
||||
QStringList PlaYUVerApp::showFileDialog( Bool bRead )
|
||||
{
|
||||
QString supported = tr( "Supported Files (" );
|
||||
QStringList formatsList;
|
||||
std::vector<PlaYUVerSupportedFormat> supportedFmts = PlaYUVerStream::supportedReadFormats();
|
||||
std::vector<PlaYUVerSupportedFormat> supportedFmts;
|
||||
|
||||
if( bRead )
|
||||
supportedFmts = PlaYUVerStream::supportedReadFormats();
|
||||
else
|
||||
supportedFmts = PlaYUVerStream::supportedWriteFormats();
|
||||
|
||||
for( UInt i = 0; i < supportedFmts.size(); i++ )
|
||||
{
|
||||
if( supportedFmts[i].formatExt != "" )
|
||||
std::vector<String> arrayExt = supportedFmts[i].getExts();
|
||||
if( arrayExt.size() > 0 )
|
||||
{
|
||||
QString currFmt;
|
||||
supported.append( " *." );
|
||||
supported.append( QString::fromStdString( supportedFmts[i].formatExt ) );
|
||||
currFmt.append( QString::fromStdString( supportedFmts[i].formatName ) );
|
||||
currFmt.append( " (*." );
|
||||
currFmt.append( QString::fromStdString( supportedFmts[i].formatExt ) );
|
||||
QString currFmt( QString::fromStdString( supportedFmts[i].formatName ) );
|
||||
currFmt.append( " (" );
|
||||
for( std::vector<String>::iterator e = arrayExt.begin(); e != arrayExt.end(); ++e )
|
||||
{
|
||||
supported.append( " *." );
|
||||
currFmt.append( "*." );
|
||||
supported.append( QString::fromStdString( *e ) );
|
||||
currFmt.append( QString::fromStdString( *e ) );
|
||||
}
|
||||
currFmt.append( ")" );
|
||||
formatsList << currFmt;
|
||||
}
|
||||
@@ -279,9 +280,13 @@ Void PlaYUVerApp::open()
|
||||
QStringList filter;
|
||||
filter << supported << formatsList << tr( "All Files (*)" );
|
||||
|
||||
QStringList fileNameList = QFileDialog::getOpenFileNames( this, tr( "Open File" ),
|
||||
m_cLastOpenPath, filter.join( ";;" ) );
|
||||
QStringList fileNameList = QFileDialog::getOpenFileNames( this, tr( "Open File" ), m_cLastOpenPath, filter.join( ";;" ) );
|
||||
return fileNameList;
|
||||
}
|
||||
|
||||
Void PlaYUVerApp::open()
|
||||
{
|
||||
QStringList fileNameList = showFileDialog( true );
|
||||
for( Int i = 0; i < fileNameList.size(); i++ )
|
||||
{
|
||||
if( !fileNameList.at( i ).isEmpty() )
|
||||
@@ -309,31 +314,11 @@ Void PlaYUVerApp::save()
|
||||
if( m_pcCurrentVideoSubWindow )
|
||||
{
|
||||
VideoSubWindow* saveWindow = m_pcCurrentVideoSubWindow;
|
||||
QString supported = tr( "Supported Files (" );
|
||||
QStringList formatsList;
|
||||
|
||||
std::vector<PlaYUVerSupportedFormat> supportedFmts = PlaYUVerStream::supportedWriteFormats();
|
||||
for( UInt i = 0; i < supportedFmts.size(); i++ )
|
||||
{
|
||||
QString currFmt;
|
||||
supported.append( " *." );
|
||||
supported.append( QString::fromStdString( supportedFmts[i].formatExt ) );
|
||||
currFmt.append( QString::fromStdString( supportedFmts[i].formatName ) );
|
||||
currFmt.append( " (*." );
|
||||
currFmt.append( QString::fromStdString( supportedFmts[i].formatExt ) );
|
||||
currFmt.append( ")" );
|
||||
formatsList << currFmt;
|
||||
}
|
||||
supported.append( " )" );
|
||||
|
||||
QStringList filter;
|
||||
filter << supported << formatsList << tr( "All Files (*)" );
|
||||
|
||||
QString fileName = QFileDialog::getSaveFileName( this, tr( "Open File" ), m_cLastOpenPath,
|
||||
filter.join( ";;" ) );
|
||||
|
||||
if( !fileName.isEmpty() )
|
||||
QStringList fileNames = showFileDialog( false );
|
||||
if( fileNames.size() == 1 )
|
||||
{
|
||||
QString fileName = fileNames[0];
|
||||
m_cLastOpenPath = QFileInfo( fileName ).path();
|
||||
try
|
||||
{
|
||||
@@ -342,8 +327,7 @@ Void PlaYUVerApp::save()
|
||||
catch( PlaYUVerFailure& e )
|
||||
{
|
||||
QApplication::restoreOverrideCursor();
|
||||
QString warningMsg = "Cannot save file " + QFileInfo( fileName ).fileName() +
|
||||
" with the following error: \n" + e.what();
|
||||
QString warningMsg = "Cannot save file " + QFileInfo( fileName ).fileName() + " with the following error: \n" + e.what();
|
||||
QMessageBox::warning( this, QApplication::applicationName(), warningMsg );
|
||||
printMessage( warningMsg, LOG_ERROR );
|
||||
return;
|
||||
@@ -366,9 +350,8 @@ Void PlaYUVerApp::format()
|
||||
}
|
||||
catch( PlaYUVerFailure& e )
|
||||
{
|
||||
QString warningMsg = "Cannot change format of " +
|
||||
QFileInfo( pcVideoSubWindow->getCurrentFileName() ).fileName() +
|
||||
" with the following error: \n" + e.what();
|
||||
QString warningMsg =
|
||||
"Cannot change format of " + QFileInfo( pcVideoSubWindow->getCurrentFileName() ).fileName() + " with the following error: \n" + e.what();
|
||||
QMessageBox::warning( this, QApplication::applicationName(), warningMsg );
|
||||
printMessage( warningMsg, LOG_ERROR );
|
||||
qDebug() << warningMsg;
|
||||
@@ -399,8 +382,7 @@ Void PlaYUVerApp::reloadAll()
|
||||
|
||||
for( UInt c = 0; c < 3; c++ )
|
||||
{
|
||||
QList<SubWindowAbstract*> subWindowList =
|
||||
m_pcWindowHandle->findSubWindow( windowCategoryOrder[c] );
|
||||
QList<SubWindowAbstract*> subWindowList = m_pcWindowHandle->findSubWindow( windowCategoryOrder[c] );
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
subWindowList.at( i )->refreshSubWindow();
|
||||
@@ -443,8 +425,7 @@ Void PlaYUVerApp::zoomToFit()
|
||||
Void PlaYUVerApp::zoomToFitAll()
|
||||
{
|
||||
VideoSubWindow* videoSubWindow;
|
||||
QList<SubWindowAbstract*> subWindowList =
|
||||
m_pcWindowHandle->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
QList<SubWindowAbstract*> subWindowList = m_pcWindowHandle->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
videoSubWindow = qobject_cast<VideoSubWindow*>( subWindowList.at( i ) );
|
||||
@@ -506,13 +487,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<SubWindowAbstract*> subWindowList =
|
||||
windowManager->findSubWindow( SubWindowAbstract::VIDEO_STREAM_SUBWINDOW );
|
||||
QList<SubWindowAbstract*> subWindowList = windowManager->findSubWindow( SubWindowAbstract::VIDEO_STREAM_SUBWINDOW );
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
pcSubWindow = qobject_cast<VideoSubWindow*>( subWindowList.at( i ) );
|
||||
@@ -638,8 +617,7 @@ Void PlaYUVerApp::createActions()
|
||||
connect( m_arrayActions[SAVE_ACT], SIGNAL( triggered() ), this, SLOT( save() ) );
|
||||
|
||||
m_arrayActions[FORMAT_ACT] = new QAction( tr( "&Format" ), this );
|
||||
m_arrayActions[FORMAT_ACT]->setIcon(
|
||||
QIcon::fromTheme( "transform-scale", QIcon( ":/images/configuredialog.png" ) ) );
|
||||
m_arrayActions[FORMAT_ACT]->setIcon( QIcon::fromTheme( "transform-scale", QIcon( ":/images/configuredialog.png" ) ) );
|
||||
m_arrayActions[FORMAT_ACT]->setShortcut( Qt::CTRL + Qt::Key_F );
|
||||
m_arrayActions[FORMAT_ACT]->setStatusTip( tr( "Open format dialog" ) );
|
||||
connect( m_arrayActions[FORMAT_ACT], SIGNAL( triggered() ), this, SLOT( format() ) );
|
||||
@@ -663,13 +641,11 @@ Void PlaYUVerApp::createActions()
|
||||
m_arrayActions[CLOSE_ACT] = new QAction( tr( "&Close" ), this );
|
||||
m_arrayActions[CLOSE_ACT]->setIcon( style()->standardIcon( QStyle::SP_DialogCloseButton ) );
|
||||
m_arrayActions[CLOSE_ACT]->setStatusTip( tr( "Close the active window" ) );
|
||||
connect( m_arrayActions[CLOSE_ACT], SIGNAL( triggered() ), m_pcWindowHandle,
|
||||
SLOT( removeActiveSubWindow() ) );
|
||||
connect( m_arrayActions[CLOSE_ACT], SIGNAL( triggered() ), m_pcWindowHandle, SLOT( removeActiveSubWindow() ) );
|
||||
|
||||
m_arrayActions[CLOSEALL_ACT] = new QAction( tr( "Close &All" ), this );
|
||||
m_arrayActions[CLOSEALL_ACT]->setStatusTip( tr( "Close all the windows" ) );
|
||||
connect( m_arrayActions[CLOSEALL_ACT], SIGNAL( triggered() ), m_pcWindowHandle,
|
||||
SLOT( removeAllSubWindow() ) );
|
||||
connect( m_arrayActions[CLOSEALL_ACT], SIGNAL( triggered() ), m_pcWindowHandle, SLOT( removeAllSubWindow() ) );
|
||||
|
||||
m_arrayActions[EXIT_ACT] = new QAction( tr( "E&xit" ), this );
|
||||
m_arrayActions[EXIT_ACT]->setShortcuts( QKeySequence::Quit );
|
||||
@@ -681,31 +657,27 @@ Void PlaYUVerApp::createActions()
|
||||
connect( mapperZoom, SIGNAL( mapped( int ) ), this, SLOT( scaleFrame( int ) ) );
|
||||
|
||||
m_arrayActions[ZOOM_IN_ACT] = new QAction( tr( "Zoom &In (+25%)" ), this );
|
||||
m_arrayActions[ZOOM_IN_ACT]->setIcon(
|
||||
QIcon::fromTheme( "zoom-in", QIcon( ":/images/zoomin.png" ) ) );
|
||||
m_arrayActions[ZOOM_IN_ACT]->setIcon( QIcon::fromTheme( "zoom-in", QIcon( ":/images/zoomin.png" ) ) );
|
||||
m_arrayActions[ZOOM_IN_ACT]->setShortcut( tr( "Ctrl++" ) );
|
||||
m_arrayActions[ZOOM_IN_ACT]->setStatusTip( tr( "Scale the image up by 25%" ) );
|
||||
connect( m_arrayActions[ZOOM_IN_ACT], SIGNAL( triggered() ), mapperZoom, SLOT( map() ) );
|
||||
mapperZoom->setMapping( m_arrayActions[ZOOM_IN_ACT], 125 );
|
||||
|
||||
m_arrayActions[ZOOM_OUT_ACT] = new QAction( tr( "Zoom &Out (-25%)" ), this );
|
||||
m_arrayActions[ZOOM_OUT_ACT]->setIcon(
|
||||
QIcon::fromTheme( "zoom-out", QIcon( ":/images/zoomout.png" ) ) );
|
||||
m_arrayActions[ZOOM_OUT_ACT]->setIcon( QIcon::fromTheme( "zoom-out", QIcon( ":/images/zoomout.png" ) ) );
|
||||
m_arrayActions[ZOOM_OUT_ACT]->setShortcut( tr( "Ctrl+-" ) );
|
||||
m_arrayActions[ZOOM_OUT_ACT]->setStatusTip( tr( "Scale the image down by 25%" ) );
|
||||
connect( m_arrayActions[ZOOM_OUT_ACT], SIGNAL( triggered() ), mapperZoom, SLOT( map() ) );
|
||||
mapperZoom->setMapping( m_arrayActions[ZOOM_OUT_ACT], 80 );
|
||||
|
||||
m_arrayActions[ZOOM_NORMAL_ACT] = new QAction( tr( "&Normal Size" ), this );
|
||||
m_arrayActions[ZOOM_NORMAL_ACT]->setIcon(
|
||||
QIcon::fromTheme( "zoom-original", QIcon( ":/images/zoomtonormal.png" ) ) );
|
||||
m_arrayActions[ZOOM_NORMAL_ACT]->setIcon( QIcon::fromTheme( "zoom-original", QIcon( ":/images/zoomtonormal.png" ) ) );
|
||||
m_arrayActions[ZOOM_NORMAL_ACT]->setShortcut( tr( "Ctrl+N" ) );
|
||||
m_arrayActions[ZOOM_NORMAL_ACT]->setStatusTip( tr( "Show the image at its original size" ) );
|
||||
connect( m_arrayActions[ZOOM_NORMAL_ACT], SIGNAL( triggered() ), this, SLOT( normalSize() ) );
|
||||
|
||||
m_arrayActions[ZOOM_FIT_ACT] = new QAction( tr( "Zoom to &Fit" ), this );
|
||||
m_arrayActions[ZOOM_FIT_ACT]->setIcon(
|
||||
QIcon::fromTheme( "zoom-fit-best", QIcon( ":/images/fittowindow.png" ) ) );
|
||||
m_arrayActions[ZOOM_FIT_ACT]->setIcon( QIcon::fromTheme( "zoom-fit-best", QIcon( ":/images/fittowindow.png" ) ) );
|
||||
m_arrayActions[ZOOM_FIT_ACT]->setStatusTip( tr( "Zoom in or out to fit on the window." ) );
|
||||
connect( m_arrayActions[ZOOM_FIT_ACT], SIGNAL( triggered() ), this, SLOT( zoomToFit() ) );
|
||||
|
||||
@@ -726,8 +698,7 @@ Void PlaYUVerApp::createActions()
|
||||
#ifdef USE_FERVOR
|
||||
m_arrayActions[UPDATE_ACT] = new QAction( tr( "&Update" ), this );
|
||||
m_arrayActions[UPDATE_ACT]->setStatusTip( tr( "Check for updates" ) );
|
||||
connect( m_arrayActions[UPDATE_ACT], SIGNAL( triggered() ), FvUpdater::sharedUpdater(),
|
||||
SLOT( CheckForUpdatesNotSilent() ) );
|
||||
connect( m_arrayActions[UPDATE_ACT], SIGNAL( triggered() ), FvUpdater::sharedUpdater(), SLOT( CheckForUpdatesNotSilent() ) );
|
||||
#endif
|
||||
|
||||
m_arrayActions[ABOUT_ACT] = new QAction( tr( "&About" ), this );
|
||||
@@ -822,8 +793,7 @@ Void PlaYUVerApp::createToolBars()
|
||||
m_pcZoomFactorSBox->setSingleStep( 10.0 );
|
||||
m_pcZoomFactorSBox->setValue( 100.0 );
|
||||
m_pcZoomFactorSBox->setSuffix( "%" );
|
||||
connect( m_pcZoomFactorSBox, SIGNAL( valueChanged( double ) ), this,
|
||||
SLOT( zoomFromSBox( double ) ) );
|
||||
connect( m_pcZoomFactorSBox, SIGNAL( valueChanged( double ) ), this, SLOT( zoomFromSBox( double ) ) );
|
||||
m_arrayToolBars[VIEW_TOOLBAR]->addWidget( m_pcZoomFactorSBox );
|
||||
m_arrayToolBars[VIEW_TOOLBAR]->addAction( m_arrayActions[ZOOM_IN_ACT] );
|
||||
m_arrayToolBars[VIEW_TOOLBAR]->addAction( m_arrayActions[ZOOM_OUT_ACT] );
|
||||
@@ -873,8 +843,7 @@ Void PlaYUVerApp::updateRecentFileActions()
|
||||
m_arrayRecentFilesActions.at( actionIdx )->setText( QFileInfo( text ).fileName() );
|
||||
m_arrayRecentFilesActions.at( actionIdx )->setToolTip( "Open File " + text );
|
||||
m_arrayRecentFilesActions.at( actionIdx )->setStatusTip( "Open File " + text );
|
||||
m_arrayRecentFilesActions.at( actionIdx )
|
||||
->setData( QVariant::fromValue( m_aRecentFileStreamInfo.at( actionIdx ) ) );
|
||||
m_arrayRecentFilesActions.at( actionIdx )->setData( QVariant::fromValue( m_aRecentFileStreamInfo.at( actionIdx ) ) );
|
||||
m_arrayRecentFilesActions.at( actionIdx )->setVisible( true );
|
||||
actionIdx++;
|
||||
}
|
||||
|
||||
+2
-2
@@ -125,9 +125,9 @@ private:
|
||||
VideoSubWindow* m_pcCurrentVideoSubWindow;
|
||||
|
||||
QString m_cLastOpenPath;
|
||||
QStringList showFileDialog( Bool bRead );
|
||||
|
||||
static VideoSubWindow* findVideoStreamSubWindow( const PlaYUVerSubWindowHandle* windowManager,
|
||||
const QString& fileName );
|
||||
static VideoSubWindow* findVideoStreamSubWindow( const PlaYUVerSubWindowHandle* windowManager, const QString& fileName );
|
||||
|
||||
Void updateMenus();
|
||||
|
||||
|
||||
@@ -26,12 +26,10 @@
|
||||
#include "PlaYUVerApp.h"
|
||||
#include <QDBusAbstractAdaptor>
|
||||
|
||||
PlaYUVerAppAdaptor::PlaYUVerAppAdaptor( PlaYUVerApp* app )
|
||||
: QDBusAbstractAdaptor( app ), m_app( app )
|
||||
PlaYUVerAppAdaptor::PlaYUVerAppAdaptor( PlaYUVerApp* app ) : QDBusAbstractAdaptor( app ), m_app( app )
|
||||
{
|
||||
// application dbus interface
|
||||
Bool isRegistered = QDBusConnection::sessionBus().registerObject(
|
||||
QStringLiteral( PLAYUVER_DBUS_PATH ), this, QDBusConnection::ExportAllSlots );
|
||||
Bool isRegistered = QDBusConnection::sessionBus().registerObject( QStringLiteral( PLAYUVER_DBUS_PATH ), this, QDBusConnection::ExportAllSlots );
|
||||
|
||||
Q_ASSERT( isRegistered == true );
|
||||
}
|
||||
|
||||
@@ -26,9 +26,7 @@
|
||||
#include "VideoSubWindow.h"
|
||||
#include "VideoSubWindow.h"
|
||||
|
||||
PlaYUVerAppModuleIf::PlaYUVerAppModuleIf( QObject* parent,
|
||||
QAction* action,
|
||||
PlaYUVerModuleIf* module )
|
||||
PlaYUVerAppModuleIf::PlaYUVerAppModuleIf( QObject* parent, QAction* action, PlaYUVerModuleIf* module )
|
||||
: m_bIsRunning( false )
|
||||
, m_pcModuleAction( action )
|
||||
, m_pcModule( module )
|
||||
|
||||
@@ -43,8 +43,7 @@
|
||||
class PlaYUVerMdiArea : public QMdiArea
|
||||
{
|
||||
public:
|
||||
PlaYUVerMdiArea( QWidget* parent = 0 )
|
||||
: QMdiArea( parent ), m_pixmapLogo( ":/images/playuver-backgroud-logo.png" )
|
||||
PlaYUVerMdiArea( QWidget* parent = 0 ) : QMdiArea( parent ), m_pixmapLogo( ":/images/playuver-backgroud-logo.png" )
|
||||
{
|
||||
setBackgroundRole( QPalette::Background );
|
||||
}
|
||||
@@ -120,8 +119,8 @@ Void PlaYUVerSubWindowHandle::resetWindowMode()
|
||||
}
|
||||
for( Int i = 0; i < m_apcMdiSubWindowList.size(); i++ )
|
||||
{
|
||||
disconnect( m_apcMdiSubWindowList.at( i ), SIGNAL( aboutToClose( PlaYUVerMdiSubWindow* ) ),
|
||||
this, SLOT( removeMdiSubWindow( PlaYUVerMdiSubWindow* ) ) );
|
||||
disconnect( m_apcMdiSubWindowList.at( i ), SIGNAL( aboutToClose( PlaYUVerMdiSubWindow* ) ), this,
|
||||
SLOT( removeMdiSubWindow( PlaYUVerMdiSubWindow* ) ) );
|
||||
m_apcMdiSubWindowList.at( i )->close();
|
||||
}
|
||||
m_apcMdiSubWindowList.clear();
|
||||
@@ -163,8 +162,7 @@ Void PlaYUVerSubWindowHandle::setWindowMode( Int iWindowMode )
|
||||
setVisible( true );
|
||||
m_pcMdiArea = new PlaYUVerMdiArea;
|
||||
m_pcMdiArea->setActivationOrder( QMdiArea::ActivationHistoryOrder );
|
||||
connect( m_pcMdiArea, SIGNAL( subWindowActivated( QMdiSubWindow* ) ), this,
|
||||
SLOT( updateActiveSubWindow() ) );
|
||||
connect( m_pcMdiArea, SIGNAL( subWindowActivated( QMdiSubWindow* ) ), this, SLOT( updateActiveSubWindow() ) );
|
||||
m_pcWindowManagerLayout = new QHBoxLayout( this );
|
||||
m_pcWindowManagerLayout->addWidget( m_pcMdiArea );
|
||||
setLayout( m_pcWindowManagerLayout );
|
||||
@@ -177,8 +175,7 @@ Void PlaYUVerSubWindowHandle::setWindowMode( Int iWindowMode )
|
||||
// m_pcApp->resize( m_cMdiModeWindowSize );
|
||||
if( m_pcActiveWindow )
|
||||
{
|
||||
m_pcApp->setWindowTitle( QApplication::applicationName() +
|
||||
" :: " + m_pcActiveWindow->getWindowName() );
|
||||
m_pcApp->setWindowTitle( QApplication::applicationName() + " :: " + m_pcActiveWindow->getWindowName() );
|
||||
}
|
||||
}
|
||||
m_iWindowMode = iWindowMode;
|
||||
@@ -205,8 +202,7 @@ Void PlaYUVerSubWindowHandle::updateActiveSubWindow( SubWindowAbstract* window )
|
||||
if( mdiSubWindow )
|
||||
{
|
||||
QWidget* activeWidget = m_pcMdiArea->activeSubWindow()->widget();
|
||||
Int windowIdx =
|
||||
m_apcSubWindowList.indexOf( qobject_cast<SubWindowAbstract*>( activeWidget ) );
|
||||
Int windowIdx = m_apcSubWindowList.indexOf( qobject_cast<SubWindowAbstract*>( activeWidget ) );
|
||||
if( windowIdx >= 0 )
|
||||
{
|
||||
m_pcActiveWindow = m_apcSubWindowList.at( windowIdx );
|
||||
@@ -215,8 +211,7 @@ Void PlaYUVerSubWindowHandle::updateActiveSubWindow( SubWindowAbstract* window )
|
||||
}
|
||||
if( m_pcActiveWindow )
|
||||
{
|
||||
m_pcApp->setWindowTitle( QApplication::applicationName() +
|
||||
" :: " + m_pcActiveWindow->getWindowName() );
|
||||
m_pcApp->setWindowTitle( QApplication::applicationName() + " :: " + m_pcActiveWindow->getWindowName() );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -228,24 +223,19 @@ Void PlaYUVerSubWindowHandle::addMdiSubWindow( SubWindowAbstract* window )
|
||||
m_pcMdiArea->addSubWindow( mdiSubWindow );
|
||||
m_apcMdiSubWindowList.append( mdiSubWindow );
|
||||
window->setSubWindow( mdiSubWindow );
|
||||
connect( mdiSubWindow, SIGNAL( aboutToClose( PlaYUVerMdiSubWindow* ) ), this,
|
||||
SLOT( removeMdiSubWindow( PlaYUVerMdiSubWindow* ) ) );
|
||||
connect( mdiSubWindow, SIGNAL( aboutToClose( PlaYUVerMdiSubWindow* ) ), this, SLOT( removeMdiSubWindow( PlaYUVerMdiSubWindow* ) ) );
|
||||
}
|
||||
|
||||
Void PlaYUVerSubWindowHandle::addSubWindow( SubWindowAbstract* window, Qt::WindowFlags flags )
|
||||
{
|
||||
if( window )
|
||||
{
|
||||
connect( window, SIGNAL( updateStatusBar( const QString& ) ), m_pcApp,
|
||||
SLOT( printMessage( const QString& ) ) );
|
||||
connect( window, SIGNAL( zoomFactorChanged_SWindow( const double, const QPoint ) ), m_pcApp,
|
||||
SLOT( updateZoomFactorSBox() ) );
|
||||
connect( window, SIGNAL( updateStatusBar( const QString& ) ), m_pcApp, SLOT( printMessage( const QString& ) ) );
|
||||
connect( window, SIGNAL( zoomFactorChanged_SWindow( const double, const QPoint ) ), m_pcApp, SLOT( updateZoomFactorSBox() ) );
|
||||
if( m_iWindowMode == DETACHEDSUBWINDOWMODE )
|
||||
{
|
||||
connect( window, SIGNAL( aboutToActivate( SubWindowAbstract* ) ), this,
|
||||
SLOT( updateActiveSubWindow( SubWindowAbstract* ) ) );
|
||||
connect( window, SIGNAL( aboutToClose( SubWindowAbstract* ) ), this,
|
||||
SLOT( removeSubWindow( SubWindowAbstract* ) ) );
|
||||
connect( window, SIGNAL( aboutToActivate( SubWindowAbstract* ) ), this, SLOT( updateActiveSubWindow( SubWindowAbstract* ) ) );
|
||||
connect( window, SIGNAL( aboutToClose( SubWindowAbstract* ) ), this, SLOT( removeSubWindow( SubWindowAbstract* ) ) );
|
||||
}
|
||||
if( m_iWindowMode == MDISUBWINDOWMODE )
|
||||
{
|
||||
@@ -330,8 +320,7 @@ QList<SubWindowAbstract*> PlaYUVerSubWindowHandle::findSubWindow( const UInt uiC
|
||||
return apcSubWindowList;
|
||||
}
|
||||
|
||||
QList<SubWindowAbstract*> PlaYUVerSubWindowHandle::findSubWindow( const QString& windowName,
|
||||
const UInt uiCategory ) const
|
||||
QList<SubWindowAbstract*> PlaYUVerSubWindowHandle::findSubWindow( const QString& windowName, const UInt uiCategory ) const
|
||||
{
|
||||
QList<SubWindowAbstract*> subWindowList = findSubWindow( uiCategory );
|
||||
QList<SubWindowAbstract*> apcSubWindowList;
|
||||
@@ -346,8 +335,7 @@ QList<SubWindowAbstract*> PlaYUVerSubWindowHandle::findSubWindow( const QString&
|
||||
return apcSubWindowList;
|
||||
}
|
||||
|
||||
SubWindowAbstract* PlaYUVerSubWindowHandle::findSubWindow(
|
||||
const SubWindowAbstract* subWindow ) const
|
||||
SubWindowAbstract* PlaYUVerSubWindowHandle::findSubWindow( const SubWindowAbstract* subWindow ) const
|
||||
{
|
||||
QList<SubWindowAbstract*> subWindowList = findSubWindow();
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
@@ -426,8 +414,7 @@ Void PlaYUVerSubWindowHandle::tileSubWindows()
|
||||
}
|
||||
|
||||
QSize totalWindowsSize( screenSize.width(), screenSize.height() - topLeftCornerWindow.y() );
|
||||
QSize windowsSize( totalWindowsSize.width() / numberTillingColumns,
|
||||
totalWindowsSize.height() / numberTillingRows );
|
||||
QSize windowsSize( totalWindowsSize.width() / numberTillingColumns, totalWindowsSize.height() / numberTillingRows );
|
||||
QPoint windowRelativePos;
|
||||
for( Int i = 0; i < m_apcSubWindowList.size(); i++ )
|
||||
{
|
||||
@@ -454,8 +441,7 @@ Void PlaYUVerSubWindowHandle::cascadeSubWindows()
|
||||
Void PlaYUVerSubWindowHandle::createActions()
|
||||
{
|
||||
m_mapperWindow = new QSignalMapper( this );
|
||||
connect( m_mapperWindow, SIGNAL( mapped( QWidget* ) ), this,
|
||||
SLOT( setActiveSubWindow( QWidget* ) ) );
|
||||
connect( m_mapperWindow, SIGNAL( mapped( QWidget* ) ), this, SLOT( setActiveSubWindow( QWidget* ) ) );
|
||||
|
||||
m_arrayActions.resize( TOTAL_ACT );
|
||||
|
||||
@@ -469,16 +455,13 @@ Void PlaYUVerSubWindowHandle::createActions()
|
||||
m_arrayActions[NORMAL_SUBWINDOW_MODE_ACT] = new QAction( tr( "&Detached SubWindows" ), this );
|
||||
m_arrayActions[NORMAL_SUBWINDOW_MODE_ACT]->setCheckable( true );
|
||||
m_actionGroupWindowMode->addAction( m_arrayActions[NORMAL_SUBWINDOW_MODE_ACT] );
|
||||
connect( m_arrayActions[NORMAL_SUBWINDOW_MODE_ACT], SIGNAL( triggered() ), m_mapperWindowMode,
|
||||
SLOT( map() ) );
|
||||
m_mapperWindowMode->setMapping( m_arrayActions[NORMAL_SUBWINDOW_MODE_ACT],
|
||||
DETACHEDSUBWINDOWMODE );
|
||||
connect( m_arrayActions[NORMAL_SUBWINDOW_MODE_ACT], SIGNAL( triggered() ), m_mapperWindowMode, SLOT( map() ) );
|
||||
m_mapperWindowMode->setMapping( m_arrayActions[NORMAL_SUBWINDOW_MODE_ACT], DETACHEDSUBWINDOWMODE );
|
||||
|
||||
m_arrayActions[MDI_SUBWINDOW_MODE_ACT] = new QAction( "&MDI SubWindows", this );
|
||||
m_arrayActions[MDI_SUBWINDOW_MODE_ACT]->setCheckable( true );
|
||||
m_actionGroupWindowMode->addAction( m_arrayActions[MDI_SUBWINDOW_MODE_ACT] );
|
||||
connect( m_arrayActions[MDI_SUBWINDOW_MODE_ACT], SIGNAL( triggered() ), m_mapperWindowMode,
|
||||
SLOT( map() ) );
|
||||
connect( m_arrayActions[MDI_SUBWINDOW_MODE_ACT], SIGNAL( triggered() ), m_mapperWindowMode, SLOT( map() ) );
|
||||
m_mapperWindowMode->setMapping( m_arrayActions[MDI_SUBWINDOW_MODE_ACT], MDISUBWINDOWMODE );
|
||||
|
||||
m_actionGroupWindowMode->actions().at( m_iWindowMode )->setChecked( true );
|
||||
@@ -486,19 +469,16 @@ Void PlaYUVerSubWindowHandle::createActions()
|
||||
m_arrayActions[CLOSE_ACT] = new QAction( tr( "&Close" ), this );
|
||||
m_arrayActions[CLOSE_ACT]->setIcon( style()->standardIcon( QStyle::SP_DialogCloseButton ) );
|
||||
m_arrayActions[CLOSE_ACT]->setStatusTip( tr( "Close the active window" ) );
|
||||
connect( m_arrayActions[CLOSE_ACT], SIGNAL( triggered() ), this,
|
||||
SLOT( removeActiveSubWindow() ) );
|
||||
connect( m_arrayActions[CLOSE_ACT], SIGNAL( triggered() ), this, SLOT( removeActiveSubWindow() ) );
|
||||
|
||||
m_arrayActions[CLOSE_ACT] = new QAction( tr( "&Close" ), this );
|
||||
m_arrayActions[CLOSE_ACT]->setIcon( style()->standardIcon( QStyle::SP_DialogCloseButton ) );
|
||||
m_arrayActions[CLOSE_ACT]->setStatusTip( tr( "Close the active window" ) );
|
||||
connect( m_arrayActions[CLOSE_ACT], SIGNAL( triggered() ), this,
|
||||
SLOT( removeActiveSubWindow() ) );
|
||||
connect( m_arrayActions[CLOSE_ACT], SIGNAL( triggered() ), this, SLOT( removeActiveSubWindow() ) );
|
||||
|
||||
m_arrayActions[CLOSE_ALL_ACT] = new QAction( tr( "Close &All" ), this );
|
||||
m_arrayActions[CLOSE_ALL_ACT]->setStatusTip( tr( "Close all the windows" ) );
|
||||
connect( m_arrayActions[CLOSE_ALL_ACT], SIGNAL( triggered() ), this,
|
||||
SLOT( removeAllSubWindow() ) );
|
||||
connect( m_arrayActions[CLOSE_ALL_ACT], SIGNAL( triggered() ), this, SLOT( removeAllSubWindow() ) );
|
||||
|
||||
m_arrayActions[TILE_WINDOWS_ACT] = new QAction( tr( "Tile" ), this );
|
||||
m_arrayActions[TILE_WINDOWS_ACT]->setIcon( QIcon( ":images/windowstile.png" ) );
|
||||
@@ -506,29 +486,24 @@ Void PlaYUVerSubWindowHandle::createActions()
|
||||
m_arrayActions[TILE_WINDOWS_ACT]->setShortcut( tr( "Ctrl+T" ) );
|
||||
// connect( m_arrayActions[TILE_WINDOWS_ACT], SIGNAL( triggered() ), mdiArea,
|
||||
// SLOT( tileSubWindows() ) );
|
||||
connect( m_arrayActions[TILE_WINDOWS_ACT], SIGNAL( triggered() ), this,
|
||||
SLOT( tileSubWindows() ) );
|
||||
connect( m_arrayActions[TILE_WINDOWS_ACT], SIGNAL( triggered() ), this, SLOT( tileSubWindows() ) );
|
||||
|
||||
m_arrayActions[CASCADE_WINDOWS_ACT] = new QAction( tr( "Cascade" ), this );
|
||||
m_arrayActions[CASCADE_WINDOWS_ACT]->setIcon( QIcon( ":images/windowscascade.png" ) );
|
||||
m_arrayActions[CASCADE_WINDOWS_ACT]->setStatusTip( tr( "Cascade the windows" ) );
|
||||
connect( m_arrayActions[CASCADE_WINDOWS_ACT], SIGNAL( triggered() ), this,
|
||||
SLOT( cascadeSubWindows() ) );
|
||||
connect( m_arrayActions[CASCADE_WINDOWS_ACT], SIGNAL( triggered() ), this, SLOT( cascadeSubWindows() ) );
|
||||
|
||||
m_arrayActions[NEXT_WINDOWS_ACT] = new QAction( tr( "Ne&xt" ), this );
|
||||
m_arrayActions[NEXT_WINDOWS_ACT]->setShortcuts( QKeySequence::NextChild );
|
||||
m_arrayActions[NEXT_WINDOWS_ACT]->setIcon(
|
||||
QIcon( style()->standardIcon( QStyle::SP_ArrowRight ) ) );
|
||||
m_arrayActions[NEXT_WINDOWS_ACT]->setIcon( QIcon( style()->standardIcon( QStyle::SP_ArrowRight ) ) );
|
||||
m_arrayActions[NEXT_WINDOWS_ACT]->setStatusTip( tr( "Move the focus to the next window" ) );
|
||||
// connect( m_arrayActions[NEXT_WINDOWS_ACT], SIGNAL( triggered() ), this,
|
||||
// SLOT( activateNextSubWindow() ) );
|
||||
|
||||
m_arrayActions[PREVIOUS_WINDOWS_ACT] = new QAction( tr( "Pre&vious" ), this );
|
||||
m_arrayActions[PREVIOUS_WINDOWS_ACT]->setShortcuts( QKeySequence::PreviousChild );
|
||||
m_arrayActions[PREVIOUS_WINDOWS_ACT]->setIcon(
|
||||
QIcon( style()->standardIcon( QStyle::SP_ArrowLeft ) ) );
|
||||
m_arrayActions[PREVIOUS_WINDOWS_ACT]->setStatusTip(
|
||||
tr( "Move the focus to the previous window" ) );
|
||||
m_arrayActions[PREVIOUS_WINDOWS_ACT]->setIcon( QIcon( style()->standardIcon( QStyle::SP_ArrowLeft ) ) );
|
||||
m_arrayActions[PREVIOUS_WINDOWS_ACT]->setStatusTip( tr( "Move the focus to the previous window" ) );
|
||||
// connect( m_arrayActions[PREVIOUS_WINDOWS_ACT], SIGNAL( triggered() ),
|
||||
// this, SLOT( activatePreviousSubWindow() ) );
|
||||
|
||||
@@ -598,10 +573,8 @@ Void PlaYUVerSubWindowHandle::updateMenu()
|
||||
Void PlaYUVerSubWindowHandle::readSettings()
|
||||
{
|
||||
QSettings appSettings;
|
||||
m_cMdiModeWindowPosition =
|
||||
appSettings.value( "SubWindowManager/LastMdiPosition", QPoint( 200, 200 ) ).toPoint();
|
||||
m_cMdiModeWindowSize =
|
||||
appSettings.value( "SubWindowManager/LastMdiSize", QSize( 500, 400 ) ).toSize();
|
||||
m_cMdiModeWindowPosition = appSettings.value( "SubWindowManager/LastMdiPosition", QPoint( 200, 200 ) ).toPoint();
|
||||
m_cMdiModeWindowSize = appSettings.value( "SubWindowManager/LastMdiSize", QSize( 500, 400 ) ).toSize();
|
||||
Int iWindowMode = appSettings.value( "SubWindowManager/SubWindowMode", MDISUBWINDOWMODE ).toInt();
|
||||
setWindowMode( iWindowMode );
|
||||
m_actionGroupWindowMode->actions().at( iWindowMode )->setChecked( true );
|
||||
|
||||
+6
-14
@@ -44,8 +44,7 @@ Void PlotSubWindow::definePlotColors()
|
||||
m_arrayColorList.append( Qt::darkYellow );
|
||||
}
|
||||
|
||||
PlotSubWindow::PlotSubWindow( const QString& windowTitle, QWidget* parent )
|
||||
: SubWindowAbstract( parent, SubWindowAbstract::PLOT_SUBWINDOW )
|
||||
PlotSubWindow::PlotSubWindow( const QString& windowTitle, QWidget* parent ) : SubWindowAbstract( parent, SubWindowAbstract::PLOT_SUBWINDOW )
|
||||
{
|
||||
definePlotColors();
|
||||
m_iNumberPlots = 0;
|
||||
@@ -94,18 +93,15 @@ PlotSubWindow::PlotSubWindow( const QString& windowTitle, QWidget* parent )
|
||||
m_cPlotArea->yAxis2->setTickLabels( false );
|
||||
// make left and bottom axes always transfer their ranges to right and top
|
||||
// axes:
|
||||
connect( m_cPlotArea->xAxis, SIGNAL( rangeChanged( QCPRange ) ), m_cPlotArea->xAxis2,
|
||||
SLOT( setRange( QCPRange ) ) );
|
||||
connect( m_cPlotArea->yAxis, SIGNAL( rangeChanged( QCPRange ) ), m_cPlotArea->yAxis2,
|
||||
SLOT( setRange( QCPRange ) ) );
|
||||
connect( m_cPlotArea->xAxis, SIGNAL( rangeChanged( QCPRange ) ), m_cPlotArea->xAxis2, SLOT( setRange( QCPRange ) ) );
|
||||
connect( m_cPlotArea->yAxis, SIGNAL( rangeChanged( QCPRange ) ), m_cPlotArea->yAxis2, SLOT( setRange( QCPRange ) ) );
|
||||
|
||||
QFont legendFont = font(); // start out with MainWindow's font..
|
||||
legendFont.setPointSize( 9 ); // and make a bit smaller for legend
|
||||
m_cPlotArea->legend->setFont( legendFont );
|
||||
m_cPlotArea->legend->setBrush( backgroundBrush );
|
||||
m_cPlotArea->legend->setTextColor( palette().text().color() );
|
||||
m_cPlotArea->legend->setBorderPen(
|
||||
QPen( palette().brush( QPalette::Active, QPalette::Shadow ), 1 ) );
|
||||
m_cPlotArea->legend->setBorderPen( QPen( palette().brush( QPalette::Active, QPalette::Shadow ), 1 ) );
|
||||
m_cPlotArea->legend->setVisible( false );
|
||||
|
||||
m_cPlotArea->setInteractions( QCP::iRangeZoom | QCP::iRangeDrag ); // QCP::iSelectPlottables
|
||||
@@ -192,9 +188,7 @@ Void PlotSubWindow::setAxisRange( const QLine& axisLimits )
|
||||
setAxisRange( VERTICAL, axisLimits.y1(), axisLimits.y2() );
|
||||
}
|
||||
|
||||
Void PlotSubWindow::setAxisRange( PlotSubWindow::Axis eAxis,
|
||||
const Int& axisStart,
|
||||
const Int& axisEnd )
|
||||
Void PlotSubWindow::setAxisRange( PlotSubWindow::Axis eAxis, const Int& axisStart, const Int& axisEnd )
|
||||
{
|
||||
if( eAxis == HORIZONTAL )
|
||||
{
|
||||
@@ -213,9 +207,7 @@ Void PlotSubWindow::setAxisRange( PlotSubWindow::Axis eAxis,
|
||||
m_cPlotArea->replot();
|
||||
}
|
||||
|
||||
Void PlotSubWindow::addPlot( const QVector<Double>& arrayX,
|
||||
const QVector<Double>& arrayY,
|
||||
const QString& key )
|
||||
Void PlotSubWindow::addPlot( const QVector<Double>& arrayX, const QVector<Double>& arrayY, const QString& key )
|
||||
{
|
||||
QCPGraph* newPlot = m_cPlotArea->addGraph();
|
||||
QColor plotColor = m_arrayColorList.at( 0 );
|
||||
|
||||
+1
-3
@@ -84,9 +84,7 @@ public:
|
||||
|
||||
Void setKey( const QString& key );
|
||||
|
||||
Void addPlot( const QVector<Double>& arrayX,
|
||||
const QVector<Double>& arrayY,
|
||||
const QString& key = QString() );
|
||||
Void addPlot( const QVector<Double>& arrayX, const QVector<Double>& arrayY, const QString& key = QString() );
|
||||
};
|
||||
|
||||
#endif // __PLOTWINDOWHANDLE_H__
|
||||
+1
-2
@@ -29,8 +29,7 @@
|
||||
#include <QProgressBar>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
ProgressBar::ProgressBar( QWidget* parent, UInt maxValue )
|
||||
: QWidget( parent ), m_uiTotalProgress( maxValue ), m_uiProgress( 0 )
|
||||
ProgressBar::ProgressBar( QWidget* parent, UInt maxValue ) : QWidget( parent ), m_uiTotalProgress( maxValue ), m_uiProgress( 0 )
|
||||
{
|
||||
QVBoxLayout* mainLayout = new QVBoxLayout( this );
|
||||
m_pcProgressBar = new QProgressBar;
|
||||
|
||||
+15
-31
@@ -34,8 +34,7 @@
|
||||
#include "QtConcurrent/qtconcurrentrun.h"
|
||||
#endif
|
||||
|
||||
QualityHandle::QualityHandle( QWidget* parent, PlaYUVerSubWindowHandle* windowManager )
|
||||
: m_pcParet( parent ), m_pcMainWindowManager( windowManager )
|
||||
QualityHandle::QualityHandle( QWidget* parent, PlaYUVerSubWindowHandle* windowManager ) : m_pcParet( parent ), m_pcMainWindowManager( windowManager )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -61,15 +60,12 @@ Void QualityHandle::createActions()
|
||||
m_arrayActions.resize( TOTAL_ACT );
|
||||
|
||||
m_arrayActions[SELECT_CURR_REF_ACT] = new QAction( "Mark as Reference", this );
|
||||
connect( m_arrayActions[SELECT_CURR_REF_ACT], SIGNAL( triggered() ), this,
|
||||
SLOT( slotSelectCurrentAsReference() ) );
|
||||
connect( m_arrayActions[SELECT_CURR_REF_ACT], SIGNAL( triggered() ), this, SLOT( slotSelectCurrentAsReference() ) );
|
||||
|
||||
m_arrayActions[PLOT_QUALITY] = new QAction( "Plot Window's Quality", this );
|
||||
connect( m_arrayActions[PLOT_QUALITY], SIGNAL( triggered() ), this,
|
||||
SLOT( slotPlotQualitySingle() ) );
|
||||
connect( m_arrayActions[PLOT_QUALITY], SIGNAL( triggered() ), this, SLOT( slotPlotQualitySingle() ) );
|
||||
m_arrayActions[PLOT_SEVERAL_QUALITY] = new QAction( "Plot Several Quality", this );
|
||||
connect( m_arrayActions[PLOT_SEVERAL_QUALITY], SIGNAL( triggered() ), this,
|
||||
SLOT( slotPlotQualitySeveral() ) );
|
||||
connect( m_arrayActions[PLOT_SEVERAL_QUALITY], SIGNAL( triggered() ), this, SLOT( slotPlotQualitySeveral() ) );
|
||||
}
|
||||
|
||||
QMenu* QualityHandle::createMenu()
|
||||
@@ -91,10 +87,8 @@ QDockWidget* QualityHandle::createDock()
|
||||
m_pcQualityHandleDock->setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );
|
||||
m_pcQualityHandleDock->setWidget( m_pcQualityHandleSideBar );
|
||||
|
||||
connect( m_pcQualityHandleSideBar, SIGNAL( signalQualityMetricChanged( int ) ), this,
|
||||
SLOT( slotQualityMetricChanged( int ) ) );
|
||||
connect( m_mapperQualityMetric, SIGNAL( mapped( int ) ), this,
|
||||
SLOT( slotQualityMetricChanged( int ) ) );
|
||||
connect( m_pcQualityHandleSideBar, SIGNAL( signalQualityMetricChanged( int ) ), this, SLOT( slotQualityMetricChanged( int ) ) );
|
||||
connect( m_mapperQualityMetric, SIGNAL( mapped( int ) ), this, SLOT( slotQualityMetricChanged( int ) ) );
|
||||
|
||||
slotQualityMetricChanged( 0 );
|
||||
|
||||
@@ -103,8 +97,7 @@ QDockWidget* QualityHandle::createDock()
|
||||
|
||||
Void QualityHandle::updateMenus()
|
||||
{
|
||||
VideoSubWindow* pcCurrentVideoSubWindow =
|
||||
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
VideoSubWindow* pcCurrentVideoSubWindow = qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
Bool hasSubWindow = pcCurrentVideoSubWindow ? true : false;
|
||||
Bool hasReference = false;
|
||||
Bool isReference = false;
|
||||
@@ -115,8 +108,7 @@ Void QualityHandle::updateMenus()
|
||||
if( hasSubWindow && !hasReference )
|
||||
{
|
||||
VideoSubWindow* pcVideoSubWindow;
|
||||
QList<SubWindowAbstract*> subWindowList =
|
||||
m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_STREAM_SUBWINDOW );
|
||||
QList<SubWindowAbstract*> subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_STREAM_SUBWINDOW );
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
pcVideoSubWindow = qobject_cast<VideoSubWindow*>( subWindowList.at( i ) );
|
||||
@@ -199,8 +191,7 @@ Void QualityHandle::measureQuality( QVector<VideoSubWindow*> apcWindowList )
|
||||
for( UInt i = 0; i < numberOfWindows; i++ )
|
||||
{
|
||||
pcCurrFrame = apcWindowList.at( i )->getCurrFrame();
|
||||
padQualityValues[i + 1].append(
|
||||
pcCurrFrame->getQuality( m_iQualityMetricIdx, pcReferenceFrame, LUMA ) );
|
||||
padQualityValues[i + 1].append( pcCurrFrame->getQuality( m_iQualityMetricIdx, pcReferenceFrame, LUMA ) );
|
||||
apcWindowList.at( i )->seekRelativeEvent( true );
|
||||
}
|
||||
pcReferenceWindow->seekRelativeEvent( true );
|
||||
@@ -218,9 +209,7 @@ Void QualityHandle::measureQuality( QVector<VideoSubWindow*> apcWindowList )
|
||||
plotWindowTitle += " - " + apcWindowList.at( 0 )->getWindowName();
|
||||
}
|
||||
PlotSubWindow* pcPlotWindow = new PlotSubWindow( plotWindowTitle );
|
||||
pcPlotWindow->setAxisName(
|
||||
"Frame Number",
|
||||
QString::fromStdString( PlaYUVerFrame::supportedQualityMetricsList()[m_iQualityMetricIdx] ) );
|
||||
pcPlotWindow->setAxisName( "Frame Number", QString::fromStdString( PlaYUVerFrame::supportedQualityMetricsList()[m_iQualityMetricIdx] ) );
|
||||
|
||||
if( apcWindowList.size() > 1 )
|
||||
{
|
||||
@@ -252,13 +241,11 @@ Void QualityHandle::slotQualityMetricChanged( Int idx )
|
||||
|
||||
Void QualityHandle::slotSelectCurrentAsReference()
|
||||
{
|
||||
VideoSubWindow* pcRefSubWindow =
|
||||
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
VideoSubWindow* pcRefSubWindow = qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
if( pcRefSubWindow )
|
||||
{
|
||||
VideoSubWindow* pcVideoSubWindow;
|
||||
QList<SubWindowAbstract*> subWindowList =
|
||||
m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
QList<SubWindowAbstract*> subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
pcVideoSubWindow = qobject_cast<VideoSubWindow*>( subWindowList.at( i ) );
|
||||
@@ -273,8 +260,7 @@ Void QualityHandle::slotSelectCurrentAsReference()
|
||||
|
||||
Void QualityHandle::slotPlotQualitySingle()
|
||||
{
|
||||
VideoSubWindow* pcSubWindow =
|
||||
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
VideoSubWindow* pcSubWindow = qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
if( pcSubWindow )
|
||||
{
|
||||
if( pcSubWindow->getRefSubWindow() )
|
||||
@@ -298,8 +284,7 @@ Void QualityHandle::slotPlotQualitySingle()
|
||||
|
||||
Void QualityHandle::slotPlotQualitySeveral()
|
||||
{
|
||||
VideoSubWindow* pcSubWindow =
|
||||
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
VideoSubWindow* pcSubWindow = qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
if( pcSubWindow )
|
||||
{
|
||||
QVector<VideoSubWindow*> apcWindowList;
|
||||
@@ -311,8 +296,7 @@ Void QualityHandle::slotPlotQualitySeveral()
|
||||
}
|
||||
|
||||
VideoSubWindow* pcVideoSubWindow;
|
||||
QList<SubWindowAbstract*> subWindowList =
|
||||
m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_STREAM_SUBWINDOW );
|
||||
QList<SubWindowAbstract*> subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_STREAM_SUBWINDOW );
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
pcVideoSubWindow = qobject_cast<VideoSubWindow*>( subWindowList.at( i ) );
|
||||
|
||||
@@ -27,8 +27,7 @@
|
||||
#include "VideoSubWindow.h"
|
||||
#include <QtGui>
|
||||
|
||||
QualityMeasurementSidebar::QualityMeasurementSidebar( QWidget* parent,
|
||||
PlaYUVerSubWindowHandle* windowManager )
|
||||
QualityMeasurementSidebar::QualityMeasurementSidebar( QWidget* parent, PlaYUVerSubWindowHandle* windowManager )
|
||||
: QWidget( parent ), m_pcMainWindowManager( windowManager ), m_pcCurrentVideoSubWindow( NULL )
|
||||
{
|
||||
// Side bar area -----------------------------------------------------
|
||||
@@ -99,8 +98,7 @@ QualityMeasurementSidebar::QualityMeasurementSidebar( QWidget* parent,
|
||||
setLayout( mainLayout );
|
||||
|
||||
connect( m_comboBoxRef, SIGNAL( activated( int ) ), this, SLOT( slotReferenceChanged( int ) ) );
|
||||
connect( m_comboBoxMetric, SIGNAL( currentIndexChanged( int ) ), this,
|
||||
SLOT( slotQualityMetricChanged( int ) ) );
|
||||
connect( m_comboBoxMetric, SIGNAL( currentIndexChanged( int ) ), this, SLOT( slotQualityMetricChanged( int ) ) );
|
||||
}
|
||||
|
||||
QualityMeasurementSidebar::~QualityMeasurementSidebar() {}
|
||||
@@ -129,8 +127,7 @@ Void QualityMeasurementSidebar::updateSubWindowList()
|
||||
m_pcVideoWindowList.clear();
|
||||
|
||||
VideoSubWindow* pcVideoSubWindow;
|
||||
QList<SubWindowAbstract*> subWindowList =
|
||||
m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
QList<SubWindowAbstract*> subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
pcVideoSubWindow = qobject_cast<VideoSubWindow*>( subWindowList.at( i ) );
|
||||
@@ -140,8 +137,7 @@ Void QualityMeasurementSidebar::updateSubWindowList()
|
||||
}
|
||||
if( m_pcCurrentVideoSubWindow )
|
||||
{
|
||||
if( !m_pcCurrentVideoSubWindow->getCurrFrame()->haveSameFmt(
|
||||
pcVideoSubWindow->getCurrFrame() ) )
|
||||
if( !m_pcCurrentVideoSubWindow->getCurrFrame()->haveSameFmt( pcVideoSubWindow->getCurrFrame() ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -57,8 +57,7 @@ SeekStreamDialog::SeekStreamDialog( PlaYUVerStream* pcCurrStream, QWidget* paren
|
||||
QVBoxLayout* verticalLayout = new QVBoxLayout;
|
||||
QHBoxLayout* horizontalLayout = new QHBoxLayout;
|
||||
horizontalLayout->addWidget( pcLabel );
|
||||
horizontalLayout->addItem(
|
||||
new QSpacerItem( 20, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
|
||||
horizontalLayout->addItem( new QSpacerItem( 20, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
|
||||
horizontalLayout->addWidget( m_spinFrameNum );
|
||||
verticalLayout->addLayout( horizontalLayout );
|
||||
verticalLayout->addWidget( dialogButtonOkCancel, Qt::AlignRight );
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
#include <QIcon>
|
||||
#include <QScrollBar>
|
||||
|
||||
SubWindowAbstract::SubWindowAbstract( QWidget* parent, UInt category )
|
||||
: QWidget( parent ), m_cSubWindow( NULL )
|
||||
SubWindowAbstract::SubWindowAbstract( QWidget* parent, UInt category ) : QWidget( parent ), m_cSubWindow( NULL )
|
||||
{
|
||||
setParent( parent );
|
||||
setVisible( false );
|
||||
|
||||
+36
-73
@@ -41,14 +41,13 @@
|
||||
#include <QElapsedTimer>
|
||||
#endif
|
||||
|
||||
VideoHandle::VideoHandle( QWidget* parent, PlaYUVerSubWindowHandle* windowManager )
|
||||
: m_pcParet( parent ), m_pcMainWindowManager( windowManager )
|
||||
VideoHandle::VideoHandle( QWidget* parent, PlaYUVerSubWindowHandle* windowManager ) : m_pcParet( parent ), m_pcMainWindowManager( windowManager )
|
||||
{
|
||||
m_pcCurrentVideoSubWindow = NULL;
|
||||
m_bIsPlaying = false;
|
||||
m_pcPlayingTimer = new QTimer;
|
||||
#if( QT_VERSION_PLAYUVER == 5 )
|
||||
m_pcPlayingTimer->setTimerType( Qt::CoarseTimer );
|
||||
m_pcPlayingTimer->setTimerType( Qt::VeryCoarseTimer );
|
||||
#endif
|
||||
connect( m_pcPlayingTimer, SIGNAL( timeout() ), this, SLOT( playEvent() ) );
|
||||
m_acPlayingSubWindows.clear();
|
||||
@@ -61,15 +60,13 @@ Void VideoHandle::createActions()
|
||||
m_arrayActions.resize( TOTAL_ACT );
|
||||
m_arrayActions[PLAY_ACT] = new QAction( "Play", this );
|
||||
m_arrayActions[PLAY_ACT]->setStatusTip( "Play/Pause" );
|
||||
m_arrayActions[PLAY_ACT]->setIcon(
|
||||
QIcon( m_pcParet->style()->standardIcon( QStyle::SP_MediaPlay ) ) );
|
||||
m_arrayActions[PLAY_ACT]->setIcon( QIcon( m_pcParet->style()->standardIcon( QStyle::SP_MediaPlay ) ) );
|
||||
m_arrayActions[PLAY_ACT]->setShortcut( Qt::Key_Space );
|
||||
connect( m_arrayActions[PLAY_ACT], SIGNAL( triggered() ), this, SLOT( play() ) );
|
||||
|
||||
m_arrayActions[STOP_ACT] = new QAction( "Stop", this );
|
||||
m_arrayActions[STOP_ACT]->setStatusTip( "Stop" );
|
||||
m_arrayActions[STOP_ACT]->setIcon(
|
||||
QIcon( m_pcParet->style()->standardIcon( QStyle::SP_MediaStop ) ) );
|
||||
m_arrayActions[STOP_ACT]->setIcon( QIcon( m_pcParet->style()->standardIcon( QStyle::SP_MediaStop ) ) );
|
||||
connect( m_arrayActions[STOP_ACT], SIGNAL( triggered() ), this, SLOT( stop() ) );
|
||||
|
||||
m_mapperVideoSeek = new QSignalMapper( this );
|
||||
@@ -77,20 +74,16 @@ Void VideoHandle::createActions()
|
||||
|
||||
m_arrayActions[VIDEO_BACKWARD_ACT] = new QAction( "Video Backward", this );
|
||||
m_arrayActions[VIDEO_BACKWARD_ACT]->setStatusTip( "Seek backward" );
|
||||
m_arrayActions[VIDEO_BACKWARD_ACT]->setIcon(
|
||||
QIcon( m_pcParet->style()->standardIcon( QStyle::SP_MediaSeekBackward ) ) );
|
||||
m_arrayActions[VIDEO_BACKWARD_ACT]->setIcon( QIcon( m_pcParet->style()->standardIcon( QStyle::SP_MediaSeekBackward ) ) );
|
||||
m_arrayActions[VIDEO_BACKWARD_ACT]->setShortcut( Qt::Key_Left );
|
||||
connect( m_arrayActions[VIDEO_BACKWARD_ACT], SIGNAL( triggered() ), m_mapperVideoSeek,
|
||||
SLOT( map() ) );
|
||||
connect( m_arrayActions[VIDEO_BACKWARD_ACT], SIGNAL( triggered() ), m_mapperVideoSeek, SLOT( map() ) );
|
||||
m_mapperVideoSeek->setMapping( m_arrayActions[VIDEO_BACKWARD_ACT], 0 );
|
||||
|
||||
m_arrayActions[VIDEO_FORWARD_ACT] = new QAction( "Video Forward", this );
|
||||
m_arrayActions[VIDEO_FORWARD_ACT]->setStatusTip( "Seek forward" );
|
||||
m_arrayActions[VIDEO_FORWARD_ACT]->setIcon(
|
||||
QIcon( m_pcParet->style()->standardIcon( QStyle::SP_MediaSeekForward ) ) );
|
||||
m_arrayActions[VIDEO_FORWARD_ACT]->setIcon( QIcon( m_pcParet->style()->standardIcon( QStyle::SP_MediaSeekForward ) ) );
|
||||
m_arrayActions[VIDEO_FORWARD_ACT]->setShortcut( Qt::Key_Right );
|
||||
connect( m_arrayActions[VIDEO_FORWARD_ACT], SIGNAL( triggered() ), m_mapperVideoSeek,
|
||||
SLOT( map() ) );
|
||||
connect( m_arrayActions[VIDEO_FORWARD_ACT], SIGNAL( triggered() ), m_mapperVideoSeek, SLOT( map() ) );
|
||||
m_mapperVideoSeek->setMapping( m_arrayActions[VIDEO_FORWARD_ACT], 1 );
|
||||
|
||||
m_arrayActions[VIDEO_GOTO_ACT] = new QAction( "Go to", this );
|
||||
@@ -114,14 +107,12 @@ Void VideoHandle::createActions()
|
||||
m_arrayActions[VIDEO_LOCK_SELECTION_ACT]->setStatusTip(
|
||||
"Select which windows should be played synchronized. Press Ctrl while "
|
||||
"click to quickly to select all!" );
|
||||
connect( m_arrayActions[VIDEO_LOCK_SELECTION_ACT], SIGNAL( triggered() ), this,
|
||||
SLOT( videoSelectionButtonEvent() ) );
|
||||
connect( m_arrayActions[VIDEO_LOCK_SELECTION_ACT], SIGNAL( triggered() ), this, SLOT( videoSelectionButtonEvent() ) );
|
||||
|
||||
m_pcFrameSlider = new QSlider;
|
||||
m_pcFrameSlider->setOrientation( Qt::Horizontal );
|
||||
m_pcFrameSlider->setMaximumWidth( 2000 );
|
||||
m_pcFrameSlider->setSizePolicy(
|
||||
QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed ) );
|
||||
m_pcFrameSlider->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed ) );
|
||||
m_pcFrameSlider->setEnabled( false );
|
||||
m_pcFrameSlider->setTracking( false );
|
||||
connect( m_pcFrameSlider, SIGNAL( valueChanged( int ) ), this, SLOT( seekSliderEvent( int ) ) );
|
||||
@@ -140,8 +131,7 @@ Void VideoHandle::createActions()
|
||||
m_arrayActions[NAVIGATION_TOOL_ACT]->setChecked( true );
|
||||
m_arrayActions[NAVIGATION_TOOL_ACT]->setShortcut( Qt::CTRL + Qt::Key_1 );
|
||||
actionGroupTools->addAction( m_arrayActions[NAVIGATION_TOOL_ACT] );
|
||||
connect( m_arrayActions[NAVIGATION_TOOL_ACT], SIGNAL( triggered() ), m_mapperTools,
|
||||
SLOT( map() ) );
|
||||
connect( m_arrayActions[NAVIGATION_TOOL_ACT], SIGNAL( triggered() ), m_mapperTools, SLOT( map() ) );
|
||||
m_mapperTools->setMapping( m_arrayActions[NAVIGATION_TOOL_ACT], ViewArea::NavigationView );
|
||||
|
||||
m_arrayActions[SELECTION_TOOL_ACT] = new QAction( "Selection Tool", this );
|
||||
@@ -149,8 +139,7 @@ Void VideoHandle::createActions()
|
||||
m_arrayActions[SELECTION_TOOL_ACT]->setChecked( false );
|
||||
m_arrayActions[SELECTION_TOOL_ACT]->setShortcut( Qt::CTRL + Qt::Key_2 );
|
||||
actionGroupTools->addAction( m_arrayActions[SELECTION_TOOL_ACT] );
|
||||
connect( m_arrayActions[SELECTION_TOOL_ACT], SIGNAL( triggered() ), m_mapperTools,
|
||||
SLOT( map() ) );
|
||||
connect( m_arrayActions[SELECTION_TOOL_ACT], SIGNAL( triggered() ), m_mapperTools, SLOT( map() ) );
|
||||
m_mapperTools->setMapping( m_arrayActions[SELECTION_TOOL_ACT], ViewArea::NormalSelectionView );
|
||||
|
||||
m_arrayActions[BLOCK_SELECTION_TOOL_ACT] = new QAction( "Block Selection Tool", this );
|
||||
@@ -158,16 +147,13 @@ Void VideoHandle::createActions()
|
||||
m_arrayActions[BLOCK_SELECTION_TOOL_ACT]->setChecked( false );
|
||||
m_arrayActions[BLOCK_SELECTION_TOOL_ACT]->setShortcut( Qt::CTRL + Qt::Key_3 );
|
||||
actionGroupTools->addAction( m_arrayActions[BLOCK_SELECTION_TOOL_ACT] );
|
||||
connect( m_arrayActions[BLOCK_SELECTION_TOOL_ACT], SIGNAL( triggered() ), m_mapperTools,
|
||||
SLOT( map() ) );
|
||||
m_mapperTools->setMapping( m_arrayActions[BLOCK_SELECTION_TOOL_ACT],
|
||||
ViewArea::BlockSelectionView );
|
||||
connect( m_arrayActions[BLOCK_SELECTION_TOOL_ACT], SIGNAL( triggered() ), m_mapperTools, SLOT( map() ) );
|
||||
m_mapperTools->setMapping( m_arrayActions[BLOCK_SELECTION_TOOL_ACT], ViewArea::BlockSelectionView );
|
||||
|
||||
m_arrayActions[SHOW_GRID_ACT] = new QAction( "Show grid", this );
|
||||
m_arrayActions[SHOW_GRID_ACT]->setCheckable( true );
|
||||
m_arrayActions[SHOW_GRID_ACT]->setChecked( false );
|
||||
connect( m_arrayActions[SHOW_GRID_ACT], SIGNAL( toggled( bool ) ), this,
|
||||
SLOT( toggleGrid( bool ) ) );
|
||||
connect( m_arrayActions[SHOW_GRID_ACT], SIGNAL( toggled( bool ) ), this, SLOT( toggleGrid( bool ) ) );
|
||||
}
|
||||
|
||||
QMenu* VideoHandle::createVideoMenu()
|
||||
@@ -255,8 +241,7 @@ QWidget* VideoHandle::createStatusBarMessage()
|
||||
|
||||
Void VideoHandle::updateMenus()
|
||||
{
|
||||
VideoSubWindow* pcSubWindow =
|
||||
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
VideoSubWindow* pcSubWindow = qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
Bool hasSubWindow = pcSubWindow ? true : false;
|
||||
|
||||
m_arrayActions[PLAY_ACT]->setEnabled( hasSubWindow );
|
||||
@@ -271,8 +256,7 @@ Void VideoHandle::updateMenus()
|
||||
m_pcFrameSlider->setEnabled( hasSubWindow );
|
||||
if( !hasSubWindow )
|
||||
{
|
||||
disconnect( m_pcFrameSlider, SIGNAL( valueChanged( int ) ), this,
|
||||
SLOT( seekSliderEvent( int ) ) );
|
||||
disconnect( m_pcFrameSlider, SIGNAL( valueChanged( int ) ), this, SLOT( seekSliderEvent( int ) ) );
|
||||
m_pcFrameSlider->setValue( 0 );
|
||||
m_pcFrameNumInfo->clear();
|
||||
}
|
||||
@@ -290,10 +274,8 @@ Void VideoHandle::updateMenus()
|
||||
Void VideoHandle::readSettings()
|
||||
{
|
||||
QSettings appSettings;
|
||||
m_arrayActions[VIDEO_REPEAT_ACT]->setChecked(
|
||||
appSettings.value( "VideoHandle/Repeat", false ).toBool() );
|
||||
m_arrayActions[VIDEO_ZOOM_LOCK_ACT]->setChecked(
|
||||
appSettings.value( "VideoHandle/VideoZoomLock", false ).toBool() );
|
||||
m_arrayActions[VIDEO_REPEAT_ACT]->setChecked( appSettings.value( "VideoHandle/Repeat", false ).toBool() );
|
||||
m_arrayActions[VIDEO_ZOOM_LOCK_ACT]->setChecked( appSettings.value( "VideoHandle/VideoZoomLock", false ).toBool() );
|
||||
if( !appSettings.value( "VideoHandle/FrameProperties", true ).toBool() )
|
||||
m_pcFramePropertiesDock->close();
|
||||
|
||||
@@ -305,8 +287,7 @@ Void VideoHandle::writeSettings()
|
||||
{
|
||||
QSettings appSettings;
|
||||
appSettings.setValue( "VideoHandle/Repeat", m_arrayActions[VIDEO_REPEAT_ACT]->isChecked() );
|
||||
appSettings.setValue( "VideoHandle/VideoZoomLock",
|
||||
m_arrayActions[VIDEO_ZOOM_LOCK_ACT]->isChecked() );
|
||||
appSettings.setValue( "VideoHandle/VideoZoomLock", m_arrayActions[VIDEO_ZOOM_LOCK_ACT]->isChecked() );
|
||||
appSettings.setValue( "VideoHandle/FrameProperties", m_pcFramePropertiesSideBar->isVisible() );
|
||||
appSettings.setValue( "VideoHandle/SelectedTool", m_uiViewTool );
|
||||
}
|
||||
@@ -326,8 +307,7 @@ Void VideoHandle::update()
|
||||
QString resolution;
|
||||
if( pcFrame )
|
||||
{
|
||||
resolution.append(
|
||||
QString( "%1x%2" ).arg( pcFrame->getWidth() ).arg( pcFrame->getHeight() ) );
|
||||
resolution.append( QString( "%1x%2" ).arg( pcFrame->getWidth() ).arg( pcFrame->getHeight() ) );
|
||||
}
|
||||
|
||||
if( pcStream )
|
||||
@@ -366,8 +346,7 @@ Void VideoHandle::update()
|
||||
if( m_pcCurrentVideoSubWindow->isPlaying() )
|
||||
{
|
||||
m_arrayActions[PLAY_ACT]->setText( "Pause" );
|
||||
m_arrayActions[PLAY_ACT]->setIcon(
|
||||
m_pcParet->style()->standardIcon( QStyle::SP_MediaPause ) );
|
||||
m_arrayActions[PLAY_ACT]->setIcon( m_pcParet->style()->standardIcon( QStyle::SP_MediaPause ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -401,8 +380,7 @@ Void VideoHandle::updateSelectionArea( QRect area )
|
||||
|
||||
Void VideoHandle::openSubWindow( VideoSubWindow* subWindow )
|
||||
{
|
||||
connect( subWindow->getViewArea(), SIGNAL( selectionChanged( QRect ) ), this,
|
||||
SLOT( updateSelectionArea( QRect ) ) );
|
||||
connect( subWindow->getViewArea(), SIGNAL( selectionChanged( QRect ) ), this, SLOT( updateSelectionArea( QRect ) ) );
|
||||
subWindow->getViewArea()->setTool( m_uiViewTool );
|
||||
subWindow->getViewArea()->setGridVisible( m_arrayActions[SHOW_GRID_ACT]->isChecked() );
|
||||
}
|
||||
@@ -432,8 +410,7 @@ Void VideoHandle::zoomToFactorAll( const Double scale, const QPoint center )
|
||||
factor = m_pcCurrentVideoSubWindow->getScaleFactor();
|
||||
|
||||
SubWindowAbstract* subWindow;
|
||||
QList<SubWindowAbstract*> subWindowList =
|
||||
m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
QList<SubWindowAbstract*> subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
subWindow = subWindowList.at( i );
|
||||
@@ -453,8 +430,7 @@ Void VideoHandle::moveAllScrollBars( const QPoint offset )
|
||||
if( m_arrayActions[VIDEO_ZOOM_LOCK_ACT]->isChecked() && m_pcCurrentVideoSubWindow )
|
||||
{
|
||||
VideoSubWindow* videoSubWindow;
|
||||
QList<SubWindowAbstract*> subWindowList =
|
||||
m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
QList<SubWindowAbstract*> subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
|
||||
QScrollBar* scrollBar;
|
||||
scrollBar = m_pcCurrentVideoSubWindow->getScroll()->horizontalScrollBar();
|
||||
@@ -538,8 +514,7 @@ Void VideoHandle::setTimerStatus()
|
||||
#if( _CONTROL_PLAYING_TIME_ == 1 )
|
||||
if( m_pcPlayControlTimer && m_pcPlayingTimer->interval() > 0 )
|
||||
{
|
||||
qDebug() << "Desired Fps: " << 1000 / m_pcPlayingTimer->interval()
|
||||
<< "Real Fps: " << 1000 / m_dAverageFps;
|
||||
qDebug() << "Desired Fps: " << 1000 / m_pcPlayingTimer->interval() << "Real Fps: " << 1000 / m_dAverageFps;
|
||||
|
||||
delete m_pcPlayControlTimer;
|
||||
m_pcPlayControlTimer = NULL;
|
||||
@@ -627,9 +602,7 @@ Void VideoHandle::playEvent()
|
||||
{
|
||||
Bool bEndOfSequence = false;
|
||||
#if( _CONTROL_PLAYING_TIME_ == 1 )
|
||||
m_dAverageFps =
|
||||
Double( m_dAverageFps * m_uiNumberPlayedFrames + m_pcPlayControlTimer->elapsed() ) /
|
||||
Double( m_uiNumberPlayedFrames + 1 );
|
||||
m_dAverageFps = Double( m_dAverageFps * m_uiNumberPlayedFrames + m_pcPlayControlTimer->elapsed() ) / Double( m_uiNumberPlayedFrames + 1 );
|
||||
m_uiNumberPlayedFrames++;
|
||||
m_pcPlayControlTimer->restart();
|
||||
#endif
|
||||
@@ -650,9 +623,8 @@ Void VideoHandle::playEvent()
|
||||
}
|
||||
catch( const char* msg )
|
||||
{
|
||||
QString warningMsg = "Error while playing " +
|
||||
QFileInfo( m_pcCurrentVideoSubWindow->getCurrentFileName() ).fileName() +
|
||||
" with the following error: \n" + msg;
|
||||
QString warningMsg =
|
||||
"Error while playing " + QFileInfo( m_pcCurrentVideoSubWindow->getCurrentFileName() ).fileName() + " with the following error: \n" + msg;
|
||||
QMessageBox::warning( m_pcParet, QApplication::applicationName(), warningMsg );
|
||||
qDebug() << warningMsg;
|
||||
stop();
|
||||
@@ -667,9 +639,7 @@ Void VideoHandle::seekEvent( Int direction )
|
||||
{
|
||||
if( m_acPlayingSubWindows.contains( m_pcCurrentVideoSubWindow ) )
|
||||
{
|
||||
if( !( ( UInt )( m_pcCurrentVideoSubWindow->getInputStream()->getCurrFrameNum() + 1 ) >=
|
||||
getMaxFrameNumber() &&
|
||||
direction > 0 ) )
|
||||
if( !( ( UInt )( m_pcCurrentVideoSubWindow->getInputStream()->getCurrFrameNum() + 1 ) >= getMaxFrameNumber() && direction > 0 ) )
|
||||
{
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
{
|
||||
@@ -692,8 +662,7 @@ Void VideoHandle::seekVideo()
|
||||
{
|
||||
if( m_pcCurrentVideoSubWindow->getInputStream() )
|
||||
{
|
||||
SeekStreamDialog* dialogSeekVideo =
|
||||
new SeekStreamDialog( m_pcCurrentVideoSubWindow->getInputStream(), m_pcParet );
|
||||
SeekStreamDialog* dialogSeekVideo = new SeekStreamDialog( m_pcCurrentVideoSubWindow->getInputStream(), m_pcParet );
|
||||
Int newFrameNum = dialogSeekVideo->runDialog();
|
||||
if( newFrameNum >= 0 )
|
||||
{
|
||||
@@ -741,8 +710,7 @@ Void VideoHandle::videoSelectionButtonEvent()
|
||||
Qt::KeyboardModifiers keyModifiers = QApplication::keyboardModifiers();
|
||||
if( keyModifiers & Qt::ControlModifier )
|
||||
{
|
||||
QList<SubWindowAbstract*> subWindowList =
|
||||
m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_STREAM_SUBWINDOW );
|
||||
QList<SubWindowAbstract*> subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_STREAM_SUBWINDOW );
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
videoSubWindow = qobject_cast<VideoSubWindow*>( subWindowList.at( i ) );
|
||||
@@ -751,8 +719,7 @@ Void VideoHandle::videoSelectionButtonEvent()
|
||||
}
|
||||
else
|
||||
{
|
||||
DialogSubWindowSelector dialogWindowsSelection( m_pcParet, m_pcMainWindowManager,
|
||||
SubWindowAbstract::VIDEO_STREAM_SUBWINDOW );
|
||||
DialogSubWindowSelector dialogWindowsSelection( m_pcParet, m_pcMainWindowManager, SubWindowAbstract::VIDEO_STREAM_SUBWINDOW );
|
||||
QStringList cWindowListNames;
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
{
|
||||
@@ -800,8 +767,7 @@ Void VideoHandle::setTool( Int tool )
|
||||
{
|
||||
m_uiViewTool = tool;
|
||||
actionGroupTools->actions().at( m_uiViewTool )->setChecked( true );
|
||||
QList<SubWindowAbstract*> subWindowList =
|
||||
m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
QList<SubWindowAbstract*> subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
qobject_cast<VideoSubWindow*>( subWindowList.at( i ) )->getViewArea()->setTool( m_uiViewTool );
|
||||
@@ -810,12 +776,9 @@ Void VideoHandle::setTool( Int tool )
|
||||
|
||||
Void VideoHandle::toggleGrid( Bool checked )
|
||||
{
|
||||
QList<SubWindowAbstract*> subWindowList =
|
||||
m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
QList<SubWindowAbstract*> subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
qobject_cast<VideoSubWindow*>( subWindowList.at( i ) )
|
||||
->getViewArea()
|
||||
->setGridVisible( checked );
|
||||
qobject_cast<VideoSubWindow*>( subWindowList.at( i ) )->getViewArea()->setGridVisible( checked );
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
#include <QThread>
|
||||
#include <QWidget>
|
||||
|
||||
#define _CONTROL_PLAYING_TIME_ 0
|
||||
#define _CONTROL_PLAYING_TIME_ 1
|
||||
|
||||
class QToolBar;
|
||||
class QDockWidget;
|
||||
|
||||
+49
-82
@@ -43,8 +43,8 @@ QDataStream& operator<<( QDataStream& out, const PlaYUVerStreamInfoVector& array
|
||||
for( Int i = 0; i < array.size(); i++ )
|
||||
{
|
||||
d = array.at( i );
|
||||
out << d.m_cFilename << d.m_uiWidth << d.m_uiHeight << d.m_iPelFormat << d.m_uiBitsPelPixel
|
||||
<< d.m_iEndianness << d.m_uiFrameRate << d.m_uiFileSize;
|
||||
out << d.m_cFilename << d.m_uiWidth << d.m_uiHeight << d.m_iPelFormat << d.m_uiBitsPelPixel << d.m_iEndianness << d.m_uiFrameRate
|
||||
<< d.m_uiFileSize;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
@@ -125,8 +125,7 @@ protected:
|
||||
if( m_bBusyWindow )
|
||||
{
|
||||
painter.setFont( m_cCenterTextFont );
|
||||
painter.drawText( rect(), Qt::AlignHCenter | Qt::AlignVCenter,
|
||||
QStringLiteral( "Refreshing..." ) );
|
||||
painter.drawText( rect(), Qt::AlignHCenter | Qt::AlignVCenter, QStringLiteral( "Refreshing..." ) );
|
||||
painter.fillRect( rect(), QBrush( QColor::fromRgb( 255, 255, 255, 50 ), Qt::SolidPattern ) );
|
||||
}
|
||||
}
|
||||
@@ -143,27 +142,19 @@ VideoSubWindow::VideoSubWindow( enum VideoSubWindowCategories category, QWidget*
|
||||
{
|
||||
// Create a new scroll area inside the sub-window
|
||||
m_pcScrollArea = new QScrollArea;
|
||||
connect( m_pcScrollArea->horizontalScrollBar(), SIGNAL( actionTriggered( int ) ), this,
|
||||
SLOT( updateCurScrollValues() ) );
|
||||
connect( m_pcScrollArea->verticalScrollBar(), SIGNAL( actionTriggered( int ) ), this,
|
||||
SLOT( updateCurScrollValues() ) );
|
||||
connect( m_pcScrollArea->horizontalScrollBar(), SIGNAL( actionTriggered( int ) ), this, SLOT( updateCurScrollValues() ) );
|
||||
connect( m_pcScrollArea->verticalScrollBar(), SIGNAL( actionTriggered( int ) ), this, SLOT( updateCurScrollValues() ) );
|
||||
|
||||
// Create a new interface to show images
|
||||
m_cViewArea = new ViewArea;
|
||||
connect( m_cViewArea, SIGNAL( zoomFactorChanged_byWheel( double, QPoint ) ), this,
|
||||
SLOT( adjustScrollBarByScale( double, QPoint ) ) );
|
||||
connect( m_cViewArea, SIGNAL( zoomFactorChanged_byWheel( double, QPoint ) ), this,
|
||||
SIGNAL( zoomFactorChanged_SWindow( double, QPoint ) ) );
|
||||
connect( m_cViewArea, SIGNAL( zoomFactorChanged_byWheel( double, QPoint ) ), this, SLOT( adjustScrollBarByScale( double, QPoint ) ) );
|
||||
connect( m_cViewArea, SIGNAL( zoomFactorChanged_byWheel( double, QPoint ) ), this, SIGNAL( zoomFactorChanged_SWindow( double, QPoint ) ) );
|
||||
|
||||
connect( m_cViewArea, SIGNAL( scrollBarMoved( QPoint ) ), this,
|
||||
SLOT( adjustScrollBarByOffset( QPoint ) ) );
|
||||
connect( m_cViewArea, SIGNAL( scrollBarMoved( QPoint ) ), this,
|
||||
SIGNAL( scrollBarMoved_SWindow( QPoint ) ) );
|
||||
connect( m_cViewArea, SIGNAL( scrollBarMoved( QPoint ) ), this, SLOT( adjustScrollBarByOffset( QPoint ) ) );
|
||||
connect( m_cViewArea, SIGNAL( scrollBarMoved( QPoint ) ), this, SIGNAL( scrollBarMoved_SWindow( QPoint ) ) );
|
||||
|
||||
connect( m_cViewArea, SIGNAL( selectionChanged( QRect ) ), this,
|
||||
SLOT( updateSelectedArea( QRect ) ) );
|
||||
connect( m_cViewArea, SIGNAL( positionChanged( const QPoint& ) ), this,
|
||||
SLOT( updatePixelValueStatusBar( const QPoint& ) ) );
|
||||
connect( m_cViewArea, SIGNAL( selectionChanged( QRect ) ), this, SLOT( updateSelectedArea( QRect ) ) );
|
||||
connect( m_cViewArea, SIGNAL( positionChanged( const QPoint& ) ), this, SLOT( updatePixelValueStatusBar( const QPoint& ) ) );
|
||||
|
||||
m_pcScrollArea->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
||||
m_pcScrollArea->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
||||
@@ -318,30 +309,29 @@ Bool VideoSubWindow::loadFile( QString cFilename, Bool bForceDialog )
|
||||
|
||||
if( guessFormat( cFilename, Width, Height, InputFormat, BitsPel, Endianness ) || bForceDialog )
|
||||
{
|
||||
if( formatDialog.runConfigureFormatDialog( QFileInfo( cFilename ).fileName(), Width, Height,
|
||||
InputFormat, BitsPel, Endianness,
|
||||
FrameRate ) == QDialog::Rejected )
|
||||
if( formatDialog.runConfigureFormatDialog( QFileInfo( cFilename ).fileName(), Width, Height, InputFormat, BitsPel, Endianness, FrameRate ) ==
|
||||
QDialog::Rejected )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
m_pCurrStream->open( cFilename.toStdString(), Width, Height, InputFormat, BitsPel, Endianness,
|
||||
FrameRate, true );
|
||||
}
|
||||
catch( ... )
|
||||
{
|
||||
if( formatDialog.runConfigureFormatDialog( QFileInfo( cFilename ).fileName(), Width, Height,
|
||||
InputFormat, BitsPel, Endianness,
|
||||
FrameRate ) == QDialog::Rejected )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
m_pCurrStream->open( cFilename.toStdString(), Width, Height, InputFormat, BitsPel, Endianness,
|
||||
FrameRate, true );
|
||||
}
|
||||
// try
|
||||
// {
|
||||
m_pCurrStream->open( cFilename.toStdString(), Width, Height, InputFormat, BitsPel, Endianness, FrameRate, true );
|
||||
// }
|
||||
// catch( ... )
|
||||
// {
|
||||
// if( formatDialog.runConfigureFormatDialog( QFileInfo( cFilename ).fileName(), Width, Height,
|
||||
// InputFormat, BitsPel, Endianness,
|
||||
// FrameRate ) == QDialog::Rejected )
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
// m_pCurrStream->open( cFilename.toStdString(), Width, Height, InputFormat, BitsPel,
|
||||
// Endianness,
|
||||
// FrameRate, true );
|
||||
// }
|
||||
|
||||
m_sStreamInfo.m_cFilename = cFilename;
|
||||
m_sStreamInfo.m_uiWidth = Width;
|
||||
@@ -370,10 +360,8 @@ Bool VideoSubWindow::loadFile( PlaYUVerStreamInfo* streamInfo )
|
||||
m_pCurrStream = new PlaYUVerStream;
|
||||
}
|
||||
|
||||
if( !m_pCurrStream->open( streamInfo->m_cFilename.toStdString(), streamInfo->m_uiWidth,
|
||||
streamInfo->m_uiHeight, streamInfo->m_iPelFormat,
|
||||
streamInfo->m_uiBitsPelPixel, streamInfo->m_iEndianness,
|
||||
streamInfo->m_uiFrameRate, true ) )
|
||||
if( !m_pCurrStream->open( streamInfo->m_cFilename.toStdString(), streamInfo->m_uiWidth, streamInfo->m_uiHeight, streamInfo->m_iPelFormat,
|
||||
streamInfo->m_uiBitsPelPixel, streamInfo->m_iEndianness, streamInfo->m_uiFrameRate, true ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -404,8 +392,7 @@ Void VideoSubWindow::updateVideoWindowInfo()
|
||||
{
|
||||
if( arraySubWindows.at( i )->getWindowName() != getWindowName() )
|
||||
{
|
||||
sourceWindowList.append(
|
||||
QString( "Input %1 - " + arraySubWindows.at( i )->getWindowName() ).arg( i + 1 ) );
|
||||
sourceWindowList.append( QString( "Input %1 - " + arraySubWindows.at( i )->getWindowName() ).arg( i + 1 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -434,12 +421,7 @@ Void VideoSubWindow::updateVideoWindowInfo()
|
||||
}
|
||||
}
|
||||
|
||||
Bool VideoSubWindow::guessFormat( QString filename,
|
||||
UInt& rWidth,
|
||||
UInt& rHeight,
|
||||
Int& rInputFormat,
|
||||
UInt& rBitsPerPixel,
|
||||
Int& rEndianness )
|
||||
Bool VideoSubWindow::guessFormat( QString filename, UInt& rWidth, UInt& rHeight, Int& rInputFormat, UInt& rBitsPerPixel, Int& rEndianness )
|
||||
{
|
||||
std::vector<PlaYUVerStdResolution> stdResList = PlaYUVerStream::stdResolutionSizes();
|
||||
Bool bGuessed = true;
|
||||
@@ -451,13 +433,11 @@ Bool VideoSubWindow::guessFormat( QString filename,
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if( !fileExtension.compare( "yuv" ) || !fileExtension.compare( "rgb" ) ||
|
||||
!fileExtension.compare( "gray" ) )
|
||||
if( !fileExtension.compare( "yuv" ) || !fileExtension.compare( "rgb" ) || !fileExtension.compare( "gray" ) )
|
||||
{
|
||||
bGuessed = false;
|
||||
// Guess pixel format
|
||||
QVector<String> formats_list =
|
||||
QVector<String>::fromStdVector( PlaYUVerFrame::supportedPixelFormatListNames() );
|
||||
QVector<String> formats_list = QVector<String>::fromStdVector( PlaYUVerFrame::supportedPixelFormatListNames() );
|
||||
for( Int i = 0; i < formats_list.size(); i++ )
|
||||
{
|
||||
if( FilenameShort.contains( formats_list.at( i ).c_str(), Qt::CaseInsensitive ) )
|
||||
@@ -486,8 +466,7 @@ Bool VideoSubWindow::guessFormat( QString filename,
|
||||
|
||||
#if( QT_VERSION_PLAYUVER == 5 )
|
||||
// Guess resolution - match %dx%d
|
||||
QRegularExpressionMatch resolutionMatch =
|
||||
QRegularExpression( "_\\d*x\\d*" ).match( FilenameShort );
|
||||
QRegularExpressionMatch resolutionMatch = QRegularExpression( "_\\d*x\\d*" ).match( FilenameShort );
|
||||
if( resolutionMatch.hasMatch() )
|
||||
{
|
||||
QString resolutionString = resolutionMatch.captured( 0 );
|
||||
@@ -518,8 +497,7 @@ Bool VideoSubWindow::guessFormat( QString filename,
|
||||
Int count = 0, module, frame_bytes, match;
|
||||
for( UInt i = 0; i < stdResList.size(); i++ )
|
||||
{
|
||||
frame_bytes = PlaYUVerFrame::getBytesPerFrame( stdResList[i].uiWidth,
|
||||
stdResList[i].uiHeight, rInputFormat, 8 );
|
||||
frame_bytes = PlaYUVerFrame::getBytesPerFrame( stdResList[i].uiWidth, stdResList[i].uiHeight, rInputFormat, 8 );
|
||||
module = uiFileSize % frame_bytes;
|
||||
if( module == 0 )
|
||||
{
|
||||
@@ -641,16 +619,16 @@ Void VideoSubWindow::associateModule( PlaYUVerAppModuleIf* pcModule )
|
||||
|
||||
Bool VideoSubWindow::hasRunningModule()
|
||||
{
|
||||
Bool bRet = false;
|
||||
Bool bRet = false;
|
||||
if( m_pcCurrentDisplayModule )
|
||||
{
|
||||
bRet |= m_pcCurrentDisplayModule->isRunning();
|
||||
bRet |= m_pcCurrentDisplayModule->isRunning();
|
||||
}
|
||||
for( Int i = 0; i < m_apcCurrentModule.size() && !bRet; i++ )
|
||||
for( Int i = 0; i < m_apcCurrentModule.size() && !bRet; i++ )
|
||||
{
|
||||
bRet |= m_apcCurrentModule.at( i )->isRunning();
|
||||
bRet |= m_apcCurrentModule.at( i )->isRunning();
|
||||
}
|
||||
return bRet;
|
||||
return bRet;
|
||||
}
|
||||
|
||||
Void VideoSubWindow::setFillWindow( Bool bFlag )
|
||||
@@ -717,8 +695,7 @@ Bool VideoSubWindow::goToNextFrame( Bool bThreaded )
|
||||
if( bThreaded )
|
||||
{
|
||||
refreshFrame();
|
||||
m_cReadResult =
|
||||
QtConcurrent::run( m_pCurrStream, &PlaYUVerStream::readNextFrameFillRGBBuffer );
|
||||
m_cReadResult = QtConcurrent::run( m_pCurrStream, &PlaYUVerStream::readNextFrameFillRGBBuffer );
|
||||
}
|
||||
else
|
||||
#endif
|
||||
@@ -738,8 +715,7 @@ Bool VideoSubWindow::save( QString filename )
|
||||
PlaYUVerFrame* saveFrame = m_pcCurrFrame;
|
||||
if( m_cSelectedArea.isValid() )
|
||||
{
|
||||
saveFrame = new PlaYUVerFrame( m_pcCurrFrame, m_cSelectedArea.x(), m_cSelectedArea.y(),
|
||||
m_cSelectedArea.width(), m_cSelectedArea.height() );
|
||||
saveFrame = new PlaYUVerFrame( m_pcCurrFrame, m_cSelectedArea.x(), m_cSelectedArea.y(), m_cSelectedArea.width(), m_cSelectedArea.height() );
|
||||
}
|
||||
if( !saveFrame )
|
||||
{
|
||||
@@ -815,8 +791,7 @@ Void VideoSubWindow::stop()
|
||||
|
||||
QSize VideoSubWindow::getScrollSize()
|
||||
{
|
||||
return QSize( m_pcScrollArea->viewport()->size().width() - 5,
|
||||
m_pcScrollArea->viewport()->size().height() - 5 );
|
||||
return QSize( m_pcScrollArea->viewport()->size().width() - 5, m_pcScrollArea->viewport()->size().height() - 5 );
|
||||
}
|
||||
|
||||
Void VideoSubWindow::adjustScrollBarByOffset( QPoint Offset )
|
||||
@@ -857,8 +832,7 @@ Void VideoSubWindow::adjustScrollBarByScale( Double scale, QPoint center )
|
||||
scrollBarH = m_pcScrollArea->horizontalScrollBar();
|
||||
if( center.isNull() )
|
||||
{
|
||||
m_cCurrScroll.setX(
|
||||
int( scale * cLastScroll.x() + ( ( scale - 1 ) * scrollBarH->pageStep() / 2 ) ) );
|
||||
m_cCurrScroll.setX( int( scale * cLastScroll.x() + ( ( scale - 1 ) * scrollBarH->pageStep() / 2 ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -874,8 +848,7 @@ Void VideoSubWindow::adjustScrollBarByScale( Double scale, QPoint center )
|
||||
scrollBarV = m_pcScrollArea->verticalScrollBar();
|
||||
if( center.isNull() )
|
||||
{
|
||||
m_cCurrScroll.setY(
|
||||
int( scale * cLastScroll.y() + ( ( scale - 1 ) * scrollBarV->pageStep() / 2 ) ) );
|
||||
m_cCurrScroll.setY( int( scale * cLastScroll.y() + ( ( scale - 1 ) * scrollBarV->pageStep() / 2 ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1008,19 +981,13 @@ Void VideoSubWindow::updatePixelValueStatusBar( const QPoint& pos )
|
||||
if( ColorSpace == PlaYUVerPixel::COLOR_YUV )
|
||||
{
|
||||
sPixelValue = m_pcCurrFrame->getPixelValue( pos.x(), pos.y() );
|
||||
strStatus.append( QString( "Y: %1 U: %2 V: %3" )
|
||||
.arg( sPixelValue.Y() )
|
||||
.arg( sPixelValue.Cb() )
|
||||
.arg( sPixelValue.Cr() ) );
|
||||
strStatus.append( QString( "Y: %1 U: %2 V: %3" ).arg( sPixelValue.Y() ).arg( sPixelValue.Cb() ).arg( sPixelValue.Cr() ) );
|
||||
}
|
||||
|
||||
if( ( ColorSpace == PlaYUVerPixel::COLOR_RGB ) )
|
||||
{
|
||||
sPixelValue = m_pcCurrFrame->getPixelValue( pos.x(), pos.y() );
|
||||
strStatus.append( QString( "R: %1 G: %2 B: %3" )
|
||||
.arg( sPixelValue.R() )
|
||||
.arg( sPixelValue.G() )
|
||||
.arg( sPixelValue.B() ) );
|
||||
strStatus.append( QString( "R: %1 G: %2 B: %3" ).arg( sPixelValue.R() ).arg( sPixelValue.G() ).arg( sPixelValue.B() ) );
|
||||
}
|
||||
emit updateStatusBar( strStatus );
|
||||
}
|
||||
|
||||
@@ -186,12 +186,7 @@ private:
|
||||
Void refreshFrameOperation();
|
||||
Bool goToNextFrame( Bool bThreaded = false );
|
||||
|
||||
static Bool guessFormat( QString filename,
|
||||
UInt& rWidth,
|
||||
UInt& rHeight,
|
||||
Int& rInputFormat,
|
||||
UInt& rBitsPerPixel,
|
||||
Int& rEndianness );
|
||||
static Bool guessFormat( QString filename, UInt& rWidth, UInt& rHeight, Int& rInputFormat, UInt& rBitsPerPixel, Int& rEndianness );
|
||||
|
||||
Bool hasRunningModule();
|
||||
|
||||
|
||||
+5
-10
@@ -72,8 +72,7 @@ Void ViewArea::setImage( PlaYUVerFrame* pcFrame )
|
||||
m_pcCurrFrame = pcFrame;
|
||||
m_uiPixelHalfScale = 1 << ( m_pcCurrFrame->getBitsPel() - 1 );
|
||||
m_pcCurrFrame->fillRGBBuffer();
|
||||
QImage qimg = QImage( m_pcCurrFrame->getRGBBuffer(), m_pcCurrFrame->getWidth(),
|
||||
m_pcCurrFrame->getHeight(), QImage::Format_RGB32 );
|
||||
QImage qimg = QImage( m_pcCurrFrame->getRGBBuffer(), m_pcCurrFrame->getWidth(), m_pcCurrFrame->getHeight(), QImage::Format_RGB32 );
|
||||
setImage( QPixmap::fromImage( qimg ) );
|
||||
}
|
||||
|
||||
@@ -439,8 +438,7 @@ Void ViewArea::paintEvent( QPaintEvent* event )
|
||||
// That gives us the part of the pixmap that has actually been exposed.
|
||||
// See:
|
||||
// http://blog.qt.digia.com/blog/2006/05/13/fast-transformed-pixmapimage-drawing/
|
||||
QRect exposedRect =
|
||||
paInter.worldTransform().inverted().mapRect( event->rect() ).adjusted( -1, -1, 1, 1 );
|
||||
QRect exposedRect = paInter.worldTransform().inverted().mapRect( event->rect() ).adjusted( -1, -1, 1, 1 );
|
||||
// Draw the pixmap.
|
||||
paInter.drawPixmap( exposedRect, m_pixmap, exposedRect );
|
||||
|
||||
@@ -514,8 +512,7 @@ Void ViewArea::paintEvent( QPaintEvent* event )
|
||||
paInter.setPen( QColor( Qt::black ) );
|
||||
|
||||
paInter.drawText( pixelRect, Qt::AlignCenter,
|
||||
"Y: " + QString::number( sPixelValue.Y() ) + "\n" +
|
||||
"U: " + QString::number( sPixelValue.Cb() ) + "\n" +
|
||||
"Y: " + QString::number( sPixelValue.Y() ) + "\n" + "U: " + QString::number( sPixelValue.Cb() ) + "\n" +
|
||||
"V: " + QString::number( sPixelValue.Cr() ) );
|
||||
}
|
||||
if( frFormat == PlaYUVerPixel::COLOR_GRAY )
|
||||
@@ -527,8 +524,7 @@ Void ViewArea::paintEvent( QPaintEvent* event )
|
||||
else
|
||||
paInter.setPen( QColor( Qt::black ) );
|
||||
|
||||
paInter.drawText( pixelRect, Qt::AlignCenter,
|
||||
"Y: " + QString::number( sPixelValue.Y() ) );
|
||||
paInter.drawText( pixelRect, Qt::AlignCenter, "Y: " + QString::number( sPixelValue.Y() ) );
|
||||
}
|
||||
|
||||
if( ( frFormat == PlaYUVerPixel::COLOR_RGB ) )
|
||||
@@ -541,8 +537,7 @@ Void ViewArea::paintEvent( QPaintEvent* event )
|
||||
paInter.setPen( QColor( Qt::black ) );
|
||||
|
||||
paInter.drawText( pixelRect, Qt::AlignCenter,
|
||||
"R: " + QString::number( sPixelValue.R() ) + "\n" +
|
||||
"G: " + QString::number( sPixelValue.G() ) + "\n" +
|
||||
"R: " + QString::number( sPixelValue.R() ) + "\n" + "G: " + QString::number( sPixelValue.G() ) + "\n" +
|
||||
"B: " + QString::number( sPixelValue.B() ) );
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+606
-1272
File diff suppressed because it is too large.
Load diff
Vendored
+58
-185
@@ -380,10 +380,7 @@ public:
|
||||
QCPScatterStyle( ScatterShape shape, const QColor& color, const QColor& fill, double size );
|
||||
QCPScatterStyle( ScatterShape shape, const QPen& pen, const QBrush& brush, double size );
|
||||
QCPScatterStyle( const QPixmap& pixmap );
|
||||
QCPScatterStyle( const QPainterPath& customPath,
|
||||
const QPen& pen,
|
||||
const QBrush& brush = Qt::NoBrush,
|
||||
double size = 6 );
|
||||
QCPScatterStyle( const QPainterPath& customPath, const QPen& pen, const QBrush& brush = Qt::NoBrush, double size = 6 );
|
||||
|
||||
// getters:
|
||||
double size() const { return mSize; }
|
||||
@@ -578,19 +575,14 @@ protected:
|
||||
virtual void applyDefaultAntialiasingHint( QCPPainter* painter ) const = 0;
|
||||
virtual void draw( QCPPainter* painter ) = 0;
|
||||
// events:
|
||||
virtual void selectEvent( QMouseEvent* event,
|
||||
bool additive,
|
||||
const QVariant& details,
|
||||
bool* selectionStateChanged );
|
||||
virtual void selectEvent( QMouseEvent* event, bool additive, const QVariant& details, bool* selectionStateChanged );
|
||||
virtual void deselectEvent( bool* selectionStateChanged );
|
||||
|
||||
// non-property methods:
|
||||
void initializeParentPlot( QCustomPlot* parentPlot );
|
||||
void setParentLayerable( QCPLayerable* parentLayerable );
|
||||
bool moveToLayer( QCPLayer* layer, bool prepend );
|
||||
void applyAntialiasingHint( QCPPainter* painter,
|
||||
bool localAntialiased,
|
||||
QCP::AntialiasedElement overrideElement ) const;
|
||||
void applyAntialiasingHint( QCPPainter* painter, bool localAntialiased, QCP::AntialiasedElement overrideElement ) const;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY( QCPLayerable )
|
||||
@@ -748,10 +740,7 @@ public:
|
||||
~QCPMarginGroup();
|
||||
|
||||
// non-virtual methods:
|
||||
QList<QCPLayoutElement*> elements( QCP::MarginSide side ) const
|
||||
{
|
||||
return mChildren.value( side );
|
||||
}
|
||||
QList<QCPLayoutElement*> elements( QCP::MarginSide side ) const { return mChildren.value( side ); }
|
||||
bool isEmpty() const;
|
||||
void clear();
|
||||
|
||||
@@ -814,10 +803,7 @@ public:
|
||||
QCP::MarginSides autoMargins() const { return mAutoMargins; }
|
||||
QSize minimumSize() const { return mMinimumSize; }
|
||||
QSize maximumSize() const { return mMaximumSize; }
|
||||
QCPMarginGroup* marginGroup( QCP::MarginSide side ) const
|
||||
{
|
||||
return mMarginGroups.value( side, (QCPMarginGroup*)0 );
|
||||
}
|
||||
QCPMarginGroup* marginGroup( QCP::MarginSide side ) const { return mMarginGroups.value( side, (QCPMarginGroup*)0 ); }
|
||||
QHash<QCP::MarginSide, QCPMarginGroup*> marginGroups() const { return mMarginGroups; }
|
||||
// setters:
|
||||
void setOuterRect( const QRect& rect );
|
||||
@@ -899,10 +885,7 @@ protected:
|
||||
void sizeConstraintsChanged() const;
|
||||
void adoptElement( QCPLayoutElement* el );
|
||||
void releaseElement( QCPLayoutElement* el );
|
||||
QVector<int> getSectionSizes( QVector<int> maxSizes,
|
||||
QVector<int> minSizes,
|
||||
QVector<double> stretchFactors,
|
||||
int totalSize ) const;
|
||||
QVector<int> getSectionSizes( QVector<int> maxSizes, QVector<int> minSizes, QVector<double> stretchFactors, int totalSize ) const;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY( QCPLayout )
|
||||
@@ -915,8 +898,7 @@ class QCP_LIB_DECL QCPLayoutGrid : public QCPLayout
|
||||
/// \cond INCLUDE_QPROPERTIES
|
||||
Q_PROPERTY( int rowCount READ rowCount )
|
||||
Q_PROPERTY( int columnCount READ columnCount )
|
||||
Q_PROPERTY(
|
||||
QList<double> columnStretchFactors READ columnStretchFactors WRITE setColumnStretchFactors )
|
||||
Q_PROPERTY( QList<double> columnStretchFactors READ columnStretchFactors WRITE setColumnStretchFactors )
|
||||
Q_PROPERTY( QList<double> rowStretchFactors READ rowStretchFactors WRITE setRowStretchFactors )
|
||||
Q_PROPERTY( int columnSpacing READ columnSpacing WRITE setColumnSpacing )
|
||||
Q_PROPERTY( int rowSpacing READ rowSpacing WRITE setRowSpacing )
|
||||
@@ -1192,15 +1174,11 @@ class QCP_LIB_DECL QCPAxis : public QCPLayerable
|
||||
Q_PROPERTY( int labelPadding READ labelPadding WRITE setLabelPadding )
|
||||
Q_PROPERTY( int padding READ padding WRITE setPadding )
|
||||
Q_PROPERTY( int offset READ offset WRITE setOffset )
|
||||
Q_PROPERTY( SelectableParts selectedParts READ selectedParts WRITE setSelectedParts NOTIFY
|
||||
selectionChanged )
|
||||
Q_PROPERTY( SelectableParts selectableParts READ selectableParts WRITE setSelectableParts NOTIFY
|
||||
selectableChanged )
|
||||
Q_PROPERTY(
|
||||
QFont selectedTickLabelFont READ selectedTickLabelFont WRITE setSelectedTickLabelFont )
|
||||
Q_PROPERTY( SelectableParts selectedParts READ selectedParts WRITE setSelectedParts NOTIFY selectionChanged )
|
||||
Q_PROPERTY( SelectableParts selectableParts READ selectableParts WRITE setSelectableParts NOTIFY selectableChanged )
|
||||
Q_PROPERTY( QFont selectedTickLabelFont READ selectedTickLabelFont WRITE setSelectedTickLabelFont )
|
||||
Q_PROPERTY( QFont selectedLabelFont READ selectedLabelFont WRITE setSelectedLabelFont )
|
||||
Q_PROPERTY(
|
||||
QColor selectedTickLabelColor READ selectedTickLabelColor WRITE setSelectedTickLabelColor )
|
||||
Q_PROPERTY( QColor selectedTickLabelColor READ selectedTickLabelColor WRITE setSelectedTickLabelColor )
|
||||
Q_PROPERTY( QColor selectedLabelColor READ selectedLabelColor WRITE setSelectedLabelColor )
|
||||
Q_PROPERTY( QPen selectedBasePen READ selectedBasePen WRITE setSelectedBasePen )
|
||||
Q_PROPERTY( QPen selectedTickPen READ selectedTickPen WRITE setSelectedTickPen )
|
||||
@@ -1409,10 +1387,7 @@ public:
|
||||
QList<QCPAbstractItem*> items() const;
|
||||
|
||||
static AxisType marginSideToAxisType( QCP::MarginSide side );
|
||||
static Qt::Orientation orientation( AxisType type )
|
||||
{
|
||||
return type == atBottom || type == atTop ? Qt::Horizontal : Qt::Vertical;
|
||||
}
|
||||
static Qt::Orientation orientation( AxisType type ) { return type == atBottom || type == atTop ? Qt::Horizontal : Qt::Vertical; }
|
||||
static AxisType opposite( AxisType type );
|
||||
|
||||
signals:
|
||||
@@ -1488,10 +1463,7 @@ protected:
|
||||
virtual void draw( QCPPainter* painter );
|
||||
virtual QCP::Interaction selectionCategory() const;
|
||||
// events:
|
||||
virtual void selectEvent( QMouseEvent* event,
|
||||
bool additive,
|
||||
const QVariant& details,
|
||||
bool* selectionStateChanged );
|
||||
virtual void selectEvent( QMouseEvent* event, bool additive, const QVariant& details, bool* selectionStateChanged );
|
||||
virtual void deselectEvent( bool* selectionStateChanged );
|
||||
|
||||
// non-virtual methods:
|
||||
@@ -1576,20 +1548,11 @@ protected:
|
||||
|
||||
virtual QByteArray generateLabelParameterHash() const;
|
||||
|
||||
virtual void placeTickLabel( QCPPainter* painter,
|
||||
double position,
|
||||
int distanceToAxis,
|
||||
const QString& text,
|
||||
QSize* tickLabelsSize );
|
||||
virtual void drawTickLabel( QCPPainter* painter,
|
||||
double x,
|
||||
double y,
|
||||
const TickLabelData& labelData ) const;
|
||||
virtual void placeTickLabel( QCPPainter* painter, double position, int distanceToAxis, const QString& text, QSize* tickLabelsSize );
|
||||
virtual void drawTickLabel( QCPPainter* painter, double x, double y, const TickLabelData& labelData ) const;
|
||||
virtual TickLabelData getTickLabelData( const QFont& font, const QString& text ) const;
|
||||
virtual QPointF getTickLabelDrawOffset( const TickLabelData& labelData ) const;
|
||||
virtual void getMaxTickLabelSize( const QFont& font,
|
||||
const QString& text,
|
||||
QSize* tickLabelsSize ) const;
|
||||
virtual void getMaxTickLabelSize( const QFont& font, const QString& text, QSize* tickLabelsSize ) const;
|
||||
};
|
||||
|
||||
class QCP_LIB_DECL QCPAbstractPlottable : public QCPLayerable
|
||||
@@ -1641,9 +1604,7 @@ public:
|
||||
|
||||
// introduced virtual methods:
|
||||
virtual void clearData() = 0;
|
||||
virtual double selectTest( const QPointF& pos,
|
||||
bool onlySelectable,
|
||||
QVariant* details = 0 ) const = 0;
|
||||
virtual double selectTest( const QPointF& pos, bool onlySelectable, QVariant* details = 0 ) const = 0;
|
||||
virtual bool addToLegend();
|
||||
virtual bool removeFromLegend() const;
|
||||
|
||||
@@ -1684,10 +1645,7 @@ protected:
|
||||
virtual QCP::Interaction selectionCategory() const;
|
||||
void applyDefaultAntialiasingHint( QCPPainter* painter ) const;
|
||||
// events:
|
||||
virtual void selectEvent( QMouseEvent* event,
|
||||
bool additive,
|
||||
const QVariant& details,
|
||||
bool* selectionStateChanged );
|
||||
virtual void selectEvent( QMouseEvent* event, bool additive, const QVariant& details, bool* selectionStateChanged );
|
||||
virtual void deselectEvent( bool* selectionStateChanged );
|
||||
|
||||
// introduced virtual methods:
|
||||
@@ -1718,10 +1676,7 @@ private:
|
||||
class QCP_LIB_DECL QCPItemAnchor
|
||||
{
|
||||
public:
|
||||
QCPItemAnchor( QCustomPlot* parentPlot,
|
||||
QCPAbstractItem* parentItem,
|
||||
const QString name,
|
||||
int anchorId = -1 );
|
||||
QCPItemAnchor( QCustomPlot* parentPlot, QCPAbstractItem* parentItem, const QString name, int anchorId = -1 );
|
||||
virtual ~QCPItemAnchor();
|
||||
|
||||
// getters:
|
||||
@@ -1851,9 +1806,7 @@ public:
|
||||
Q_SLOT void setSelected( bool selected );
|
||||
|
||||
// reimplemented virtual methods:
|
||||
virtual double selectTest( const QPointF& pos,
|
||||
bool onlySelectable,
|
||||
QVariant* details = 0 ) const = 0;
|
||||
virtual double selectTest( const QPointF& pos, bool onlySelectable, QVariant* details = 0 ) const = 0;
|
||||
|
||||
// non-virtual methods:
|
||||
QList<QCPItemPosition*> positions() const { return mPositions; }
|
||||
@@ -1880,10 +1833,7 @@ protected:
|
||||
virtual void applyDefaultAntialiasingHint( QCPPainter* painter ) const;
|
||||
virtual void draw( QCPPainter* painter ) = 0;
|
||||
// events:
|
||||
virtual void selectEvent( QMouseEvent* event,
|
||||
bool additive,
|
||||
const QVariant& details,
|
||||
bool* selectionStateChanged );
|
||||
virtual void selectEvent( QMouseEvent* event, bool additive, const QVariant& details, bool* selectionStateChanged );
|
||||
virtual void deselectEvent( bool* selectionStateChanged );
|
||||
|
||||
// introduced virtual methods:
|
||||
@@ -1909,15 +1859,12 @@ class QCP_LIB_DECL QCustomPlot : public QWidget
|
||||
Q_PROPERTY( QRect viewport READ viewport WRITE setViewport )
|
||||
Q_PROPERTY( QPixmap background READ background WRITE setBackground )
|
||||
Q_PROPERTY( bool backgroundScaled READ backgroundScaled WRITE setBackgroundScaled )
|
||||
Q_PROPERTY( Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode WRITE
|
||||
setBackgroundScaledMode )
|
||||
Q_PROPERTY( Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode WRITE setBackgroundScaledMode )
|
||||
Q_PROPERTY( QCPLayoutGrid* plotLayout READ plotLayout )
|
||||
Q_PROPERTY( bool autoAddPlottableToLegend READ autoAddPlottableToLegend WRITE
|
||||
setAutoAddPlottableToLegend )
|
||||
Q_PROPERTY( bool autoAddPlottableToLegend READ autoAddPlottableToLegend WRITE setAutoAddPlottableToLegend )
|
||||
Q_PROPERTY( int selectionTolerance READ selectionTolerance WRITE setSelectionTolerance )
|
||||
Q_PROPERTY( bool noAntialiasingOnDrag READ noAntialiasingOnDrag WRITE setNoAntialiasingOnDrag )
|
||||
Q_PROPERTY( Qt::KeyboardModifier multiSelectModifier READ multiSelectModifier WRITE
|
||||
setMultiSelectModifier )
|
||||
Q_PROPERTY( Qt::KeyboardModifier multiSelectModifier READ multiSelectModifier WRITE setMultiSelectModifier )
|
||||
/// \endcond
|
||||
public:
|
||||
/*!
|
||||
@@ -1973,17 +1920,14 @@ public:
|
||||
// setters:
|
||||
void setViewport( const QRect& rect );
|
||||
void setBackground( const QPixmap& pm );
|
||||
void setBackground( const QPixmap& pm,
|
||||
bool scaled,
|
||||
Qt::AspectRatioMode mode = Qt::KeepAspectRatioByExpanding );
|
||||
void setBackground( const QPixmap& pm, bool scaled, Qt::AspectRatioMode mode = Qt::KeepAspectRatioByExpanding );
|
||||
void setBackground( const QBrush& brush );
|
||||
void setBackgroundScaled( bool scaled );
|
||||
void setBackgroundScaledMode( Qt::AspectRatioMode mode );
|
||||
void setAntialiasedElements( const QCP::AntialiasedElements& antialiasedElements );
|
||||
void setAntialiasedElement( QCP::AntialiasedElement antialiasedElement, bool enabled = true );
|
||||
void setNotAntialiasedElements( const QCP::AntialiasedElements& notAntialiasedElements );
|
||||
void setNotAntialiasedElement( QCP::AntialiasedElement notAntialiasedElement,
|
||||
bool enabled = true );
|
||||
void setNotAntialiasedElement( QCP::AntialiasedElement notAntialiasedElement, bool enabled = true );
|
||||
void setAutoAddPlottableToLegend( bool on );
|
||||
void setInteractions( const QCP::Interactions& interactions );
|
||||
void setInteraction( const QCP::Interaction& interaction, bool enabled = true );
|
||||
@@ -2035,9 +1979,7 @@ public:
|
||||
bool setCurrentLayer( const QString& name );
|
||||
bool setCurrentLayer( QCPLayer* layer );
|
||||
int layerCount() const;
|
||||
bool addLayer( const QString& name,
|
||||
QCPLayer* otherLayer = 0,
|
||||
LayerInsertMode insertMode = limAbove );
|
||||
bool addLayer( const QString& name, QCPLayer* otherLayer = 0, LayerInsertMode insertMode = limAbove );
|
||||
bool removeLayer( QCPLayer* layer );
|
||||
bool moveLayer( QCPLayer* layer, QCPLayer* otherLayer, LayerInsertMode insertMode = limAbove );
|
||||
|
||||
@@ -2058,23 +2000,10 @@ public:
|
||||
int height = 0,
|
||||
const QString& pdfCreator = "",
|
||||
const QString& pdfTitle = "" );
|
||||
bool savePng( const QString& fileName,
|
||||
int width = 0,
|
||||
int height = 0,
|
||||
double scale = 1.0,
|
||||
int quality = -1 );
|
||||
bool saveJpg( const QString& fileName,
|
||||
int width = 0,
|
||||
int height = 0,
|
||||
double scale = 1.0,
|
||||
int quality = -1 );
|
||||
bool savePng( const QString& fileName, int width = 0, int height = 0, double scale = 1.0, int quality = -1 );
|
||||
bool saveJpg( const QString& fileName, int width = 0, int height = 0, double scale = 1.0, int quality = -1 );
|
||||
bool saveBmp( const QString& fileName, int width = 0, int height = 0, double scale = 1.0 );
|
||||
bool saveRastered( const QString& fileName,
|
||||
int width,
|
||||
int height,
|
||||
double scale,
|
||||
const char* format,
|
||||
int quality = -1 );
|
||||
bool saveRastered( const QString& fileName, int width, int height, double scale, const char* format, int quality = -1 );
|
||||
QPixmap toPixmap( int width = 0, int height = 0, double scale = 1.0 );
|
||||
void toPainter( QCPPainter* painter, int width = 0, int height = 0 );
|
||||
Q_SLOT void replot( QCustomPlot::RefreshPriority refreshPriority = QCustomPlot::rpHint );
|
||||
@@ -2151,9 +2080,7 @@ protected:
|
||||
|
||||
// non-virtual methods:
|
||||
void updateLayerIndices() const;
|
||||
QCPLayerable* layerableAt( const QPointF& pos,
|
||||
bool onlySelectable,
|
||||
QVariant* selectionDetails = 0 ) const;
|
||||
QCPLayerable* layerableAt( const QPointF& pos, bool onlySelectable, QVariant* selectionDetails = 0 ) const;
|
||||
void drawBackground( QCPPainter* painter );
|
||||
|
||||
friend class QCPLegend;
|
||||
@@ -2248,12 +2175,7 @@ public:
|
||||
void setPeriodic( bool enabled );
|
||||
|
||||
// non-property methods:
|
||||
void colorize( const double* data,
|
||||
const QCPRange& range,
|
||||
QRgb* scanLine,
|
||||
int n,
|
||||
int dataIndexFactor = 1,
|
||||
bool logarithmic = false );
|
||||
void colorize( const double* data, const QCPRange& range, QRgb* scanLine, int n, int dataIndexFactor = 1, bool logarithmic = false );
|
||||
QRgb color( double position, const QCPRange& range, bool logarithmic = false );
|
||||
void loadPreset( GradientPreset preset );
|
||||
void clearColorStops();
|
||||
@@ -2279,8 +2201,7 @@ class QCP_LIB_DECL QCPAxisRect : public QCPLayoutElement
|
||||
/// \cond INCLUDE_QPROPERTIES
|
||||
Q_PROPERTY( QPixmap background READ background WRITE setBackground )
|
||||
Q_PROPERTY( bool backgroundScaled READ backgroundScaled WRITE setBackgroundScaled )
|
||||
Q_PROPERTY( Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode WRITE
|
||||
setBackgroundScaledMode )
|
||||
Q_PROPERTY( Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode WRITE setBackgroundScaledMode )
|
||||
Q_PROPERTY( Qt::Orientations rangeDrag READ rangeDrag WRITE setRangeDrag )
|
||||
Q_PROPERTY( Qt::Orientations rangeZoom READ rangeZoom WRITE setRangeZoom )
|
||||
/// \endcond
|
||||
@@ -2300,9 +2221,7 @@ public:
|
||||
|
||||
// setters:
|
||||
void setBackground( const QPixmap& pm );
|
||||
void setBackground( const QPixmap& pm,
|
||||
bool scaled,
|
||||
Qt::AspectRatioMode mode = Qt::KeepAspectRatioByExpanding );
|
||||
void setBackground( const QPixmap& pm, bool scaled, Qt::AspectRatioMode mode = Qt::KeepAspectRatioByExpanding );
|
||||
void setBackground( const QBrush& brush );
|
||||
void setBackgroundScaled( bool scaled );
|
||||
void setBackgroundScaledMode( Qt::AspectRatioMode mode );
|
||||
@@ -2435,10 +2354,7 @@ protected:
|
||||
virtual QRect clipRect() const;
|
||||
virtual void draw( QCPPainter* painter ) = 0;
|
||||
// events:
|
||||
virtual void selectEvent( QMouseEvent* event,
|
||||
bool additive,
|
||||
const QVariant& details,
|
||||
bool* selectionStateChanged );
|
||||
virtual void selectEvent( QMouseEvent* event, bool additive, const QVariant& details, bool* selectionStateChanged );
|
||||
virtual void deselectEvent( bool* selectionStateChanged );
|
||||
|
||||
private:
|
||||
@@ -2481,10 +2397,8 @@ class QCP_LIB_DECL QCPLegend : public QCPLayoutGrid
|
||||
Q_PROPERTY( QSize iconSize READ iconSize WRITE setIconSize )
|
||||
Q_PROPERTY( int iconTextPadding READ iconTextPadding WRITE setIconTextPadding )
|
||||
Q_PROPERTY( QPen iconBorderPen READ iconBorderPen WRITE setIconBorderPen )
|
||||
Q_PROPERTY( SelectableParts selectableParts READ selectableParts WRITE setSelectableParts NOTIFY
|
||||
selectionChanged )
|
||||
Q_PROPERTY( SelectableParts selectedParts READ selectedParts WRITE setSelectedParts NOTIFY
|
||||
selectableChanged )
|
||||
Q_PROPERTY( SelectableParts selectableParts READ selectableParts WRITE setSelectableParts NOTIFY selectionChanged )
|
||||
Q_PROPERTY( SelectableParts selectedParts READ selectedParts WRITE setSelectedParts NOTIFY selectableChanged )
|
||||
Q_PROPERTY( QPen selectedBorderPen READ selectedBorderPen WRITE setSelectedBorderPen )
|
||||
Q_PROPERTY( QPen selectedIconBorderPen READ selectedIconBorderPen WRITE setSelectedIconBorderPen )
|
||||
Q_PROPERTY( QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush )
|
||||
@@ -2583,10 +2497,7 @@ protected:
|
||||
virtual void applyDefaultAntialiasingHint( QCPPainter* painter ) const;
|
||||
virtual void draw( QCPPainter* painter );
|
||||
// events:
|
||||
virtual void selectEvent( QMouseEvent* event,
|
||||
bool additive,
|
||||
const QVariant& details,
|
||||
bool* selectionStateChanged );
|
||||
virtual void selectEvent( QMouseEvent* event, bool additive, const QVariant& details, bool* selectionStateChanged );
|
||||
virtual void deselectEvent( bool* selectionStateChanged );
|
||||
|
||||
// non-virtual methods:
|
||||
@@ -2658,10 +2569,7 @@ protected:
|
||||
virtual QSize minimumSizeHint() const;
|
||||
virtual QSize maximumSizeHint() const;
|
||||
// events:
|
||||
virtual void selectEvent( QMouseEvent* event,
|
||||
bool additive,
|
||||
const QVariant& details,
|
||||
bool* selectionStateChanged );
|
||||
virtual void selectEvent( QMouseEvent* event, bool additive, const QVariant& details, bool* selectionStateChanged );
|
||||
virtual void deselectEvent( bool* selectionStateChanged );
|
||||
|
||||
// non-virtual methods:
|
||||
@@ -2703,8 +2611,7 @@ class QCP_LIB_DECL QCPColorScale : public QCPLayoutElement
|
||||
/// \cond INCLUDE_QPROPERTIES
|
||||
Q_PROPERTY( QCPAxis::AxisType type READ type WRITE setType )
|
||||
Q_PROPERTY( QCPRange dataRange READ dataRange WRITE setDataRange NOTIFY dataRangeChanged )
|
||||
Q_PROPERTY( QCPAxis::ScaleType dataScaleType READ dataScaleType WRITE setDataScaleType NOTIFY
|
||||
dataScaleTypeChanged )
|
||||
Q_PROPERTY( QCPAxis::ScaleType dataScaleType READ dataScaleType WRITE setDataScaleType NOTIFY dataScaleTypeChanged )
|
||||
Q_PROPERTY( QCPColorGradient gradient READ gradient WRITE setGradient NOTIFY gradientChanged )
|
||||
Q_PROPERTY( QString label READ label WRITE setLabel )
|
||||
Q_PROPERTY( int barWidth READ barWidth WRITE setBarWidth )
|
||||
@@ -2872,16 +2779,12 @@ public:
|
||||
// setters:
|
||||
void setData( QCPDataMap* data, bool copy = false );
|
||||
void setData( const QVector<double>& key, const QVector<double>& value );
|
||||
void setDataKeyError( const QVector<double>& key,
|
||||
const QVector<double>& value,
|
||||
const QVector<double>& keyError );
|
||||
void setDataKeyError( const QVector<double>& key, const QVector<double>& value, const QVector<double>& keyError );
|
||||
void setDataKeyError( const QVector<double>& key,
|
||||
const QVector<double>& value,
|
||||
const QVector<double>& keyErrorMinus,
|
||||
const QVector<double>& keyErrorPlus );
|
||||
void setDataValueError( const QVector<double>& key,
|
||||
const QVector<double>& value,
|
||||
const QVector<double>& valueError );
|
||||
void setDataValueError( const QVector<double>& key, const QVector<double>& value, const QVector<double>& valueError );
|
||||
void setDataValueError( const QVector<double>& key,
|
||||
const QVector<double>& value,
|
||||
const QVector<double>& valueErrorMinus,
|
||||
@@ -2945,11 +2848,9 @@ protected:
|
||||
virtual void drawLegendIcon( QCPPainter* painter, const QRectF& rect ) const;
|
||||
virtual QCPRange getKeyRange( bool& foundRange, SignDomain inSignDomain = sdBoth ) const;
|
||||
virtual QCPRange getValueRange( bool& foundRange, SignDomain inSignDomain = sdBoth ) const;
|
||||
virtual QCPRange getKeyRange( bool& foundRange,
|
||||
SignDomain inSignDomain,
|
||||
virtual QCPRange getKeyRange( bool& foundRange, SignDomain inSignDomain,
|
||||
bool includeErrors ) const; // overloads base class interface
|
||||
virtual QCPRange getValueRange( bool& foundRange,
|
||||
SignDomain inSignDomain,
|
||||
virtual QCPRange getValueRange( bool& foundRange, SignDomain inSignDomain,
|
||||
bool includeErrors ) const; // overloads base class interface
|
||||
|
||||
// introduced virtual methods:
|
||||
@@ -2965,15 +2866,11 @@ protected:
|
||||
void getLinePlotData( QVector<QPointF>* linePixelData, QVector<QCPData>* scatterData ) const;
|
||||
void getStepLeftPlotData( QVector<QPointF>* linePixelData, QVector<QCPData>* scatterData ) const;
|
||||
void getStepRightPlotData( QVector<QPointF>* linePixelData, QVector<QCPData>* scatterData ) const;
|
||||
void getStepCenterPlotData( QVector<QPointF>* linePixelData,
|
||||
QVector<QCPData>* scatterData ) const;
|
||||
void getStepCenterPlotData( QVector<QPointF>* linePixelData, QVector<QCPData>* scatterData ) const;
|
||||
void getImpulsePlotData( QVector<QPointF>* linePixelData, QVector<QCPData>* scatterData ) const;
|
||||
void drawError( QCPPainter* painter, double x, double y, const QCPData& data ) const;
|
||||
void getVisibleDataBounds( QCPDataMap::const_iterator& lower,
|
||||
QCPDataMap::const_iterator& upper ) const;
|
||||
int countDataInBounds( const QCPDataMap::const_iterator& lower,
|
||||
const QCPDataMap::const_iterator& upper,
|
||||
int maxCount ) const;
|
||||
void getVisibleDataBounds( QCPDataMap::const_iterator& lower, QCPDataMap::const_iterator& upper ) const;
|
||||
int countDataInBounds( const QCPDataMap::const_iterator& lower, const QCPDataMap::const_iterator& upper, int maxCount ) const;
|
||||
void addFillBasePoints( QVector<QPointF>* lineData ) const;
|
||||
void removeFillBasePoints( QVector<QPointF>* lineData ) const;
|
||||
QPointF lowerFillBasePoint( double lowerKey ) const;
|
||||
@@ -3042,9 +2939,7 @@ public:
|
||||
LineStyle lineStyle() const { return mLineStyle; }
|
||||
// setters:
|
||||
void setData( QCPCurveDataMap* data, bool copy = false );
|
||||
void setData( const QVector<double>& t,
|
||||
const QVector<double>& key,
|
||||
const QVector<double>& value );
|
||||
void setData( const QVector<double>& t, const QVector<double>& key, const QVector<double>& value );
|
||||
void setData( const QVector<double>& key, const QVector<double>& value );
|
||||
void setScatterStyle( const QCPScatterStyle& style );
|
||||
void setLineStyle( LineStyle style );
|
||||
@@ -3054,9 +2949,7 @@ public:
|
||||
void addData( const QCPCurveData& data );
|
||||
void addData( double t, double key, double value );
|
||||
void addData( double key, double value );
|
||||
void addData( const QVector<double>& ts,
|
||||
const QVector<double>& keys,
|
||||
const QVector<double>& values );
|
||||
void addData( const QVector<double>& ts, const QVector<double>& keys, const QVector<double>& values );
|
||||
void removeDataBefore( double t );
|
||||
void removeDataAfter( double t );
|
||||
void removeData( double fromt, double tot );
|
||||
@@ -3216,12 +3109,7 @@ public:
|
||||
void setUpperQuartile( double value );
|
||||
void setMaximum( double value );
|
||||
void setOutliers( const QVector<double>& values );
|
||||
void setData( double key,
|
||||
double minimum,
|
||||
double lowerQuartile,
|
||||
double median,
|
||||
double upperQuartile,
|
||||
double maximum );
|
||||
void setData( double key, double minimum, double lowerQuartile, double median, double upperQuartile, double maximum );
|
||||
void setWidth( double width );
|
||||
void setWhiskerWidth( double width );
|
||||
void setWhiskerPen( const QPen& pen );
|
||||
@@ -3261,10 +3149,7 @@ protected:
|
||||
class QCP_LIB_DECL QCPColorMapData
|
||||
{
|
||||
public:
|
||||
QCPColorMapData( int keySize,
|
||||
int valueSize,
|
||||
const QCPRange& keyRange,
|
||||
const QCPRange& valueRange );
|
||||
QCPColorMapData( int keySize, int valueSize, const QCPRange& keyRange, const QCPRange& valueRange );
|
||||
~QCPColorMapData();
|
||||
QCPColorMapData( const QCPColorMapData& other );
|
||||
QCPColorMapData& operator=( const QCPColorMapData& other );
|
||||
@@ -3314,8 +3199,7 @@ class QCP_LIB_DECL QCPColorMap : public QCPAbstractPlottable
|
||||
Q_OBJECT
|
||||
/// \cond INCLUDE_QPROPERTIES
|
||||
Q_PROPERTY( QCPRange dataRange READ dataRange WRITE setDataRange NOTIFY dataRangeChanged )
|
||||
Q_PROPERTY( QCPAxis::ScaleType dataScaleType READ dataScaleType WRITE setDataScaleType NOTIFY
|
||||
dataScaleTypeChanged )
|
||||
Q_PROPERTY( QCPAxis::ScaleType dataScaleType READ dataScaleType WRITE setDataScaleType NOTIFY dataScaleTypeChanged )
|
||||
Q_PROPERTY( QCPColorGradient gradient READ gradient WRITE setGradient NOTIFY gradientChanged )
|
||||
Q_PROPERTY( bool interpolate READ interpolate WRITE setInterpolate )
|
||||
Q_PROPERTY( bool tightBoundary READ tightBoundary WRITE setTightBoundary )
|
||||
@@ -3344,8 +3228,7 @@ public:
|
||||
|
||||
// non-property methods:
|
||||
void rescaleDataRange( bool recalculateDataBounds = false );
|
||||
Q_SLOT void updateLegendIcon( Qt::TransformationMode transformMode = Qt::SmoothTransformation,
|
||||
const QSize& thumbSize = QSize( 32, 18 ) );
|
||||
Q_SLOT void updateLegendIcon( Qt::TransformationMode transformMode = Qt::SmoothTransformation, const QSize& thumbSize = QSize( 32, 18 ) );
|
||||
|
||||
// reimplemented virtual methods:
|
||||
virtual void clearData();
|
||||
@@ -3415,12 +3298,8 @@ protected:
|
||||
virtual void draw( QCPPainter* painter );
|
||||
|
||||
// non-virtual methods:
|
||||
double distToStraightLine( const QVector2D& point1,
|
||||
const QVector2D& vec,
|
||||
const QVector2D& point ) const;
|
||||
QLineF getRectClippedStraightLine( const QVector2D& point1,
|
||||
const QVector2D& vec,
|
||||
const QRect& rect ) const;
|
||||
double distToStraightLine( const QVector2D& point1, const QVector2D& vec, const QVector2D& point ) const;
|
||||
QLineF getRectClippedStraightLine( const QVector2D& point1, const QVector2D& vec, const QRect& rect ) const;
|
||||
QPen mainPen() const;
|
||||
};
|
||||
|
||||
@@ -3463,9 +3342,7 @@ protected:
|
||||
virtual void draw( QCPPainter* painter );
|
||||
|
||||
// non-virtual methods:
|
||||
QLineF getRectClippedLine( const QVector2D& start,
|
||||
const QVector2D& end,
|
||||
const QRect& rect ) const;
|
||||
QLineF getRectClippedLine( const QVector2D& start, const QVector2D& end, const QRect& rect ) const;
|
||||
QPen mainPen() const;
|
||||
};
|
||||
|
||||
@@ -3666,9 +3543,7 @@ protected:
|
||||
virtual QPointF anchorPixelPoint( int anchorId ) const;
|
||||
|
||||
// non-virtual methods:
|
||||
QPointF getTextDrawPoint( const QPointF& pos,
|
||||
const QRectF& rect,
|
||||
Qt::Alignment positionAlignment ) const;
|
||||
QPointF getTextDrawPoint( const QPointF& pos, const QRectF& rect, Qt::Alignment positionAlignment ) const;
|
||||
QFont mainFont() const;
|
||||
QColor mainColor() const;
|
||||
QPen mainPen() const;
|
||||
@@ -3802,9 +3677,7 @@ protected:
|
||||
virtual QPointF anchorPixelPoint( int anchorId ) const;
|
||||
|
||||
// non-virtual methods:
|
||||
void updateScaledPixmap( QRect finalRect = QRect(),
|
||||
bool flipHorz = false,
|
||||
bool flipVert = false );
|
||||
void updateScaledPixmap( QRect finalRect = QRect(), bool flipHorz = false, bool flipVert = false );
|
||||
QRect getFinalRect( bool* flippedHorz = 0, bool* flippedVert = 0 ) const;
|
||||
QPen mainPen() const;
|
||||
};
|
||||
|
||||
+86
-90
@@ -41,112 +41,108 @@
|
||||
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
qRegisterMetaType<PlaYUVerStreamInfoVector>();
|
||||
qRegisterMetaTypeStreamOperators<PlaYUVerStreamInfoVector>();
|
||||
qRegisterMetaType<PlaYUVerStdResolutionVector>();
|
||||
qRegisterMetaTypeStreamOperators<PlaYUVerStdResolutionVector>();
|
||||
qRegisterMetaType<PlaYUVerStreamInfoVector>();
|
||||
qRegisterMetaTypeStreamOperators<PlaYUVerStreamInfoVector>();
|
||||
qRegisterMetaType<PlaYUVerStdResolutionVector>();
|
||||
qRegisterMetaTypeStreamOperators<PlaYUVerStdResolutionVector>();
|
||||
|
||||
QApplication application( argc, argv );
|
||||
QApplication::setApplicationName( "PlaYUVer" );
|
||||
QApplication::setApplicationVersion( PLAYUVER_VERSION_STRING );
|
||||
QApplication::setOrganizationName( "PixLRA" );
|
||||
QApplication application( argc, argv );
|
||||
QApplication::setApplicationName( "PlaYUVer" );
|
||||
QApplication::setApplicationVersion( PLAYUVER_VERSION_STRING );
|
||||
QApplication::setOrganizationName( "PixLRA" );
|
||||
|
||||
#ifdef USE_QTDBUS
|
||||
/**
|
||||
* use dbus, if available
|
||||
* allows for resuse of running Kate instances
|
||||
*/
|
||||
if( QDBusConnectionInterface* const sessionBusInterface =
|
||||
QDBusConnection::sessionBus().interface() )
|
||||
{
|
||||
Bool force_new = false;
|
||||
QStringList filenameList;
|
||||
for( Int i = 1; i < argc; i++ )
|
||||
{
|
||||
filenameList.append( QFileInfo( QString( argv[i] ) ).absoluteFilePath() );
|
||||
}
|
||||
if( filenameList.isEmpty() )
|
||||
{
|
||||
force_new = true;
|
||||
}
|
||||
/**
|
||||
* use dbus, if available
|
||||
* allows for resuse of running Kate instances
|
||||
*/
|
||||
if( QDBusConnectionInterface* const sessionBusInterface = QDBusConnection::sessionBus().interface() )
|
||||
{
|
||||
Bool force_new = false;
|
||||
QStringList filenameList;
|
||||
for( Int i = 1; i < argc; i++ )
|
||||
{
|
||||
filenameList.append( QFileInfo( QString( argv[i] ) ).absoluteFilePath() );
|
||||
}
|
||||
if( filenameList.isEmpty() )
|
||||
{
|
||||
force_new = true;
|
||||
}
|
||||
|
||||
// check again if service is still running
|
||||
bool foundRunningService = false;
|
||||
if( !force_new )
|
||||
{
|
||||
QDBusReply<bool> there =
|
||||
sessionBusInterface->isServiceRegistered( PLAYUVER_DBUS_SESSION_NAME );
|
||||
foundRunningService = there.isValid() && there.value();
|
||||
// check again if service is still running
|
||||
bool foundRunningService = false;
|
||||
if( !force_new )
|
||||
{
|
||||
QDBusReply<bool> there = sessionBusInterface->isServiceRegistered( PLAYUVER_DBUS_SESSION_NAME );
|
||||
foundRunningService = there.isValid() && there.value();
|
||||
|
||||
if( foundRunningService )
|
||||
{
|
||||
qInfo() << "Found running instance... Re-using";
|
||||
if( foundRunningService )
|
||||
{
|
||||
qInfo() << "Found running instance... Re-using";
|
||||
|
||||
// open given session
|
||||
QDBusMessage m = QDBusMessage::createMethodCall(
|
||||
PLAYUVER_DBUS_SESSION_NAME, QStringLiteral( PLAYUVER_DBUS_PATH ),
|
||||
QStringLiteral( PLAYUVER_DBUS_SESSION_NAME ), QStringLiteral( "activate" ) );
|
||||
// open given session
|
||||
QDBusMessage m = QDBusMessage::createMethodCall( PLAYUVER_DBUS_SESSION_NAME, QStringLiteral( PLAYUVER_DBUS_PATH ),
|
||||
QStringLiteral( PLAYUVER_DBUS_SESSION_NAME ), QStringLiteral( "activate" ) );
|
||||
|
||||
QDBusConnection::sessionBus().call( m );
|
||||
QDBusConnection::sessionBus().call( m );
|
||||
|
||||
// only block, if files to open there....
|
||||
bool needToBlock = false;
|
||||
// only block, if files to open there....
|
||||
bool needToBlock = false;
|
||||
|
||||
QStringList tokens;
|
||||
QStringList tokens;
|
||||
|
||||
// open given files...
|
||||
foreach( const QString& file, filenameList )
|
||||
{
|
||||
QDBusMessage m = QDBusMessage::createMethodCall(
|
||||
PLAYUVER_DBUS_SESSION_NAME, QStringLiteral( PLAYUVER_DBUS_PATH ),
|
||||
QStringLiteral( PLAYUVER_DBUS_SESSION_NAME ), QStringLiteral( "loadFile" ) );
|
||||
// open given files...
|
||||
foreach( const QString& file, filenameList )
|
||||
{
|
||||
QDBusMessage m = QDBusMessage::createMethodCall( PLAYUVER_DBUS_SESSION_NAME, QStringLiteral( PLAYUVER_DBUS_PATH ),
|
||||
QStringLiteral( PLAYUVER_DBUS_SESSION_NAME ), QStringLiteral( "loadFile" ) );
|
||||
|
||||
QList<QVariant> dbusargs;
|
||||
dbusargs.append( file );
|
||||
m.setArguments( dbusargs );
|
||||
QList<QVariant> dbusargs;
|
||||
dbusargs.append( file );
|
||||
m.setArguments( dbusargs );
|
||||
|
||||
QDBusMessage res = QDBusConnection::sessionBus().call( m );
|
||||
if( res.type() == QDBusMessage::ReplyMessage )
|
||||
{
|
||||
if( res.arguments().count() == 1 )
|
||||
{
|
||||
QVariant v = res.arguments()[0];
|
||||
if( v.isValid() )
|
||||
{
|
||||
QString s = v.toString();
|
||||
if( ( !s.isEmpty() ) && ( s != QStringLiteral( "ERROR" ) ) )
|
||||
{
|
||||
tokens << s;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// this will wait until exiting is emitted by the used instance, if
|
||||
// wanted...
|
||||
return needToBlock ? application.exec() : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
QDBusMessage res = QDBusConnection::sessionBus().call( m );
|
||||
if( res.type() == QDBusMessage::ReplyMessage )
|
||||
{
|
||||
if( res.arguments().count() == 1 )
|
||||
{
|
||||
QVariant v = res.arguments()[0];
|
||||
if( v.isValid() )
|
||||
{
|
||||
QString s = v.toString();
|
||||
if( ( !s.isEmpty() ) && ( s != QStringLiteral( "ERROR" ) ) )
|
||||
{
|
||||
tokens << s;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// this will wait until exiting is emitted by the used instance, if
|
||||
// wanted...
|
||||
return needToBlock ? application.exec() : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* if we arrive here, we need to start a new playuver instance!
|
||||
*/
|
||||
QDBusConnection::sessionBus().registerService( PLAYUVER_DBUS_SESSION_NAME );
|
||||
/**
|
||||
* if we arrive here, we need to start a new playuver instance!
|
||||
*/
|
||||
QDBusConnection::sessionBus().registerService( PLAYUVER_DBUS_SESSION_NAME );
|
||||
#endif
|
||||
PlaYUVerApp mainwindow;
|
||||
mainwindow.show();
|
||||
if( mainwindow.parseArgs( argc, argv ) )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
PlaYUVerApp mainwindow;
|
||||
mainwindow.show();
|
||||
if( mainwindow.parseArgs( argc, argv ) )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#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();
|
||||
return application.exec();
|
||||
}
|
||||
Reference in new issue
Block a user