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

Unified Diff: media/midi/midi_manager_usb.cc

Issue 516893002: [MIDI] Make android MIDI port id unique (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/midi/midi_manager_usb.cc
diff --git a/media/midi/midi_manager_usb.cc b/media/midi/midi_manager_usb.cc
index f2cf866aa0c68b36a8807b071817335369d33d65..8385d9fd79e1a55b6d5ddd5a4468b6f09ddc8ad7 100644
--- a/media/midi/midi_manager_usb.cc
+++ b/media/midi/midi_manager_usb.cc
@@ -8,6 +8,7 @@
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
+#include "base/strings/stringprintf.h"
#include "media/midi/usb_midi_descriptor_parser.h"
#include "media/midi/usb_midi_device.h"
#include "media/midi/usb_midi_input_stream.h"
@@ -94,12 +95,16 @@ void MidiManagerUsb::OnEnumerateDevicesDone(bool result,
if (jacks[j].direction() == UsbMidiJack::DIRECTION_OUT) {
output_streams_.push_back(new UsbMidiOutputStream(jacks[j]));
// TODO(yhirano): Set appropriate properties.
- AddOutputPort(MidiPortInfo());
+ MidiPortInfo port;
+ port.id = base::StringPrintf("port-%zu-%zu", i, j);
Takashi Toyoshima 2014/08/28 11:52:11 I might be wrong, but the i and j mean the USB por
yhirano 2014/08/28 13:09:14 They are just indices and are not meaningful. I wi
+ AddOutputPort(port);
} else {
DCHECK_EQ(jacks[j].direction(), UsbMidiJack::DIRECTION_IN);
input_jacks.push_back(jacks[j]);
// TODO(yhirano): Set appropriate properties.
- AddInputPort(MidiPortInfo());
+ MidiPortInfo port;
+ port.id = base::StringPrintf("port-%zu-%zu", i, j);
+ AddInputPort(port);
}
}
input_stream_.reset(new UsbMidiInputStream(input_jacks, this));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698