Skip to content

Commit e8cb69c

Browse files
committed
add LimitFPS
1 parent 9e7ac98 commit e8cb69c

15 files changed

+471
-298
lines changed

OngekiFumenEditor/App.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@
173173
<setting name="ColorHoldWallLeft" serializeAs="String">
174174
<value>136, 3, 152</value>
175175
</setting>
176+
<setting name="LimitFPS" serializeAs="String">
177+
<value>-1</value>
178+
</setting>
176179
</OngekiFumenEditor.Properties.EditorGlobalSetting>
177180
<OngekiFumenEditor.Properties.AudioPlayerToolViewerSetting>
178181
<setting name="ResampleSize" serializeAs="String">
@@ -190,6 +193,9 @@
190193
<setting name="EnableWaveformDisplay" serializeAs="String">
191194
<value>True</value>
192195
</setting>
196+
<setting name="LimitFPS" serializeAs="String">
197+
<value>-1</value>
198+
</setting>
193199
</OngekiFumenEditor.Properties.AudioPlayerToolViewerSetting>
194200
</userSettings>
195201
</configuration>

OngekiFumenEditor/Kernel/Graphics/IDrawingContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public VisibleRect(Vector2 buttomRight, Vector2 topLeft)
4646

4747
IPerfomenceMonitor PerfomenceMonitor { get; }
4848

49-
void PrepareEditorLoop(GLWpfControl glView);
49+
void PrepareRenderLoop(GLWpfControl glView);
5050
void OnRenderSizeChanged(GLWpfControl glView, SizeChangedEventArgs e);
5151

5252
void Render(TimeSpan ts);

OngekiFumenEditor/Kernel/SettingPages/FumenVisualEditor/Views/FumenVisualEditorGlobalSettingView.xaml

