FastLED 3.9.15
Loading...
Searching...
No Matches

◆ thruFilter()

template<class Transport, class Settings, class Platform>
void MidiInterface< Transport, Settings, Platform >::thruFilter ( byte inChannel)
private

Definition at line 1400 of file MIDI.hpp.

1401{
1402 // If the feature is disabled, don't do anything.
1404 return;
1405
1406 // First, check if the received message is Channel
1407 if (mMessage.type >= NoteOff && mMessage.type <= PitchBend)
1408 {
1409 const bool filter_condition = ((mMessage.channel == inChannel) ||
1411
1412 // Now let's pass it to the output
1413 switch (mThruFilterMode)
1414 {
1415 case Thru::Full:
1416 send(mMessage.type,
1417 mMessage.data1,
1418 mMessage.data2,
1419 mMessage.channel);
1420 break;
1421
1422 case Thru::SameChannel:
1423 if (filter_condition)
1424 {
1425 send(mMessage.type,
1426 mMessage.data1,
1427 mMessage.data2,
1428 mMessage.channel);
1429 }
1430 break;
1431
1433 if (!filter_condition)
1434 {
1435 send(mMessage.type,
1436 mMessage.data1,
1437 mMessage.data2,
1438 mMessage.channel);
1439 }
1440 break;
1441
1442 default:
1443 break;
1444 }
1445 }
1446 else
1447 {
1448 // Send the message to the output
1449 switch (mMessage.type)
1450 {
1451 // Real Time and 1 byte
1452 case Clock:
1453 case Start:
1454 case Stop:
1455 case Continue:
1456 case ActiveSensing:
1457 case SystemReset:
1458 case TuneRequest:
1459 sendRealTime(mMessage.type);
1460 break;
1461
1462 case SystemExclusive:
1463 // Send SysEx (0xf0 and 0xf7 are included in the buffer)
1465 break;
1466
1467 case SongSelect:
1468 sendSongSelect(mMessage.data1);
1469 break;
1470
1471 case SongPosition:
1472 sendSongPosition(mMessage.data1 | ((unsigned)mMessage.data2 << 7));
1473 break;
1474
1477 break;
1478
1479 default:
1480 break; // LCOV_EXCL_LINE - Unreacheable code, but prevents unhandled case warning.
1481 }
1482 }
1483}
bool mThruActivated
Definition MIDI.h:281
Thru::Mode mThruFilterMode
Definition MIDI.h:282
MidiMessage mMessage
Definition MIDI.h:283
The main class for MIDI handling. It is templated over the type of serial port to provide abstraction...
Definition MIDI.h:55
unsigned getSysExArrayLength() const
Get the length of the System Exclusive array.
Definition MIDI.hpp:1180
const byte * getSysExArray() const
Get the System Exclusive byte array.
Definition MIDI.hpp:1169
void sendTimeCodeQuarterFrame(DataByte inTypeNibble, DataByte inValuesNibble)
Send a MIDI Time Code Quarter Frame.
Definition MIDI.hpp:400
void send(const MidiMessage &)
Send a MIDI message.
Definition MIDI.hpp:118
void sendSongPosition(unsigned inBeats)
Send a Song Position Pointer message.
Definition MIDI.hpp:423
void sendSongSelect(DataByte inSongNumber)
Send a Song Select message.
Definition MIDI.hpp:430
void sendRealTime(MidiType inType)
Send a Real Time (one byte) message.
Definition MIDI.hpp:492
void sendSysEx(unsigned inLength, const byte *inArray, bool inArrayContainsBoundaries=false)
Generate and send a System Exclusive frame.
Definition MIDI.hpp:357

References ActiveSensing, Clock, Continue, Thru::DifferentChannel, Thru::Full, getSysExArray(), getSysExArrayLength(), MIDI_CHANNEL_OMNI, mMessage, mThruActivated, mThruFilterMode, NoteOff, Thru::Off, PitchBend, Thru::SameChannel, send(), sendRealTime(), sendSongPosition(), sendSongSelect(), sendSysEx(), sendTimeCodeQuarterFrame(), SongPosition, SongSelect, Start, Stop, SystemExclusive, SystemReset, TimeCodeQuarterFrame, and TuneRequest.

Referenced by read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: