VST3: fetch midi mappings all at once, use it for note/sound-off
[carla.git] / source / modules / juce_audio_basics / midi / ump / juce_UMPSysEx7.h
blob0d6e80013654c9e6beb789af69c9220d43e94a03
1 /*
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
8 licensing.
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
18 DISCLAIMED.
20 ==============================================================================
23 #ifndef DOXYGEN
25 namespace juce
27 namespace universal_midi_packets
30 /**
31 This struct acts as a single-file namespace for Universal MIDI Packet
32 functionality related to 7-bit SysEx.
34 @tags{Audio}
36 struct SysEx7
38 /** Returns the number of 64-bit packets required to hold a series of
39 SysEx bytes.
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. */
51 complete = 0,
53 /** The packet begins a SysEx message that will continue in subsequent packets. */
54 begin = 1,
56 /** The packet is a continuation of an ongoing SysEx message. */
57 continuation = 2,
59 /** The packet terminates an ongoing SysEx message. */
60 end = 3
63 /** Holds the bytes from a single SysEx-7 packet. */
64 struct PacketBytes
66 std::array<uint8_t, 6> data;
67 uint8_t size;
70 /** Extracts the data bytes from a 64-bit data message. */
71 static PacketBytes getDataBytes (const PacketX2& packet);
77 #endif