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

Side by Side Diff: media/midi/midi_input_port_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, 3 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_device_android.cc ('k') | media/midi/midi_input_port_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_MIDI_MIDI_INPUT_PORT_ANDROID_H_
6 #define MEDIA_MIDI_MIDI_INPUT_PORT_ANDROID_H_
7
8 #include <jni.h>
9
10 #include "base/android/scoped_java_ref.h"
11 #include "base/time/time.h"
12
13 namespace media {
14 namespace midi {
15
16 class MidiInputPortAndroid final {
17 public:
18 class Delegate {
19 public:
20 virtual ~Delegate() {}
21 virtual void OnReceivedData(MidiInputPortAndroid* port,
22 const uint8* data,
23 size_t size,
24 base::TimeTicks time) = 0;
25 };
26 MidiInputPortAndroid(JNIEnv* env, jobject raw, Delegate* delegate);
27 ~MidiInputPortAndroid();
28
29 // Returns true when the operation succeeds.
30 bool Open();
31 void Close();
32
33 // Called by the Java world.
34 void OnData(JNIEnv* env,
35 jobject caller,
36 jbyteArray data,
37 jint offset,
38 jint size,
39 jlong timestamp);
40
41 static bool Register(JNIEnv* env);
42
43 private:
44 base::android::ScopedJavaGlobalRef<jobject> raw_port_;
45 Delegate* const delegate_;
46 };
47
48 } // namespace midi
49 } // namespace media
50
51 #endif // MEDIA_MIDI_MIDI_INPUT_PORT_ANDROID_H_
OLDNEW
« no previous file with comments | « media/midi/midi_device_android.cc ('k') | media/midi/midi_input_port_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698