Re-format code
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QDebug>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QFileInfo>
|
||||
#include <QGroupBox>
|
||||
@@ -33,7 +34,6 @@
|
||||
#include <QSpinBox>
|
||||
#include <QString>
|
||||
#include <QWidget>
|
||||
#include <QDebug>
|
||||
|
||||
#include "lib/PlaYUVerFrame.h"
|
||||
|
||||
@@ -147,17 +147,20 @@ 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 ) );
|
||||
}
|
||||
|
||||
@@ -189,7 +192,8 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget* parent ) : QDialog( paren
|
||||
// dialogTitleLabel->setFont( titleFont );
|
||||
// dialogTitleLabel->setText( "Configure Resolution" );
|
||||
// headLayout->addWidget( dialogTitleLabel );
|
||||
// headLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
|
||||
// headLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding,
|
||||
// QSizePolicy::Minimum ) );
|
||||
//
|
||||
// MainLayout->addLayout( headLayout );
|
||||
// MainLayout->addItem( new QSpacerItem( 10, 20, QSizePolicy::Minimum ) );
|
||||
@@ -204,7 +208,8 @@ 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 );
|
||||
|
||||
@@ -282,16 +287,19 @@ 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();
|
||||
@@ -303,7 +311,8 @@ 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 );
|
||||
|
||||
/*
|
||||
@@ -320,7 +329,8 @@ 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 );
|
||||
@@ -340,7 +350,8 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget* parent ) : QDialog( paren
|
||||
m_spinBoxFrameRate->setRange( 0, 200 );
|
||||
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 );
|
||||
@@ -368,7 +379,8 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget* parent ) : QDialog( paren
|
||||
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() ) );
|
||||
@@ -471,9 +483,11 @@ 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 );
|
||||
@@ -499,7 +513,8 @@ 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;
|
||||
@@ -517,7 +532,8 @@ 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 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user