1 | /* smplayer, GUI front-end for mplayer.
|
---|
2 | Copyright (C) 2006-2012 Ricardo Villalba <rvm@users.sourceforge.net>
|
---|
3 |
|
---|
4 | This program is free software; you can redistribute it and/or modify
|
---|
5 | it under the terms of the GNU General Public License as published by
|
---|
6 | the Free Software Foundation; either version 2 of the License, or
|
---|
7 | (at your option) any later version.
|
---|
8 |
|
---|
9 | This program is distributed in the hope that it will be useful,
|
---|
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
12 | GNU General Public License for more details.
|
---|
13 |
|
---|
14 | You should have received a copy of the GNU General Public License
|
---|
15 | along with this program; if not, write to the Free Software
|
---|
16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
17 | */
|
---|
18 |
|
---|
19 | #include "eqslider.h"
|
---|
20 | #include <QSlider>
|
---|
21 | #include <QLabel>
|
---|
22 | #include <QPixmap>
|
---|
23 | #include "verticaltext.h"
|
---|
24 |
|
---|
25 |
|
---|
26 | EqSlider::EqSlider( QWidget* parent, Qt::WindowFlags f)
|
---|
27 | : QWidget(parent, f)
|
---|
28 | {
|
---|
29 | setupUi(this);
|
---|
30 |
|
---|
31 | _icon->setText( QString::null );
|
---|
32 | _slider->setFocusPolicy( Qt::StrongFocus );
|
---|
33 | _slider->setTickPosition( QSlider::TicksRight );
|
---|
34 | _slider->setTickInterval( 10 );
|
---|
35 | _slider->setSingleStep( 1 );
|
---|
36 | _slider->setPageStep( 10 );
|
---|
37 |
|
---|
38 | connect( _slider, SIGNAL(valueChanged(int)),
|
---|
39 | this, SLOT(sliderValueChanged(int)) );
|
---|
40 | }
|
---|
41 |
|
---|
42 | EqSlider::~EqSlider() {
|
---|
43 | }
|
---|
44 |
|
---|
45 | /*
|
---|
46 | void EqSlider::languageChange() {
|
---|
47 | }
|
---|
48 | */
|
---|
49 |
|
---|
50 | void EqSlider::setIcon( QPixmap i) {
|
---|
51 | _icon->setPixmap(i);
|
---|
52 | }
|
---|
53 |
|
---|
54 | const QPixmap * EqSlider::icon() const {
|
---|
55 | return _icon->pixmap();
|
---|
56 | }
|
---|
57 |
|
---|
58 | void EqSlider::setLabel( QString s) {
|
---|
59 | _label->setText(s);
|
---|
60 | }
|
---|
61 |
|
---|
62 | QString EqSlider::label() const {
|
---|
63 | return _label->text();
|
---|
64 | }
|
---|
65 |
|
---|
66 | void EqSlider::setValue(int value) {
|
---|
67 | _slider->setValue(value);
|
---|
68 | value_label->setNum(value);
|
---|
69 | }
|
---|
70 |
|
---|
71 | int EqSlider::value() const {
|
---|
72 | return _slider->value();
|
---|
73 | }
|
---|
74 |
|
---|
75 | void EqSlider::sliderValueChanged(int v) {
|
---|
76 | emit valueChanged( v );
|
---|
77 | }
|
---|
78 |
|
---|
79 | #include "moc_eqslider.cpp"
|
---|