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"
26 #include "../style/style.hpp"
31 class QcLevelIndicator
: public QWidget
, QcHelper
, QtCollider::Style::Client
34 Q_PROPERTY( float value READ dummyFloat WRITE setValue
);
35 Q_PROPERTY( float warning READ dummyFloat WRITE setWarning
);
36 Q_PROPERTY( float critical READ dummyFloat WRITE setCritical
);
37 Q_PROPERTY( float peak READ dummyFloat WRITE setPeak
);
38 Q_PROPERTY( bool drawPeak READ dummyBool WRITE setDrawPeak
);
39 Q_PROPERTY( int ticks READ dummyInt WRITE setTicks
);
40 Q_PROPERTY( int majorTicks READ dummyInt WRITE setMajorTicks
);
44 void setValue( float f
) { _value
= f
; update(); }
45 void setWarning( float f
) { _warning
= f
; update(); }
46 void setCritical( float f
) { _critical
= f
; update(); }
47 void setPeak( float f
) { _peak
= f
; update(); }
48 void setDrawPeak( bool b
) { _drawPeak
= b
; update(); }
49 void setTicks( int i
) { _ticks
= qMax(i
,0); update(); }
50 void setMajorTicks( int i
) { _majorTicks
= qMax(i
,0); update(); }
51 virtual QSize
sizeHint() const { return QSize( 25, 150 ); }
55 void paintEvent( QPaintEvent
*e
);