Working on thru.
This commit is contained in:
parent
d8e0631399
commit
8c9d289216
35
src/MIDI.h
35
src/MIDI.h
|
|
@ -68,7 +68,7 @@ public:
|
|||
inline void sendAfterTouch(DataByte inPressure,
|
||||
Channel inChannel);
|
||||
|
||||
inline void sendSysEx(unsigned int inLength,
|
||||
inline void sendSysEx(unsigned inLength,
|
||||
const byte* inArray,
|
||||
bool inArrayContainsBoundaries = false);
|
||||
|
||||
|
|
@ -76,7 +76,7 @@ public:
|
|||
DataByte inValuesNibble);
|
||||
inline void sendTimeCodeQuarterFrame(DataByte inData);
|
||||
|
||||
inline void sendSongPosition(unsigned int inBeats);
|
||||
inline void sendSongPosition(unsigned inBeats);
|
||||
inline void sendSongSelect(DataByte inSongNumber);
|
||||
inline void sendTuneRequest();
|
||||
inline void sendRealTime(MidiType inType);
|
||||
|
|
@ -109,7 +109,7 @@ public:
|
|||
inline DataByte getData1() const;
|
||||
inline DataByte getData2() const;
|
||||
inline const byte* getSysExArray() const;
|
||||
inline unsigned int getSysExArrayLength() const;
|
||||
inline unsigned getSysExArrayLength() const;
|
||||
inline bool check() const;
|
||||
|
||||
public:
|
||||
|
|
@ -119,6 +119,7 @@ public:
|
|||
public:
|
||||
static inline MidiType getTypeFromStatusByte(byte inStatus);
|
||||
static inline bool isChannelMessage(MidiType inType);
|
||||
static inline bool isRealtimeMessage(MidiType inType);
|
||||
|
||||
private:
|
||||
bool inputFilter(Channel inChannel);
|
||||
|
|
@ -130,8 +131,8 @@ private:
|
|||
Channel mInputChannel;
|
||||
|
||||
byte mPendingMessage[3]; // SysEx are dumped into mMessage directly.
|
||||
unsigned int mPendingMessageExpectedLenght;
|
||||
unsigned int mPendingMessageIndex; // Extended to unsigned int for larger SysEx payloads.
|
||||
unsigned mPendingMessageExpectedLenght;
|
||||
unsigned mPendingMessageIndex; // Extended to unsigned for larger SysEx payloads.
|
||||
Message mMessage;
|
||||
|
||||
|
||||
|
|
@ -150,7 +151,7 @@ public:
|
|||
inline void setHandlePitchBend(void (*fptr)(byte channel, int bend));
|
||||
inline void setHandleSystemExclusive(void (*fptr)(byte * array, byte size));
|
||||
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 setHandleTuneRequest(void (*fptr)(void));
|
||||
inline void setHandleClock(void (*fptr)(void));
|
||||
|
|
@ -175,7 +176,7 @@ private:
|
|||
void (*mPitchBendCallback)(byte channel, int);
|
||||
void (*mSystemExclusiveCallback)(byte * array, byte size);
|
||||
void (*mTimeCodeQuarterFrameCallback)(byte data);
|
||||
void (*mSongPositionCallback)(unsigned int beats);
|
||||
void (*mSongPositionCallback)(unsigned beats);
|
||||
void (*mSongSelectCallback)(byte songnumber);
|
||||
void (*mTuneRequestCallback)(void);
|
||||
void (*mClockCallback)(void);
|
||||
|
|
@ -196,20 +197,20 @@ private:
|
|||
#if MIDI_BUILD_THRU
|
||||
|
||||
public:
|
||||
inline MidiFilterMode getFilterMode() const;
|
||||
inline bool getThruState() const;
|
||||
|
||||
inline void turnThruOn(MidiFilterMode inThruFilterMode = Full);
|
||||
inline void turnThruOn(ThruFlags inThruFlags = ThruFilterFlags::all);
|
||||
inline void turnThruOff();
|
||||
inline void setThruFilterMode(MidiFilterMode inThruFilterMode);
|
||||
|
||||
|
||||
inline void setThruFilterMode(ThruFlags inFlags);
|
||||
inline ThruFlags getThruFilterMode() const;
|
||||
inline bool isThruOn() const;
|
||||
inline bool hasThruFlag(byte inFlag) const;
|
||||
|
||||
private:
|
||||
void thruFilter(byte inChannel);
|
||||
|
||||
inline bool shouldMessageBeForwarded(StatusByte inStatus) const;
|
||||
|
||||
private:
|
||||
bool mThruActivated : 1;
|
||||
MidiFilterMode mThruFilterMode : 7;
|
||||
ThruFlags mThruFlags;
|
||||
bool mForwardCurrentMessage;
|
||||
|
||||
#endif // MIDI_BUILD_THRU
|
||||
|
||||
|
|
|
|||
538
src/MIDI.hpp
538
src/MIDI.hpp
File diff suppressed because it is too large
Load Diff
|
|
@ -62,7 +62,7 @@ enum MidiType
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
/*! Enumeration of Thru filter modes */
|
||||
enum MidiFilterMode
|
||||
enum MidiFilterMode
|
||||
{
|
||||
Off = 0, ///< Thru disabled (nothing passes through).
|
||||
Full = 1, ///< Fully enabled Thru (every incoming message is sent back).
|
||||
|
|
@ -70,6 +70,23 @@ enum MidiFilterMode
|
|||
DifferentChannel = 3, ///< All the messages but the ones on the Input Channel will be sent back.
|
||||
};
|
||||
|
||||
struct ThruFilterFlags
|
||||
{
|
||||
enum
|
||||
{
|
||||
off = 0
|
||||
|
||||
, channelSame = 1
|
||||
, channelDifferent = 2
|
||||
, channel = channelSame | channelDifferent
|
||||
, system = 4
|
||||
, realtime = 8
|
||||
, all = channel | system | realtime
|
||||
};
|
||||
};
|
||||
|
||||
typedef byte ThruFlags;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/*! \brief Enumeration of Control Change command numbers.
|
||||
|
|
|
|||
Loading…
Reference in New Issue