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 ************************************************************************/
25 #include "../QcHelper.h"
28 #include <SC_SndBuf.h>
32 class QcScope
: public QWidget
, QcHelper
35 Q_PROPERTY( int bufferNumber READ dummyInt WRITE setBufferNumber
);
36 Q_PROPERTY( float xOffset READ dummyFloat WRITE setXOffset
);
37 Q_PROPERTY( float yOffset READ dummyFloat WRITE setYOffset
);
38 Q_PROPERTY( float xZoom READ dummyFloat WRITE setXZoom
);
39 Q_PROPERTY( float yZoom READ dummyFloat WRITE setYZoom
);
40 Q_PROPERTY( int style READ dummyInt WRITE setStyle
);
41 Q_PROPERTY( VariantList waveColors READ dummyVariantList WRITE setWaveColors
);
42 Q_PROPERTY( QColor background READ background WRITE setBackground
);
43 Q_PROPERTY( int updateInterval READ updateInterval WRITE setUpdateInterval
);
48 void setBufferNumber( int );
49 void setXOffset( float f
) { xOffset
= f
; }
50 void setYOffset( float f
) { yOffset
= f
; }
51 void setXZoom( float f
) { xZoom
= f
; }
52 void setYZoom( float f
) { yZoom
= f
; }
53 void setStyle( int i
) { style
= i
; }
54 void setWaveColors( const VariantList
& colors
);
55 QColor
background() const { return _bkg
; }
56 void setBackground( const QColor
&c
) { _bkg
= c
; update(); }
57 int updateInterval() const;
58 void setUpdateInterval( int i
);
59 QSize
sizeHint() const { return QSize( 500, 300 ); }
60 QSize
minimumSizeHint() const { return QSize( 50, 50 ); }
64 void paintEvent ( QPaintEvent
* event
);
65 void setPoint( QPointF
& pt
,
66 float frame
, float data
, float xRatio
, float yRatio
,
67 int xStart
, int yStart
);
68 void paint1D( bool overlapped
, QPainter
& );
69 void paint2D( QPainter
& );