blob: fce85963d21790387543b08672509ea5ce417e43 [file] [log] [blame]
Paul McLean71f672b2017-03-05 08:12:18 -07001/*
Paul McLean8a3e33b2017-03-14 15:20:51 -07002 * Copyright (C) 2018 The Android Open Source Project
Paul McLean71f672b2017-03-05 08:12:18 -07003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Paul McLeanf79b8d12019-02-06 13:27:43 -070017#ifndef ANDROID_MEDIA_AMIDI_INTERNAL_H_
18#define ANDROID_MEDIA_AMIDI_INTERNAL_H_
Paul McLean71f672b2017-03-05 08:12:18 -070019
Paul McLean8a3e33b2017-03-14 15:20:51 -070020#include <jni.h>
21
Paul McLean71f672b2017-03-05 08:12:18 -070022#include "android/media/midi/BpMidiDeviceServer.h"
23
Paul McLean8a3e33b2017-03-14 15:20:51 -070024typedef struct {
25 int32_t type; /* one of AMIDI_DEVICE_TYPE_* constants */
26 int32_t inputPortCount; /* number of input (send) ports associated with the device */
27 int32_t outputPortCount; /* number of output (received) ports associated with the device */
28} AMidiDeviceInfo;
29
30struct AMidiDevice {
31 android::sp<android::media::midi::BpMidiDeviceServer>
32 server; /* The Binder interface to the MIDI server (from the Java MidiDevice) */
33 int32_t deviceId; /* The integer id of the device assigned in the Java API */
34 JavaVM* javaVM; /* The Java VM (so we can obtain the JNIEnv in the
35 AMidiDevice_close function) */
36 jobject midiDeviceObj; /* NewGlobalRef() reference to the Java MidiDevice associated with
37 this native AMidiDevice. */
38 AMidiDeviceInfo deviceInfo; /* Attributes of the device. */
Paul McLean71f672b2017-03-05 08:12:18 -070039};
40
Paul McLeanf79b8d12019-02-06 13:27:43 -070041#endif // ANDROID_MEDIA_AMIDI_INTERNAL_H_