2 ==============================================================================
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
7 JUCE is an open source library subject to commercial or open-source
10 The code included in this file is provided under the terms of the ISC license
11 http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 To use, copy, modify, and/or distribute this software for any purpose with or
13 without fee is hereby granted provided that the above copyright notice and
14 this permission notice appear in all copies.
16 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
20 ==============================================================================
27 namespace universal_midi_packets
31 This struct acts as a single-file namespace for Universal MIDI Packet
32 functionality related to 7-bit SysEx.
38 /** Returns the number of 64-bit packets required to hold a series of
41 The number passed to this function should exclude the leading/trailing
42 SysEx bytes used in an old midi bytestream, as these are not required
43 when using Universal MIDI Packets.
45 static uint32_t getNumPacketsRequiredForDataSize (uint32_t);
47 /** The different kinds of UMP SysEx-7 message. */
48 enum class Kind
: uint8_t
50 /** The whole message fits in a single 2-word packet. */
53 /** The packet begins a SysEx message that will continue in subsequent packets. */
56 /** The packet is a continuation of an ongoing SysEx message. */
59 /** The packet terminates an ongoing SysEx message. */
63 /** Holds the bytes from a single SysEx-7 packet. */
66 std::array
<uint8_t, 6> data
;
70 /** Extracts the data bytes from a 64-bit data message. */
71 static PacketBytes
getDataBytes (const PacketX2
& packet
);