diff --git a/source/ConfigureFormatDialog.cpp b/source/ConfigureFormatDialog.cpp index b025044..70c168a 100755 --- a/source/ConfigureFormatDialog.cpp +++ b/source/ConfigureFormatDialog.cpp @@ -24,6 +24,7 @@ #include #include #include "ConfigureFormatDialog.h" +#include "InputStream.h" namespace plaYUVer { @@ -37,7 +38,7 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget *parent ) : // Config dialog setObjectName( QStringLiteral( "ConfigureFormat" ) ); - resize( 392, 292 ); + resize( 392, 350 ); setWindowTitle( QApplication::translate( "ConfigureFormat", "Configure Resolution", 0 ) ); setWindowIcon( QIcon( ":/images/dialogicon-grid.png" ) ); @@ -73,10 +74,14 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget *parent ) : // standardResolutionLayout + verticalSpacer = new QSpacerItem( 10, 20, QSizePolicy::Minimum ); + MainLayout->addItem( verticalSpacer ); + standardResolutionLayout = new QHBoxLayout( ); standardResolutionLayout->setObjectName( QStringLiteral( "standardResolutionLayout" ) ); standardResolutionLabel = new QLabel( this ); standardResolutionLabel->setObjectName( QStringLiteral( "standardResolutionLabel" ) ); + standardResolutionLabel->setText( QApplication::translate( "ConfigureFormat", "Standard Resolution", 0 ) ); horizontalSpacer = new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); @@ -89,19 +94,21 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget *parent ) : standardResolutionBox->setSizePolicy( sizePolicy ); standardResolutionBox->setAcceptDrops( true ); - - standardResolutionLayout->addWidget( standardResolutionLabel ); - standardResolutionLayout->addItem( horizontalSpacer ); - standardResolutionLayout->addWidget( standardResolutionBox ); - standardResolutionLabel->setText( QApplication::translate( "ConfigureFormat", "Standard Resolution", 0 ) ); standardResolutionBox->clear(); standardResolutionBox->insertItems( 0, standardResolutionNames ); standardResolutionBox->setCurrentIndex( -1 ); + standardResolutionLayout->addWidget( standardResolutionLabel ); + standardResolutionLayout->addItem( horizontalSpacer ); + standardResolutionLayout->addWidget( standardResolutionBox ); + MainLayout->addLayout( standardResolutionLayout ); // resolutionGrid + *verticalSpacer = QSpacerItem( 10, 20, QSizePolicy::Minimum ); + MainLayout->addItem( verticalSpacer ); + resolutionGrid = new QGridLayout( this ); resolutionGrid->setObjectName( QStringLiteral( "resolutionGrid" ) ); @@ -142,11 +149,43 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget *parent ) : MainLayout->addLayout( resolutionGrid ); - verticalSpacer = new QSpacerItem( 20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding ); + // Pixel format + + *verticalSpacer = QSpacerItem( 10, 20, QSizePolicy::Minimum ); MainLayout->addItem( verticalSpacer ); + pixelFormatLayout = new QHBoxLayout( ); + pixelFormatLayout->setObjectName( QStringLiteral( "pixelFormatLayout" ) ); + + pixelFormatLabel = new QLabel( this ); + pixelFormatLabel->setObjectName( QStringLiteral( "pixelFormatLabel" ) ); + pixelFormatLabel->setText( QApplication::translate( "pixelFormat", "Pixel FormatBox", 0 ) ); + + pixelFormatHorizontalSpacer = new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + + pixelFormatBox = new QComboBox( this ); + pixelFormatBox->setObjectName( QStringLiteral( "pixelFormatBox" ) ); + QSizePolicy sizePolicyPixelFormat( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed ); + sizePolicyPixelFormat.setHorizontalStretch( 0 ); + sizePolicyPixelFormat.setVerticalStretch( 0 ); + sizePolicyPixelFormat.setHeightForWidth( pixelFormatBox->sizePolicy().hasHeightForWidth() ); + pixelFormatBox->setSizePolicy( sizePolicyPixelFormat ); + pixelFormatBox->setAcceptDrops( true ); + pixelFormatBox->clear(); + pixelFormatBox->insertItems( 0, InputStream::supportedPixelFormatList() ); + pixelFormatBox->setCurrentIndex( 0 ); + + pixelFormatLayout->addWidget( pixelFormatLabel ); + pixelFormatLayout->addItem( pixelFormatHorizontalSpacer ); + pixelFormatLayout->addWidget( pixelFormatBox ); + + MainLayout->addLayout( pixelFormatLayout ); + // Confirmation buttons + verticalSpacerConfirmation = new QSpacerItem( 20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding ); + MainLayout->addItem( verticalSpacerConfirmation ); + dialogButtonOkCancel = new QDialogButtonBox( this ); dialogButtonOkCancel->setObjectName( QString::fromUtf8( "dialogButtonBox" ) ); dialogButtonOkCancel->setStandardButtons( QDialogButtonBox::Cancel | QDialogButtonBox::Ok ); diff --git a/source/ConfigureFormatDialog.h b/source/ConfigureFormatDialog.h index 20ff585..e11d6f0 100755 --- a/source/ConfigureFormatDialog.h +++ b/source/ConfigureFormatDialog.h @@ -82,6 +82,12 @@ private: QSpinBox *heightSpinBox; QLabel *heightLabel; QSpacerItem *verticalSpacer; + + QHBoxLayout *pixelFormatLayout; + QLabel *pixelFormatLabel; + QSpacerItem *pixelFormatHorizontalSpacer; + QComboBox *pixelFormatBox; + QSpacerItem *verticalSpacerConfirmation; QDialogButtonBox *dialogButtonOkCancel; Void setStandardResolutionSizes() diff --git a/source/InputStream.cpp b/source/InputStream.cpp index 52bd073..7c7b919 100755 --- a/source/InputStream.cpp +++ b/source/InputStream.cpp @@ -79,6 +79,13 @@ QStringList InputStream::supportedReadFormatsList() return formats; } +QStringList InputStream::supportedPixelFormatList() +{ + QStringList formats; + formats << "YUV420" << "YUV444"; + return formats; +} + Void InputStream::init( QString filename, UInt width, UInt height ) { @@ -301,4 +308,4 @@ Bool InputStream::checkErrors( Int error_type ) return false; } -} // NAMESPACE +} // NAMESPACE diff --git a/source/InputStream.h b/source/InputStream.h index a2681b9..d0bc7eb 100755 --- a/source/InputStream.h +++ b/source/InputStream.h @@ -71,6 +71,7 @@ public: static QString supportedReadFormats(); static QStringList supportedReadFormatsList(); + static QStringList supportedPixelFormatList(); Void init( QString filename, UInt width, UInt height );