Class SXEffect

    • Constructor Detail

      • SXEffect

        public SXEffect​(long nativeEffect,
                        long nativeManager,
                        java.lang.String trackID)
    • Method Detail

      • getEffectId

        public java.lang.String getEffectId()
        获取特效 Id
        Returns:
        特效 id
      • getStartTime

        public double getStartTime()
        获取特效开始时间

        不同时间跟随方式start time的参照时间是不一样的,跟随方式祥见 SXEffectTimeFollowType 类型说明

        Returns:
      • setStartTime

        public void setStartTime​(double startTime)
        设置开始时间

        不同时间跟随方式start time的参照时间是不一样的,跟随方式祥见 SXEffectTimeFollowType 类型说明

        Parameters:
        startTime -
      • getDuration

        public double getDuration()
        效果的持续时长,时间跟随方式为 FollowWholeProcess 时无效
        Returns:
        时长,单位为秒
      • setSpeed

        public void setSpeed​(float speed)
        设置特效倍速,默认为1倍速

        1. 仅扩展方式为 SXEffectTimeExtendType.StretchAndLoop 时有效

        Parameters:
        speed - 倍速
      • getSpeed

        public float getSpeed()
        获取特效倍速
        Returns:
        特效倍速
      • getDurationOfOneCycle

        public double getDurationOfOneCycle()
        获取一次循环的时长,时长由倍速转化,因此未设置动画资源时返回值为0

        1. 仅扩展方式为kStretchAndLoop时有效

        Returns:
        一次循环的时长
      • setDurationOfOneCycle

        public void setDurationOfOneCycle​(double duration)
        设置一次循环的时长,时长会转化为倍速,因此未设置动画资源时此设置无效

        1. 仅扩展方式为kStretchAndLoop时有效

        Parameters:
        duration - 一次循环的时长
      • getEffectFollowType

        public SXEffectTimeFollowType getEffectFollowType()
        获取效果跟随轨道时间方式

        1. 例如跟随轨道开始时间与轨道一同开始、跟随轨道的结束时间与轨道一同结束等, 默认跟随方式为 SXEffectTimeFollowType.FollowDisplayTime

        Returns:
        跟随轨道时间方式
      • setEffectExtendType

        public void setEffectExtendType​(SXEffectTimeExtendType type)
        设置效果在显示时间区间内的扩展方式

        1. 扩展方式决定当特效时间超出特效自身的时长时如何扩展 2. 默认扩展方式为 SXEffectTimeExtendType.Stretch

        Parameters:
        type - 扩展类型
      • getExtendType

        public SXEffectTimeExtendType getExtendType()
        获取特效的时间扩展方式
        Returns:
        扩展方式
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • getNativeEffect

        public long getNativeEffect()