2
2
* knob.h - powerful knob-widget
4
* This file is based on the knob-widget of the Qwt Widget Library by Josef Wilgen
4
* This file is based on the knob-widget of the Qwt Widget Library by
6
* Linux MultiMedia Studio
7
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
7
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
9
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
9
11
* This program is free software; you can redistribute it and/or
10
12
* modify it under the terms of the GNU General Public
63
62
knob( int _knob_num, QWidget * _parent, const QString & _name );
75
void setTracking( bool _enable );
76
66
void setHintText( const QString & _txt_before,
77
67
const QString & _txt_after );
78
68
void setLabel( const QString & _txt );
127
virtual void paintEvent( QPaintEvent * _me );
128
virtual void resizeEvent( QResizeEvent * _me );
118
virtual void contextMenuEvent( QContextMenuEvent * _me );
119
virtual void dragEnterEvent( QDragEnterEvent * _dee );
120
virtual void dropEvent( QDropEvent * _de );
129
121
virtual void mousePressEvent( QMouseEvent * _me );
130
122
virtual void mouseReleaseEvent( QMouseEvent * _me );
131
123
virtual void mouseMoveEvent( QMouseEvent * _me );
124
virtual void mouseDoubleClickEvent( QMouseEvent * _me );
125
virtual void paintEvent( QPaintEvent * _me );
126
virtual void resizeEvent( QResizeEvent * _me );
132
127
virtual void wheelEvent( QWheelEvent * _me );
133
virtual void contextMenuEvent( QContextMenuEvent * _me );
135
129
void drawKnob( QPainter * _p );
136
130
void setPosition( const QPoint & _p );
133
// TODO: Need to figure out what is really used by tempoSyncKnob
134
// to get the private/protected attributes sorted out. Right
135
// now, just make everything protected.
140
137
void layoutKnob( bool _update = TRUE );
141
138
float getValue( const QPoint & _p );
142
void getScrollMode( const QPoint & _p, int & _scroll_mode,
144
139
void recalcAngle( void );
146
141
void valueChange( void );
150
145
void buttonReleased( void );
152
void setNewValue( float x, int align = 0 );
147
void setNewValue( float _x, bool _align = FALSE );
155
150
static float s_copiedValue;
156
151
static textFloat * s_textFloat;
161
154
float m_mouseOffset;
164
155
QPoint m_origMousePos;
156
bool m_buttonPressed;
169
160
float m_totalAngle;
172
162
QPixmap * m_knobPixmap;