/*****************************************************************************
 *
 *  playerdialog.h -- Wrap a PlayerWidget 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 PLAYERDIALOG_H
#define PLAYERDIALOG_H

#include "../video/video_constants.h"
#include "playerwidget.h"
#include <QDialog>
#include <QWidget>
#include <QStatusBar>
#include <QTextEdit>
#include <QAction>
#include <QActionGroup>
#include <QString>
#include <QSize>

class PlayerDialog : public QDialog
{
	Q_OBJECT

public:
	struct Preferences
	{
		QWidget *referenceConsole;
		QString mplayerPath;
		QString mediainfoPath;
		QString ffprobePath;
		QTextEdit *inputChannel;
		QTextEdit *outputChannel;
		QTextEdit *errorChannel;
		QTextEdit *logChannel;
		int verbosity;

		PlayerWidget::Preferences playerPreferences;

		Preferences() { reset(); }
		
		void reset()
		{
			referenceConsole = 0;
			mplayerPath.clear();
			mediainfoPath.clear();
			ffprobePath.clear();
			inputChannel = 0;
			outputChannel = 0;
			errorChannel = 0;
			logChannel = 0;
			verbosity = VERBOSITY_QUIET;

			playerPreferences.reset();
		}
	};

public:
	PlayerDialog(const QString &, Preferences *prefs, QWidget *parent=0);

	void setCurrentFilePath(const QString &);
	void setInfoMode(const bool);

	inline interfacemediainfo_data_t readMediaInfoData() { return playerWidget->readMediaInfoData(); };

protected:
	void center();	// center on reference window (usually main window)

protected slots:

protected:
	PlayerWidget* playerWidget;
	QSize frameSize;

	QString playerTitle;
	QString currentFile;

	bool infoMode;

	Preferences preferences;
};

#endif
