1 /************************************************************************
3 * Copyright 2010 Jakob Leben (jakob.leben@gmail.com)
5 * This file is part of SuperCollider Qt GUI.
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 ************************************************************************/
22 #ifndef QC_LEVEL_INDICATOR_H
23 #define QC_LEVEL_INDICATOR_H
25 #include "../QcHelper.h"
30 class QcLevelIndicator
: public QWidget
, public QcHelper
33 Q_PROPERTY( float value READ dummyFloat WRITE setValue
);
34 Q_PROPERTY( float warning READ dummyFloat WRITE setWarning
);
35 Q_PROPERTY( float critical READ dummyFloat WRITE setCritical
);
36 Q_PROPERTY( float peak READ dummyFloat WRITE setPeak
);
37 Q_PROPERTY( bool drawPeak READ dummyBool WRITE setDrawPeak
);
38 Q_PROPERTY( int ticks READ dummyInt WRITE setTicks
);
39 Q_PROPERTY( int majorTicks READ dummyInt WRITE setMajorTicks
);
43 void setValue( float f
) { _value
= f
; update(); }
44 void setWarning( float f
) { _warning
= f
; update(); }
45 void setCritical( float f
) { _critical
= f
; update(); }
46 void setPeak( float f
) { _peak
= f
; update(); }
47 void setDrawPeak( bool b
) { _drawPeak
= b
; update(); }
48 void setTicks( int i
) { _ticks
= qMax(i
,0); update(); }
49 void setMajorTicks( int i
) { _majorTicks
= qMax(i
,0); update(); }
50 virtual QSize
sizeHint() const { return QSize( 25, 150 ); }
54 void paintEvent( QPaintEvent
*e
);