Media Authoring
with Java API

tv.amwa.maj.entity
Class PCMDescriptor

java.lang.Object
  extended by tv.amwa.maj.entity.InterchangeObject
      extended by tv.amwa.maj.entity.EssenceDescriptor
          extended by tv.amwa.maj.entity.AAFFileDescriptor
              extended by tv.amwa.maj.entity.SoundDescriptor
                  extended by tv.amwa.maj.entity.PCMDescriptor
All Implemented Interfaces:
Serializable, Cloneable, MAJCommon, AAFFileDescriptor, EssenceDescriptor, InterchangeObject, PCMDescriptor, SoundDescriptor, XMLSerializable
Direct Known Subclasses:
AES3PCMDescriptor

@AAFClass(uuid1=218169601,
          uuid2=257,
          uuid3=18432,
          uuid4={6,14,43,52,2,6,1,1},
          definedName="PCMDescriptor",
          description="The PCMDescriptor class specifies that a File SourceMob is associated with audio essence formatted according to the BWF File Format.")
public class PCMDescriptor
extends SoundDescriptor
implements PCMDescriptor, Serializable, Cloneable, MAJCommon

Implements the description of a file source mob that is associated with audio essence formatted according to the BWF file format.

THE COMMENTS FOR THIS CLASS ARE INCOMPLETE.

Author:
Richard Cartwright
See Also:
BWFImportDescriptor, Serialized Form

Nested Class Summary
static class PCMDescriptor.XMLHandler
           
 
Nested classes/interfaces inherited from class tv.amwa.maj.entity.AAFFileDescriptor
AAFFileDescriptor.FileDescriptorXMLHandler
 
Nested classes/interfaces inherited from class tv.amwa.maj.entity.EssenceDescriptor
EssenceDescriptor.EssenceDescriptorXMLHandler, EssenceDescriptor.LocatorXMLHandler, EssenceDescriptor.SubDescriptorXMLHandler
 
Nested classes/interfaces inherited from class tv.amwa.maj.entity.InterchangeObject
InterchangeObject.InterchangeObjectXMLHandler
 
Field Summary
static String PCMDESCRIPTOR_TAG
           
 
Fields inherited from class tv.amwa.maj.entity.SoundDescriptor
SOUNDDESCRIPTOR_TAG
 
Fields inherited from class tv.amwa.maj.entity.AAFFileDescriptor
FILEDESCRIPTOR_ITEM
 
Fields inherited from class tv.amwa.maj.entity.EssenceDescriptor
ESSENCEDESCRIPTOR_ITEM
 
Constructor Summary
PCMDescriptor(ContainerDefinition containerFormat, Rational audioSamplingRate, int channels, int quantizationBits, short blockAlign, int averageBPS)
          Creates and initializes a new PCM sound descriptor, which is associated with audio essence formatted according to the BWF File Format.
 
Method Summary
 void appendXMLChildren(Node parent)
          Append child elements to the given parent node to serialize the value of an object to an XML fragment.
 boolean areAllPeakEnvelopePropertiesPresent()
          Returns true if all the following optional properties are set for this PCM descriptor:
 PCMDescriptor clone()
          Creates a cloned copy of this entity.
 boolean equals(Object o)
          Tests to see if the given object is equal to this interchange object.
 int getAverageBPS()
          Returns the average bytes per second of the essence stream described by this PCM descriptor.
 short getBlockAlign()
          Returns the number of bytes used to store one sample of all channels of data associated with this PCM descriptor.
 AUID getChannelAssignment()
          Returns the channel assignment scheme for this PCM descriptor.
 int getPeakChannelCount()
          Returns the number of peak channels for this PCM descriptor.
 int getPeakEnvelopeBlockSize()
          Returns the number of audio samples used to generate each peak frame for this PCM descriptor.
 byte[] getPeakEnvelopeData()
           
 long getPeakEnvelopeDataPosition()
          Returns the offset from the beginning of the peak envelope data for this PCM descriptor.
 long getPeakEnvelopeDataSize()
          Returns the size of the peak envelope data of this PCM descriptor.
 int getPeakEnvelopeFormat()
          Returns the format of the peak point for this PCM descriptor.
 TimeStamp getPeakEnvelopeTimestamp()
          Returns the time stamp for the date and time of the creation of this peak data for this PCM descriptor.
 int getPeakEnvelopeVersion()
          Returns the version information of the peak envelope data of this PCM descriptor.
 int getPeakFrameCount()
          Returns the number of peak frames for this PCM descriptor.
 long getPeakOfPeaksPosition()
          Returns the offset to the first audio sample whose absolute value is the maximum value of the entire audio file represented by this PCM descriptor.
 int getPointsPerPeakValue()
          Returns the number of peak points per peak value for this PCM descriptor.
 byte getSequenceOffset()
          Returns the frame number of the beginning of the essence data within a five-frame sequence for this PCM descriptor.
 int hashCode()
          Returns a hash code value for this interchange object.
 byte[] readPeakEnvelopeData(int bytes)
          Read the given number of bytes of data from the peak envelope data stream of this PCM descriptor at the PCMDescriptor.getPeakEnvelopeDataPosition() current position.
 void setAverageBPS(int bps)
          Sets the average bytes per second of the essence stream described by this PCM descriptor.
 void setBlockAlign(short blockAlign)
          Sets the number of bytes used to store one sample of all channels of data associated with this PCM descriptor.
 void setChannelAssignment(AUID channelAssignment)
          Sets the channel assignment scheme of this PCM descriptor.
 void setPeakChannelCount(Integer channelCount)
          Sets the number of peak channels for this PCM descriptor.
 void setPeakEnvelopeBlockSize(Integer blockSize)
          Sets the number of audio samples used to generate each peak frame for this PCM descriptor.
 void setPeakEnvelopeData(byte[] peakEnvelopeData)
           
 void setPeakEnvelopeDataPosition(long position)
          Sets the offset from the beginning of the peak envelope data for this PCM descriptor.
 void setPeakEnvelopeFormat(Integer format)
          Sets the format of the peak point for this PCM descriptor.
 void setPeakEnvelopeTimestamp(TimeStamp timeStamp)
          Sets the time stamp for the date and time of the creation of the peak data for the PCM descriptor.
 void setPeakEnvelopeVersion(Integer version)
          Sets the version information of the peak envelope data of this PCM descriptor.
 void setPeakFrameCount(Integer frameCount)
          Sets the number of peak frames for this PCM descriptor.
 void setPeakOfPeaksPosition(Long position)
          Sets the offset to the first audio sample whose absolute value is the maximum value of the entire audio file described by this PCM descriptor.
 void setPointsPerPeakValue(Integer pointCount)
          Sets the number of peak points per peak value for this PCM descriptor.
 void setPropertiesFromInterface(PCMDescriptor castFrom)
           
 void setSequenceOffset(Byte offset)
          Sets the frame number of the beginning of the essence data within a five-frame sequence for this PCM descriptor.
 int writePeakEnvelopeData(byte[] bytes)
          Write the given bytes to the peak envelope data stream of the PCM descriptor at the current position, as determined by calling PCMDescriptor.getPeakEnvelopeDataPosition().
 
Methods inherited from class tv.amwa.maj.entity.SoundDescriptor
getAudioRefLevel, getAudioSamplingRate, getChannelCount, getCompression, getDialNorm, getElectroSpatialFormulation, getIsLocked, getQuantizationBits, isLocked, setAudioRefLevel, setAudioSamplingRate, setChannelCount, setCompression, setDialNorm, setElectroSpatialFormulation, setIsLocked, setPropertiesFromInterface, setQuantizationBits
 
Methods inherited from class tv.amwa.maj.entity.AAFFileDescriptor
describesStaticEssence, getCodecDefinition, getContainerFormat, getLength, getLinkedSlotID, getSampleRate, setCodecDefinition, setContainerFormat, setDescribesStaticEssence, setDescribesTimeVaryingEssence, setLength, setLinkedSlotID, setPropertiesFromInterface, setSampleRate
 
Methods inherited from class tv.amwa.maj.entity.EssenceDescriptor
appendLocator, appendSubDescriptor, countLocators, countSubDescriptors, getLocatorAt, getLocators, getSubDescriptorAt, getSubDescriptors, insertLocatorAt, insertSubDescriptorAt, prependLocator, prependSubDescriptor, removeLocatorAt, removeSubDescriptorAt, setPropertiesFromInterface
 
Methods inherited from class tv.amwa.maj.entity.InterchangeObject
castFromInterface, countProperties, createOptionalPropertyValue, disableGenerationTracking, enableGenerationTracking, getDefinition, getGeneration, getGenerationAUID, getProperties, getPropertyValue, isGenerationTracked, isPropertyPresent, omitOpionalProperty, registerImplementation, setPropertiesFromInterface, setPropertyValue, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface tv.amwa.maj.iface.SoundDescriptor
getAudioRefLevel, getAudioSamplingRate, getChannelCount, getCompression, getDialNorm, getElectroSpatialFormulation, getQuantizationBits, isLocked, setAudioRefLevel, setAudioSamplingRate, setChannelCount, setCompression, setDialNorm, setElectroSpatialFormulation, setIsLocked, setQuantizationBits
 
Methods inherited from interface tv.amwa.maj.iface.AAFFileDescriptor
getCodecDefinition, getContainerFormat, getLength, getLinkedSlotID, getSampleRate, setCodecDefinition, setContainerFormat, setLength, setLinkedSlotID, setSampleRate
 
Methods inherited from interface tv.amwa.maj.iface.EssenceDescriptor
appendLocator, appendSubDescriptor, countLocators, countSubDescriptors, getLocatorAt, getLocators, getSubDescriptorAt, getSubDescriptors, insertLocatorAt, insertSubDescriptorAt, prependLocator, prependSubDescriptor, removeLocatorAt, removeSubDescriptorAt
 
Methods inherited from interface tv.amwa.maj.iface.InterchangeObject
countProperties, createOptionalPropertyValue, disableGenerationTracking, enableGenerationTracking, getDefinition, getGeneration, getGenerationAUID, getProperties, getPropertyValue, isGenerationTracked, isPropertyPresent, omitOpionalProperty, setPropertyValue
 
Methods inherited from interface tv.amwa.maj.entity.MAJCommon
toString
 

Field Detail

PCMDESCRIPTOR_TAG

public static final String PCMDESCRIPTOR_TAG
See Also:
Constant Field Values
Constructor Detail

PCMDescriptor

public PCMDescriptor(ContainerDefinition containerFormat,
                     Rational audioSamplingRate,
                     @UInt32
                     int channels,
                     @UInt32
                     int quantizationBits,
                     @UInt16
                     short blockAlign,
                     @UInt32
                     int averageBPS)
              throws NullPointerException,
                     IllegalArgumentException

Creates and initializes a new PCM sound descriptor, which is associated with audio essence formatted according to the BWF File Format.

Parameters:
containerFormat - Identifies the container mechanism used to store the essence.
audioSamplingRate - Sampling rate of the audio essence.
channels - Number of audio channels.
quantizationBits - Number of quantization bits.
blockAlign - Sample block alignment.
averageBPS - Average bytes per second.
Throws:
NullPointerException - The container format or sampling rate properties are null.
IllegalArgumentException - Cannot set the channels, quantization bits, block align or average bits per second values to negative values.
Method Detail

setPropertiesFromInterface

public final void setPropertiesFromInterface(PCMDescriptor castFrom)
See Also:
InterchangeObject.setPropertiesFromInterface(tv.amwa.maj.iface.InterchangeObject)

areAllPeakEnvelopePropertiesPresent

public boolean areAllPeakEnvelopePropertiesPresent()
Description copied from interface: PCMDescriptor

Returns true if all the following optional properties are set for this PCM descriptor:

Specified by:
areAllPeakEnvelopePropertiesPresent in interface PCMDescriptor
Returns:
Are all the optional peak envelope properties present in this PCM descriptor?

getAverageBPS

@AAFProperty(uuid1=67240707,
             uuid2=1280,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,5},
             definedName="AverageBPS",
             typeName="UInt32",
             optional=false,
             uniqueIdentifier=false,
             pid=15625)
public int getAverageBPS()
Description copied from interface: PCMDescriptor

Returns the average bytes per second of the essence stream described by this PCM descriptor.

Specified by:
getAverageBPS in interface PCMDescriptor
Returns:
Average bytes per second of the essence stream described by this PCM descriptor.

setAverageBPS

public void setAverageBPS(int bps)
                   throws IllegalArgumentException
Description copied from interface: PCMDescriptor

Sets the average bytes per second of the essence stream described by this PCM descriptor. This property is required.

Specified by:
setAverageBPS in interface PCMDescriptor
Parameters:
bps - Average bytes per second of the essence stream.
Throws:
IllegalArgumentException - The given average bytes per second value is negative.

getBlockAlign

@AAFProperty(uuid1=67240706,
             uuid2=256,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,5},
             definedName="BlockAlign",
             typeName="UInt16",
             optional=false,
             uniqueIdentifier=false,
             pid=15626)
public short getBlockAlign()
Description copied from interface: PCMDescriptor

Returns the number of bytes used to store one sample of all channels of data associated with this PCM descriptor. This property is required.

Specified by:
getBlockAlign in interface PCMDescriptor
Returns:
Number of bytes used to store one sample of all channels.

setBlockAlign

public void setBlockAlign(short blockAlign)
                   throws IllegalArgumentException
Description copied from interface: PCMDescriptor

Sets the number of bytes used to store one sample of all channels of data associated with this PCM descriptor. This property is required.

Specified by:
setBlockAlign in interface PCMDescriptor
Parameters:
blockAlign - The number of bytes used to store one sample of all channels.
Throws:
IllegalArgumentException - The given block align value is negative.

getChannelAssignment

@AAFProperty(uuid1=67240193,
             uuid2=1280,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,7},
             definedName="ChannelAssignment",
             typeName="AUID",
             optional=true,
             uniqueIdentifier=false,
             pid=15666)
public AUID getChannelAssignment()
Description copied from interface: PCMDescriptor

Returns the channel assignment scheme for this PCM descriptor. An example of this would be an AUID representing "SMPTE 320M-B". This property is optional and has a default value of "SMPTE 320M-B".

Specified by:
getChannelAssignment in interface PCMDescriptor
Returns:
Channel assignment scheme for the PCM descriptor.

setChannelAssignment

public void setChannelAssignment(AUID channelAssignment)
Description copied from interface: PCMDescriptor

Sets the channel assignment scheme of this PCM descriptor. An example of this would be an AUID representing "SMPTE 320M-B". This property is optional and set by default to the identifier for "SMPTE 320M-B". Calling this method with null will restore the default value.

Specified by:
setChannelAssignment in interface PCMDescriptor
Parameters:
channelAssignment - Channel assignment to use for this PCM descriptor.

getPeakChannelCount

@AAFProperty(uuid1=67240705,
             uuid2=2560,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,8},
             definedName="PeakChannels",
             typeName="UInt32",
             optional=true,
             uniqueIdentifier=false,
             pid=15661)
public int getPeakChannelCount()
                        throws PropertyNotPresentException
Description copied from interface: PCMDescriptor

Returns the number of peak channels for this PCM descriptor. This property is optional.

Specified by:
getPeakChannelCount in interface PCMDescriptor
Returns:
Number of peak channels for this PCM descriptor.
Throws:
PropertyNotPresentException - The optional peak channels property is not present in this PCM descriptor.

setPeakChannelCount

public void setPeakChannelCount(Integer channelCount)
                         throws IllegalArgumentException
Description copied from interface: PCMDescriptor

Sets the number of peak channels for this PCM descriptor. Set this optional property of null to omit it.

Specified by:
setPeakChannelCount in interface PCMDescriptor
Parameters:
channelCount - Number of peak channels for this PCM descriptor.
Throws:
IllegalArgumentException - Cannot set the peak channels property of this PCM descriptor to a negative value.

getPeakEnvelopeBlockSize

@AAFProperty(uuid1=67240705,
             uuid2=2304,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,8},
             definedName="PeakEnvelopeBlockSize",
             typeName="UInt32",
             optional=true,
             uniqueIdentifier=false,
             pid=15660)
public int getPeakEnvelopeBlockSize()
                             throws PropertyNotPresentException
Description copied from interface: PCMDescriptor

Returns the number of audio samples used to generate each peak frame for this PCM descriptor. This property is optional.

Specified by:
getPeakEnvelopeBlockSize in interface PCMDescriptor
Returns:
Number of audio samples used to generate each peak frame for this PCM descriptor.
Throws:
PropertyNotPresentException - The optional peak envelope block size property is not present in this PCM descriptor.

setPeakEnvelopeBlockSize

public void setPeakEnvelopeBlockSize(Integer blockSize)
                              throws IllegalArgumentException
Description copied from interface: PCMDescriptor

Sets the number of audio samples used to generate each peak frame for this PCM descriptor. Set this optional property to null to omit it.

Specified by:
setPeakEnvelopeBlockSize in interface PCMDescriptor
Parameters:
blockSize - Number of audio samples used to generate each peak frame for this PCM descriptor.
Throws:
IllegalArgumentException - The given peak envelope block size is negative.

getPeakEnvelopeDataPosition

public long getPeakEnvelopeDataPosition()
Description copied from interface: PCMDescriptor

Returns the offset from the beginning of the peak envelope data for this PCM descriptor. This transient property is used to define the point at which peak envelope data is read or written.

Specified by:
getPeakEnvelopeDataPosition in interface PCMDescriptor
Returns:
Offset from the beginning of the peak envelope data for this PCM descriptor.

setPeakEnvelopeDataPosition

public void setPeakEnvelopeDataPosition(long position)
Description copied from interface: PCMDescriptor

Sets the offset from the beginning of the peak envelope data for this PCM descriptor. This property is optional and is used to define the point at which peak envelope data is read or written.

Specified by:
setPeakEnvelopeDataPosition in interface PCMDescriptor
Parameters:
position - Offset from the beginning of the peak envelope data for this PCM descriptor.

getPeakEnvelopeDataSize

public long getPeakEnvelopeDataSize()
                             throws PropertyNotPresentException
Description copied from interface: PCMDescriptor

Returns the size of the peak envelope data of this PCM descriptor. This peak envelope data property is optional. The value returned can be useful when working out how many bytes to read from the stream of peak envelope data.

Specified by:
getPeakEnvelopeDataSize in interface PCMDescriptor
Returns:
Size of the peak envelope data of this PCM descriptor.
Throws:
PropertyNotPresentException - The optional peak envelope data property is not present in this PCM descriptor.

getPeakEnvelopeFormat

@AAFProperty(uuid1=67240705,
             uuid2=1792,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,8},
             definedName="PeakEnvelopeFormat",
             typeName="UInt32",
             optional=true,
             uniqueIdentifier=false,
             pid=15658)
public int getPeakEnvelopeFormat()
                          throws PropertyNotPresentException
Description copied from interface: PCMDescriptor

Returns the format of the peak point for this PCM descriptor. This property is optional.

Specified by:
getPeakEnvelopeFormat in interface PCMDescriptor
Returns:
Format of the peak point for this PCM descriptor.
Throws:
PropertyNotPresentException - The optional peak envelope format property is not present in this PCM descriptor.

