Changed Whitespace

removed whitespace in Piano.cpp and Piano.h to comply with LMMS coding convetions
This commit is contained in:
PrestonXPitzer
2022-11-23 12:18:48 -05:00
committed by Johannes Lorenz
parent 2f2ba41f28
commit 79def0c3b5
2 changed files with 22 additions and 22 deletions

View File

@@ -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;
}

View File

@@ -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);
}