]> git.sur5r.net Git - minitube/blob - src/videosourcewidget.h
b2d923631ec116a3f171a4ad0ef11d7b9a591246
[minitube] / src / videosourcewidget.h
1 #ifndef VIDEOSOURCEWIDGET_H
2 #define VIDEOSOURCEWIDGET_H
3
4 #include <QtGui>
5
6 class Video;
7 class VideoSource;
8
9 class VideoSourceWidget : public QWidget {
10
11     Q_OBJECT
12
13 public:
14     VideoSourceWidget(VideoSource *videoSource, QWidget *parent = 0);
15
16 signals:
17     void activated(VideoSource *videoSource);
18
19 protected:
20     void paintEvent(QPaintEvent *);
21     void mouseMoveEvent(QMouseEvent *event);
22     void mousePressEvent(QMouseEvent *event);
23     void mouseReleaseEvent(QMouseEvent *event);
24     void enterEvent(QEvent *event);
25     void leaveEvent(QEvent *event);
26     void keyReleaseEvent(QKeyEvent *event);
27
28 private slots:
29     void activate();
30     void previewVideo(QList<Video*> videos);
31     void setPixmapData(QByteArray bytes);
32
33 private:
34     QPixmap playPixmap();
35     VideoSource *videoSource;
36     QPixmap pixmap;
37     Video *video;
38
39     bool hovered;
40     bool pressed;
41 };
42
43 #endif // VIDEOSOURCEWIDGET_H