/****************************************************************************
**
** Created: Sun Apr 11 22:06:50 2004
**      by: Varol Okan using the kate text editor.
**
**
****************************************************************************/

#ifndef QXINE_H
#define QXINE_H

#include "uiqplayer.h"
#include <qstringlist.h>

#define QPLAYER_INIT_FILE "qplayer.ini"
#define QPLAYER_INIT_DIR  "/.qdvdauthor/"

class MediaInterface;
class QGridLayout;
class QTranslator;
class QPopupMenu;
class QComboBox;
class QToolBar;

class QPlayer : public uiQPlayer
{
    Q_OBJECT

public:
	// list the states of the xine engine.
	enum {	STATE_STOPPED=0,
		STATE_PLAYING,
		STATE_PAUSED,
		STATE_UNKNOWN};
	// Constructor / destructor.
	QPlayer (QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
	virtual ~QPlayer ();

	void setFileName (QString, bool b=true);
	void setFileList (QValueList <QString>, bool b=true);
private:
	void colorMovieButtons (void *);
	void loadHistory ();
	void initLanguages ();
	void saveHistory ();
	void addFileToHistory(QString);
	void getImage(uint i=0 );

protected slots:
	// Here are the standard slots which are implemented in QXine
	virtual void polish          ();
	virtual void fileOpen        ();
	virtual void fileOpenRecent  ();
	virtual void fileExit        ();
	virtual void helpAbout       ();
	virtual void slotSetup       ();
	virtual void slotConfigure   ();
	virtual void slotMediaInfo   ();

	virtual void slotPrev        ();
	virtual void slotNext        ();
	virtual void slotStop        ();
	virtual void slotPlay        ();
	virtual void slotSpeedPlus   ();
	virtual void slotSpeedMinus  ();
	virtual void slotSeekPosition();
	virtual void slotSetVolume   (int);
	virtual void slotScreenshot  ();

	virtual void slotHistory          (int);
	virtual void slotNewPosition      (int, const QString&);
	virtual void slotPlaybackFinished ();
	virtual void slotChangeLanguage   (int);

protected:
	MediaInterface *m_pMediaInterface;
	QToolBar       *m_pToolBarPrevious;
	QComboBox      *m_pComboPrevious;
	QPopupMenu     *m_pLanguagePopup;
	QGridLayout    *m_pVideoLayout;
	QTranslator    *m_pTranslator;
	QString         m_qsFileName;
	float           m_fSpeed;
	QStringList     m_listHistory;
	int             m_iIsPlaying;
//	QString         m_qsCurrentVideoPlugin;
//	QString         m_qsCurrentAudioPlugin;
};

#endif // QXINE_H
