using System.ComponentModel; using System.Runtime.CompilerServices; using EmbyToolbox.Services; namespace EmbyToolbox.ViewModels; public sealed class ConversionProfilePresetRow : INotifyPropertyChanged { private string _profile = string.Empty; public bool IsBuiltIn { get; set; } public string Profile { get => _profile; set { if (_profile == value) { return; } if (!IsBuiltIn && ConversionProfileNames.IsBuiltIn(value)) { return; } _profile = value; OnPropertyChanged(); } } public string Container { get; set; } = string.Empty; public string Video { get; set; } = string.Empty; public string PixelFormat { get; set; } = string.Empty; public string Resolution { get; set; } = string.Empty; public string Fps { get; set; } = string.Empty; public string Audio { get; set; } = string.Empty; public string Bitrate { get; set; } = string.Empty; public string VideoBitrateMode { get; set; } = VideoBitratePolicy.Auto; public double? VideoBitrateMbps { get; set; } public string Subtitles { get; set; } = string.Empty; public string ExternalTracks { get; set; } = string.Empty; public string ExternalSubtitles { get; set; } = string.Empty; public string Fonts { get; set; } = string.Empty; public ConversionProfileSettingsEntry ToSettingsEntry() => new() { Profile = Profile, Container = Container, Video = Video, PixelFormat = PixelFormat, Resolution = Resolution, Fps = Fps, Audio = Audio, Bitrate = Bitrate, VideoBitrateMode = VideoBitrateMode, VideoBitrateMbps = VideoBitrateMbps, Subtitles = Subtitles, ExternalTracks = ExternalTracks, ExternalSubtitles = ExternalSubtitles, Fonts = Fonts }; public event PropertyChangedEventHandler? PropertyChanged; private void OnPropertyChanged([CallerMemberName] string? propertyName = null) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } }