22#include <QGraphicsView>
23#include <QScopedPointer>
24#include <QGraphicsScene>
82 virtual void noteOn(
const int note,
const int vel ) = 0;
88 virtual void noteOff(
const int note,
const int vel ) = 0;
168 Q_PROPERTY(
int baseOctave READ baseOctave WRITE setBaseOctave )
169 Q_PROPERTY(
int numKeys READ numKeys WRITE setNumKeys )
170 Q_PROPERTY(
int rotation READ getRotation WRITE setRotation )
171 Q_PROPERTY( QColor keyPressedColor READ getKeyPressedColor WRITE setKeyPressedColor )
176 Q_PROPERTY(
int transpose READ getTranspose WRITE setTranspose )
177 Q_PROPERTY(
int startKey READ startKey WRITE setStartKey )
178 Q_PROPERTY( QFont labelFont READ font WRITE setFont )
181 Q_CLASSINFO(
"Author",
"Pedro Lopez-Cabanillas <plcl@users.sf.net>")
182 Q_CLASSINFO(
"URL",
"https://sourceforge.net/projects/drumstick")
183 Q_CLASSINFO(
"Version", QT_STRINGIFY(VERSION))
187 explicit PianoKeybd(QWidget *parent =
nullptr);
188 PianoKeybd(
const int baseOctave,
const int numKeys,
const int startKey, QWidget *parent =
nullptr);
191 void setFont(
const QFont &font);
202 bool showColorScale()
const;
203 void setShowColorScale(
const bool show);
205 void useCustomNoteNames(
const QStringList& names);
206 void useStandardNoteNames();
207 QStringList customNoteNames()
const;
208 QStringList standardNoteNames()
const;
211 int baseOctave()
const;
212 void setBaseOctave(
const int baseOctave);
214 int startKey()
const;
216 int getRotation()
const;
217 void setRotation(
int r);
218 QColor getKeyPressedColor()
const;
219 void setKeyPressedColor(
const QColor& c);
220 void resetKeyPressedColor();
229 int getTranspose()
const;
230 void setTranspose(
int t);
231 int getChannel()
const;
232 void setChannel(
const int c);
233 int getVelocity()
const;
234 void setVelocity(
const int v);
236 bool isKeyboardEnabled()
const;
237 void setKeyboardEnabled(
const bool enable );
238 bool isMouseEnabled()
const;
239 void setMouseEnabled(
const bool enable );
240 bool isTouchEnabled()
const;
241 void setTouchEnabled(
const bool enable );
242 bool velocityTint()
const ;
243 void setVelocityTint(
const bool enable );
246 QSize sizeHint()
const override;
249 void resetKeyboardMap();
252 void resetRawKeyboardMap();
253 bool getRawKeyboardMode()
const;
254 void setRawKeyboardMode(
const bool b);
256 void showNoteOn(
const int note, QColor color,
int vel = -1 );
257 void showNoteOn(
const int note,
int vel = -1 );
258 void showNoteOff(
const int note,
int vel = -1 );
261 bool handleKeyPressed(
int keycode)
override;
262 bool handleKeyReleased(
int keycode)
override;
264 void setKeyPicture(
const bool natural,
const QPixmap& pix);
265 QPixmap getKeyPicture(
const bool natural);
267 void setUseKeyPictures(
const bool enable);
268 bool getUseKeyPictures()
const;
270 void setUsingNativeFilter(
const bool newState);
271 bool isUsingNativeFilter()
const;
273 void setOctaveSubscript(
const bool enable);
274 bool octaveSubscript()
const;
276 void setStartKey(
const int startKey);
304 void initDefaultMap();
305 void initScene(
int base,
int num,
int ini,
const QColor& c = QColor());
306 void resizeEvent(QResizeEvent *event)
override;
307 bool viewportEvent(
QEvent *ev)
override;
310 class PianoKeybdPrivate;
311 QScopedPointer<PianoKeybdPrivate> d;
The QEvent class is the base class of all event classes.
The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.
Drumstick visibility macros.
Piano Palette declarations.