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 *normalButton;
114 QPushButton *snapshotButton;
124 class VolumeClickHandler;
125 class ControlsWidget : public QFrame
129 ControlsWidget( intf_thread_t *);
130 virtual ~ControlsWidget();
132 QPushButton *playlistButton;
133 QSlider *volumeSlider;
134 void setStatus( int );
135 void enableInput( bool );
136 void enableVideo( bool );
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, *fullscreenButton;
150 QPushButton *slowerButton, *fasterButton;
156 void updateVolume( int );
164 class VolumeClickHandler : public QObject
167 VolumeClickHandler( intf_thread_t *_p_intf, ControlsWidget *_m ) :QObject(_m)
168 {m = _m; p_intf = _p_intf; }
169 virtual ~VolumeClickHandler() {};
170 bool eventFilter( QObject *obj, QEvent *e )
172 if (e->type() == QEvent::MouseButtonPress )
174 aout_VolumeMute( p_intf, NULL );
181 intf_thread_t *p_intf;
185 /******************** Playlist Widgets ****************/
186 #include <QModelIndex>
193 class PlaylistWidget : public QSplitter
197 PlaylistWidget( intf_thread_t *_p_i ) ;
198 virtual ~PlaylistWidget();
200 virtual QSize sizeHint() const;
202 PLSelector *selector;
204 QPushButton *addButton;
208 intf_thread_t *p_intf;
210 void setArt( QString );
212 void rootChanged( int );
213 void artSet( QString );