![]() |
QJackRcd 1.0.4
Simple turnkey Jack recorder
|
00001 /*************************************************************************** 00002 Copyright (C) 2011 - Olivier ROUITS <olivier.rouits@free.fr> 00003 00004 This program is free software; you can redistribute it and/or modify 00005 it under the terms of the GNU General Public License as published by 00006 the Free Software Foundation; either version 2 of the License, or 00007 (at your option) any later version. 00008 00009 This program is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 GNU General Public License for more details. 00013 00014 You should have received a copy of the GNU General Public License 00015 along with this program; if not, write to the 00016 Free Software Foundation, Inc., 00017 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00018 ***************************************************************************/ 00027 #ifndef QJRMETER_H 00028 #define QJRMETER_H 00029 00030 #include <QtGui> 00031 #include <QtDesigner/QDesignerExportWidget> 00032 #include <math.h> 00033 00034 #define QJRM_MAXLEVEL 3 ///< Max DB showable level by the vumeter 00035 #define QJRM_MINLEVEL -40 ///< Min DB showable level by the vumeter 00036 00041 class QDESIGNER_WIDGET_EXPORT QJRMeter : public QWidget 00042 { 00043 Q_OBJECT 00044 Q_PROPERTY(QColor colorBack READ getColorBack WRITE setColorBack); 00045 Q_PROPERTY(QColor colorLevel READ getColorLevel WRITE setColorLevel); 00046 Q_PROPERTY(QColor colorLow READ getColorLow WRITE setColorLow); 00047 Q_PROPERTY(QColor colorHigh READ getColorHigh WRITE setColorHigh); 00048 Q_PROPERTY(double leftLevel READ getLeftLevel WRITE setLeftLevel); 00049 Q_PROPERTY(double rightLevel READ getRightLevel WRITE setRightLevel); 00050 Q_PROPERTY(double compLevel READ getCompLevel WRITE setCompLevel); 00051 00052 QColor getColorBack() const 00053 { 00054 return colorBack; 00055 } 00056 QColor getColorLevel() const 00057 { 00058 return colorLevel; 00059 } 00060 QColor getColorLow() const 00061 { 00062 return colorLow; 00063 } 00064 QColor getColorHigh() const 00065 { 00066 return colorHigh; 00067 } 00068 double getLeftLevel() const 00069 { 00070 return leftLevel; 00071 } 00072 double getRightLevel() const 00073 { 00074 return rightLevel; 00075 } 00076 double getCompLevel() const 00077 { 00078 return compLevel; 00079 } 00080 00081 00082 public: 00083 00084 QJRMeter(QWidget *parent = 0); 00085 QSize minimumSizeHint() const; 00086 QSize sizeHint() const; 00087 00088 00089 signals: 00090 00091 void valueLChanged(double); 00092 void valueRChanged(double); 00093 00094 public slots: 00095 00096 void setColorBack(QColor); 00097 void setColorLevel(QColor); 00098 void setColorHigh(QColor); 00099 void setColorLow(QColor); 00100 void setLeftLevel(double); 00101 void setRightLevel(double); 00102 void setCompLevel(double); 00103 00104 00105 protected: 00106 00107 void paintEvent(QPaintEvent *); 00108 void paintBorder(); 00109 void paintBar(); 00110 00111 private: 00112 00113 double leftLevel; 00114 double rightLevel; 00115 double compLevel; 00116 QColor colorBack; 00117 QColor colorLevel; 00118 QColor colorHigh; 00119 QColor colorLow; 00120 00121 00122 }; 00123 00124 #endif