/*****************************************************************************
 *
 *  encoderpreviewdialog.h -- Wrap a single JobManagerWidget in a window.
 *
 *  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 ENCODERPREVIEWDIALOG_H
#define ENCODERPREVIEWDIALOG_H

#include "../job/jobmanager.h"
#include "jobmanagerwidget.h"
#include "consoledialog.h"
#include "playerdialog.h"
#include <QDialog>
#include <QString>
#include <QCheckBox>
#include <QLabel>
#include <QPushButton>
#include <QGroupBox>
#include <QLayout>

class EncoderPreviewDialog : public QDialog
{
	Q_OBJECT

public:
	EncoderPreviewDialog(const QString &, JobManagerWidget *, 
		PlayerDialog::Preferences *, QWidget *);

	void setEncoding();
	void setEncodingDone();
	void setOutput(const QString &str);
	void setNoConsoleButton(bool);

signals:
	void abortedByUser();

public slots:
	void playPreview();
	void showPreviewInfo();

protected:
	void center();	// center on parent
	void abortEncodingPreview();
	void closeEvent(QCloseEvent *);
	void showEvent(QShowEvent *);

protected:
	JobManagerWidget* jobManagerWidget;
	PlayerDialog::Preferences *playerPreferences;
	QString output;

	QCheckBox *deleteOutputBox;

	QPushButton *controlButton;
	QPushButton *previewButton;		// play output
	QPushButton *infoButton;		// show output media info

	QWidget *mainConsole;

	bool isEncoding;
	bool showConsoleButton;
};

#endif
