mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-01-19 13:06:44 +00:00
bff3406545
Former-commit-id: bb08076db4
35 lines
936 B
C#
35 lines
936 B
C#
using System;
|
|
|
|
namespace FFMpegCore.Arguments
|
|
{
|
|
/// <summary>
|
|
/// Represents seek parameter
|
|
/// </summary>
|
|
public class SeekArgument : IArgument
|
|
{
|
|
public readonly TimeSpan? SeekTo;
|
|
|
|
public SeekArgument(TimeSpan? seekTo)
|
|
{
|
|
SeekTo = seekTo;
|
|
}
|
|
|
|
public string Text {
|
|
get {
|
|
if(SeekTo.HasValue)
|
|
{
|
|
int hours = SeekTo.Value.Hours;
|
|
if(SeekTo.Value.Days > 0)
|
|
{
|
|
hours += SeekTo.Value.Days * 24;
|
|
}
|
|
return $"-ss {hours.ToString("00")}:{SeekTo.Value.Minutes.ToString("00")}:{SeekTo.Value.Seconds.ToString("00")}.{SeekTo.Value.Milliseconds.ToString("000")}";
|
|
}
|
|
else
|
|
{
|
|
return string.Empty;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|