diff --git a/ProxyForge/Sources/VideoSourceLoader.cs b/ProxyForge/Sources/VideoSourceLoader.cs new file mode 100644 index 0000000..e0b2638 --- /dev/null +++ b/ProxyForge/Sources/VideoSourceLoader.cs @@ -0,0 +1,25 @@ +using YukkuriMovieMaker.Commons; +using YukkuriMovieMaker.Plugin; +using YukkuriMovieMaker.Plugin.FileSource; + +namespace ProxyForge.Sources; + +internal delegate IVideoFileSource? VideoSourceFactory(IGraphicsDevicesAndContext devices, string filePath); + +internal static class VideoSourceLoader +{ + public static IVideoFileSource? Load(IGraphicsDevicesAndContext devices, string filePath) + { + foreach (var plugin in PluginLoader.VideoFileSourcePlugins) + { + if (ReferenceEquals(plugin.GetType().Assembly, typeof(VideoSourceLoader).Assembly)) + continue; + + var source = plugin.CreateVideoFileSource(devices, filePath); + if (source is not null) + return source; + } + + return null; + } +}