setPeakEnvelopeFormat

public void setPeakEnvelopeFormat(Integer format)
                           throws IllegalArgumentException
Description copied from interface: PCMDescriptor

Sets the format of the peak point for this PCM descriptor. Set this optional property to null to omit it.

Specified by:
setPeakEnvelopeFormat in interface PCMDescriptor
Parameters:
format - Format of the peak point for this PCM descriptor.
Throws:
IllegalArgumentException - The given peak envelope format is negative.

getPeakEnvelopeTimestamp

@AAFProperty(uuid1=67240705,
             uuid2=3328,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,8},
             definedName="PeakEnvelopeTimestamp",
             typeName="TimeStamp",
             optional=true,
             uniqueIdentifier=false,
             pid=15664)
public TimeStamp getPeakEnvelopeTimestamp()
                                   throws PropertyNotPresentException
Description copied from interface: PCMDescriptor

Returns the time stamp for the date and time of the creation of this peak data for this PCM descriptor. This property is optional.

Specified by:
getPeakEnvelopeTimestamp in interface PCMDescriptor
Returns:
Time stamp of the creation of the peak data for this PCM descriptor.
Throws:
PropertyNotPresentException - This optional property is not present in this PCM descriptor.
See Also:
PCMDescriptor.areAllPeakEnvelopePropertiesPresent(), TimeStamp.getTimeStamp()

setPeakEnvelopeTimestamp

public void setPeakEnvelopeTimestamp(TimeStamp timeStamp)
Description copied from interface: PCMDescriptor

Sets the time stamp for the date and time of the creation of the peak data for the PCM descriptor. Set this optional property to null to omit it.

Specified by:
setPeakEnvelopeTimestamp in interface PCMDescriptor
Parameters:
timeStamp - Time stamp of the creation of the peak data for the PCM descriptor.
See Also:
TimeStamp.TimeStamp(java.util.Calendar), TimeStamp.parseTimeStamp(String), PCMDescriptor.areAllPeakEnvelopePropertiesPresent()

getPeakEnvelopeVersion

@AAFProperty(uuid1=67240705,
             uuid2=1536,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,8},
             definedName="PeakEnvelopeVersion",
             typeName="UInt32",
             optional=true,
             uniqueIdentifier=false,
             pid=15657)
public int getPeakEnvelopeVersion()
                           throws PropertyNotPresentException
Description copied from interface: PCMDescriptor

Returns the version information of the peak envelope data of this PCM descriptor. This property is optional.

Specified by:
getPeakEnvelopeVersion in interface PCMDescriptor
Returns:
Version information of the peak envelope data of this PCM descriptor.
Throws:
PropertyNotPresentException - The optional peak envelope version property is not present in this PCM descriptor.

setPeakEnvelopeVersion

public void setPeakEnvelopeVersion(Integer version)
                            throws IllegalArgumentException
Description copied from interface: PCMDescriptor

Sets the version information of the peak envelope data of this PCM descriptor. Set this optional property to null to omit it.

Specified by:
setPeakEnvelopeVersion in interface PCMDescriptor
Parameters:
version - Version information of the peak envelope data of this PCM descriptor.
Throws:
IllegalArgumentException - Cannot set the peak envelope version property of this PCM descriptor to a negative value.

getPeakFrameCount

@AAFProperty(uuid1=67240705,
             uuid2=2816,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,8},
             definedName="PeakFrames",
             typeName="UInt32",
             optional=true,
             uniqueIdentifier=false,
             pid=15662)
public int getPeakFrameCount()
                      throws PropertyNotPresentException
Description copied from interface: PCMDescriptor

Returns the number of peak frames for this PCM descriptor. This property is optional.

Specified by:
getPeakFrameCount in interface PCMDescriptor
Returns:
Number of peak frames for this PCM descriptor.
Throws:
PropertyNotPresentException - This optional peak of peaks property is not present in this PCM descriptor.

setPeakFrameCount

