Skip to content

Commit 1a15af4

Browse files
committed
show reencode progress in windows taskbar
1 parent b2b2f3e commit 1a15af4

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

ReencGUI/MainWindow.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
mc:Ignorable="d"
88
Style="{StaticResource ReencWindowStyle}"
99
Title="reika" Height="450" Width="800" MinHeight="304" MinWidth="678" AllowDrop="True" Drop="Window_Drop">
10+
<Window.TaskbarItemInfo>
11+
<TaskbarItemInfo />
12+
</Window.TaskbarItemInfo>
1013
<Grid>
1114
<Grid.ColumnDefinitions>
1215
<ColumnDefinition Width="523*"/>

ReencGUI/MainWindow.xaml.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
using System.Windows.Media;
1818
using System.Windows.Media.Imaging;
1919
using System.Windows.Navigation;
20+
using System.Windows.Shell;
2021

2122
namespace ReencGUI
2223
{
@@ -377,6 +378,7 @@ public void ProcessNextEncode()
377378

378379
private void ProcessEncode(EncodeOperation next)
379380
{
381+
this.TaskbarItemInfo.ProgressState = TaskbarItemProgressState.Normal;
380382
encodesRunning++;
381383
next.uiQueueEntry.Label_Primary.Text = Path.GetFileName(next.outputFileName);
382384
bool cancelling = false;
@@ -405,6 +407,7 @@ private void ProcessEncode(EncodeOperation next)
405407
Dispatcher.Invoke(() =>
406408
{
407409
next.uiQueueEntry.UpdateProgressBasedOnLogKVs(logOutputKVs, next.outputDuration);
410+
this.TaskbarItemInfo.ProgressValue = next.uiQueueEntry.ProgressBar_Operation.Value / 100d;
408411
});
409412
}
410413
else
@@ -418,6 +421,7 @@ private void ProcessEncode(EncodeOperation next)
418421
Console.WriteLine($"FFMPEG exited with code {exit:X}");
419422
Dispatcher.Invoke(() =>
420423
{
424+
this.TaskbarItemInfo.ProgressState = TaskbarItemProgressState.None;
421425
if (exit != 0)
422426
{
423427
EncodeFailed($"Exit code {exit:X}", "", cancelling,

0 commit comments

Comments
 (0)