source: smplayer/vendor/current/src/videoequalizer.cpp

Last change on this file was 186, checked in by Silvan Scherrer, 9 years ago

SMPlayer: update vendor to 17.1.0

File size: 3.3 KB
RevLine 
[90]1/* smplayer, GUI front-end for mplayer.
[186]2 Copyright (C) 2006-2017 Ricardo Villalba <[email protected]>
[90]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 "videoequalizer.h"
20
[163]21VideoEqualizer::VideoEqualizer( QWidget* parent, Qt::WindowFlags f )
[90]22 : QWidget(parent, f)
23{
[163]24 setupUi(this);
[90]25
[163]26 /*
27 contrast_indicator->setNum(0);
28 brightness_indicator->setNum(0);
29 hue_indicator->setNum(0);
30 saturation_indicator->setNum(0);
31 gamma_indicator->setNum(0);
32 */
[90]33
[163]34 connect( contrast_slider, SIGNAL(valueChanged(int)),
35 contrast_indicator, SLOT(setNum(int)) );
[90]36
[163]37 connect( brightness_slider, SIGNAL(valueChanged(int)),
38 brightness_indicator, SLOT(setNum(int)) );
[90]39
[163]40 connect( hue_slider, SIGNAL(valueChanged(int)),
41 hue_indicator, SLOT(setNum(int)) );
[90]42
[163]43 connect( saturation_slider, SIGNAL(valueChanged(int)),
44 saturation_indicator, SLOT(setNum(int)) );
[90]45
[163]46 connect( gamma_slider, SIGNAL(valueChanged(int)),
47 gamma_indicator, SLOT(setNum(int)) );
48
49 // Reemit signals
50 connect( contrast_slider, SIGNAL(valueChanged(int)),
51 this, SIGNAL(contrastChanged(int)) );
52 connect( brightness_slider, SIGNAL(valueChanged(int)),
53 this, SIGNAL(brightnessChanged(int)) );
54 connect( hue_slider, SIGNAL(valueChanged(int)),
55 this, SIGNAL(hueChanged(int)) );
56 connect( saturation_slider, SIGNAL(valueChanged(int)),
57 this, SIGNAL(saturationChanged(int)) );
58 connect( gamma_slider, SIGNAL(valueChanged(int)),
59 this, SIGNAL(gammaChanged(int)) );
60
61 connect( makedefault_button, SIGNAL(clicked()),
62 this, SIGNAL(requestToChangeDefaultValues()) );
63
[90]64 adjustSize();
65}
66
67VideoEqualizer::~VideoEqualizer() {
68}
69
[163]70void VideoEqualizer::reset() {
71 setContrast(0);
72 setBrightness(0);
73 setHue(0);
74 setSaturation(0);
75 setGamma(0);
[90]76}
77
[163]78void VideoEqualizer::on_reset_button_clicked() {
79 qDebug("VideoEqualizer::on_reset_button_clicked");
80 reset();
[90]81}
82
[163]83void VideoEqualizer::on_bysoftware_check_stateChanged(int state) {
84 qDebug("VideoEqualizer::on_bysoftware_check_stateChanged");
85 emit bySoftwareChanged(state == Qt::Checked);
[90]86}
87
88void VideoEqualizer::hideEvent( QHideEvent * ) {
89 emit visibilityChanged();
90}
91
92void VideoEqualizer::showEvent( QShowEvent * ) {
93 emit visibilityChanged();
94}
95
[163]96void VideoEqualizer::retranslateStrings() {
97 retranslateUi(this);
98
99 // What's this help:
100 makedefault_button->setWhatsThis(
101 tr("Use the current values as default values for new videos.") );
102
103 reset_button->setWhatsThis( tr("Set all controls to zero.") );
104}
105
[90]106// Language change stuff
107void VideoEqualizer::changeEvent(QEvent *e) {
108 if (e->type() == QEvent::LanguageChange) {
109 retranslateStrings();
110 } else {
111 QWidget::changeEvent(e);
112 }
113}
114
115#include "moc_videoequalizer.cpp"
Note: See TracBrowser for help on using the repository browser.