JD2022-TU1/main/tools/services/JD.Adobe.Service/API/IAfterEffectsService.cs

302 lines
No EOL
16 KiB
C#

using System.Collections.Generic;
using System.Threading.Tasks;
using Shuttle.Api.AfterEffectsDTO;
using Shuttle.Api.AfterEffectsDTO.Items;
using Shuttle.Api.AfterEffectsDTO.Render;
using Shuttle.Api.AfterEffectsDTO.UpdatedData;
using Shuttle.Servers;
namespace JD.Adobe.Service.API
{
public interface IAfterEffectsService : IAdobeService
{
/// <summary>
/// Purge the AfterEffects cache (same as Edit > Purge > All memory & Disk Cache)
/// </summary>
Task PurgeCache(TargetAppInfo target);
/// <summary>
/// Saves the project. The same as the File > Save. If the project has never previously been saved and no file is specified,
/// prompts the user for a location and file name.
/// </summary>
Task Save(TargetAppInfo target);
/// <summary>
/// Saves the project. The same as the File > Save As command. Save a project to a new file without prompting.
/// </summary>
/// <param name="target">The Adobe application target.</param>
/// <param name="filePath">An ExtendScript File object for the file to save.</param>
Task SaveAs(TargetAppInfo target, string filePath);
/// <summary>
/// Opens the given project file.
/// </summary>
Task OpenProject(TargetAppInfo target, string projectFilePath);
/// <summary>
/// Displays (or hides) the Render window.
/// </summary>
Task ShowRenderWindow(TargetAppInfo target, bool show);
/// <summary>
/// Starts an Undo group.
/// </summary>
Task BeginUndoGroup(TargetAppInfo target, string undoGroupName);
/// <summary>
/// Ends an Undo group.
/// </summary>
Task EndUndoGroup(TargetAppInfo target);
// GET
/// <summary>
/// Returns the name of the file currently opened. It will be an empty string if the project is not saved yet.
/// </summary>
Task<string> GetCurrentProjectFilePath(TargetAppInfo target);
/// <summary>
/// Returns all items in the current project.
/// </summary>
Task<ICollection<Item>> GetItems(TargetAppInfo target);
/// <summary>
/// Returns the selected items in the current project panel.
/// </summary>
Task<ICollection<Item>> GetSelectedItems(TargetAppInfo target);
/// <summary>
/// Returns the content of the render queue.
/// </summary>
Task<RenderQueue> GetRenderQueue(TargetAppInfo target);
/// <summary>
/// Get a render queue item at a specific index
/// </summary>
Task<RenderQueueItem> GetRenderQueueItem(TargetAppInfo target, int index);
/// <summary>
/// Returns a full <see cref="FolderItem"/> corresponding to the given folder identifier.
/// </summary>
Task<FolderItem> GetFolderItem(TargetAppInfo target, int folderId);
/// <summary>
/// Returns a full <see cref="CompItem"/> corresponding to the given composition identifier.
/// </summary>
Task<CompItem> GetCompItem(TargetAppInfo target, int compositionId);
/// <summary>
/// Returns a full <see cref="FootageItem"/> corresponding to the given footage identifier.
/// </summary>
Task<FootageItem> GetFootageItem(TargetAppInfo target, int footageId);
// CREATE
/// <summary>
/// Creates a new folder and returns it.
/// </summary>
/// <param name="target">The target</param>
/// <param name="name">The name of the folder to create.</param>
Task<FolderItem> AddFolder(TargetAppInfo target, string name);
/// <summary>
/// Creates a new folder under the given folder id and returns it.
/// </summary>
/// <param name="target">The Adobe application target.</param>
/// <param name="name">The name of the folder to create.</param>
/// <param name="parentFolderId">Id of the parent.</param>
Task<FolderItem> AddFolder(TargetAppInfo target, string name, int parentFolderId);
/// <summary>
/// Creates a new composition and returns it.
/// </summary>
/// <param name="target">The Adobe application target.</param>
/// <param name="name">A string containing the name of the composition</param>
/// <param name="width">The width of the composition in pixels, an integer in the range [4..30000]</param>
/// <param name="height">The height of the composition in pixels, an integer in the range [4..30000]</param>
/// <param name="pixelAspect">The pixel aspect ratio of the composition, a floating-point value in the range [0.01..100.0]</param>
/// <param name="duration">The duration of the composition in seconds, a floating-point value in the range [0.0..10800.0]</param>
/// <param name="frameRate">The frame rate of the composition, a floating-point value in the range [1.0..99.0]</param>
Task<CompItem> AddComp(TargetAppInfo target, string name, int width, int height, float pixelAspect, float duration, float frameRate);
/// <summary>
/// Creates a new composition under the given folder id and returns it.
/// </summary>
/// <param name="target">The Adobe application target.</param>
/// <param name="name">A string containing the name of the composition</param>
/// <param name="width">The width of the composition in pixels, an integer in the range [4..30000]</param>
/// <param name="height">The height of the composition in pixels, an integer in the range [4..30000]</param>
/// <param name="pixelAspect">The pixel aspect ratio of the composition, a floating-point value in the range [0.01..100.0]</param>
/// <param name="duration">The duration of the composition in seconds, a floating-point value in the range [0.0..10800.0]</param>
/// <param name="frameRate">The frame rate of the composition, a floating-point value in the range [1.0..99.0]</param>
/// <param name="parentFolderId">Id of the parent.</param>
Task<CompItem> AddComp(TargetAppInfo target, string name, int width, int height, float pixelAspect, float duration, float frameRate, int parentFolderId);
/// <summary>
/// Imports the given file. Creates and returns a new FootageItem from the file.
/// </summary>
/// <param name="target">The Adobe application target.</param>
/// <param name="footageFilePath">Path to the footage file to import.</param>
Task<Item> ImportFile(TargetAppInfo target, string footageFilePath);
/// <summary>
/// Imports the given file under the given folder id. Creates and returns a new Item from the file. Item can be a FootageItem or a FolderItem.
/// </summary>
/// <param name="target">The Adobe application target.</param>
/// <param name="footageFilePath">Path to the footage file to import.</param>
/// <param name="parentFolderId">Id of the parent.</param>
Task<Item> ImportFile(TargetAppInfo target, string footageFilePath, int parentFolderId);
/// <summary>
/// Add the given composition to the RenderQueue.
/// </summary>
/// <param name="target">The Adobe application target.</param>
/// <param name="compId">The id of the composition to add.</param>
/// <returns></returns>
Task<RenderQueueItem> AddToRenderQueue(TargetAppInfo target, int compId);
/// <summary>
/// Add a null layer to the given composition.
/// </summary>
/// <param name="target">The Adobe application target.</param>
/// <param name="compId">The id of the comp.</param>
/// <param name="layerName">The name of the layer to create.</param>
/// <returns></returns>
Task<Layer> AddNullLayer(TargetAppInfo target, int compId, string layerName);
/// <summary>
/// Add the given item as a new layer to the given composition.
/// </summary>
/// <param name="target">The Adobe application target.</param>
/// <param name="compId">The id of the comp.</param>
/// <param name="sourceItemId">The id of the item to add to the comp.</param>
/// <returns></returns>
Task<Layer> AddLayer(TargetAppInfo target, int compId, int sourceItemId);
// UPDATE
/// <summary>
/// Updates the <see cref="FolderItem"/> corresponding to the given id with the given data.
/// </summary>
/// <param name="target">The Adobe application target.</param>
/// <param name="folderItemId">Id of the <see cref="FolderItem"/> to update.</param>
/// <param name="folderItemData">Updated data (id will be ignored).</param>
/// <returns>The updated <see cref="FolderItem"/>.</returns>
Task<FolderItem> UpdateFolderItem(TargetAppInfo target, int folderItemId, FolderItemUpdatableData folderItemData);
/// <summary>
/// Updates the <see cref="CompItem"/> corresponding to the given id with the given data.
/// </summary>
/// <param name="target">The Adobe application target.</param>
/// <param name="compItemId">Id of the <see cref="CompItem"/> to update.</param>
/// <param name="compItemData">Updated data (id will be ignored).</param>
/// <returns>The updated <see cref="CompItem"/>.</returns>
Task<CompItem> UpdateCompItem(TargetAppInfo target, int compItemId, CompItemUpdatableData compItemData);
/// <summary>
/// Copy all the layers from the source comp to the target comp.
/// </summary>
Task<CompItem> CopyLayers(TargetAppInfo target, int sourceCompId, int targetCompId);
/// <summary>
/// Remove all layers with the given names from the given comp.
/// </summary>
/// <param name="target">The Adobe application target.</param>
/// <param name="compId">Id of the comp.</param>
/// <param name="layerNames">Collection of layer names to remove from the comp.</param>
/// <returns></returns>
Task<CompItem> RemoveLayers(TargetAppInfo target, int compId, ICollection<string> layerNames);
/// <summary>
/// Updates the <see cref="FootageItem"/> corresponding to the given id with the given data.
/// </summary>
/// <param name="target">The Adobe application target.</param>
/// <param name="footageItemId">Id of the <see cref="FootageItem"/> to update.</param>
/// <param name="footageItemData">Updated data (id will be ignored).</param>
/// <returns>The updated <see cref="FootageItem"/>.</returns>
Task<FootageItem> UpdateFootageItem(TargetAppInfo target, int footageItemId, FootageItemUpdatableData footageItemData);
/// <summary>
/// Changes the source of the given FootageItem to the specified file. In addition to loading the file, the method creates a new FileSource object
/// for the file and sets mainSource to that object. In the new source object, it sets the name, width, height, frameDuration, and duration attributes
/// (see AVItem object) based on the contents of the file. The method preserves interpretation parameters from the previous mainSource object.
/// If the specified file has an unlabeled alpha channel, the method estimates the alpha interpretation.
/// </summary>
Task<FootageItem> ReplaceFootageSource(TargetAppInfo target, int footageId, string sourceFilePath);
/// <summary>
/// Changes the source of the given FootageItem to the given image sequence (identified by the first file in the sequence to be used as the footage main source). In addition to loading the file, the method creates a new FileSource object for
/// the file and sets mainSource to that object. In the new source object, it sets the name, width, height, frameDuration, and duration attributes (see AVItem object)
/// based on the contents of the file. The method preserves interpretation parameters from the previous mainSource object. If the specified file has an unlabeled alpha channel,
/// the method estimates the alpha interpretation.
/// </summary>
Task<FootageItem> ReplaceFootageSourceWithSequence(TargetAppInfo target, int footageId, string firstSourceFilePath, bool forceAlphabetical);
/// <summary>
/// Updates the <see cref="RenderQueueItem"/> corresponding to the given id with the given data.
/// </summary>
/// <param name="target">The Adobe application target.</param>
/// <param name="renderQueueItemId">Id of the <see cref="RenderQueueItem"/> to update.</param>
/// <param name="renderQueueItem">Updated data (id will be ignored).</param>
/// <returns>The updated <see cref="FootageItem"/>.</returns>
Task<RenderQueueItem> UpdateRenderQueueItem(TargetAppInfo target, int renderQueueItemId, RenderQueueItem renderQueueItem);
/// <summary>
/// Configure the <see cref="RenderQueueItem"/> at the given index of the Render Queue.
/// </summary>
/// <param name="target">The Adobe application target.</param>
/// <param name="renderQueueItemIndex">Index of the item in the Render Queue (first item is at index 1).</param>
/// <param name="settingsTemplateName">Name of the template of Render Settings to apply.</param>
/// <param name="outputModuleTemplateName">Name of the template of Output Module to apply (only 1 output module is currently supported).</param>
/// <param name="outputFilePath">Path to the output file of the render.</param>
/// <returns></returns>
Task<RenderQueueItem> ConfigureRenderQueueItem(TargetAppInfo target, int renderQueueItemIndex, string settingsTemplateName, string outputModuleTemplateName, string outputFilePath);
/// <summary>
/// Update the layer in the given comp with the given data.
/// </summary>
/// <param name="target">The Adobe application target.</param>
/// <param name="compId">The id of the comp.</param>
/// <param name="layerIndex">The index of the layer (starts at 0).</param>
/// <param name="layerData">The updated data.</param>
/// <returns></returns>
Task<Layer> UpdateLayer(TargetAppInfo target, int compId, int layerIndex, LayerUpdatableData layerData);
/// <summary>
/// Put the given item at the root of the project.
/// </summary>
/// <param name="target">The Adobe application target.</param>
/// <param name="itemId">Id of the item.</param>
Task<Item> SetParentFolderToRoot(TargetAppInfo target, int itemId);
/// <summary>
/// Put the given item into the given folder.
/// </summary>
/// <param name="target">The Adobe application target.</param>
/// <param name="itemId">Id of the item.</param>
/// <param name="parentFolderId">Id of the folder to put the item into.</param>
Task<Item> SetParentFolder(TargetAppInfo target, int itemId, int parentFolderId);
/// <summary>
/// Rename the given item.
/// </summary>
/// <param name="target">The Adobe application target.</param>
/// <param name="itemId">Id of the item.</param>
/// <param name="newName">New name of the item.</param>
/// <returns></returns>
Task<Item> RenameItem(TargetAppInfo target, int itemId, string newName);
// DELETE
/// <summary>
/// Deletes this item from the project and from the Project panel. If the item is a FolderItem, all the items contained in the folder are also removed from the project. No files or folders are removed from disk
/// </summary>
/// <param name="target">The Adobe application target.</param>
/// <param name="itemId"></param>
Task RemoveItem(TargetAppInfo target, int itemId);
}
}