mirror of
https://github.com/BililiveRecorder/BililiveRecorder.git
synced 2024-11-16 19:57:27 +08:00
122 lines
10 KiB
XML
122 lines
10 KiB
XML
<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"
|
|
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:flv="clr-namespace:BililiveRecorder.FlvProcessor;assembly=BililiveRecorder.FlvProcessor"
|
|
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>
|
|
</ui:Page.Resources>
|
|
<ScrollViewer d:DataContext="{d:DesignInstance Type=config:GlobalConfig}">
|
|
<ui:SimpleStackPanel Orientation="Vertical" Spacing="5" Margin="20">
|
|
<TextBlock Text="{l:Loc Settings_SettingsPage_Title}" Style="{StaticResource TitleTextBlockStyle}" FontFamily="Microsoft Yahei" Margin="0,10"/>
|
|
<GroupBox Header="{l:Loc Settings_Danmaku_Title}">
|
|
<StackPanel>
|
|
<ui:ToggleSwitch IsOn="{Binding RecordDanmaku}" Name="RecordDanmakuCheckbox" OnContent="{l:Loc Settings_Danmaku_ToggleSwitch_Enabled}" OffContent="{l:Loc Settings_Danmaku_ToggleSwitch_Enabled}"/>
|
|
<StackPanel Margin="0,7,0,0" Visibility="{Binding ElementName=RecordDanmakuCheckbox,Path=IsOn,Converter={StaticResource BooleanToVisibilityCollapsedConverter}}">
|
|
<ui:ToggleSwitch IsEnabled="{Binding RecordDanmaku}" IsOn="{Binding RecordDanmakuSuperChat}"
|
|
OnContent="{l:Loc Settings_Danmaku_ToggleSwitch_SuperChat}" OffContent="{l:Loc Settings_Danmaku_ToggleSwitch_SuperChat}"/>
|
|
<ui:ToggleSwitch IsEnabled="{Binding RecordDanmaku}" IsOn="{Binding RecordDanmakuGuard}"
|
|
OnContent="{l:Loc Settings_Danmaku_ToggleSwitch_Guard}" OffContent="{l:Loc Settings_Danmaku_ToggleSwitch_Guard}"/>
|
|
<ui:ToggleSwitch IsEnabled="{Binding RecordDanmaku}" IsOn="{Binding RecordDanmakuGift}"
|
|
OnContent="{l:Loc Settings_Danmaku_ToggleSwitch_Gift}" OffContent="{l:Loc Settings_Danmaku_ToggleSwitch_Gift}"/>
|
|
<ui:ToggleSwitch IsEnabled="{Binding RecordDanmaku}" IsOn="{Binding RecordDanmakuRaw}"
|
|
OnContent="{l:Loc Settings_Danmaku_ToggleSwitch_Raw}" OffContent="{l:Loc Settings_Danmaku_ToggleSwitch_Raw}"/>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</GroupBox>
|
|
<GroupBox Header="{l:Loc Settings_Splitting_Title}">
|
|
<StackPanel>
|
|
<RadioButton GroupName="Splitting" Name="CutDisabledRadioButton" Content="{l:Loc Settings_Splitting_RadioButton_Disabled}"
|
|
IsChecked="{Binding Path=CuttingMode, Converter={StaticResource EnumToBooleanConverter},
|
|
ConverterParameter={x:Static flv:AutoCuttingMode.Disabled}}" />
|
|
<RadioButton GroupName="Splitting" Name="CutBySizeRadioButton" Content="{l:Loc Settings_Splitting_RadioButton_BySize}"
|
|
IsChecked="{Binding Path=CuttingMode, Converter={StaticResource EnumToBooleanConverter},
|
|
ConverterParameter={x:Static flv:AutoCuttingMode.BySize}}" />
|
|
<RadioButton GroupName="Splitting" Name="CutByTimeRadioButton" Content="{l:Loc Settings_Splitting_RadioButton_ByTime}"
|
|
IsChecked="{Binding Path=CuttingMode, Converter={StaticResource EnumToBooleanConverter},
|
|
ConverterParameter={x:Static flv:AutoCuttingMode.ByTime}}" />
|
|
|
|
<StackPanel Orientation="Horizontal" Margin="0,5,0,0"
|
|
Visibility="{Binding ElementName=CutDisabledRadioButton,Path=IsChecked,Converter={StaticResource InvertBooleanToVisibilityCollapsedConverter}}">
|
|
<TextBlock Text="{l:Loc Settings_Splitting_TextBox_Left}"/>
|
|
<TextBox Margin="5,0" Width="100" Text="{Binding CuttingNumber,Delay=500}" ui:TextBoxHelper.IsDeleteButtonVisible="False"/>
|
|
<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}"/>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</GroupBox>
|
|
<GroupBox Header="{l:Loc Settings_FileName_Title}">
|
|
<StackPanel MaxWidth="500" HorizontalAlignment="Left">
|
|
<StackPanel Orientation="Horizontal" Margin="0,0,0,10">
|
|
<StackPanel.ToolTip>
|
|
<TextBlock FontSize="13" Text="{l:Loc Settings_FileName_Description_ToolTip}"
|
|
l:ResxLocalizationProvider.DefaultDictionary="Strings"/>
|
|
</StackPanel.ToolTip>
|
|
<TextBlock Text="{l:Loc Settings_FileName_Description_Text}"/>
|
|
<ui:PathIcon Margin="2,0" VerticalAlignment="Center" Height="15" Style="{StaticResource PathIconDataInformationOutline}"/>
|
|
</StackPanel>
|
|
<c:SettingWithDefault IsSettingNotUsingDefault="{Binding HasRecordFilenameFormat}" Header="{l:Loc Settings_FileName_Record}">
|
|
<TextBox Text="{Binding RecordFilenameFormat,Delay=500}" ui:TextBoxHelper.IsDeleteButtonVisible="False"/>
|
|
</c:SettingWithDefault>
|
|
<c:SettingWithDefault IsSettingNotUsingDefault="{Binding HasClipFilenameFormat}" Header="{l:Loc Settings_FileName_Clip}" Margin="0,5,0,0"
|
|
Visibility="{Binding ElementName=EnabledFeatureRecordOnlyRadioButton,Path=IsChecked,Converter={StaticResource InvertBooleanToVisibilityCollapsedConverter}}">
|
|
<TextBox Text="{Binding ClipFilenameFormat,Delay=500}" ui:TextBoxHelper.IsDeleteButtonVisible="False"/>
|
|
</c:SettingWithDefault>
|
|
</StackPanel>
|
|
</GroupBox>
|
|
<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>
|
|
<GroupBox Header="{l:Loc Settings_RecordMode_Title}">
|
|
<StackPanel>
|
|
<TextBlock Text="{l:Loc Settings_RecordMode_Description}"/>
|
|
<RadioButton GroupName="RecordMode" Name="EnabledFeatureRecordOnlyRadioButton" Content="{l:Loc Settings_RecordMode_RadioButton_RecordOnly}"
|
|
IsChecked="{Binding Path=EnabledFeature, Converter={StaticResource EnumToBooleanConverter},
|
|
ConverterParameter={x:Static flv:EnabledFeature.RecordOnly}}" />
|
|
<RadioButton GroupName="RecordMode" Content="{l:Loc Settings_RecordMode_RadioButton_ClipOnly}"
|
|
IsChecked="{Binding Path=EnabledFeature, Converter={StaticResource EnumToBooleanConverter},
|
|
ConverterParameter={x:Static flv:EnabledFeature.ClipOnly}}" />
|
|
<RadioButton GroupName="RecordMode" Content="{l:Loc Settings_RecordMode_RadioButton_Both}"
|
|
IsChecked="{Binding Path=EnabledFeature, Converter={StaticResource EnumToBooleanConverter},
|
|
ConverterParameter={x:Static flv:EnabledFeature.Both}}" />
|
|
|
|
<StackPanel Margin="0,5,0,0" Visibility="{Binding ElementName=EnabledFeatureRecordOnlyRadioButton,Path=IsChecked,Converter={StaticResource InvertBooleanToVisibilityCollapsedConverter}}">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock Text="{l:Loc Settings_RecordMode_Clip_PastDuration_Left}"/>
|
|
<TextBox Margin="5,0" Width="80" Text="{Binding ClipLengthPast,Delay=500}" ui:TextBoxHelper.IsDeleteButtonVisible="False"/>
|
|
<TextBlock Text="{l:Loc Settings_RecordMode_Clip_PastDuration_Right}"/>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock Text="{l:Loc Settings_RecordMode_Clip_FutureDuration_Left}"/>
|
|
<TextBox Margin="5,0" Width="80" Text="{Binding ClipLengthFuture,Delay=500}" ui:TextBoxHelper.IsDeleteButtonVisible="False"/>
|
|
<TextBlock Text="{l:Loc Settings_RecordMode_Clip_FutureDuration_Right}"/>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</GroupBox>
|
|
</ui:SimpleStackPanel>
|
|
</ScrollViewer>
|
|
</ui:Page>
|