File indexing completed on 2024-05-19 16:31:47
0001 /* 0002 * A horizontal slider and a text field for the gamma value. 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-or-later 0005 * 0006 * SPDX-FileCopyrightText: 2001 Michael v.Ostheim <MvOstheim@web> 0007 */ 0008 0009 #ifndef GAMMACTRL_H 0010 #define GAMMACTRL_H 0011 0012 #include <qslider.h> 0013 0014 class QString; 0015 class DisplayNumber; 0016 class XVidExtWrap; 0017 0018 class GammaCtrl : public QWidget 0019 { 0020 Q_OBJECT 0021 public: 0022 /** construktor */ 0023 explicit GammaCtrl(QWidget *parent = nullptr, 0024 XVidExtWrap *xvid = nullptr, 0025 int channel = 0, 0026 const QString &mingamma = QStringLiteral("0.40"), 0027 const QString &maxgamma = QStringLiteral("3.50"), 0028 const QString &setgamma = QStringLiteral("1.00")); 0029 /** destruktor */ 0030 ~GammaCtrl() override; 0031 /** Return the current gamma value with precision prec */ 0032 QString gamma(int); 0033 /** Set gamma, slider and textfield */ 0034 void setGamma(const QString &); 0035 /** Set slider and textfield */ 0036 void setControl(const QString &); 0037 /** Disable the slider */ 0038 void disableSlider() 0039 { 0040 slider->setDisabled(true); 0041 } 0042 0043 private: 0044 QString mgamma; 0045 QSlider *slider; 0046 DisplayNumber *textfield; 0047 bool suspended, changed; 0048 int gchannel, oldpos; 0049 double ming; 0050 XVidExtWrap *xv; 0051 0052 public Q_SLOTS: 0053 /** Disable textfield */ 0054 void suspend(); 0055 0056 protected Q_SLOTS: 0057 /** Set slider and textfield */ 0058 void setCtrl(int); 0059 /** Set gamma and textfield */ 0060 void setGamma(int); 0061 /** Change status of GammaCtrl when pressed */ 0062 void pressed(); 0063 0064 Q_SIGNALS: 0065 /** Gamma change signal */ 0066 void gammaChanged(int); 0067 }; 0068 0069 #endif