Cleanup & init'd thru.
This commit is contained in:
parent
8eb881f39e
commit
8ebd4f9161
30
src/MIDI.h
30
src/MIDI.h
|
|
@ -152,8 +152,7 @@ public:
|
||||||
public:
|
public:
|
||||||
static inline MidiType getTypeFromStatusByte(byte inStatus);
|
static inline MidiType getTypeFromStatusByte(byte inStatus);
|
||||||
static inline Channel getChannelFromStatusByte(byte inStatus);
|
static inline Channel getChannelFromStatusByte(byte inStatus);
|
||||||
static inline bool isChannelMessage(MidiType inType);
|
static inline bool isChannelMessage(MidiType inType);
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
// Input Callbacks
|
// Input Callbacks
|
||||||
|
|
@ -222,10 +221,6 @@ private:
|
||||||
inline bool inputFilter(Channel inChannel);
|
inline bool inputFilter(Channel inChannel);
|
||||||
inline void resetInput();
|
inline void resetInput();
|
||||||
|
|
||||||
private:
|
|
||||||
bool mThruActivated : 1;
|
|
||||||
MidiFilterMode mThruFilterMode : 7;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef Message<Settings::SysExMaxSize> MidiMessage;
|
typedef Message<Settings::SysExMaxSize> MidiMessage;
|
||||||
|
|
||||||
|
|
@ -233,15 +228,18 @@ private:
|
||||||
SerialPort& mSerial;
|
SerialPort& mSerial;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Channel mInputChannel;
|
Channel mInputChannel;
|
||||||
StatusByte mRunningStatus_RX;
|
StatusByte mRunningStatus_RX;
|
||||||
StatusByte mRunningStatus_TX;
|
StatusByte mRunningStatus_TX;
|
||||||
byte mPendingMessage[3];
|
byte mPendingMessage[3];
|
||||||
unsigned mPendingMessageExpectedLenght;
|
unsigned mPendingMessageExpectedLenght;
|
||||||
unsigned mPendingMessageIndex;
|
unsigned mPendingMessageIndex;
|
||||||
unsigned mCurrentRpnNumber;
|
unsigned mCurrentRpnNumber;
|
||||||
unsigned mCurrentNrpnNumber;
|
unsigned mCurrentNrpnNumber;
|
||||||
MidiMessage mMessage;
|
bool mThruActivated : 1;
|
||||||
|
MidiFilterMode mThruFilterMode : 7;
|
||||||
|
MidiMessage mMessage;
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
inline StatusByte getStatus(MidiType inType,
|
inline StatusByte getStatus(MidiType inType,
|
||||||
|
|
@ -255,6 +253,4 @@ unsigned decodeSysEx(const byte* inSysEx, byte* outData, unsigned inLenght);
|
||||||
|
|
||||||
END_MIDI_NAMESPACE
|
END_MIDI_NAMESPACE
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#include "MIDI.hpp"
|
#include "MIDI.hpp"
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,8 @@ inline MidiInterface<SerialPort, Settings>::MidiInterface(SerialPort& inSerial)
|
||||||
, mPendingMessageIndex(0)
|
, mPendingMessageIndex(0)
|
||||||
, mCurrentRpnNumber(0xffff)
|
, mCurrentRpnNumber(0xffff)
|
||||||
, mCurrentNrpnNumber(0xffff)
|
, mCurrentNrpnNumber(0xffff)
|
||||||
|
, mThruActivated(true)
|
||||||
|
, mThruFilterMode(Full)
|
||||||
{
|
{
|
||||||
mNoteOffCallback = 0;
|
mNoteOffCallback = 0;
|
||||||
mNoteOnCallback = 0;
|
mNoteOnCallback = 0;
|
||||||
|
|
@ -781,9 +783,14 @@ bool MidiInterface<SerialPort, Settings>::parse()
|
||||||
|
|
||||||
// Save data2 only if applicable
|
// Save data2 only if applicable
|
||||||
if (mPendingMessageExpectedLenght == 3)
|
if (mPendingMessageExpectedLenght == 3)
|
||||||
|
{
|
||||||
|
// todo: This code seems unreacheable, to clean up.
|
||||||
mMessage.data2 = mPendingMessage[2];
|
mMessage.data2 = mPendingMessage[2];
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
mMessage.data2 = 0;
|
mMessage.data2 = 0;
|
||||||
|
}
|
||||||
|
|
||||||
mPendingMessageIndex = 0;
|
mPendingMessageIndex = 0;
|
||||||
mPendingMessageExpectedLenght = 0;
|
mPendingMessageExpectedLenght = 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue