Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.media.midi; | 5 package org.chromium.midi; |
| 6 | 6 |
| 7 import android.annotation.TargetApi; | 7 import android.annotation.TargetApi; |
| 8 import android.media.midi.MidiDevice; | 8 import android.media.midi.MidiDevice; |
| 9 import android.media.midi.MidiInputPort; | 9 import android.media.midi.MidiInputPort; |
| 10 import android.os.Build; | 10 import android.os.Build; |
| 11 | 11 |
| 12 import org.chromium.base.Log; | 12 import org.chromium.base.Log; |
| 13 import org.chromium.base.annotations.CalledByNative; | 13 import org.chromium.base.annotations.CalledByNative; |
| 14 import org.chromium.base.annotations.JNINamespace; | 14 import org.chromium.base.annotations.JNINamespace; |
| 15 | 15 |
| 16 import java.io.IOException; | 16 import java.io.IOException; |
| 17 | 17 |
| 18 /** | 18 /** |
| 19 * A class implementing media::midi::MidiOutputPortAndroid functionality. | 19 * A class implementing midi::MidiOutputPortAndroid functionality. |
| 20 */ | 20 */ |
| 21 // Note "OutputPort" is named in the Web MIDI manner. It corresponds to MidiInpu tPort class in the | 21 // Note "OutputPort" is named in the Web MIDI manner. It corresponds to MidiInpu tPort class in the |
| 22 // Android API. | 22 // Android API. |
| 23 @JNINamespace("media::midi") | 23 @JNINamespace("midi") |
| 24 @TargetApi(Build.VERSION_CODES.M) | 24 @TargetApi(Build.VERSION_CODES.M) |
| 25 class MidiOutputPortAndroid { | 25 class MidiOutputPortAndroid { |
| 26 /** | 26 /** |
| 27 * The underlying port. | 27 * The underlying port. |
| 28 */ | 28 */ |
| 29 private MidiInputPort mPort; | 29 private MidiInputPort mPort; |
| 30 /** | 30 /** |
| 31 * The device this port belongs to. | 31 * The device this port belongs to. |
| 32 */ | 32 */ |
| 33 private final MidiDevice mDevice; | 33 private final MidiDevice mDevice; |
| 34 /** | 34 /** |
| 35 * The index of the port in the associated device. | 35 * The index of the port in the associated device. |
| 36 */ | 36 */ |
| 37 private final int mIndex; | 37 private final int mIndex; |
| 38 | 38 |
| 39 private static final String TAG = "media_midi"; | 39 private static final String TAG = "media_midi"; |
|
yhirano
2016/10/12 11:26:08
Should this be fixed?
Takashi Toyoshima
2016/10/13 05:28:40
Good eyes, thanks!
| |
| 40 | 40 |
| 41 /** | 41 /** |
| 42 * constructor | 42 * constructor |
| 43 * @param device The device this port belongs to. | 43 * @param device The device this port belongs to. |
| 44 * @param index The index of the port in the associated device. | 44 * @param index The index of the port in the associated device. |
| 45 */ | 45 */ |
| 46 MidiOutputPortAndroid(MidiDevice device, int index) { | 46 MidiOutputPortAndroid(MidiDevice device, int index) { |
| 47 mDevice = device; | 47 mDevice = device; |
| 48 mIndex = index; | 48 mIndex = index; |
| 49 } | 49 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 86 return; | 86 return; |
| 87 } | 87 } |
| 88 try { | 88 try { |
| 89 mPort.close(); | 89 mPort.close(); |
| 90 } catch (IOException e) { | 90 } catch (IOException e) { |
| 91 // We can do nothing here. Just ignore the error. | 91 // We can do nothing here. Just ignore the error. |
| 92 } | 92 } |
| 93 mPort = null; | 93 mPort = null; |
| 94 } | 94 } |
| 95 } | 95 } |
| OLD | NEW |