Class TrackGroup

  • All Implemented Interfaces:
    Parcelable

    public final class TrackGroup
    extends Object
    implements Parcelable
    Defines an immutable group of tracks identified by their format identity.
    • Constructor Detail

      • TrackGroup

        public TrackGroup​(Format... formats)
        Parameters:
        formats - The track formats. At least one Format must be provided.
    • Method Detail

      • getFormat

        public Format getFormat​(int index)
        Returns the format of the track at a given index.
        Parameters:
        index - The index of the track.
        Returns:
        The track's format.
      • indexOf

        public int indexOf​(Format format)
        Returns the index of the track with the given format in the group. The format is located by identity so, for example, group.indexOf(group.getFormat(index)) == index even if multiple tracks have formats that contain the same values.
        Parameters:
        format - The format.
        Returns:
        The index of the track, or C.INDEX_UNSET if no such track exists.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public boolean equals​(@Nullable
                              Object obj)
        Overrides:
        equals in class Object