| 1 | package org.farng.mp3.lyrics3; |
| 2 | |
| 3 | import org.farng.mp3.InvalidTagException; |
| 4 | import org.farng.mp3.object.ObjectBooleanString; |
| 5 | |
| 6 | import java.io.RandomAccessFile; |
| 7 | |
| 8 | /** |
| 9 | * Indications field. This is always two characters big in v2.00, but might be bigger in a future standard. The first |
| 10 | * byte indicates wether or not a lyrics field is present. "1" for present and "0" for otherwise. The second character |
| 11 | * indicates if there is a timestamp in the lyrics. Again "1" for yes and "0" for no. |
| 12 | * |
| 13 | * @author Eric Farng |
| 14 | * @version $Revision: 1.4 $ |
| 15 | */ |
| 16 | public class FieldBodyIND extends AbstractLyrics3v2FieldBody { |
| 17 | |
| 18 | /** |
| 19 | * Creates a new FieldBodyIND object. |
| 20 | */ |
| 21 | public FieldBodyIND() { |
| 22 | super(); |
| 23 | } |
| 24 | |
| 25 | /** |
| 26 | * Creates a new FieldBodyIND object. |
| 27 | */ |
| 28 | public FieldBodyIND(final FieldBodyIND body) { |
| 29 | super(body); |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * Creates a new FieldBodyIND object. |
| 34 | */ |
| 35 | public FieldBodyIND(final boolean lyricsPresent, final boolean timeStampPresent) { |
| 36 | setObject("Lyrics Present", new Boolean(lyricsPresent)); |
| 37 | setObject("Timestamp Present", new Boolean(timeStampPresent)); |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * Creates a new FieldBodyIND object. |
| 42 | */ |
| 43 | public FieldBodyIND(final RandomAccessFile file) throws InvalidTagException, java.io.IOException { |
| 44 | this.read(file); |
| 45 | } |
| 46 | |
| 47 | public void setAuthor(final String author) { |
| 48 | setObject("Author", author); |
| 49 | } |
| 50 | |
| 51 | public String getAuthor() { |
| 52 | return (String) getObject("Author"); |
| 53 | } |
| 54 | |
| 55 | public String getIdentifier() { |
| 56 | return "IND"; |
| 57 | } |
| 58 | |
| 59 | protected void setupObjectList() { |
| 60 | appendToObjectList(new ObjectBooleanString("Lyrics Present")); |
| 61 | appendToObjectList(new ObjectBooleanString("Timestamp Present")); |
| 62 | } |
| 63 | } |