| 19 | } |
| 20 | |
| 21 | void CtrlrSysexProcessor::sysExProcessToken (const CtrlrSysexToken token, uint8 *byte, const int value, const int channel) |
| 22 | { |
| 23 | if (byte == NULL) |
| 24 | return; |
| 25 | |
| 26 | BigInteger bi; |
| 27 | |
| 28 | switch (token.getType()) |
| 29 | { |
| 30 | case ByteValue: |
| 31 | *byte = (uint8)value; |
| 32 | break; |
| 33 | |
| 34 | case ByteChannel: |
| 35 | *byte = (uint8)jlimit (0,15, channel-1); |
| 36 | break; |
| 37 | |
| 38 | case LSB7bitValue: |
| 39 | *byte = (uint8)(value & 127); |
| 40 | break; |
| 41 | |
| 42 | case MSB7bitValue: |
| 43 | *byte = (uint8)(value >> 7); |
| 44 | break; |
| 45 | |
| 46 | case ByteChannel4Bit: |
| 47 | bi = BigInteger ((uint8)jlimit (0,15, channel-1)); |
| 48 | bi.setBitRangeAsInt (4, 3, token.getAdditionalData()); |
| 49 | *byte = (uint8)bi.getBitRangeAsInt(0,7); |
| 50 | break; |
| 51 | |
| 52 | case GlobalVariable: |
| 53 | if (getGlobalVariables() [token.getAdditionalData()] >= 0) |
| 54 | *byte = (uint8)getGlobalVariables() [token.getAdditionalData()]; |
| 55 | break; |
| 56 | |
| 57 | case LSB4bitValue: |
| 58 | *byte = (uint8)(value & 0xf); |
| 59 | break; |
| 60 | |
| 61 | case MSB4bitValue: |
| 62 | *byte = (uint8)((value >> 4) & 0xf); |
| 63 | break; |
| 64 | |
| 65 | case RolandSplitByte1: |
| 66 | *byte = getRolandSplit (value, 1); |
| 67 | break; |
| 68 | |
| 69 | case RolandSplitByte2: |
| 70 | *byte = getRolandSplit (value, 2); |
| 71 | break; |
| 72 | |
| 73 | case RolandSplitByte3: |
| 74 | *byte = getRolandSplit (value, 3); |
| 75 | break; |
| 76 | |
| 77 | case RolandSplitByte4: |
| 78 | *byte = getRolandSplit (value, 4); |
nothing calls this directly
no test coverage detected