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

Unified Diff: media/midi/usb_midi_input_stream.h

Issue 107163008: [WebMIDI] Introduce MidiManagerUsb (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@usb-midi-stream
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/midi/usb_midi_device.h ('k') | media/midi/usb_midi_input_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/midi/usb_midi_input_stream.h
diff --git a/media/midi/usb_midi_input_stream.h b/media/midi/usb_midi_input_stream.h
index 70ed306699a8e16dd4ab4cb55ae2b070d4317685..2207c5d81510f9c40d4fa834e53bc17a95ef82f7 100644
--- a/media/midi/usb_midi_input_stream.h
+++ b/media/midi/usb_midi_input_stream.h
@@ -22,7 +22,7 @@ class UsbMidiDevice;
// Section 4 "USB-MIDI Event Packets" for details.
class MEDIA_EXPORT UsbMidiInputStream {
public:
- class Delegate {
+ class MEDIA_EXPORT Delegate {
public:
virtual ~Delegate() {}
// This function is called when some data arrives to a USB-MIDI jack.
@@ -33,6 +33,17 @@ class MEDIA_EXPORT UsbMidiInputStream {
double timestamp) = 0;
};
+ // This is public for testing.
+ struct JackUniqueKey {
+ JackUniqueKey(UsbMidiDevice* device, int endpoint_number, int cable_number);
+ bool operator==(const JackUniqueKey& that) const;
+ bool operator<(const JackUniqueKey& that) const;
+
+ UsbMidiDevice* device;
+ int endpoint_number;
+ int cable_number;
+ };
+
UsbMidiInputStream(const std::vector<UsbMidiJack>& jacks,
Delegate* delegate);
~UsbMidiInputStream();
@@ -47,18 +58,10 @@ class MEDIA_EXPORT UsbMidiInputStream {
size_t size,
double timestamp);
+ std::vector<JackUniqueKey> RegisteredJackKeysForTesting() const;
+
private:
static const size_t kPacketSize = 4;
- struct JackUniqueKey {
- JackUniqueKey(UsbMidiDevice* device, int endpoint_number, int cable_number);
- bool operator==(const JackUniqueKey& that) const;
- bool operator<(const JackUniqueKey& that) const;
-
- UsbMidiDevice* device;
- int endpoint_number;
- int cable_number;
- };
-
// Processes a USB-MIDI Event Packet.
// The first |kPacketSize| bytes of |packet| must be accessible.
void ProcessOnePacket(UsbMidiDevice* device,
« no previous file with comments | « media/midi/usb_midi_device.h ('k') | media/midi/usb_midi_input_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698