Skip to content

Commit

Permalink
由于zgabi/ffmediaelement貌似修复了死锁问题,因此将裁剪功能修改为单进程运行,加快了启动速度
Browse files Browse the repository at this point in the history
  • Loading branch information
autodotua committed Dec 11, 2023
1 parent eaf007b commit cc72816
Show file tree
Hide file tree
Showing 4 changed files with 192 additions and 265 deletions.
26 changes: 6 additions & 20 deletions SimpleFFmpegGUI.WPF/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,26 +57,9 @@ protected override void OnStartup(StartupEventArgs e)
ConfigureServices(serviceCollection);
ServiceProvider = serviceCollection.BuildServiceProvider();

if (e.Args.Length > 1)
{
if (e.Args[0] == "cut")
{
MainWindow = new CutWindow(new CutWindowViewModel(), e.Args[2..]);
WindowInteropHelper helper = new WindowInteropHelper(MainWindow);
helper.Owner = IntPtr.Parse(e.Args[1]);
MainWindow.ShowDialog();
}
else
{
throw new ArgumentException("未知参数:" + e.Args[0]);
}
}
else
{
ServiceProvider.GetService<FFmpegOutputPageViewModel>();
MainWindow = ServiceProvider.GetService<MainWindow>();
MainWindow.Show();
}
ServiceProvider.GetService<FFmpegOutputPageViewModel>();
MainWindow = ServiceProvider.GetService<MainWindow>();
MainWindow.Show();
}

private void ConfigureServices(IServiceCollection services)
Expand All @@ -90,6 +73,9 @@ private void ConfigureServices(IServiceCollection services)
services.AddSingleton<MainWindow>();
services.AddTransient<MainWindowViewModel>();

services.AddTransient<CutWindow>();
services.AddTransient<CutWindowViewModel>();

services.AddTransient<TestWindow>();
services.AddTransient<TestWindowViewModel>();

Expand Down
Loading

0 comments on commit cc72816

Please sign in to comment.