Skip to content

Commit

Permalink
add LimitFPS
Browse files Browse the repository at this point in the history
  • Loading branch information
MikiraSora committed Oct 1, 2024
1 parent 9e7ac98 commit e8cb69c
Show file tree
Hide file tree
Showing 15 changed files with 471 additions and 298 deletions.
6 changes: 6 additions & 0 deletions OngekiFumenEditor/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@
<setting name="ColorHoldWallLeft" serializeAs="String">
<value>136, 3, 152</value>
</setting>
<setting name="LimitFPS" serializeAs="String">
<value>-1</value>
</setting>
</OngekiFumenEditor.Properties.EditorGlobalSetting>
<OngekiFumenEditor.Properties.AudioPlayerToolViewerSetting>
<setting name="ResampleSize" serializeAs="String">
Expand All @@ -190,6 +193,9 @@
<setting name="EnableWaveformDisplay" serializeAs="String">
<value>True</value>
</setting>
<setting name="LimitFPS" serializeAs="String">
<value>-1</value>
</setting>
</OngekiFumenEditor.Properties.AudioPlayerToolViewerSetting>
</userSettings>
</configuration>
2 changes: 1 addition & 1 deletion OngekiFumenEditor/Kernel/Graphics/IDrawingContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public VisibleRect(Vector2 buttomRight, Vector2 topLeft)

IPerfomenceMonitor PerfomenceMonitor { get; }

void PrepareEditorLoop(GLWpfControl glView);
void PrepareRenderLoop(GLWpfControl glView);
void OnRenderSizeChanged(GLWpfControl glView, SizeChangedEventArgs e);

