mirror of
https://github.com/BililiveRecorder/BililiveRecorder.git
synced 2024-11-16 11:42:22 +08:00
311 lines
19 KiB
XML
311 lines
19 KiB
XML
<Window x:Class="BililiveRecorder.WPF.SettingsWindow"
|
||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||
xmlns:local="clr-namespace:BililiveRecorder.WPF"
|
||
xmlns:core="clr-namespace:BililiveRecorder.Core;assembly=BililiveRecorder.Core"
|
||
xmlns:flv="clr-namespace:BililiveRecorder.FlvProcessor;assembly=BililiveRecorder.FlvProcessor"
|
||
mc:Ignorable="d"
|
||
ShowInTaskbar="False" ResizeMode="NoResize"
|
||
Title="设置 - 录播姬" Height="500" Width="270">
|
||
<Window.Resources>
|
||
<local:ValueConverterGroup x:Key="EnumToInvertBooleanConverter">
|
||
<local:EnumToBooleanConverter/>
|
||
<local:BooleanInverterConverter/>
|
||
</local:ValueConverterGroup>
|
||
<local:EnumToBooleanConverter x:Key="EnumToBooleanConverter"/>
|
||
</Window.Resources>
|
||
<Grid>
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition/>
|
||
<RowDefinition Height="Auto"/>
|
||
</Grid.RowDefinitions>
|
||
<Grid Margin="5">
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition Height="Auto"/>
|
||
<RowDefinition Height="Auto"/>
|
||
<RowDefinition Height="Auto"/>
|
||
<RowDefinition Height="Auto"/>
|
||
<RowDefinition Height="Auto"/>
|
||
<RowDefinition Height="Auto"/>
|
||
<RowDefinition Height="Auto"/>
|
||
<RowDefinition Height="Auto"/>
|
||
<RowDefinition Height="Auto"/>
|
||
<RowDefinition Height="1*"/>
|
||
</Grid.RowDefinitions>
|
||
<Grid.Resources>
|
||
<ResourceDictionary>
|
||
<Style TargetType="TextBlock">
|
||
<Style.Setters>
|
||
<Setter Property="HorizontalAlignment" Value="Right"></Setter>
|
||
<Setter Property="VerticalAlignment" Value="Center"></Setter>
|
||
</Style.Setters>
|
||
</Style>
|
||
</ResourceDictionary>
|
||
</Grid.Resources>
|
||
<Grid Grid.Row="0">
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition Height="Auto"/>
|
||
<RowDefinition Height="Auto"/>
|
||
<RowDefinition Height="Auto"/>
|
||
<RowDefinition Height="Auto"/>
|
||
<RowDefinition Height="Auto"/>
|
||
<RowDefinition Height="Auto"/>
|
||
<RowDefinition Height="Auto"/>
|
||
<RowDefinition Height="Auto"/>
|
||
</Grid.RowDefinitions>
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="2*"/>
|
||
<ColumnDefinition Width="3*"/>
|
||
</Grid.ColumnDefinitions>
|
||
<TextBlock Grid.Row="0" Grid.Column="0">录制重试间隔:</TextBlock>
|
||
<Grid Grid.Row="0" Grid.Column="1" VerticalAlignment="Center">
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="1*"/>
|
||
<ColumnDefinition Width="Auto"/>
|
||
</Grid.ColumnDefinitions>
|
||
<local:ClickSelectTextBox Grid.Column="0" Text="{Binding TimingStreamRetry,Delay=500,UpdateSourceTrigger=PropertyChanged}">
|
||
<local:ClickSelectTextBox.ToolTip>
|
||
<ToolTip>
|
||
<StackPanel>
|
||
<StackPanel.Resources>
|
||
<Style TargetType="TextBlock">
|
||
<Setter Property="TextAlignment" Value="Left"/>
|
||
</Style>
|
||
</StackPanel.Resources>
|
||
<TextBlock FontWeight="Bold">注:</TextBlock>
|
||
<TextBlock>录制断开后等待多长时间再尝试开始录制</TextBlock>
|
||
</StackPanel>
|
||
</ToolTip>
|
||
</local:ClickSelectTextBox.ToolTip>
|
||
</local:ClickSelectTextBox>
|
||
<TextBlock Grid.Column="1" Margin="5,0,10,0">毫秒</TextBlock>
|
||
</Grid>
|
||
<TextBlock Grid.Row="1" Grid.Column="0">录制连接超时:</TextBlock>
|
||
<Grid Grid.Row="1" Grid.Column="1" VerticalAlignment="Center">
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="1*"/>
|
||
<ColumnDefinition Width="Auto"/>
|
||
</Grid.ColumnDefinitions>
|
||
<local:ClickSelectTextBox Grid.Column="0" Text="{Binding TimingStreamConnect,Delay=500,UpdateSourceTrigger=PropertyChanged}">
|
||
<local:ClickSelectTextBox.ToolTip>
|
||
<ToolTip>
|
||
<StackPanel>
|
||
<StackPanel.Resources>
|
||
<Style TargetType="TextBlock">
|
||
<Setter Property="TextAlignment" Value="Left"/>
|
||
</Style>
|
||
</StackPanel.Resources>
|
||
<TextBlock FontWeight="Bold">注:</TextBlock>
|
||
<TextBlock>发出连接直播服务器的请求后等待多长时间</TextBlock>
|
||
<TextBlock>防止直播服务器长时间不返回数据导致卡住</TextBlock>
|
||
</StackPanel>
|
||
</ToolTip>
|
||
</local:ClickSelectTextBox.ToolTip>
|
||
</local:ClickSelectTextBox>
|
||
<TextBlock Grid.Column="1" Margin="5,0,10,0">毫秒</TextBlock>
|
||
</Grid>
|
||
<TextBlock Grid.Row="2" Grid.Column="0">弹幕重连间隔:</TextBlock>
|
||
<Grid Grid.Row="2" Grid.Column="1" VerticalAlignment="Center">
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="1*"/>
|
||
<ColumnDefinition Width="Auto"/>
|
||
</Grid.ColumnDefinitions>
|
||
<local:ClickSelectTextBox Grid.Column="0" Text="{Binding TimingDanmakuRetry,Delay=500,UpdateSourceTrigger=PropertyChanged}">
|
||
<local:ClickSelectTextBox.ToolTip>
|
||
<ToolTip>
|
||
<StackPanel>
|
||
<StackPanel.Resources>
|
||
<Style TargetType="TextBlock">
|
||
<Setter Property="TextAlignment" Value="Left"/>
|
||
</Style>
|
||
</StackPanel.Resources>
|
||
<TextBlock FontWeight="Bold">注:</TextBlock>
|
||
<TextBlock>弹幕服务器被断开后等待多长时间再尝试连接</TextBlock>
|
||
<TextBlock>监控开播的主要途径是通过弹幕服务器发送的信息</TextBlock>
|
||
</StackPanel>
|
||
</ToolTip>
|
||
</local:ClickSelectTextBox.ToolTip>
|
||
</local:ClickSelectTextBox>
|
||
<TextBlock Grid.Column="1" Margin="5,0,10,0">毫秒</TextBlock>
|
||
</Grid>
|
||
<TextBlock Grid.Row="3" Grid.Column="0">接收数据超时:</TextBlock>
|
||
<Grid Grid.Row="3" Grid.Column="1" VerticalAlignment="Center">
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="1*"/>
|
||
<ColumnDefinition Width="Auto"/>
|
||
</Grid.ColumnDefinitions>
|
||
<local:ClickSelectTextBox Grid.Column="0" Text="{Binding TimingWatchdogTimeout,Delay=500,UpdateSourceTrigger=PropertyChanged}">
|
||
<local:ClickSelectTextBox.ToolTip>
|
||
<ToolTip>
|
||
<StackPanel>
|
||
<StackPanel.Resources>
|
||
<Style TargetType="TextBlock">
|
||
<Setter Property="TextAlignment" Value="Left"/>
|
||
</Style>
|
||
</StackPanel.Resources>
|
||
<TextBlock FontWeight="Bold">注:</TextBlock>
|
||
<TextBlock>在一定时间没有收到直播服务器发送的数据后断开重连。</TextBlock>
|
||
<TextBlock>用于防止因为玄学网络问题导致卡住</TextBlock>
|
||
</StackPanel>
|
||
</ToolTip>
|
||
</local:ClickSelectTextBox.ToolTip>
|
||
</local:ClickSelectTextBox>
|
||
<TextBlock Grid.Column="1" Margin="5,0,10,0">毫秒</TextBlock>
|
||
</Grid>
|
||
<TextBlock Grid.Row="5" Grid.Column="0">开播检查间隔:</TextBlock>
|
||
<Grid Grid.Row="5" Grid.Column="1" VerticalAlignment="Center">
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="1*"/>
|
||
<ColumnDefinition Width="Auto"/>
|
||
</Grid.ColumnDefinitions>
|
||
<local:ClickSelectTextBox Grid.Column="0" Text="{Binding TimingCheckInterval,Delay=500,UpdateSourceTrigger=PropertyChanged}">
|
||
<local:ClickSelectTextBox.ToolTip>
|
||
<ToolTip>
|
||
<StackPanel>
|
||
<StackPanel.Resources>
|
||
<Style TargetType="TextBlock">
|
||
<Setter Property="TextAlignment" Value="Left"/>
|
||
</Style>
|
||
</StackPanel.Resources>
|
||
<TextBlock FontWeight="Bold">注:</TextBlock>
|
||
<TextBlock>此项影响的时间间隔是定时请求HTTP接口的间隔,</TextBlock>
|
||
<TextBlock>主要目的是防止没有从弹幕服务器收到开播消息。</TextBlock>
|
||
<TextBlock>通常主播开播后会通过弹幕服务器通知录播姬开始录制,</TextBlock>
|
||
<TextBlock>所以此项不需要设置太短。</TextBlock>
|
||
<TextBlock>时间间隔设置太短会导致被B站服务器屏蔽,无法录制。</TextBlock>
|
||
</StackPanel>
|
||
</ToolTip>
|
||
</local:ClickSelectTextBox.ToolTip>
|
||
</local:ClickSelectTextBox>
|
||
<TextBlock Grid.Column="1" Margin="5,0,10,0">秒</TextBlock>
|
||
</Grid>
|
||
</Grid>
|
||
<Separator Grid.Row="1"/>
|
||
<Grid Grid.Row="2">
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition Height="Auto"/>
|
||
<RowDefinition Height="Auto"/>
|
||
<RowDefinition Height="Auto"/>
|
||
<RowDefinition Height="Auto"/>
|
||
</Grid.RowDefinitions>
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="2*"/>
|
||
<ColumnDefinition Width="3*"/>
|
||
</Grid.ColumnDefinitions>
|
||
<TextBlock Grid.Row="1" Grid.Column="0">剪辑过去时长:</TextBlock>
|
||
<Grid Grid.Row="1" Grid.Column="1" VerticalAlignment="Center">
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="1*"/>
|
||
<ColumnDefinition Width="Auto"/>
|
||
</Grid.ColumnDefinitions>
|
||
<local:ClickSelectTextBox Grid.Column="0" Text="{Binding ClipLengthPast,Delay=500,UpdateSourceTrigger=PropertyChanged}"
|
||
IsEnabled="{Binding Path=EnabledFeature, Converter={StaticResource EnumToInvertBooleanConverter},
|
||
ConverterParameter={x:Static flv:EnabledFeature.RecordOnly}}"/>
|
||
<TextBlock Grid.Column="1" Margin="5,0,10,0">秒</TextBlock>
|
||
</Grid>
|
||
<TextBlock Grid.Row="2" Grid.Column="0">剪辑将来时长:</TextBlock>
|
||
<Grid Grid.Row="2" Grid.Column="1" VerticalAlignment="Center">
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="1*"/>
|
||
<ColumnDefinition Width="Auto"/>
|
||
</Grid.ColumnDefinitions>
|
||
<local:ClickSelectTextBox Grid.Column="0" Text="{Binding ClipLengthFuture,Delay=500,UpdateSourceTrigger=PropertyChanged}"
|
||
IsEnabled="{Binding Path=EnabledFeature, Converter={StaticResource EnumToInvertBooleanConverter},
|
||
ConverterParameter={x:Static flv:EnabledFeature.RecordOnly}}"/>
|
||
<TextBlock Grid.Column="1" Margin="5,0,10,0">秒</TextBlock>
|
||
</Grid>
|
||
<StackPanel Grid.Row="3" Grid.ColumnSpan="2" Margin="10,0">
|
||
<RadioButton GroupName="EnabledFeature" IsChecked="{Binding Path=EnabledFeature, Converter={StaticResource EnumToBooleanConverter},
|
||
ConverterParameter={x:Static flv:EnabledFeature.ClipOnly}}" ToolTipService.InitialShowDelay="0"
|
||
ToolTip="不保存所有直播数据到硬盘">只使用即时回放剪辑功能</RadioButton>
|
||
<RadioButton GroupName="EnabledFeature" IsChecked="{Binding Path=EnabledFeature, Converter={StaticResource EnumToBooleanConverter},
|
||
ConverterParameter={x:Static flv:EnabledFeature.RecordOnly}}" ToolTipService.InitialShowDelay="0"
|
||
ToolTip="占内存更少,但不能剪辑回放">只使用录制功能</RadioButton>
|
||
<RadioButton GroupName="EnabledFeature" IsChecked="{Binding Path=EnabledFeature, Converter={StaticResource EnumToBooleanConverter},
|
||
ConverterParameter={x:Static flv:EnabledFeature.Both}}">同时启用两个功能</RadioButton>
|
||
</StackPanel>
|
||
</Grid>
|
||
<Separator Grid.Row="3"/>
|
||
<Grid Grid.Row="4">
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition Height="Auto"/>
|
||
<RowDefinition Height="Auto"/>
|
||
</Grid.RowDefinitions>
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="2*"/>
|
||
<ColumnDefinition Width="3*"/>
|
||
</Grid.ColumnDefinitions>
|
||
<TextBlock Grid.Row="0" Grid.Column="0">自动切割单位:</TextBlock>
|
||
<Grid Grid.Row="0" Grid.Column="1" VerticalAlignment="Center">
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="1*"/>
|
||
<ColumnDefinition Width="Auto"/>
|
||
</Grid.ColumnDefinitions>
|
||
<local:ClickSelectTextBox Grid.Column="0" Text="{Binding CuttingNumber,Delay=500,UpdateSourceTrigger=PropertyChanged}"
|
||
ToolTipService.InitialShowDelay="0" ToolTipService.ShowDuration="20000"
|
||
IsEnabled="{Binding Path=CuttingMode, Converter={StaticResource EnumToInvertBooleanConverter},
|
||
ConverterParameter={x:Static flv:AutoCuttingMode.Disabled}}">
|
||
<local:ClickSelectTextBox.ToolTip>
|
||
<ToolTip>
|
||
<StackPanel>
|
||
<StackPanel.Resources>
|
||
<Style TargetType="TextBlock">
|
||
<Setter Property="TextAlignment" Value="Left"/>
|
||
</Style>
|
||
</StackPanel.Resources>
|
||
<TextBlock FontWeight="Bold">注:</TextBlock>
|
||
<TextBlock>实际切割出来的视频文件会比设定的要大一点</TextBlock>
|
||
<TextBlock>根据实际情况不同,可能会 大不到1MiB 或 长几秒钟</TextBlock>
|
||
<TextBlock>请根据实际需求调整</TextBlock>
|
||
</StackPanel>
|
||
</ToolTip>
|
||
</local:ClickSelectTextBox.ToolTip>
|
||
</local:ClickSelectTextBox>
|
||
<TextBlock Grid.Column="1" Margin="5,0,10,0">分 或 MiB</TextBlock>
|
||
</Grid>
|
||
<StackPanel Grid.Row="1" Grid.ColumnSpan="2" Margin="10,0">
|
||
<RadioButton GroupName="CuttingMode" IsChecked="{Binding Path=CuttingMode, Converter={StaticResource EnumToBooleanConverter},
|
||
ConverterParameter={x:Static flv:AutoCuttingMode.Disabled}}">不切割录制的视频文件</RadioButton>
|
||
<RadioButton GroupName="CuttingMode" IsChecked="{Binding Path=CuttingMode, Converter={StaticResource EnumToBooleanConverter},
|
||
ConverterParameter={x:Static flv:AutoCuttingMode.ByTime}}">根据视频时间(分)切割</RadioButton>
|
||
<RadioButton GroupName="CuttingMode" IsChecked="{Binding Path=CuttingMode, Converter={StaticResource EnumToBooleanConverter},
|
||
ConverterParameter={x:Static flv:AutoCuttingMode.BySize}}">根据文件大小(MiB)切割</RadioButton>
|
||
</StackPanel>
|
||
</Grid>
|
||
<Separator Grid.Row="5"/>
|
||
<Grid Grid.Row="6" Margin="10,0">
|
||
<CheckBox IsChecked="{Binding AvoidTxy}">
|
||
<TextBlock>
|
||
尽量不使用有问题的腾讯云服务器
|
||
<LineBreak/> 可减少录出奇葩损坏文件的概率
|
||
</TextBlock>
|
||
</CheckBox>
|
||
</Grid>
|
||
<Separator Grid.Row="7"/>
|
||
<Grid Grid.Row="8" Margin="10,0">
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition Height="*"/>
|
||
<RowDefinition Height="*"/>
|
||
</Grid.RowDefinitions>
|
||
<TextBlock HorizontalAlignment="Left">请求 API 时使用 Cookie: (可选)</TextBlock>
|
||
<local:ClickSelectTextBox Grid.Row="1" Text="{Binding Cookie,Delay=500,UpdateSourceTrigger=PropertyChanged}"/>
|
||
</Grid>
|
||
<!--
|
||
<TextBlock Grid.Row="4" Grid.Column="0"></TextBlock>
|
||
<StackPanel Grid.Row="4" Grid.Column="1">
|
||
|
||
</StackPanel>
|
||
-->
|
||
</Grid>
|
||
|
||
<StackPanel Orientation="Horizontal" Grid.Row="1"
|
||
HorizontalAlignment="Center"
|
||
VerticalAlignment="Center">
|
||
<Button Click="Save" Padding="20,5" Margin="5" IsDefault="True">保存</Button>
|
||
<Button Click="Cancel" Padding="20,5" Margin="5" IsCancel="True">取消</Button>
|
||
</StackPanel>
|
||
</Grid>
|
||
</Window>
|