/*****************************************************************************
 *
 *  tunesettingsdialog.h -- Tune encoder settings.
 *
 *  Copyright (C) 2010 Starbuck <starbuck@labdv.com>
 *  All rights reserved.
 *
 *  This file is part of the Gui4 module of the DVDx 4 application.
 *
 *  GNU Lesser General Public License Usage
 *  This file may be used under the terms of the GNU Lesser General
 *  Public License version 2.1 as published by the Free Software
 *  Foundation and appearing in the file LICENSE.LGPL included in the
 *  packaging of this file.  Please review the following information to
 *  ensure the GNU Lesser General Public License version 2.1 requirements
 *  will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
 *
 *  GNU General Public License Usage
 *  Alternatively, this file may be used under the terms of the GNU
 *  General Public License version 3.0 as published by the Free Software
 *  Foundation and appearing in the file LICENSE.GPL included in the
 *  packaging of this file.  Please review the following information to
 *  ensure the GNU General Public License version 3.0 requirements will be
 *  met: http://www.gnu.org/copyleft/gpl.html.
 *
 *****************************************************************************/

#ifndef TUNESETTINGSDIALOG_H
#define TUNESETTINGSDIALOG_H

#include "../video/video_struct.h"
#include <QDialog>
#include <QString>
#include <QLineEdit>
#include <QCheckBox>
#include <QLayout>
#include <QPushButton>
#include <QMultiMap>
#include <QLabel>
#include <QGroupBox>
#include <QDialogButtonBox>
#include <QSignalMapper>

class TuneSettingsDialog : public QDialog
{
	Q_OBJECT

public:
	TuneSettingsDialog(encoder_video_settings_t::filter_t *filters,
			QString *videoCodecName,
			QMultiMap<QString, QString> *videoOptions,
			QString *audioCodecName, 
			QMultiMap<QString, QString> *audioOptions,
			QWidget *parent = 0);

private slots:
	void accept();
	void harddupCheckBoxClicked();
	void noskipCheckBoxClicked();
	void videoButtonClicked(const int);
	void audioButtonClicked(const int);
	void videoEditFinished(const int);
	void audioEditFinished(const int);

private:
	encoder_video_settings_t::filter_t *videoFilters;
	QMultiMap<QString, QString> *outputVideoOptions;
	QMultiMap<QString, QString> *outputAudioOptions;

	QList<QHBoxLayout *> videoHLayoutList;
	QList<QLineEdit *> videoOptionEditList;
	QList<QLineEdit *> videoParamsEditList;
	QList<QPushButton *> videoButtonList;
	QList<QHBoxLayout *> audioHLayoutList;
	QList<QLineEdit *> audioOptionEditList;
	QList<QLineEdit *> audioParamsEditList;
	QList<QPushButton *> audioButtonList;
	
	QGroupBox *preprocessingGroup;
	QVBoxLayout *preprocessingVLayout;
	QHBoxLayout *noskipHLayout;
	QCheckBox *noskipCheckBox;
	QHBoxLayout *harddupHLayout;
	QCheckBox *harddupCheckBox;

	QGroupBox *cliGroup;
	QLabel *videoCodecLabel;
	QLabel *audioCodecLabel;
	QVBoxLayout *cliVLayout;

	QVBoxLayout *mainLayout;
	QDialogButtonBox *buttonBox;

	QSignalMapper *videoEditSignalMapper;
	QSignalMapper *audioEditSignalMapper;

	QSignalMapper *videoSignalMapper;
	QSignalMapper *audioSignalMapper;
};

#endif
