Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1490)

Side by Side Diff: media/midi/midi_message_util.cc

Issue 151343002: Web MIDI: make naming convention be consistent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review boliu #2 Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/midi/midi_message_util.h ('k') | media/midi/midi_message_util_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/midi/midi_message_util.h" 5 #include "media/midi/midi_message_util.h"
6 6
7 namespace media { 7 namespace media {
8 8
9 size_t GetMIDIMessageLength(uint8 status_byte) { 9 size_t GetMidiMessageLength(uint8 status_byte) {
10 if (status_byte < 0x80) 10 if (status_byte < 0x80)
11 return 0; 11 return 0;
12 if (0x80 <= status_byte && status_byte <= 0xbf) 12 if (0x80 <= status_byte && status_byte <= 0xbf)
13 return 3; 13 return 3;
14 if (0xc0 <= status_byte && status_byte <= 0xdf) 14 if (0xc0 <= status_byte && status_byte <= 0xdf)
15 return 2; 15 return 2;
16 if (0xe0 <= status_byte && status_byte <= 0xef) 16 if (0xe0 <= status_byte && status_byte <= 0xef)
17 return 3; 17 return 3;
18 if (status_byte == 0xf0) 18 if (status_byte == 0xf0)
19 return 0; 19 return 0;
20 if (status_byte == 0xf1) 20 if (status_byte == 0xf1)
21 return 2; 21 return 2;
22 if (status_byte == 0xf2) 22 if (status_byte == 0xf2)
23 return 3; 23 return 3;
24 if (status_byte == 0xf3) 24 if (status_byte == 0xf3)
25 return 2; 25 return 2;
26 if (0xf4 <= status_byte && status_byte <= 0xf6) 26 if (0xf4 <= status_byte && status_byte <= 0xf6)
27 return 1; 27 return 1;
28 if (status_byte == 0xf7) 28 if (status_byte == 0xf7)
29 return 0; 29 return 0;
30 // 0xf8 <= status_byte && status_byte <= 0xff 30 // 0xf8 <= status_byte && status_byte <= 0xff
31 return 1; 31 return 1;
32 } 32 }
33 33
34 } // namespace media 34 } // namespace media
OLDNEW
« no previous file with comments | « media/midi/midi_message_util.h ('k') | media/midi/midi_message_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698