Media Authoring
with Java API

tv.amwa.maj.entity
Class OperationDefinition

java.lang.Object
  extended by tv.amwa.maj.entity.InterchangeObject
      extended by tv.amwa.maj.entity.DefinitionObject
          extended by tv.amwa.maj.entity.OperationDefinition
All Implemented Interfaces:
Serializable, Cloneable, OperationConstant, DefinitionType, MAJCommon, DefinitionObject, InterchangeObject, OperationDefinition, XMLSerializable

@AAFClass(uuid1=218169601,
          uuid2=257,
          uuid3=7168,
          uuid4={6,14,43,52,2,6,1,1},
          definedName="OperationDefinition",
          description="The OperationDefinition class identifies an operation that is performed on an array of Segments.")
public class OperationDefinition
extends DefinitionObject
implements OperationDefinition, Serializable, OperationConstant, Cloneable, MAJCommon

Implements the definition of an operation that is performed on an array of segments. Operation definitions specify which parameters are possible on an operation, while an operation group specifies specific parameters and input segments for a particular operation invocation.

THE COMMENTS FOR THIS CLASS ARE INCOMPLETE.

Author:
Richard Cartwright
See Also:
Serialized Form

Nested Class Summary
static class OperationDefinition.DegradeToXMLHander
           
static class OperationDefinition.ParametersDefinedXMLHandler
           
static class OperationDefinition.XMLHandler
           
 
Nested classes/interfaces inherited from class tv.amwa.maj.entity.DefinitionObject
DefinitionObject.DefinitionObjectXMLHandler
 
Nested classes/interfaces inherited from class tv.amwa.maj.entity.InterchangeObject
InterchangeObject.InterchangeObjectXMLHandler
 
Field Summary
 
Fields inherited from interface tv.amwa.maj.iface.OperationDefinition
ISTIMEWARP_DEFAULT
 
Fields inherited from interface tv.amwa.maj.constant.OperationConstant
Flip, FlipFlop, Flop, MonoAudioDissolve, MonoAudioGain, MonoAudioMixdown, MonoAudioPan, PictureWithMate, SMPTEVideoWipe, StereoAudioDissolve, StereoAudioGain, TwoParameterMonoAudioDissolve, Unknown, VideoAlphaWithinVideoKey, VideoChromaKey, VideoCornerPinning, VideoCrop, VideoDissolve, VideoFadeToBlack, VideoFrameToMask, VideoLuminanceKey, VideoPosition, VideoRepeat, VideoRotate, VideoScale, VideoSeparateAlphaKey, VideoSpeedControl
 
Constructor Summary
OperationDefinition(AUID identifier, String name, DataDefinition dataDefinition, int numInputs)
          Creates and initializes a new operation definition, which identifies an operation that is performed on an array of segments.
 
Method Summary
 void addParameterDefinition(ParameterDefinition parameterDefinition)
          Add a parameter definition to the unordered collection of parameter definitions of this operation definition, which specify the parameters that can be used as controls for the operation.
 void appendDegradeToOperation(OperationDefinition operationDefinition)
          Append an operation definition tto the degrade-to list of operation definitions of this operation definition, which specify simpler operations that an application can substitute for the defined operation if it cannot process it.
 void appendXMLChildren(Node parent)
          Append child elements to the given parent node to serialize the value of an object to an XML fragment.
 OperationDefinition clone()
          Creates a cloned copy of this entity.
 int countDegradeToOperations()
          Returns the number of degrade-to operations in this operation definition, which specify simpler operations that an application can substitute for the defined operation if it cannot process it.
 int countParameterDefinitions()
          Return the number of parameter definitions of this operation definition, which specify the parameters that can be used as controls for the operation.
static OperationDefinition forIdentification(AUID identification)
           
