Skip to content

Commit a44d1e7

Browse files
author
Francois Best
authored
Merge pull request #98 from jarosz/master
Corrected typo.
2 parents 1cd6383 + e486667 commit a44d1e7

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

src/MIDI.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ BEGIN_MIDI_NAMESPACE
3737
data you want to send.
3838
\param inData The data to encode.
3939
\param outSysEx The output buffer where to store the encoded message.
40-
\param inLength The lenght of the input buffer.
41-
\return The lenght of the encoded output buffer.
40+
\param inLength The length of the input buffer.
41+
\return The length of the encoded output buffer.
4242
@see decodeSysEx
4343
Code inspired from Ruin & Wesen's SysEx encoder/decoder - http://ruinwesen.com
4444
*/
@@ -74,8 +74,8 @@ unsigned encodeSysEx(const byte* inData, byte* outSysEx, unsigned inLength)
7474
your received message.
7575
\param inSysEx The SysEx data received from MIDI in.
7676
\param outData The output buffer where to store the decrypted message.
77-
\param inLength The lenght of the input buffer.
78-
\return The lenght of the output buffer.
77+
\param inLength The length of the input buffer.
78+
\return The length of the output buffer.
7979
@see encodeSysEx @see getSysExArrayLength
8080
Code inspired from Ruin & Wesen's SysEx encoder/decoder - http://ruinwesen.com
8181
*/

src/MIDI.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ class MidiInterface
234234
StatusByte mRunningStatus_RX;
235235
StatusByte mRunningStatus_TX;
236236
byte mPendingMessage[3];
237-
unsigned mPendingMessageExpectedLenght;
237+
unsigned mPendingMessageExpectedLength;
238238
unsigned mPendingMessageIndex;
239239
unsigned mCurrentRpnNumber;
240240
unsigned mCurrentNrpnNumber;
@@ -250,8 +250,8 @@ class MidiInterface
250250

251251
// -----------------------------------------------------------------------------
252252

253-
unsigned encodeSysEx(const byte* inData, byte* outSysEx, unsigned inLenght);
254-
unsigned decodeSysEx(const byte* inSysEx, byte* outData, unsigned inLenght);
253+
unsigned encodeSysEx(const byte* inData, byte* outSysEx, unsigned inLength);
254+
unsigned decodeSysEx(const byte* inSysEx, byte* outData, unsigned inLength);
255255

256256
END_MIDI_NAMESPACE
257257

src/MIDI.hpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ inline MidiInterface<SerialPort, Settings>::MidiInterface(SerialPort& inSerial)
3636
, mInputChannel(0)
3737
, mRunningStatus_RX(InvalidType)
3838
, mRunningStatus_TX(InvalidType)
39-
, mPendingMessageExpectedLenght(0)
39+
, mPendingMessageExpectedLength(0)
4040
, mPendingMessageIndex(0)
4141
, mCurrentRpnNumber(0xffff)
4242
, mCurrentNrpnNumber(0xffff)
@@ -95,7 +95,7 @@ void MidiInterface<SerialPort, Settings>::begin(Channel inChannel)
9595
mRunningStatus_RX = InvalidType;
9696

9797
mPendingMessageIndex = 0;
98-
mPendingMessageExpectedLenght = 0;
98+
mPendingMessageExpectedLength = 0;
9999

100100
mCurrentRpnNumber = 0xffff;
101101
mCurrentNrpnNumber = 0xffff;
@@ -746,7 +746,7 @@ bool MidiInterface<SerialPort, Settings>::parse()
746746
// Do not reset all input attributes, Running Status must remain unchanged.
747747
// We still need to reset these
748748
mPendingMessageIndex = 0;
749-
mPendingMessageExpectedLenght = 0;
749+
mPendingMessageExpectedLength = 0;
750750

751751
return true;
752752
break;
@@ -756,7 +756,7 @@ bool MidiInterface<SerialPort, Settings>::parse()
756756
case AfterTouchChannel:
757757
case TimeCodeQuarterFrame:
758758
case SongSelect:
759-
mPendingMessageExpectedLenght = 2;
759+
mPendingMessageExpectedLength = 2;
760760
break;
761761

