25namespace juce::universal_midi_packets
36 static constexpr uint32_t
bytesToWord (std::byte a, std::byte b, std::byte c, std::byte d)
38 return uint32_t (a) << 0x18
39 | uint32_t (b) << 0x10
40 | uint32_t (c) << 0x08
41 | uint32_t (d) << 0x00;
55 template <
size_t Index>
58 static constexpr uint32_t shift = (uint32_t) 0x1c - Index * 4;
60 static constexpr uint32_t set (uint32_t word, uint8_t value)
62 return (word & ~((uint32_t) 0xf << shift)) | (uint32_t) ((value & 0xf) << shift);
65 static constexpr uint8_t get (uint32_t word)
67 return (uint8_t) ((word >> shift) & 0xf);
74 template <
size_t Index>
77 static constexpr uint32_t shift = (uint32_t) 0x18 - Index * 8;
79 static constexpr uint32_t set (uint32_t word, uint8_t value)
81 return (word & ~((uint32_t) 0xff << shift)) | (uint32_t) (value << shift);
84 static constexpr uint8_t get (uint32_t word)
86 return (uint8_t) ((word >> shift) & 0xff);
93 template <
size_t Index>
96 static constexpr uint32_t shift = (uint32_t) 0x10 - Index * 16;
98 static constexpr uint32_t set (uint32_t word, uint16_t value)
100 return (word & ~((uint32_t) 0xffff << shift)) | (uint32_t) (value << shift);
103 static constexpr uint16_t get (uint32_t word)
105 return (uint16_t) ((word >> shift) & 0xffff);
109 static constexpr uint8_t getMessageType (uint32_t w)
noexcept {
return U4<0>::get (w); }
110 static constexpr uint8_t getGroup (uint32_t w)
noexcept {
return U4<1>::get (w); }
111 static constexpr uint8_t getStatus (uint32_t w)
noexcept {
return U4<2>::get (w); }
112 static constexpr uint8_t getChannel (uint32_t w)
noexcept {
return U4<3>::get (w); }
static constexpr uint32_t bytesToWord(std::byte a, std::byte b, std::byte c, std::byte d)
static uint32_t getNumWordsForMessageType(uint32_t)