void Render(TimeSpan ts);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
x:Class="OngekiFumenEditor.Kernel.SettingPages.FumenVisualEditor.Views.FumenVisualEditorGlobalSettingView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Behaviors="http://schemas.microsoft.com/xaml/behaviors"
xmlns:cal="http://caliburnmicro.com"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:markup="clr-namespace:OngekiFumenEditor.UI.Markup"
Expand Down Expand Up @@ -100,56 +101,91 @@
</StackPanel>
</GroupBox>
<GroupBox Margin="5" Header="{markup:Translate [Render]}">
<GroupBox Margin="5" Header="{markup:Translate [PreviewMode]}">
<StackPanel Margin="10">
<StackPanel Orientation="Horizontal">
<TextBlock VerticalAlignment="Center" Text="{markup:Translate [BellBulletCountOverLimit_Part1]}" />
<TextBox
Width="50"
Margin="5,0,5,0"
Text="{Binding Setting.ParallelCountLimit}">
</TextBox>
<TextBlock VerticalAlignment="Center" Text="{markup:Translate [BellBulletCountOverLimit_Part2]}" />
</StackPanel>
<StackPanel Margin="0,10,0,5" Orientation="Horizontal">
<TextBlock VerticalAlignment="Center" Text="{markup:Translate [BackgroundColor]}" />
<Border
Width="60"
Height="18"
Margin="10,0"
cal:Message.Attach="[Event MouseDown] = [Action OnSelectBackgroundColor($executionContext)]"
Background="{Binding Setting.PlayFieldBackgroundColor, Converter={StaticResource IntToSolidBrush}}"
BorderBrush="{Binding Setting.PlayFieldBackgroundColor, Converter={StaticResource IntToSolidBrush}, ConverterParameter=True}"
BorderThickness="1"
CornerRadius="7"
Cursor="Hand">
</Border>
</StackPanel>
<CheckBox IsChecked="{Binding Setting.EnablePlayFieldDrawing}">
<TextBlock Text="{markup:Translate [EnablePlayFieldDrawing]}" />
</CheckBox>
<StackPanel
Margin="0,5,0,5"
IsEnabled="{Binding Setting.EnablePlayFieldDrawing}"
Orientation="Horizontal">
<TextBlock VerticalAlignment="Center" Text="{markup:Translate [PlayFieldForegroundColor]}" />
<Border
Width="60"
Height="18"
Margin="10,0"
cal:Message.Attach="[Event MouseDown] = [Action OnSelectForegroundColor($executionContext)]"
Background="{Binding Setting.PlayFieldForegroundColor, Converter={StaticResource IntToSolidBrush}}"
BorderBrush="{Binding Setting.PlayFieldForegroundColor, Converter={StaticResource IntToSolidBrush}, ConverterParameter=True}"
BorderThickness="1"
CornerRadius="7"
Cursor="Hand">
</Border>
</StackPanel>
<CheckBox IsChecked="{Binding Setting.EnableShowPlayerLocation}">
<TextBlock Text="{markup:Translate [EnableShowPlayerLocation]}" />
</CheckBox>
<StackPanel>
<StackPanel Margin="10,5,5,5" Orientation="Horizontal">
<TextBlock Text="Limit FPS:" />
<TextBox
Width="50"
Margin="5,0"
Text="{Binding Setting.LimitFPS}" />
<TextBlock x:Name="noLimitText" Text="(无限制)">
<Behaviors:Interaction.Triggers>
<Behaviors:DataTrigger
Binding="{Binding Setting.LimitFPS}"
Comparison="LessThanOrEqual"
Value="0">
<Behaviors:DataTrigger.Actions>
<Behaviors:ChangePropertyAction
PropertyName="Visibility"
TargetObject="{Binding ElementName=noLimitText}"
Value="Visible" />
</Behaviors:DataTrigger.Actions>
</Behaviors:DataTrigger>
<Behaviors:DataTrigger
Binding="{Binding Setting.LimitFPS}"
Comparison="GreaterThan"
Value="0">
<Behaviors:DataTrigger.Actions>
<Behaviors:ChangePropertyAction
PropertyName="Visibility"
TargetObject="{Binding ElementName=noLimitText}"
Value="Hidden" />
</Behaviors:DataTrigger.Actions>
</Behaviors:DataTrigger>
</Behaviors:Interaction.Triggers>
</TextBlock>
</StackPanel>
</GroupBox>
<GroupBox Margin="5,0,5,5" Header="{markup:Translate [PreviewMode]}">
<StackPanel Margin="10">
<StackPanel Orientation="Horizontal">
<TextBlock VerticalAlignment="Center" Text="{markup:Translate [BellBulletCountOverLimit_Part1]}" />
<TextBox
Width="50"
Margin="5,0,5,0"
Text="{Binding Setting.ParallelCountLimit}">
</TextBox>
<TextBlock VerticalAlignment="Center" Text="{markup:Translate [BellBulletCountOverLimit_Part2]}" />
</StackPanel>
<StackPanel Margin="0,10,0,5" Orientation="Horizontal">
<TextBlock VerticalAlignment="Center" Text="{markup:Translate [BackgroundColor]}" />
<Border
Width="60"
Height="18"
Margin="10,0"
cal:Message.Attach="[Event MouseDown] = [Action OnSelectBackgroundColor($executionContext)]"
Background="{Binding Setting.PlayFieldBackgroundColor, Converter={StaticResource IntToSolidBrush}}"
BorderBrush="{Binding Setting.PlayFieldBackgroundColor, Converter={StaticResource IntToSolidBrush}, ConverterParameter=True}"
BorderThickness="1"
CornerRadius="7"
Cursor="Hand">
</Border>
</StackPanel>
<CheckBox IsChecked="{Binding Setting.EnablePlayFieldDrawing}">
<TextBlock Text="{markup:Translate [EnablePlayFieldDrawing]}" />
</CheckBox>
<StackPanel
Margin="0,5,0,5"
IsEnabled="{Binding Setting.EnablePlayFieldDrawing}"
Orientation="Horizontal">
<TextBlock VerticalAlignment="Center" Text="{markup:Translate [PlayFieldForegroundColor]}" />
<Border
Width="60"
Height="18"
Margin="10,0"
cal:Message.Attach="[Event MouseDown] = [Action OnSelectForegroundColor($executionContext)]"
Background="{Binding Setting.PlayFieldForegroundColor, Converter={StaticResource IntToSolidBrush}}"
BorderBrush="{Binding Setting.PlayFieldForegroundColor, Converter={StaticResource IntToSolidBrush}, ConverterParameter=True}"
BorderThickness="1"
CornerRadius="7"
Cursor="Hand">
</Border>
</StackPanel>
<CheckBox IsChecked="{Binding Setting.EnableShowPlayerLocation}">
<TextBlock Text="{markup:Translate [EnableShowPlayerLocation]}" />
</CheckBox>
</StackPanel>
</GroupBox>
</StackPanel>
</GroupBox>
<GroupBox Margin="5" Header="{markup:Translate [Other]}">
<StackPanel Margin="10">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ public override void Draw(IWaveformDrawingContext target, PeakPointCollection pe
lineDrawing.Begin(target, 1);
{
var prevX = 0f;
lineDrawing.PostPoint(new(-width / 2, 0), WhiteColor, InvailedLineDash);

lineDrawing.PostPoint(new(-width / 2, 0), WhiteColor, InvailedLineDash);
for (int i = minIndex; i < maxIndex; i++)
{
var peakPoint = peakData[i];
Expand Down
Loading

0 comments on commit e8cb69c

Please sign in to comment.