BililiveRecorder/BililiveRecorder.WPF/Pages/AdvancedSettingsPage.xaml
2021-11-20 14:34:35 +08:00

138 lines
8.7 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<ui:Page
x:Class="BililiveRecorder.WPF.Pages.AdvancedSettingsPage"
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:c="clr-namespace:BililiveRecorder.WPF.Controls"
xmlns:local="clr-namespace:BililiveRecorder.WPF.Pages"
xmlns:config="clr-namespace:BililiveRecorder.Core.Config.V2;assembly=BililiveRecorder.Core"
xmlns:model="clr-namespace:BililiveRecorder.WPF.Models"
mc:Ignorable="d"
d:DesignHeight="1500" d:DesignWidth="500"
DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=local:RootPage},Path=DataContext.Recorder.Config.Global}"
Title="SettingsPage">
<ui:Page.Resources>
<Style TargetType="TextBlock">
<Setter Property="FontSize" Value="14"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style TargetType="c:SettingWithDefault">
<Setter Property="HorizontalAlignment" Value="Left"/>
</Style>
<Style TargetType="ui:NumberBox">
<Setter Property="Width" Value="220"/>
<Setter Property="ValidationMode" Value="InvalidInputOverwritten"/>
<Setter Property="SpinButtonPlacementMode" Value="Inline"/>
</Style>
</ui:Page.Resources>
<ScrollViewer d:DataContext="{d:DesignInstance Type=config:GlobalConfig}">
<ui:SimpleStackPanel Orientation="Vertical" Spacing="5" Margin="20">
<TextBlock Text="{l:Loc Settings_AdvancedPage_Title}" Style="{StaticResource TitleTextBlockStyle}" FontFamily="Microsoft YaHei" Margin="0,10"/>
<TextBlock Text="{l:Loc Settings_AdvancedPage_Warning}"/>
<GroupBox Header="Cookie">
<StackPanel Orientation="Vertical">
<c:SettingWithDefault IsSettingNotUsingDefault="{Binding HasCookie}">
<TextBox Text="{Binding Cookie,UpdateSourceTrigger=PropertyChanged,Delay=1000}" Width="220" HorizontalAlignment="Left"/>
</c:SettingWithDefault>
<Button Content="Test" Click="TestCookie_Click"/>
</StackPanel>
</GroupBox>
<GroupBox Header="{l:Loc Settings_Danmaku_Title}">
<c:SettingWithDefault IsSettingNotUsingDefault="{Binding HasRecordDanmakuFlushInterval}" Header="{l:Loc Settings_Danmaku_FlushInterval}">
<ui:NumberBox Minimum="0" SmallChange="1" Text="{Binding RecordDanmakuFlushInterval,UpdateSourceTrigger=PropertyChanged}"/>
</c:SettingWithDefault>
</GroupBox>
<GroupBox Header="Timing">
<ui:SimpleStackPanel Spacing="10">
<c:SettingWithDefault IsSettingNotUsingDefault="{Binding HasTimingStreamRetry}" Header="录制重试间隔">
<c:SettingWithDefault.ToolTip>
<TextBlock>录制断开后等待多长时间再尝试开始录制</TextBlock>
</c:SettingWithDefault.ToolTip>
<ui:NumberBox Minimum="1000" Description="单位: 毫秒" SmallChange="100" Text="{Binding TimingStreamRetry,Delay=500}"/>
</c:SettingWithDefault>
<c:SettingWithDefault IsSettingNotUsingDefault="{Binding HasTimingStreamRetryNoQn}" Header="录制重试间隔(无匹配画质)">
<c:SettingWithDefault.ToolTip>
<TextBlock>无匹配的画质后等待多长时间再尝试开始录制</TextBlock>
</c:SettingWithDefault.ToolTip>
<ui:NumberBox Minimum="10" Description="单位: 秒" SmallChange="5" Text="{Binding TimingStreamRetryNoQn,Delay=500}"/>
</c:SettingWithDefault>
<c:SettingWithDefault IsSettingNotUsingDefault="{Binding HasTimingStreamConnect}" Header="录制连接超时">
<c:SettingWithDefault.ToolTip>
<TextBlock>
发出连接直播服务器的请求后等待多长时间<LineBreak/>
防止直播服务器长时间不返回数据导致卡住
</TextBlock>
</c:SettingWithDefault.ToolTip>
<ui:NumberBox Minimum="1000" Description="单位: 毫秒" SmallChange="100" Text="{Binding TimingStreamConnect,Delay=500}"/>
</c:SettingWithDefault>
<c:SettingWithDefault IsSettingNotUsingDefault="{Binding HasTimingDanmakuRetry}" Header="弹幕重连间隔">
<c:SettingWithDefault.ToolTip>
<TextBlock>
弹幕服务器被断开后等待多长时间再尝试连接<LineBreak/>
监控开播的主要途径是通过弹幕服务器发送的信息
</TextBlock>
</c:SettingWithDefault.ToolTip>
<ui:NumberBox Minimum="1000" Description="单位: 毫秒" SmallChange="100" Text="{Binding TimingDanmakuRetry,Delay=500}"/>
</c:SettingWithDefault>
<c:SettingWithDefault IsSettingNotUsingDefault="{Binding HasTimingWatchdogTimeout}" Header="接收数据超时">
<c:SettingWithDefault.ToolTip>
<TextBlock>
在一定时间没有收到直播服务器发送的数据后断开重连<LineBreak/>
用于防止因为玄学网络问题导致卡住
</TextBlock>
</c:SettingWithDefault.ToolTip>
<ui:NumberBox Minimum="1000" Description="单位: 毫秒" SmallChange="100" Text="{Binding TimingWatchdogTimeout,Delay=500}"/>
</c:SettingWithDefault>
<c:SettingWithDefault IsSettingNotUsingDefault="{Binding HasTimingCheckInterval}" Header="开播检查间隔">
<c:SettingWithDefault.ToolTip>
<TextBlock>
此项影响的时间间隔是定时请求HTTP接口的间隔
主要目的是防止没有从弹幕服务器收到开播消息,
所以此项不需要设置太短。<LineBreak/>
时间间隔设置太短会被B站服务器屏蔽导致无法录制。
</TextBlock>
</c:SettingWithDefault.ToolTip>
<ui:NumberBox Minimum="60" Description="单位: 秒" SmallChange="10" Text="{Binding TimingCheckInterval,Delay=500}"/>
</c:SettingWithDefault>
</ui:SimpleStackPanel>
</GroupBox>
<GroupBox Header="Reset Request Policies">
<GroupBox.DataContext>
<model:PollyPolicyModel/>
</GroupBox.DataContext>
<Button Content="Reset" Command="{Binding ResetAllPolicy}"/>
</GroupBox>
<GroupBox Header="手动崩溃 Test Crash">
<StackPanel>
<Button Content="Crash EVERTHING !!1">
<ui:FlyoutService.Flyout>
<ui:Flyout>
<StackPanel>
<TextBlock Text="Are you sure about that?" Margin="0,0,0,12" />
<Button Click="Crash_Click" Content="Yes" />
</StackPanel>
</ui:Flyout>
</ui:FlyoutService.Flyout>
</Button>
<Button Content="Throw in task">
<ui:FlyoutService.Flyout>
<ui:Flyout>
<StackPanel>
<TextBlock Text="Are you sure about that?" Margin="0,0,0,12" />
<Button Click="Throw_In_Task_Click" Content="Yes" />
</StackPanel>
</ui:Flyout>
</ui:FlyoutService.Flyout>
</Button>
</StackPanel>
</GroupBox>
</ui:SimpleStackPanel>
</ScrollViewer>
</ui:Page>