From 10b6090e0b6eb6f5dfc7d4a934a2086e3abbdec5 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Wed, 15 Apr 2015 17:23:45 +0100 Subject: [PATCH] Add missing files --- app/SeekStreamDialog.cpp | 82 ++++++++++++++++++++++++++++++++++++++++ app/SeekStreamDialog.h | 54 ++++++++++++++++++++++++++ 2 files changed, 136 insertions(+) create mode 100644 app/SeekStreamDialog.cpp create mode 100644 app/SeekStreamDialog.h diff --git a/app/SeekStreamDialog.cpp b/app/SeekStreamDialog.cpp new file mode 100644 index 0000000..7e8d3e7 --- /dev/null +++ b/app/SeekStreamDialog.cpp @@ -0,0 +1,82 @@ +/* This file is a part of plaYUVer project + * Copyright (C) 2014-2015 by Luis Lucas (luisfrlucas@gmail.com) + * Joao Carreira (jfmcarreira@gmail.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + * \file SeekStreamDialog.cpp + * \brief Dialog box to config modules opts + */ + +#include "SeekStreamDialog.h" +#include "lib/PlaYUVerStream.h" +#include +#include +#include +#include +#include + +namespace plaYUVer +{ + +SeekStreamDialog::SeekStreamDialog( PlaYUVerStream *pcCurrStream, QWidget *parent ) : + QDialog( parent ), + m_iSelectedFrameNum() +{ + + m_iSelectedFrameNum = pcCurrStream->getCurrFrameNum(); + + setWindowTitle( "Go to frame" ); + + QLabel* pcLabel = new QLabel; + pcLabel->setText( QString( "Go to frame (0 - %1)" ).arg( pcCurrStream->getFrameNum() - 1 ) ); + + m_spinFrameNum = new QSpinBox; + m_spinFrameNum->setMinimumSize( 70, 5 ); + m_spinFrameNum->setMaximumSize( 70, 30 ); + m_spinFrameNum->setMinimum( 0 ); + m_spinFrameNum->setMaximum( pcCurrStream->getFrameNum() - 1 ); + m_spinFrameNum->setValue( m_iSelectedFrameNum ); + + QDialogButtonBox* dialogButtonOkCancel = new QDialogButtonBox(); + dialogButtonOkCancel->setObjectName( QString::fromUtf8( "dialogButtonBox" ) ); + dialogButtonOkCancel->setStandardButtons( QDialogButtonBox::Cancel | QDialogButtonBox::Ok ); + dialogButtonOkCancel->setCenterButtons( false ); + + QGridLayout* mainLayout = new QGridLayout; + mainLayout->addWidget( pcLabel, 0, 0 ); + mainLayout->addWidget( m_spinFrameNum, 0, 1 ); + mainLayout->addWidget( dialogButtonOkCancel, 1, 0, 1, 2, Qt::AlignRight ); + setLayout( mainLayout ); + + setFixedSize( 250, mainLayout->sizeHint().height() ); + + connect( dialogButtonOkCancel, SIGNAL( accepted() ), this, SLOT( accept() ) ); + connect( dialogButtonOkCancel, SIGNAL( rejected() ), this, SLOT( reject() ) ); +} + +Int SeekStreamDialog::runDialog() +{ + if( exec() == QDialog::Rejected ) + { + return -1; + } + m_iSelectedFrameNum = m_spinFrameNum->value(); + return m_iSelectedFrameNum; +} + +} // NAMESPACE diff --git a/app/SeekStreamDialog.h b/app/SeekStreamDialog.h new file mode 100644 index 0000000..c268ab6 --- /dev/null +++ b/app/SeekStreamDialog.h @@ -0,0 +1,54 @@ +/* This file is a part of plaYUVer project + * Copyright (C) 2014-2015 by Luis Lucas (luisfrlucas@gmail.com) + * Joao Carreira (jfmcarreira@gmail.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + * \file SeekStreamDialog.h + * \brief Dialog box to config modules opts + */ + +#ifndef __SEEKSTREAMDIALOG_H__ +#define __SEEKSTREAMDIALOG_H__ + +#include "config.h" +#include "PlaYUVerAppDefs.h" +#include "PlaYUVerAppModuleIf.h" +#include +#include + +namespace plaYUVer +{ + +/** + * + */ +class SeekStreamDialog: public QDialog +{ +Q_OBJECT + +public: + SeekStreamDialog( PlaYUVerStream *pcCurrStream, QWidget *parent = 0 ); + Int runDialog(); +private: + QSpinBox* m_spinFrameNum; + Int m_iSelectedFrameNum; +}; + +} // NAMESPACE + +#endif // __MODULEHANDLEOPTDIALOG_H__