1 /*****************************************************************************
2 * interface_widgets.hpp : Custom widgets for the main interface
3 ****************************************************************************
4 * Copyright (C) 2006-2008 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_
33 #include "main_interface.hpp" /* Interface integration */
34 #include "input_manager.hpp" /* Speed control */
36 #include "components/controller.hpp"
37 #include "components/controller_widget.hpp"
39 //#include <vlc_aout.h> Visualizer
44 #include <QMouseEvent>
52 /******************** Video Widget ****************/
53 class VideoWidget : public QFrame
56 friend class MainInterface;
59 VideoWidget( intf_thread_t * );
60 virtual ~VideoWidget();
62 WId request( int *, int *,
63 unsigned int *, unsigned int *, bool );
65 int control( void *, int, va_list );
67 virtual QSize sizeHint() const;
70 virtual QPaintEngine *paintEngine() const
75 virtual void paintEvent(QPaintEvent *);
78 intf_thread_t *p_intf;
81 QWidget *reparentable;
85 void SetSizing( unsigned int, unsigned int );
86 void SetFullScreen( bool );
89 /******************** Background Widget ****************/
90 class BackgroundWidget : public QWidget
94 BackgroundWidget( intf_thread_t * );
95 virtual ~BackgroundWidget();
100 virtual void contextMenuEvent( QContextMenuEvent *event );
101 intf_thread_t *p_intf;
102 virtual void resizeEvent( QResizeEvent * event );
105 void toggle(){ TOGGLEV( this ); }
106 void updateArt( const QString& );
110 class VisualSelector : public QFrame
114 VisualSelector( intf_thread_t *);
115 virtual ~VisualSelector();
117 intf_thread_t *p_intf;
125 class TimeLabel : public QLabel
129 TimeLabel( intf_thread_t *_p_intf );
131 virtual void mousePressEvent( QMouseEvent *event )
136 virtual void mouseDoubleClickEvent( QMouseEvent *event )
140 emit timeLabelDoubleClicked();
143 intf_thread_t *p_intf;
144 bool b_remainingTime;
145 void toggleTimeDisplay();
147 void timeLabelDoubleClicked();
149 void setDisplayPosition( float pos, int time, int length );
150 void setCaching( float );
153 class SpeedLabel : public QLabel
157 SpeedLabel( intf_thread_t *, const QString&, QWidget * );
158 virtual ~SpeedLabel();
161 virtual void mousePressEvent ( QMouseEvent * event )
163 showSpeedMenu( event->pos() );
166 void showSpeedMenu( QPoint );
169 intf_thread_t *p_intf;
170 QMenu *speedControlMenu;
171 SpeedControlWidget *speedControl;
174 /******************** Speed Control Widgets ****************/
175 class SpeedControlWidget : public QFrame
179 SpeedControlWidget( intf_thread_t *, QWidget * );
180 void updateControls( int );
182 intf_thread_t *p_intf;
183 QSlider *speedSlider;
186 void activateOnState();
189 void updateRate( int );
193 class CoverArtLabel : public QLabel
197 CoverArtLabel( QWidget *parent, intf_thread_t * );
198 virtual ~CoverArtLabel();
201 intf_thread_t *p_intf;
204 void requestUpdate() { emit updateRequested(); };
212 void showArtUpdate( const QString& );
215 void updateRequested();