com.beaglebuddy.id3.v23.frame_body

## Class ID3v23FrameBodyTextInformation

- java.lang.Object
- - com.beaglebuddy.util.Utility
  - - com.beaglebuddy.id3.v23.frame_body.ID3v23FrameBodyUtility
    - - com.beaglebuddy.id3.v23.frame_body.ID3v23FrameBody
      - - com.beaglebuddy.id3.v23.frame_body.ID3v23FrameBodyTextInformation

-     public class ID3v23FrameBodyTextInformation
      extends ID3v23FrameBody

  A text information frame body is associated with the ID3v2.3 `frames` listed below, and are the most important frames, containing information like artist, album, song title, and more. The text information frame body contains the following fields:

  Text Information Frame Body Fields
  | Field | Description
  --- | --- | ---
  1. | `encoding` | character set used to `encode` the text field.
  2. | text | a string whose value depends on the type of text frame. see the list below.

  Text Information Frames
  Frame Id | Description
  --- | ---
  TALB | The 'Album/Movie/Show title' frame is intended for the title of the recording(/source of sound) which the audio in the file is taken from.
  TBPM | The 'BPM' frame contains the number of beats per minute in the main part of the audio. The BPM is an integer and represented as a numerical string.
  TCOM | The 'Composer(s)' frame is intended for the name of the composer(s). They are separated with the "/" character.
  TCON | The 'Content type', which previously was stored as a one byte numeric value, is now a numeric string. You may use one or several of the types as ID3v1.1 did or, since the category list would be impossible to maintain with accurate and up to date categories, define your own. References to the ID3v1 genres can be made by enclosing a number from the `genres list` with parentheses. This is optionally followed by a refinement, e.g. "(21)" or "(4)Eurodisco". Several references can be made in the same frame, e.g. "(51)(39)". If the refinement should begin with a parenthesis, "(", it should be replaced with "((", e.g. "((I can figure out any genre)" or "(55)((I think...)".
  TCOP | The 'Copyright message' frame, which must begin with a year and a space character (making five characters), is intended for the copyright holder of the original sound, not the audio file itself. The absence of this frame means only that the copyright information is unavailable or has been removed, and must not be interpreted to mean that the sound is public domain. Every time this field is displayed the field must be preceded with "Copyright © ".
  TDAT | The 'Date' frame is a numeric string in the DDMM format containing the date for the recording. This field is always four characters long.
  TDLY | The 'Playlist delay' defines the numbers of milliseconds of silence between every song in a playlist. The player should use the "ETC" frame, if present, to skip initial silence and silence at the end of the audio to match the 'Playlist delay' time. The time is represented as a numeric string.
  TENC | The 'Encoded by' frame contains the name of the person or organization that encoded the audio file. This field may contain a copyright message, if the audio file also is copyrighted by the encoder.
  TEXT | The 'Lyricist(s)/Text writer(s)' frame is intended for the writer(s) of the text or lyrics in the recording. They are separated with the "/" character.
  TFLT | The 'File type' frame indicates which type of audio this tag defines. The following type and refinements are defined:
  Type | Refinement
  --- | ---
  MPG | MPEG Audio
  /1 | MPEG 1/2 layer I
  /2 | MPEG 1/2 layer II
  /3 | MPEG 1/2 layer III
  /2.5 | MPEG 2.5
  /AAC | Advanced audio compression
  VQF | Transform-domain Weighted Interleave Vector Quantization
  PCM | Pulse Code Modulated audio
  but other types may be used, not for these types though. This is used in a similar way to the predefined types in the "TMED" frame, but without parentheses. If this frame is not present audio type is assumed to be "MPG".
  TIME | The 'Time' frame is a numeric string in the HHMM format containing the time for the recording. This field is always four characters long.
  TIT1 | The 'Content group description' frame is used if the sound belongs to a larger category of sounds/music. For example, classical music is often sorted in different musical sections (e.g. "Piano Concerto", "Weather - Hurricane").
  TIT2 | The 'Title/Songname/Content description' frame is the actual name of the piece (e.g. "Adagio", "Hurricane Donna").
  TIT3 | The 'Subtitle/Description refinement' frame is used for information directly related to the contents title (e.g. "Op. 16" or "Performed live at Wembley").
  TKEY | The 'Initial key' frame contains the musical key in which the sound starts. It is represented as a string with a maximum length of three characters. The ground keys are represented with "A","B","C","D","E", "F" and "G" and halfkeys represented with "b" and "#". Minor is represented as "m". Example "Cbm". Off key is represented with an "o" only.
  TLAN | The 'Language(s)' frame should contain the languages of the text or lyrics spoken or sung in the audio. The `language` is represented with three characters according to the ISO-639-2 specification. If more than one language is used in the text their language codes should follow according to their usage.
  TLEN | The 'Length' frame contains the length of the audiofile in milliseconds, represented as a numeric string.
  TMED | The 'Media type' frame describes from which media the sound originated. This may be a text string or a reference to the predefined media types found in the list below. References are made within "(" and ")" and are optionally followed by a text refinement, e.g. "(MC) with four channels". If a text refinement should begin with a "(" character it should be replaced with "((" in the same way as in the "TCO" frame. Predefined refinements is appended after the media type, e.g. "(CD/A)" or "(VID/PAL/VHS)".
  Type | Refinement | Description
  --- | --- | ---
  DIG |  | Other digital media
  DIG | /A | Analog transfer from media
  ANA |  | Other analog media
  ANA | /WAC | Wax cylinder
  ANA | /8CA | 8-track tape cassette
  CD |  | CD
  CD | /A | Analog transfer from media
  CD | /DD | DDD
  CD | /AD | ADD
  CD | /AA | AAD
  LD |  | Laserdisc
  LD | /A | Analog transfer from media
  TT |  | Turntable records
  TT | /33 | 33.33 rpm
  TT | /45 | 45 rpm
  TT | /71 | 71.29 rpm
  TT | /76 | 76.59 rpm
  TT | /78 | 78.26 rpm
  TT | /80 | 80 rpm
  MD |  | MiniDisc
  MD | /A | Analog transfer from media
  DAT |  | DAT
  DAT | /A | Analog transfer from media
  DAT | /1 | standard, 48 kHz/16 bits, linear
  DAT | /2 | mode 2, 32 kHz/16 bits, linear
  DAT | /3 | mode 3, 32 kHz/12 bits, nonlinear, low speed
  DAT | /4 | mode 4, 32 kHz/12 bits, 4 channels
  DAT | /5 | mode 5, 44.1 kHz/16 bits, linear
  DAT | /6 | mode 6, 44.1 kHz/16 bits, 'wide track' play
  DCC |  | DCC
  DCC | /A | Analog transfer from media
  DVD |  | DVD
  DVD | /A | Analog transfer from media
  TV |  | Television
  TV | /PAL | PAL
  TV | /NTSC | NTSC
  TV | /SECAM | SECAM
  VID |  | Video
  VID | /PAL | PAL
  VID | /NTSC | NTSC
  VID | /SECAM | SECAM
  VID | /VHS | VHS
  VID | /SVHS | S-VHS
  VID | /BETA | BETAMAX
  RAD |  | Radio
  RAD | /FM | FM
  RAD | /AM | AM
  RAD | /LW | LW
  RAD | /MW | MW
  TEL |  | Telephone
  TEL | /I | ISDN
  MC |  | MC (normal cassette)
  MC | /4 | 4.75 cm/s (normal speed for a two sided cassette)
  MC | /9 | 9.5 cm/s
  MC | /I | Type I cassette (ferric/normal)
  MC | /II | Type II cassette (chrome)
  MC | /III | Type III cassette (ferric chrome)
  MC | /IV | Type IV cassette (metal)
  REE |  | Reel
  REE | /9 | 9.5 cm/s
  REE | /19 | 19 cm/s
  REE | /38 | 38 cm/s
  REE | /76 | 76 cm/s
  REE | /I | Type I cassette (ferric/normal)
  REE | /II | Type II cassette (chrome)
  REE | /III | Type III cassette (ferric chrome)
  REE | /IV | Type IV cassette (metal)
  TOAL | The 'Original album/movie/show title' frame is intended for the title of the original recording (or source of sound), if for example the music in the file should be a cover of a previously released song.
  TOFN | The 'Original filename' frame contains the preferred filename for the file, since some media doesn't allow the desired length of the filename. The filename is case sensitive and includes its suffix.
  TOLY | The 'Original lyricist(s)/text writer(s)' frame is intended for the text writer(s) of the original recording, if for example the music in the file should be a cover of a previously released song. The text writers are seperated with the "/" character.
  TOPE | The 'Original artist(s)/performer(s)' frame is intended for the performer(s) of the original recording, if for example the music in the file should be a cover of a previously released song. The performers are seperated with the "/" character.
  TORY | The 'Original release year' frame is intended for the year when the original recording, if for example the music in the file should be a cover of a previously released song, was released. The field is formatted as in the "TYER" frame.
  TOWN | The 'File owner/licensee' frame contains the name of the owner or licensee of the file and it's contents.
  TPE1 | The 'Lead artist(s)/Lead performer(s)/Soloist(s)/Performing group' is used for the main artist(s). They are separated with the "/" character.
  TPE2 | The 'Band/Orchestra/Accompaniment' frame is used for additional information about the performers in the recording.
  TPE3 | The 'Conductor' frame is used for the name of the conductor.
  TPE4 | The 'Interpreted, remixed, or otherwise modified by' frame contains more information about the people behind a remix and similar interpretations of another existing piece.
  TPOS | The 'Part of a set' frame is a numeric string that describes which part of a set the audio came from. This frame is used if the source described in the "TALB" frame is divided into several mediums, e.g. a double CD. The value may be extended with a "/" character and a numeric string containing the total number of parts in the set. E.g. "1/2".
  TPUB | The 'Publisher' frame simply contains the name of the label or publisher.
  TRCK | The 'Track number/Position in set' frame is a numeric string containing the order number of the audio-file on its original recording. This may be extended with a "/" character and a numeric string containing the total numer of tracks/elements on the original recording. E.g. "4/9".
  TRDA | The 'Recording dates' frame is a intended to be used as complement to the "TYER", "TDAT" and "TIME" frames. E.g. "4th-7th June, 12th June" in combination with the "TYER" frame.
  TRSN | The 'Internet radio station name' frame contains the name of the internet radio station from which the audio is streamed.
  TRSO | The 'Internet radio station owner' frame contains the name of the owner of the internet radio station from which the audio is streamed.
  TSIZ | The 'Size' frame contains the size of the audio file in bytes, excluding the ID3v2 tag, represented as a numeric string.
  TSRC | The 'ISRC' frame should contain the International Standard Recording Code (ISRC) (12 characters).
  TSSE | The 'Software/Hardware and settings used for encoding' frame includes the used audio encoder and its settings when the file was encoded. Hardware refers to hardware encoders, not the computer on which a program was run.
  TYER | The 'Year' frame is a numeric string with a year of the recording. This frames is always four characters long (until the year 10000).

  There may only be one text information frame of its kind in an ID3v2.3 `tag`

  See Also:
    `ID3v23Frame`, ID3 tag version 2.3.0 standard, wikipedia history of ID3 tags

- - ### Field Summary

    - ### Fields inherited from class com.beaglebuddy.id3.v23.frame_body.ID3v23FrameBody

      `buffer, dirty, frameType`

    - ### Fields inherited from class com.beaglebuddy.id3.v23.frame_body.ID3v23FrameBodyUtility

      `nextNullTerminatorIndex, nullTerminatorIndex`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ID3v23FrameBodyTextInformation(FrameType frameType)` The constructor is called when creating a new frame.
    `ID3v23FrameBodyTextInformation(FrameType frameType, Encoding encoding, java.lang.String text)` This constructor is called when creating a new frame.
    `ID3v23FrameBodyTextInformation(java.io.InputStream inputStream, FrameType frameType, int frameBodySize)` This constructor is called when reading in an existing frame from an .mp3 file.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Encoding` | `getEncoding()` gets the character encoding of the text.
    `java.lang.String` | `getText()` gets the text.
    `void` | `parse()` parses the raw bytes of the frame body and stores the parsed values in the frame's fields.
    `void` | `setBuffer()` If the frame body's values have been modified, then resize the raw binary buffer and store the new values there.
    `void` | `setEncoding(Encoding encoding)` sets the character encoding of the text.
    `void` | `setText(java.lang.String text)` sets the text.
    `java.lang.String` | `toString()` gets a string representation of the text information frame body.

    - ### Methods inherited from class com.beaglebuddy.id3.v23.frame_body.ID3v23FrameBody

      `getFrameType, getNextNullTerminator, getSize, isDirty, save, save`

    - ### Methods inherited from class com.beaglebuddy.id3.v23.frame_body.ID3v23FrameBodyUtility

      `getNextNullTerminator, pricesToString, stringToBytes`

    - ### Methods inherited from class com.beaglebuddy.util.Utility

      `bytesToInt, bytesToInt, bytesToShort, bytesToShort, bytesToSynchsafeInt, bytesToSynchsafeShort, formateDate, getUTF16String, getUTF8String, hex, hex, hex, intToBytes, littleEndianBytesToInt, pad, shortToBytes, synchsafeIntToBytes`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ID3v23FrameBodyTextInformation

          public ID3v23FrameBodyTextInformation(FrameType frameType)

      The constructor is called when creating a new frame. The default values used are:
      - ISO-8859-1 encoding
      - empty text
      Parameters:
        `frameType` - It must be one of the 38 following ID3v2.3 Text frame types:

        ID3v2.3 Text Frame Typess
        | Frame Type | Frame id | Description
        --- | --- | --- | ---
        1. | ALBUM_TITLE | TALB | album/movie/show title
        2. | BEATS_PER_MINUTE | TBPM | bpm (beats per minute)
        3. | COMPOSER | TCOM | composer
        4. | CONTENT_TYPE | TCON | content type
        5. | COPYRIGHT_MESSAGE | TCOP | copyright message
        6. | DATE | TDAT | date
        7. | PLAYLIST_DELAY | TDLY | playlist delay
        8. | ENCODED_BY | TENC | encoded by
        9. | LYRICIST | TEXT | lyricist/text writer
        10. | FILE_TYPE | TFLT | file type
        11. | TIME | TIME | time
        12. | CONTENT_GROUP_DESCRIPTION | TIT1 | content group description
        13. | SONG_TITLE | TIT2 | title/songname/content description
        14. | SUBTITLE_REFINEMENT | TIT3 | subtitle/description refinement
        15. | INITIAL_KEY | TKEY | initial key
        16. | LANGUAGE | TLAN | language(s)
        17. | LENGTH | TLEN | length of the song (in ms)
        18. | MEDIA_TYPE | TMED | media type
        19. | ORIGINAL_ALBUM_TITLE | TOAL | original album/movie/show title
        20. | ORIGINAL_FILENAME | TOFN | original filename
        21. | ORIGINAL_LYRICIST | TOLY | original lyricist(s)/text writer(s)
        22. | ORIGINAL_ARTIST | TOPE | original artist(s)/performer(s)
        23. | ORIGINAL_RELEASE_YEAR | TORY | original release year
        24. | FILE_OWNER | TOWN | file owner/licensee
        25. | LEAD_PERFORMER | TPE1 | lead performer(s)/soloist(s)
        26. | BAND | TPE2 | band/orchestra/accompaniment
        27. | CONDUCTOR | TPE3 | conductor/performer refinement
        28. | INTERPRETED_MODIFIED_BY | TPE4 | interpreted, remixed, or otherwise modified by
        29. | PART_OF_A_SET | TPOS | part of a set
        30. | PUBLISHER | TPUB | publisher
        31. | TRACK_NUMBER | TRCK | track number/position in set
        32. | RECORDING_DATES | TRDA | recording dates
        33. | INTERNET_RADIO_STATION_NAME | TRSN | internet radio station name
        34. | INTERNET_RADIO_STATION_OWNER | TRSO | internet radio station owner
        35. | SIZE | TSIZ | size of the audio portion of the .mp3 file (in bytes)
        36. | INTERNATIONAL_STANDARD_RECORDING_CODE | TSRC | isrc (international standard recording code)
        37. | SOFTWARE_HARDWARE_ENCODING_SETTINGS | TSSE | software/hardware and settings used for encoding
        38. | YEAR | TYER | year the song was recorded

    - #### ID3v23FrameBodyTextInformation

          public ID3v23FrameBodyTextInformation(FrameType frameType,
                                        Encoding encoding,
                                        java.lang.String text)

      This constructor is called when creating a new frame.
      Parameters:
        `frameType` - one of the 38 ID3v2.3 Text frame types. See `ID3v23FrameBodyTextInformation(FrameType)`
        `encoding` - character set used to encode the text.
        `text` - text.

    - #### ID3v23FrameBodyTextInformation

          public ID3v23FrameBodyTextInformation(java.io.InputStream inputStream,
                                        FrameType frameType,
                                        int frameBodySize)
                                         throws java.io.IOException

      This constructor is called when reading in an existing frame from an .mp3 file. This is then followed by a call to the parse() method.
      Parameters:
        `inputStream` - input stream pointing to a text information frame body in the .mp3 file.
        `frameType` - the type of ID3v2.3 frame.
        `frameBodySize` - size (in bytes) of the frame's body.
      Throws:
        `java.io.IOException` - if there is an error while reading the frame body.

  - ### Method Detail

    - #### parse

          public void parse()
                     throws java.lang.IllegalArgumentException

      parses the raw bytes of the frame body and stores the parsed values in the frame's fields.
      Overrides:
        `parse` in class `ID3v23FrameBody`
      Throws:
        `java.lang.IllegalArgumentException` - if an invalid value is detected while parsing the frame body's raw bytes.

    - #### getEncoding

          public Encoding getEncoding()

      gets the character encoding of the text.
      Returns:
        the character encoding of the text.
      See Also:
        `setEncoding(Encoding)`

    - #### setEncoding

          public void setEncoding(Encoding encoding)

      sets the character encoding of the text.
      Parameters:
        `encoding` - the character set used to encode the text. Only ISO 8859-1 and UTF-16 are allowed.
      See Also:
        `getEncoding()`

    - #### getText

          public java.lang.String getText()

      gets the text.
      Returns:
        the text.
      See Also:
        `setText(String)`

    - #### setText

          public void setText(java.lang.String text)

      sets the text.
      Parameters:
        `text` - the text.
      Throws:
        `java.lang.IllegalArgumentException` - if the text is null or an empty string.
      See Also:
        `getText()`

    - #### setBuffer

          public void setBuffer()

      If the frame body's values have been modified, then resize the raw binary buffer and store the new values there. When finished, the dirty flag is reset to indicate that the buffer is up to date, and the frame is now ready to be saved to the .mp3 file.
      Overrides:
        `setBuffer` in class `ID3v23FrameBody`

    - #### toString

          public java.lang.String toString()

      gets a string representation of the text information frame body.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        a string representation of the frame body.