Lines changed: 85 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
x:Class="OngekiFumenEditor.Kernel.SettingPages.FumenVisualEditor.Views.FumenVisualEditorGlobalSettingView"
33
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:Behaviors="http://schemas.microsoft.com/xaml/behaviors"
56
xmlns:cal="http://caliburnmicro.com"
67
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
78
xmlns:markup="clr-namespace:OngekiFumenEditor.UI.Markup"
@@ -100,56 +101,91 @@
100101
</StackPanel>
101102
</GroupBox>
102103
<GroupBox Margin="5" Header="{markup:Translate [Render]}">
103-
<GroupBox Margin="5" Header="{markup:Translate [PreviewMode]}">
104-
<StackPanel Margin="10">
105-
<StackPanel Orientation="Horizontal">
106-
<TextBlock VerticalAlignment="Center" Text="{markup:Translate [BellBulletCountOverLimit_Part1]}" />
107-
<TextBox
108-
Width="50"
109-
Margin="5,0,5,0"
110-
Text="{Binding Setting.ParallelCountLimit}">
111-
</TextBox>
112-
<TextBlock VerticalAlignment="Center" Text="{markup:Translate [BellBulletCountOverLimit_Part2]}" />
113-
</StackPanel>
114-
<StackPanel Margin="0,10,0,5" Orientation="Horizontal">
115-
<TextBlock VerticalAlignment="Center" Text="{markup:Translate [BackgroundColor]}" />
116-
<Border
117-
Width="60"
118-
Height="18"
119-
Margin="10,0"
120-
cal:Message.Attach="[Event MouseDown] = [Action OnSelectBackgroundColor($executionContext)]"
121-
Background="{Binding Setting.PlayFieldBackgroundColor, Converter={StaticResource IntToSolidBrush}}"
122-
BorderBrush="{Binding Setting.PlayFieldBackgroundColor, Converter={StaticResource IntToSolidBrush}, ConverterParameter=True}"
123-
BorderThickness="1"
124-
CornerRadius="7"
125-
Cursor="Hand">
126-
</Border>
127-
</StackPanel>
128-
<CheckBox IsChecked="{Binding Setting.EnablePlayFieldDrawing}">
129-
<TextBlock Text="{markup:Translate [EnablePlayFieldDrawing]}" />
130-
</CheckBox>
131-
<StackPanel
132-
Margin="0,5,0,5"
133-
IsEnabled="{Binding Setting.EnablePlayFieldDrawing}"
134-
Orientation="Horizontal">
135-
<TextBlock VerticalAlignment="Center" Text="{markup:Translate [PlayFieldForegroundColor]}" />
136-
<Border
137-
Width="60"
138-
Height="18"
139-
Margin="10,0"
140-
cal:Message.Attach="[Event MouseDown] = [Action OnSelectForegroundColor($executionContext)]"
141-
Background="{Binding Setting.PlayFieldForegroundColor, Converter={StaticResource IntToSolidBrush}}"
142-
BorderBrush="{Binding Setting.PlayFieldForegroundColor, Converter={StaticResource IntToSolidBrush}, ConverterParameter=True}"
143-
BorderThickness="1"
144-
CornerRadius="7"
145-
Cursor="Hand">
146-
</Border>
147-
</StackPanel>
148-
<CheckBox IsChecked="{Binding Setting.EnableShowPlayerLocation}">
149-
<TextBlock Text="{markup:Translate [EnableShowPlayerLocation]}" />
150-
</CheckBox>
104+
<StackPanel>
105+
<StackPanel Margin="10,5,5,5" Orientation="Horizontal">
106+
<TextBlock Text="Limit FPS:" />
107+
<TextBox
108+
Width="50"
109+
Margin="5,0"
110+
Text="{Binding Setting.LimitFPS}" />
111+
<TextBlock x:Name="noLimitText" Text="(无限制)">
112+
<Behaviors:Interaction.Triggers>
113+
<Behaviors:DataTrigger
114+
Binding="{Binding Setting.LimitFPS}"
115+
Comparison="LessThanOrEqual"
116+
Value="0">
117+
<Behaviors:DataTrigger.Actions>
118+
<Behaviors:ChangePropertyAction
119+
PropertyName="Visibility"
120+
TargetObject="{Binding ElementName=noLimitText}"
121+
Value="Visible" />
122+
</Behaviors:DataTrigger.Actions>
123+
</Behaviors:DataTrigger>
124+
<Behaviors:DataTrigger
125+
Binding="{Binding Setting.LimitFPS}"
126+
Comparison="GreaterThan"
127+
Value="0">
128+
<Behaviors:DataTrigger.Actions>
129+
<Behaviors:ChangePropertyAction
130+
PropertyName="Visibility"
131+
TargetObject="{Binding ElementName=noLimitText}"
132+
Value="Hidden" />
133+
</Behaviors:DataTrigger.Actions>
134+
</Behaviors:DataTrigger>
135+
</Behaviors:Interaction.Triggers>
136+
</TextBlock>
151137
</StackPanel>
152-
</GroupBox>
138+
<GroupBox Margin="5,0,5,5" Header="{markup:Translate [PreviewMode]}">
139+
<StackPanel Margin="10">
140+
<StackPanel Orientation="Horizontal">
141+
<TextBlock VerticalAlignment="Center" Text="{markup:Translate [BellBulletCountOverLimit_Part1]}" />
142+
<TextBox
143+
Width="50"
144+
Margin="5,0,5,0"
145+
Text="{Binding Setting.ParallelCountLimit}">
146+
</TextBox>
147+
<TextBlock VerticalAlignment="Center" Text="{markup:Translate [BellBulletCountOverLimit_Part2]}" />
148+
</StackPanel>
149+
<StackPanel Margin="0,10,0,5" Orientation="Horizontal">
150+
<TextBlock VerticalAlignment="Center" Text="{markup:Translate [BackgroundColor]}" />
151+
<Border
152+
Width="60"
153+
Height="18"
154+
Margin="10,0"
155+
cal:Message.Attach="[Event MouseDown] = [Action OnSelectBackgroundColor($executionContext)]"
156+
Background="{Binding Setting.PlayFieldBackgroundColor, Converter={StaticResource IntToSolidBrush}}"
157+
BorderBrush="{Binding Setting.PlayFieldBackgroundColor, Converter={StaticResource IntToSolidBrush}, ConverterParameter=True}"
158+
BorderThickness="1"
159+
CornerRadius="7"
160+
Cursor="Hand">
161+
</Border>
162+
</StackPanel>
163+
<CheckBox IsChecked="{Binding Setting.EnablePlayFieldDrawing}">
164+
<TextBlock Text="{markup:Translate [EnablePlayFieldDrawing]}" />
165+
</CheckBox>
166+
<StackPanel
167+
Margin="0,5,0,5"
168+
IsEnabled="{Binding Setting.EnablePlayFieldDrawing}"
169+
Orientation="Horizontal">
170+
<TextBlock VerticalAlignment="Center" Text="{markup:Translate [PlayFieldForegroundColor]}" />
171+
<Border
172+
Width="60"
173+
Height="18"
174+
Margin="10,0"
175+
cal:Message.Attach="[Event MouseDown] = [Action OnSelectForegroundColor($executionContext)]"
176+
Background="{Binding Setting.PlayFieldForegroundColor, Converter={StaticResource IntToSolidBrush}}"
177+
BorderBrush="{Binding Setting.PlayFieldForegroundColor, Converter={StaticResource IntToSolidBrush}, ConverterParameter=True}"
178+
BorderThickness="1"
179+
CornerRadius="7"
180+
Cursor="Hand">
181+
</Border>
182+
</StackPanel>
183+
<CheckBox IsChecked="{Binding Setting.EnableShowPlayerLocation}">
184+
<TextBlock Text="{markup:Translate [EnableShowPlayerLocation]}" />
185+
</CheckBox>
186+
</StackPanel>
187+
</GroupBox>
188+
</StackPanel>
153189
</GroupBox>
154190
<GroupBox Margin="5" Header="{markup:Translate [Other]}">
155191
<StackPanel Margin="10">

OngekiFumenEditor/Modules/AudioPlayerToolViewer/Graphics/WaveformDrawing/DefaultImpls/DefaultWaveformDrawing.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ public override void Draw(IWaveformDrawingContext target, PeakPointCollection pe
7474
lineDrawing.Begin(target, 1);
7575
{
7676
var prevX = 0f;
77-
lineDrawing.PostPoint(new(-width / 2, 0), WhiteColor, InvailedLineDash);
77+
78+
lineDrawing.PostPoint(new(-width / 2, 0), WhiteColor, InvailedLineDash);
7879
for (int i = minIndex; i < maxIndex; i++)
7980
{
8081
var peakPoint = peakData[i];

0 commit comments

Comments
 (0)