Fixed order of DataEntry bytes (MSB first).
This commit is contained in:
parent
a7d6d803a1
commit
34b37f75e8
|
|
@ -471,8 +471,8 @@ inline void MidiInterface<SerialPort, Settings>::sendRpnValue(unsigned inValue,
|
|||
{;
|
||||
const byte valMsb = 0x7f & (inValue >> 7);
|
||||
const byte valLsb = 0x7f & inValue;
|
||||
sendControlChange(DataEntryLSB, valLsb, inChannel);
|
||||
sendControlChange(DataEntryMSB, valMsb, inChannel);
|
||||
sendControlChange(DataEntryLSB, valLsb, inChannel);
|
||||
}
|
||||
|
||||
/*! \brief Send separate MSB/LSB values for the currently selected RPN number.
|
||||
|
|
@ -485,8 +485,8 @@ inline void MidiInterface<SerialPort, Settings>::sendRpnValue(byte inMsb,
|
|||
byte inLsb,
|
||||
Channel inChannel)
|
||||
{
|
||||
sendControlChange(DataEntryLSB, inLsb, inChannel);
|
||||
sendControlChange(DataEntryMSB, inMsb, inChannel);
|
||||
sendControlChange(DataEntryLSB, inLsb, inChannel);
|
||||
}
|
||||
|
||||
/* \brief Increment the value of the currently selected RPN number by the specified amount.
|
||||
|
|
@ -551,8 +551,8 @@ inline void MidiInterface<SerialPort, Settings>::sendNrpnValue(unsigned inValue,
|
|||
{;
|
||||
const byte valMsb = 0x7f & (inValue >> 7);
|
||||
const byte valLsb = 0x7f & inValue;
|
||||
sendControlChange(DataEntryLSB, valLsb, inChannel);
|
||||
sendControlChange(DataEntryMSB, valMsb, inChannel);
|
||||
sendControlChange(DataEntryLSB, valLsb, inChannel);
|
||||
}
|
||||
|
||||
/*! \brief Send separate MSB/LSB values for the currently selected NRPN number.
|
||||
|
|
@ -565,8 +565,8 @@ inline void MidiInterface<SerialPort, Settings>::sendNrpnValue(byte inMsb,
|
|||
byte inLsb,
|
||||
Channel inChannel)
|
||||
{
|
||||
sendControlChange(DataEntryLSB, inLsb, inChannel);
|
||||
sendControlChange(DataEntryMSB, inMsb, inChannel);
|
||||
sendControlChange(DataEntryLSB, inLsb, inChannel);
|
||||
}
|
||||
|
||||
/* \brief Increment the value of the currently selected NRPN number by the specified amount.
|
||||
|
|
|
|||
|
|
@ -244,4 +244,53 @@ TEST(MidiOutput, sendRealTime)
|
|||
|
||||
}
|
||||
|
||||
TEST(MidiOutput, RPN)
|
||||
{
|
||||
SerialMock serial;
|
||||
MidiInterface midi(serial);
|
||||
std::vector<test_mocks::uint8> buffer;
|
||||
|
||||
// 14-bit Value Single Frame
|
||||
{
|
||||
buffer.clear();
|
||||
buffer.resize(13);
|
||||
|
||||
midi.begin();
|
||||
midi.beginRpn(1242, 12);
|
||||
midi.sendRpnValue(12345, 12);
|
||||
midi.endRpn(12);
|
||||
|
||||
EXPECT_EQ(serial.mTxBuffer.getLength(), 13);
|
||||
serial.mTxBuffer.read(&buffer[0], 13);
|
||||
EXPECT_THAT(buffer, ElementsAreArray({0xbb,
|
||||
0x64, 0x5a,
|
||||
0x65, 0x09,
|
||||
0x06, 0x60,
|
||||
0x26, 0x39,
|
||||
0x64, 0x7f,
|
||||
0x65, 0x7f}));
|
||||
}
|
||||
// MSB/LSB Single Frame
|
||||
{
|
||||
|
||||
}
|
||||
// Increment Single Frame
|
||||
{
|
||||
|
||||
}
|
||||
// Decrement Single Frame
|
||||
{
|
||||
|
||||
}
|
||||
// Multi Frame
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
TEST(MidiOutput, NRPN)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
END_UNNAMED_NAMESPACE
|
||||
|
|
|
|||
Loading…
Reference in New Issue