com.aliyun.svideosdk.common

## Interface AliyunIClipManager

- All Known Subinterfaces:
    AliyunIClipConstructor, AliyunIImport, AliyunISourcePartManager

      public interface AliyunIClipManager

  An interface that manages media clips. Allows users to add media clips when importing video files, and update media clips when editing video files.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `addMediaClip(AliyunClip clip)` Adds a media clip.
    `int` | `addMediaClip(int index, AliyunClip clip)` Adds a media clip to an index position.
    `int` | `deleteLastMediaClip()` Deletes the media clip at the end of the list.
    `void` | `deleteMediaClip(AliyunClip clip)` Removes a media clip, such as a video or an image.
    `int` | `deleteMediaClip(int index)` Deletes a media clip at an index position.
    `java.util.List<AliyunClip>` | `getAllClips()` Gets a copy of all media clips in the list.
    `AliyunClip` | `getMediaClip(int index)` Gets a media clip at an index position.
    `int` | `getMediaClipCount()` Gets the number of media clips.
    `void` | `swap(int pos1, int pos2)` Swaps the positions of two media clips.
    `void` | `updateAllClips(java.util.List<AliyunClip> clips)` Replaces all clips in the list.
    `int` | `updateMediaClip(int index, AliyunClip clip)` Replaces a media clip at an index position.

- - ### Method Detail

    - #### addMediaClip

          int addMediaClip(AliyunClip clip)

      Adds a media clip. To add a video clip, use `AliyunVideoClip`. To add an image, use `AliyunImageClip`. Add GIF images as video clips.
      Parameters:
        `clip` -
      Returns:
        The index position of the clip if the invocation is successful or `AliyunErrorCode.ERROR_CLIP_INVALID` if the invocation fails.
      See Also:
        `AliyunVideoClip`, `AliyunImageClip`

    - #### addMediaClip

          int addMediaClip(int index,
                           AliyunClip clip)

      Adds a media clip to an index position. An AliyunClip object and an index are required as input parameters. `AliyunClip` This method creates a clone of this clip and adds this clone to the index position in the list.
      Parameters:
        `index` - The index position.
        `clip` -
      Returns:
        The index position of the clip if the invocation is successful or `AliyunErrorCode.ERROR_CLIP_INVALID` if the invocation fails.

    - #### updateMediaClip

          int updateMediaClip(int index,
                              AliyunClip clip)

      Replaces a media clip at an index position. An AliyunClip object and an index are required as input parameters. `AliyunClip` This method creates a clone of this clip and uses this clone to replace the clip at the index position.
      Parameters:
        `index` -
        `clip` -
      Returns:
        The index position of the clip if the invocation is successful or `AliyunErrorCode.ERROR_CLIP_INVALID` if the invocation fails.

    - #### deleteLastMediaClip

          int deleteLastMediaClip()

      Deletes the media clip at the end of the list.
      Returns:
        0 if the invocation is successful or `AliyunErrorCode.ERROR_NO_CLIP` if there is no clip in the list.

    - #### deleteMediaClip

          int deleteMediaClip(int index)

      Deletes a media clip at an index position.
      Parameters:
        `index` -
      Returns:
        0 if the invocation is successful or `AliyunErrorCode.ERROR_CLIP_INDEX_INVALID` if the invocation fails.

    - #### deleteMediaClip

          void deleteMediaClip(AliyunClip clip)

      Removes a media clip, such as a video or an image.
      Parameters:
        `clip` -

    - #### getMediaClip

          AliyunClip getMediaClip(int index)

      Gets a media clip at an index position.
      Parameters:
        `index` -
      Returns:
        A copy of the clip at the index position if the invocation is successful or null if the invocation fails.

    - #### getMediaClipCount

          int getMediaClipCount()

      Gets the number of media clips.
      Returns:
        The total number of clips in the list.

    - #### getAllClips

          java.util.List<AliyunClip> getAllClips()

      Gets a copy of all media clips in the list.
      Returns:
        A list that contains all media clips.

    - #### updateAllClips

          void updateAllClips(java.util.List<AliyunClip> clips)

      Replaces all clips in the list. A list of media clips is required as the input parameter. This method creates a copy of this list and uses the copy to replace all clips in the existing list.

    - #### swap

          void swap(int pos1,
                    int pos2)

      Swaps the positions of two media clips. Two index positions are required as input parameters.
      Parameters:
        `pos1` -
        `pos2` -