/*****************************************************************************
 *
 *  mencoder.h -- MEncoder interface.
 *
 *  Copyright (C) 2010 Starbuck <starbuck@labdv.com>
 *  All rights reserved.
 *
 *  This file is part of the JobManager 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 MENCODER_H
#define MENCODER_H

#include "transcoder.h"
#include <QObject>
#include <QString>
#include <QStringList>

class MEncoder : public Transcoder
{
	Q_OBJECT

public:
	MEncoder();
	//~MEncoder();

	void interfaceReset();
	bool interfaceStart(const QString &path="", const QString &libPath="");  // IProcessor interface

signals:
	void interfaceFailed();  // IProcessor interface
	void interfaceReady();  // IProcessor interface

protected:
	QString		encX264Bitrate(double bitrate);
	QString		encX264Preset(const QString &format, const QString &codec);
	QString		encX264Profile(const QString &format, const int width, const int height);
	QStringList	encX264Tuning(const QString &format, const QString &codec, const double fps=0.0);

	QString		encXvidBitrate(double bitrate);
	QString		encXvidProfile(const int width, const int height, const QString &aviFourcc, const QString &tvStandard="");
	QStringList	encXvidTuning(const double bitrate);
	
	//QString encX264Profile();

	void parseInterfaceVersion(QString *cmdOutput);
	void parseOutputHelpFormats(QString *cmdOutput, QMap<QString, QString> *availableEncoders);

protected:
	QStringList m_divxFourcc;
	QString		m_xvidRecodedFourcc;
};

#endif
