|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.harvard.hul.ois.jhove.ModuleBase
edu.harvard.hul.ois.jhove.module.AiffModule
public class AiffModule
Module for identification and validation of AIFF files. Supports AIFF and AIFF-C.
Field Summary | |
---|---|
protected AESAudioMetadata |
_aesMetadata
|
protected java.util.List |
_annotationList
|
protected Checksummer |
_ckSummer
PRIVATE Instance FIELDS. |
protected ChecksumInputStream |
_cstream
|
protected java.io.DataInputStream |
_dstream
|
protected Property |
_metadata
|
protected java.util.List |
_midiList
|
protected java.util.List |
_propList
|
protected java.util.List |
_saxelList
|
static int |
AIFCTYPE
|
static int |
AIFFTYPE
|
protected boolean |
audioRecChunkSeen
|
protected boolean |
authorChunkSeen
|
protected long |
bytesRemaining
|
protected boolean |
commentsChunkSeen
|
protected boolean |
commonChunkSeen
|
protected boolean |
copyrightChunkSeen
|
protected int |
fileType
|
protected boolean |
firstSampleOffsetMarked
|
protected boolean |
formatVersionChunkSeen
|
protected boolean |
instrumentChunkSeen
|
protected boolean |
markerChunkSeen
|
protected boolean |
nameChunkSeen
|
protected boolean |
soundChunkSeen
|
protected boolean |
thisFileBigEndian
|
Fields inherited from class edu.harvard.hul.ois.jhove.ModuleBase |
---|
_app, _bigEndian, _checksumFinished, _countStream, _coverage, _crc32, _date, _defaultParams, _features, _format, _init, _isRandomAccess, _je, _logger, _md5, _mimeType, _name, _nByte, _note, _param, _release, _repInfoNote, _rights, _sha1, _signature, _specification, _validityNote, _vendor, _verbosity, _wellFormedNote |
Fields inherited from interface edu.harvard.hul.ois.jhove.Module |
---|
MAXIMUM_VERBOSITY, MINIMUM_VERBOSITY |
Constructor Summary | |
---|---|
AiffModule()
Instantiates an AiffModule object. |
Method Summary | |
---|---|
void |
addAiffProperty(Property prop)
Adds a Property to the AIFF metadata. |
void |
addAnnotation(Property prop)
Adds an Annotation Property to the annotation list. |
void |
addMidi(Property prop)
Adds a MIDI Property to the MIDI list. |
void |
addSaxel(Property prop)
Adds a Saxel Property to the saxel list. |
protected void |
dupChunkError(RepInfo info,
java.lang.String chunkName)
|
AESAudioMetadata |
getAESMetadata()
Returns the module's AES metadata. |
int |
getFileType()
Returns the filetype, which is AIFFTYPE or AIFCTYPE. |
protected void |
initParse()
Initializes the state of the module for parsing. |
void |
markFirstSampleOffset(long offset)
Marks the first sample offset as the current byte position, if it hasn't already been marked. |
int |
parse(java.io.InputStream stream,
RepInfo info,
int parseIndex)
Parses the content of a purported AIFF digital object and stores the results in RepInfo. |
java.lang.String |
read4Chars(java.io.DataInputStream stream)
Reads 4 bytes and concatenates them into a String. |
double |
read80BitDouble(java.io.DataInputStream stream)
This reads an 80-bit SANE number, aka IEEE 754 extended double. |
protected boolean |
readChunk(RepInfo info)
Reads an AIFF Chunk. |
protected boolean |
readFileType(RepInfo info)
Reads the file type. |
java.lang.String |
readPascalString(java.io.DataInputStream stream)
Reads a Pascal string. |
int |
readSignedShort(java.io.DataInputStream stream)
One-argument version of readSignedShort . |
long |
readUnsignedInt(java.io.DataInputStream stream)
One-argument version of readUnsignedInt . |
int |
readUnsignedShort(java.io.DataInputStream stream)
One-argument version of readUnsignedShort . |
void |
setEndian(boolean bigEndian)
Sets the endian-ness. |
java.util.Date |
timestampToDate(long timestamp)
Converts a Macintosh-style timestamp (seconds since January 1, 1904) into a Java date. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Checksummer _ckSummer
protected ChecksumInputStream _cstream
protected java.io.DataInputStream _dstream
protected Property _metadata
protected java.util.List _propList
protected AESAudioMetadata _aesMetadata
protected java.util.List _annotationList
protected java.util.List _midiList
protected java.util.List _saxelList
protected long bytesRemaining
protected boolean soundChunkSeen
protected boolean formatVersionChunkSeen
protected boolean instrumentChunkSeen
protected boolean commonChunkSeen
protected boolean commentsChunkSeen
protected boolean nameChunkSeen
protected boolean authorChunkSeen
protected boolean copyrightChunkSeen
protected boolean markerChunkSeen
protected boolean audioRecChunkSeen
protected boolean firstSampleOffsetMarked
protected int fileType
protected boolean thisFileBigEndian
public static final int AIFFTYPE
public static final int AIFCTYPE
Constructor Detail |
---|
public AiffModule()
Method Detail |
---|
public int parse(java.io.InputStream stream, RepInfo info, int parseIndex) throws java.io.IOException
parse
in interface Module
parse
in class ModuleBase
stream
- An InputStream, positioned at its beginning,
which is generated from the object to be parsedinfo
- A fresh RepInfo object which will be modified
to reflect the results of the parsingparseIndex
- Must be 0 in first call to parse
. If
parse
returns a nonzero value, it must be
called again with parseIndex
equal to that return value.
java.io.IOException
public void setEndian(boolean bigEndian)
true
indicates
big-endian, and false
means little-endian.
This is needed because chunk data can change the
usual little-endian byte order to big-endian.
public void addAiffProperty(Property prop)
public void addAnnotation(Property prop)
public void addSaxel(Property prop)
public void addMidi(Property prop)
protected void initParse()
initParse
in class ModuleBase
public long readUnsignedInt(java.io.DataInputStream stream) throws java.io.IOException
readUnsignedInt
.
java.io.IOException
public int readUnsignedShort(java.io.DataInputStream stream) throws java.io.IOException
readUnsignedShort
.
java.io.IOException
public int readSignedShort(java.io.DataInputStream stream) throws java.io.IOException
readSignedShort
.
java.io.IOException
public double read80BitDouble(java.io.DataInputStream stream) throws java.io.IOException
java.io.IOException
public java.lang.String read4Chars(java.io.DataInputStream stream) throws java.io.IOException
java.io.IOException
public java.lang.String readPascalString(java.io.DataInputStream stream) throws java.io.IOException
java.io.IOException
public java.util.Date timestampToDate(long timestamp)
public int getFileType()
public void markFirstSampleOffset(long offset)
protected boolean readFileType(RepInfo info) throws java.io.IOException
java.io.IOException
protected boolean readChunk(RepInfo info) throws java.io.IOException
java.io.IOException
public AESAudioMetadata getAESMetadata()
protected void dupChunkError(RepInfo info, java.lang.String chunkName)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |