22 #include <QGraphicsView>
23 #include <QScopedPointer>
24 #include <QGraphicsScene>
80 virtual void noteOn(
const int note,
const int vel ) = 0;
86 virtual void noteOff(
const int note,
const int vel ) = 0;
161 Q_PROPERTY(
int baseOctave READ baseOctave WRITE setBaseOctave )
162 Q_PROPERTY(
int numKeys READ numKeys WRITE setNumKeys )
163 Q_PROPERTY(
int rotation READ getRotation WRITE setRotation )
164 Q_PROPERTY( QColor keyPressedColor READ getKeyPressedColor WRITE setKeyPressedColor )
165 Q_PROPERTY(
LabelVisibility showLabels READ showLabels WRITE setShowLabels )
166 Q_PROPERTY(
LabelAlteration alterations READ labelAlterations WRITE setLabelAlterations )
167 Q_PROPERTY(
LabelOrientation labelOrientation READ labelOrientation WRITE setLabelOrientation )
169 Q_PROPERTY(
int transpose READ getTranspose WRITE setTranspose )
172 Q_CLASSINFO(
"Author",
"Pedro Lopez-Cabanillas <plcl@users.sf.net>")
173 Q_CLASSINFO(
"URL",
"https://sourceforge.net/projects/drumstick")
174 Q_CLASSINFO(
"Version", QT_STRINGIFY(VERSION))
178 explicit PianoKeybd(QWidget *parent =
nullptr);
179 PianoKeybd(
const int baseOctave,
const int numKeys,
const int startKey, QWidget *parent =
nullptr);
188 void setFont(
const QFont &font);
199 bool showColorScale()
const;
200 void setShowColorScale(
const bool show);
202 void useCustomNoteNames(
const QStringList& names);
203 void useStandardNoteNames();
204 QStringList customNoteNames()
const;
205 QStringList standardNoteNames()
const;
208 int baseOctave()
const;
209 void setBaseOctave(
const int baseOctave);
211 int startKey()
const;
213 int getRotation()
const;
214 void setRotation(
int r);
215 QColor getKeyPressedColor()
const;
216 void setKeyPressedColor(
const QColor& c);
217 void resetKeyPressedColor();
226 int getTranspose()
const;
227 void setTranspose(
int t);
228 int getChannel()
const;
229 void setChannel(
const int c);
230 int getVelocity()
const;
231 void setVelocity(
const int v);
233 bool isKeyboardEnabled()
const;
234 void setKeyboardEnabled(
const bool enable );
235 bool isMouseEnabled()
const;
236 void setMouseEnabled(
const bool enable );
237 bool isTouchEnabled()
const;
238 void setTouchEnabled(
const bool enable );
239 bool velocityTint()
const ;
240 void setVelocityTint(
const bool enable );
243 QSize sizeHint()
const override;
246 void resetKeyboardMap();
249 void resetRawKeyboardMap();
250 bool getRawKeyboardMode()
const;
251 void setRawKeyboardMode(
const bool b);
253 void showNoteOn(
const int note, QColor color,
int vel = -1 );
254 void showNoteOn(
const int note,
int vel = -1 );
255 void showNoteOff(
const int note,
int vel = -1 );
258 bool handleKeyPressed(
int keycode)
override;
259 bool handleKeyReleased(
int keycode)
override;
287 void initDefaultMap();
288 void initScene(
int base,
int num,
int ini,
const QColor& c = QColor());
289 void resizeEvent(QResizeEvent *event)
override;
292 class PianoKeybdPrivate;
293 QScopedPointer<PianoKeybdPrivate> d;
The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.
Drumstick visibility macros.
Piano Palette declarations.