Skip to content

Commit 6d9a0ae

Browse files
committed
Improved progress bar
Now it tracks the process correctly until ffmpeg (I have to figure out a way to track ffmpeg converting, but I don't know if it's feasible)
1 parent 0d38578 commit 6d9a0ae

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Video2x/MainWindow.xaml.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ private async void Button_enhance_Click(object sender, RoutedEventArgs e)
6060
string application_path = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
6161
string temp_dir_path = Path.Combine(Path.GetTempPath(), "videoframes");
6262

63-
6463
//exceptions checking
6564

6665
if (textbox_save.Text == "")
@@ -143,7 +142,7 @@ private async void Button_enhance_Click(object sender, RoutedEventArgs e)
143142
frames_count++; //conta i frame totali
144143
}
145144

146-
progress_bar.Maximum = frames_count + 2;
145+
progress_bar.Maximum = frames_count + 1;
147146

148147
string result_file = textbox_save.Text;
149148

@@ -169,9 +168,10 @@ private async void Button_enhance_Click(object sender, RoutedEventArgs e)
169168
foreach (FileInfo frame in lista_files_temp_dir)
170169
{
171170
await Task.Run(() => Esegui_console(temp_dir_path, ".'" + Path.Combine(waifu_2x_folder_temp, @".\waifu2x-converter-cpp.exe") + "' -i " + frame.Name + " -o " + frame.Name, debug));
171+
progress_bar.Value++;
172172
}
173173

174-
progress_bar.Value++;
174+
175175

176176

177177

@@ -277,7 +277,7 @@ public static void DirectoryCopy(string sourceDirName, string destDirName, bool
277277
FileInfo[] files = dir.GetFiles();
278278
foreach (FileInfo file in files)
279279
{
280-
string temppath = System.IO.Path.Combine(destDirName, file.Name);
280+
string temppath = Path.Combine(destDirName, file.Name);
281281
file.CopyTo(temppath, false);
282282
}
283283

@@ -286,7 +286,7 @@ public static void DirectoryCopy(string sourceDirName, string destDirName, bool
286286
{
287287
foreach (DirectoryInfo subdir in dirs)
288288
{
289-
string temppath = System.IO.Path.Combine(destDirName, subdir.Name);
289+
string temppath = Path.Combine(destDirName, subdir.Name);
290290
DirectoryCopy(subdir.FullName, temppath, copySubDirs);
291291
}
292292
}

0 commit comments

Comments
 (0)