BililiveRecorder/BililiveRecorder.WPF/Pages/ToolboxAutoFixPage.xaml

105 lines
7.3 KiB
Plaintext
Raw Normal View History

2021-02-23 18:03:37 +08:00
<ui:Page
x:Class="BililiveRecorder.WPF.Pages.ToolboxAutoFixPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ui="http://schemas.modernwpf.com/2019"
xmlns:l="https://github.com/XAMLMarkupExtensions/WPFLocalizationExtension"
l:LocalizeDictionary.DesignCulture=""
l:ResxLocalizationProvider.DefaultAssembly="BililiveRecorder.WPF"
l:ResxLocalizationProvider.DefaultDictionary="Strings"
xmlns:local="clr-namespace:BililiveRecorder.WPF.Pages"
2021-02-27 20:44:04 +08:00
xmlns:model="clr-namespace:BililiveRecorder.WPF.Models"
2021-04-14 23:46:24 +08:00
xmlns:c="clr-namespace:BililiveRecorder.WPF.Converters"
xmlns:tool="clr-namespace:BililiveRecorder.ToolBox.Commands;assembly=BililiveRecorder.ToolBox"
2021-02-27 20:44:04 +08:00
mc:Ignorable="d" DataContext="{x:Null}"
2021-02-27 13:24:18 +08:00
d:DesignHeight="600" d:DesignWidth="900"
2021-02-23 18:03:37 +08:00
Title="ToolboxAutoFixPage">
2021-02-27 20:44:04 +08:00
<Grid Margin="20">
2021-02-27 13:24:18 +08:00
<Grid.RowDefinitions>
2021-02-27 20:44:04 +08:00
<RowDefinition Height="Auto"/>
2021-02-27 13:24:18 +08:00
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<DockPanel Margin="0,0,0,10">
<Button VerticalAlignment="Bottom" DockPanel.Dock="Right" Content="修复失败?">
<ui:FlyoutService.Flyout>
<ui:Flyout Placement="LeftEdgeAlignedTop">
<StackPanel>
<TextBlock Text="如果修复出错、或在修复后依旧有问题"/>
<TextBlock Text="请发邮件到 rec@danmuji.org 反馈"/>
<TextBlock Text="在邮件内附上此处导出的分析数据"/>
<TextBlock Text="并尽量详细描述视频的问题、所使用的录播姬版本"/>
<TextBlock Text="请分析未经修复的原始文件,而不是录播姬修复后的文件"/>
<TextBlock><Hyperlink NavigateUri=""><Run Text="更多信息请点击这里"/></Hyperlink></TextBlock>
2021-02-27 18:14:44 +08:00
<Button Margin="0,15,0,10" HorizontalAlignment="Center" Click="Export_Button_Click">
2021-02-27 13:24:18 +08:00
<StackPanel Orientation="Horizontal">
<ui:PathIcon Margin="0,0,5,0" Style="{StaticResource PathIconDataExport}"/>
<TextBlock Text="导出原始分析数据"/>
</StackPanel>
</Button>
</StackPanel>
</ui:Flyout>
</ui:FlyoutService.Flyout>
</Button>
2021-02-27 18:14:44 +08:00
<Button VerticalAlignment="Bottom" DockPanel.Dock="Right" Margin="5,0" Click="Fix_Button_Click">
2021-02-27 13:24:18 +08:00
<StackPanel Orientation="Horizontal">
<ui:PathIcon Height="14" Margin="0,0,5,0" Style="{StaticResource PathIconDataAutoFix}"/>
<TextBlock Text="修复"/>
</StackPanel>
</Button>
2021-02-27 18:14:44 +08:00
<Button VerticalAlignment="Bottom" DockPanel.Dock="Right" Click="Analyze_Button_Click">
2021-02-27 13:24:18 +08:00
<StackPanel Orientation="Horizontal">
<ui:PathIcon Height="14" Margin="0,0,5,0" Style="{StaticResource PathIconDataMagnifyScan}"/>
<TextBlock Text="分析"/>
</StackPanel>
</Button>
2021-02-27 18:14:44 +08:00
<Button VerticalAlignment="Bottom" DockPanel.Dock="Right" Margin="0,0,5,0" Content="选择..." Click="SelectFile_Button_Click"/>
<TextBox ui:ControlHelper.PlaceholderText="FLV 文件" ui:TextBoxHelper.IsDeleteButtonVisible="False" x:Name="FileNameTextBox"/>
2021-02-27 13:24:18 +08:00
</DockPanel>
2021-02-27 20:44:04 +08:00
<Border Grid.Row="1" BorderThickness="1" CornerRadius="5" x:Name="analyzeResultDisplayArea" DataContext="{x:Null}"
2021-02-27 13:24:18 +08:00
Background="{DynamicResource SystemControlBackgroundAltHighBrush}"
BorderBrush="{DynamicResource SystemControlBackgroundAccentBrush}">
2021-02-27 20:44:04 +08:00
<Border.Resources>
<DataTemplate x:Key="NullAnalyzeResult">
<StackPanel Margin="16">
<TextBlock Text="点击分析按钮开始分析" FontSize="26" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="注:不分析也可以进行修复操作" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</StackPanel>
</DataTemplate>
2021-04-14 23:46:24 +08:00
<DataTemplate x:Key="NormalAnalyzeResult" DataType="{x:Type tool:AnalyzeResponse}">
2021-02-27 20:44:04 +08:00
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
2021-04-14 23:46:24 +08:00
<TextBox Grid.Row="0" IsReadOnly="True" Text="{Binding InputPath}" ui:ControlHelper.Header="文件:"/>
2021-02-27 20:44:04 +08:00
<TextBlock Grid.Row="1" HorizontalAlignment="Center" FontSize="24" Text="无需修复" Foreground="Green"
Visibility="{Binding NeedFix,Converter={StaticResource InvertBooleanToVisibilityCollapsedConverter}}"/>
<TextBlock Grid.Row="1" HorizontalAlignment="Center" FontSize="24" Text="需要修复" Foreground="Red"
Visibility="{Binding NeedFix,Converter={StaticResource BooleanToVisibilityCollapsedConverter}}"/>
<StackPanel Grid.Row="2" HorizontalAlignment="Center"
Visibility="{Binding Unrepairable,Converter={StaticResource BooleanToVisibilityCollapsedConverter}}">
<TextBlock HorizontalAlignment="Center" FontSize="20" Text="文件内存在录播姬无法自动修复的问题" Foreground="Red"/>
<TextBlock HorizontalAlignment="Center" Text="请点击“修复失败?”按钮并反馈本问题"/>
</StackPanel>
<StackPanel Grid.Row="3" HorizontalAlignment="Center" Margin="10">
2021-04-14 23:46:24 +08:00
<TextBlock Text="{Binding OutputFileCount,StringFormat=修复将会输出 {0} 个文件}" Margin="0,0,0,5"/>
2021-02-27 20:44:04 +08:00
<TextBlock Text="{Binding IssueTypeTimestampJump,StringFormat=时间戳问题 {0} 处}"/>
<TextBlock Text="{Binding IssueTypeDecodingHeader,StringFormat=分辨率、解码问题 {0} 处}"/>
<TextBlock Text="{Binding IssueTypeRepeatingData,StringFormat=重复片段 {0} 处}"/>
<TextBlock Text="{Binding IssueTypeOther,StringFormat=其他问题 {0} 处}"/>
<TextBlock Text="{Binding IssueTypeUnrepairable,StringFormat=无法修复的问题 {0} 处}"/>
</StackPanel>
</Grid>
</DataTemplate>
<c:NullValueTemplateSelector x:Key="SelectorTemplate" Normal="{StaticResource NormalAnalyzeResult}" Null="{StaticResource NullAnalyzeResult}"/>
</Border.Resources>
<ContentControl Content="{Binding}" ContentTemplateSelector="{StaticResource SelectorTemplate}"/>
2021-02-27 13:24:18 +08:00
</Border>
2021-02-23 18:03:37 +08:00
</Grid>
</ui:Page>