public void setPeakFrameCount(Integer frameCount)
                       throws IllegalArgumentException
Description copied from interface: PCMDescriptor

Sets the number of peak frames for this PCM descriptor. Set this optional property to null to omit it.

Specified by:
setPeakFrameCount in interface PCMDescriptor
Parameters:
frameCount - Number of peak frames for this PCM descriptor.
Throws:
IllegalArgumentException - The given peak frames count is negative.

getPeakOfPeaksPosition

@AAFProperty(uuid1=67240705,
             uuid2=3072,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,8},
             definedName="PeakOfPeaksPosition",
             typeName="PositionType",
             optional=true,
             uniqueIdentifier=false,
             pid=15663)
public long getPeakOfPeaksPosition()
                            throws PropertyNotPresentException
Description copied from interface: PCMDescriptor

Returns the offset to the first audio sample whose absolute value is the maximum value of the entire audio file represented by this PCM descriptor. This property is optional.

Specified by:
getPeakOfPeaksPosition in interface PCMDescriptor
Returns:
Peak of peaks position in the described audio essence.
Throws:
PropertyNotPresentException - The optional peak of peaks position property is not present in this PCM descriptor.

setPeakOfPeaksPosition

public void setPeakOfPeaksPosition(Long position)
Description copied from interface: PCMDescriptor

Sets the offset to the first audio sample whose absolute value is the maximum value of the entire audio file described by this PCM descriptor. Set this optional property to null to omit it.

Specified by:
setPeakOfPeaksPosition in interface PCMDescriptor
Parameters:
position - Peak of peaks position in the described audio essence.

getPointsPerPeakValue

@AAFProperty(uuid1=67240705,
             uuid2=2048,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,8},
             definedName="PointsPerPeakValue",
             typeName="UInt32",
             optional=true,
             uniqueIdentifier=false,
             pid=15659)
public int getPointsPerPeakValue()
                          throws PropertyNotPresentException
Description copied from interface: PCMDescriptor

Returns the number of peak points per peak value for this PCM descriptor. This value is optional.

Specified by:
getPointsPerPeakValue in interface PCMDescriptor
Returns:
Number of peak points per peak value for this PCM descriptor.
Throws:
PropertyNotPresentException - The optional points per peak value property is not present in this PCM descriptor.

setPointsPerPeakValue

public void setPointsPerPeakValue(Integer pointCount)
                           throws IllegalArgumentException
Description copied from interface: PCMDescriptor

Sets the number of peak points per peak value for this PCM descriptor. Set this optional property to null to omit it.

Specified by:
setPointsPerPeakValue in interface PCMDescriptor
Parameters:
pointCount - Number of peak points per peak value for this PCM descriptor.
Throws:
IllegalArgumentException - The given number of peak points per peak value is negative.

getSequenceOffset

@AAFProperty(uuid1=67240706,
             uuid2=512,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,5},
             definedName="SequenceOffset",
             typeName="UInt8",
             optional=true,
             uniqueIdentifier=false,
             pid=15627)
public byte getSequenceOffset()
                       throws PropertyNotPresentException
Description copied from interface: PCMDescriptor

Returns the frame number of the beginning of the essence data within a five-frame sequence for this PCM descriptor. This property is optional and zero-based.

Specified by:
getSequenceOffset in interface PCMDescriptor
Returns:
Frame number of the beginning of the essence data within a five-frame sequence.
Throws:
PropertyNotPresentException - This optional property is not present in this PCM descriptor.

setSequenceOffset

public void setSequenceOffset(Byte offset)
                       throws IllegalArgumentException
Description copied from interface: PCMDescriptor

Sets the frame number of the beginning of the essence data within a five-frame sequence for this PCM descriptor. This property is optional and zero-based. Set to null omit it.

Specified by:
setSequenceOffset in interface PCMDescriptor
Parameters:
offset - Frame number of the beginning of the essence data within a five-frame sequence.
Throws:
IllegalArgumentException - The given sequence offset value is negative.

