BililiveRecorder/BililiveRecorder.WPF/Controls/PerRoomSettingsDialog.xaml
cxumol 86e6526f09
feat: split recording on title change
* feat:add CuttingByTitle to BililiveRecorder.Core.Config.V3

* add: CuttingByTitle

* add: new config-related test

* fix:test txt

* fix:test txt

* add: translations

* add:translations

* Reactivating git submodule webui

* revert webui submodule update

---------

Co-authored-by: genteure <genteure@gmail.com>
2023-10-12 17:59:45 +08:00

120 lines
8.9 KiB
XML

<ui:ContentDialog
x:Class="BililiveRecorder.WPF.Controls.PerRoomSettingsDialog"
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.Controls"
xmlns:config="clr-namespace:BililiveRecorder.Core.Config;assembly=BililiveRecorder.Core"
xmlns:core="clr-namespace:BililiveRecorder.Core;assembly=BililiveRecorder.Core"
d:DataContext="{d:DesignInstance core:Room}"
DefaultButton="Close"
CloseButtonText="{l:Loc Global_Close}"
mc:Ignorable="d">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel>
<ContentControl Content="{Binding}" ContentTemplate="{StaticResource RoomDialogHeader}"/>
<TextBlock TextAlignment="Center" Text="Tip: 这里是房间独立设置,是对↙全局设置↙的覆盖"/>
<Separator/>
</StackPanel>
<ScrollViewer Grid.Row="1">
<ui:SimpleStackPanel Orientation="Vertical" Spacing="5" DataContext="{Binding RoomConfig}">
<GroupBox Header="{l:Loc Settings_Danmaku_Title}">
<StackPanel>
<local:SettingWithDefault IsSettingNotUsingDefault="{Binding HasRecordDanmaku}">
<ui:ToggleSwitch IsOn="{Binding RecordDanmaku}" OnContent="{l:Loc Settings_Danmaku_ToggleSwitch_Enabled}" OffContent="{l:Loc Settings_Danmaku_ToggleSwitch_Enabled}"/>
</local:SettingWithDefault>
<local:SettingWithDefault IsSettingNotUsingDefault="{Binding HasRecordDanmakuSuperChat}">
<ui:ToggleSwitch IsOn="{Binding RecordDanmakuSuperChat}" OnContent="{l:Loc Settings_Danmaku_ToggleSwitch_SuperChat}" OffContent="{l:Loc Settings_Danmaku_ToggleSwitch_SuperChat}"/>
</local:SettingWithDefault>
<local:SettingWithDefault IsSettingNotUsingDefault="{Binding HasRecordDanmakuGuard}">
<ui:ToggleSwitch IsOn="{Binding RecordDanmakuGuard}" OnContent="{l:Loc Settings_Danmaku_ToggleSwitch_Guard}" OffContent="{l:Loc Settings_Danmaku_ToggleSwitch_Guard}"/>
</local:SettingWithDefault>
<local:SettingWithDefault IsSettingNotUsingDefault="{Binding HasRecordDanmakuGift}">
<ui:ToggleSwitch IsOn="{Binding RecordDanmakuGift}" OnContent="{l:Loc Settings_Danmaku_ToggleSwitch_Gift}" OffContent="{l:Loc Settings_Danmaku_ToggleSwitch_Gift}"/>
</local:SettingWithDefault>
<local:SettingWithDefault IsSettingNotUsingDefault="{Binding HasRecordDanmakuRaw}">
<ui:ToggleSwitch IsOn="{Binding RecordDanmakuRaw}" OnContent="{l:Loc Settings_Danmaku_ToggleSwitch_Raw}" OffContent="{l:Loc Settings_Danmaku_ToggleSwitch_Raw}"/>
</local:SettingWithDefault>
</StackPanel>
</GroupBox>
<GroupBox Header="{l:Loc Settings_RecordMode_Title}">
<StackPanel>
<local:SettingWithDefault IsSettingNotUsingDefault="{Binding HasRecordMode}">
<StackPanel>
<RadioButton GroupName="RecordMode" Content="{l:Loc Settings_RecordMode_RadioButton_Standard}"
IsChecked="{Binding Path=RecordMode, Converter={StaticResource EnumToBooleanConverter},
ConverterParameter={x:Static config:RecordMode.Standard}}" />
<RadioButton GroupName="RecordMode" Content="{l:Loc Settings_RecordMode_RadioButton_RawData}"
IsChecked="{Binding Path=RecordMode, Converter={StaticResource EnumToBooleanConverter},
ConverterParameter={x:Static config:RecordMode.RawData}}" />
</StackPanel>
</local:SettingWithDefault>
</StackPanel>
</GroupBox>
<GroupBox Header="标准模式录制修复设置">
<StackPanel>
<local:SettingWithDefault IsSettingNotUsingDefault="{Binding HasFlvProcessorSplitOnScriptTag}">
<StackPanel>
<ui:ToggleSwitch IsOn="{Binding FlvProcessorSplitOnScriptTag}" OnContent="检测到可能缺少数据时分段" OffContent="检测到可能缺少数据时分段"/>
</StackPanel>
</local:SettingWithDefault>
</StackPanel>
</GroupBox>
<GroupBox Header="{l:Loc Settings_Splitting_Title}">
<StackPanel>
<local:SettingWithDefault IsSettingNotUsingDefault="{Binding HasCuttingMode}">
<StackPanel>
<RadioButton GroupName="Splitting" Content="{l:Loc Settings_Splitting_RadioButton_Disabled}"
IsChecked="{Binding Path=CuttingMode, Converter={StaticResource EnumToBooleanConverter},
ConverterParameter={x:Static config:CuttingMode.Disabled}}" />
<RadioButton GroupName="Splitting" Content="{l:Loc Settings_Splitting_RadioButton_BySize}"
IsChecked="{Binding Path=CuttingMode, Converter={StaticResource EnumToBooleanConverter},
ConverterParameter={x:Static config:CuttingMode.BySize}}" />
<RadioButton GroupName="Splitting" Content="{l:Loc Settings_Splitting_RadioButton_ByTime}"
IsChecked="{Binding Path=CuttingMode, Converter={StaticResource EnumToBooleanConverter},
ConverterParameter={x:Static config:CuttingMode.ByTime}}" />
</StackPanel>
</local:SettingWithDefault>
<local:SettingWithDefault IsSettingNotUsingDefault="{Binding HasCuttingNumber}">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,5,0,0">
<TextBlock VerticalAlignment="Center" Text="{l:Loc Settings_Splitting_TextBox_Left}"/>
<TextBox Margin="5,0" Width="100" Text="{Binding CuttingNumber}" ui:TextBoxHelper.IsDeleteButtonVisible="False"/>
<TextBlock VerticalAlignment="Center" Text="{l:Loc Settings_Splitting_TextBox_TimeUnit}"/>
<TextBlock VerticalAlignment="Center" Text="/"/>
<TextBlock VerticalAlignment="Center" Text="{l:Loc Settings_Splitting_TextBox_SizeUnit}"/>
<TextBlock VerticalAlignment="Center" Text=" "/>
<TextBlock VerticalAlignment="Center" Text="{l:Loc Settings_Splitting_TextBox_Right}"/>
</StackPanel>
</local:SettingWithDefault>
<ui:ToggleSwitch IsOn="{Binding CuttingByTitle}" OnContent="{l:Loc Settings_Splitting_ToggleSwitch_ByTitle}" OffContent="{l:Loc Settings_Splitting_ToggleSwitch_ByTitle}"/>
</StackPanel>
</GroupBox>
<GroupBox Header="直播封面">
<local:SettingWithDefault IsSettingNotUsingDefault="{Binding HasSaveStreamCover}">
<ui:ToggleSwitch IsOn="{Binding SaveStreamCover}" OnContent="录制时同时保存直播封面" OffContent="录制时同时保存直播封面"/>
</local:SettingWithDefault>
</GroupBox>
<GroupBox Header="录制画质">
<StackPanel>
<TextBlock Text="逗号分割的录制画质ID"/>
<local:SettingWithDefault IsSettingNotUsingDefault="{Binding HasRecordingQuality}">
<TextBox Text="{Binding RecordingQuality,UpdateSourceTrigger=PropertyChanged,Delay=1000}"
ui:TextBoxHelper.IsDeleteButtonVisible="False" Width="220" HorizontalAlignment="Left"/>
</local:SettingWithDefault>
</StackPanel>
</GroupBox>
</ui:SimpleStackPanel>
</ScrollViewer>
</Grid>
</ui:ContentDialog>