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;
67 /******************** Background Widget ****************/
68 class BackgroundWidget : public QFrame
72 BackgroundWidget( intf_thread_t * );
73 virtual ~BackgroundWidget();
75 virtual QSize sizeHint() const;
79 QHBoxLayout *backgroundLayout;
80 virtual void resizeEvent( QResizeEvent *e );
82 int CleanBackground();
83 intf_thread_t *p_intf;
85 void setArt( QString );
88 class VisualSelector : public QFrame
92 VisualSelector( intf_thread_t *);
93 virtual ~VisualSelector();
95 intf_thread_t *p_intf;
103 class AdvControlsWidget : public QFrame
107 AdvControlsWidget( intf_thread_t *);
108 virtual ~AdvControlsWidget();
109 void enableInput( bool );
110 void enableVideo( bool );
112 intf_thread_t *p_intf;
113 QPushButton *slowerButton, *normalButton, *fasterButton;
114 QPushButton *fullscreenButton, *snapshotButton;
126 class VolumeClickHandler;
127 class ControlsWidget : public QFrame
131 ControlsWidget( intf_thread_t *);
132 virtual ~ControlsWidget();
134 QPushButton *playlistButton;
135 QSlider *volumeSlider;
136 void setStatus( int );
138 void setNavigation( int );
139 void updateOnTimer();
141 friend class MainInterface;
142 friend class VolumeClickHandler;
144 intf_thread_t *p_intf;
146 QGridLayout *controlLayout;
148 QPushButton *prevSectionButton, *nextSectionButton, *menuButton;
149 QPushButton *playButton;
155 void updateVolume( int );
161 class VolumeClickHandler : public QObject
164 VolumeClickHandler( intf_thread_t *_p_intf, ControlsWidget *_m ) :QObject(_m)
165 {m = _m; p_intf = _p_intf; }
166 virtual ~VolumeClickHandler() {};
167 bool eventFilter( QObject *obj, QEvent *e )
169 if (e->type() == QEvent::MouseButtonPress )
171 aout_VolumeMute( p_intf, NULL );
178 intf_thread_t *p_intf;
182 /******************** Playlist Widgets ****************/
183 #include <QModelIndex>
190 class PlaylistWidget : public QSplitter
194 PlaylistWidget( intf_thread_t *_p_i ) ;
195 virtual ~PlaylistWidget();
197 virtual QSize sizeHint() const;
199 PLSelector *selector;
201 QPushButton *addButton;
205 intf_thread_t *p_intf;
207 void setArt( QString );
209 void rootChanged( int );
210 void artSet( QString );