From eae1caa87538c6525ec7da950e51ea9b2167c033 Mon Sep 17 00:00:00 2001 From: Paddy Xu Date: Sun, 16 Aug 2020 12:22:38 +0200 Subject: [PATCH] Add MXF to VideoViewer --- .../QuickLook.Plugin.ImageViewer/Plugin.cs | 25 +++++++++---------- .../QuickLook.Plugin.VideoViewer/Plugin.cs | 15 ++++++----- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Plugin.cs b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Plugin.cs index 8c390f5..5778ffd 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Plugin.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Plugin.cs @@ -27,19 +27,18 @@ namespace QuickLook.Plugin.ImageViewer { public class Plugin : IViewer { - private static readonly HashSet Formats = new HashSet( - new[] - { - // camera raw - ".ari", ".arw", ".bay", ".crw", ".cr2", ".cap", ".dcs", ".dcr", ".dng", ".drf", ".eip", ".erf", ".exr", - ".fff", ".iiq", ".k25", ".kdc", ".mdc", ".mef", ".mos", ".mrw", ".nef", ".nrw", ".obm", ".orf", ".pef", - ".ptx", ".pxn", ".r3d", ".raf", ".raw", ".rwl", ".rw2", ".rwz", ".sr2", ".srf", ".srw", ".x3f", - // normal - ".bmp", ".hdr", ".heic", ".heif", ".ico", ".icon", ".jpg", ".jpeg", ".psd", ".wdp", ".tif", ".tiff", - ".tga", ".webp", ".pbm", ".pgm", ".ppm", ".pnm", ".svg", ".emf", ".wmf", - // animated - ".png", ".apng", ".gif" - }); + private static readonly HashSet Formats = new HashSet(new[] + { + // camera raw + ".ari", ".arw", ".bay", ".crw", ".cr2", ".cap", ".dcs", ".dcr", ".dng", ".drf", ".eip", ".erf", ".fff", + ".iiq", ".k25", ".kdc", ".mdc", ".mef", ".mos", ".mrw", ".nef", ".nrw", ".obm", ".orf", ".pef", ".ptx", + ".pxn", ".r3d", ".raf", ".raw", ".rwl", ".rw2", ".rwz", ".sr2", ".srf", ".srw", ".x3f", + // normal + ".bmp", ".hdr", ".heic", ".heif", ".ico", ".icon", ".jpg", ".jpeg", ".psd", ".wdp", ".tif", ".tiff", + ".tga", ".webp", ".pbm", ".pgm", ".ppm", ".pnm", ".svg", ".emf", ".wmf", ".exr", + // animated + ".png", ".apng", ".gif" + }); private ImagePanel _ip; private MetaProvider _meta; diff --git a/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/Plugin.cs b/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/Plugin.cs index 7a4194c..f0ce1ca 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/Plugin.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/Plugin.cs @@ -16,8 +16,8 @@ // along with this program. If not, see . using System; +using System.Collections.Generic; using System.IO; -using System.Linq; using System.Reflection; using System.Windows; using MediaInfo; @@ -27,16 +27,16 @@ namespace QuickLook.Plugin.VideoViewer { public class Plugin : IViewer { - private static readonly string[] Formats = + private static readonly HashSet Formats = new HashSet(new[] { // video ".3g2", ".3gp", ".3gp2", ".3gpp", ".amv", ".asf", ".asf", ".avi", ".flv", ".mts", ".m2ts", ".m4v", ".mkv", - ".mov", ".mp4", ".mp4v", ".mpeg", ".mpg", ".ogv", ".qt", ".tp", ".ts", ".vob", ".webm", ".wmv", + ".mov", ".mp4", ".mp4v", ".mpeg", ".mpg", ".ogv", ".qt", ".tp", ".ts", ".vob", ".webm", ".wmv", ".mxf", // audio - ".3gp", ".aa", ".aac", ".aax", ".act", ".aif", ".aiff", ".amr", ".ape", ".au", ".awb", ".dct", ".dss", ".dvf", - ".flac", ".gsm", ".iklax", ".ivs", ".m4a", ".m4b", ".m4p", ".m4r", ".mmf", ".mp3", ".mpc", ".msv", ".ogg", - ".oga", ".mogg", ".opus", ".ra", ".rm", ".raw", ".tta", ".vox", ".wav", ".wma", ".wv", ".webm" - }; + ".3gp", ".aa", ".aac", ".aax", ".act", ".aif", ".aiff", ".amr", ".ape", ".au", ".awb", ".dct", ".dss", + ".dvf", ".flac", ".gsm", ".iklax", ".ivs", ".m4a", ".m4b", ".m4p", ".m4r", ".mmf", ".mp3", ".mpc", ".msv", + ".ogg", ".oga", ".mogg", ".opus", ".ra", ".rm", ".raw", ".tta", ".vox", ".wav", ".wma", ".wv", ".webm" + }); private ContextObject _context; private MediaInfo.MediaInfo _mediaInfo; @@ -67,7 +67,6 @@ namespace QuickLook.Plugin.VideoViewer _mediaInfo.Option("Cover_Data", "base64"); _mediaInfo.Open(path); - } catch (Exception) {