input_slider.hpp

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * input_slider.hpp : A slider that controls an input
00003  ****************************************************************************
00004  * Copyright (C) 2006 the VideoLAN team
00005  * $Id$
00006  *
00007  * Authors: Clément Stenac <zorglub@videolan.org>
00008  *          Jean-Baptiste Kempf <jb@videolan.org>
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00023  *****************************************************************************/
00024 
00025 #ifndef _INPUTSLIDER_H_
00026 #define _INPUTSLIDER_H_
00027 
00028 #include "qt4.hpp"
00029 
00030 #include <QSlider>
00031 #include <QMouseEvent>
00032 
00033 class InputSlider : public QSlider
00034 {
00035     Q_OBJECT
00036 public:
00037     InputSlider( QWidget *_parent );
00038     InputSlider( Qt::Orientation q,QWidget *_parent );
00039     virtual ~InputSlider()   {};
00040 protected:
00041     virtual void mouseMoveEvent(QMouseEvent *event);
00042     virtual void mousePressEvent(QMouseEvent* event);
00043     virtual void mouseReleaseEvent(QMouseEvent* event);
00044 private:
00045     bool b_sliding;
00046     int inputLength;
00047     char psz_length[MSTRTIME_MAX_SIZE];
00048 public slots:
00049     void setPosition( float, int, int );
00050 private slots:
00051     void userDrag( int );
00052 signals:
00053     void sliderDragged( float );
00054 };
00055 
00056 
00057 class QPaintEvent;
00058 #include <QAbstractSlider>
00059 
00060 class SoundSlider : public QAbstractSlider
00061 {
00062     Q_OBJECT
00063 public:
00064     SoundSlider( QWidget *_parent, int _i_step, bool b_softamp, char * );
00065     virtual ~SoundSlider() {};
00066 
00067 protected:
00068     const static int paddingL = 4;
00069     const static int paddingR = 2;
00070     virtual void paintEvent(QPaintEvent *);
00071     virtual void wheelEvent( QWheelEvent *event );
00072     virtual void mousePressEvent( QMouseEvent * );
00073     virtual void mouseMoveEvent( QMouseEvent * );
00074     virtual void mouseReleaseEvent( QMouseEvent * );
00075 private:
00076     bool b_sliding;
00077     bool b_outside;
00078     int i_oldvalue;
00079     float f_step;
00080     void changeValue( int x );
00081     QPixmap pixGradient;
00082     QPixmap pixOutside;
00083 };
00084 
00085 #endif

Generated on Wed Aug 13 08:02:38 2008 for VLC by  doxygen 1.5.1