unsigned int -> unsigned and trimmed whitespace.
This commit is contained in:
parent
601ddb3773
commit
c4d5d76f4a
14
src/MIDI.h
14
src/MIDI.h
|
|
@ -68,7 +68,7 @@ public:
|
||||||
inline void sendAfterTouch(DataByte inPressure,
|
inline void sendAfterTouch(DataByte inPressure,
|
||||||
Channel inChannel);
|
Channel inChannel);
|
||||||
|
|
||||||
inline void sendSysEx(unsigned int inLength,
|
inline void sendSysEx(unsigned inLength,
|
||||||
const byte* inArray,
|
const byte* inArray,
|
||||||
bool inArrayContainsBoundaries = false);
|
bool inArrayContainsBoundaries = false);
|
||||||
|
|
||||||
|
|
@ -76,7 +76,7 @@ public:
|
||||||
DataByte inValuesNibble);
|
DataByte inValuesNibble);
|
||||||
inline void sendTimeCodeQuarterFrame(DataByte inData);
|
inline void sendTimeCodeQuarterFrame(DataByte inData);
|
||||||
|
|
||||||
inline void sendSongPosition(unsigned int inBeats);
|
inline void sendSongPosition(unsigned inBeats);
|
||||||
inline void sendSongSelect(DataByte inSongNumber);
|
inline void sendSongSelect(DataByte inSongNumber);
|
||||||
inline void sendTuneRequest();
|
inline void sendTuneRequest();
|
||||||
inline void sendRealTime(MidiType inType);
|
inline void sendRealTime(MidiType inType);
|
||||||
|
|
@ -109,7 +109,7 @@ public:
|
||||||
inline DataByte getData1() const;
|
inline DataByte getData1() const;
|
||||||
inline DataByte getData2() const;
|
inline DataByte getData2() const;
|
||||||
inline const byte* getSysExArray() const;
|
inline const byte* getSysExArray() const;
|
||||||
inline unsigned int getSysExArrayLength() const;
|
inline unsigned getSysExArrayLength() const;
|
||||||
inline bool check() const;
|
inline bool check() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
@ -130,8 +130,8 @@ private:
|
||||||
Channel mInputChannel;
|
Channel mInputChannel;
|
||||||
|
|
||||||
byte mPendingMessage[3]; // SysEx are dumped into mMessage directly.
|
byte mPendingMessage[3]; // SysEx are dumped into mMessage directly.
|
||||||
unsigned int mPendingMessageExpectedLenght;
|
unsigned mPendingMessageExpectedLenght;
|
||||||
unsigned int mPendingMessageIndex; // Extended to unsigned int for larger SysEx payloads.
|
unsigned mPendingMessageIndex; // Extended to unsigned for larger SysEx payloads.
|
||||||
Message mMessage;
|
Message mMessage;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -150,7 +150,7 @@ public:
|
||||||
inline void setHandlePitchBend(void (*fptr)(byte channel, int bend));
|
inline void setHandlePitchBend(void (*fptr)(byte channel, int bend));
|
||||||
inline void setHandleSystemExclusive(void (*fptr)(byte * array, byte size));
|
inline void setHandleSystemExclusive(void (*fptr)(byte * array, byte size));
|
||||||
inline void setHandleTimeCodeQuarterFrame(void (*fptr)(byte data));
|
inline void setHandleTimeCodeQuarterFrame(void (*fptr)(byte data));
|
||||||
inline void setHandleSongPosition(void (*fptr)(unsigned int beats));
|
inline void setHandleSongPosition(void (*fptr)(unsigned beats));
|
||||||
inline void setHandleSongSelect(void (*fptr)(byte songnumber));
|
inline void setHandleSongSelect(void (*fptr)(byte songnumber));
|
||||||
inline void setHandleTuneRequest(void (*fptr)(void));
|
inline void setHandleTuneRequest(void (*fptr)(void));
|
||||||
inline void setHandleClock(void (*fptr)(void));
|
inline void setHandleClock(void (*fptr)(void));
|
||||||
|
|
@ -175,7 +175,7 @@ private:
|
||||||
void (*mPitchBendCallback)(byte channel, int);
|
void (*mPitchBendCallback)(byte channel, int);
|
||||||
void (*mSystemExclusiveCallback)(byte * array, byte size);
|
void (*mSystemExclusiveCallback)(byte * array, byte size);
|
||||||
void (*mTimeCodeQuarterFrameCallback)(byte data);
|
void (*mTimeCodeQuarterFrameCallback)(byte data);
|
||||||
void (*mSongPositionCallback)(unsigned int beats);
|
void (*mSongPositionCallback)(unsigned beats);
|
||||||
void (*mSongSelectCallback)(byte songnumber);
|
void (*mSongSelectCallback)(byte songnumber);
|
||||||
void (*mTuneRequestCallback)(void);
|
void (*mTuneRequestCallback)(void);
|
||||||
void (*mClockCallback)(void);
|
void (*mClockCallback)(void);
|
||||||
|
|
|
||||||
16
src/MIDI.hpp
16
src/MIDI.hpp
|
|
@ -268,7 +268,7 @@ template<class SerialPort>
|
||||||
void MidiInterface<SerialPort>::sendPitchBend(int inPitchValue,
|
void MidiInterface<SerialPort>::sendPitchBend(int inPitchValue,
|
||||||
Channel inChannel)
|
Channel inChannel)
|
||||||
{
|
{
|
||||||
const unsigned int bend = inPitchValue - MIDI_PITCHBEND_MIN;
|
const unsigned bend = inPitchValue - MIDI_PITCHBEND_MIN;
|
||||||
send(PitchBend, (bend & 0x7F), (bend >> 7) & 0x7F, inChannel);
|
send(PitchBend, (bend & 0x7F), (bend >> 7) & 0x7F, inChannel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -297,7 +297,7 @@ void MidiInterface<SerialPort>::sendPitchBend(double inPitchValue,
|
||||||
with previous versions of the library.
|
with previous versions of the library.
|
||||||
*/
|
*/
|
||||||
template<class SerialPort>
|
template<class SerialPort>
|
||||||
void MidiInterface<SerialPort>::sendSysEx(unsigned int inLength,
|
void MidiInterface<SerialPort>::sendSysEx(unsigned inLength,
|
||||||
const byte* inArray,
|
const byte* inArray,
|
||||||
bool inArrayContainsBoundaries)
|
bool inArrayContainsBoundaries)
|
||||||
{
|
{
|
||||||
|
|
@ -305,14 +305,14 @@ void MidiInterface<SerialPort>::sendSysEx(unsigned int inLength,
|
||||||
{
|
{
|
||||||
mSerial.write(0xF0);
|
mSerial.write(0xF0);
|
||||||
|
|
||||||
for (unsigned int i = 0; i < inLength; ++i)
|
for (unsigned i = 0; i < inLength; ++i)
|
||||||
mSerial.write(inArray[i]);
|
mSerial.write(inArray[i]);
|
||||||
|
|
||||||
mSerial.write(0xF7);
|
mSerial.write(0xF7);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (unsigned int i = 0; i < inLength; ++i)
|
for (unsigned i = 0; i < inLength; ++i)
|
||||||
mSerial.write(inArray[i]);
|
mSerial.write(inArray[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -367,7 +367,7 @@ void MidiInterface<SerialPort>::sendTimeCodeQuarterFrame(DataByte inData)
|
||||||
\param inBeats The number of beats since the start of the song.
|
\param inBeats The number of beats since the start of the song.
|
||||||
*/
|
*/
|
||||||
template<class SerialPort>
|
template<class SerialPort>
|
||||||
void MidiInterface<SerialPort>::sendSongPosition(unsigned int inBeats)
|
void MidiInterface<SerialPort>::sendSongPosition(unsigned inBeats)
|
||||||
{
|
{
|
||||||
mSerial.write((byte)SongPosition);
|
mSerial.write((byte)SongPosition);
|
||||||
mSerial.write(inBeats & 0x7F);
|
mSerial.write(inBeats & 0x7F);
|
||||||
|
|
@ -865,9 +865,9 @@ const byte* MidiInterface<SerialPort>::getSysExArray() const
|
||||||
\return The array's length, in bytes.
|
\return The array's length, in bytes.
|
||||||
*/
|
*/
|
||||||
template<class SerialPort>
|
template<class SerialPort>
|
||||||
unsigned int MidiInterface<SerialPort>::getSysExArrayLength() const
|
unsigned MidiInterface<SerialPort>::getSysExArrayLength() const
|
||||||
{
|
{
|
||||||
const unsigned int size = ((unsigned)(mMessage.data2) << 8) | mMessage.data1;
|
const unsigned size = ((unsigned)(mMessage.data2) << 8) | mMessage.data1;
|
||||||
return (size > MIDI_SYSEX_ARRAY_SIZE) ? MIDI_SYSEX_ARRAY_SIZE : size;
|
return (size > MIDI_SYSEX_ARRAY_SIZE) ? MIDI_SYSEX_ARRAY_SIZE : size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -944,7 +944,7 @@ template<class SerialPort> void MidiInterface<SerialPort>::setHandleAfterTouchCh
|
||||||
template<class SerialPort> void MidiInterface<SerialPort>::setHandlePitchBend(void (*fptr)(byte channel, int bend)) { mPitchBendCallback = fptr; }
|
template<class SerialPort> void MidiInterface<SerialPort>::setHandlePitchBend(void (*fptr)(byte channel, int bend)) { mPitchBendCallback = fptr; }
|
||||||
template<class SerialPort> void MidiInterface<SerialPort>::setHandleSystemExclusive(void (*fptr)(byte* array, byte size)) { mSystemExclusiveCallback = fptr; }
|
template<class SerialPort> void MidiInterface<SerialPort>::setHandleSystemExclusive(void (*fptr)(byte* array, byte size)) { mSystemExclusiveCallback = fptr; }
|
||||||
template<class SerialPort> void MidiInterface<SerialPort>::setHandleTimeCodeQuarterFrame(void (*fptr)(byte data)) { mTimeCodeQuarterFrameCallback = fptr; }
|
template<class SerialPort> void MidiInterface<SerialPort>::setHandleTimeCodeQuarterFrame(void (*fptr)(byte data)) { mTimeCodeQuarterFrameCallback = fptr; }
|
||||||
template<class SerialPort> void MidiInterface<SerialPort>::setHandleSongPosition(void (*fptr)(unsigned int beats)) { mSongPositionCallback = fptr; }
|
template<class SerialPort> void MidiInterface<SerialPort>::setHandleSongPosition(void (*fptr)(unsigned beats)) { mSongPositionCallback = fptr; }
|
||||||
template<class SerialPort> void MidiInterface<SerialPort>::setHandleSongSelect(void (*fptr)(byte songnumber)) { mSongSelectCallback = fptr; }
|
template<class SerialPort> void MidiInterface<SerialPort>::setHandleSongSelect(void (*fptr)(byte songnumber)) { mSongSelectCallback = fptr; }
|
||||||
template<class SerialPort> void MidiInterface<SerialPort>::setHandleTuneRequest(void (*fptr)(void)) { mTuneRequestCallback = fptr; }
|
template<class SerialPort> void MidiInterface<SerialPort>::setHandleTuneRequest(void (*fptr)(void)) { mTuneRequestCallback = fptr; }
|
||||||
template<class SerialPort> void MidiInterface<SerialPort>::setHandleClock(void (*fptr)(void)) { mClockCallback = fptr; }
|
template<class SerialPort> void MidiInterface<SerialPort>::setHandleClock(void (*fptr)(void)) { mClockCallback = fptr; }
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue