public class AiffModule extends ModuleBase
Modifier and Type | Field and Description |
---|---|
protected AESAudioMetadata |
_aesMetadata |
protected List |
_annotationList |
protected Checksummer |
_ckSummer
PRIVATE Instance FIELDS.
|
protected ChecksumInputStream |
_cstream |
protected DataInputStream |
_dstream |
protected Property |
_metadata |
protected List |
_midiList |
protected List |
_propList |
protected 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 |
_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
MAXIMUM_VERBOSITY, MINIMUM_VERBOSITY
Constructor and Description |
---|
AiffModule()
Instantiates an AiffModule object.
|
Modifier and Type | Method and Description |
---|---|
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,
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(InputStream stream,
RepInfo info,
int parseIndex)
Parses the content of a purported AIFF digital object and stores the
results in RepInfo.
|
String |
read4Chars(DataInputStream stream)
Reads 4 bytes and concatenates them into a String.
|
double |
read80BitDouble(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.
|
String |
readPascalString(DataInputStream stream)
Reads a Pascal string.
|
int |
readSignedShort(DataInputStream stream)
One-argument version of
readSignedShort . |
long |
readUnsignedInt(DataInputStream stream)
One-argument version of
readUnsignedInt . |
int |
readUnsignedShort(DataInputStream stream)
One-argument version of
readUnsignedShort . |
void |
setEndian(boolean bigEndian)
Sets the endian-ness.
|
Date |
timestampToDate(long timestamp)
Converts a Macintosh-style timestamp (seconds since
January 1, 1904) into a Java date.
|
addIntegerProperty, addIntegerProperty, applyDefaultParams, calcRAChecksum, checkSignatures, checkSignatures, getApp, getBase, getBufferedDataStream, getCoverage, getCRC32, getDate, getDefaultParams, getFeatures, getFormat, getMimeType, getName, getNByte, getNote, getRelease, getRepInfoNote, getRights, getSignature, getSpecification, getValidityNote, getVendor, getWellFormedNote, hasFeature, init, initFeatures, isBigEndian, isRandomAccess, param, parse, readByteBuf, readDouble, readDouble, readDouble, readFloat, readFloat, readSignedByte, readSignedByte, readSignedByte, readSignedInt, readSignedInt, readSignedInt, readSignedLong, readSignedRational, readSignedRational, readSignedShort, readSignedShort, readSignedShort, readUnsignedByte, readUnsignedByte, readUnsignedByte, readUnsignedInt, readUnsignedInt, readUnsignedInt, readUnsignedRational, readUnsignedRational, readUnsignedRational, readUnsignedShort, readUnsignedShort, readUnsignedShort, resetParams, setApp, setBase, setChecksums, setCRC32, setDefaultParams, setMD5, setNByte, setSHA1, setValidityNote, setVerbosity, show, skipBytes, skipBytes, vectorToPropArray
protected Checksummer _ckSummer
protected ChecksumInputStream _cstream
protected DataInputStream _dstream
protected Property _metadata
protected List _propList
protected AESAudioMetadata _aesMetadata
protected List _annotationList
protected List _midiList
protected 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
public int parse(InputStream stream, RepInfo info, int parseIndex) throws 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.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(DataInputStream stream) throws IOException
readUnsignedInt
.IOException
public int readUnsignedShort(DataInputStream stream) throws IOException
readUnsignedShort
.IOException
public int readSignedShort(DataInputStream stream) throws IOException
readSignedShort
.IOException
public double read80BitDouble(DataInputStream stream) throws IOException
IOException
public String read4Chars(DataInputStream stream) throws IOException
IOException
public String readPascalString(DataInputStream stream) throws IOException
IOException
public Date timestampToDate(long timestamp)
public int getFileType()
public void markFirstSampleOffset(long offset)
protected boolean readFileType(RepInfo info) throws IOException
IOException
protected boolean readChunk(RepInfo info) throws IOException
IOException
public AESAudioMetadata getAESMetadata()
Copyright © 2008–2017 The Open Preservation Foundation. All rights reserved.