From 7102cbd97e0f72eec66a3124b6bc063cd8988eac Mon Sep 17 00:00:00 2001 From: XyLe-GBP Date: Sat, 1 Oct 2022 22:45:17 +0900 Subject: [PATCH] version 1.31 --- Localization/Strings.Designer.cs | 10 + Localization/Strings.en.resx | 4 + Localization/Strings.ja.resx | 4 + Localization/Strings.resx | 4 + Localization/Strings.zh.resx | 4 + VERSIONINFO | 2 +- src/Common.cs | 43 + src/Forms/FormImageUpscaleSettings.cs | 384 +++++- src/Forms/FormMain.Designer.cs | 59 +- src/Forms/FormMain.cs | 448 ++++--- src/Forms/FormMain.ja.resx | 63 +- src/Forms/FormMain.resx | 1078 +++++++++-------- src/Forms/FormMain.zh.resx | 19 +- src/Forms/FormSplash.Designer.cs | 2 +- src/Forms/FormSplash.cs | 44 +- ...u2x-ncnn-vulkan-GUI-Edition-C-Sharp.csproj | 6 +- 16 files changed, 1365 insertions(+), 809 deletions(-) diff --git a/Localization/Strings.Designer.cs b/Localization/Strings.Designer.cs index c2a1fae..eb93435 100644 --- a/Localization/Strings.Designer.cs +++ b/Localization/Strings.Designer.cs @@ -852,6 +852,16 @@ public static string UnExpectedError { } } + /// + /// FFmpeg exists, but the version is unknown. + ///Do you want to download the official version? に類似しているローカライズされた文字列を検索します。 + /// + public static string UnknownFFmpegCaption { + get { + return ResourceManager.GetString("UnknownFFmpegCaption", resourceCulture); + } + } + /// /// The update has been completed. に類似しているローカライズされた文字列を検索します。 /// diff --git a/Localization/Strings.en.resx b/Localization/Strings.en.resx index 1b8c2cd..f57e19e 100644 --- a/Localization/Strings.en.resx +++ b/Localization/Strings.en.resx @@ -389,6 +389,10 @@ Please configure the settings from the 'Settings' item. An unexpected error has occurred. {0} + + + FFmpeg exists, but the version is unknown. +Do you want to download the official version? The update has been completed. diff --git a/Localization/Strings.ja.resx b/Localization/Strings.ja.resx index 22090dd..25fe2c9 100644 --- a/Localization/Strings.ja.resx +++ b/Localization/Strings.ja.resx @@ -403,6 +403,10 @@ Real-ESRGAN Photo: 写真等をアップスケールする際に適したモデ 予期せぬエラーが発生しました。 {0} + + + FFmpegが存在しますが、バージョンが不明です。 +正規バージョンをダウンロードしますか? アップデートが完了しました。 diff --git a/Localization/Strings.resx b/Localization/Strings.resx index 40c20c2..862fa34 100644 --- a/Localization/Strings.resx +++ b/Localization/Strings.resx @@ -404,6 +404,10 @@ Please configure the settings from the 'Settings' item. An unexpected error has occurred. {0} + + + FFmpeg exists, but the version is unknown. +Do you want to download the official version? The update has been completed. diff --git a/Localization/Strings.zh.resx b/Localization/Strings.zh.resx index aa93666..a3cbc32 100644 --- a/Localization/Strings.zh.resx +++ b/Localization/Strings.zh.resx @@ -403,6 +403,10 @@ Real-ESRGAN Photo:该模型适用于放大照片等。 发生了一个意外的错误。 {0} + + + FFmpeg存在,但版本不明。 +你想下载官方版本吗? 更新完成。 diff --git a/VERSIONINFO b/VERSIONINFO index ae60475..dc88157 100644 --- a/VERSIONINFO +++ b/VERSIONINFO @@ -1 +1 @@ -version:1.30.2220.615 +version:1.31.2220.1001 diff --git a/src/Common.cs b/src/Common.cs index 9878ed8..4129a8d 100644 --- a/src/Common.cs +++ b/src/Common.cs @@ -1170,6 +1170,49 @@ public static void GetVideoControllerInformation(string[] buffers) } } } + + public static List GetGraphicsCardNamesInformation() + { + var clist = new List(); + ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_VideoController"); + string graphicsCard = string.Empty; + foreach (ManagementObject obj in searcher.Get()) + { + if (obj["CurrentBitsPerPixel"] != null && obj["CurrentHorizontalResolution"] != null) + { + graphicsCard = obj["Name"].ToString(); + clist.Add(graphicsCard); + } + } + + if (clist.Count != 0) + { + return clist; + } + else { return null; } + } + + public static List GetGraphicsCardsInformation() + { + var clist = new List(); + ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_VideoController"); + string graphicsCard = string.Empty; + foreach (ManagementObject obj in searcher.Get()) + { + if (obj["CurrentBitsPerPixel"] != null && obj["CurrentHorizontalResolution"] != null) + { + long ram = long.Parse(obj["AdapterRAM"].ToString()) / 1048576; + graphicsCard = obj["Name"].ToString() + " - " + obj["DriverVersion"].ToString() + " [ " + ram.ToString() + "MiB RAM ]"; + clist.Add(graphicsCard); + } + } + + if (clist.Count != 0) + { + return clist; + } + else { return null; } + } } class Config diff --git a/src/Forms/FormImageUpscaleSettings.cs b/src/Forms/FormImageUpscaleSettings.cs index ac12446..65ebe31 100644 --- a/src/Forms/FormImageUpscaleSettings.cs +++ b/src/Forms/FormImageUpscaleSettings.cs @@ -1,5 +1,7 @@ using NVGE.Localization; using System; +using System.Collections; +using System.Collections.Generic; using System.Windows.Forms; namespace NVGE @@ -15,11 +17,63 @@ public FormImageUpscaleSettings() private void FormImageUpscaleSettings_Load(object sender, EventArgs e) { - string[] GPUInfo = new string[3]; - SystemInfo.GetVideoControllerInformation(GPUInfo); + comboBox_GPU.Items.Clear(); + string[] CPUInfo = new string[3]; + SystemInfo.GetProcessorsInformation(CPUInfo); + List GPUNList = new(); + GPUNList = SystemInfo.GetGraphicsCardNamesInformation(); + + foreach (var GPU in GPUNList) + { + if (GPU.Contains("Intel")) + { + if (GPU.Contains("HD Graphics")) + { + comboBox_GPU.Items.Add("iGPU [ " + GPU + " ]"); + } + if (GPU.Contains("Iris")) + { + comboBox_GPU.Items.Add("iGPU [ " + GPU + " ]"); + } + if (GPU.Contains("Xe Graphics")) + { + comboBox_GPU.Items.Add("iGPU [ " + GPU + " ]"); + } + } + else if (GPU.Contains("Radeon")) + { + if (GPU.Contains("Vega 11")) + { + comboBox_GPU.Items.Add("iGPU [ " + GPU + " ]"); + } + if (GPU.Contains("Vega 8")) + { + comboBox_GPU.Items.Add("iGPU [ " + GPU + " ]"); + } + if (GPU.Contains("Vega 7")) + { + comboBox_GPU.Items.Add("iGPU [ " + GPU + " ]"); + } + if (GPU.Contains("Vega 6")) + { + comboBox_GPU.Items.Add("iGPU [ " + GPU + " ]"); + } + } + else + { + comboBox_GPU.Items.Add("dGPU [ " + GPU + " ]"); + } + } + comboBox_GPU.Items.Add("Auto"); + ArrayList array = ArrayList.Adapter(comboBox_GPU.Items); + array.Reverse(); + + Config.Load(Common.xmlpath); + + switch (int.Parse(Config.Entry["ConversionType"].Value)) { case 0: // waifu2x @@ -985,6 +1039,7 @@ private void ComboBox_Uplevel_SelectedIndexChanged(object sender, EventArgs e) private void ComboBox_GPU_SelectedIndexChanged(object sender, EventArgs e) { + string item = (string)comboBox_GPU.Items[1]; if (checkBox_Advanced.Checked != false) { switch (comboBox_engine.SelectedIndex) @@ -999,22 +1054,50 @@ private void ComboBox_GPU_SelectedIndexChanged(object sender, EventArgs e) textBox_CMD.Text = cmdparam; break; case 1: - usegpu = " -g -1"; + if (!item.Contains("iGPU")) + { + usegpu = " -g 0"; + } + else + { + usegpu = " -g -1"; + } cmdparam = RefleshParams(); textBox_CMD.Text = cmdparam; break; case 2: - usegpu = " -g 0"; + if (!item.Contains("iGPU")) + { + usegpu = " -g 1"; + } + else + { + usegpu = " -g 0"; + } cmdparam = RefleshParams(); textBox_CMD.Text = cmdparam; break; case 3: - usegpu = " -g 1"; + if (!item.Contains("iGPU")) + { + usegpu = " -g 2"; + } + else + { + usegpu = " -g 1"; + } cmdparam = RefleshParams(); textBox_CMD.Text = cmdparam; break; case 4: - usegpu = " -g 2"; + if (!item.Contains("iGPU")) + { + usegpu = " -g default"; + } + else + { + usegpu = " -g 2"; + } cmdparam = RefleshParams(); textBox_CMD.Text = cmdparam; break; @@ -1036,22 +1119,50 @@ private void ComboBox_GPU_SelectedIndexChanged(object sender, EventArgs e) textBox_CMD.Text = cmdparam; break; case 1: - usegpu = " -g -1"; + if (!item.Contains("iGPU")) + { + usegpu = " -g 0"; + } + else + { + usegpu = " -g -1"; + } cmdparam = RefleshParams(); textBox_CMD.Text = cmdparam; break; case 2: - usegpu = " -g 0"; + if (!item.Contains("iGPU")) + { + usegpu = " -g 1"; + } + else + { + usegpu = " -g 0"; + } cmdparam = RefleshParams(); textBox_CMD.Text = cmdparam; break; case 3: - usegpu = " -g 1"; + if (!item.Contains("iGPU")) + { + usegpu = " -g 2"; + } + else + { + usegpu = " -g 1"; + } cmdparam = RefleshParams(); textBox_CMD.Text = cmdparam; break; case 4: - usegpu = " -g 2"; + if (!item.Contains("iGPU")) + { + usegpu = " -g default"; + } + else + { + usegpu = " -g 2"; + } cmdparam = RefleshParams(); textBox_CMD.Text = cmdparam; break; @@ -1068,27 +1179,60 @@ private void ComboBox_GPU_SelectedIndexChanged(object sender, EventArgs e) switch (comboBox_GPU.SelectedIndex) { case 0: - usegpu = " -g auto"; + usegpu = " -g default"; cmdparam = RefleshParams(); textBox_CMD.Text = cmdparam; break; case 1: - usegpu = " -g 0"; + if (!item.Contains("iGPU")) + { + usegpu = " -g 0"; + } + else + { + usegpu = " -g -1"; + } cmdparam = RefleshParams(); textBox_CMD.Text = cmdparam; break; case 2: - usegpu = " -g 1"; + if (!item.Contains("iGPU")) + { + usegpu = " -g 1"; + } + else + { + usegpu = " -g 0"; + } cmdparam = RefleshParams(); textBox_CMD.Text = cmdparam; break; case 3: - usegpu = " -g 2"; + if (!item.Contains("iGPU")) + { + usegpu = " -g 2"; + } + else + { + usegpu = " -g 1"; + } + cmdparam = RefleshParams(); + textBox_CMD.Text = cmdparam; + break; + case 4: + if (!item.Contains("iGPU")) + { + usegpu = " -g default"; + } + else + { + usegpu = " -g 2"; + } cmdparam = RefleshParams(); textBox_CMD.Text = cmdparam; break; default: - usegpu = " -g auto"; + usegpu = " -g default"; cmdparam = RefleshParams(); textBox_CMD.Text = cmdparam; break; @@ -1105,22 +1249,50 @@ private void ComboBox_GPU_SelectedIndexChanged(object sender, EventArgs e) textBox_CMD.Text = cmdparam; break; case 1: - usegpu = " -g -1"; + if (!item.Contains("iGPU")) + { + usegpu = " -g 0"; + } + else + { + usegpu = " -g -1"; + } cmdparam = RefleshParams(); textBox_CMD.Text = cmdparam; break; case 2: - usegpu = " -g 0"; + if (!item.Contains("iGPU")) + { + usegpu = " -g 1"; + } + else + { + usegpu = " -g 0"; + } cmdparam = RefleshParams(); textBox_CMD.Text = cmdparam; break; case 3: - usegpu = " -g 1"; + if (!item.Contains("iGPU")) + { + usegpu = " -g 2"; + } + else + { + usegpu = " -g 1"; + } cmdparam = RefleshParams(); textBox_CMD.Text = cmdparam; break; case 4: - usegpu = " -g 2"; + if (!item.Contains("iGPU")) + { + usegpu = " -g default"; + } + else + { + usegpu = " -g 2"; + } cmdparam = RefleshParams(); textBox_CMD.Text = cmdparam; break; @@ -1145,26 +1317,60 @@ private void ComboBox_GPU_SelectedIndexChanged(object sender, EventArgs e) case 0: usegpu = " -g default"; cmdparam = RefleshParams(); + textBox_CMD.Text = cmdparam; break; case 1: - usegpu = " -g -1"; + if (!item.Contains("iGPU")) + { + usegpu = " -g 0"; + } + else + { + usegpu = " -g -1"; + } cmdparam = RefleshParams(); + textBox_CMD.Text = cmdparam; break; case 2: - usegpu = " -g 0"; + if (!item.Contains("iGPU")) + { + usegpu = " -g 1"; + } + else + { + usegpu = " -g 0"; + } cmdparam = RefleshParams(); + textBox_CMD.Text = cmdparam; break; case 3: - usegpu = " -g 1"; + if (!item.Contains("iGPU")) + { + usegpu = " -g 2"; + } + else + { + usegpu = " -g 1"; + } cmdparam = RefleshParams(); + textBox_CMD.Text = cmdparam; break; case 4: - usegpu = " -g 2"; + if (!item.Contains("iGPU")) + { + usegpu = " -g default"; + } + else + { + usegpu = " -g 2"; + } cmdparam = RefleshParams(); + textBox_CMD.Text = cmdparam; break; default: usegpu = " -g default"; cmdparam = RefleshParams(); + textBox_CMD.Text = cmdparam; break; } } @@ -1176,26 +1382,60 @@ private void ComboBox_GPU_SelectedIndexChanged(object sender, EventArgs e) case 0: usegpu = " -g default"; cmdparam = RefleshParams(); + textBox_CMD.Text = cmdparam; break; case 1: - usegpu = " -g -1"; + if (!item.Contains("iGPU")) + { + usegpu = " -g 0"; + } + else + { + usegpu = " -g -1"; + } cmdparam = RefleshParams(); + textBox_CMD.Text = cmdparam; break; case 2: - usegpu = " -g 0"; + if (!item.Contains("iGPU")) + { + usegpu = " -g 1"; + } + else + { + usegpu = " -g 0"; + } cmdparam = RefleshParams(); + textBox_CMD.Text = cmdparam; break; case 3: - usegpu = " -g 1"; + if (!item.Contains("iGPU")) + { + usegpu = " -g 2"; + } + else + { + usegpu = " -g 1"; + } cmdparam = RefleshParams(); + textBox_CMD.Text = cmdparam; break; case 4: - usegpu = " -g 2"; + if (!item.Contains("iGPU")) + { + usegpu = " -g default"; + } + else + { + usegpu = " -g 2"; + } cmdparam = RefleshParams(); + textBox_CMD.Text = cmdparam; break; default: usegpu = " -g default"; cmdparam = RefleshParams(); + textBox_CMD.Text = cmdparam; break; } } @@ -1205,24 +1445,62 @@ private void ComboBox_GPU_SelectedIndexChanged(object sender, EventArgs e) switch (comboBox_GPU.SelectedIndex) { case 0: - usegpu = " -g auto"; + usegpu = " -g default"; cmdparam = RefleshParams(); + textBox_CMD.Text = cmdparam; break; case 1: - usegpu = " -g 0"; + if (!item.Contains("iGPU")) + { + usegpu = " -g 0"; + } + else + { + usegpu = " -g -1"; + } cmdparam = RefleshParams(); + textBox_CMD.Text = cmdparam; break; case 2: - usegpu = " -g 1"; + if (!item.Contains("iGPU")) + { + usegpu = " -g 1"; + } + else + { + usegpu = " -g 0"; + } cmdparam = RefleshParams(); + textBox_CMD.Text = cmdparam; break; case 3: - usegpu = " -g 2"; + if (!item.Contains("iGPU")) + { + usegpu = " -g 2"; + } + else + { + usegpu = " -g 1"; + } + cmdparam = RefleshParams(); + textBox_CMD.Text = cmdparam; + break; + case 4: + if (!item.Contains("iGPU")) + { + usegpu = " -g default"; + } + else + { + usegpu = " -g 2"; + } cmdparam = RefleshParams(); + textBox_CMD.Text = cmdparam; break; default: - usegpu = " -g auto"; + usegpu = " -g default"; cmdparam = RefleshParams(); + textBox_CMD.Text = cmdparam; break; } } @@ -1234,26 +1512,60 @@ private void ComboBox_GPU_SelectedIndexChanged(object sender, EventArgs e) case 0: usegpu = " -g default"; cmdparam = RefleshParams(); + textBox_CMD.Text = cmdparam; break; case 1: - usegpu = " -g -1"; + if (!item.Contains("iGPU")) + { + usegpu = " -g 0"; + } + else + { + usegpu = " -g -1"; + } cmdparam = RefleshParams(); + textBox_CMD.Text = cmdparam; break; case 2: - usegpu = " -g 0"; + if (!item.Contains("iGPU")) + { + usegpu = " -g 1"; + } + else + { + usegpu = " -g 0"; + } cmdparam = RefleshParams(); + textBox_CMD.Text = cmdparam; break; case 3: - usegpu = " -g 1"; + if (!item.Contains("iGPU")) + { + usegpu = " -g 2"; + } + else + { + usegpu = " -g 1"; + } cmdparam = RefleshParams(); + textBox_CMD.Text = cmdparam; break; case 4: - usegpu = " -g 2"; + if (!item.Contains("iGPU")) + { + usegpu = " -g default"; + } + else + { + usegpu = " -g 2"; + } cmdparam = RefleshParams(); + textBox_CMD.Text = cmdparam; break; default: usegpu = " -g default"; cmdparam = RefleshParams(); + textBox_CMD.Text = cmdparam; break; } } diff --git a/src/Forms/FormMain.Designer.cs b/src/Forms/FormMain.Designer.cs index c985017..ff46b68 100644 --- a/src/Forms/FormMain.Designer.cs +++ b/src/Forms/FormMain.Designer.cs @@ -67,6 +67,7 @@ private void InitializeComponent() this.label_File = new System.Windows.Forms.Label(); this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.toolStripStatusLabel_Status = new System.Windows.Forms.ToolStripStatusLabel(); + this.comboBox_GPU = new System.Windows.Forms.ComboBox(); this.menuStrip1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -90,16 +91,17 @@ private void InitializeComponent() // // menuStrip1 // + resources.ApplyResources(this.menuStrip1, "menuStrip1"); this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.fileFToolStripMenuItem, this.settingsCToolStripMenuItem, this.toolsTToolStripMenuItem, this.aboutAToolStripMenuItem}); - resources.ApplyResources(this.menuStrip1, "menuStrip1"); this.menuStrip1.Name = "menuStrip1"; // // fileFToolStripMenuItem // + resources.ApplyResources(this.fileFToolStripMenuItem, "fileFToolStripMenuItem"); this.fileFToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.openImegeIToolStripMenuItem, this.openVideoVToolStripMenuItem, @@ -108,24 +110,23 @@ private void InitializeComponent() this.toolStripMenuItem2, this.exitXToolStripMenuItem}); this.fileFToolStripMenuItem.Name = "fileFToolStripMenuItem"; - resources.ApplyResources(this.fileFToolStripMenuItem, "fileFToolStripMenuItem"); // // openImegeIToolStripMenuItem // - this.openImegeIToolStripMenuItem.Name = "openImegeIToolStripMenuItem"; resources.ApplyResources(this.openImegeIToolStripMenuItem, "openImegeIToolStripMenuItem"); + this.openImegeIToolStripMenuItem.Name = "openImegeIToolStripMenuItem"; this.openImegeIToolStripMenuItem.Click += new System.EventHandler(this.OpenImegeIToolStripMenuItem_Click); // // openVideoVToolStripMenuItem // - this.openVideoVToolStripMenuItem.Name = "openVideoVToolStripMenuItem"; resources.ApplyResources(this.openVideoVToolStripMenuItem, "openVideoVToolStripMenuItem"); + this.openVideoVToolStripMenuItem.Name = "openVideoVToolStripMenuItem"; this.openVideoVToolStripMenuItem.Click += new System.EventHandler(this.OpenVideoVToolStripMenuItem_Click); // // toolStripMenuItem1 // - this.toolStripMenuItem1.Name = "toolStripMenuItem1"; resources.ApplyResources(this.toolStripMenuItem1, "toolStripMenuItem1"); + this.toolStripMenuItem1.Name = "toolStripMenuItem1"; // // closeFileCToolStripMenuItem // @@ -135,87 +136,87 @@ private void InitializeComponent() // // toolStripMenuItem2 // - this.toolStripMenuItem2.Name = "toolStripMenuItem2"; resources.ApplyResources(this.toolStripMenuItem2, "toolStripMenuItem2"); + this.toolStripMenuItem2.Name = "toolStripMenuItem2"; // // exitXToolStripMenuItem // - this.exitXToolStripMenuItem.Name = "exitXToolStripMenuItem"; resources.ApplyResources(this.exitXToolStripMenuItem, "exitXToolStripMenuItem"); + this.exitXToolStripMenuItem.Name = "exitXToolStripMenuItem"; this.exitXToolStripMenuItem.Click += new System.EventHandler(this.ExitXToolStripMenuItem_Click); // // settingsCToolStripMenuItem // + resources.ApplyResources(this.settingsCToolStripMenuItem, "settingsCToolStripMenuItem"); this.settingsCToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.upscalingSettingsUToolStripMenuItem, this.videoUpscalingSettingsVToolStripMenuItem}); this.settingsCToolStripMenuItem.Name = "settingsCToolStripMenuItem"; - resources.ApplyResources(this.settingsCToolStripMenuItem, "settingsCToolStripMenuItem"); // // upscalingSettingsUToolStripMenuItem // - this.upscalingSettingsUToolStripMenuItem.Name = "upscalingSettingsUToolStripMenuItem"; resources.ApplyResources(this.upscalingSettingsUToolStripMenuItem, "upscalingSettingsUToolStripMenuItem"); + this.upscalingSettingsUToolStripMenuItem.Name = "upscalingSettingsUToolStripMenuItem"; this.upscalingSettingsUToolStripMenuItem.Click += new System.EventHandler(this.UpscalingSettingsUToolStripMenuItem_Click); // // videoUpscalingSettingsVToolStripMenuItem // - this.videoUpscalingSettingsVToolStripMenuItem.Name = "videoUpscalingSettingsVToolStripMenuItem"; resources.ApplyResources(this.videoUpscalingSettingsVToolStripMenuItem, "videoUpscalingSettingsVToolStripMenuItem"); + this.videoUpscalingSettingsVToolStripMenuItem.Name = "videoUpscalingSettingsVToolStripMenuItem"; this.videoUpscalingSettingsVToolStripMenuItem.Click += new System.EventHandler(this.VideoUpscalingSettingsVToolStripMenuItem_Click); // // toolsTToolStripMenuItem // + resources.ApplyResources(this.toolsTToolStripMenuItem, "toolsTToolStripMenuItem"); this.toolsTToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.changeVideoResolutionToolStripMenuItem, this.changeVideoFormatToolStripMenuItem, this.changeImageFormatToolStripMenuItem}); this.toolsTToolStripMenuItem.Name = "toolsTToolStripMenuItem"; - resources.ApplyResources(this.toolsTToolStripMenuItem, "toolsTToolStripMenuItem"); // // changeVideoResolutionToolStripMenuItem // - this.changeVideoResolutionToolStripMenuItem.Name = "changeVideoResolutionToolStripMenuItem"; resources.ApplyResources(this.changeVideoResolutionToolStripMenuItem, "changeVideoResolutionToolStripMenuItem"); + this.changeVideoResolutionToolStripMenuItem.Name = "changeVideoResolutionToolStripMenuItem"; this.changeVideoResolutionToolStripMenuItem.Click += new System.EventHandler(this.ChangeVideoResolutionToolStripMenuItem_Click); // // changeVideoFormatToolStripMenuItem // - this.changeVideoFormatToolStripMenuItem.Name = "changeVideoFormatToolStripMenuItem"; resources.ApplyResources(this.changeVideoFormatToolStripMenuItem, "changeVideoFormatToolStripMenuItem"); + this.changeVideoFormatToolStripMenuItem.Name = "changeVideoFormatToolStripMenuItem"; this.changeVideoFormatToolStripMenuItem.Click += new System.EventHandler(this.ChangeVideoFormatToolStripMenuItem_Click); // // changeImageFormatToolStripMenuItem // - this.changeImageFormatToolStripMenuItem.Name = "changeImageFormatToolStripMenuItem"; resources.ApplyResources(this.changeImageFormatToolStripMenuItem, "changeImageFormatToolStripMenuItem"); + this.changeImageFormatToolStripMenuItem.Name = "changeImageFormatToolStripMenuItem"; this.changeImageFormatToolStripMenuItem.Click += new System.EventHandler(this.ChangeImageFormatToolStripMenuItem_Click); // // aboutAToolStripMenuItem // + resources.ApplyResources(this.aboutAToolStripMenuItem, "aboutAToolStripMenuItem"); this.aboutAToolStripMenuItem.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; this.aboutAToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.aboutWaifu2xncnnvulkanGUIToolStripMenuItem, this.toolStripMenuItem3, this.checkForUpdatesUToolStripMenuItem}); this.aboutAToolStripMenuItem.Name = "aboutAToolStripMenuItem"; - resources.ApplyResources(this.aboutAToolStripMenuItem, "aboutAToolStripMenuItem"); // // aboutWaifu2xncnnvulkanGUIToolStripMenuItem // - this.aboutWaifu2xncnnvulkanGUIToolStripMenuItem.Name = "aboutWaifu2xncnnvulkanGUIToolStripMenuItem"; resources.ApplyResources(this.aboutWaifu2xncnnvulkanGUIToolStripMenuItem, "aboutWaifu2xncnnvulkanGUIToolStripMenuItem"); + this.aboutWaifu2xncnnvulkanGUIToolStripMenuItem.Name = "aboutWaifu2xncnnvulkanGUIToolStripMenuItem"; this.aboutWaifu2xncnnvulkanGUIToolStripMenuItem.Click += new System.EventHandler(this.AboutWaifu2xncnnvulkanGUIToolStripMenuItem_Click); // // toolStripMenuItem3 // - this.toolStripMenuItem3.Name = "toolStripMenuItem3"; resources.ApplyResources(this.toolStripMenuItem3, "toolStripMenuItem3"); + this.toolStripMenuItem3.Name = "toolStripMenuItem3"; // // checkForUpdatesUToolStripMenuItem // - this.checkForUpdatesUToolStripMenuItem.Name = "checkForUpdatesUToolStripMenuItem"; resources.ApplyResources(this.checkForUpdatesUToolStripMenuItem, "checkForUpdatesUToolStripMenuItem"); + this.checkForUpdatesUToolStripMenuItem.Name = "checkForUpdatesUToolStripMenuItem"; this.checkForUpdatesUToolStripMenuItem.Click += new System.EventHandler(this.CheckForUpdatesUToolStripMenuItem_Click); // // label2 @@ -230,13 +231,13 @@ private void InitializeComponent() // // groupBox1 // + resources.ApplyResources(this.groupBox1, "groupBox1"); this.groupBox1.Controls.Add(this.label_OS); this.groupBox1.Controls.Add(this.label4); this.groupBox1.Controls.Add(this.label_Graphic); this.groupBox1.Controls.Add(this.label_Processor); this.groupBox1.Controls.Add(this.label2); this.groupBox1.Controls.Add(this.label3); - resources.ApplyResources(this.groupBox1, "groupBox1"); this.groupBox1.Name = "groupBox1"; this.groupBox1.TabStop = false; // @@ -262,10 +263,10 @@ private void InitializeComponent() // // groupBox2 // + resources.ApplyResources(this.groupBox2, "groupBox2"); this.groupBox2.Controls.Add(this.button_Merge); this.groupBox2.Controls.Add(this.button_Image); this.groupBox2.Controls.Add(this.button_Video); - resources.ApplyResources(this.groupBox2, "groupBox2"); this.groupBox2.Name = "groupBox2"; this.groupBox2.TabStop = false; // @@ -278,9 +279,9 @@ private void InitializeComponent() // // label1 // + resources.ApplyResources(this.label1, "label1"); this.label1.AllowDrop = true; this.label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - resources.ApplyResources(this.label1, "label1"); this.label1.Name = "label1"; this.label1.DragDrop += new System.Windows.Forms.DragEventHandler(this.Label1_DragDrop); this.label1.DragEnter += new System.Windows.Forms.DragEventHandler(this.Label1_DragEnter); @@ -306,26 +307,35 @@ private void InitializeComponent() // // label_File // - this.label_File.AutoEllipsis = true; resources.ApplyResources(this.label_File, "label_File"); + this.label_File.AutoEllipsis = true; this.label_File.Name = "label_File"; // // statusStrip1 // + resources.ApplyResources(this.statusStrip1, "statusStrip1"); this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripStatusLabel_Status}); - resources.ApplyResources(this.statusStrip1, "statusStrip1"); this.statusStrip1.Name = "statusStrip1"; // // toolStripStatusLabel_Status // - this.toolStripStatusLabel_Status.Name = "toolStripStatusLabel_Status"; resources.ApplyResources(this.toolStripStatusLabel_Status, "toolStripStatusLabel_Status"); + this.toolStripStatusLabel_Status.Name = "toolStripStatusLabel_Status"; + // + // comboBox_GPU + // + resources.ApplyResources(this.comboBox_GPU, "comboBox_GPU"); + this.comboBox_GPU.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox_GPU.FormattingEnabled = true; + this.comboBox_GPU.Name = "comboBox_GPU"; + this.comboBox_GPU.SelectedIndexChanged += new System.EventHandler(this.ComboBox_GPU_SelectedIndexChanged); // // FormMain // resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.comboBox_GPU); this.Controls.Add(this.label_default); this.Controls.Add(this.label_File); this.Controls.Add(this.label_Size); @@ -393,6 +403,7 @@ private void InitializeComponent() private System.Windows.Forms.Label label_default; private System.Windows.Forms.ToolStripMenuItem changeVideoFormatToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem changeImageFormatToolStripMenuItem; + private System.Windows.Forms.ComboBox comboBox_GPU; } } diff --git a/src/Forms/FormMain.cs b/src/Forms/FormMain.cs index 6e1da8f..707611d 100644 --- a/src/Forms/FormMain.cs +++ b/src/Forms/FormMain.cs @@ -8,6 +8,7 @@ using System.IO.Compression; using System.Net.Http; using System.Net.NetworkInformation; +using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; @@ -25,6 +26,9 @@ public partial class FormMain : Form private static readonly HttpClient FFupdatechecker = new(handler); #endregion + static FormSplash fs; + static object lockobj; + public FormMain() { InitializeComponent(); @@ -36,109 +40,199 @@ private void FormMain_Load(object sender, EventArgs e) FileVersionInfo ver = FileVersionInfo.GetVersionInfo(Application.ExecutablePath); Text = "waifu2x-nvger ( build: " + ver.FileVersion.ToString() + "-Beta )"; - using var splash = new FormSplash(); - splash.Show(); - splash.Refresh(); + lockobj = new object(); - foreach (var files in Directory.GetFiles(Directory.GetCurrentDirectory() + @"\res", "*", SearchOption.AllDirectories)) + lock (lockobj) { - FileInfo fi = new(files); - RefleshSplashForm(splash, string.Format(Strings.SplashFormFileCaption, fi.Name)); - } + ThreadStart ts = new(StartThread); + Thread thread = new(ts) + { + Name = "Splash", + IsBackground = true + }; + thread.SetApartmentState(ApartmentState.STA); + thread.Start(); - RefleshSplashForm(splash, Strings.SplashFormSystemCaption); + dmes d = new(ShowMessage); + if (fs != null) + { + fs.Invoke(d, "Initializing..."); + } + label1.Text = Strings.DragDropCaption; + Thread.Sleep(1000); - label1.Text = Strings.DragDropCaption; + foreach (var files in Directory.GetFiles(Directory.GetCurrentDirectory() + @"\res", "*", SearchOption.AllDirectories)) + { + FileInfo fi = new(files); + if (fs != null) + { + fs.Invoke(d, string.Format(Strings.SplashFormFileCaption, fi.Name)); + Thread.Sleep(10); + } + } - string[] OSInfo = new string[17]; - string[] CPUInfo = new string[3]; - string[] GPUInfo = new string[3]; - SystemInfo.GetSystemInformation(OSInfo); - SystemInfo.GetProcessorsInformation(CPUInfo); - SystemInfo.GetVideoControllerInformation(GPUInfo); - /*OSInfo = splash.OSInfo; - CPUInfo = splash.CPUInfo; - GPUInfo = splash.GPUInfo;*/ - - ResetLabels(); - label_OS.Text = OSInfo[1] + " - " + OSInfo[3] + " [ build: " + OSInfo[4] + " ]"; - label_Processor.Text = CPUInfo[0] + " [ " + CPUInfo[1] + " Core / " + CPUInfo[2] + " Threads ]"; - label_Graphic.Text = GPUInfo[0] + " - " + GPUInfo[1] + " [ " + GPUInfo[2] + " RAM ]"; - toolStripStatusLabel_Status.ForeColor = Color.FromArgb(0, 255, 0, 0); + if (fs != null) + { + fs.Invoke(d, Strings.SplashFormConfigCaption); + } - RefleshSplashForm(splash, Strings.SplashFormConfigCaption); + if (!File.Exists(Common.xmlpath)) + { + Common.InitConfig(); + } - if (!File.Exists(Common.xmlpath)) - { - Common.InitConfig(); - } - - Config.Load(Common.xmlpath); + Config.Load(Common.xmlpath); - Common.FFmpegPath = Config.Entry["FFmpegLocation"].Value; - Common.ImageParam = Config.Entry["Param"].Value; - Common.VideoParam = Config.Entry["VideoParam"].Value; - Common.AudioParam = Config.Entry["AudioParam"].Value; - Common.MergeParam = Config.Entry["MergeParam"].Value; + Common.FFmpegPath = Config.Entry["FFmpegLocation"].Value; + Common.ImageParam = Config.Entry["Param"].Value; + Common.VideoParam = Config.Entry["VideoParam"].Value; + Common.AudioParam = Config.Entry["AudioParam"].Value; + Common.MergeParam = Config.Entry["MergeParam"].Value; - if (Directory.Exists(Directory.GetCurrentDirectory() + @"\_temp-project\")) - { - Common.DeleteDirectory(Directory.GetCurrentDirectory() + @"\_temp-project\"); - } - if (Config.Entry["VideoLocation"].Value != "") - { - Directory.CreateDirectory(Config.Entry["VideoLocation"].Value + @"\image-frames"); - Directory.CreateDirectory(Config.Entry["VideoLocation"].Value + @"\image-frames2x"); - Common.DeletePathFrames = Config.Entry["VideoLocation"].Value + @"\image-frames"; - Common.DeletePathFrames2x = Config.Entry["VideoLocation"].Value + @"\image-frames2x"; - } - else - { - Directory.CreateDirectory(Directory.GetCurrentDirectory() + @"\_temp-project\image-frames"); - Directory.CreateDirectory(Directory.GetCurrentDirectory() + @"\_temp-project\image-frames2x"); - Common.DeletePathFrames = Directory.GetCurrentDirectory() + @"\_temp-project\image-frames"; - Common.DeletePathFrames2x = Directory.GetCurrentDirectory() + @"\_temp-project\image-frames2x"; - } - if (Config.Entry["AudioLocation"].Value != "") - { - Directory.CreateDirectory(Config.Entry["AudioLocation"].Value + @"\audio"); - Common.DeletePathAudio = Config.Entry["AudioLocation"].Value + @"\audio"; - } - else - { - Directory.CreateDirectory(Directory.GetCurrentDirectory() + @"\_temp-project\audio"); - Common.DeletePathAudio = Directory.GetCurrentDirectory() + @"\_temp-project\audio"; - } - - Directory.CreateDirectory(Directory.GetCurrentDirectory() + @"\_temp-project\images"); + if (Directory.Exists(Directory.GetCurrentDirectory() + @"\_temp-project\")) + { + Common.DeleteDirectory(Directory.GetCurrentDirectory() + @"\_temp-project\"); + } + if (Config.Entry["VideoLocation"].Value != "") + { + Directory.CreateDirectory(Config.Entry["VideoLocation"].Value + @"\image-frames"); + Directory.CreateDirectory(Config.Entry["VideoLocation"].Value + @"\image-frames2x"); + Common.DeletePathFrames = Config.Entry["VideoLocation"].Value + @"\image-frames"; + Common.DeletePathFrames2x = Config.Entry["VideoLocation"].Value + @"\image-frames2x"; + } + else + { + Directory.CreateDirectory(Directory.GetCurrentDirectory() + @"\_temp-project\image-frames"); + Directory.CreateDirectory(Directory.GetCurrentDirectory() + @"\_temp-project\image-frames2x"); + Common.DeletePathFrames = Directory.GetCurrentDirectory() + @"\_temp-project\image-frames"; + Common.DeletePathFrames2x = Directory.GetCurrentDirectory() + @"\_temp-project\image-frames2x"; + } + if (Config.Entry["AudioLocation"].Value != "") + { + Directory.CreateDirectory(Config.Entry["AudioLocation"].Value + @"\audio"); + Common.DeletePathAudio = Config.Entry["AudioLocation"].Value + @"\audio"; + } + else + { + Directory.CreateDirectory(Directory.GetCurrentDirectory() + @"\_temp-project\audio"); + Common.DeletePathAudio = Directory.GetCurrentDirectory() + @"\_temp-project\audio"; + } - if (File.Exists(Directory.GetCurrentDirectory() + @"\updated.dat")) - { - RefleshSplashForm(splash, Strings.SplashFormUpdatingCaption); - File.Delete(Directory.GetCurrentDirectory() + @"\updated.dat"); - string updpath = Directory.GetCurrentDirectory()[..Directory.GetCurrentDirectory().LastIndexOf('\\')]; - File.Delete(updpath + @"\updater.exe"); - File.Delete(updpath + @"\waifu2x-nvger.zip"); - Common.DeleteDirectory(updpath + @"\updater-temp"); - - RefleshSplashForm(splash, Strings.SplashFormUpdatedCaption); - MessageBox.Show(Strings.UpdateCompletedCaption, Strings.MSGInfo, MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - RefleshSplashForm(splash, Strings.SplashFormUpdateCaption); - var update = Task.Run(() => CheckForUpdatesForInit()); - update.Wait(); - } + Directory.CreateDirectory(Directory.GetCurrentDirectory() + @"\_temp-project\images"); + Thread.Sleep(1000); - RefleshSplashForm(splash, Strings.SplashFormFFCaption); + if (fs != null) + { + fs.Invoke(d, Strings.SplashFormSystemCaption); + } + string[] OSInfo = new string[17]; + string[] CPUInfo = new string[3]; + string[] GPUInfo = new string[3]; + SystemInfo.GetSystemInformation(OSInfo); + SystemInfo.GetProcessorsInformation(CPUInfo); + SystemInfo.GetVideoControllerInformation(GPUInfo); + + List GPUList = new(); + List GPUNList = new(); + GPUList = SystemInfo.GetGraphicsCardsInformation(); + GPUNList = SystemInfo.GetGraphicsCardNamesInformation(); + if (GPUList.Count == 0) + { + MessageBox.Show("GPUInfo", Strings.MSGError, MessageBoxButtons.OK, MessageBoxIcon.Error); + } + if (GPUNList.Count == 0) + { + MessageBox.Show("GPUInfo", Strings.MSGError, MessageBoxButtons.OK, MessageBoxIcon.Error); + } - var ffupdate = Task.Run(() => CheckForFFmpeg()); - ffupdate.Wait(); + ResetLabels(); + label_OS.Text = OSInfo[1] + " - " + OSInfo[3] + " [ build: " + OSInfo[4] + " ]"; + label_Processor.Text = CPUInfo[0] + " [ " + CPUInfo[1] + " Core / " + CPUInfo[2] + " Threads ]"; + toolStripStatusLabel_Status.ForeColor = Color.FromArgb(0, 255, 0, 0); - RefleshSplashForm(splash, Strings.SplashFormFinalCaption); + if (fs != null) + { + fs.Invoke(d, "Detected OS: " + OSInfo[1]); + } + Thread.Sleep(10); + if (fs != null) + { + fs.Invoke(d, "Detected CPU: " + CPUInfo[0]); + } + Thread.Sleep(10); - splash.Close(); + if (GPUList.Count == 1) + { + if (fs != null) + { + fs.Invoke(d, "Detected GPU: " + GPUNList); + } + Thread.Sleep(10); + comboBox_GPU.Items.Add(GPUNList[0]); + comboBox_GPU.SelectedIndex = 0; + comboBox_GPU.Enabled = false; + label_Graphic.Text = GPUList[0]; + } + else + { + foreach (var GPU in GPUNList) + { + if (fs != null) + { + fs.Invoke(d, "Detected GPU: " + GPU); + } + Thread.Sleep(10); + comboBox_GPU.Items.Add(GPU); + } + comboBox_GPU.SelectedIndex = 0; + comboBox_GPU.Enabled = true; + label_Graphic.Text = GPUList[0]; + } + + if (fs != null) + { + fs.Invoke(d, Strings.SplashFormFFCaption); + } + var ffupdate = Task.Run(() => CheckForFFmpeg()); + ffupdate.Wait(); + + if (fs != null) + { + fs.Invoke(d, Strings.SplashFormUpdateCaption); + } + Thread.Sleep(500); + if (File.Exists(Directory.GetCurrentDirectory() + @"\updated.dat")) + { + if (fs != null) + { + fs.Invoke(d, Strings.SplashFormUpdatingCaption); + } + File.Delete(Directory.GetCurrentDirectory() + @"\updated.dat"); + string updpath = Directory.GetCurrentDirectory()[..Directory.GetCurrentDirectory().LastIndexOf('\\')]; + File.Delete(updpath + @"\updater.exe"); + File.Delete(updpath + @"\waifu2x-nvger.zip"); + Common.DeleteDirectory(updpath + @"\updater-temp"); + + if (fs != null) + { + fs.Invoke(d, Strings.SplashFormUpdatedCaption); + } + MessageBox.Show(fs, Strings.UpdateCompletedCaption, Strings.MSGInfo, MessageBoxButtons.OK, MessageBoxIcon.Information); + } + else + { + var update = Task.Run(() => CheckForUpdatesForInit()); + update.Wait(); + } + + if (fs != null) + { + fs.Invoke(d, Strings.SplashFormFinalCaption); + } + Thread.Sleep(500); + } + + CloseSplash(); Activate(); } @@ -4181,6 +4275,7 @@ private async void CheckForUpdatesUToolStripMenuItem_Click(object sender, EventA }; Process.Start(pi); Close(); + return; } else { @@ -4195,7 +4290,6 @@ private async void CheckForUpdatesUToolStripMenuItem_Click(object sender, EventA return; } } - return; case 0: MessageBox.Show(this, Strings.LatestString + hv[8..].Replace("\n", "") + "\n" + Strings.CurrentString + ver.FileVersion + "\n" + Strings.Uptodate, Strings.MSGInfo, MessageBoxButtons.OK, MessageBoxIcon.Information); break; @@ -4286,6 +4380,7 @@ private async Task CheckForUpdatesForInit() }; Process.Start(pi); Close(); + return; } else { @@ -4300,7 +4395,6 @@ private async Task CheckForUpdatesForInit() return; } } - return; case 0: // Latest break; case 1: @@ -4392,59 +4486,119 @@ private async Task CheckForFFmpeg() } else if (Config.Entry["FFmpegVersion"].Value == "") // Unknown version ffmpeg { - DialogResult dr = MessageBox.Show(Strings.DLConfirm, Strings.MSGWarning, MessageBoxButtons.YesNo, MessageBoxIcon.Warning); - if (dr == DialogResult.Yes) + if (File.Exists(Directory.GetCurrentDirectory() + @"\res\ffmpeg.exe")) { - if (File.Exists(Directory.GetCurrentDirectory() + @"\res\ffmpeg.exe")) + DialogResult dr = MessageBox.Show(Strings.UnknownFFmpegCaption, Strings.MSGWarning, MessageBoxButtons.YesNo, MessageBoxIcon.Warning); + if (dr == DialogResult.Yes) { - File.Delete(Directory.GetCurrentDirectory() + @"\res\ffmpeg.exe"); - } - Form.ShowDialog(); + if (File.Exists(Directory.GetCurrentDirectory() + @"\res\ffmpeg.exe")) + { + File.Delete(Directory.GetCurrentDirectory() + @"\res\ffmpeg.exe"); + } + Form.ShowDialog(); - if (Common.AbortFlag != 0) - { - Common.DlcancelFlag = 0; - Config.Entry["FFmpegLocation"].Value = ""; - Config.Save(Common.xmlpath); - MessageBox.Show(string.Format(Strings.UnExpectedError, Common.DLlog), Strings.MSGWarning, MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - if (File.Exists(Directory.GetCurrentDirectory() + @"\ffmpeg-release-essentials.zip")) + if (Common.AbortFlag != 0) { - using ZipArchive archive = ZipFile.OpenRead(Directory.GetCurrentDirectory() + @"\ffmpeg-release-essentials.zip"); - foreach (ZipArchiveEntry entry in archive.Entries) + Common.DlcancelFlag = 0; + Config.Entry["FFmpegLocation"].Value = ""; + Config.Save(Common.xmlpath); + MessageBox.Show(string.Format(Strings.UnExpectedError, Common.DLlog), Strings.MSGWarning, MessageBoxButtons.OK, MessageBoxIcon.Warning); + } + else + { + if (File.Exists(Directory.GetCurrentDirectory() + @"\ffmpeg-release-essentials.zip")) { - if (entry.FullName == "ffmpeg-" + hv + "-essentials_build/bin/ffmpeg.exe") + using ZipArchive archive = ZipFile.OpenRead(Directory.GetCurrentDirectory() + @"\ffmpeg-release-essentials.zip"); + foreach (ZipArchiveEntry entry in archive.Entries) { - entry.ExtractToFile(Directory.GetCurrentDirectory() + @"\res\" + entry.Name, true); + if (entry.FullName == "ffmpeg-" + hv + "-essentials_build/bin/ffmpeg.exe") + { + entry.ExtractToFile(Directory.GetCurrentDirectory() + @"\res\" + entry.Name, true); + } } - } - if (File.Exists(Directory.GetCurrentDirectory() + @"\res\ffmpeg.exe")) - { - Config.Entry["FFmpegLocation"].Value = Directory.GetCurrentDirectory() + @"\res\ffmpeg.exe"; - Config.Entry["FFmpegVersion"].Value = "essentials_build " + hv; - Config.Save(Common.xmlpath); - MessageBox.Show(Strings.DLSuccess, Strings.MSGInfo, MessageBoxButtons.OK, MessageBoxIcon.Information); + if (File.Exists(Directory.GetCurrentDirectory() + @"\res\ffmpeg.exe")) + { + Config.Entry["FFmpegLocation"].Value = Directory.GetCurrentDirectory() + @"\res\ffmpeg.exe"; + Config.Entry["FFmpegVersion"].Value = "essentials_build " + hv; + Config.Save(Common.xmlpath); + MessageBox.Show(Strings.DLSuccess, Strings.MSGInfo, MessageBoxButtons.OK, MessageBoxIcon.Information); + } + else + { + MessageBox.Show(string.Format(Strings.UnExpectedError, "extract failed."), Strings.MSGError, MessageBoxButtons.OK, MessageBoxIcon.Error); + } } else { - MessageBox.Show(string.Format(Strings.UnExpectedError, "extract failed."), Strings.MSGError, MessageBoxButtons.OK, MessageBoxIcon.Error); + Config.Entry["FFmpegLocation"].Value = ""; + Config.Save(Common.xmlpath); + MessageBox.Show(string.Format(Strings.UnExpectedError, Common.DLlog), Strings.MSGError, MessageBoxButtons.OK, MessageBoxIcon.Error); } } - else + } + else + { + return; + } + } + else + { + DialogResult dr = MessageBox.Show(Strings.DLConfirm, Strings.MSGWarning, MessageBoxButtons.YesNo, MessageBoxIcon.Warning); + if (dr == DialogResult.Yes) + { + if (File.Exists(Directory.GetCurrentDirectory() + @"\res\ffmpeg.exe")) + { + File.Delete(Directory.GetCurrentDirectory() + @"\res\ffmpeg.exe"); + } + Form.ShowDialog(); + + if (Common.AbortFlag != 0) { + Common.DlcancelFlag = 0; Config.Entry["FFmpegLocation"].Value = ""; Config.Save(Common.xmlpath); - MessageBox.Show(string.Format(Strings.UnExpectedError, Common.DLlog), Strings.MSGError, MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(string.Format(Strings.UnExpectedError, Common.DLlog), Strings.MSGWarning, MessageBoxButtons.OK, MessageBoxIcon.Warning); + } + else + { + if (File.Exists(Directory.GetCurrentDirectory() + @"\ffmpeg-release-essentials.zip")) + { + using ZipArchive archive = ZipFile.OpenRead(Directory.GetCurrentDirectory() + @"\ffmpeg-release-essentials.zip"); + foreach (ZipArchiveEntry entry in archive.Entries) + { + if (entry.FullName == "ffmpeg-" + hv + "-essentials_build/bin/ffmpeg.exe") + { + entry.ExtractToFile(Directory.GetCurrentDirectory() + @"\res\" + entry.Name, true); + } + } + + if (File.Exists(Directory.GetCurrentDirectory() + @"\res\ffmpeg.exe")) + { + Config.Entry["FFmpegLocation"].Value = Directory.GetCurrentDirectory() + @"\res\ffmpeg.exe"; + Config.Entry["FFmpegVersion"].Value = "essentials_build " + hv; + Config.Save(Common.xmlpath); + MessageBox.Show(Strings.DLSuccess, Strings.MSGInfo, MessageBoxButtons.OK, MessageBoxIcon.Information); + } + else + { + MessageBox.Show(string.Format(Strings.UnExpectedError, "extract failed."), Strings.MSGError, MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + else + { + Config.Entry["FFmpegLocation"].Value = ""; + Config.Save(Common.xmlpath); + MessageBox.Show(string.Format(Strings.UnExpectedError, Common.DLlog), Strings.MSGError, MessageBoxButtons.OK, MessageBoxIcon.Error); + } } } + else + { + return; + } } - else - { - return; - } + } else // Update ffmpeg { @@ -4568,23 +4722,45 @@ private async Task CheckForFFmpeg() } } - private static void SplashOperation(bool reflesh) + #region SplashScreenCommon + private static void StartThread() { - while (reflesh) + fs = new FormSplash(); + Application.Run(fs); + } + + + private static void CloseSplash() + { + dop d = new dop(CloseForm); + if (fs != null) { - Application.DoEvents(); - if (!reflesh) - { - break; - } + fs.Invoke(d); } } - private static void RefleshSplashForm(FormSplash form, string text) + private delegate void dop(); + private static void CloseForm() + { + fs.Close(); + } + + private delegate void dmes(string message); + private static void ShowMessage(string message) { - form.ProgressMsg = text; - Application.DoEvents(); - System.Threading.Thread.Sleep(10); + fs.label_log.Text = message; + } + #endregion + + private void ComboBox_GPU_SelectedIndexChanged(object sender, EventArgs e) + { + List GPUList = new(); + GPUList = SystemInfo.GetGraphicsCardsInformation(); + if (GPUList.Count == 0) + { + MessageBox.Show("GPUInfo", Strings.MSGError, MessageBoxButtons.OK, MessageBoxIcon.Error); + } + label_Graphic.Text = GPUList[comboBox_GPU.SelectedIndex]; } } } diff --git a/src/Forms/FormMain.ja.resx b/src/Forms/FormMain.ja.resx index 9096dc4..9110c15 100644 --- a/src/Forms/FormMain.ja.resx +++ b/src/Forms/FormMain.ja.resx @@ -64,6 +64,12 @@ 動画のアップスケーリング + + 70, 20 + + + ファイル (&F) + 178, 22 @@ -94,11 +100,11 @@ 終了 (&X) - - 70, 20 + + 60, 20 - - ファイル (&F) + + 設定 (&S) 203, 22 @@ -112,11 +118,8 @@ 動画アップスケール設定 (&V) - - 60, 20 - - - 設定 (&S) + + ツール (&T) 168, 22 @@ -136,8 +139,11 @@ 画像形式の変更 - - ツール (&T) + + 68, 20 + + + ヘルプ (&H) 289, 22 @@ -154,12 +160,6 @@ アップデートの確認 (&U) - - 68, 20 - - - ヘルプ (&H) - 73, 15 @@ -172,6 +172,9 @@ グラフィックボード: + + システム情報 + 132, 30 @@ -187,36 +190,20 @@ 73, 51 - - システム情報 + + 操作 FFmpegで結合 - - 操作 - - 520, 301 - - - - False + 520, 329 - 520, 325 - - - 372, 15 - - - MiddleCenter + 520, 348 - 520, 304 - - - MiddleCenter + 520, 331 195, 17 diff --git a/src/Forms/FormMain.resx b/src/Forms/FormMain.resx index cdfbfa3..d713e1e 100644 --- a/src/Forms/FormMain.resx +++ b/src/Forms/FormMain.resx @@ -58,604 +58,411 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - False + + 5 + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Size Info + + + button_Merge - - 6, 25 + + 500, 196 - - 487, 50 + + Image Upscaling (&U) - - 1 + + 154, 22 - - Upscaling Image + + 63, 20 - - button_Image + + groupBox1 - - System.Windows.Forms.Button, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - groupBox2 + + MiddleCenter + + + toolStripMenuItem2 + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 1 - - False - - - 6, 80 + + 6 487, 50 - - 2 + + $this - - Upscaling Video + + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - button_Video + + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.Button, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 4 - - groupBox2 + + groupBox1 - - 2 + + Open Video (&V) - - 17, 17 - - - 154, 22 + + 85, 15 + + + label_Size + + + 520, 330 + + + MiddleCenter + + + FormMain Open Imege (&I) - - 154, 22 + + Change video resolution - - Open Video (&V) + + fileFToolStripMenuItem + + + 520, 33 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 151, 6 - - False + + 0, 374 - - 154, 22 + + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Close File (&C) + + groupBox1 - - 151, 6 + + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 154, 22 + + 6, 80 - - Exit (&X) + + 60, 15 - - 54, 20 + + 107, 30 - - File (&F) + + 904, 396 - - 180, 22 + + Not ready - please open the file. - - Image Upscaling (&U) + + 0 - - 180, 22 + + groupBox1 - - Video Upscaling (&V) + + label2 - - 71, 20 + + 174, 17 - - Config (&C) + + System.Windows.Forms.MenuStrip, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 202, 22 + + button_Image - - Change video resolution + + GPU Information - - 202, 22 + + 154, 22 - - Change video format + + False - - 202, 22 + + 7 - - Change image format + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 63, 20 + + exitXToolStripMenuItem - - Tools (&T) + + 180, 22 - - 247, 22 + + System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - About waifu2x-ncnn-vulkan-GUI + + OS Information - - 244, 6 + + $this - - 247, 22 + + Process + + + 12, 345 Check for Updates (&U) - - 64, 20 - - - Help (&H) - - - 0, 0 + + System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 904, 24 + + 9 - - 3 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - menuStrip1 + + label_OS - - menuStrip1 + + False - - System.Windows.Forms.MenuStrip, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 103, 15 - - $this + + MiddleCenter - 7 + 8 - - True + + 10 - - 6, 51 + + 372, 15 - - 60, 15 - - - 4 - - - Prosessor: + + 71, 20 - - label2 + + System.Windows.Forms.Form, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - groupBox1 - - - 4 - - - True + + Prosessor: - - 6, 71 + + 1 - - 85, 15 + + 487, 50 - - 5 + + groupBox2 - - Graphic Board: + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - label3 + + 3 - - System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - groupBox1 + + 6, 30 - - 5 + + 95, 15 - - True + + 372, 296 - - 107, 30 + + 4 - - 87, 15 + + closeFileCToolStripMenuItem - - 9 + + 7 - - OS Information + + 6, 71 - - label_OS + + False - - System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + $this - - groupBox1 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 0 + + 247, 22 - + True - - 6, 30 - - - 103, 15 - - - 8 + + False - - Operating System: + + label_Graphic - - label4 + + groupBox1 - - System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + $this - - groupBox1 + + 12, 33 - + 1 - + True - - 89, 71 + + toolStripMenuItem1 - - 95, 15 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 7 + + aboutWaifu2xncnnvulkanGUIToolStripMenuItem - - GPU Information + + 180, 22 - - label_Graphic + + 520, 349 - - System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 4 - - groupBox1 + + Change video format + + + System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 6, 25 2 - + True - - 64, 51 - - - 94, 15 + + 7, 15 - - 6 + + 87, 15 - - CPU Information + + groupBox1 - - label_Processor + + 2 - - System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Merge with FFmpeg - - groupBox1 + + Change image format - - 3 + + label4 12, 235 - - 500, 105 - - - 6 - - - System Information + + 202, 22 - - groupBox1 + + 54, 20 - - System.Windows.Forms.GroupBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + label_default - - $this + + button_Video - - 6 + + label_File - - False + + 5 - - 7, 135 + + groupBox2 - - 487, 50 + + Tools (&T) - - 3 + + Drag and drop an image or video file here, or open the file... - - Merge with FFmpeg + + 372, 296 - - button_Merge + + Operating System: - - System.Windows.Forms.Button, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Graphic Board: - - groupBox2 + + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 0 + + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 12, 33 + + 520, 332 - - 500, 196 - - - 7 - - - Process - - - groupBox2 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 5 - - - 520, 33 - - - 372, 268 - - - 5 - - - Drag and drop an image or video file here, or open the file... - - - MiddleCenter - - - label1 - - - System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 3 - - - 520, 33 - - - 372, 268 - - - - Zoom - - - 4 - - - pictureBox_DD - - - System.Windows.Forms.PictureBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 8 - - - Yu Gothic UI, 11.25pt - - - 520, 301 - - - 372, 38 - - - 6 - - - label5 - - - MiddleCenter - - - label_default - - - System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 0 - - - 520, 325 - - - 372, 15 - - - 5 - - - Size Info - - - MiddleCenter - - - label_Size - - - System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - - - 520, 306 - - - 372, 15 - - - 4 - - - File Info - - - MiddleCenter - - - label_File - - - System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 1 - - - 132, 17 - - - 174, 17 - - - Not ready - please open the file. - - - 0, 349 - - - 904, 22 - - - 9 - - - statusStrip1 - - - statusStrip1 - - - System.Windows.Forms.StatusStrip, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 4 - - - True - - - 7, 15 - - - 904, 371 + + waifu2x-nvge Reloaded @@ -6894,130 +6701,347 @@ AAAAAAAA - - CenterScreen - - - waifu2x-nvge Reloaded + + 6 - - fileFToolStripMenuItem + + 94, 15 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 8 - - openImegeIToolStripMenuItem + + 372, 38 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + $this - - openVideoVToolStripMenuItem + + toolsTToolStripMenuItem - + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - toolStripMenuItem1 + + MiddleCenter - - System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System Information - - closeFileCToolStripMenuItem + + Close File (&C) - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 3 - - toolStripMenuItem2 + + label1 - - System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + False - - exitXToolStripMenuItem + + 244, 6 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 520, 33 + + + File Info settingsCToolStripMenuItem - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - upscalingSettingsUToolStripMenuItem + + Help (&H) - + + 6 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + changeVideoFormatToolStripMenuItem + + + $this + + + Exit (&X) + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comboBox_GPU + + + Video Upscaling (&V) + + + 1 + + + 202, 22 + + + 154, 22 + + + checkForUpdatesUToolStripMenuItem + + + groupBox1 + + + pictureBox_DD + + + CPU Information + + + openImegeIToolStripMenuItem + + + 9 + + + $this + + + 7 + videoUpscalingSettingsVToolStripMenuItem - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + True - - toolsTToolStripMenuItem + + True - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Yu Gothic UI, 11.25pt - - changeVideoResolutionToolStripMenuItem + + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + + statusStrip1 + + + $this + + + label5 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - changeVideoFormatToolStripMenuItem + + System.Windows.Forms.Button, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + + 151, 6 + + + upscalingSettingsUToolStripMenuItem + + + System.Windows.Forms.StatusStrip, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 7, 135 + + + 202, 22 + + + 4 + + + 64, 51 + + + 4 + + + label_Processor + + + statusStrip1 + + + 904, 22 + + + 0 + + + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + CenterScreen + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 904, 24 + changeImageFormatToolStripMenuItem - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + groupBox2 + + + System.Windows.Forms.Button, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 5 + + + 500, 23 + + + Zoom + + + 5 + + + 247, 22 + + + 500, 105 + + + toolStripStatusLabel_Status aboutAToolStripMenuItem - + + $this + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + 154, 22 + + + System.Windows.Forms.Button, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 2 + + + 0, 0 + + + File (&F) + + + 64, 20 + + + menuStrip1 + + + $this + + + openVideoVToolStripMenuItem + + + menuStrip1 + + + Upscaling Image + + + groupBox2 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - aboutWaifu2xncnnvulkanGUIToolStripMenuItem + + 6, 51 - + + label3 + + + 89, 71 + + + 3 + + + 5 + + + 3 + + + System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 2 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Upscaling Video + + + 6 + + + 372, 15 + + + 9 + toolStripMenuItem3 - - System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 487, 50 - - checkForUpdatesUToolStripMenuItem + + Config (&C) - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + changeVideoResolutionToolStripMenuItem - - toolStripStatusLabel_Status + + About waifu2x-ncnn-vulkan-GUI - - System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 0 - - FormMain + + System.Windows.Forms.PictureBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.Form, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + + + 132, 17 + + + True + \ No newline at end of file diff --git a/src/Forms/FormMain.zh.resx b/src/Forms/FormMain.zh.resx index 689adc1..e6e22ff 100644 --- a/src/Forms/FormMain.zh.resx +++ b/src/Forms/FormMain.zh.resx @@ -187,24 +187,11 @@ 与FFmpeg合并 - - 520, 301 - - - - False - - 520, 325 - - - 372, 15 - - - MiddleCenter + 520, 330 - - MiddleCenter + + 520, 348 146, 17 diff --git a/src/Forms/FormSplash.Designer.cs b/src/Forms/FormSplash.Designer.cs index 359915f..fd55078 100644 --- a/src/Forms/FormSplash.Designer.cs +++ b/src/Forms/FormSplash.Designer.cs @@ -68,7 +68,7 @@ private void InitializeComponent() #endregion - private System.Windows.Forms.Label label_log; + public System.Windows.Forms.Label label_log; private System.Windows.Forms.ProgressBar progressBar1; } } \ No newline at end of file diff --git a/src/Forms/FormSplash.cs b/src/Forms/FormSplash.cs index 278399f..9b9f7ba 100644 --- a/src/Forms/FormSplash.cs +++ b/src/Forms/FormSplash.cs @@ -1,7 +1,9 @@ -using NVGE.Localization; -using System; +using System; +using System.Drawing; using System.IO; +using System.Net; using System.Net.Http; +using System.Net.NetworkInformation; using System.Threading.Tasks; using System.Windows.Forms; @@ -18,10 +20,6 @@ public partial class FormSplash : Form private static readonly HttpClient stream = new(handler); #endregion - //public string[] OSInfo { get; set; } - //public string[] CPUInfo { get; set; } - //public string[] GPUInfo { get; set; } - public FormSplash() { InitializeComponent(); @@ -29,30 +27,22 @@ public FormSplash() private void FormSplash_Load(object sender, EventArgs e) { - BackgroundImage = Properties.Resources.waifu2x_splash; - progressBar1.Style = ProgressBarStyle.Marquee; - progressBar1.MarqueeAnimationSpeed = 50; - //Main(); - } + if (NetworkInterface.GetIsNetworkAvailable()) + { + string url = "https://github.com/XyLe-GBP/waifu2x-ncnn-vulkan-GUI-Edition-Reloaded/raw/master/Properties/waifu2x-splash.png"; + Task st = stream.GetStreamAsync(url); + Bitmap bitmap = new(st.Result); - /*private void Main() - { - foreach (var files in Directory.GetFiles(Directory.GetCurrentDirectory() + @"\res", "*", SearchOption.AllDirectories)) + BackgroundImage = bitmap; + } + else { - FileInfo fi = new(files); - label_log.Text = string.Format(Strings.SplashFormFileCaption, fi.Name); - Refresh(); + BackgroundImage = Properties.Resources.waifu2x_splash; } - string[] oi = new string[17]; - string[] ci = new string[3]; - string[] gi = new string[3]; - SystemInfo.GetSystemInformation(oi); - SystemInfo.GetProcessorsInformation(ci); - SystemInfo.GetVideoControllerInformation(gi); - OSInfo = oi; - CPUInfo = ci; - GPUInfo = gi; - }*/ + + progressBar1.Style = ProgressBarStyle.Marquee; + progressBar1.MarqueeAnimationSpeed = 50; + } public string ProgressMsg { diff --git a/waifu2x-ncnn-vulkan-GUI-Edition-C-Sharp.csproj b/waifu2x-ncnn-vulkan-GUI-Edition-C-Sharp.csproj index a90db7e..b815424 100644 --- a/waifu2x-ncnn-vulkan-GUI-Edition-C-Sharp.csproj +++ b/waifu2x-ncnn-vulkan-GUI-Edition-C-Sharp.csproj @@ -10,8 +10,8 @@ XyLe waifu2x-ncnn-vulkan GUI Edition Reloaded Copyright (C) 2022 - XyLe. All Rights Reserved. - 1.30.2220.615 - 1.30.2220.615 + 1.31.2220.1001 + 1.31.2220.1001 1.30 Super-Resolution Convolutional Neural Network(SRCNN)Utility. csharp-logo.png @@ -34,7 +34,7 @@ - +