public class MidiPortInfoWrapper extends Object implements Parcelable
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<MidiPortInfoWrapper> |
CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and Description |
---|---|
|
MidiPortInfoWrapper(MidiDeviceInfo.PortInfo portInfo,
MidiDeviceInfo parent)
Constructs a
MidiPortInfoWrapper to represent a MIDI port. |
protected |
MidiPortInfoWrapper(Parcel in)
Creates a new
MidiPortInfoWrapper from a Parcel . |
Modifier and Type | Method and Description |
---|---|
int |
describeContents()
Returns
0 . |
boolean |
equals(Object o)
Checks whether this
MidiPortInfoWrapper is equal to another Object . |
String |
getName()
Gets the name of this port.
|
MidiDeviceInfo |
getParent()
Gets the parent
MidiDeviceInfo of this port. |
String |
getParentName()
Gets the name of the parent
MidiDeviceInfo of this port. |
int |
getPortIndex()
Gets the index of this port in the array returned with the parent
MidiDeviceInfo 's
getPorts() method. |
int |
getPortNumber()
Gets the number of this port within either the input or output port lists of the parent
MidiDeviceInfo (i.e. |
int |
getType()
Gets the type of this port, either
MidiDeviceInfo.PortInfo.TYPE_INPUT
or MidiDeviceInfo.PortInfo.TYPE_OUTPUT depending on if this MIDI port
receives or sends MIDI messages. |
void |
writeToParcel(Parcel dest,
int flags)
Writes this
MidiPortInfoWrapper to a Parcel . |
public static final Parcelable.Creator<MidiPortInfoWrapper> CREATOR
public MidiPortInfoWrapper(MidiDeviceInfo.PortInfo portInfo, MidiDeviceInfo parent)
MidiPortInfoWrapper
to represent a MIDI port.portInfo
- the MidiDeviceInfo.PortInfo
to provideparent
- the MidiDeviceInfo
that contains portInfo
public int getType()
MidiDeviceInfo.PortInfo.TYPE_INPUT
or MidiDeviceInfo.PortInfo.TYPE_OUTPUT
depending on if this MIDI port
receives or sends MIDI messages.public int getPortNumber()
MidiDeviceInfo
(i.e. an input port and output port could both have a port number of 0).
Not suitable to be used as an index in getParent().{@link MidiDeviceInfo#getPorts() getPorts()}
,
see getPortIndex()
for that.public int getPortIndex()
MidiDeviceInfo
's
getPorts()
method.public String getName()
public MidiDeviceInfo getParent()
MidiDeviceInfo
of this port.public String getParentName()
MidiDeviceInfo
of this port.null if the parent is {@code null}
public void writeToParcel(Parcel dest, int flags)
MidiPortInfoWrapper
to a Parcel
.writeToParcel
in interface Parcelable
dest
- the parcel to write toflags
- the flags used for writingParcelable.writeToParcel(Parcel, int)
public int describeContents()
0
.describeContents
in interface Parcelable
0
Parcelable.describeContents()