com.aliyun.svideosdk.common.struct.effect

## Class ActionBase

- java.lang.Object
- - com.aliyun.svideosdk.common.struct.effect.ActionBase

- Direct Known Subclasses:
    ActionSet, ActionShader, ActionWipe

      public abstract class ActionBase
      extends java.lang.Object

  A class that defines common animations such as rotation, translation, and transparency control. You can perform animations on any materials.
  See Also:
    `ActionFade`, `ActionRotate`, `ActionRotateBy`, `ActionRotateTo`, `ActionScale`, `ActionTranslate`, `ActionWipe`, `ActionSet`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ActionBase.Interpolator` Added in v3.25.0 Interpolator
    `static class` | `ActionBase.PartParam` Added in v3.25.0 The animation param of child node.
    `static class` | `ActionBase.RepeatMode`
    `static class` | `ActionBase.Scope`
    `static class` | `ActionBase.Type`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.lang.String` | `mAnimationConfig` The animation configuration.
    `protected java.lang.Long` | `mDuration` The animation duration on the playback timeline.
    `protected int` | `mFillAfter` Indicates whether the animation transformation should be applied after the animation ends.
    `protected int` | `mFillBefore` If fillBefore is true, this animation will apply its transformation before the start time of the animation.
    `protected int` | `mId` The animation id.
    `protected int` | `mInterpolatorType` Interceptor Type.
    `protected boolean` | `mIsStream` Whether to perform animation on the source stream.
    `protected ActionBase.PartParam` | `mPartParam` Added in v3.25.0
    `protected int` | `mRepeatCount`
    `protected int` | `mRepeatMode`
    `protected int` | `mScope` Added in v3.25.0
    `protected float` | `mStartOffset` The delay in seconds after which the animation must start.
    `protected int` | `mTargetId` The id of the object on which this animation is performed.
    `protected float` | `mTimelineIn` The time when this action appears.
    `protected float` | `mTimelineOut` The time when this action disappears.
    `protected ActionBase.Type` | `mType` The animation type.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ActionBase()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object obj)`
    `java.lang.String` | `getAnimationConfig()` Gets the animation configuration.
    `long` | `getDuration()` Gets the animation duration.
    `long` | `getDuration(java.util.concurrent.TimeUnit timeUnit)` Gets the animation duration.
    `int` | `getId()` Gets the id, unique resource identifier, of this animation.
    `java.lang.String` | `getResId()` Gets the id of a resource.
    `long` | `getStartTime()` Gets the animation start time.
    `long` | `getStartTime(java.util.concurrent.TimeUnit timeUnit)` Gets the animation start time.
    `int` | `getTargetId()` Gets the id of the object on which this animation is performed.
    `float` | `getTimelineIn()` Gets the time when this animation appears.
    `float` | `getTimelineOut()` Gets the time when this animation disappears.
    `ActionBase.Type` | `getType()` Gets the animation type.
    `boolean` | `isStream()` Returns whether this animation is performed on a source stream.
    `void` | `setAnimationConfig(java.lang.String animationConfig)` Deprecated.
    `void` | `setDuration(long durationUs)` Sets the animation duration.
    `void` | `setDuration(long duration, java.util.concurrent.TimeUnit timeUnit)` Sets the animation duration.
    `void` | `setFillAfter(boolean aFillAfter)` Added in v3.25.0 Indicates whether the animation transformation should be applied after the animation ends.
    `void` | `setFillBefore(boolean aFillBefore)` Added in v3.25.0 If fillBefore is true, this animation will apply its transformation before the start time of the animation.
    `void` | `setId(int id)` Sets the id of this animation.
    `void` | `setInterpolatorType(ActionBase.Interpolator aInterpolator)` Added in v3.25.0 Set Interceptor Type.
    `void` | `setIsStream(boolean isStream)` Defines whether this animation is performed on a source stream.
    `void` | `setPartParam(ActionBase.PartParam aPartParam)` Added in v3.25.0 set the part node param of animation when the scope is `ActionBase.Scope.Part`
    `void` | `setRepeatCount(int aRepeatCount)` Added in v3.25.0
    `void` | `setRepeatMode(ActionBase.RepeatMode aRepeatMode)` Added in v3.25.0 the repeat mode
    `void` | `setResId(java.lang.String id)` Set the id of action resource.
    `void` | `setScope(ActionBase.Scope aScope)` Added in v3.25.0
    `void` | `setStartOffset(long aStartOffset)` Added in v3.25.0 Set the animation delay time in milliseconds.
    `void` | `setStartTime(long startTimeUs)` Sets the animation start time.
    `void` | `setStartTime(long startTime, java.util.concurrent.TimeUnit timeUnit)` Sets the animation start time.
    `void` | `setTargetId(int id)` Sets the id of the object on which this animation is performed.
    `void` | `setTimelineIn(float timelineIn)` Sets the time when this animation appears.
    `void` | `setTimelineOut(float timelineOut)` Sets the time when this animation disappears.
    `protected void` | `setType(ActionBase.Type type)` Sets the animation type.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### mTargetId

          protected transient int mTargetId

      The id of the object on which this animation is performed.

    - #### mType

          protected ActionBase.Type mType

      The animation type.

    - #### mTimelineIn

          protected float mTimelineIn

      The time when this action appears. Unit: second. Accurate to 4 decimal places.

    - #### mTimelineOut

          protected float mTimelineOut

      The time when this action disappears. Unit: second. Accurate to 4 decimal places.

    - #### mScope

          protected int mScope

      Added in v3.25.0

           The animation scope.
           0 ： Whole
           1 : Part
           the default value is 0

    - #### mPartParam

          protected ActionBase.PartParam mPartParam

      Added in v3.25.0

           The param when the scope is part

    - #### mDuration

          protected transient java.lang.Long mDuration

      The animation duration on the playback timeline.

    - #### mStartOffset

          protected float mStartOffset

      The delay in seconds after which the animation must start. When the start offset is > 0, the start time of the action is timelineIn + startOffset.

    - #### mIsStream

          protected transient boolean mIsStream

      Whether to perform animation on the source stream.

    - #### mId

          protected transient int mId

      The animation id.

    - #### mFillBefore

          protected int mFillBefore

      If fillBefore is true, this animation will apply its transformation before the start time of the animation.

    - #### mFillAfter

          protected int mFillAfter

      Indicates whether the animation transformation should be applied after the animation ends.

    - #### mRepeatCount

          protected int mRepeatCount

    - #### mRepeatMode

          protected int mRepeatMode

    - #### mAnimationConfig

          protected java.lang.String mAnimationConfig

      The animation configuration.

    - #### mInterpolatorType

          protected int mInterpolatorType

      Interceptor Type. See `ActionBase.Interpolator` for more detail

  - ### Constructor Detail

    - #### ActionBase

          public ActionBase()

  - ### Method Detail

    - #### getAnimationConfig

          public java.lang.String getAnimationConfig()

      Gets the animation configuration.
      Returns:
        the animation configuration

    - #### setAnimationConfig

          @Deprecated
          public void setAnimationConfig(java.lang.String animationConfig)

      Deprecated.

           Defines custom animations with the specified animation configuration. Allows you to create custom animations at random points in time
           to achieve different transition speeds. The animation configuration must be a string representation of semicolon-separated key-value pairs.
           The key indicates the point in time and the value can hold one or two values depending on the animation type. One value is needed for
           animations such as rotation while two comma-separated values are needed for animations such as transition and scaling. Separate the key
           and value in a key-value pair with a colon.

           Examples:
           rotation: "0.0:0.123;0.1:0.245;0.3:0.798"
           translation: "0.0:0.234,1.47;0.1:2.3,4.565;0.2:3.45,6.78"

      Parameters:
        `animationConfig` - The animation configuration.

    - #### getType

          public ActionBase.Type getType()

      Gets the animation type.
      Returns:
        The animation type.

    - #### setType

          protected void setType(ActionBase.Type type)

      Sets the animation type.
      Parameters:
        `type` - The animation type.

    - #### getStartTime

          public long getStartTime()

      Gets the animation start time.
      Returns:
        The start time in microseconds.

    - #### getStartTime

          public long getStartTime(java.util.concurrent.TimeUnit timeUnit)

      Gets the animation start time.

      Added in v3.27.0

      Returns:
        The start time

    - #### setStartTime

          public void setStartTime(long startTimeUs)

      Sets the animation start time.
      Parameters:
        `startTimeUs` - The start time in microseconds.

    - #### setStartTime

          public void setStartTime(long startTime,
                                   java.util.concurrent.TimeUnit timeUnit)

      Sets the animation start time.

      Added in v3.27.0

      Parameters:
        `startTime` -
        `timeUnit` - Time Unit

    - #### getDuration

          public long getDuration()

      Gets the animation duration.
      Returns:
        The duration in microseconds.

    - #### getDuration

          public long getDuration(java.util.concurrent.TimeUnit timeUnit)

      Gets the animation duration.

      Added in v3.27.0

      Parameters:
        `timeUnit` - Time Unit
      Returns:
        The duration

    - #### setDuration

          public void setDuration(long durationUs)

      Sets the animation duration.
      Parameters:
        `durationUs` - The duration in microseconds.

    - #### setDuration

          public void setDuration(long duration,
                                  java.util.concurrent.TimeUnit timeUnit)

      Sets the animation duration.

      Added in v3.27.0

      Parameters:
        `duration` - The duration.
        `timeUnit` - Time Unit

    - #### isStream

          public boolean isStream()

      Returns whether this animation is performed on a source stream.
      Returns:
        boolean

    - #### setIsStream

          public void setIsStream(boolean isStream)

      Defines whether this animation is performed on a source stream. This method must be invoked in order to perform this animation on a source stream.
      Parameters:
        `isStream` - Whether this animation is performed on a source stream.

    - #### getTargetId

          public int getTargetId()

      Gets the id of the object on which this animation is performed.
      Returns:
        The id of the object on which this animation is performed.

    - #### setTargetId

          public void setTargetId(int id)

           Sets the id of the object on which this animation is performed. The object can be a stream or a material, such as a GIF image or a subtitle line.
           To perform this animation on a source stream during a specific time period, the source stream id is required. Use AliyunIClipManager.getAllClips()}
           to get the list of source streams, and find the specific AliyunClip. Use AliyunClip.getId()
           to get the stream id. If the object is a material, such as a GIF image or JPG image, use EffectBase.getViewId() to get the material id.
           To perform this animation on a source stream, setIsStream(boolean) must be set to true.

      Parameters:
        `id` - The id of the object on which this animation is performed.

    - #### getId

          public int getId()

      Gets the id, unique resource identifier, of this animation.
      Returns:
        The id of this animation.

    - #### setId

          public void setId(int id)

      Sets the id of this animation. This method is automatically invoked.
      Parameters:
        `id` - The id of this animation.

    - #### getResId

          public java.lang.String getResId()

      Gets the id of a resource.
      Returns:
        The resource id.

    - #### setResId

          public void setResId(java.lang.String id)

      Set the id of action resource.

    - #### setScope

          public void setScope(ActionBase.Scope aScope)

      Added in v3.25.0

           The animation scope.
           ActionBase.Scope.Overall ：Overall
           ActionBase.Scope.Part : Part - Currently only works with caption, where animations are applied to individual text
           the default value isActionBase.Scope.Overall

    - #### setPartParam

          public void setPartParam(ActionBase.PartParam aPartParam)

      Added in v3.25.0 set the part node param of animation when the scope is `ActionBase.Scope.Part`

    - #### setFillBefore

          public void setFillBefore(boolean aFillBefore)

      Added in v3.25.0 If fillBefore is true, this animation will apply its transformation before the start time of the animation.
      Parameters:
        `aFillBefore` -

    - #### setFillAfter

          public void setFillAfter(boolean aFillAfter)

      Added in v3.25.0 Indicates whether the animation transformation should be applied after the animation ends.
      Parameters:
        `aFillAfter` -

    - #### setRepeatCount

          public void setRepeatCount(int aRepeatCount)

      Added in v3.25.0

           Sets the max repeat times of animation when repeatMode is not NONE。 If the repeat
           count is 0, the animation will repeat indefinitely.

      Parameters:
        `repeatCount` - the max repeat times of animation

    - #### setRepeatMode

          public void setRepeatMode(ActionBase.RepeatMode aRepeatMode)

      Added in v3.25.0 the repeat mode
      Parameters:
        `aRepeatMode` -

    - #### getTimelineIn

          public float getTimelineIn()

      Gets the time when this animation appears.
      Returns:
        Unit: second.

    - #### setTimelineIn

          public void setTimelineIn(float timelineIn)

      Sets the time when this animation appears.
      Parameters:
        `timelineIn` - Unit: second.

    - #### getTimelineOut

          public float getTimelineOut()

      Gets the time when this animation disappears.
      Returns:
        Unit: second.

    - #### setTimelineOut

          public void setTimelineOut(float timelineOut)

      Sets the time when this animation disappears.
      Parameters:
        `timelineOut` - Unit: second.

    - #### setInterpolatorType

          public void setInterpolatorType(ActionBase.Interpolator aInterpolator)

      Added in v3.25.0 Set Interceptor Type. See `ActionBase.Interpolator` for more detail
      Parameters:
        `aInterpolator` - Interpolator

    - #### setStartOffset

          public void setStartOffset(long aStartOffset)

      Added in v3.25.0 Set the animation delay time in milliseconds. start offset is > 0, the start time of the action is timelineIn + startOffset.
      Parameters:
        `aStartOffset` -

    - #### equals

          public boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`