OpenShot Audio Library | OpenShotAudio  0.6.0
juce_UMPUtils.cpp
1 /*
2  ==============================================================================
3 
4  This file is part of the JUCE library.
5  Copyright (c) 2022 - Raw Material Software Limited
6 
7  JUCE is an open source library subject to commercial or open-source
8  licensing.
9 
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.
15 
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.
19 
20  ==============================================================================
21 */
22 
23 namespace juce::universal_midi_packets
24 {
25 
26 uint32_t Utils::getNumWordsForMessageType (uint32_t mt)
27 {
28  switch (Utils::getMessageType (mt))
29  {
30  case 0x0:
31  case 0x1:
32  case 0x2:
33  case 0x6:
34  case 0x7:
35  return 1;
36  case 0x3:
37  case 0x4:
38  case 0x8:
39  case 0x9:
40  case 0xa:
41  return 2;
42  case 0xb:
43  case 0xc:
44  return 3;
45  case 0x5:
46  case 0xd:
47  case 0xe:
48  case 0xf:
49  return 4;
50  }
51 
52  jassertfalse;
53  return 1;
54 }
55 
56 } // namespace juce::universal_midi_packets
static uint32_t getNumWordsForMessageType(uint32_t)