]> git.sesse.net Git - vlc/blob - modules/gui/qt4/util/input_slider.hpp
Qt4 - Add an option to have the volume slider from 0 to 400 %. Close #952 Close ...
[vlc] / modules / gui / qt4 / util / input_slider.hpp
1 /*****************************************************************************
2  * input_slider.hpp : A slider that controls an input
3  ****************************************************************************
4  * Copyright (C) 2006 the VideoLAN team
5  * $Id$
6  *
7  * Authors: ClĂ©ment Stenac <zorglub@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 _INPUTSLIDER_H_
25 #define _INPUTSLIDER_H_
26
27 #include "util/directslider.hpp"
28
29 class InputSlider : public DirectSlider
30 {
31     Q_OBJECT
32 public:
33     InputSlider( QWidget *_parent );
34     InputSlider( Qt::Orientation q,QWidget *_parent );
35     virtual ~InputSlider()   {};
36 protected:
37     void mouseMoveEvent(QMouseEvent *event);
38 private:
39     bool mymove;
40     int inputLength;
41 public slots:
42     void setPosition( float, int, int );
43 private slots:
44     void userDrag( int );
45 signals:
46     void sliderDragged( float );
47 };
48
49
50 class QPaintEvent;
51 #include <QAbstractSlider>
52
53 class SoundSlider : public QAbstractSlider
54 {
55     Q_OBJECT
56 public:
57     SoundSlider( QWidget *_parent, bool b_softamp );
58     virtual ~SoundSlider() {};
59 protected:
60     int padding;
61     virtual void paintEvent(QPaintEvent *);
62     virtual void wheelEvent( QWheelEvent *event );
63     virtual void mousePressEvent( QMouseEvent * );
64     virtual void mouseMoveEvent( QMouseEvent * );
65     virtual void mouseReleaseEvent( QMouseEvent * );
66 private:
67     bool b_sliding;
68     bool b_outside;
69     int i_oldvalue;
70     void changeValue( int x );
71     QPixmap pixGradient;
72     QPixmap pixLimit;
73 };
74
75 #endif