]> git.sesse.net Git - vlc/blob - modules/gui/qt4/components/controller_widget.hpp
Qt: FSC opacity control between 0.1 and 1.0
[vlc] / modules / gui / qt4 / components / controller_widget.hpp
1 /*****************************************************************************
2  * Controller_widget.cpp : Controller Widget for the controllers
3  ****************************************************************************
4  * Copyright (C) 2006-2008 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Jean-Baptiste Kempf <jb@videolan.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #ifndef _CONTROLLER_WIDGET_H_
25 #define _CONTROLLER_WIDGET_H_
26
27 #ifdef HAVE_CONFIG_H
28 # include "config.h"
29 #endif
30
31 #include "qt4.hpp"
32
33 #include <QWidget>
34 #include <QFrame>
35 #include <QToolButton>
36
37 class QLabel;
38 class QSpinBox;
39 class QAbstractSlider;
40
41 /**
42  * SPECIAL Widgets that are a bit more than just a ToolButton
43  * and have an icon/behaviour that changes depending on the context:
44  * - playButton
45  * - A->B Button
46  * - Teletext group buttons
47  * - Sound Widget group
48  **/
49 class PlayButton : public QToolButton
50 {
51     Q_OBJECT
52 private slots:
53     void updateButton( bool );
54 };
55
56 class AtoB_Button : public QToolButton
57 {
58     Q_OBJECT
59 private slots:
60     void setIcons( bool, bool );
61 };
62
63 #define VOLUME_MAX 200
64 class SoundWidget : public QWidget
65 {
66     Q_OBJECT
67
68 public:
69     SoundWidget( QWidget *parent, intf_thread_t  *_p_i, bool,
70                  bool b_special = false );
71     virtual ~SoundWidget();
72
73 private:
74     intf_thread_t       *p_intf;
75     QLabel              *volMuteLabel;
76     QAbstractSlider     *volumeSlider;
77     QFrame              *volumeControlWidget;
78     bool                 b_my_volume;
79     QMenu               *volumeMenu;
80     virtual bool eventFilter( QObject *obj, QEvent *e );
81 protected slots:
82     void updateVolume( int );
83     void updateVolume( void );
84     void showVolumeMenu( QPoint pos );
85 };
86
87 #endif