/****************************************************************************
**
** 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"	//ooo
#include "ui_uiqplayer.h"	//xxx
#include <QMainWindow>      //xxx
#include <qstringlist.h>
//Added by qt3to4:
//#include <Q3GridLayout>   //ooo
#include <QGridLayout>      //xxx
//#include <Q3ValueList>	//oxx
#include <QTranslator>
//#include <Q3PopupMenu>    //ooo
#include <QMenu>            //xxx

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

class MediaInterface;
//class Q3GridLayout;   //ooo
class QGridLayout;      //xxx
class QTranslator;
//class Q3PopupMenu;    //ooo
class QMenu;            //xxx
class QComboBox;
//class Q3ToolBar;      //ooo
class QToolBar;         //xxx

//class QPlayer : public uiQPlayer			//ooo
//class QPlayer : public Q3MainWindow, Ui::uiQPlayer	//xxx
class QPlayer : public QMainWindow, public Ui::uiQPlayer	//xxx
{
    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, Qt::WFlags fl = 0 );	//ooo
	QPlayer (QWidget* pParent = 0);							//xxx
	virtual ~QPlayer ();

	void setFileName (QString, bool b=true);
	void setFileList (QList <QString>, bool b=true);	//oxx
private:
	void colorMovieButtons (void *);
	void loadHistory ();
	void initLanguages ();
	void saveHistory ();
	void addFileToHistory(QString);
	void getImage(uint i=0 );
    
    QLabel      *m_pImagePreview;   //xxx

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 slotUp            ( );
	virtual void slotDown          ( );
	virtual void slotLeft          ( );
	virtual void slotRight         ( );
	virtual void slotSet           ( );
	virtual void slotRoot          ( );
	virtual void slotTitle         ( );
	virtual void slotSubtitleMinus ( );
	virtual void slotSubtitlePlus  ( );
	virtual void slotAudioMinus    ( );
	virtual void slotAudioPlus     ( );

	virtual void slotPrev        ();
	virtual void slotNext        ();
	virtual void slotStop        ();
	virtual void slotPlay        ();
	virtual void slotSpeedPlus   ();
	virtual void slotSpeedMinus  ();
	virtual void slotStartSeekPos();
	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;
	//Q3ToolBar       *m_pToolBarPrevious; //ooo
    QToolBar       *m_pToolBarPrevious;    //xxx
	QComboBox      *m_pComboPrevious;
	//Q3PopupMenu     *m_pLanguagePopup;   //ooo
    QMenu          *m_pLanguagePopup;      //xxx  
	//Q3GridLayout    *m_pVideoLayout;     //ooo
	QGridLayout    *m_pVideoLayout;        //xxx
	QTranslator    *m_pTranslator;
	QString         m_qsFileName;
	float           m_fSpeed;
	QStringList     m_listHistory;
	int             m_iIsPlaying;
	bool            m_bIgnoreSliderPos;
	int             m_iSubtitleTrack;
	int             m_iAudioTrack;
};

#endif // QXINE_H
