org.jaudiotagger.tag.mp4.field
Class Mp4TrackField

java.lang.Object
  extended by org.jaudiotagger.tag.mp4.Mp4TagField
      extended by org.jaudiotagger.tag.mp4.field.Mp4TagTextField
          extended by org.jaudiotagger.tag.mp4.field.Mp4TagTextNumberField
              extended by org.jaudiotagger.tag.mp4.field.Mp4TrackField
All Implemented Interfaces:
TagField, TagTextField

public class Mp4TrackField
extends Mp4TagTextNumberField

Represents the Track No field

There are a number of reseved fields makeing matters more complicated Reserved:2 bytes Track Number:2 bytes No of Tracks:2 bytes (or zero if not known) PlayListTitleReserved: 1 byte playtitlenameReserved:0 bytes


Field Summary
private static int NONE_END_VALUE_INDEX
           
private static int NONE_VALUE_INDEX
           
private static int TRACK_NO_INDEX
           
private static int TRACK_TOTAL_INDEX
           
 
Fields inherited from class org.jaudiotagger.tag.mp4.field.Mp4TagTextNumberField
NUMBER_LENGTH, numbers
 
Fields inherited from class org.jaudiotagger.tag.mp4.field.Mp4TagTextField
content, dataSize
 
Fields inherited from class org.jaudiotagger.tag.mp4.Mp4TagField
id, logger, parentHeader
 
Constructor Summary
Mp4TrackField(int trackNo)
          Create new Track Field with only track No
Mp4TrackField(int trackNo, int total)
          Create new Track Field with track No and total tracks
Mp4TrackField(java.lang.String trackValue)
          Create new Track Field parsing the String for the trackno/total
Mp4TrackField(java.lang.String id, java.nio.ByteBuffer data)
          Construct from filedata
 
Method Summary
protected  void build(java.nio.ByteBuffer data)
          Processes the data and sets the position of the data buffer to just after the end of this fields data ready for processing next field.
 java.lang.Short getTrackNo()
           
 java.lang.Short getTrackTotal()
           
 void setTrackNo(int trackNo)
          Set Track No
 void setTrackTotal(int trackTotal)
          Set total number of tracks
 
Methods inherited from class org.jaudiotagger.tag.mp4.field.Mp4TagTextNumberField
copyContent, getDataBytes, getFieldType, getNumbers
 
Methods inherited from class org.jaudiotagger.tag.mp4.field.Mp4TagTextField
getContent, getEncoding, isBinary, isEmpty, setContent, setEncoding, toString
 
Methods inherited from class org.jaudiotagger.tag.mp4.Mp4TagField
getId, getIdBytes, getRawContent, getRawContentDataOnly, isBinary, isCommon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jaudiotagger.tag.TagField
getId, getRawContent, isBinary, isCommon
 

Field Detail

NONE_VALUE_INDEX

private static final int NONE_VALUE_INDEX
See Also:
Constant Field Values

TRACK_NO_INDEX

private static final int TRACK_NO_INDEX
See Also:
Constant Field Values

TRACK_TOTAL_INDEX

private static final int TRACK_TOTAL_INDEX
See Also:
Constant Field Values

NONE_END_VALUE_INDEX

private static final int NONE_END_VALUE_INDEX
See Also:
Constant Field Values
Constructor Detail

Mp4TrackField

public Mp4TrackField(java.lang.String trackValue)
              throws FieldDataInvalidException
Create new Track Field parsing the String for the trackno/total

Parameters:
trackValue -
Throws:
FieldDataInvalidException

Mp4TrackField

public Mp4TrackField(int trackNo)
Create new Track Field with only track No

Parameters:
trackNo -

Mp4TrackField

public Mp4TrackField(int trackNo,
                     int total)
Create new Track Field with track No and total tracks

Parameters:
trackNo -
total -

Mp4TrackField

public Mp4TrackField(java.lang.String id,
                     java.nio.ByteBuffer data)
              throws java.io.UnsupportedEncodingException
Construct from filedata

Parameters:
id -
data -
Throws:
java.io.UnsupportedEncodingException
Method Detail

build

protected void build(java.nio.ByteBuffer data)
              throws java.io.UnsupportedEncodingException
Description copied from class: Mp4TagField
Processes the data and sets the position of the data buffer to just after the end of this fields data ready for processing next field.

Overrides:
build in class Mp4TagTextNumberField
Throws:
java.io.UnsupportedEncodingException

getTrackNo

public java.lang.Short getTrackNo()
Returns:

getTrackTotal

public java.lang.Short getTrackTotal()
Returns:

setTrackNo

public void setTrackNo(int trackNo)
Set Track No

Parameters:
trackNo -

setTrackTotal

public void setTrackTotal(int trackTotal)
Set total number of tracks

Parameters:
trackTotal -