![]() |
drumstick 2.10.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. | |
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. | |
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. | |
Public Member Functions | |
PianoScene (const int baseOctave, const int numKeys, const int startKey, const QColor &keyPressedColor=QColor(), QObject *parent=nullptr) | |
Constructor. | |
~PianoScene () | |
Destructor. | |
QSize | sizeHint () const |
Returns the calculated size of the scene. | |
void | setKeyboardMap (KeyboardMap *map) |
Assigns the computer keyboard note map. | |
KeyboardMap * | getKeyboardMap () const |
Returns the computer keyboard note map. | |
PianoHandler * | getPianoHandler () const |
Gets the PianoHandler pointer to the note receiver. | |
void | setPianoHandler (PianoHandler *handler) |
Assigns a PianoHandler pointer for processing note events. | |
PianoPalette | getHighlightPalette () |
Returns the palette used for highlighting the played keys. | |
void | setHighlightPalette (const PianoPalette &p) |
Assigns the active highlight palette. | |
PianoPalette | getBackgroundPalette () |
Returns the background palette. | |
void | setBackgroundPalette (const PianoPalette &p) |
Assigns the active background palette. | |
PianoPalette | getForegroundPalette () |
Returns the active foreground palette. | |
void | setForegroundPalette (const PianoPalette &p) |
Assigns the active foreground palette. | |
bool | showColorScale () const |
Returns whether the color scale mode is enabled. | |
void | setShowColorScale (const bool show) |
Enables or disables the color scale key background mode. | |
QColor | getKeyPressedColor () const |
Returns the single highlight palette color. | |
void | setKeyPressedColor (const QColor &color) |
Assigns a single color for key highlight. | |
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. | |
void | setMinNote (const int note) |
Assigns the minimum MIDI note number that will be displayed. | |
int | getMaxNote () const |
Returns the maximum MIDI note number that will be displayed. | |
void | setMaxNote (const int note) |
Assigns the maximum MIDI note number that will be displayed. | |
int | getTranspose () const |
Returns the transpose amount in semitones. | |
void | setTranspose (const int transpose) |
Assigns the transpose amount in semitones. | |
LabelVisibility | showLabels () const |
Returns the label visibility policy (display note names over the piano keys). | |
void | setShowLabels (const LabelVisibility show) |
Assigns the label visibility policy to the piano keys. | |
LabelAlteration | alterations () const |
Returns the alterations name policy. | |
void | setAlterations (const LabelAlteration use) |
Assigns the alterations name policy. | |
LabelCentralOctave | getOctave () const |
Returns the central octave name policy. | |
void | setOrientation (const LabelOrientation orientation) |
Assigns the label orientation policy. | |
void | setKeyboardEnabled (const bool enable) |
Enables or disables the computer keyboard note generation. | |
bool | isMouseEnabled () const |
Returns whether the computer keyboard note generation is enabled. | |
void | setMouseEnabled (const bool enable) |
Enables or disables the mouse note generation. | |
bool | isTouchEnabled () const |
Returns whether the touch screen note generation is enabled. | |
void | setTouchEnabled (const bool enable) |
Enables or disables the touch screen note generation. | |
bool | velocityTint () const |
Returns whether the velocity parameter of note events is used to influence the highlight key colors. | |
void | setVelocityTint (const bool enable) |
Enables or disables the velocity parameter of note events to influence the highlight key colors. | |
bool | isOctaveStart (const int note) |
Returns whether the given note number is a octave startup note. | |
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. | |
void | showNoteOn (const int note, int vel=-1) |
Displays highlighted the corresponding key for a given MIDI note, with MIDI velocity. | |
void | showNoteOff (const int note, int vel=-1) |
Displays deactivated the corresponding key for a given MIDI note, with MIDI velocity. | |
int | baseOctave () const |
Returns the base octave number. | |
void | setBaseOctave (const int base) |
Assigns the octave base number. | |
int | numKeys () const |
Returns the number of keys that will be displayed. | |
int | startKey () const |
Returns the first key number that will be displayed. | |
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. | |
void | keyOff (const int note) |
Produces a MIDI Note Off event and deactivates the corresponding key for the given MIDI note number. | |
bool | getRawKeyboardMode () const |
Returns whether the low level computer keyboard mode is enabled. | |
void | setRawKeyboardMode (const bool b) |
Assigns the low level computer keyboard mode. | |
void | useCustomNoteNames (const QStringList &names) |
Assigns the list of custom note names, and enables this mode. | |
void | useStandardNoteNames () |
Assigns the standard note names, clearing the list of custom note names. | |
QStringList | customNoteNames () const |
Returns the custom note names list. | |
QStringList | standardNoteNames () const |
Returns the standard note names list. | |
int | getVelocity () |
Returns the MIDI note velocity parameter that is assigned to the MIDI OUT notes. | |
void | setVelocity (const int velocity) |
Assigns the MIDI note velocity parameter that is assigned to the MIDI OUT notes. | |
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). | |
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). | |
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. | |
void | setUsingNativeFilter (const bool newState) |
Enables or disables the application level usage of a native event filter. | |
bool | isUsingNativeFilter () const |
Returns whether the application is filtering native events. | |
void | setOctaveSubscript (const bool enable) |
Enables or disables the subscript octave designation. | |
bool | octaveSubscript () const |
Returns whether the subscript octave designation is enabled. | |
Protected Member Functions | |
void | showKeyOn (PianoKey *key, QColor color, int vel) |
Displays highlighted the activated key with the supplied color and note velocity. | |
void | showKeyOn (PianoKey *key, int vel) |
Displays highlighted the activated key with the supplied note velocity. | |
void | showKeyOff (PianoKey *key, int vel) |
Displays as deactivated a key. | |
void | displayKeyOn (PianoKey *key) |
Displays the note label over a highligted key. | |
void | keyOn (PianoKey *key) |
Produces a MIDI Note On event and highlights the given key. | |
void | keyOff (PianoKey *key) |
Produces a MIDI Note Off event and deactivates the given key. | |
void | keyOn (PianoKey *key, qreal pressure) |
Produces a MIDI Note On event and highlights the given key with the given pressure. | |
void | keyOff (PianoKey *key, qreal pressure) |
Produces a MIDI Note Off event and deactivates the given key with the given pressure. | |
PianoKey * | getKeyForPos (const QPointF &p) const |
Returns the piano key for the given scene point coordenates. | |
PianoKey * | getPianoKey (const int key) const |
Returns the piano key object corresponding to the given computer keyboard key. | |
QString | noteName (PianoKey *key) |
Returns the note name string that will be displayed over a given piano key. | |
void | mouseMoveEvent (QGraphicsSceneMouseEvent *mouseEvent) override |
This event handler, for event mouseEvent, is reimplemented to receive mouse move events for the scene. | |
void | mousePressEvent (QGraphicsSceneMouseEvent *mouseEvent) override |
This event handler, for event mouseEvent, is reimplemented to receive mouse press events for the scene. | |
void | mouseReleaseEvent (QGraphicsSceneMouseEvent *mouseEvent) override |
This event handler, for event mouseEvent, is reimplemented to receive mouse release events for the scene. | |
void | keyPressEvent (QKeyEvent *keyEvent) override |
This event handler, for event keyEvent, is reimplemented to receive keypress events. | |
void | keyReleaseEvent (QKeyEvent *keyEvent) override |
This event handler, for event keyEvent, is reimplemented to receive key release events. | |
bool | event (QEvent *event) override |
This method overrides QGraphicsScene::event(). | |
void | triggerNoteOn (const int note, const int vel) |
Performs a Note On MIDI event for the given MIDI note number and velocity. | |
void | triggerNoteOff (const int note, const int vel) |
Performs a Note Off MIDI event for the given MIDI note number and velocity. | |
int | getNoteFromKey (const int key) const |
Returns the note number for the given computer keyboard key code. | |
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. | |
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 baseOctave(), getKeyPressedColor(), numKeys(), PianoKeybd::setFont(), and startKey().
LabelAlteration alterations | ( | ) | const |
Returns the alterations name policy.
Definition at line 1014 of file pianoscene.cpp.
References alterations().
Referenced by alterations().
int baseOctave | ( | ) | const |
Returns the base octave number.
Definition at line 483 of file pianoscene.cpp.
References baseOctave().
Referenced by baseOctave(), and PianoScene().
QStringList customNoteNames | ( | ) | const |
Returns the custom note names list.
Definition at line 1109 of file pianoscene.cpp.
References customNoteNames().
Referenced by customNoteNames().
|
protected |
Displays the note label over a highligted key.
key | the activated key |
Definition at line 374 of file pianoscene.cpp.
References displayKeyOn(), drumstick::widgets::ShowActivated, and signalName().
Referenced by displayKeyOn(), showKeyOn(), and 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 event().
Referenced by event(), and signalName().
PianoPalette getBackgroundPalette | ( | ) |
Returns the background palette.
Definition at line 1325 of file pianoscene.cpp.
References getBackgroundPalette().
Referenced by getBackgroundPalette().
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.
References getChannel().
Referenced by getChannel().
PianoPalette getForegroundPalette | ( | ) |
Returns the active foreground palette.
Definition at line 1347 of file pianoscene.cpp.
References getForegroundPalette().
Referenced by getForegroundPalette().
PianoPalette getHighlightPalette | ( | ) |
Returns the palette used for highlighting the played keys.
Definition at line 365 of file pianoscene.cpp.
References getHighlightPalette().
Referenced by getHighlightPalette().
KeyboardMap * getKeyboardMap | ( | ) | const |
Returns the computer keyboard note map.
Definition at line 331 of file pianoscene.cpp.
References getKeyboardMap().
Referenced by getKeyboardMap().
|
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.
References getKeyForPos().
Referenced by getKeyForPos(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), and touchScreenEvent().
QColor getKeyPressedColor | ( | ) | const |
Returns the single highlight palette color.
Definition at line 1303 of file pianoscene.cpp.
References getKeyPressedColor().
Referenced by getKeyPressedColor(), PianoScene(), and resetKeyPressedColor().
int getMaxNote | ( | ) | const |
Returns the maximum MIDI note number that will be displayed.
Definition at line 881 of file pianoscene.cpp.
References getMaxNote().
Referenced by getMaxNote().
int getMinNote | ( | ) | const |
Returns the minimum MIDI note number that will be displayed.
Definition at line 848 of file pianoscene.cpp.
References getMinNote().
Referenced by getMinNote().
|
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.
References getNoteFromKey().
Referenced by getNoteFromKey(), getPianoKey(), keyPressEvent(), and keyReleaseEvent().
LabelCentralOctave getOctave | ( | ) | const |
Returns the central octave name policy.
Definition at line 1036 of file pianoscene.cpp.
References getOctave().
Referenced by getOctave().
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.
References getPianoHandler().
Referenced by getPianoHandler().
|
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 getNoteFromKey(), and getPianoKey().
Referenced by getPianoKey().
bool getRawKeyboardMode | ( | ) | const |
Returns whether the low level computer keyboard mode is enabled.
Definition at line 631 of file pianoscene.cpp.
References getRawKeyboardMode().
Referenced by getRawKeyboardMode().
int getTranspose | ( | ) | const |
Returns the transpose amount in semitones.
Definition at line 902 of file pianoscene.cpp.
References getTranspose().
Referenced by getTranspose().
int getVelocity | ( | ) |
Returns the MIDI note velocity parameter that is assigned to the MIDI OUT notes.
Definition at line 1127 of file pianoscene.cpp.
References getVelocity().
Referenced by getVelocity().
bool isMouseEnabled | ( | ) | const |
Returns whether the computer keyboard note generation is enabled.
Definition at line 1197 of file pianoscene.cpp.
References isMouseEnabled().
Referenced by isMouseEnabled().
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.
References isOctaveStart().
Referenced by isOctaveStart(), and refreshLabels().
bool isTouchEnabled | ( | ) | const |
Returns whether the touch screen note generation is enabled.
Definition at line 1217 of file pianoscene.cpp.
References isTouchEnabled().
Referenced by isTouchEnabled().
bool isUsingNativeFilter | ( | ) | const |
Returns whether the application is filtering native events.
Definition at line 1564 of file pianoscene.cpp.
References isUsingNativeFilter().
Referenced by isUsingNativeFilter().
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 keyOff(), and triggerNoteOff().
Referenced by keyOff(), keyOff(), keyOff(), keyReleaseEvent(), mouseMoveEvent(), mouseReleaseEvent(), and 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 keyOff(), showKeyOff(), and 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 keyOff(), showKeyOff(), and 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 keyOn(), and triggerNoteOn().
Referenced by keyOn(), keyOn(), keyOn(), keyPressEvent(), mouseMoveEvent(), mousePressEvent(), and 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 keyOn(), showKeyOn(), and 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 keyOn(), showKeyOn(), and 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 getNoteFromKey(), keyOn(), and keyPressEvent().
Referenced by keyPressEvent().
|
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 getNoteFromKey(), keyOff(), and keyReleaseEvent().
Referenced by keyReleaseEvent().
|
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 getKeyForPos(), keyOff(), keyOn(), and mouseMoveEvent().
Referenced by mouseMoveEvent().
|
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 getKeyForPos(), keyOn(), and mousePressEvent().
Referenced by mousePressEvent().
|
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 getKeyForPos(), keyOff(), and mouseReleaseEvent().
Referenced by mouseReleaseEvent().
|
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.
References noteName().
Referenced by noteName().
|
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 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 triggerNoteOn().
int numKeys | ( | ) | const |
Returns the number of keys that will be displayed.
Definition at line 924 of file pianoscene.cpp.
References numKeys().
Referenced by numKeys(), and PianoScene().
bool octaveSubscript | ( | ) | const |
Returns whether the subscript octave designation is enabled.
Definition at line 1585 of file pianoscene.cpp.
References octaveSubscript().
Referenced by octaveSubscript().
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 refreshLabels(), and setAlterations().
Referenced by setAlterations().
void setBackgroundPalette | ( | const PianoPalette & | p | ) |
Assigns the active background palette.
p | the active background palette |
Definition at line 1334 of file pianoscene.cpp.
References refreshKeys(), and setBackgroundPalette().
Referenced by setBackgroundPalette().
void setBaseOctave | ( | const int | base | ) |
Assigns the octave base number.
base | the octave base number |
Definition at line 911 of file pianoscene.cpp.
References hideOrShowKeys(), refreshLabels(), and setBaseOctave().
Referenced by setBaseOctave().
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.
References setChannel().
Referenced by setChannel().
void setForegroundPalette | ( | const PianoPalette & | p | ) |
Assigns the active foreground palette.
p | the foreground palette |
Definition at line 1356 of file pianoscene.cpp.
References refreshLabels(), and setForegroundPalette().
Referenced by setForegroundPalette().
|
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, drumstick::widgets::PAL_SINGLE, and setHighlightColorFromPolicy().
Referenced by setHighlightColorFromPolicy(), and 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 refreshKeys(), and setHighlightPalette().
Referenced by setHighlightPalette().
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.
References setKeyboardEnabled().
Referenced by setKeyboardEnabled().
void setKeyboardMap | ( | KeyboardMap * | map | ) |
Assigns the computer keyboard note map.
map | the computer keyboard note map. |
Definition at line 322 of file pianoscene.cpp.
References setKeyboardMap().
Referenced by setKeyboardMap().
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, and setKeyPressedColor().
Referenced by setKeyPressedColor().
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 hideOrShowKeys(), and setMaxNote().
Referenced by setMaxNote().
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 hideOrShowKeys(), and setMinNote().
Referenced by setMinNote().
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.
References setMouseEnabled().
Referenced by setMouseEnabled().
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 refreshLabels(), and setOctaveSubscript().
Referenced by setOctaveSubscript().
void setOrientation | ( | const LabelOrientation | orientation | ) |
Assigns the label orientation policy.
orientation | the label orientation policy |
Definition at line 1045 of file pianoscene.cpp.
References refreshLabels(), and setOrientation().
Referenced by setOrientation().
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.
References setPianoHandler().
Referenced by setPianoHandler().
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.
References setRawKeyboardMode().
Referenced by setRawKeyboardMode().
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 refreshKeys(), and setShowColorScale().
Referenced by setShowColorScale().
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 refreshLabels(), and setShowLabels().
Referenced by setShowLabels().
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.
References setTouchEnabled().
Referenced by setTouchEnabled().
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 hideOrShowKeys(), refreshLabels(), and setTranspose().
Referenced by setTranspose().
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.
References setUsingNativeFilter().
Referenced by setUsingNativeFilter().
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.
References setVelocity().
Referenced by setVelocity().
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.
References setVelocityTint().
Referenced by setVelocityTint().
bool showColorScale | ( | ) | const |
Returns whether the color scale mode is enabled.
Definition at line 1369 of file pianoscene.cpp.
References showColorScale().
Referenced by showColorScale().
|
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, showKeyOff(), and signalName().
Referenced by keyOff(), keyOff(), showKeyOff(), and 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 displayKeyOn(), setHighlightColorFromPolicy(), and showKeyOn().
|
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 displayKeyOn(), and showKeyOn().
Referenced by keyOn(), keyOn(), showKeyOn(), showKeyOn(), showNoteOn(), and showNoteOn().
LabelVisibility showLabels | ( | ) | const |
Returns the label visibility policy (display note names over the piano keys).
Definition at line 1089 of file pianoscene.cpp.
References showLabels().
Referenced by showLabels().
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 showKeyOff(), and showNoteOff().
Referenced by showNoteOff().
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 showKeyOn(), and showNoteOn().
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 showKeyOn(), and showNoteOn().
Referenced by showNoteOn(), and showNoteOn().
|
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 |
References event().
Referenced by displayKeyOn(), PianoKeybd::initScene(), and showKeyOff().
QSize sizeHint | ( | ) | const |
Returns the calculated size of the scene.
Definition at line 313 of file pianoscene.cpp.
References sizeHint().
Referenced by sizeHint().
QStringList standardNoteNames | ( | ) | const |
Returns the standard note names list.
Definition at line 1118 of file pianoscene.cpp.
References standardNoteNames().
Referenced by standardNoteNames().
int startKey | ( | ) | const |
Returns the first key number that will be displayed.
Definition at line 933 of file pianoscene.cpp.
References startKey().
Referenced by PianoScene(), and startKey().
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 getKeyForPos(), keyOff(), keyOn(), and touchScreenEvent().
Referenced by touchScreenEvent().
|
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 noteOff(), and triggerNoteOff().
Referenced by keyOff(), keyOff(), keyOff(), and triggerNoteOff().
|
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 noteOn(), and triggerNoteOn().
Referenced by keyOn(), keyOn(), keyOn(), and triggerNoteOn().
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 refreshLabels(), and useCustomNoteNames().
Referenced by useCustomNoteNames().
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.
References velocityTint().
Referenced by velocityTint().