static OperationDefinition forName(String operationName)
           
 int getBypass()
          This is a 1-based index.
 AUID getCategory()
          Returns an AUID identifying the category of this operation definition, which specifies the kind of operation, such as video effect, audio effect, or 3D operation.
 DataDefinition getDataDefinition()
          Returns the data definition referenced from this operation definition, which identifies the kind of data that is produced by the operation.
 List<OperationDefinition> getDegradeToOperations()
          Returns the list of degrade-to operation definitions of this operation definition, which specify simpler operations that an application can substitute for the defined operation if it cannot process it.
 boolean getIsTimeWarp()
           
 int getNumberInputs()
          Returns the number of input media segments of this operation definition.
 Set<ParameterDefinition> getParameterDefinitions()
          Returns the collection of parameter definitions of this operation definition, which specify the parameters that can be used as controls for the operation.
 void insertDegradeToOperationAt(int index, OperationDefinition operationDefinition)
          Insert an operation definition into the degrade-to list of definitions of this operation definition at the given index.
 boolean isTimeWarp()
          Returns true if the length of an operation group is different from the lengths of the input segments, for example a slow motion effect.
 ParameterDefinition lookupParameterDefinition(AUID parameterDefinition)
          Looks up and returns the parameter definition corresponding to the given identifier from the collection of defined parameters of this operation definition.
 void prependDegradeToOperation(OperationDefinition operationDefinition)
          Prepend an operation definition to the degrade-to list of operation definitions of this operation definition, which specify simpler operations that an application can substitute for the defined operation if it cannot process it.
static boolean registerOperationDefinition(OperationDefinition definedOperation)
           
static int registerOperationsFromClass(Class<?> classWithOperations)
           
 void removeDegradeToOperationAt(int index)
          Removes the indexed operation definition from the degrade-to list of operation definitions of this operation definition, which specify simpler operations that an application can substitute for the defined operation if it cannot process it.
 void setBypass(Integer bypass)
          Sets the bypass media segment index, which specifies the array index (1-based) of the input segment which is the primary input.
 void setCategory(AUID category)
          Sets an AUID identifying the category of this operation definition, which specifies the kind of operation, such as video effect, audio effect, or 3D operation.
 void setDataDefinition(DataDefinition dataDefinition)
          Sets the data definition of this operation definition, which identifies the kind of data that is produced by the operation.
 void setIsTimeWarp(Boolean isTimeWarp)
          Set to true to indicate that the the length of an operation group is different from the lengths of the input segments, for example a slow motion effect.
 void setNumberInputs(int numberInputs)
          Sets the number of input media segments for the operation definition.
 void setPropertiesFromInterface(OperationDefinition castFrom)
           
 
Methods inherited from class tv.amwa.maj.entity.DefinitionObject
equals, getAUID, getDescription, getLocalizedUID, getName, hashCode, setDescription, setLocalizedUID, setName
 
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.DefinitionObject
getAUID, getDescription, getName, setDescription, setName
 
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
equals, hashCode, toString
 

Constructor Detail

OperationDefinition

public OperationDefinition(AUID identifier,
                           @AAFString
                           String name,
                           DataDefinition dataDefinition,
                           int numInputs)
                    throws NullPointerException

Creates and initializes a new operation definition, which identifies an operation that is performed on an array of segments.

Parameters:
identifier - Unique identifier for the operation definition.
name - Display name of the operation definition.
dataDefinition - The kind of data that is produced by the operation.
numInputs - Number of input segments. A value of -1 indicates that the effect can have any number of input segments.
Throws:
NullPointerException - One or more of the arguments is null and they are all required properties.
Method Detail

registerOperationsFromClass

public static final int registerOperationsFromClass(Class<?> classWithOperations)
                                             throws NullPointerException
Throws:
NullPointerException

registerOperationDefinition

public static final boolean registerOperationDefinition(OperationDefinition definedOperation)
                                                 throws NullPointerException
Throws:
NullPointerException

forName

public static final OperationDefinition forName(String operationName)
                                         throws NullPointerException
Throws:
NullPointerException

forIdentification

public static final OperationDefinition forIdentification(AUID identification)
                                                   throws NullPointerException
Throws:
NullPointerException

setPropertiesFromInterface

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

addParameterDefinition

public void addParameterDefinition(ParameterDefinition parameterDefinition)
                            throws NullPointerException,
                                   ObjectAlreadyAttachedException
Description copied from interface: OperationDefinition

Add a parameter definition to the unordered collection of parameter definitions of this operation definition, which specify the parameters that can be used as controls for the operation.

Specified by:
addParameterDefinition in interface OperationDefinition
Parameters:
parameterDefinition - Parameter definition object to add.
Throws:
NullPointerException - The given parameter definition is null.
ObjectAlreadyAttachedException - Parameter definition is already present within this operation definition.
See Also:
OperationGroup.addParameter(Parameter)

appendDegradeToOperation

public void appendDegradeToOperation(OperationDefinition operationDefinition)
                              throws NullPointerException
Description copied from interface: OperationDefinition

Append an operation definition tto the degrade-to list of operation definitions of this operation definition, which specify simpler operations that an application can substitute for the defined operation if it cannot process it. Use this function to add an operation definition to be scanned last when searching for a replacement, to be considered as a less desirable alternate operation.

Specified by:
appendDegradeToOperation in interface OperationDefinition
Parameters:
operationDefinition - Degrade-to operation to append.
Throws:
NullPointerException - The given degrade-to operation definition is null.

countDegradeToOperations

public int countDegradeToOperations()
Description copied from interface: OperationDefinition

Returns the number of degrade-to operations in this operation definition, which specify simpler operations that an application can substitute for the defined operation if it cannot process it.

Specified by:
countDegradeToOperations in interface OperationDefinition
Returns:
Number of degrade-to operations listed in this operation definition.

countParameterDefinitions

public int countParameterDefinitions()
Description copied from interface: OperationDefinition

Return the number of parameter definitions of this operation definition, which specify the parameters that can be used as controls for the operation.

Specified by:
countParameterDefinitions in interface OperationDefinition
Returns:
Number of parameter definitions of this operation definition.

getBypass

@AAFProperty(uuid1=87033093,
             uuid2=0,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,1},
             definedName="Bypass",
             typeName="UInt32",
             optional=true,
             uniqueIdentifier=false,
             pid=7688)
public int getBypass()
              throws PropertyNotPresentException

This is a 1-based index. A value of 0 indicates this optional property is not set.

Specified by:
getBypass in interface OperationDefinition
Returns:
1-based index of the bypass media segment for the operation definition.
Throws:
PropertyNotPresentException - The optional bypass property is not present in this operation definition.
See Also:
OperationDefinition.getBypass()

setBypass

public void setBypass(Integer bypass)
Description copied from interface: OperationDefinition

Sets the bypass media segment index, which specifies the array index (1-based) of the input segment which is the primary input. This value allows the client application to pick one of the inputs (foreground, background, etc.) to stand in for the effect if it is not available, and none of the degrade to effects are available. Set this optional property to null to omit it.

Specified by:
setBypass in interface OperationDefinition
Parameters:
bypass - Index of bypass media segment for the operation definition.

getCategory

@AAFProperty(uuid1=87033098,
             uuid2=0,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,2},
             definedName="OperationCategory",
             typeName="OperationCategoryType",
             optional=true,
             uniqueIdentifier=false,
             pid=7686)
public AUID getCategory()
                 throws PropertyNotPresentException
Description copied from interface: OperationDefinition

Returns an AUID identifying the category of this operation definition, which specifies the kind of operation, such as video effect, audio effect, or 3D operation. This is an optional property.

Specified by:
getCategory in interface OperationDefinition
Returns:
Identifier for the category of the operation definition.
Throws:
PropertyNotPresentException - The optional operation category property is not present for this operation definition.
See Also:
OperationCategoryType, TypeDefinitionExtendibleEnumeration.OperationCategoryType

setCategory

public void setCategory(AUID category)
Description copied from interface: OperationDefinition

Sets an AUID identifying the category of this operation definition, which specifies the kind of operation, such as video effect, audio effect, or 3D operation. Set this optional property to null to omit it.

Specified by:
setCategory in interface OperationDefinition
Parameters:
category - AUID indicating the category of the operation definition.
See Also:
OperationCategoryType, TypeDefinitionExtendibleEnumeration.OperationCategoryType

getDataDefinition

@AAFProperty(uuid1=87033097,
             uuid2=0,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,2},
             definedName="DataDefinition",
             typeName="WeakReference to DataDefinition",
             optional=false,
             uniqueIdentifier=false,
             pid=7681)
public DataDefinition getDataDefinition()
Description copied from interface: OperationDefinition

Returns the data definition referenced from this operation definition, which identifies the kind of data that is produced by the operation.

Specified by:
getDataDefinition in interface OperationDefinition
Returns:
Data definition referenced from this operation definition.

setDataDefinition

public void setDataDefinition(DataDefinition dataDefinition)
                       throws NullPointerException
Description copied from interface: OperationDefinition

Sets the data definition of this operation definition, which identifies the kind of data that is produced by the operation.

Specified by:
setDataDefinition in interface OperationDefinition
Parameters:
dataDefinition - Data definition of the operation.
Throws:
NullPointerException - The given data definition is null.

getDegradeToOperations

@AAFProperty(uuid1=100729092,
             uuid2=1025,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,2},
             definedName="DegradeTo",
             typeName="WeakReferenceVector of OperationDefinition",
             optional=true,
             uniqueIdentifier=false,
             pid=7683)
public List<OperationDefinition> getDegradeToOperations()
Description copied from interface: OperationDefinition

Returns the list of degrade-to operation definitions of this operation definition, which specify simpler operations that an application can substitute for the defined operation if it cannot process it. The definitions are ordered from the most desirable to the least desirable alternative.

Specified by:
getDegradeToOperations in interface OperationDefinition
Returns:
Shallow copy of the list of degrade-to operation definitions of this operation definition.

getNumberInputs

@AAFProperty(uuid1=87033092,
             uuid2=0,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,1},
             definedName="NumberInputs",
             typeName="Int32",
             optional=false,
             uniqueIdentifier=false,
             pid=7687)
public int getNumberInputs()
Description copied from interface: OperationDefinition

Returns the number of input media segments of this operation definition. A value of -1 indicates that the effect can have any number of input segments.

Specified by:
getNumberInputs in interface OperationDefinition
Returns:
Number of input media segments for this operation definition.

setNumberInputs

public void setNumberInputs(int numberInputs)
Description copied from interface: OperationDefinition

Sets the number of input media segments for the operation definition. A value of -1 indicates that the effect can have any number of input segments.

Specified by:
setNumberInputs in interface OperationDefinition
Parameters:
numberInputs - Number of input media segments of this operation definition.

getParameterDefinitions

@AAFProperty(uuid1=100729092,
             uuid2=770,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,2},
             definedName="ParametersDefined",
             typeName="WeakReferenceSet of ParameterDefinition",
             optional=true,
             uniqueIdentifier=false,
             pid=7689)
public Set<ParameterDefinition> getParameterDefinitions()
Description copied from interface: OperationDefinition

Returns the collection of parameter definitions of this operation definition, which specify the parameters that can be used as controls for the operation.

Specified by:
getParameterDefinitions in interface OperationDefinition
Returns:
Shallow copy of the collection of parameter definitions of the operation definition.
See Also:
OperationGroup.addParameter(Parameter)

insertDegradeToOperationAt

public void insertDegradeToOperationAt(int index,
                                       OperationDefinition operationDefinition)
                                throws NullPointerException,
                                       IndexOutOfBoundsException
Description copied from interface: OperationDefinition

Insert an operation definition into the degrade-to list of definitions of this operation definition at the given index. The degrade-to list of operation definitions specify simpler operations that an application can substitute for the defined operation if it cannot process it. Operation definitions already existing at the given and higher indices will be moved up to the next higher index to accommodate.

Specified by:
insertDegradeToOperationAt in interface OperationDefinition
Parameters:
index - 0-based index at which the operation definition is to be inserted.
operationDefinition - Degrade-to operation definition to insert at the specified index.
Throws:
NullPointerException - The given operation definition is null.
IndexOutOfBoundsException - The index is outside the acceptable range for the current degrade-to list.

isTimeWarp

public boolean isTimeWarp()
Description copied from interface: OperationDefinition

Returns true if the length of an operation group is different from the lengths of the input segments, for example a slow motion effect.

If this optional property is not present, its default value of false is returned.

Specified by:
isTimeWarp in interface OperationDefinition
Returns:
Does this operation change the total length of segments in the associated operation group?
See Also:
OperationDefinition.ISTIMEWARP_DEFAULT

getIsTimeWarp

@AAFProperty(uuid1=87033091,
             uuid2=0,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,1},
             definedName="IsTimeWarp",
             typeName="Boolean",
             optional=true,
             uniqueIdentifier=false,
             pid=7682)
public boolean getIsTimeWarp()

setIsTimeWarp

public void setIsTimeWarp(Boolean isTimeWarp)
Description copied from interface: OperationDefinition

Set to true to indicate that the the length of an operation group is different from the lengths of the input segments, for example a slow motion effect.

The default value for this optional property is false. To omit this optional property, call this method with null.

Specified by:
setIsTimeWarp in interface OperationDefinition
Parameters:
isTimeWarp - Does this operation change the total length of segments in the associated operation group?
See Also:
OperationDefinition.ISTIMEWARP_DEFAULT

lookupParameterDefinition

public ParameterDefinition lookupParameterDefinition(AUID parameterDefinition)
                                              throws NullPointerException,
                                                     ObjectNotFoundException
Description copied from interface: OperationDefinition

Looks up and returns the parameter definition corresponding to the given identifier from the collection of defined parameters of this operation definition.

Specified by:
lookupParameterDefinition in interface OperationDefinition
Parameters:
parameterDefinition - Identity of the parameter definition to look up.
Returns:
Matching parameter definition with the given identifier.
Throws:
NullPointerException - The given identifier for a parameter definition is null.
ObjectNotFoundException - The given identifier does not correspond to a parameter definition of this operation definition.

prependDegradeToOperation

public void prependDegradeToOperation(OperationDefinition operationDefinition)
                               throws NullPointerException
Description copied from interface: OperationDefinition

Prepend an operation definition to the degrade-to list of operation definitions of this operation definition, which specify simpler operations that an application can substitute for the defined operation if it cannot process it. Use this function to add an operation definition to be scanned first when searching for a replacement, to be considered as a more desirable alternate operation.

Specified by:
prependDegradeToOperation in interface OperationDefinition
Parameters:
operationDefinition - Degrade-to operation definition to add.
Throws:
NullPointerException - The given degrade-to operation definition is null.

removeDegradeToOperationAt

public void removeDegradeToOperationAt(int index)
                                throws IndexOutOfBoundsException
Description copied from interface: OperationDefinition

Removes the indexed operation definition from the degrade-to list of operation definitions of this operation definition, which specify simpler operations that an application can substitute for the defined operation if it cannot process it. Operation definitions already existing at indices higher than the given index will be moved down to the next lower index to accommodate.

Specified by:
removeDegradeToOperationAt in interface OperationDefinition
Parameters:
index - 0-based index of operation definition to remove from the degrade-to list of this operation definition
Throws:
IndexOutOfBoundsException - The index is outside the range acceptable range for the current degrade-to list.

clone

public OperationDefinition 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 DefinitionObject
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 DefinitionObject
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.