From 79def0c3b544826ceb7c72fbd3dd9e602c75a058 Mon Sep 17 00:00:00 2001 From: PrestonXPitzer Date: Wed, 23 Nov 2022 12:18:48 -0500 Subject: [PATCH] Changed Whitespace removed whitespace in Piano.cpp and Piano.h to comply with LMMS coding convetions --- include/Piano.h | 12 ++++++------ src/core/Piano.cpp | 32 ++++++++++++++++---------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/include/Piano.h b/include/Piano.h index 01a20046d..531bb65a6 100644 --- a/include/Piano.h +++ b/include/Piano.h @@ -44,17 +44,17 @@ public: BlackKey } ; - Piano( InstrumentTrack* track ); + Piano(InstrumentTrack* track); - void setKeyState( int key, bool state ); + void setKeyState(int key, bool state); - bool isKeyPressed( int key ) const + bool isKeyPressed(int key) const { return m_pressedKeys[key]; } - void handleKeyPress( int key, int midiVelocity = -1 ); - void handleKeyRelease( int key ); + void handleKeyPress(int key, int midiVelocity = -1); + void handleKeyRelease(int key); InstrumentTrack* instrumentTrack() const { @@ -75,7 +75,7 @@ public: static const unsigned int NumBlackKeys = 53; private: - static bool isValidKey( int key ) + static bool isValidKey(int key) { return key >= 0 && key < NumKeys; } diff --git a/src/core/Piano.cpp b/src/core/Piano.cpp index 0f59dd905..82323526e 100644 --- a/src/core/Piano.cpp +++ b/src/core/Piano.cpp @@ -62,10 +62,10 @@ static const auto KEY_ORDER = std::array * * \param _it the InstrumentTrack window to attach to */ -Piano::Piano( InstrumentTrack* track ) : - Model( nullptr ), /*!< base class ctor */ - m_instrumentTrack( track ), - m_midiEvProc( track ) /*!< the InstrumentTrack Model */ +Piano::Piano(InstrumentTrack* track) : + Model(nullptr), /*!< base class ctor */ + m_instrumentTrack(track), + m_midiEvProc(track) /*!< the InstrumentTrack Model */ { } @@ -74,9 +74,9 @@ Piano::Piano( InstrumentTrack* track ) : * \param key the key number to change * \param state the state to set the key to */ -void Piano::setKeyState( int key, bool state ) +void Piano::setKeyState(int key, bool state) { - if( isValidKey( key ) ) + if (isValidKey(key)) { m_pressedKeys[key] = state; @@ -91,15 +91,15 @@ void Piano::setKeyState( int key, bool state ) * * \param key the key being pressed */ -void Piano::handleKeyPress( int key, int midiVelocity ) +void Piano::handleKeyPress(int key, int midiVelocity) { - if( midiVelocity == -1 ) + if (midiVelocity == -1) { midiVelocity = m_instrumentTrack->midiPort()->baseVelocity(); } - if( isValidKey( key ) ) + if (isValidKey(key)) { - m_midiEvProc->processInEvent( MidiEvent( MidiNoteOn, -1, key, midiVelocity ) ); + m_midiEvProc->processInEvent(MidiEvent(MidiNoteOn, -1, key, midiVelocity)); m_pressedKeys[key] = true; } } @@ -112,18 +112,18 @@ void Piano::handleKeyPress( int key, int midiVelocity ) * * \param key the key being releassed */ -void Piano::handleKeyRelease( int key ) +void Piano::handleKeyRelease(int key) { - if( isValidKey( key ) ) + if (isValidKey(key)) { - m_midiEvProc->processInEvent( MidiEvent( MidiNoteOff, -1, key, 0 ) ); + m_midiEvProc->processInEvent(MidiEvent(MidiNoteOff, -1, key, 0)); m_pressedKeys[key] = false; } } -bool Piano::isBlackKey( int key ) +bool Piano::isBlackKey(int key) { int keyCode = key % KeysPerOctave; @@ -131,9 +131,9 @@ bool Piano::isBlackKey( int key ) } -bool Piano::isWhiteKey( int key ) +bool Piano::isWhiteKey(int key) { - return !isBlackKey( key ); + return !isBlackKey(key); }