#ifndef media_H
#define media_H
#include <QLabel>
#include <QListWidget>
#include "panelmedia.h"

class media : public QLabel
{
	Q_OBJECT
	public:
		media(QWidget *, panelmedia *);
	public:
		panelmedia *hdlpar;
		QPixmap image;
		QPixmap miniature;
		QString pathname_media;
		QString wl_width;
		QString wl_height;
		QString wl_fps;
		QString wl_duree;
		QString wl_format;
		QString wl_audio_channel;
		QString wl_vbitrate;
		QString wl_vbitrate_encode;
		QString wl_sub_path;
		QString wl_video_sync;
		int isdvd;
		int oldisdvd;
		long dvdsize;
		int is_select;
		int is_lock;
		int is_drag;
		int already_encode;
		int hue;
		int saturation;
		int contraste;
		int lumiere;
		int isdvdintro;

		QAction *action_delete;
		QAction *action_chapitrer;
		QAction *action_thumb;
		QAction *action_reencode;
		QAction *action_force_reencode;
		QAction *action_sub_load;
		QAction *action_sub_cancel;
		QAction *action_soundtrack;
		QAction *action_reglages;
		QAction *action_introdvd;
		QAction *action_introdvd_cancel;

		QString chapitres[40];
		QIcon icones_chapitres[40];
		QString table_soundtrack[8];
		int nbre_chapitres;

		QPoint oldpos;
		QPoint position;

	private:
		QPoint dragPosition;
	signals:
		void delete_media(media*);
		void encode_media(media*);
		void chapitre_media(media*);
		void select_media(media*,int);
		void affiche_info(media*);
		void thumbnail_media(media*);
		void cache_info(media*);
		void soundtrack(media*);
		void effets(media*);
		void introdvd(media*);

	public slots:
		void del_media();
		void cha_media();
		void thu_media();
		void ren_media();
		void force_ren_media();
		void f_effets();
		void f_load_sub();
		void f_cancel_sub();
		void f_soundtrack();
		void f_introdvd();
	protected:
		void contextMenuEvent(QContextMenuEvent *);
		void paintEvent(QPaintEvent *);
		void mousePressEvent(QMouseEvent *);
		void mouseMoveEvent(QMouseEvent *);
		void mouseReleaseEvent(QMouseEvent *);
		void enterEvent(QEvent *);
		void leaveEvent(QEvent *);
};
#endif
