| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
package com.drew.metadata.mov.atoms; |
| 22 |
|
| 23 |
import com.drew.lang.SequentialReader; |
| 24 |
import com.drew.metadata.mov.media.QuickTimeTimecodeDirectory; |
| 25 |
|
| 26 |
import java.io.IOException; |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
public class TimecodeInformationMediaAtom extends FullAtom |
| 34 |
{ |
| 35 |
int textFont; |
| 36 |
int textFace; |
| 37 |
int textSize; |
| 38 |
int[] textColor; |
| 39 |
int[] backgroundColor; |
| 40 |
String fontName; |
| 41 |
|
| 42 |
public TimecodeInformationMediaAtom(SequentialReader reader, Atom atom) throws IOException |
| 43 |
{ |
| 44 |
super(reader, atom); |
| 45 |
|
| 46 |
textFont = reader.getInt16(); |
| 47 |
textFace = reader.getInt16(); |
| 48 |
textSize = reader.getInt16(); |
| 49 |
reader.skip(2); |
| 50 |
textColor = new int[]{reader.getUInt16(), reader.getUInt16(), reader.getUInt16()}; |
| 51 |
backgroundColor = new int[]{reader.getUInt16(), reader.getUInt16(), reader.getUInt16()}; |
| 52 |
fontName = reader.getString(reader.getUInt8()); |
| 53 |
} |
| 54 |
|
| 55 |
public void addMetadata(QuickTimeTimecodeDirectory directory) |
| 56 |
{ |
| 57 |
directory.setInt(QuickTimeTimecodeDirectory.TAG_TEXT_FONT, textFont); |
| 58 |
switch (textFace) { |
| 59 |
case (0x0001): |
| 60 |
directory.setString(QuickTimeTimecodeDirectory.TAG_TEXT_FACE, "Bold"); |
| 61 |
break; |
| 62 |
case (0x0002): |
| 63 |
directory.setString(QuickTimeTimecodeDirectory.TAG_TEXT_FACE, "Italic"); |
| 64 |
break; |
| 65 |
case (0x0004): |
| 66 |
directory.setString(QuickTimeTimecodeDirectory.TAG_TEXT_FACE, "Underline"); |
| 67 |
break; |
| 68 |
case (0x0008): |
| 69 |
directory.setString(QuickTimeTimecodeDirectory.TAG_TEXT_FACE, "Outline"); |
| 70 |
break; |
| 71 |
case (0x0010): |
| 72 |
directory.setString(QuickTimeTimecodeDirectory.TAG_TEXT_FACE, "Shadow"); |
| 73 |
break; |
| 74 |
case (0x0020): |
| 75 |
directory.setString(QuickTimeTimecodeDirectory.TAG_TEXT_FACE, "Condense"); |
| 76 |
break; |
| 77 |
case (0x0040): |
| 78 |
directory.setString(QuickTimeTimecodeDirectory.TAG_TEXT_FACE, "Extend"); |
| 79 |
} |
| 80 |
|
| 81 |
directory.setInt(QuickTimeTimecodeDirectory.TAG_TEXT_SIZE, textSize); |
| 82 |
directory.setIntArray(QuickTimeTimecodeDirectory.TAG_TEXT_COLOR, textColor); |
| 83 |
directory.setIntArray(QuickTimeTimecodeDirectory.TAG_BACKGROUND_COLOR, backgroundColor); |
| 84 |
directory.setString(QuickTimeTimecodeDirectory.TAG_FONT_NAME, fontName); |
| 85 |
} |
| 86 |
} |