22#include <QGraphicsView>
23#include <QScopedPointer>
24#include <QGraphicsScene>
33#if defined(DRUMSTICK_STATIC)
34#define DRUMSTICK_WIDGETS_EXPORT
36#if defined(drumstick_widgets_EXPORTS)
37#define DRUMSTICK_WIDGETS_EXPORT Q_DECL_EXPORT
39#define DRUMSTICK_WIDGETS_EXPORT Q_DECL_IMPORT
92 virtual void noteOn(
const int note,
const int vel ) = 0;
98 virtual void noteOff(
const int note,
const int vel ) = 0;
178 Q_PROPERTY(
int baseOctave READ baseOctave WRITE setBaseOctave )
179 Q_PROPERTY(
int numKeys READ numKeys WRITE setNumKeys )
180 Q_PROPERTY(
int rotation READ getRotation WRITE setRotation )
181 Q_PROPERTY( QColor keyPressedColor READ getKeyPressedColor WRITE setKeyPressedColor )
186 Q_PROPERTY(
int transpose READ getTranspose WRITE setTranspose )
187 Q_PROPERTY(
int startKey READ startKey WRITE setStartKey )
188 Q_PROPERTY( QFont labelFont READ font WRITE setFont )
191 Q_CLASSINFO(
"Author",
"Pedro Lopez-Cabanillas <plcl@users.sf.net>")
192 Q_CLASSINFO(
"URL",
"https://sourceforge.net/projects/drumstick")
193 Q_CLASSINFO(
"Version", QT_STRINGIFY(VERSION))
197 explicit PianoKeybd(QWidget *parent =
nullptr);
198 PianoKeybd(
const int baseOctave,
const int numKeys,
const int startKey, QWidget *parent =
nullptr);
201 void setFont(
const QFont &font);
212 bool showColorScale()
const;
213 void setShowColorScale(
const bool show);
215 void useCustomNoteNames(
const QStringList& names);
216 void useStandardNoteNames();
217 QStringList customNoteNames()
const;
218 QStringList standardNoteNames()
const;
221 int baseOctave()
const;
222 void setBaseOctave(
const int baseOctave);
224 int startKey()
const;
226 int getRotation()
const;
227 void setRotation(
int r);
228 QColor getKeyPressedColor()
const;
229 void setKeyPressedColor(
const QColor& c);
230 void resetKeyPressedColor();
239 int getTranspose()
const;
240 void setTranspose(
int t);
241 int getChannel()
const;
242 void setChannel(
const int c);
243 int getVelocity()
const;
244 void setVelocity(
const int v);
246 bool isKeyboardEnabled()
const;
247 void setKeyboardEnabled(
const bool enable );
248 bool isMouseEnabled()
const;
249 void setMouseEnabled(
const bool enable );
250 bool isTouchEnabled()
const;
251 void setTouchEnabled(
const bool enable );
252 bool velocityTint()
const ;
253 void setVelocityTint(
const bool enable );
256 QSize sizeHint()
const override;
259 void resetKeyboardMap();
262 void resetRawKeyboardMap();
263 bool getRawKeyboardMode()
const;
264 void setRawKeyboardMode(
const bool b);
266 void showNoteOn(
const int note, QColor color,
int vel = -1 );
267 void showNoteOn(
const int note,
int vel = -1 );
268 void showNoteOff(
const int note,
int vel = -1 );
271 bool handleKeyPressed(
int keycode)
override;
272 bool handleKeyReleased(
int keycode)
override;
274 void setKeyPicture(
const bool natural,
const QPixmap& pix);
275 QPixmap getKeyPicture(
const bool natural);
277 void setUseKeyPictures(
const bool enable);
278 bool getUseKeyPictures()
const;
280 void setUsingNativeFilter(
const bool newState);
281 bool isUsingNativeFilter()
const;
283 void setOctaveSubscript(
const bool enable);
284 bool octaveSubscript()
const;
286 void setStartKey(
const int startKey);
314 void initDefaultMap();
315 void initScene(
int base,
int num,
int ini,
const QColor& c = QColor());
316 void resizeEvent(QResizeEvent *event)
override;
317 bool viewportEvent(
QEvent *ev)
override;
320 class PianoKeybdPrivate;
321 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.
Piano Palette declarations.