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

Unified Diff: media/midi/midi_device_android.h

Issue 1177973003: [Web MIDI] Use Android MIDI API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: media/midi/midi_device_android.h
diff --git a/media/midi/midi_device_android.h b/media/midi/midi_device_android.h
new file mode 100644
index 0000000000000000000000000000000000000000..fefd70f20f7734be94a8ab858701e7a95de7383d
--- /dev/null
+++ b/media/midi/midi_device_android.h
@@ -0,0 +1,50 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_MIDI_MIDI_DEVICE_ANDROID_H_
+#define MEDIA_MIDI_MIDI_DEVICE_ANDROID_H_
+
+#include <jni.h>
+#include <string>
+
+#include "base/android/scoped_java_ref.h"
+#include "base/memory/scoped_vector.h"
+#include "media/midi/midi_input_port_android.h"
+
+namespace media {
+namespace midi {
+
+class MidiOutputPortAndroid;
+
+class MidiDeviceAndroid final {
+ public:
+ MidiDeviceAndroid(JNIEnv* env,
+ jobject raw_device,
+ MidiInputPortAndroid::Delegate* delegate);
+ ~MidiDeviceAndroid();
+
+ std::string GetManufacturer();
+ std::string GetProductName();
+ std::string GetDeviceVersion();
+
+ const ScopedVector<MidiInputPortAndroid>& input_ports() const {
+ return input_ports_;
+ }
+ const ScopedVector<MidiOutputPortAndroid>& output_ports() const {
+ return output_ports_;
+ }
+ jobject raw_device() const { return raw_device_.obj(); }
Takashi Toyoshima 2015/09/07 16:42:20 Maybe "IsEqualTo(const jobject raw_device) const"
yhirano 2015/09/10 11:43:50 Done.
+
+ static bool Register(JNIEnv* env);
+
+ private:
+ base::android::ScopedJavaGlobalRef<jobject> raw_device_;
+ ScopedVector<MidiInputPortAndroid> input_ports_;
+ ScopedVector<MidiOutputPortAndroid> output_ports_;
+};
+
+} // namespace midi
+} // namespace media
+
+#endif // MEDIA_MIDI_MIDI_DEVICE_ANDROID_H_

Powered by Google App Engine
This is Rietveld 408576698