| 1 | /* smplayer, GUI front-end for mplayer.
|
|---|
| 2 | Copyright (C) 2006-2013 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 "videoequalizer2.h"
|
|---|
| 20 |
|
|---|
| 21 | VideoEqualizer2::VideoEqualizer2( QWidget* parent, Qt::WindowFlags f )
|
|---|
| 22 | : QWidget(parent, f)
|
|---|
| 23 | {
|
|---|
| 24 | setupUi(this);
|
|---|
| 25 |
|
|---|
| 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 | */
|
|---|
| 33 |
|
|---|
| 34 | connect( contrast_slider, SIGNAL(valueChanged(int)),
|
|---|
| 35 | contrast_indicator, SLOT(setNum(int)) );
|
|---|
| 36 |
|
|---|
| 37 | connect( brightness_slider, SIGNAL(valueChanged(int)),
|
|---|
| 38 | brightness_indicator, SLOT(setNum(int)) );
|
|---|
| 39 |
|
|---|
| 40 | connect( hue_slider, SIGNAL(valueChanged(int)),
|
|---|
| 41 | hue_indicator, SLOT(setNum(int)) );
|
|---|
| 42 |
|
|---|
| 43 | connect( saturation_slider, SIGNAL(valueChanged(int)),
|
|---|
| 44 | saturation_indicator, SLOT(setNum(int)) );
|
|---|
| 45 |
|
|---|
| 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 |
|
|---|
| 64 | adjustSize();
|
|---|
| 65 | }
|
|---|
| 66 |
|
|---|
| 67 | VideoEqualizer2::~VideoEqualizer2() {
|
|---|
| 68 | }
|
|---|
| 69 |
|
|---|
| 70 | void VideoEqualizer2::reset() {
|
|---|
| 71 | setContrast(0);
|
|---|
| 72 | setBrightness(0);
|
|---|
| 73 | setHue(0);
|
|---|
| 74 | setSaturation(0);
|
|---|
| 75 | setGamma(0);
|
|---|
| 76 | }
|
|---|
| 77 |
|
|---|
| 78 | void VideoEqualizer2::on_reset_button_clicked() {
|
|---|
| 79 | qDebug("VideoEqualizer2::on_reset_button_clicked");
|
|---|
| 80 | reset();
|
|---|
| 81 | }
|
|---|
| 82 |
|
|---|
| 83 | void VideoEqualizer2::on_bysoftware_check_stateChanged(int state) {
|
|---|
| 84 | qDebug("VideoEqualizer2::on_bysoftware_check_stateChanged");
|
|---|
| 85 | emit bySoftwareChanged(state == Qt::Checked);
|
|---|
| 86 | }
|
|---|
| 87 |
|
|---|
| 88 | void VideoEqualizer2::hideEvent( QHideEvent * ) {
|
|---|
| 89 | emit visibilityChanged();
|
|---|
| 90 | }
|
|---|
| 91 |
|
|---|
| 92 | void VideoEqualizer2::showEvent( QShowEvent * ) {
|
|---|
| 93 | emit visibilityChanged();
|
|---|
| 94 | }
|
|---|
| 95 |
|
|---|
| 96 | void VideoEqualizer2::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 |
|
|---|
| 106 | // Language change stuff
|
|---|
| 107 | void VideoEqualizer2::changeEvent(QEvent *e) {
|
|---|
| 108 | if (e->type() == QEvent::LanguageChange) {
|
|---|
| 109 | retranslateStrings();
|
|---|
| 110 | } else {
|
|---|
| 111 | QWidget::changeEvent(e);
|
|---|
| 112 | }
|
|---|
| 113 | }
|
|---|
| 114 |
|
|---|
| 115 | #include "moc_videoequalizer2.cpp"
|
|---|