Skip to content

Commit

Permalink
Merge pull request #2127 from andy840119/update-package-to-the-latest
Browse files Browse the repository at this point in the history
Update package to the latest.
  • Loading branch information
andy840119 authored Sep 24, 2023
2 parents a02e8a3 + ca72928 commit 6b3774e
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private class TestScrollingInfo : IScrollingInfo

IBindable<ScrollingDirection> IScrollingInfo.Direction => Direction;
IBindable<double> IScrollingInfo.TimeRange { get; } = new Bindable<double>(1000);
IScrollAlgorithm IScrollingInfo.Algorithm { get; } = new ZeroScrollAlgorithm();
IBindable<IScrollAlgorithm> IScrollingInfo.Algorithm { get; } = new Bindable<IScrollAlgorithm>(new ZeroScrollAlgorithm());
}

private class ZeroScrollAlgorithm : IScrollAlgorithm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ private static bool isWriteLyricPropertyLockedByState(LockState lockState, strin
nameof(Lyric.ReferenceLyricConfig) => lockState > LockState.Partial,
// base class
nameof(Lyric.Samples) => false,
nameof(Lyric.LegacyBpmMultiplier) => false,
_ => throw new NotSupportedException(),
};
}
Expand Down Expand Up @@ -117,7 +116,6 @@ private static bool isWriteLyricPropertyLockedByConfig(IReferenceLyricPropertyCo
nameof(Lyric.ReferenceLyricConfig) => false,
// base class
nameof(Lyric.Samples) => false,
nameof(Lyric.LegacyBpmMultiplier) => false,
_ => throw new NotSupportedException(),
},
null => false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,6 @@ private class LocalScrollingInfo : IScrollingInfo
MaxValue = 10000,
};

public IScrollAlgorithm Algorithm { get; } = new SequentialScrollAlgorithm(new List<MultiplierControlPoint>());
public IBindable<IScrollAlgorithm> Algorithm { get; } = new Bindable<IScrollAlgorithm>(new SequentialScrollAlgorithm(new List<MultiplierControlPoint>()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ private class LocalScrollingInfo : IScrollingInfo

public IBindable<double> TimeRange { get; } = new BindableDouble(1500);

public IScrollAlgorithm Algorithm { get; } = new SequentialScrollAlgorithm(new SortedList<MultiplierControlPoint>(Comparer<MultiplierControlPoint>.Default));
public IBindable<IScrollAlgorithm> Algorithm { get; } = new Bindable<IScrollAlgorithm>(new SequentialScrollAlgorithm(new SortedList<MultiplierControlPoint>(Comparer<MultiplierControlPoint>.Default)));
}

private class PreviewNotePositionInfo : INotePositionInfo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class PreviewScrollingInfo : IScrollingInfo

public IBindable<double> TimeRange { get; } = new BindableDouble();

public IScrollAlgorithm Algorithm { get; } = new ZeroScrollAlgorithm();
public IBindable<IScrollAlgorithm> Algorithm { get; } = new Bindable<IScrollAlgorithm>(new ZeroScrollAlgorithm());

private class ZeroScrollAlgorithm : IScrollAlgorithm
{
Expand Down
10 changes: 5 additions & 5 deletions osu.Game.Rulesets.Karaoke/UI/Components/VoiceVisualization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ protected override void Update()
if (!initialStateCache.IsValid)
{
// Reset scroll info
scrollingInfo.Algorithm.Reset();
scrollingInfo.Algorithm.Value.Reset();

foreach (var cached in pathInitialStateCache.Values)
cached.Invalidate();
Expand Down Expand Up @@ -132,8 +132,8 @@ private void computeLifetime(ScoringPath path)
_ => 0.0f,
};

path.LifetimeStart = scrollingInfo.Algorithm.GetDisplayStartTime(startTime, originAdjustment, timeRange.Value, scrollLength);
path.LifetimeEnd = scrollingInfo.Algorithm.TimeAt(scrollLength * safe_lifetime_end_multiplier, endTime, timeRange.Value, scrollLength);
path.LifetimeStart = scrollingInfo.Algorithm.Value.GetDisplayStartTime(startTime, originAdjustment, timeRange.Value, scrollLength);
path.LifetimeEnd = scrollingInfo.Algorithm.Value.TimeAt(scrollLength * safe_lifetime_end_multiplier, endTime, timeRange.Value, scrollLength);
}

// Cant use AddOnce() since the delegate is re-constructed every invocation
Expand Down Expand Up @@ -161,7 +161,7 @@ private void computePath(ScoringPath path) => path.Schedule(() =>
foreach (var frame in frameList)
{
float x = scrollingInfo.Algorithm.GetLength(startTime, GetTime(frame), timeRange.Value, scrollLength);
float x = scrollingInfo.Algorithm.Value.GetLength(startTime, GetTime(frame), timeRange.Value, scrollLength);
path.AddVertex(new Vector2(left ? x : -x, GetPosition(frame)));
}
});
Expand Down Expand Up @@ -194,7 +194,7 @@ private void updatePosition(ScoringPath path, double currentTime)

double startTime = GetTime(firstFrameInPath);
int multiple = direction.Value == ScrollingDirection.Left ? 1 : -1;
float x = scrollingInfo.Algorithm.PositionAt(startTime, currentTime, timeRange.Value, scrollLength);
float x = scrollingInfo.Algorithm.Value.PositionAt(startTime, currentTime, timeRange.Value, scrollLength);
path.X = (x + Offset) * multiple;
}

Expand Down
4 changes: 2 additions & 2 deletions osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
<PackageReference Include="osu.Game.Rulesets.Karaoke.Resources" Version="2022.611.0" />
<PackageReference Include="LanguageDetection.karaoke-dev" Version="1.3.3-alpha" />
<PackageReference Include="LrcParser" Version="2023.524.0" />
<PackageReference Include="Octokit" Version="7.1.0" />
<PackageReference Include="Octokit" Version="8.0.0" />
<PackageReference Include="osu.Framework.KaraokeFont" Version="2023.627.1" />
<PackageReference Include="osu.Framework.Microphone" Version="2023.627.0" />
<PackageReference Include="ppy.LocalisationAnalyser" Version="2023.712.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="ppy.osu.Game" Version="2023.908.1" />
<PackageReference Include="ppy.osu.Game" Version="2023.924.0" />
<PackageReference Include="Lucene.Net" Version="4.8.0-beta00016" />
<PackageReference Include="Lucene.Net.Analysis.Kuromoji" Version="4.8.0-beta00016" />
<PackageReference Include="SixLabors.Fonts" Version="2.0.0" />
Expand Down

0 comments on commit 6b3774e

Please sign in to comment.