762762
// 3 bytes messages
@@ -766,13 +766,13 @@ bool MidiInterface<SerialPort, Settings>::parse()
766766
case PitchBend:
767767
case AfterTouchPoly:
768768
case SongPosition:
769-
mPendingMessageExpectedLenght = 3;
769+
mPendingMessageExpectedLength = 3;
770770
break;
771771

772772
case SystemExclusive:
773-
// The message can be any lenght
773+
// The message can be any length
774774
// between 3 and MidiMessage::sSysExMaxSize bytes
775-
mPendingMessageExpectedLenght = MidiMessage::sSysExMaxSize;
775+
mPendingMessageExpectedLength = MidiMessage::sSysExMaxSize;
776776
mRunningStatus_RX = InvalidType;
777777
mMessage.sysexArray[0] = SystemExclusive;
778778
break;
@@ -785,7 +785,7 @@ bool MidiInterface<SerialPort, Settings>::parse()
785785
break;
786786
}
787787

788-
if (mPendingMessageIndex >= (mPendingMessageExpectedLenght - 1))
788+
if (mPendingMessageIndex >= (mPendingMessageExpectedLength - 1))
789789
{
790790
// Reception complete
791791
mMessage.type = getTypeFromStatusByte(mPendingMessage[0]);
@@ -794,7 +794,7 @@ bool MidiInterface<SerialPort, Settings>::parse()
794794
mMessage.data2 = 0; // Completed new message has 1 data byte
795795

796796
mPendingMessageIndex = 0;
797-
mPendingMessageExpectedLenght = 0;
797+
mPendingMessageExpectedLength = 0;
798798
mMessage.valid = true;
799799
return true;
800800
}
@@ -882,7 +882,7 @@ bool MidiInterface<SerialPort, Settings>::parse()
882882
mPendingMessage[mPendingMessageIndex] = extracted;
883883

884884
// Now we are going to check if we have reached the end of the message
885-
if (mPendingMessageIndex >= (mPendingMessageExpectedLenght - 1))
885+
if (mPendingMessageIndex >= (mPendingMessageExpectedLength - 1))
886886
{
887887
// "FML" case: fall down here with an overflown SysEx..
888888
// This means we received the last possible data byte that can fit
@@ -903,11 +903,11 @@ bool MidiInterface<SerialPort, Settings>::parse()
903903
mMessage.data1 = mPendingMessage[1];
904904

905905
// Save data2 only if applicable
906-
mMessage.data2 = mPendingMessageExpectedLenght == 3 ? mPendingMessage[2] : 0;
906+
mMessage.data2 = mPendingMessageExpectedLength == 3 ? mPendingMessage[2] : 0;
907907

908908
// Reset local variables
909909
mPendingMessageIndex = 0;
910-
mPendingMessageExpectedLenght = 0;
910+
mPendingMessageExpectedLength = 0;
911911

912912
mMessage.valid = true;
913913

@@ -996,7 +996,7 @@ template<class SerialPort, class Settings>
996996
inline void MidiInterface<SerialPort, Settings>::resetInput()
997997
{
998998
mPendingMessageIndex = 0;
999-
mPendingMessageExpectedLenght = 0;
999+
mPendingMessageExpectedLength = 0;
10001000
mRunningStatus_RX = InvalidType;
10011001
}
10021002

@@ -1047,7 +1047,7 @@ inline const byte* MidiInterface<SerialPort, Settings>::getSysExArray() const
10471047
return mMessage.sysexArray;
10481048
}
10491049

1050-
/*! \brief Get the lenght of the System Exclusive array.
1050+
/*! \brief Get the length of the System Exclusive array.
10511051
10521052
It is coded using data1 as LSB and data2 as MSB.
10531053
\return The array's length, in bytes.

0 commit comments

Comments
 (0)