/*
Copyright (c) 2010 by Drake Justice <djustice.kde@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.

*/

#ifndef ENCODERTHREAD_H
#define ENCODERTHREAD_H

#include <QStringList>
#include <QProcess>
#include <QThread>


class EncoderThread : public QThread
{
    Q_OBJECT

    public:
      EncoderThread(const QStringList& fileList, const QString& tmpDir, const QString& vidMod, const QString& aspectRatio);
      ~EncoderThread();
      void run();

    signals:
      void progress(int p);
      void progressMax(int p);
      void progressFile(int p);
      void finished();

    private slots:
      void ffmpegFinished(int i);
      void mencoderFinished();
      void updateProgress();

    private:
      QProcess m_mencoderProcess;
      QProcess m_ffmpegProcess;
      QStringList m_fileList;
      QString m_tmpDir;
      QString m_vidMode;
      QString m_aspectRatio;
      int m_currentFile;
};

#endif // ENCODERTHREAD_H
