drumstick  2.2.0
pianokeybd.cpp
Go to the documentation of this file.
1 /*
2  Virtual Piano Widget for Qt5
3  Copyright (C) 2008-2021, Pedro Lopez-Cabanillas <plcl@users.sf.net>
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 3 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License along
16  with this program; If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #include <QApplication>
20 #include <drumstick/pianokeybd.h>
21 #include "pianoscene.h"
22 
34 namespace drumstick { namespace widgets {
35 
40  {Qt::Key_Z, 12},
41  {Qt::Key_S, 13},
42  {Qt::Key_X, 14},
43  {Qt::Key_D, 15},
44  {Qt::Key_C, 16},
45  {Qt::Key_V, 17},
46  {Qt::Key_G, 18},
47  {Qt::Key_B, 19},
48  {Qt::Key_H, 20},
49  {Qt::Key_N, 21},
50  {Qt::Key_J, 22},
51  {Qt::Key_M, 23},
52  {Qt::Key_Q, 24},
53  {Qt::Key_2, 25},
54  {Qt::Key_W, 26},
55  {Qt::Key_3, 27},
56  {Qt::Key_E, 28},
57  {Qt::Key_R, 29},
58  {Qt::Key_5, 30},
59  {Qt::Key_T, 31},
60  {Qt::Key_6, 32},
61  {Qt::Key_Y, 33},
62  {Qt::Key_7, 34},
63  {Qt::Key_U, 35},
64  {Qt::Key_I, 36},
65  {Qt::Key_9, 37},
66  {Qt::Key_O, 38},
67  {Qt::Key_0, 39},
68  {Qt::Key_P, 40}
69 };
70 
75 #if defined(Q_OS_LINUX)
76  {94, 11},
77  {52, 12},
78  {39, 13},
79  {53, 14},
80  {40, 15},
81  {54, 16},
82  {55, 17},
83  {42, 18},
84  {56, 19},
85  {43, 20},
86  {57, 21},
87  {44, 22},
88  {58, 23},
89  {59, 24},
90  {46, 25},
91  {60, 26},
92  {47, 27},
93  {61, 28},
94 
95  {24, 29},
96  {11, 30},
97  {25, 31},
98  {12, 32},
99  {26, 33},
100  {13, 34},
101  {27, 35},
102  {28, 36},
103  {15, 37},
104  {29, 38},
105  {16, 39},
106  {30, 40},
107  {31, 41},
108  {18, 42},
109  {32, 43},
110  {19, 44},
111  {33, 45},
112  {20, 46},
113  {34, 47},
114  {35, 48}
115 #endif
116 
117 #if defined(Q_OS_WIN)
118  {86, 11},
119  {44, 12},
120  {31, 13},
121  {45, 14},
122  {32, 15},
123  {46, 16},
124  {47, 17},
125  {34, 18},
126  {48, 19},
127  {35, 20},
128  {49, 21},
129  {36, 22},
130  {50, 23},
131  {51, 24},
132  {38, 25},
133  {52, 26},
134  {39, 27},
135  {53, 28},
136 
137  {16, 29},
138  {3, 30},
139  {17, 31},
140  {4, 32},
141  {18, 33},
142  {5, 34},
143  {19, 35},
144  {20, 36},
145  {7, 37},
146  {21, 38},
147  {8, 39},
148  {22, 40},
149  {23, 41},
150  {10, 42},
151  {24, 43},
152  {11, 44},
153  {25, 45},
154  {12, 46},
155  {26, 47},
156  {27, 48}
157 #endif
158 
159 #if defined(Q_OS_MAC)
160  {50, 11},
161  {6, 12},
162  {1, 13},
163  {7, 14},
164  {2, 15},
165  {8, 16},
166  {9, 17},
167  {5, 18},
168  {11, 19},
169  {4, 20},
170  {45, 21},
171  {38, 22},
172  {46, 23},
173  {43, 24},
174  {37, 25},
175  {47, 26},
176  {41, 27},
177  {44, 28},
178 
179  {12, 29},
180  {19, 30},
181  {13, 31},
182  {20, 32},
183  {14, 33},
184  {21, 34},
185  {15, 35},
186  {17, 36},
187  {22, 37},
188  {16, 38},
189  {26, 39},
190  {32, 40},
191  {34, 41},
192  {25, 42},
193  {31, 43},
194  {29, 44},
195  {35, 45},
196  {27, 46},
197  {33, 47},
198  {30, 48}
199 #endif
200 };
201 
202 class PianoKeybd::PianoKeybdPrivate {
203 public:
204  PianoKeybdPrivate(): m_rotation(0), m_scene(nullptr), m_rawMap(nullptr)
205  { }
206  ~PianoKeybdPrivate() = default;
207 
208  int m_rotation;
209  PianoScene *m_scene;
210  KeyboardMap *m_rawMap;
211 };
212 
220 PianoKeybd::PianoKeybd(QWidget *parent)
221  : QGraphicsView(parent), d(new PianoKeybdPrivate())
222 {
223  initialize();
225 }
226 
235 PianoKeybd::PianoKeybd(const int baseOctave, const int numKeys, const int startKey, QWidget *parent)
236  : QGraphicsView(parent), d(new PianoKeybdPrivate)
237 {
238  initialize();
239  initScene(baseOctave, numKeys, startKey);
240 }
241 
246 {
247  d->m_scene->setRawKeyboardMode(false);
248  setKeyboardMap(nullptr);
249 }
250 
259 {
260  return d->m_scene->getPianoHandler();
261 }
262 
272 {
273  d->m_scene->setPianoHandler(handler);
274 }
275 
281 {
282  return d->m_scene->getHighlightPalette();
283 }
284 
292 {
293  d->m_scene->setHighlightPalette(p);
294 }
295 
301 {
302  return d->m_scene->getBackgroundPalette();
303 }
304 
310 {
311  d->m_scene->setBackgroundPalette(p);
312 }
313 
320 {
321  return d->m_scene->getForegroundPalette();
322 }
323 
330 {
331  d->m_scene->setForegroundPalette(p);
332 }
333 
339 {
340  return d->m_scene->showColorScale();
341 }
342 
347 void PianoKeybd::setShowColorScale(const bool show)
348 {
349  d->m_scene->setShowColorScale(show);
350 }
351 
361 void PianoKeybd::useCustomNoteNames(const QStringList &names)
362 {
363  d->m_scene->useCustomNoteNames(names);
364 }
365 
371 {
372  d->m_scene->useStandardNoteNames();
373 }
374 
379 QStringList PianoKeybd::customNoteNames() const
380 {
381  return d->m_scene->customNoteNames();
382 }
383 
388 QStringList PianoKeybd::standardNoteNames() const
389 {
390  return d->m_scene->standardNoteNames();
391 }
392 
399 {
400  d->m_scene->retranslate();
401 }
402 
410 void PianoKeybd::initScene(int base, int num, int strt, const QColor& c)
411 {
412  d->m_scene = new PianoScene(base, num, strt, c, this);
413  d->m_scene->setKeyboardMap(&g_DefaultKeyMap);
414  connect(d->m_scene, &PianoScene::noteOn, this, &PianoKeybd::noteOn);
415  connect(d->m_scene, &PianoScene::noteOff, this, &PianoKeybd::noteOff);
416  connect(d->m_scene, &PianoScene::signalName, this, &PianoKeybd::signalName);
417  setScene(d->m_scene);
418 }
419 
425 {
426  setAttribute(Qt::WA_AcceptTouchEvents);
427  setAttribute(Qt::WA_InputMethodEnabled, false);
428  setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
429  setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
430  setViewportUpdateMode(MinimalViewportUpdate);
431  setRenderHints(QPainter::Antialiasing|QPainter::TextAntialiasing|QPainter::SmoothPixmapTransform);
432  setOptimizationFlag(DontClipPainter, true);
433  setOptimizationFlag(DontSavePainterState, true);
434  setOptimizationFlag(DontAdjustForAntialiasing, true);
436 }
437 
443 void PianoKeybd::resizeEvent(QResizeEvent *event)
444 {
445  QGraphicsView::resizeEvent(event);
446  fitInView(d->m_scene->sceneRect(), Qt::KeepAspectRatio);
447 }
448 
455 void PianoKeybd::setNumKeys(const int numKeys, const int startKey)
456 {
457  //qDebug() << Q_FUNC_INFO << numKeys << startKey;
458  if ( numKeys != d->m_scene->numKeys() || startKey != d->m_scene->startKey() )
459  {
460  QByteArray dataBuffer;
461  int baseOctave = d->m_scene->baseOctave();
462  QColor color = d->m_scene->getKeyPressedColor();
463  PianoHandler* handler = d->m_scene->getPianoHandler();
464  KeyboardMap* keyMap = d->m_scene->getKeyboardMap();
465  d->m_scene->saveData(dataBuffer);
466  delete d->m_scene;
467  initScene(baseOctave, numKeys, startKey, color);
468  d->m_scene->loadData(dataBuffer);
469  d->m_scene->setPianoHandler(handler);
470  d->m_scene->setKeyboardMap(keyMap);
471  d->m_scene->hideOrShowKeys();
472  d->m_scene->refreshKeys();
473  d->m_scene->refreshLabels();
474  fitInView(d->m_scene->sceneRect(), Qt::KeepAspectRatio);
475  }
476 }
477 
483 {
484  if (r != d->m_rotation) {
485  d->m_rotation = r;
486  resetTransform();
487  rotate(d->m_rotation);
488  fitInView(d->m_scene->sceneRect(), Qt::KeepAspectRatio);
489  }
490 }
491 
496 QSize PianoKeybd::sizeHint() const
497 {
498  return mapFromScene(sceneRect()).boundingRect().size();
499 }
500 
501 // RAWKBD_SUPPORT
503 {
504  if (d->m_scene->isKeyboardEnabled() && d->m_rawMap != nullptr && d->m_rawMap->contains(keycode)) {
505  d->m_scene->keyOn(d->m_rawMap->value(keycode));
506  return true;
507  }
508  return false;
509 }
510 
512 {
513  if (d->m_scene->isKeyboardEnabled() && d->m_rawMap != nullptr && d->m_rawMap->contains(keycode)) {
514  d->m_scene->keyOff(d->m_rawMap->value(keycode));
515  return true;
516  }
517  return false;
518 }
519 
526 void PianoKeybd::setKeyPicture(const bool natural, const QPixmap &pix)
527 {
528  d->m_scene->setKeyPicture(natural, pix);
529 }
530 
536 QPixmap PianoKeybd::getKeyPicture(const bool natural)
537 {
538  return d->m_scene->getKeyPicture(natural);
539 }
540 
545 void PianoKeybd::setUseKeyPictures(const bool enable)
546 {
547  d->m_scene->setUseKeyPictures(enable);
548 }
549 
555 {
556  return d->m_scene->getUseKeyPictures();
557 }
558 
564 int PianoKeybd::baseOctave() const
565 {
566  return d->m_scene->baseOctave();
567 }
568 
573 void PianoKeybd::setBaseOctave(const int baseOctave)
574 {
575  d->m_scene->setBaseOctave(baseOctave);
576 }
577 
583 int PianoKeybd::numKeys() const
584 {
585  return d->m_scene->numKeys();
586 }
587 
593 {
594  return d->m_scene->startKey();
595 }
596 
602 {
603  return d->m_rotation;
604 }
605 
611 {
612  return d->m_scene->getKeyPressedColor();
613 }
614 
621 void PianoKeybd::setKeyPressedColor(const QColor& c)
622 {
623  d->m_scene->setKeyPressedColor(c);
624 }
625 
630 {
631  d->m_scene->resetKeyPressedColor();
632 }
633 
639 LabelVisibility PianoKeybd::showLabels() const
640 {
641  return d->m_scene->showLabels();
642 }
643 
650 {
651  d->m_scene->setShowLabels(show);
652 }
653 
660 {
661  return d->m_scene->alterations();
662 }
663 
670 {
671  d->m_scene->setAlterations(use);
672 }
673 
679 LabelOrientation PianoKeybd::labelOrientation() const
680 {
681  return d->m_scene->getOrientation();
682 }
683 
690 {
691  d->m_scene->setOrientation(orientation);
692 }
693 
699 LabelCentralOctave PianoKeybd::labelOctave() const
700 {
701  return d->m_scene->getOctave();
702 }
703 
710 {
711  d->m_scene->setOctave(octave);
712 }
713 
720 {
721  return d->m_scene->getTranspose();
722 }
723 
730 {
731  d->m_scene->setTranspose(t);
732 }
733 
739 {
740  return d->m_scene->getChannel();
741 }
742 
747 void PianoKeybd::setChannel(const int c)
748 {
749  d->m_scene->setChannel(c);
750 }
751 
758 {
759  return d->m_scene->getVelocity();
760 }
761 
767 void PianoKeybd::setVelocity(const int v)
768 {
769  d->m_scene->setVelocity(v);
770 }
771 
777 {
778  return d->m_scene->isKeyboardEnabled();
779 }
780 
785 void PianoKeybd::setKeyboardEnabled(const bool enable)
786 {
787  d->m_scene->setKeyboardEnabled(enable);
788 }
789 
795 {
796  return d->m_scene->isMouseEnabled();
797 }
798 
803 void PianoKeybd::setMouseEnabled(const bool enable)
804 {
805  d->m_scene->setMouseEnabled(enable);
806 }
807 
813 {
814  return d->m_scene->isTouchEnabled();
815 }
816 
821 void PianoKeybd::setTouchEnabled(const bool enable)
822 {
823  d->m_scene->setTouchEnabled(enable);
824 }
825 
831 {
832  return d->m_scene->velocityTint();
833 }
834 
839 void PianoKeybd::setVelocityTint(const bool enable)
840 {
841  //qDebug() << Q_FUNC_INFO << enable;
842  d->m_scene->setVelocityTint(enable);
843 }
844 
849 {
850  d->m_scene->allKeysOff();
851 }
852 
858 {
859  d->m_scene->setKeyboardMap(m);
860 }
861 
867 {
868  return d->m_scene->getKeyboardMap();
869 }
870 
875 {
876  d->m_rawMap = &g_DefaultRawKeyMap;
877 }
878 
884 {
885  return d->m_scene->getRawKeyboardMode();
886 }
887 
893 {
894  d->m_scene->setRawKeyboardMode(b);
895 }
896 
901 {
902  d->m_scene->setKeyboardMap(&g_DefaultKeyMap);
903 }
904 
910 {
911  d->m_rawMap = m;
912 }
913 
919 {
920  return d->m_rawMap;
921 }
922 
929 void PianoKeybd::showNoteOn(const int note, QColor color, int vel)
930 {
931  d->m_scene->showNoteOn(note, color, vel);
932 }
933 
939 void PianoKeybd::showNoteOn(const int note, int vel)
940 {
941  d->m_scene->showNoteOn(note, vel);
942 }
943 
949 void PianoKeybd::showNoteOff(const int note, int vel)
950 {
951  d->m_scene->showNoteOff(note, vel);
952 }
953 
958 void PianoKeybd::setFont(const QFont &font)
959 {
960  QWidget::setFont(font);
961  d->m_scene->setFont(font);
962  d->m_scene->refreshLabels();
963 }
964 
965 } // namespace widgets
966 } // namespace drumstick
The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.
The PianoHandler class callbacks.
Definition: pianokeybd.h:72
void initScene(int base, int num, int ini, const QColor &c=QColor())
Creates and initializes a new PianoScene instance and assigns it to this widget.
Definition: pianokeybd.cpp:410
void allKeysOff()
Forces all active notes to silence.
Definition: pianokeybd.cpp:848
virtual ~PianoKeybd()
Destructor.
Definition: pianokeybd.cpp:245
void resetKeyPressedColor()
Assigns the default highlight palette colors and assigns it to the scene.
Definition: pianokeybd.cpp:629
bool handleKeyReleased(int keycode) override
handleKeyReleased handles low level computer keyboard reelase events
Definition: pianokeybd.cpp:511
void setNumKeys(const int numKeys, const int startKey=DEFAULTSTARTINGKEY)
This method changes the number of displayed keys and the starting key number, keeping the other setti...
Definition: pianokeybd.cpp:455
PianoKeybd(QWidget *parent=nullptr)
Constructor.
Definition: pianokeybd.cpp:220
void setBackgroundPalette(const PianoPalette &p)
Assigns the palette used to paint the keys' background.
Definition: pianokeybd.cpp:309
void setRawKeyboardMode(const bool b)
Enables or disables the low level computer keyboard mode.
Definition: pianokeybd.cpp:892
void setFont(const QFont &font)
Assigns a typographic font for drawing the note labels over the piano keys.
Definition: pianokeybd.cpp:958
void initialize()
This method is called from the available constructors to initialize some widget attributes,...
Definition: pianokeybd.cpp:424
QSize sizeHint() const override
Overrides QGraphicsView::sizeHint() providing a size value based on the piano scene.
Definition: pianokeybd.cpp:496
void useStandardNoteNames()
Disables the custom note names usage as labels over the keys, and restores the standard note names in...
Definition: pianokeybd.cpp:370
bool isKeyboardEnabled() const
Returns whether the computer keyboard is enabled.
Definition: pianokeybd.cpp:776
void resetKeyboardMap()
Resets the low level computer keyboard note map to the default one.
Definition: pianokeybd.cpp:900
void setKeyPressedColor(const QColor &c)
Assigns a single color for key highlight.
Definition: pianokeybd.cpp:621
void setChannel(const int c)
Assigns the MIDI Channel (0-15).
Definition: pianokeybd.cpp:747
PianoPalette getForegroundPalette() const
Returns the palette used to paint texts over the keys like the note names or custom labels.
Definition: pianokeybd.cpp:319
bool getUseKeyPictures() const
Returns whether pictures are used to paint the keys.
Definition: pianokeybd.cpp:554
void setHighlightPalette(const PianoPalette &p)
Assigns the palette used for highlighting the played keys.
Definition: pianokeybd.cpp:291
void setShowColorScale(const bool show)
Enables or disables the color scale background palette.
Definition: pianokeybd.cpp:347
void setPianoHandler(PianoHandler *handler)
Assigns a PianoHandler pointer for processing note events.
Definition: pianokeybd.cpp:271
void setLabelOctave(const LabelCentralOctave octave)
Assigns the octave label policy.
Definition: pianokeybd.cpp:709
bool showColorScale() const
Returns true if the color scale background palette is assigned and active.
Definition: pianokeybd.cpp:338
void signalName(const QString &name)
signalName is emitted for each note created, and contains a string with the MIDI note number and the ...
void setKeyboardEnabled(const bool enable)
Enables or disables the computer keyboard note input.
Definition: pianokeybd.cpp:785
KeyboardMap * getRawKeyboardMap()
Returns the low level computer keyboard note map.
Definition: pianokeybd.cpp:918
PianoPalette getBackgroundPalette() const
Returns the palette used to paint the keys' background.
Definition: pianokeybd.cpp:300
void setRawKeyboardMap(KeyboardMap *m)
Assigns the low level computer keyboard note map.
Definition: pianokeybd.cpp:909
int getChannel() const
Returns the MIDI Channel (0-15).
Definition: pianokeybd.cpp:738
void setBaseOctave(const int baseOctave)
Assigns the base octave number.
Definition: pianokeybd.cpp:573
void setForegroundPalette(const PianoPalette &p)
Assigns the palette used to paint texts over the keys like the note names or custom labels.
Definition: pianokeybd.cpp:329
void setVelocityTint(const bool enable)
Enables or disables the note MIDI velocity influencing the highlight color tint.
Definition: pianokeybd.cpp:839
void setLabelAlterations(const LabelAlteration use)
Assigns the label alterations policy.
Definition: pianokeybd.cpp:669
void setKeyPicture(const bool natural, const QPixmap &pix)
Assigns a custom picture to the white or black keys that will be used as a texture to paint the keys.
Definition: pianokeybd.cpp:526
bool velocityTint() const
Returns whether the note MIDI velocity influences the highlight color tint.
Definition: pianokeybd.cpp:830
QColor getKeyPressedColor() const
Returns the key highlight color.
Definition: pianokeybd.cpp:610
void resizeEvent(QResizeEvent *event) override
This method overrides QGraphicsView::resizeEvent() to keep the aspect ratio of the keys scene when th...
Definition: pianokeybd.cpp:443
void noteOff(int midiNote, int vel)
This signal is emitted for each Note Off MIDI event created using the computer keyboard,...
bool handleKeyPressed(int keycode) override
handleKeyPressed handles low level computer keyboard press events
Definition: pianokeybd.cpp:502
void setKeyboardMap(KeyboardMap *m)
Assigns the computer keyboard note map.
Definition: pianokeybd.cpp:857
void showNoteOff(const int note, int vel=-1)
Shows inactive one note key with the specified velocity.
Definition: pianokeybd.cpp:949
void setShowLabels(const LabelVisibility show)
Assigns the label visibility policy.
Definition: pianokeybd.cpp:649
LabelAlteration labelAlterations() const
Returns the label alterations policy.
Definition: pianokeybd.cpp:659
PianoPalette getHighlightPalette() const
Returns the palette used for highlighting the played keys.
Definition: pianokeybd.cpp:280
QStringList standardNoteNames() const
Returns the list of standard note names.
Definition: pianokeybd.cpp:388
void noteOn(int midiNote, int vel)
This signal is emitted for each Note On MIDI event created using the computer keyboard,...
void resetRawKeyboardMap()
Resets the computer keyboard note map to the default one.
Definition: pianokeybd.cpp:874
PianoHandler * getPianoHandler() const
Gets the PianoHandler pointer to the note receiver.
Definition: pianokeybd.cpp:258
void setLabelOrientation(const LabelOrientation orientation)
Assigns the labels orientation policy.
Definition: pianokeybd.cpp:689
bool isMouseEnabled() const
Returns whether the mouse note input is enabled.
Definition: pianokeybd.cpp:794
bool getRawKeyboardMode() const
Returns the low level computer keyboard note map.
Definition: pianokeybd.cpp:883
void showNoteOn(const int note, QColor color, int vel=-1)
Highlights one note key with the specified color and velocity.
Definition: pianokeybd.cpp:929
void setRotation(int r)
Rotates the keyboard view an angle clockwise.
Definition: pianokeybd.cpp:482
QPixmap getKeyPicture(const bool natural)
Returns the custom picture used to paint the corresponding keys.
Definition: pianokeybd.cpp:536
void retranslate()
Updates the standard names of notes according to the currently active program language translation.
Definition: pianokeybd.cpp:398
int startKey() const
Returns the starting key note: C=0, A=9 and so on.
Definition: pianokeybd.cpp:592
void setTouchEnabled(const bool enable)
Enables or disables the touch screen note input.
Definition: pianokeybd.cpp:821
void useCustomNoteNames(const QStringList &names)
Assigns a list of custom text labels to be displayer over the keys.
Definition: pianokeybd.cpp:361
void setMouseEnabled(const bool enable)
Enables or disables the mouse note input.
Definition: pianokeybd.cpp:803
KeyboardMap * getKeyboardMap()
Returns the computer keyboard note map.
Definition: pianokeybd.cpp:866
void setUseKeyPictures(const bool enable)
Enables or disables a picture to paint the keys.
Definition: pianokeybd.cpp:545
int getRotation() const
Returns the rotation angle in degrees, clockwise, of the piano view.
Definition: pianokeybd.cpp:601
void setTranspose(int t)
Assigns the transpose amount in semitones.
Definition: pianokeybd.cpp:729
QStringList customNoteNames() const
Returns the list of custom note names.
Definition: pianokeybd.cpp:379
int getVelocity() const
Returns the MIDI note velocity.
Definition: pianokeybd.cpp:757
void setVelocity(const int v)
Assigns the MIDI note velocity.
Definition: pianokeybd.cpp:767
bool isTouchEnabled() const
Returns whether the touch screen note input is enabled.
Definition: pianokeybd.cpp:812
int getTranspose() const
Returns the transpose amount in semitones.
Definition: pianokeybd.cpp:719
The PianoPalette class.
Definition: pianopalette.h:61
The PianoScene class is a QGraphicsScene composed by a number of graphics items: the piano keys.
Definition: pianoscene.h:46
void noteOff(int n, int v)
This signal is emitted for each Note Off MIDI event created using the computer keyboard,...
void signalName(const QString &name)
signalName is emitted for each note created, and contains a string with the MIDI note number and the ...
void noteOn(int n, int v)
This signal is emitted for each Note On MIDI event created using the computer keyboard,...
LabelAlteration
Labels for Alterations.
Definition: pianokeybd.h:118
DRUMSTICK_EXPORT KeyboardMap g_DefaultKeyMap
Global Key Map Variable.
Definition: pianokeybd.cpp:39
LabelCentralOctave
Labels Central Octave.
Definition: pianokeybd.h:145
LabelVisibility
Labels Visibility.
Definition: pianokeybd.h:108
const int DEFAULTNUMBEROFKEYS
Default number of piano keys.
Definition: pianokeybd.h:103
LabelOrientation
Labels Orientation.
Definition: pianokeybd.h:127
const int DEFAULTSTARTINGKEY
Default starting key (A)
Definition: pianokeybd.h:101
QHash< int, int > KeyboardMap
KeyboardMap.
Definition: pianokeybd.h:96
DRUMSTICK_EXPORT KeyboardMap g_DefaultRawKeyMap
Global Raw Key Map Variable.
Definition: pianokeybd.cpp:74
const int DEFAULTBASEOCTAVE
Default base octave.
Definition: pianokeybd.h:102
Drumstick common.
Definition: alsaclient.cpp:68
Piano Keyboard Widget.
PianoScene class declaration.