Paul McLean | 71f672b | 2017-03-05 08:12:18 -0700 | [diff] [blame] | 1 | /* |
Paul McLean | 8a3e33b | 2017-03-14 15:20:51 -0700 | [diff] [blame] | 2 | * Copyright (C) 2018 The Android Open Source Project |
Paul McLean | 71f672b | 2017-03-05 08:12:18 -0700 | [diff] [blame] | 3 | * |
| 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 McLean | f79b8d1 | 2019-02-06 13:27:43 -0700 | [diff] [blame] | 17 | #ifndef ANDROID_MEDIA_AMIDI_INTERNAL_H_ |
| 18 | #define ANDROID_MEDIA_AMIDI_INTERNAL_H_ |
Paul McLean | 71f672b | 2017-03-05 08:12:18 -0700 | [diff] [blame] | 19 | |
Paul McLean | 8a3e33b | 2017-03-14 15:20:51 -0700 | [diff] [blame] | 20 | #include <jni.h> |
| 21 | |
Paul McLean | 71f672b | 2017-03-05 08:12:18 -0700 | [diff] [blame] | 22 | #include "android/media/midi/BpMidiDeviceServer.h" |
| 23 | |
Paul McLean | 8a3e33b | 2017-03-14 15:20:51 -0700 | [diff] [blame] | 24 | typedef 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 */ |
Robert Wu | a936a25 | 2021-12-22 19:47:20 +0000 | [diff] [blame] | 28 | int32_t defaultProtocol; /* one of the AMIDI_DEVICE_PROTOCOL_* constants */ |
Paul McLean | 8a3e33b | 2017-03-14 15:20:51 -0700 | [diff] [blame] | 29 | } AMidiDeviceInfo; |
| 30 | |
| 31 | struct AMidiDevice { |
| 32 | android::sp<android::media::midi::BpMidiDeviceServer> |
| 33 | server; /* The Binder interface to the MIDI server (from the Java MidiDevice) */ |
| 34 | int32_t deviceId; /* The integer id of the device assigned in the Java API */ |
| 35 | JavaVM* javaVM; /* The Java VM (so we can obtain the JNIEnv in the |
| 36 | AMidiDevice_close function) */ |
| 37 | jobject midiDeviceObj; /* NewGlobalRef() reference to the Java MidiDevice associated with |
| 38 | this native AMidiDevice. */ |
| 39 | AMidiDeviceInfo deviceInfo; /* Attributes of the device. */ |
Paul McLean | 71f672b | 2017-03-05 08:12:18 -0700 | [diff] [blame] | 40 | }; |
| 41 | |
Paul McLean | f79b8d1 | 2019-02-06 13:27:43 -0700 | [diff] [blame] | 42 | #endif // ANDROID_MEDIA_AMIDI_INTERNAL_H_ |