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

Side by Side Diff: media/midi/midi_message_queue.h

Issue 1086073004: Web MIDI: namespace change from media to media::midi (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@null
Patch Set: (rebase) Created 5 years, 7 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
« no previous file with comments | « media/midi/midi_manager_win.cc ('k') | media/midi/midi_message_queue.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 #ifndef MEDIA_MIDI_MIDI_MESSAGE_QUEUE_H_ 5 #ifndef MEDIA_MIDI_MIDI_MESSAGE_QUEUE_H_
6 #define MEDIA_MIDI_MIDI_MESSAGE_QUEUE_H_ 6 #define MEDIA_MIDI_MIDI_MESSAGE_QUEUE_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "media/midi/midi_export.h" 12 #include "media/midi/midi_export.h"
13 13
14 namespace media { 14 namespace media {
15 namespace midi {
15 16
16 // A simple message splitter for possibly unsafe/corrupted MIDI data stream. 17 // A simple message splitter for possibly unsafe/corrupted MIDI data stream.
17 // This class allows you to: 18 // This class allows you to:
18 // - maintain fragmented MIDI message. 19 // - maintain fragmented MIDI message.
19 // - skip any invalid data sequence. 20 // - skip any invalid data sequence.
20 // - reorder MIDI messages so that "System Real Time Message", which can be 21 // - reorder MIDI messages so that "System Real Time Message", which can be
21 // inserted at any point of the byte stream, is placed at the boundary of 22 // inserted at any point of the byte stream, is placed at the boundary of
22 // complete MIDI messages. 23 // complete MIDI messages.
23 // - (Optional) reconstruct complete MIDI messages from data stream where 24 // - (Optional) reconstruct complete MIDI messages from data stream where
24 // MIDI status byte is abbreviated (a.k.a. "running status"). 25 // MIDI status byte is abbreviated (a.k.a. "running status").
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 // |message| is empty if there is no complete MIDI message any more. 61 // |message| is empty if there is no complete MIDI message any more.
61 void Get(std::vector<uint8>* message); 62 void Get(std::vector<uint8>* message);
62 63
63 private: 64 private:
64 std::deque<uint8> queue_; 65 std::deque<uint8> queue_;
65 std::vector<uint8> next_message_; 66 std::vector<uint8> next_message_;
66 const bool allow_running_status_; 67 const bool allow_running_status_;
67 DISALLOW_COPY_AND_ASSIGN(MidiMessageQueue); 68 DISALLOW_COPY_AND_ASSIGN(MidiMessageQueue);
68 }; 69 };
69 70
71 } // namespace midi
70 } // namespace media 72 } // namespace media
71 73
72 #endif // MEDIA_MIDI_MIDI_MESSAGE_QUEUE_H_ 74 #endif // MEDIA_MIDI_MIDI_MESSAGE_QUEUE_H_
OLDNEW
« no previous file with comments | « media/midi/midi_manager_win.cc ('k') | media/midi/midi_message_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698