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

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, 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 unified diff | Download patch
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 // Called by the Java world.
30 void OnData(JNIEnv* env,
31 jobject caller,
32 jbyteArray data,
33 jint offset,
34 jint size,
35 jlong timestamp);
36
37 static bool Register(JNIEnv* env);
38
39 private:
40 Delegate* const delegate_;
41 };
42
43 } // namespace midi
44 } // namespace media
45
46 #endif // MEDIA_MIDI_MIDI_INPUT_PORT_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698