Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
2.3KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2022 - Raw Material Software Limited
  5. JUCE is an open source library subject to commercial or open-source
  6. licensing.
  7. The code included in this file is provided under the terms of the ISC license
  8. http://www.isc.org/downloads/software-support-policy/isc-license. Permission
  9. To use, copy, modify, and/or distribute this software for any purpose with or
  10. without fee is hereby granted provided that the above copyright notice and
  11. this permission notice appear in all copies.
  12. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  13. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  14. DISCLAIMED.
  15. ==============================================================================
  16. */
  17. #ifndef DOXYGEN
  18. namespace juce
  19. {
  20. namespace universal_midi_packets
  21. {
  22. /**
  23. This struct acts as a single-file namespace for Universal MIDI Packet
  24. functionality related to 7-bit SysEx.
  25. @tags{Audio}
  26. */
  27. struct SysEx7
  28. {
  29. /** Returns the number of 64-bit packets required to hold a series of
  30. SysEx bytes.
  31. The number passed to this function should exclude the leading/trailing
  32. SysEx bytes used in an old midi bytestream, as these are not required
  33. when using Universal MIDI Packets.
  34. */
  35. static uint32_t getNumPacketsRequiredForDataSize (uint32_t);
  36. /** The different kinds of UMP SysEx-7 message. */
  37. enum class Kind : uint8_t
  38. {
  39. /** The whole message fits in a single 2-word packet. */
  40. complete = 0,
  41. /** The packet begins a SysEx message that will continue in subsequent packets. */
  42. begin = 1,
  43. /** The packet is a continuation of an ongoing SysEx message. */
  44. continuation = 2,
  45. /** The packet terminates an ongoing SysEx message. */
  46. end = 3
  47. };
  48. /** Holds the bytes from a single SysEx-7 packet. */
  49. struct PacketBytes
  50. {
  51. std::array<uint8_t, 6> data;
  52. uint8_t size;
  53. };
  54. /** Extracts the data bytes from a 64-bit data message. */
  55. static PacketBytes getDataBytes (const PacketX2& packet);
  56. };
  57. }
  58. }
  59. #endif