1 /*****************************************************************************
2 * interface_widgets.hpp : Custom widgets for the main interface
3 ****************************************************************************
4 * Copyright (C) 2006 the VideoLAN team
7 * Authors: Clément Stenac <zorglub@videolan.org>
8 * Jean-Baptiste Kempf <jb@videolan.org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 #ifndef _INTFWIDGETS_H_
26 #define _INTFWIDGETS_H_
29 #include <vlc_interface.h>
43 /******************** Video Widget ****************/
44 class VideoWidget : public QFrame
48 VideoWidget( intf_thread_t * );
49 virtual ~VideoWidget();
51 void *request( vout_thread_t *, int *, int *,
52 unsigned int *, unsigned int * );
53 void release( void * );
54 int control( void *, int, va_list );
56 int i_video_height, i_video_width;
57 vout_thread_t *p_vout;
60 virtual QSize sizeHint() const;
63 intf_thread_t *p_intf;
71 /******************** Background Widget ****************/
72 class BackgroundWidget : public QFrame
76 BackgroundWidget( intf_thread_t * );
77 virtual ~BackgroundWidget();
79 virtual QSize sizeHint() const;
83 QHBoxLayout *backgroundLayout;
84 virtual void resizeEvent( QResizeEvent *e );
86 int CleanBackground();
87 intf_thread_t *p_intf;
89 void setArt( QString );
92 class VisualSelector : public QFrame
96 VisualSelector( intf_thread_t *);
97 virtual ~VisualSelector();
99 intf_thread_t *p_intf;
107 class AdvControlsWidget : public QFrame
111 AdvControlsWidget( intf_thread_t *);
112 virtual ~AdvControlsWidget();
113 void enableInput( bool );
114 void enableVideo( bool );
116 intf_thread_t *p_intf;
117 QPushButton *normalButton, *recordButton, *ABButton;
118 QPushButton *snapshotButton, *frameButton;
130 class VolumeClickHandler;
131 class ControlsWidget : public QFrame
135 ControlsWidget( intf_thread_t *, bool );
136 virtual ~ControlsWidget();
138 QPushButton *playlistButton;
139 QSlider *volumeSlider;
140 void setStatus( int );
141 void enableInput( bool );
142 void enableVideo( bool );
144 void setNavigation( int );
145 void updateOnTimer();
147 friend class MainInterface;
148 friend class VolumeClickHandler;
150 intf_thread_t *p_intf;
152 QGridLayout *controlLayout;
154 QPushButton *prevSectionButton, *nextSectionButton, *menuButton;
155 QPushButton *playButton, *fullscreenButton;
156 QPushButton *slowerButton, *fasterButton;
157 AdvControlsWidget *advControls;
159 bool b_advancedVisible;
165 void updateVolume( int );
171 void toggleAdvanced();
173 void advancedControlsShowed( bool );
176 class VolumeClickHandler : public QObject
179 VolumeClickHandler( intf_thread_t *_p_intf, ControlsWidget *_m ) :QObject(_m)
180 {m = _m; p_intf = _p_intf; }
181 virtual ~VolumeClickHandler() {};
182 bool eventFilter( QObject *obj, QEvent *e )
184 if (e->type() == QEvent::MouseButtonPress )
186 aout_VolumeMute( p_intf, NULL );
193 intf_thread_t *p_intf;
197 /******************** Playlist Widgets ****************/
198 #include <QModelIndex>
205 class PlaylistWidget : public QSplitter
209 PlaylistWidget( intf_thread_t *_p_i ) ;
210 virtual ~PlaylistWidget();
212 virtual QSize sizeHint() const;
214 PLSelector *selector;
216 QPushButton *addButton;
220 intf_thread_t *p_intf;
222 void setArt( QString );
224 void rootChanged( int );
225 void artSet( QString );