using System; namespace ADOFAIRenderer.API { /// /// Represents the result and metadata of a completed or cancelled render session. /// public class RenderResult { /// /// Indicates whether the rendering session completed successfully. /// public bool Success { get; } /// /// The absolute output path of the rendered video file. Empty string if rendering failed or output was not created. /// public string OutputPath { get; } /// /// Total number of video frames sent to the encoder. /// public long TotalFrames { get; } /// /// The calculated video duration in seconds (based on TotalFrames and FPS). /// public double VideoDuration { get; } /// /// Total wall-clock time spent rendering. /// public TimeSpan RenderDuration { get; } /// /// File size of the output video in bytes (0 if failed or file does not exist). /// public long FileSizeBytes { get; } /// /// Error message or reason if rendering failed or was cancelled; null on success. /// public string? ErrorMessage { get; } public RenderResult( bool success, string outputPath, long totalFrames, double videoDuration, TimeSpan renderDuration, long fileSizeBytes = 0, string? errorMessage = null) { Success = success; OutputPath = outputPath; TotalFrames = totalFrames; VideoDuration = videoDuration; RenderDuration = renderDuration; FileSizeBytes = fileSizeBytes; ErrorMessage = errorMessage; } public override string ToString() { return Success ? $"[RenderResult: Success, Output={OutputPath}, Frames={TotalFrames}, VideoDuration={VideoDuration:F2}s, Time={RenderDuration.TotalSeconds:F1}s, Size={FileSizeBytes / 1024.0 / 1024.0:F2}MB]" : $"[RenderResult: Failed/Cancelled, Error={ErrorMessage ?? "Unknown"}]"; } } }