|
lmms
Cross-platform music production software
|
#include <Piano.h>
Public Types | |
| enum class | KeyType { White , Black } |
Public Member Functions | |
| Piano (InstrumentTrack *track) | |
| Create a new keyboard display. | |
| void | setKeyState (int key, bool state) |
| Turn a key on or off. | |
| bool | isKeyPressed (int key) const |
| void | handleKeyPress (int key, int midiVelocity=-1) |
| Handle a note being pressed on our keyboard display. | |
| void | handleKeyRelease (int key) |
| Handle a note being released on our keyboard display. | |
| InstrumentTrack * | instrumentTrack () const |
| MidiEventProcessor * | midiEventProcessor () const |
| Public Member Functions inherited from lmms::Model | |
| Model (Model *parent, QString displayName=QString(), bool defaultConstructed=false) | |
| ~Model () override=default | |
| bool | isDefaultConstructed () const |
| Model * | parentModel () const |
| virtual QString | displayName () const |
| virtual void | setDisplayName (const QString &displayName) |
| virtual QString | fullDisplayName () const |
Static Public Member Functions | |
| static bool | isWhiteKey (int key) |
| static bool | isBlackKey (int key) |
Static Public Attributes | |
| static const unsigned int | WhiteKeysPerOctave = 7 |
| static const unsigned int | BlackKeysPerOctave = 5 |
| static const unsigned int | NumWhiteKeys = 75 |
| static const unsigned int | NumBlackKeys = 53 |
Static Private Member Functions | |
| static bool | isValidKey (int key) |
Private Attributes | |
| InstrumentTrack * | m_instrumentTrack |
| MidiEventProcessor * | m_midiEvProc |
| std::array< bool, NumKeys > | m_pressedKeys = {} |
Additional Inherited Members | |
| Signals inherited from lmms::Model | |
| void | dataChanged () |
| void | dataUnchanged () |
| void | propertiesChanged () |
|
strong |
| lmms::Piano::Piano | ( | InstrumentTrack * | track | ) |
Create a new keyboard display.
| track | The InstrumentTrack window to attach to |
| void lmms::Piano::handleKeyPress | ( | int | key, |
| int | midiVelocity = -1 ) |
Handle a note being pressed on our keyboard display.
| key | the key being pressed |
| midiVelocity | An optional MIDI velocity override |
| void lmms::Piano::handleKeyRelease | ( | int | key | ) |
Handle a note being released on our keyboard display.
| key | the key being releassed |
|
inline |
|
static |
|
inline |
|
inlinestaticprivate |
|
static |
|
inline |
| void lmms::Piano::setKeyState | ( | int | key, |
| bool | state ) |
Turn a key on or off.
| key | the key number to change |
| state | the state to set the key to |
|
static |
|
private |
|
private |
|
private |
|
static |
|
static |
|
static |