getPeakEnvelopeData

@AAFProperty(uuid1=67240705,
             uuid2=3584,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,8},
             definedName="PeakEnvelopeData",
             typeName="Stream",
             optional=true,
             uniqueIdentifier=false,
             pid=15665)
public byte[] getPeakEnvelopeData()
                           throws PropertyNotPresentException
Throws:
PropertyNotPresentException

setPeakEnvelopeData

public void setPeakEnvelopeData(byte[] peakEnvelopeData)

readPeakEnvelopeData

public byte[] readPeakEnvelopeData(int bytes)
                            throws EndOfDataException,
                                   PropertyNotPresentException
Description copied from interface: PCMDescriptor

Read the given number of bytes of data from the peak envelope data stream of this PCM descriptor at the PCMDescriptor.getPeakEnvelopeDataPosition() current position.

Specified by:
readPeakEnvelopeData in interface PCMDescriptor
Parameters:
bytes - Number of bytes to read.
Returns:
The given number of bytes of data from the peak envelope data stream of this PCM descriptor.
Throws:
EndOfDataException - Attempt to read beyond the end of the peak envelope data.
PropertyNotPresentException - The optional peak envelope data property is not present in this PCM descriptor.

writePeakEnvelopeData

public int writePeakEnvelopeData(byte[] bytes)
                          throws PropertyNotPresentException,
                                 ContainerWriteException
Description copied from interface: PCMDescriptor

Write the given bytes to the peak envelope data stream of the PCM descriptor at the current position, as determined by calling PCMDescriptor.getPeakEnvelopeDataPosition().

Specified by:
writePeakEnvelopeData in interface PCMDescriptor
Parameters:
bytes - Data to write to the peak envelope data stream of this PCM descriptor.
Returns:
Number of bytes written.
Throws:
PropertyNotPresentException - The optional peak envelope data property is not present in this PCM descriptor and so cannot be written to.
ContainerWriteException - Writing to the container failed.

equals

public boolean equals(Object o)
Description copied from interface: MAJCommon

Tests to see if the given object is equal to this interchange object. To be equal, the given value must be not null, share the same interface to its value and each of the properties of the value must each be equal.

Specified by:
equals in interface MAJCommon
Overrides:
equals in class SoundDescriptor
Parameters:
o - Object to test for equality with.
Returns:
Is the given object equals to this value?
See Also:
Object.equals(Object)

hashCode

public int hashCode()
Description copied from interface: MAJCommon

Returns a hash code value for this interchange object.

Specified by:
hashCode in interface MAJCommon
Overrides:
hashCode in class SoundDescriptor
Returns:
Hash code value for this interchange object.
See Also:
Object.hashCode()

clone

public PCMDescriptor clone()
Description copied from interface: MAJCommon

Creates a cloned copy of this entity. The clone will be initialized to have the same value as this value but exists independently from then on. Changes to this value will not effect the clone and changes to the clone will not effect this. MAJ API clones are true deep clones with no shared references to areas of memory within the original.

This method does not throw a CloneNotSupportedException as all entity values must implement the Cloneable interface. If a cloning error does occur, a null value will be returned but this is very unlikely to happen.

Specified by:
clone in interface MAJCommon
Overrides:
clone in class SoundDescriptor
Returns:
Independent clone of this value, which is a deep copy.
See Also:
Object.clone()

appendXMLChildren

public void appendXMLChildren(Node parent)
Description copied from interface: XMLSerializable

Append child elements to the given parent node to serialize the value of an object to an XML fragment. Methods of the XMLBuilder class are provided to help with this process.

Specified by:
appendXMLChildren in interface XMLSerializable
Overrides:
appendXMLChildren in class SoundDescriptor
Parameters:
parent - XML parent element to append child nodes to.

Media Authoring
with Java API

(c) 2007-2008 Richard Cartwright, all rights reserved. Subject to the terms of the AAF SDK Public Source License.