|
Media Authoring with Java API |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttv.amwa.maj.argument.SourceReferenceValue
public class SourceReferenceValue
Implementation of a source reference value that is a reference to an item of source material, defined by a mob id, source slot id and start time. This reference can be used as an argument to methods or as a return value. The class is used to ensure the constraint that if the source id is the zero mob id then the source slot id is 0 and the start time is 0 (SourceClip class specification text) .
The interpretation of a source reference value depends on the context where it is used. The value of a source reference can be explicit or relative to its context. Source references are often used to build a chain of references that can be used to trace the original source of some material.
Three different kinds of reference can be identified from the value of the source id property of a source reference. These are defined as:
originalSource()
static method.inContextReference(int)
or
inContextReference(int, Long)
methods.As this class is used as a convenience argument to the methods of other persistent classes, it has no persistent representation of its own.
SourceClip
,
SourceReferenceSegment
,
MobID
,
Serialized FormConstructor Summary | |
---|---|
SourceReferenceValue(MobID sourceID,
int sourceSlotID,
Long startTime)
Create a new source reference value that contains a source mob id, source slot id and start time. |
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. |
SourceReferenceValue |
clone()
|
boolean |
equals(Object o)
|
MobID |
getSourceID()
Returns the identifier of the mob being referenced. |
int |
getSourceSlotID()
Returns the slot id of a mob slot within the referenced mob. |
long |
getStartTime()
Returns the offset from the origin of the referenced mob's mob slot in edit units determined by the source clip's context. |
int |
hashCode()
|
static SourceReferenceValue |
inContextReference(int sourceSlotID)
Manufactures a new source reference to static material in slot within the same context as the mob in which the reference is specified. |
static SourceReferenceValue |
inContextReference(int sourceSlotID,
Long startTime)
Manufactures a new source reference to timeline- or event-based material in a slot within the same context as the mob in which the reference is specified. |
boolean |
isContextual()
Returns true if this source reference is to another slot within the context
of the same mob or false if it is a reference
to a slot in another mob. |
boolean |
isOriginalSource()
Return true if this source reference is to the original source material and
false if it requires further resolution. |
static SourceReferenceValue |
originalSource()
Manufactures a new source reference that indicates the reference is to essence that is the original source. |
void |
setPropertiesFromInterface(SourceReferenceValue castFrom)
Set the properties of this source reference value using the given object that implements the SourceReferenceValue interface. |
void |
setSourceID(MobID sourceID)
Sets the identity of mob being referenced. |
void |
setSourceSlotID(int sourceSlotID)
Sets the slot id of the referenced mob slot within the referenced mob. |
void |
setStartTime(Long startTime)
Returns the offset from the origin of the referenced mob's mob slot in edit units determined by the source clip's context. |
String |
toString()
Create a pseudo-XML representation of this source reference, similar to that produced for a source clip. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SourceReferenceValue(@MobIDType MobID sourceID, @SlotID int sourceSlotID, @PositionType Long startTime) throws IllegalArgumentException
Create a new source reference value that contains a source mob id, source slot id and start time. If the given source mob id is the null mob, values for source slot id and start time are set to zero to comply with source reference constraints.
sourceID
- Identifies the mob being referenced. If the property is set to
the zero mob id, it means that the mob owning the source reference describes
the original source. If this optional property is omitted by setting its value to null
,
the given mob slot refers to another slot within the same mob.sourceSlotID
- Specifies the slot id of a mob slot within the specified
mob. If the source id is the zero mob id, then the source mob slot id shall have a
0 value.startTime
- Specifies the offset from the origin of the referenced mob's
mob slot in edit units determined by the associated
source clip's context. If the source id
is the zero id, then the start time shall have a 0 value.
Set the value to null
to omit this optional property in the case that the
new reference is to static material.
IllegalArgumentException
- The source slot id cannot be set to a negative value.MobID.isZero()
,
MobID.getZeroMobID()
Method Detail |
---|
public static final SourceReferenceValue originalSource()
Manufactures a new source reference that indicates the reference is to essence that is the original source. The source id will be the zero mob id, the source slot id will be zero and so will the start time.
SourceReferenceValue.isOriginalSource()
,
MobID.isZero()
public static final SourceReferenceValue inContextReference(@SlotID int sourceSlotID) throws IllegalArgumentException
Manufactures a new source reference to static material in slot within the same context
as the mob in which the reference is specified. This method version omits the start
time property - use inContextReference(int, Long)
to set a start
time value for timeline- or event-based material.
sourceSlotID
- Slot to reference within the same mob that this reference is defined in.
IllegalArgumentException
- The given source slot id is a negative value.StaticMobSlot
,
SourceReferenceValue.isContextual()
public static final SourceReferenceValue inContextReference(@SlotID int sourceSlotID, @PositionType Long startTime) throws IllegalArgumentException
Manufactures a new source reference to timeline- or event-based material in
a slot within the same context as the mob in which the reference is specified. Use the
inContextReference(int)
to create a reference to static material.
sourceSlotID
- Slot to reference within the same mob that this reference is defined in.startTime
- Specifies the offset from the origin of the referenced mob mobslot in edit
units determined by the associated source clip object's context.
IllegalArgumentException
- The source slot id cannot be set to a negative value.TimelineMobSlot
,
EventMobSlot
,
SourceReferenceValue.isContextual()
public final void setPropertiesFromInterface(SourceReferenceValue castFrom)
Set the properties of this source reference value using the given object that
implements the SourceReferenceValue
interface.
castFrom
- Object to use to set the values of this object.@MobIDType public MobID getSourceID() throws PropertyNotPresentException
SourceReferenceValue
Returns the identifier of the mob being referenced. If the property is the zero mob id, it means that the mob owning this source reference describes the original source.
getSourceID
in interface SourceReferenceValue
PropertyNotPresentException
- The optional source id property is not present in
this source reference, implying that the reference is to a slot in the same
mob as the reference itself.public void setSourceID(@MobIDType MobID sourceID)
SourceReferenceValue
Sets the identity of mob being referenced. If the property is the
zero mob id, it means that the
mob owning this source reference describes the original source. Set the source id to null
to indicate
that the reference is to a slot in the mob owning this reference.
setSourceID
in interface SourceReferenceValue
sourceID
- Source id component of the source reference.@SlotID public int getSourceSlotID()
SourceReferenceValue
Returns the slot id of a mob slot within the referenced mob. If the source id of this value is the zero mob id then the source mob slot value shall also be set to 0.
getSourceSlotID
in interface SourceReferenceValue
public void setSourceSlotID(@SlotID int sourceSlotID) throws IllegalArgumentException
SourceReferenceValue
Sets the slot id of the referenced mob slot within the referenced mob. If the source id of this value is the zero mob id then the source slot value shall also be set to 0.
setSourceSlotID
in interface SourceReferenceValue
sourceSlotID
- Slot component of source reference, specified by slot id.
IllegalArgumentException
- Trying to set a non-zero value when the source id is the zero mob id or the
slot id is negative.@PositionType public long getStartTime() throws PropertyNotPresentException
SourceReferenceValue
Returns the offset from the origin of the referenced mob's mob slot in edit units determined by the source clip's context. If the source id of this value is the nil mob id, then the start time shall also be set to 0.
getStartTime
in interface SourceReferenceValue
PropertyNotPresentException
- The optional start time property is not present,
indicating that the reference is in the context of a static mob slot
rather than a timeline or
event mob slot.public void setStartTime(@PositionType Long startTime) throws IllegalArgumentException
SourceReferenceValue
Returns the offset from the origin of the referenced mob's mob slot in edit units determined by the source clip's context. If the source id of this value is the null mob id then the start time shall be set to 0.
Set this optional property to null
to omit it, indicating
that this reference is in the context of a static mob slot
rather than a timeline or
event mob slot.
setStartTime
in interface SourceReferenceValue
startTime
- Offset from the origin of the referenced content.
IllegalArgumentException
- Trying to set a non-zero value when the source id is the zero mob id.public boolean isOriginalSource()
SourceReferenceValue
Return true
if this source reference is to the original source material and
false
if it requires further resolution.
isOriginalSource
in interface SourceReferenceValue
SourceReferenceValue.isOriginalSource()
,
originalSource()
public boolean isContextual()
SourceReferenceValue
Returns true
if this source reference is to another slot within the context
of the same mob or false
if it is a reference
to a slot in another mob.
isContextual
in interface SourceReferenceValue
SourceReferenceValue.isContextual()
,
inContextReference(int)
,
inContextReference(int, Long)
public boolean equals(Object o)
equals
in class Object
public String toString()
Create a pseudo-XML representation of this source reference, similar to that produced for a source clip. No XML schema or DTD defines this element. For example, an original source reference would create the following:
<?xml version=\"1.0\" encoding=\"UTF-8\"?> <!--The SourceReferenceValue tag is not valid AAF XML.--> <SourceReferenceValue> <SourceID>urn:x-umid:000000000000000000000000-00-000000-00000000000000000000000000000000</SourceID> <SourceMobSlotID>0</SourceMobSlotID> <StartTime>0</StartTime> </SourceReferenceValue>
toString
in class Object
public int hashCode()
hashCode
in class Object
public SourceReferenceValue clone()
clone
in class Object
public void appendXMLChildren(Node parent)
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.
appendXMLChildren
in interface XMLSerializable
parent
- XML parent element to append child nodes to.
|
Media Authoring with Java API |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |