public class DefaultFadeImpl extends Object implements DefaultFade, XMLSerializable, Serializable, Cloneable
Implementation of a default fade to be applied to source clips in a composition package that do not specify their own fade properties. The structure consists of the fade length, edit units to which the fade is specified and the fade type.
It is useful to manage default fade properties together as they are either all present or all omitted from a CompositionPackage (conditional rule 1).
| Constructor and Description |
|---|
DefaultFadeImpl()
Create a default fade value with its parameters initialised to basic values.
|
DefaultFadeImpl(long fadeLength,
FadeType fadeType,
Rational fadeEditUnit)
Create a default fade description.
|
| Modifier and Type | Method and Description |
|---|---|
void |
appendXMLChildren(Node parent)
Append extra child elements to the given parent node to serialize the value of an object
to an XML fragment.
|
DefaultFade |
clone()
Create a cloned copy of this default fade value.
|
boolean |
equals(Object o) |
String |
getComment()
Include a comment when serializing a value to XML.
|
Rational |
getFadeEditUnit()
Returns the edit units used to specify the default fade length.
|
long |
getFadeLength()
Returns the length of this default audio fade, measured in this fade's edit units.
|
FadeType |
getFadeType()
Returns the type of this default audio fade.
|
int |
hashCode() |
void |
setFadeEditUnit(Rational fadeEditUnit)
Sets the edit units used to specify the default fade length
|
void |
setFadeLength(long fadeLength)
Sets the length of this default audio fade, measured in this fade's edit unit.
|
void |
setFadeType(FadeType fadeType)
Sets the type of this default audio fade.
|
String |
toString()
Creates a pseudo-XML representation of this default fade value.
|
public DefaultFadeImpl(@LengthType long fadeLength, FadeType fadeType, Rational fadeEditUnit) throws NullPointerException, BadLengthException
Create a default fade description.
fadeLength - Specifies the default length of the audio fade-in and fade-out.fadeType - Specifies the default type of audio fade.fadeEditUnit - Specifies the edit units in which the default fade length is specified.NullPointerException - One or both of the given fade type and/or fade edit unit values
is null.BadLengthException - The default fade length is negative.public DefaultFadeImpl()
Create a default fade value with its parameters initialised to basic values. These
are a fade length of 0, a fade type of FadeType.None
and a fade edit unit of 0/1.
public Rational getFadeEditUnit()
DefaultFadeReturns the edit units used to specify the default fade length.
getFadeEditUnit in interface DefaultFadepublic void setFadeEditUnit(Rational fadeEditUnit) throws NullPointerException
DefaultFadeSets the edit units used to specify the default fade length
setFadeEditUnit in interface DefaultFadefadeEditUnit - Edit units used to specify the fade length.NullPointerException - The given edit units for the default fade length are null.@LengthType public long getFadeLength()
DefaultFadeReturns the length of this default audio fade, measured in this fade's edit units.
getFadeLength in interface DefaultFadeDefaultFade.getFadeEditUnit()public void setFadeLength(@LengthType long fadeLength) throws BadLengthException
DefaultFadeSets the length of this default audio fade, measured in this fade's edit unit.
setFadeLength in interface DefaultFadefadeLength - Length of the default audio fade.BadLengthException - Length of the default fade is negative.DefaultFade.getFadeEditUnit(),
DefaultFade.setFadeEditUnit(Rational)public FadeType getFadeType()
DefaultFadeReturns the type of this default audio fade.
getFadeType in interface DefaultFadepublic void setFadeType(FadeType fadeType) throws NullPointerException
DefaultFadeSets the type of this default audio fade.
setFadeType in interface DefaultFadefadeType - Type of this default audio fade.NullPointerException - The given fade type for the default fade is null.public void appendXMLChildren(Node parent)
XMLSerializableAppend extra 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 XMLSerializableparent - XML parent element to append child nodes to.public String getComment()
XMLSerializableInclude a comment when serializing a value to XML. The comment will be inserted as the first child node of the element representing the class.
getComment in interface XMLSerializablepublic String toString()
Creates a pseudo-XML representation of this default fade value. The format is loosely based on the XML element representing a composition package but is not itself defined by an XML schema or DTD. For example:
<DefaultFade> <DefaultFadeLength>1000</DefaultFadeLength> <DefaultFadeType>FadeLinearAmp</DefFadeType> <DefaultFadeEditUnit>25/1</DefFadeEditUnit> </DefaultFade>
public DefaultFade clone()
DefaultFadeCreate a cloned copy of this default fade value.
clone in interface DefaultFadeclone in class Object(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.