Media Authoring
with Java API

tv.amwa.maj.argument
Class DefaultFade

java.lang.Object
  extended by tv.amwa.maj.argument.DefaultFade
All Implemented Interfaces:
Serializable, Cloneable, DefaultFade

public class DefaultFade
extends Object
implements DefaultFade, Serializable, Cloneable

Implementation of a default fade to be applied to source clips in a composition mob 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 CompositionMob (conditional rule 1).

Author:
Richard Cartwright
See Also:
CompositionMob.getDefaultFade(), Serialized Form

Constructor Summary
DefaultFade()
          Create a default fade value with its parameters initialised to basic values.
DefaultFade(long fadeLength, FadeType fadeType, Rational fadeEditUnit)
          Create a default fade description.
 
Method Summary
 DefaultFade clone()
           
 boolean equals(Object o)
           
 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.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultFade

public DefaultFade(@LengthType
                   long fadeLength,
                   FadeType fadeType,
                   Rational fadeEditUnit)
            throws NullPointerException,
                   BadLengthException

Create a default fade description.

Parameters:
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.
Throws:
NullPointerException - One or both of the given fade type and/or fade edit unit values is null.
BadLengthException - The default fade length is negative.

DefaultFade

public DefaultFade()

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.

Method Detail

getFadeEditUnit

public Rational getFadeEditUnit()
Description copied from interface: DefaultFade

Returns the edit units used to specify the default fade length.

Specified by:
getFadeEditUnit in interface DefaultFade
Returns:
Edit units used to specify the fade length.

setFadeEditUnit

public void setFadeEditUnit(Rational fadeEditUnit)
                     throws NullPointerException
Description copied from interface: DefaultFade

Sets the edit units used to specify the default fade length

Specified by:
setFadeEditUnit in interface DefaultFade
Parameters:
fadeEditUnit - Edit units used to specify the fade length.
Throws:
NullPointerException - The given edit units for the default fade length are null.

getFadeLength

@LengthType
public long getFadeLength()
Description copied from interface: DefaultFade

Returns the length of this default audio fade, measured in this fade's edit units.

Specified by:
getFadeLength in interface DefaultFade
Returns:
Length of the default audio fade.
See Also:
DefaultFade.getFadeEditUnit()

setFadeLength

public void setFadeLength(@LengthType
                          long fadeLength)
                   throws BadLengthException
Description copied from interface: DefaultFade

Sets the length of this default audio fade, measured in this fade's edit unit.

Specified by:
setFadeLength in interface DefaultFade
Parameters:
fadeLength - Length of the default audio fade.
Throws:
BadLengthException - Length of the default fade is negative.
See Also:
DefaultFade.getFadeEditUnit(), DefaultFade.setFadeEditUnit(Rational)

getFadeType

public FadeType getFadeType()
Description copied from interface: DefaultFade

Returns the type of this default audio fade.

Specified by:
getFadeType in interface DefaultFade
Returns:
Type of this default audio fade.

setFadeType

public void setFadeType(FadeType fadeType)
                 throws NullPointerException
Description copied from interface: DefaultFade

Sets the type of this default audio fade.

Specified by:
setFadeType in interface DefaultFade
Parameters:
fadeType - Type of this default audio fade.
Throws:
NullPointerException - The given fade type for the default fade is null.

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()

Creates a pseudo-XML representation of this default fade value. The format is loosely based on the XML element representing a composition mob but is not itself defined by an XML schema or DTD. For example:

 <DefaultFade>
   <DefaultFadeLength>1000</DefaultFadeLength>
   <DefFadeType>FadeLinearAmp</DefFadeType>
   <DefFadeEditUnit>25/1</DefFadeEditUnit>
 </DefaultFade>
 

Overrides:
toString in class Object
Returns:
XML representation of this default fade value.

clone

public DefaultFade clone()
                  throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException

Media Authoring
with Java API

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