Skip to content

Commit

Permalink
增加可设置内容与控件“默认录制清晰度等级”
Browse files Browse the repository at this point in the history
  • Loading branch information
CHKZL committed Jun 29, 2024
1 parent 912696f commit 5accaf0
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 3 deletions.
58 changes: 57 additions & 1 deletion Core/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ public bool _DeleteOriginalFileAfterRepair

private static string DefaultResolution = "10000";
/// <summary>
/// 默认分辨率 默认值:10000 可选值:流畅:80 高清:150 超清:250 蓝光:400 原画:10000
/// 默认分辨率 默认值:10000 可选值:流畅:80 高清:150 超清:250 蓝光:400 原画:10000 4K:20000 杜比:30000
/// 默认值:10000
/// </summary>
public int _DefaultResolution
Expand All @@ -885,6 +885,62 @@ public int _DefaultResolution
}
}

/// <summary>
/// 默认录制分辨率设置界面下拉框选项
/// </summary>
public int _DefaultResolution_For_ComboBox
{
get
{
switch(_DefaultResolution)
{
case 80:
return 0;
case 150:
return 1;
case 250:
return 2;
case 400:
return 3;
case 10000:
return 4;
case 20000:
return 5;
case 30000:
return 6;
default:
return 4;
}
}
set
{
switch (value)
{
case 0:
_DefaultResolution = 80;
break;
case 1:
_DefaultResolution = 150;
break;
case 2:
_DefaultResolution = 250;
break;
case 3:
_DefaultResolution = 400;
break;
case 4:
_DefaultResolution = 10000;
break;
case 5:
_DefaultResolution = 20000;
break;
case 6:
_DefaultResolution = 30000;
break;
}
OnPropertyChanged();
}
}

private static string Port = "11419";
/// <summary>
Expand Down
29 changes: 27 additions & 2 deletions Desktop/Views/Pages/SettingsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,32 @@
</ui:CardExpander.Header>

<StackPanel Margin="24,0,24,0">
<ui:CardExpander Grid.Row="0" Icon="{ui:SymbolIcon Voicemail24}">

<ui:CardControl Padding="15,15,20,15" Header="默认录制清晰度等级" Icon="{ui:SymbolIcon EyeTracking20}" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Right" ToolTipService.InitialShowDelay="100" ToolTipService.Placement="MousePoint" ToolTipService.ToolTip="如无目标分辨率,会使用接近的分辨率进行录制">
<ComboBox Name="DefaultResolution_For_ComboBox" Grid.Row="0" Grid.Column="1" SelectedIndex="{Binding _DefaultResolution_For_ComboBox,Mode=OneWay}" Margin="0,0,5,0">
<ComboBoxItem Content="流畅"/>
<ComboBoxItem Content="高清" />
<ComboBoxItem Content="超清" />
<ComboBoxItem Content="蓝光" />
<ComboBoxItem Content="原画" />
<ComboBoxItem Content="4K" />
<ComboBoxItem Content="杜比" />
</ComboBox>
</Grid>
</Grid>
</ui:CardControl>

<ui:CardExpander Icon="{ui:SymbolIcon Voicemail24}">
<ui:CardExpander.Header>
<Grid>
<Grid.ColumnDefinitions>
Expand Down Expand Up @@ -423,7 +448,7 @@
</StackPanel>
</ui:CardExpander>

<ui:CardExpander Grid.Row="1" Icon="{ui:SymbolIcon ArrowSyncCheckmark20}">
<ui:CardExpander Icon="{ui:SymbolIcon ArrowSyncCheckmark20}">
<ui:CardExpander.Header>
<Grid>
<Grid.ColumnDefinitions>
Expand Down
5 changes: 5 additions & 0 deletions Desktop/Views/Pages/SettingsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@ public async void SaveConfiguration()
#endregion

#region 录制功能设置保存
//录制分辨率
if (Config.Core_RunConfig._DefaultResolution_For_ComboBox != DefaultResolution_For_ComboBox.SelectedIndex)
{
Config.Core_RunConfig._DefaultResolution_For_ComboBox = DefaultResolution_For_ComboBox.SelectedIndex;
}
//录制模式
if ((int)Config.Core_RunConfig._RecordingMode - 1 != RecordingMode_ComboBox.SelectedIndex)
{
Expand Down

0 comments on commit 5accaf0

Please sign in to comment.