drumstick 2.9.0
C++ MIDI libraries using Qt objects, idioms, and style.
|
The PianoScene class is a QGraphicsScene composed by a number of graphics items: the piano keys. More...
#include <pianoscene.h>
Signals | |
void | noteOn (int n, int v) |
This signal is emitted for each Note On MIDI event created using the computer keyboard, mouse or touch screen. More... | |
void | noteOff (int n, int v) |
This signal is emitted for each Note Off MIDI event created using the computer keyboard, mouse or touch screen. More... | |
void | signalName (const QString &name) |
signalName is emitted for each note created, and contains a string with the MIDI note number and the note name for each note on event. More... | |
Public Member Functions | |
PianoScene (const int baseOctave, const int numKeys, const int startKey, const QColor &keyPressedColor=QColor(), QObject *parent=nullptr) | |
Constructor. More... | |
~PianoScene () | |
Destructor. | |
QSize | sizeHint () const |
Returns the calculated size of the scene. More... | |
void | setKeyboardMap (KeyboardMap *map) |
Assigns the computer keyboard note map. More... | |
KeyboardMap * | getKeyboardMap () const |
Returns the computer keyboard note map. More... | |
PianoHandler * | getPianoHandler () const |
Gets the PianoHandler pointer to the note receiver. More... | |
void | setPianoHandler (PianoHandler *handler) |
Assigns a PianoHandler pointer for processing note events. More... | |
PianoPalette | getHighlightPalette () |
Returns the palette used for highlighting the played keys. More... | |
void | setHighlightPalette (const PianoPalette &p) |
Assigns the active highlight palette. More... | |
PianoPalette | getBackgroundPalette () |
Returns the background palette. More... | |
void | setBackgroundPalette (const PianoPalette &p) |
Assigns the active background palette. More... | |
PianoPalette | getForegroundPalette () |
Returns the active foreground palette. More... | |
void | setForegroundPalette (const PianoPalette &p) |
Assigns the active foreground palette. More... | |
bool | showColorScale () const |
Returns whether the color scale mode is enabled. More... | |
void | setShowColorScale (const bool show) |
Enables or disables the color scale key background mode. More... | |
QColor | getKeyPressedColor () const |
Returns the single highlight palette color. More... | |
void | setKeyPressedColor (const QColor &color) |
Assigns a single color for key highlight. More... | |
void | resetKeyPressedColor () |
Assigns the default highlight palette colors and assigns it to the scene. | |
int | getMinNote () const |
Returns the minimum MIDI note number that will be displayed. More... | |
void | setMinNote (const int note) |
Assigns the minimum MIDI note number that will be displayed. More... | |
int | getMaxNote () const |
Returns the maximum MIDI note number that will be displayed. More... | |
void | setMaxNote (const int note) |
Assigns the maximum MIDI note number that will be displayed. More... | |
int | getTranspose () const |
Returns the transpose amount in semitones. More... | |
void | setTranspose (const int transpose) |
Assigns the transpose amount in semitones. More... | |
LabelVisibility | showLabels () const |
Returns the label visibility policy (display note names over the piano keys). More... | |
void | setShowLabels (const LabelVisibility show) |
Assigns the label visibility policy to the piano keys. More... | |
LabelAlteration | alterations () const |
Returns the alterations name policy. More... | |
void | setAlterations (const LabelAlteration use) |
Assigns the alterations name policy. More... | |
LabelCentralOctave | getOctave () const |
Returns the central octave name policy. More... | |
void | setOrientation (const LabelOrientation orientation) |
Assigns the label orientation policy. More... | |
void | setKeyboardEnabled (const bool enable) |
Enables or disables the computer keyboard note generation. More... | |
bool | isMouseEnabled () const |
Returns whether the computer keyboard note generation is enabled. More... | |
void | setMouseEnabled (const bool enable) |
Enables or disables the mouse note generation. More... | |
bool | isTouchEnabled () const |
Returns whether the touch screen note generation is enabled. More... | |
void | setTouchEnabled (const bool enable) |
Enables or disables the touch screen note generation. More... | |
bool | velocityTint () const |
Returns whether the velocity parameter of note events is used to influence the highlight key colors. More... | |
void | setVelocityTint (const bool enable) |
Enables or disables the velocity parameter of note events to influence the highlight key colors. More... | |
bool | isOctaveStart (const int note) |
Returns whether the given note number is a octave startup note. More... | |
void | showNoteOn (const int note, QColor color, int vel=-1) |
Displays highlighted the corresponding key for a given MIDI note, with a color and MIDI velocity. More... | |
void | showNoteOn (const int note, int vel=-1) |
Displays highlighted the corresponding key for a given MIDI note, with MIDI velocity. More... | |
void | showNoteOff (const int note, int vel=-1) |
Displays deactivated the corresponding key for a given MIDI note, with MIDI velocity. More... | |
int | baseOctave () const |
Returns the base octave number. More... | |
void | setBaseOctave (const int base) |
Assigns the octave base number. More... | |
int | numKeys () const |
Returns the number of keys that will be displayed. More... | |
int | startKey () const |
Returns the first key number that will be displayed. More... | |
void | allKeysOff () |
Deactivates all keys. | |
void | keyOn (const int note) |
Produces a MIDI Note On event and highlights the corresponding key for the given MIDI note number. More... | |
void | keyOff (const int note) |
Produces a MIDI Note Off event and deactivates the corresponding key for the given MIDI note number. More... | |
bool | getRawKeyboardMode () const |
Returns whether the low level computer keyboard mode is enabled. More... | |
void | setRawKeyboardMode (const bool b) |
Assigns the low level computer keyboard mode. More... | |
void | useCustomNoteNames (const QStringList &names) |
Assigns the list of custom note names, and enables this mode. More... | |
void | useStandardNoteNames () |
Assigns the standard note names, clearing the list of custom note names. | |
QStringList | customNoteNames () const |
Returns the custom note names list. More... | |
QStringList | standardNoteNames () const |
Returns the standard note names list. More... | |
int | getVelocity () |
Returns the MIDI note velocity parameter that is assigned to the MIDI OUT notes. More... | |
void | setVelocity (const int velocity) |
Assigns the MIDI note velocity parameter that is assigned to the MIDI OUT notes. More... | |
int | getChannel () const |
Returns the MIDI channel that is assigned to the output events, or used to filter the input events (unless MIDI OMNI mode is enabled). More... | |
void | setChannel (const int channel) |
Assigns the MIDI channel that is included into the output events, or used to filter the input events (unless MIDI OMNI mode is enabled). More... | |
void | retranslate () |
Retranslates the standard note names. | |
void | refreshLabels () |
Refresh the visibility and other attributes of the labels shown over the piano keys. | |
void | hideOrShowKeys () |
Hides or shows keys. | |
void | refreshKeys () |
Refresh the background colors of all the piano keys. | |
bool | touchScreenEvent (QTouchEvent *touchEvent) |
Process touch screen events, called by the view. More... | |
void | setUsingNativeFilter (const bool newState) |
Enables or disables the application level usage of a native event filter. More... | |
bool | isUsingNativeFilter () const |
Returns whether the application is filtering native events. More... | |
void | setOctaveSubscript (const bool enable) |
Enables or disables the subscript octave designation. More... | |
bool | octaveSubscript () const |
Returns whether the subscript octave designation is enabled. More... | |
Protected Member Functions | |
void | showKeyOn (PianoKey *key, QColor color, int vel) |
Displays highlighted the activated key with the supplied color and note velocity. More... | |
void | showKeyOn (PianoKey *key, int vel) |
Displays highlighted the activated key with the supplied note velocity. More... | |
void | showKeyOff (PianoKey *key, int vel) |
Displays as deactivated a key. More... | |
void | displayKeyOn (PianoKey *key) |
Displays the note label over a highligted key. More... | |
void | keyOn (PianoKey *key) |
Produces a MIDI Note On event and highlights the given key. More... | |
void | keyOff (PianoKey *key) |
Produces a MIDI Note Off event and deactivates the given key. More... | |
void | keyOn (PianoKey *key, qreal pressure) |
Produces a MIDI Note On event and highlights the given key with the given pressure. More... | |
void | keyOff (PianoKey *key, qreal pressure) |
Produces a MIDI Note Off event and deactivates the given key with the given pressure. More... | |
PianoKey * | getKeyForPos (const QPointF &p) const |
Returns the piano key for the given scene point coordenates. More... | |
PianoKey * | getPianoKey (const int key) const |
Returns the piano key object corresponding to the given computer keyboard key. More... | |
QString | noteName (PianoKey *key) |
Returns the note name string that will be displayed over a given piano key. More... | |
void | mouseMoveEvent (QGraphicsSceneMouseEvent *mouseEvent) override |
This event handler, for event mouseEvent, is reimplemented to receive mouse move events for the scene. More... | |
void | mousePressEvent (QGraphicsSceneMouseEvent *mouseEvent) override |
This event handler, for event mouseEvent, is reimplemented to receive mouse press events for the scene. More... | |
void | mouseReleaseEvent (QGraphicsSceneMouseEvent *mouseEvent) override |
This event handler, for event mouseEvent, is reimplemented to receive mouse release events for the scene. More... | |
void | keyPressEvent (QKeyEvent *keyEvent) override |
This event handler, for event keyEvent, is reimplemented to receive keypress events. More... | |
void | keyReleaseEvent (QKeyEvent *keyEvent) override |
This event handler, for event keyEvent, is reimplemented to receive key release events. More... | |
bool | event (QEvent *event) override |
This method overrides QGraphicsScene::event(). More... | |
void | triggerNoteOn (const int note, const int vel) |
Performs a Note On MIDI event for the given MIDI note number and velocity. More... | |
void | triggerNoteOff (const int note, const int vel) |
Performs a Note Off MIDI event for the given MIDI note number and velocity. More... | |
int | getNoteFromKey (const int key) const |
Returns the note number for the given computer keyboard key code. More... | |
void | setHighlightColorFromPolicy (PianoKey *key, const int vel) |
Assigns to the given key the highlight color from the active highlight palette and the given MIDI velocity. More... | |
The PianoScene class is a QGraphicsScene composed by a number of graphics items: the piano keys.
Definition at line 46 of file pianoscene.h.
PianoScene | ( | const int | baseOctave, |
const int | numKeys, | ||
const int | startKey, | ||
const QColor & | keyPressedColor = QColor() , |
||
QObject * | parent = nullptr |
||
) |
Constructor.
baseOctave | octave base number |
numKeys | number of keys |
startKey | starting key |
keyPressedColor | highlight keys color |
parent | owner object |
Definition at line 253 of file pianoscene.cpp.
References PianoScene::getKeyPressedColor(), PianoScene::hideOrShowKeys(), PianoScene::retranslate(), and PianoScene::setKeyPressedColor().
LabelAlteration alterations | ( | ) | const |
Returns the alterations name policy.
Definition at line 1014 of file pianoscene.cpp.
int baseOctave | ( | ) | const |
Returns the base octave number.
Definition at line 483 of file pianoscene.cpp.
QStringList customNoteNames | ( | ) | const |
Returns the custom note names list.
Definition at line 1109 of file pianoscene.cpp.
|
protected |
Displays the note label over a highligted key.
key | the activated key |
Definition at line 374 of file pianoscene.cpp.
References drumstick::widgets::ShowActivated, and PianoScene::signalName().
Referenced by PianoScene::showKeyOn().
|
overrideprotected |
This method overrides QGraphicsScene::event().
It does not add new logic, but calls the overrided function.
event | The given event |
Definition at line 799 of file pianoscene.cpp.
References PianoScene::event().
Referenced by PianoScene::event().
PianoPalette getBackgroundPalette | ( | ) |
Returns the background palette.
Definition at line 1325 of file pianoscene.cpp.
int getChannel | ( | ) | const |
Returns the MIDI channel that is assigned to the output events, or used to filter the input events (unless MIDI OMNI mode is enabled).
Definition at line 1146 of file pianoscene.cpp.
PianoPalette getForegroundPalette | ( | ) |
Returns the active foreground palette.
Definition at line 1347 of file pianoscene.cpp.
PianoPalette getHighlightPalette | ( | ) |
Returns the palette used for highlighting the played keys.
Definition at line 365 of file pianoscene.cpp.
KeyboardMap * getKeyboardMap | ( | ) | const |
Returns the computer keyboard note map.
Definition at line 331 of file pianoscene.cpp.
|
protected |
Returns the piano key for the given scene point coordenates.
p | The given scene point coordenates |
Definition at line 641 of file pianoscene.cpp.
Referenced by PianoScene::mouseMoveEvent(), PianoScene::mousePressEvent(), PianoScene::mouseReleaseEvent(), and PianoScene::touchScreenEvent().
QColor getKeyPressedColor | ( | ) | const |
Returns the single highlight palette color.
Definition at line 1303 of file pianoscene.cpp.
Referenced by PianoScene::PianoScene(), and PianoScene::resetKeyPressedColor().
int getMaxNote | ( | ) | const |
Returns the maximum MIDI note number that will be displayed.
Definition at line 881 of file pianoscene.cpp.
int getMinNote | ( | ) | const |
Returns the minimum MIDI note number that will be displayed.
Definition at line 848 of file pianoscene.cpp.
|
protected |
Returns the note number for the given computer keyboard key code.
key | The given computer keyboard key code |
Definition at line 714 of file pianoscene.cpp.
Referenced by PianoScene::getPianoKey(), PianoScene::keyPressEvent(), and PianoScene::keyReleaseEvent().
LabelCentralOctave getOctave | ( | ) | const |
Returns the central octave name policy.
Definition at line 1036 of file pianoscene.cpp.
PianoHandler * getPianoHandler | ( | ) | const |
Gets the PianoHandler pointer to the note receiver.
If this method returns null, then there is not a PianoHandler class assigned, and then the signals noteOn() and noteOff() are emitted instead.
Definition at line 343 of file pianoscene.cpp.
|
protected |
Returns the piano key object corresponding to the given computer keyboard key.
key | The given computer keyboard key |
Definition at line 731 of file pianoscene.cpp.
References PianoScene::getNoteFromKey().
bool getRawKeyboardMode | ( | ) | const |
Returns whether the low level computer keyboard mode is enabled.
Definition at line 631 of file pianoscene.cpp.
int getTranspose | ( | ) | const |
Returns the transpose amount in semitones.
Definition at line 902 of file pianoscene.cpp.
int getVelocity | ( | ) |
Returns the MIDI note velocity parameter that is assigned to the MIDI OUT notes.
Definition at line 1127 of file pianoscene.cpp.
bool isMouseEnabled | ( | ) | const |
Returns whether the computer keyboard note generation is enabled.
Definition at line 1197 of file pianoscene.cpp.
bool isOctaveStart | ( | const int | note | ) |
Returns whether the given note number is a octave startup note.
note | The given note number |
Definition at line 943 of file pianoscene.cpp.
Referenced by PianoScene::refreshLabels().
bool isTouchEnabled | ( | ) | const |
Returns whether the touch screen note generation is enabled.
Definition at line 1217 of file pianoscene.cpp.
bool isUsingNativeFilter | ( | ) | const |
Returns whether the application is filtering native events.
Definition at line 1564 of file pianoscene.cpp.
void keyOff | ( | const int | note | ) |
Produces a MIDI Note Off event and deactivates the corresponding key for the given MIDI note number.
note | The given MIDI note number |
Definition at line 619 of file pianoscene.cpp.
References PianoScene::keyOff(), and PianoScene::triggerNoteOff().
Referenced by PianoScene::keyOff(), PianoScene::keyReleaseEvent(), PianoScene::mouseMoveEvent(), PianoScene::mouseReleaseEvent(), and PianoScene::touchScreenEvent().
|
protected |
Produces a MIDI Note Off event and deactivates the given key.
key | The given key |
Definition at line 573 of file pianoscene.cpp.
References PianoScene::showKeyOff(), and PianoScene::triggerNoteOff().
|
protected |
Produces a MIDI Note Off event and deactivates the given key with the given pressure.
key | The given key |
pressure | The applied pressure |
Definition at line 596 of file pianoscene.cpp.
References PianoScene::showKeyOff(), and PianoScene::triggerNoteOff().
void keyOn | ( | const int | note | ) |
Produces a MIDI Note On event and highlights the corresponding key for the given MIDI note number.
note | The given MIDI note number |
Definition at line 607 of file pianoscene.cpp.
References PianoScene::keyOn(), and PianoScene::triggerNoteOn().
Referenced by PianoScene::keyOn(), PianoScene::keyPressEvent(), PianoScene::mouseMoveEvent(), PianoScene::mousePressEvent(), and PianoScene::touchScreenEvent().
|
protected |
Produces a MIDI Note On event and highlights the given key.
key | The given key |
Definition at line 563 of file pianoscene.cpp.
References PianoScene::showKeyOn(), and PianoScene::triggerNoteOn().
|
protected |
Produces a MIDI Note On event and highlights the given key with the given pressure.
key | The given key |
pressure | The applied pressure |
Definition at line 584 of file pianoscene.cpp.
References PianoScene::showKeyOn(), and PianoScene::triggerNoteOn().
|
overrideprotected |
This event handler, for event keyEvent, is reimplemented to receive keypress events.
keyEvent | The computer keyboard pressed event |
Definition at line 743 of file pianoscene.cpp.
References PianoScene::getNoteFromKey(), and PianoScene::keyOn().
|
overrideprotected |
This event handler, for event keyEvent, is reimplemented to receive key release events.
keyEvent | The computer keyboard released event |
Definition at line 770 of file pianoscene.cpp.
References PianoScene::getNoteFromKey(), and PianoScene::keyOff().
|
overrideprotected |
This event handler, for event mouseEvent, is reimplemented to receive mouse move events for the scene.
mouseEvent | The mouse move event object pointer |
Definition at line 657 of file pianoscene.cpp.
References PianoScene::getKeyForPos(), PianoScene::keyOff(), and PianoScene::keyOn().
|
overrideprotected |
This event handler, for event mouseEvent, is reimplemented to receive mouse press events for the scene.
mouseEvent | The mouse press event object pointer |
Definition at line 679 of file pianoscene.cpp.
References PianoScene::getKeyForPos(), and PianoScene::keyOn().
|
overrideprotected |
This event handler, for event mouseEvent, is reimplemented to receive mouse release events for the scene.
mouseEvent | The mouse release event object pointer |
Definition at line 696 of file pianoscene.cpp.
References PianoScene::getKeyForPos(), and PianoScene::keyOff().
|
protected |
Returns the note name string that will be displayed over a given piano key.
key | The given piano key |
Definition at line 953 of file pianoscene.cpp.
|
signal |
This signal is emitted for each Note Off MIDI event created using the computer keyboard, mouse or touch screen.
It is not emitted if a PianoHandler has been assigned using setPianoHandler().
n | the MIDI note number |
v | the MIDI velocity |
Referenced by PianoKeybd::initScene(), and PianoScene::triggerNoteOff().
|
signal |
This signal is emitted for each Note On MIDI event created using the computer keyboard, mouse or touch screen.
It is not emitted if a PianoHandler has been assigned using setPianoHandler().
n | the MIDI note number |
v | the MIDI velocity |
Referenced by PianoKeybd::initScene(), and PianoScene::triggerNoteOn().
int numKeys | ( | ) | const |
Returns the number of keys that will be displayed.
Definition at line 924 of file pianoscene.cpp.
bool octaveSubscript | ( | ) | const |
Returns whether the subscript octave designation is enabled.
Definition at line 1585 of file pianoscene.cpp.
void setAlterations | ( | const LabelAlteration | use | ) |
Assigns the alterations name policy.
use | the new alterations name policy |
Definition at line 1024 of file pianoscene.cpp.
References PianoScene::refreshLabels().
void setBackgroundPalette | ( | const PianoPalette & | p | ) |
Assigns the active background palette.
p | the active background palette |
Definition at line 1334 of file pianoscene.cpp.
References PianoScene::refreshKeys().
void setBaseOctave | ( | const int | base | ) |
Assigns the octave base number.
base | the octave base number |
Definition at line 911 of file pianoscene.cpp.
References PianoScene::hideOrShowKeys(), and PianoScene::refreshLabels().
void setChannel | ( | const int | channel | ) |
Assigns the MIDI channel that is included into the output events, or used to filter the input events (unless MIDI OMNI mode is enabled).
channel | the MIDI channel |
Definition at line 1156 of file pianoscene.cpp.
void setForegroundPalette | ( | const PianoPalette & | p | ) |
Assigns the active foreground palette.
p | the foreground palette |
Definition at line 1356 of file pianoscene.cpp.
References PianoScene::refreshLabels().
|
protected |
Assigns to the given key the highlight color from the active highlight palette and the given MIDI velocity.
key | The given piano key |
vel | The MIDI note velocity |
Definition at line 529 of file pianoscene.cpp.
References drumstick::widgets::PAL_CHANNELS, drumstick::widgets::PAL_DOUBLE, drumstick::widgets::PAL_HISCALE, and drumstick::widgets::PAL_SINGLE.
Referenced by PianoScene::showKeyOn().
void setHighlightPalette | ( | const PianoPalette & | p | ) |
Assigns the active highlight palette.
p | the active highlight palette |
Definition at line 1312 of file pianoscene.cpp.
References PianoScene::refreshKeys().
void setKeyboardEnabled | ( | const bool | enable | ) |
Enables or disables the computer keyboard note generation.
enable | the computer keyboard note generation |
Definition at line 1186 of file pianoscene.cpp.
void setKeyboardMap | ( | KeyboardMap * | map | ) |
Assigns the computer keyboard note map.
map | the computer keyboard note map. |
Definition at line 322 of file pianoscene.cpp.
void setKeyPressedColor | ( | const QColor & | color | ) |
Assigns a single color for key highlight.
This is an alternative to creating a highlight palette with a single color and assigning it.
color | Color for key highlight |
Definition at line 820 of file pianoscene.cpp.
References drumstick::widgets::PAL_SINGLE.
Referenced by PianoScene::PianoScene().
void setMaxNote | ( | const int | note | ) |
Assigns the maximum MIDI note number that will be displayed.
note | the maximum MIDI note number |
Definition at line 890 of file pianoscene.cpp.
References PianoScene::hideOrShowKeys().
void setMinNote | ( | const int | note | ) |
Assigns the minimum MIDI note number that will be displayed.
note | the minimum MIDI note number |
Definition at line 869 of file pianoscene.cpp.
References PianoScene::hideOrShowKeys().
void setMouseEnabled | ( | const bool | enable | ) |
Enables or disables the mouse note generation.
enable | the mouse note generation |
Definition at line 1206 of file pianoscene.cpp.
void setOctaveSubscript | ( | const bool | enable | ) |
Enables or disables the subscript octave designation.
enable | the subscript octave designation |
Definition at line 1573 of file pianoscene.cpp.
References PianoScene::refreshLabels().
void setOrientation | ( | const LabelOrientation | orientation | ) |
Assigns the label orientation policy.
orientation | the label orientation policy |
Definition at line 1045 of file pianoscene.cpp.
References PianoScene::refreshLabels().
void setPianoHandler | ( | PianoHandler * | handler | ) |
Assigns a PianoHandler pointer for processing note events.
When this member is used to assign a PianoHandler instance, then the methods in that instance are called instead of emitting the signals noteOn() and noteOff().
handler | pointer to a PianoHandler instance |
Definition at line 356 of file pianoscene.cpp.
void setRawKeyboardMode | ( | const bool | b | ) |
Assigns the low level computer keyboard mode.
b | the low level computer keyboard mode |
Definition at line 1098 of file pianoscene.cpp.
void setShowColorScale | ( | const bool | show | ) |
Enables or disables the color scale key background mode.
show | the color scale key background mode |
Definition at line 1290 of file pianoscene.cpp.
References PianoScene::refreshKeys().
void setShowLabels | ( | const LabelVisibility | show | ) |
Assigns the label visibility policy to the piano keys.
show | the new label visibility policy |
Definition at line 1000 of file pianoscene.cpp.
References PianoScene::refreshLabels().
void setTouchEnabled | ( | const bool | enable | ) |
Enables or disables the touch screen note generation.
enable | the touch screen note generation |
Definition at line 1226 of file pianoscene.cpp.
void setTranspose | ( | const int | transpose | ) |
Assigns the transpose amount in semitones.
transpose | the transpose amount in semitones |
Definition at line 1075 of file pianoscene.cpp.
References PianoScene::hideOrShowKeys(), and PianoScene::refreshLabels().
void setUsingNativeFilter | ( | const bool | newState | ) |
Enables or disables the application level usage of a native event filter.
newState | of the application level usage of a native event filter |
Definition at line 1553 of file pianoscene.cpp.
void setVelocity | ( | const int | velocity | ) |
Assigns the MIDI note velocity parameter that is assigned to the MIDI OUT notes.
velocity | the MIDI note velocity |
Definition at line 1136 of file pianoscene.cpp.
void setVelocityTint | ( | const bool | enable | ) |
Enables or disables the velocity parameter of note events to influence the highlight key colors.
enable | the velocity parameter of note events to influence the highlight key colors |
Definition at line 1246 of file pianoscene.cpp.
bool showColorScale | ( | ) | const |
Returns whether the color scale mode is enabled.
Definition at line 1369 of file pianoscene.cpp.
|
protected |
Displays as deactivated a key.
key | the deactivated key |
vel | the MIDI note velocity |
Definition at line 423 of file pianoscene.cpp.
References drumstick::widgets::ShowActivated, and PianoScene::signalName().
Referenced by PianoScene::keyOff(), and PianoScene::showNoteOff().
|
protected |
Displays highlighted the activated key with the supplied note velocity.
key | the activated key |
vel | the MIDI note velocity |
Definition at line 412 of file pianoscene.cpp.
References PianoScene::displayKeyOn(), and PianoScene::setHighlightColorFromPolicy().
|
protected |
Displays highlighted the activated key with the supplied color and note velocity.
key | the activated key |
color | the highlight color |
vel | the MIDI note velocity |
Definition at line 395 of file pianoscene.cpp.
References PianoScene::displayKeyOn().
Referenced by PianoScene::keyOn(), and PianoScene::showNoteOn().
LabelVisibility showLabels | ( | ) | const |
Returns the label visibility policy (display note names over the piano keys).
Definition at line 1089 of file pianoscene.cpp.
void showNoteOff | ( | const int | note, |
int | vel = -1 |
||
) |
Displays deactivated the corresponding key for a given MIDI note, with MIDI velocity.
note | The MIDI note number |
vel | The MIDI note velocity |
Definition at line 470 of file pianoscene.cpp.
References PianoScene::showKeyOff().
void showNoteOn | ( | const int | note, |
int | vel = -1 |
||
) |
Displays highlighted the corresponding key for a given MIDI note, with MIDI velocity.
note | The MIDI note number |
vel | The MIDI note velocity |
Definition at line 456 of file pianoscene.cpp.
References PianoScene::showKeyOn().
void showNoteOn | ( | const int | note, |
QColor | color, | ||
int | vel = -1 |
||
) |
Displays highlighted the corresponding key for a given MIDI note, with a color and MIDI velocity.
note | The MIDI note number |
color | The highlight color |
vel | The MIDI note velocity |
Definition at line 443 of file pianoscene.cpp.
References PianoScene::showKeyOn().
|
signal |
signalName is emitted for each note created, and contains a string with the MIDI note number and the note name for each note on event.
name | the MIDI note number and name |
Referenced by PianoScene::displayKeyOn(), PianoKeybd::initScene(), and PianoScene::showKeyOff().
QSize sizeHint | ( | ) | const |
Returns the calculated size of the scene.
Definition at line 313 of file pianoscene.cpp.
QStringList standardNoteNames | ( | ) | const |
Returns the standard note names list.
Definition at line 1118 of file pianoscene.cpp.
int startKey | ( | ) | const |
Returns the first key number that will be displayed.
Definition at line 933 of file pianoscene.cpp.
bool touchScreenEvent | ( | QTouchEvent * | touchEvent | ) |
Process touch screen events, called by the view.
touchEvent | The given QTouchEvent* |
Definition at line 1417 of file pianoscene.cpp.
References PianoScene::getKeyForPos(), PianoScene::keyOff(), and PianoScene::keyOn().
|
protected |
Performs a Note Off MIDI event for the given MIDI note number and velocity.
If a PianoHandler instance is assigned, its PianoHandler::noteOff() method is called, otherwise the noteOff() signal is triggered.
note | The MIDI note number |
vel | The MIDI velocity |
Definition at line 511 of file pianoscene.cpp.
References PianoScene::noteOff().
Referenced by PianoScene::keyOff().
|
protected |
Performs a Note On MIDI event for the given MIDI note number and velocity.
If a PianoHandler instance is assigned, its PianoHandler::noteOn() method is called, otherwise the noteOn() signal is triggered.
note | The MIDI note number |
vel | The MIDI velocity |
Definition at line 492 of file pianoscene.cpp.
References PianoScene::noteOn().
Referenced by PianoScene::keyOn().
void useCustomNoteNames | ( | const QStringList & | names | ) |
Assigns the list of custom note names, and enables this mode.
names | the list of custom note names |
Definition at line 1165 of file pianoscene.cpp.
References PianoScene::refreshLabels().
bool velocityTint | ( | ) | const |
Returns whether the velocity parameter of note events is used to influence the highlight key colors.
Definition at line 1237 of file pianoscene.cpp.