Finish ViedoViewer (except volume slider)

This commit is contained in:
Paddy Xu
2017-08-11 00:29:24 +03:00
parent 9ce0776d53
commit cd9b713c41
30 changed files with 426 additions and 164 deletions

View File

@@ -45,4 +45,28 @@ namespace QuickLook.Plugin.VideoViewer
throw new NotImplementedException();
}
}
public sealed class VolumeToIconConverter : DependencyObject, IValueConverter
{
private static readonly string[] Volumes = {"\xE992", "\xE993", "\xE994", "\xE995"};
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null)
return Volumes[0];
var v = (int) value;
if (v == 0)
return Volumes[0];
v = Math.Min(v, 100);
return Volumes[1 + v / 34];
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}