All instances of addresses as void* are changed to uintptr_t in
[chromium-blink-merge.git] / media / midi / midi_message_util.cc
blobe8e953d19471b7b1397beeef0604a16bc885d427
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "media/midi/midi_message_util.h"
7 namespace media {
8 namespace midi {
10 size_t GetMidiMessageLength(uint8 status_byte) {
11 if (status_byte < 0x80)
12 return 0;
13 if (0x80 <= status_byte && status_byte <= 0xbf)
14 return 3;
15 if (0xc0 <= status_byte && status_byte <= 0xdf)
16 return 2;
17 if (0xe0 <= status_byte && status_byte <= 0xef)
18 return 3;
19 if (status_byte == 0xf0)
20 return 0;
21 if (status_byte == 0xf1)
22 return 2;
23 if (status_byte == 0xf2)
24 return 3;
25 if (status_byte == 0xf3)
26 return 2;
27 if (0xf4 <= status_byte && status_byte <= 0xf6)
28 return 1;
29 if (status_byte == 0xf7)
30 return 0;
31 // 0xf8 <= status_byte && status_byte <= 0xff
32 return 1;
35 } // namespace midi
36 } // namespace media