[112] | 1 | /* smplayer, GUI front-end for mplayer.
|
---|
[188] | 2 | Copyright (C) 2006-2017 Ricardo Villalba <rvm@users.sourceforge.net>
|
---|
[112] | 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 |
|
---|
[165] | 21 | VideoEqualizer::VideoEqualizer( QWidget* parent, Qt::WindowFlags f )
|
---|
[112] | 22 | : QWidget(parent, f)
|
---|
| 23 | {
|
---|
[165] | 24 | setupUi(this);
|
---|
[112] | 25 |
|
---|
[165] | 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 | */
|
---|
[112] | 33 |
|
---|
[165] | 34 | connect( contrast_slider, SIGNAL(valueChanged(int)),
|
---|
| 35 | contrast_indicator, SLOT(setNum(int)) );
|
---|
[112] | 36 |
|
---|
[165] | 37 | connect( brightness_slider, SIGNAL(valueChanged(int)),
|
---|
| 38 | brightness_indicator, SLOT(setNum(int)) );
|
---|
[112] | 39 |
|
---|
[165] | 40 | connect( hue_slider, SIGNAL(valueChanged(int)),
|
---|
| 41 | hue_indicator, SLOT(setNum(int)) );
|
---|
[112] | 42 |
|
---|
[165] | 43 | connect( saturation_slider, SIGNAL(valueChanged(int)),
|
---|
| 44 | saturation_indicator, SLOT(setNum(int)) );
|
---|
[112] | 45 |
|
---|
[165] | 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 |
|
---|
[112] | 64 | adjustSize();
|
---|
| 65 | }
|
---|
| 66 |
|
---|
| 67 | VideoEqualizer::~VideoEqualizer() {
|
---|
| 68 | }
|
---|
| 69 |
|
---|
[165] | 70 | void VideoEqualizer::reset() {
|
---|
| 71 | setContrast(0);
|
---|
| 72 | setBrightness(0);
|
---|
| 73 | setHue(0);
|
---|
| 74 | setSaturation(0);
|
---|
| 75 | setGamma(0);
|
---|
[112] | 76 | }
|
---|
| 77 |
|
---|
[165] | 78 | void VideoEqualizer::on_reset_button_clicked() {
|
---|
| 79 | qDebug("VideoEqualizer::on_reset_button_clicked");
|
---|
| 80 | reset();
|
---|
[112] | 81 | }
|
---|
| 82 |
|
---|
[165] | 83 | void VideoEqualizer::on_bysoftware_check_stateChanged(int state) {
|
---|
| 84 | qDebug("VideoEqualizer::on_bysoftware_check_stateChanged");
|
---|
| 85 | emit bySoftwareChanged(state == Qt::Checked);
|
---|
[112] | 86 | }
|
---|
| 87 |
|
---|
| 88 | void VideoEqualizer::hideEvent( QHideEvent * ) {
|
---|
| 89 | emit visibilityChanged();
|
---|
| 90 | }
|
---|
| 91 |
|
---|
| 92 | void VideoEqualizer::showEvent( QShowEvent * ) {
|
---|
| 93 | emit visibilityChanged();
|
---|
| 94 | }
|
---|
| 95 |
|
---|
[165] | 96 | void 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 |
|
---|
[112] | 106 | // Language change stuff
|
---|
| 107 | void 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"
|
---|