mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-12 10:19:07 +00:00
Avoid audio cover null exception in xaml
Can slightly increase the opening speed of audio file
This commit is contained in:
@@ -19,6 +19,7 @@ using System;
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace QuickLook.Plugin.VideoViewer;
|
||||
|
||||
@@ -48,7 +49,7 @@ public sealed class TimeTickToShortStringConverter : DependencyObject, IValueCon
|
||||
|
||||
public sealed class VolumeToIconConverter : DependencyObject, IValueConverter
|
||||
{
|
||||
private static readonly string[] Volumes = { "\xE74F", "\xE993", "\xE994", "\xE995" };
|
||||
private static readonly string[] Volumes = ["\xE74F", "\xE993", "\xE994", "\xE995"];
|
||||
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
@@ -69,3 +70,19 @@ public sealed class VolumeToIconConverter : DependencyObject, IValueConverter
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class CoverArtConverter : IValueConverter
|
||||
{
|
||||
private static readonly BitmapImage emptyImage =
|
||||
new(new Uri("pack://application:,,,/QuickLook.Plugin.VideoViewer;component/Resources/empty.png", UriKind.Absolute));
|
||||
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return value ?? emptyImage;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user