45 lines
1.8 KiB
C#
45 lines
1.8 KiB
C#
namespace EmbyToolbox.Models;
|
||
|
||
/// <summary>Сторонний аудиофайл (контейнер или raw), возможно с несколькими аудиопотоками.</summary>
|
||
public sealed class ExternalAudioFile
|
||
{
|
||
public ExternalAudioFile(string fullPath, IReadOnlyList<ExternalAudioStream> streams)
|
||
{
|
||
FullPath = fullPath;
|
||
Streams = streams;
|
||
}
|
||
|
||
public string FullPath { get; }
|
||
public IReadOnlyList<ExternalAudioStream> Streams { get; }
|
||
}
|
||
|
||
/// <summary>Один аудиопоток внутри <see cref="ExternalAudioFile"/> (индекс для ffmpeg <c>-map</c> <i>input:a:N</i>).</summary>
|
||
public sealed class ExternalAudioStream
|
||
{
|
||
public required string FileFullPath { get; init; }
|
||
|
||
/// <summary>Порядковый номер аудиопотока внутри файла (0 = первый audio), для <c>-map M:a:N</c>.</summary>
|
||
public int StreamOrdinal { get; init; }
|
||
|
||
public required string CodecName { get; init; }
|
||
public string? TitleFromProbe { get; init; }
|
||
public int? Channels { get; init; }
|
||
public int? SampleRateHz { get; init; }
|
||
public long? BitRateBps { get; init; }
|
||
}
|
||
|
||
/// <summary>Результат поиска sidecar: объединённые файлы для плана/ffmpeg и разобранное внешнее аудио.</summary>
|
||
public sealed class SidecarDiscoveryResult
|
||
{
|
||
public SidecarDiscoveryResult(IReadOnlyList<SidecarFile> sidecars, IReadOnlyList<ExternalAudioFile> externalAudioFiles)
|
||
{
|
||
Sidecars = sidecars;
|
||
ExternalAudioFiles = externalAudioFiles;
|
||
}
|
||
|
||
public IReadOnlyList<SidecarFile> Sidecars { get; }
|
||
|
||
/// <summary>Разбор аудиофайлов (пути совпадают с audio-<see cref="SidecarFile"/>).</summary>
|
||
public IReadOnlyList<ExternalAudioFile> ExternalAudioFiles { get; }
|
||
}
|