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>
9 * Rafaël Carré <funman@videolanorg>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24 *****************************************************************************/
26 #ifndef _INTFWIDGETS_H_
27 #define _INTFWIDGETS_H_
30 #include <vlc_interface.h>
44 /******************** Video Widget ****************/
45 class VideoWidget : public QFrame
49 VideoWidget( intf_thread_t * );
50 virtual ~VideoWidget();
52 void *request( vout_thread_t *, int *, int *,
53 unsigned int *, unsigned int * );
54 void release( void * );
55 int control( void *, int, va_list );
57 int i_video_height, i_video_width;
58 vout_thread_t *p_vout;
61 virtual QSize sizeHint() const;
64 intf_thread_t *p_intf;
72 /******************** Background Widget ****************/
73 class BackgroundWidget : public QFrame
77 BackgroundWidget( intf_thread_t * );
78 virtual ~BackgroundWidget();
80 virtual QSize sizeHint() const;
84 QHBoxLayout *backgroundLayout;
85 virtual void resizeEvent( QResizeEvent *e );
87 int CleanBackground();
88 intf_thread_t *p_intf;
90 void setArt( QString );
93 class VisualSelector : public QFrame
97 VisualSelector( intf_thread_t *);
98 virtual ~VisualSelector();
100 intf_thread_t *p_intf;
108 class AdvControlsWidget : public QFrame
112 AdvControlsWidget( intf_thread_t *);
113 virtual ~AdvControlsWidget();
114 void enableInput( bool );
115 void enableVideo( bool );
117 intf_thread_t *p_intf;
118 QPushButton *normalButton, *recordButton, *ABButton;
119 QPushButton *snapshotButton, *frameButton;
131 class VolumeClickHandler;
132 class ControlsWidget : public QFrame
136 ControlsWidget( intf_thread_t *, bool );
137 virtual ~ControlsWidget();
139 QPushButton *playlistButton;
140 QSlider *volumeSlider;
141 void setStatus( int );
142 void enableInput( bool );
143 void enableVideo( bool );
145 void setNavigation( int );
146 void updateOnTimer();
148 friend class MainInterface;
149 friend class VolumeClickHandler;
151 intf_thread_t *p_intf;
153 QGridLayout *controlLayout;
155 QPushButton *prevSectionButton, *nextSectionButton, *menuButton;
156 QPushButton *playButton, *fullscreenButton;
157 QPushButton *slowerButton, *fasterButton;
158 AdvControlsWidget *advControls;
159 QLabel *volMuteLabel;
161 bool b_advancedVisible;
167 void updateVolume( int );
173 void toggleAdvanced();
175 void advancedControlsToggled( bool );
178 class VolumeClickHandler : public QObject
181 VolumeClickHandler( intf_thread_t *_p_intf, ControlsWidget *_m ) :QObject(_m)
182 {m = _m; p_intf = _p_intf; }
183 virtual ~VolumeClickHandler() {};
184 bool eventFilter( QObject *obj, QEvent *e )
186 if (e->type() == QEvent::MouseButtonPress )
188 aout_VolumeMute( p_intf, NULL );
189 audio_volume_t i_volume;
190 aout_VolumeGet( p_intf, &i_volume );
191 m->updateVolume( i_volume * 200 /AOUT_VOLUME_MAX );
198 intf_thread_t *p_intf;
202 /******************** Playlist Widgets ****************/
203 #include <QModelIndex>
210 class PlaylistWidget : public QSplitter
214 PlaylistWidget( intf_thread_t *_p_i ) ;
215 virtual ~PlaylistWidget();
217 virtual QSize sizeHint() const;
219 PLSelector *selector;
221 QPushButton *addButton;
225 intf_thread_t *p_intf;
227 void setArt( QString );
229 void rootChanged( int );
230 void artSet( QString );