BililiveRecorder/BililiveRecorder.WPF/Pages/SettingsPage.xaml

122 lines
10 KiB
Plaintext
Raw Normal View History

2020-11-27 18:51:02 +08:00
<ui:Page
x:Class="BililiveRecorder.WPF.Pages.SettingsPage"
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"
2021-01-05 19:08:57 +08:00
xmlns:l="https://github.com/XAMLMarkupExtensions/WPFLocalizationExtension"
l:LocalizeDictionary.DesignCulture=""
l:ResxLocalizationProvider.DefaultAssembly="BililiveRecorder.WPF"
l:ResxLocalizationProvider.DefaultDictionary="Strings"
2021-01-01 14:46:27 +08:00
xmlns:c="clr-namespace:BililiveRecorder.WPF.Controls"
2020-11-27 18:51:02 +08:00
xmlns:local="clr-namespace:BililiveRecorder.WPF.Pages"
2021-01-01 14:46:27 +08:00
xmlns:config="clr-namespace:BililiveRecorder.Core.Config.V2;assembly=BililiveRecorder.Core"
2020-11-27 18:51:02 +08:00
xmlns:flv="clr-namespace:BililiveRecorder.FlvProcessor;assembly=BililiveRecorder.FlvProcessor"
mc:Ignorable="d"
d:DesignHeight="1500" d:DesignWidth="500"
2021-01-01 14:46:27 +08:00
DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=local:RootPage},Path=DataContext.Recorder.Config.Global}"
2020-11-27 18:51:02 +08:00
Title="SettingsPage">
<ui:Page.Resources>
<Style TargetType="TextBlock">
<Setter Property="FontSize" Value="14"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</ui:Page.Resources>
2021-01-01 14:46:27 +08:00
<ScrollViewer d:DataContext="{d:DesignInstance Type=config:GlobalConfig}">
2020-11-27 18:51:02 +08:00
<ui:SimpleStackPanel Orientation="Vertical" Spacing="5" Margin="20">
2021-01-05 19:08:57 +08:00
<TextBlock Text="{l:Loc Settings_SettingsPage_Title}" Style="{StaticResource TitleTextBlockStyle}" FontFamily="Microsoft Yahei" Margin="0,10"/>
<GroupBox Header="{l:Loc Settings_Danmaku_Title}">
2020-11-27 18:51:02 +08:00
<StackPanel>
2021-01-05 19:08:57 +08:00
<ui:ToggleSwitch IsOn="{Binding RecordDanmaku}" Name="RecordDanmakuCheckbox" OnContent="{l:Loc Settings_Danmaku_ToggleSwitch_Enabled}" OffContent="{l:Loc Settings_Danmaku_ToggleSwitch_Enabled}"/>
2020-12-10 17:02:56 +08:00
<StackPanel Margin="0,7,0,0" Visibility="{Binding ElementName=RecordDanmakuCheckbox,Path=IsOn,Converter={StaticResource BooleanToVisibilityCollapsedConverter}}">
<ui:ToggleSwitch IsEnabled="{Binding RecordDanmaku}" IsOn="{Binding RecordDanmakuSuperChat}"
2021-01-05 19:08:57 +08:00
OnContent="{l:Loc Settings_Danmaku_ToggleSwitch_SuperChat}" OffContent="{l:Loc Settings_Danmaku_ToggleSwitch_SuperChat}"/>
2020-11-27 18:51:02 +08:00
<ui:ToggleSwitch IsEnabled="{Binding RecordDanmaku}" IsOn="{Binding RecordDanmakuGuard}"
2021-01-05 19:08:57 +08:00
OnContent="{l:Loc Settings_Danmaku_ToggleSwitch_Guard}" OffContent="{l:Loc Settings_Danmaku_ToggleSwitch_Guard}"/>
<ui:ToggleSwitch IsEnabled="{Binding RecordDanmaku}" IsOn="{Binding RecordDanmakuGift}"
2021-01-05 19:08:57 +08:00
OnContent="{l:Loc Settings_Danmaku_ToggleSwitch_Gift}" OffContent="{l:Loc Settings_Danmaku_ToggleSwitch_Gift}"/>
<ui:ToggleSwitch IsEnabled="{Binding RecordDanmaku}" IsOn="{Binding RecordDanmakuRaw}"
2021-01-05 19:08:57 +08:00
OnContent="{l:Loc Settings_Danmaku_ToggleSwitch_Raw}" OffContent="{l:Loc Settings_Danmaku_ToggleSwitch_Raw}"/>
2020-11-27 18:51:02 +08:00
</StackPanel>
</StackPanel>
</GroupBox>
2021-01-05 19:08:57 +08:00
<GroupBox Header="{l:Loc Settings_Splitting_Title}">
2020-11-27 18:51:02 +08:00
<StackPanel>
2021-01-05 19:08:57 +08:00
<RadioButton GroupName="Splitting" Name="CutDisabledRadioButton" Content="{l:Loc Settings_Splitting_RadioButton_Disabled}"
2020-11-27 18:51:02 +08:00
IsChecked="{Binding Path=CuttingMode, Converter={StaticResource EnumToBooleanConverter},
ConverterParameter={x:Static flv:AutoCuttingMode.Disabled}}" />
2021-01-05 19:08:57 +08:00
<RadioButton GroupName="Splitting" Name="CutBySizeRadioButton" Content="{l:Loc Settings_Splitting_RadioButton_BySize}"
2020-11-27 18:51:02 +08:00
IsChecked="{Binding Path=CuttingMode, Converter={StaticResource EnumToBooleanConverter},
ConverterParameter={x:Static flv:AutoCuttingMode.BySize}}" />
2021-01-05 19:08:57 +08:00
<RadioButton GroupName="Splitting" Name="CutByTimeRadioButton" Content="{l:Loc Settings_Splitting_RadioButton_ByTime}"
2020-11-27 18:51:02 +08:00
IsChecked="{Binding Path=CuttingMode, Converter={StaticResource EnumToBooleanConverter},
ConverterParameter={x:Static flv:AutoCuttingMode.ByTime}}" />
<StackPanel Orientation="Horizontal" Margin="0,5,0,0"
2020-12-10 17:02:56 +08:00
Visibility="{Binding ElementName=CutDisabledRadioButton,Path=IsChecked,Converter={StaticResource InvertBooleanToVisibilityCollapsedConverter}}">
2021-01-05 19:08:57 +08:00
<TextBlock Text="{l:Loc Settings_Splitting_TextBox_Left}"/>
2020-11-27 18:51:02 +08:00
<TextBox Margin="5,0" Width="100" Text="{Binding CuttingNumber,Delay=500}" ui:TextBoxHelper.IsDeleteButtonVisible="False"/>
2021-01-05 19:08:57 +08:00
<TextBlock Text="{l:Loc Settings_Splitting_TextBox_SizeUnit}" Visibility="{Binding ElementName=CutBySizeRadioButton,Path=IsChecked,Converter={StaticResource BooleanToVisibilityCollapsedConverter}}"/>
<TextBlock Text="{l:Loc Settings_Splitting_TextBox_TimeUnit}" Visibility="{Binding ElementName=CutByTimeRadioButton,Path=IsChecked,Converter={StaticResource BooleanToVisibilityCollapsedConverter}}"/>
<TextBlock Text="{l:Loc Settings_Splitting_TextBox_Right}"/>
2020-11-27 18:51:02 +08:00
</StackPanel>
</StackPanel>
</GroupBox>
2021-01-05 19:08:57 +08:00
<GroupBox Header="{l:Loc Settings_FileName_Title}">
<StackPanel MaxWidth="500" HorizontalAlignment="Left">
<StackPanel Orientation="Horizontal" Margin="0,0,0,10">
<StackPanel.ToolTip>
2021-01-08 18:54:50 +08:00
<TextBlock FontSize="13" Text="{l:Loc Settings_FileName_Description_ToolTip}"
l:ResxLocalizationProvider.DefaultDictionary="Strings"/>
2021-01-05 19:08:57 +08:00
</StackPanel.ToolTip>
<TextBlock Text="{l:Loc Settings_FileName_Description_Text}"/>
<ui:PathIcon Margin="2,0" VerticalAlignment="Center" Height="15" Style="{StaticResource PathIconDataInformationOutline}"/>
</StackPanel>
2021-01-05 22:50:10 +08:00
<c:SettingWithDefault IsSettingNotUsingDefault="{Binding HasRecordFilenameFormat}" Header="{l:Loc Settings_FileName_Record}">
2021-01-05 19:08:57 +08:00
<TextBox Text="{Binding RecordFilenameFormat,Delay=500}" ui:TextBoxHelper.IsDeleteButtonVisible="False"/>
</c:SettingWithDefault>
2021-01-05 22:50:10 +08:00
<c:SettingWithDefault IsSettingNotUsingDefault="{Binding HasClipFilenameFormat}" Header="{l:Loc Settings_FileName_Clip}" Margin="0,5,0,0"
2021-01-05 19:08:57 +08:00
Visibility="{Binding ElementName=EnabledFeatureRecordOnlyRadioButton,Path=IsChecked,Converter={StaticResource InvertBooleanToVisibilityCollapsedConverter}}">
<TextBox Text="{Binding ClipFilenameFormat,Delay=500}" ui:TextBoxHelper.IsDeleteButtonVisible="False"/>
</c:SettingWithDefault>
</StackPanel>
</GroupBox>
2021-01-05 22:50:10 +08:00
<GroupBox Header="{l:Loc Settings_Webhook_Title}">
<StackPanel MaxWidth="400" HorizontalAlignment="Left">
<TextBlock Text="{l:Loc Settings_Webhook_Address}"/>
<TextBox AcceptsReturn="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Visible"
Text="{Binding WebHookUrls,UpdateSourceTrigger=PropertyChanged,Delay=1000}" ui:TextBoxHelper.IsDeleteButtonVisible="False"/>
</StackPanel>
</GroupBox>
2021-01-05 19:08:57 +08:00
<GroupBox Header="{l:Loc Settings_RecordMode_Title}">
2020-11-27 18:51:02 +08:00
<StackPanel>
2021-01-05 19:08:57 +08:00
<TextBlock Text="{l:Loc Settings_RecordMode_Description}"/>
<RadioButton GroupName="RecordMode" Name="EnabledFeatureRecordOnlyRadioButton" Content="{l:Loc Settings_RecordMode_RadioButton_RecordOnly}"
2020-11-27 18:51:02 +08:00
IsChecked="{Binding Path=EnabledFeature, Converter={StaticResource EnumToBooleanConverter},
ConverterParameter={x:Static flv:EnabledFeature.RecordOnly}}" />
2021-01-05 19:08:57 +08:00
<RadioButton GroupName="RecordMode" Content="{l:Loc Settings_RecordMode_RadioButton_ClipOnly}"
2020-11-27 18:51:02 +08:00
IsChecked="{Binding Path=EnabledFeature, Converter={StaticResource EnumToBooleanConverter},
ConverterParameter={x:Static flv:EnabledFeature.ClipOnly}}" />
2021-01-05 19:08:57 +08:00
<RadioButton GroupName="RecordMode" Content="{l:Loc Settings_RecordMode_RadioButton_Both}"
2020-11-27 18:51:02 +08:00
IsChecked="{Binding Path=EnabledFeature, Converter={StaticResource EnumToBooleanConverter},
ConverterParameter={x:Static flv:EnabledFeature.Both}}" />
2020-12-10 17:02:56 +08:00
<StackPanel Margin="0,5,0,0" Visibility="{Binding ElementName=EnabledFeatureRecordOnlyRadioButton,Path=IsChecked,Converter={StaticResource InvertBooleanToVisibilityCollapsedConverter}}">
2020-11-27 18:51:02 +08:00
<StackPanel Orientation="Horizontal">
2021-01-08 18:55:03 +08:00
<TextBlock Text="{l:Loc Settings_RecordMode_Clip_PastDuration_Left}"/>
2020-11-27 18:51:02 +08:00
<TextBox Margin="5,0" Width="80" Text="{Binding ClipLengthPast,Delay=500}" ui:TextBoxHelper.IsDeleteButtonVisible="False"/>
2021-01-08 18:55:03 +08:00
<TextBlock Text="{l:Loc Settings_RecordMode_Clip_PastDuration_Right}"/>
2020-11-27 18:51:02 +08:00
</StackPanel>
<StackPanel Orientation="Horizontal">
2021-01-08 18:55:03 +08:00
<TextBlock Text="{l:Loc Settings_RecordMode_Clip_FutureDuration_Left}"/>
2020-11-27 18:51:02 +08:00
<TextBox Margin="5,0" Width="80" Text="{Binding ClipLengthFuture,Delay=500}" ui:TextBoxHelper.IsDeleteButtonVisible="False"/>
2021-01-08 18:55:03 +08:00
<TextBlock Text="{l:Loc Settings_RecordMode_Clip_FutureDuration_Right}"/>
2020-11-27 18:51:02 +08:00
</StackPanel>
</StackPanel>
</StackPanel>
</GroupBox>
</ui:SimpleStackPanel>
</ScrollViewer>
</ui:Page>