SHA256
Suppress Unused Warning in API Classes
This commit is contained in:
1 parent
838b0fccfd
commit
2d88a0d99c
2 files changed
+64
-61
No files matched your search
+62
-61
@@ -1,70 +1,71 @@
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace ADOFAIRenderer.API
|
||||
namespace ADOFAIRenderer.API;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the result and metadata of a completed or cancelled render session.
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "UnusedType.Global")]
|
||||
public class RenderResult
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the result and metadata of a completed or cancelled render session.
|
||||
/// Indicates whether the rendering session completed successfully.
|
||||
/// </summary>
|
||||
public class RenderResult
|
||||
public bool Success { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The absolute output path of the rendered video file. Empty string if rendering failed or output was not created.
|
||||
/// </summary>
|
||||
public string OutputPath { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Total number of video frames sent to the encoder.
|
||||
/// </summary>
|
||||
public long TotalFrames { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The calculated video duration in seconds (based on TotalFrames and FPS).
|
||||
/// </summary>
|
||||
public double VideoDuration { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Total wall-clock time spent rendering.
|
||||
/// </summary>
|
||||
public TimeSpan RenderDuration { get; }
|
||||
|
||||
/// <summary>
|
||||
/// File size of the output video in bytes (0 if failed or file does not exist).
|
||||
/// </summary>
|
||||
public long FileSizeBytes { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Error message or reason if rendering failed or was cancelled; <c>null</c> on success.
|
||||
/// </summary>
|
||||
public string? ErrorMessage { get; }
|
||||
|
||||
public RenderResult(
|
||||
bool success,
|
||||
string outputPath,
|
||||
long totalFrames,
|
||||
double videoDuration,
|
||||
TimeSpan renderDuration,
|
||||
long fileSizeBytes = 0,
|
||||
string? errorMessage = null)
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates whether the rendering session completed successfully.
|
||||
/// </summary>
|
||||
public bool Success { get; }
|
||||
Success = success;
|
||||
OutputPath = outputPath;
|
||||
TotalFrames = totalFrames;
|
||||
VideoDuration = videoDuration;
|
||||
RenderDuration = renderDuration;
|
||||
FileSizeBytes = fileSizeBytes;
|
||||
ErrorMessage = errorMessage;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The absolute output path of the rendered video file. Empty string if rendering failed or output was not created.
|
||||
/// </summary>
|
||||
public string OutputPath { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Total number of video frames sent to the encoder.
|
||||
/// </summary>
|
||||
public long TotalFrames { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The calculated video duration in seconds (based on TotalFrames and FPS).
|
||||
/// </summary>
|
||||
public double VideoDuration { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Total wall-clock time spent rendering.
|
||||
/// </summary>
|
||||
public TimeSpan RenderDuration { get; }
|
||||
|
||||
/// <summary>
|
||||
/// File size of the output video in bytes (0 if failed or file does not exist).
|
||||
/// </summary>
|
||||
public long FileSizeBytes { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Error message or reason if rendering failed or was cancelled; <c>null</c> on success.
|
||||
/// </summary>
|
||||
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"}]";
|
||||
}
|
||||
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"}]";
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.IO;
|
||||
using ADOFAIRenderer.Core;
|
||||
using ADOFAIRenderer.Data;
|
||||
@@ -9,6 +10,7 @@ namespace ADOFAIRenderer.API;
|
||||
/// <summary>
|
||||
/// Fluent builder for configuring and starting a render session.
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "UnusedType.Global")]
|
||||
public class RenderSession
|
||||
{
|
||||
private bool _auto = true;
|
||||
|
||||
Reference in new issue
Block a user