]> git.sesse.net Git - vlc/blob - modules/gui/qt4/components/interface_widgets.hpp
qt4 : QT4 album art in allways-video.
[vlc] / modules / gui / qt4 / components / interface_widgets.hpp
1 /*****************************************************************************
2  * interface_widgets.hpp : Custom widgets for the main interface
3  ****************************************************************************
4  * Copyright (C) 2006 the VideoLAN team
5  * $Id$
6  *
7  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #ifndef _INTFWIDGETS_H_
25 #define _INTFWIDGETS_H_
26
27 #include <vlc/vlc.h>
28 #include <vlc_interface.h>
29
30 #include "qt4.hpp"
31
32 #include <QWidget>
33 #include <QFrame>
34
35 class ResizeEvent;
36 class QPalette;
37 class QPixmap;
38 class QLabel;
39 class QHBoxLayout;
40
41 /******************** Video Widget ****************/
42 class VideoWidget : public QFrame
43 {
44     Q_OBJECT
45 public:
46     VideoWidget( intf_thread_t * );
47     virtual ~VideoWidget();
48
49     void *request( vout_thread_t *, int *, int *,
50                    unsigned int *, unsigned int * );
51     void release( void * );
52     int control( void *, int, va_list );
53
54     int i_video_height, i_video_width;
55     vout_thread_t *p_vout;
56
57     QSize widgetSize;
58     virtual QSize sizeHint() const;
59 private:
60     QWidget *frame;
61     intf_thread_t *p_intf;
62     vlc_mutex_t lock;
63 };
64
65 /******************** Background Widget ****************/
66 class BackgroundWidget : public QFrame
67 {
68     Q_OBJECT
69 public:
70     BackgroundWidget( intf_thread_t * );
71     virtual ~BackgroundWidget();
72     QSize widgetSize;
73     virtual QSize sizeHint() const;
74 private:
75     QPalette plt;
76     QLabel *label;
77     QHBoxLayout *backgroundLayout;
78     virtual void resizeEvent( QResizeEvent *e );
79     int DrawBackground();
80     int CleanBackground();
81     intf_thread_t *p_intf;
82 private slots:
83     void setArt( QString );
84 };
85
86 class VisualSelector : public QFrame
87 {
88     Q_OBJECT
89 public:
90     VisualSelector( intf_thread_t *);
91     virtual ~VisualSelector();
92 private:
93     intf_thread_t *p_intf;
94     QLabel *current;
95 private slots:
96     void prev();
97     void next();
98 };
99
100 class QPushButton;
101 class ControlsWidget : public QFrame
102 {
103     Q_OBJECT
104 public:
105     ControlsWidget( intf_thread_t *);
106     virtual ~ControlsWidget();
107     void enableInput( bool );
108     void enableVideo( bool );
109 private:
110     intf_thread_t *p_intf;
111     QPushButton *slowerButton, *normalButton, *fasterButton;
112     QPushButton *fullscreenButton, *snapshotButton;
113 private slots:
114     void faster();
115     void slower();
116     void normal();
117     void snapshot();
118     void fullscreen();
119 };
120
121
122 /******************** Playlist Widgets ****************/
123 #include <QModelIndex>
124 #include <QSplitter>
125 class QSignalMapper;
126 class PLSelector;
127 class PLPanel;
128 class QPushButton;
129
130 class PlaylistWidget : public QSplitter
131 {
132     Q_OBJECT;
133 public:
134     PlaylistWidget( intf_thread_t *_p_i ) ;
135     virtual ~PlaylistWidget();
136     QSize widgetSize;
137     virtual QSize sizeHint() const;
138 private:
139     PLSelector *selector;
140     PLPanel *rightPanel;
141     QPushButton *addButton;
142     QLabel *art;
143     QString prevArt;
144 protected:
145      intf_thread_t *p_intf;
146 private slots:
147     void setArt( QString );
148 signals:
149     void rootChanged( int );
150     void artSet( QString );
151 };
152
153 #endif