mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 09:23:06 +08:00
Rename SwellSampleMapping -> DrumSampleMapping
This commit is contained in:
parent
0fb620a8d3
commit
8bfdee586b
40
osu.Game.Rulesets.Taiko/Audio/DrumSampleMapping.cs
Normal file
40
osu.Game.Rulesets.Taiko/Audio/DrumSampleMapping.cs
Normal file
@ -0,0 +1,40 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Audio.Sample;
|
||||
using osu.Game.Audio;
|
||||
using osu.Game.Beatmaps.ControlPoints;
|
||||
|
||||
namespace osu.Game.Rulesets.Taiko.Audio
|
||||
{
|
||||
public class DrumSampleMapping : IComparable<DrumSampleMapping>
|
||||
{
|
||||
public double Time;
|
||||
public readonly SampleInfo Centre;
|
||||
public readonly SampleInfo Rim;
|
||||
|
||||
public SampleChannel CentreChannel { get; private set; }
|
||||
public SampleChannel RimChannel { get; private set; }
|
||||
|
||||
public DrumSampleMapping()
|
||||
{
|
||||
}
|
||||
|
||||
public DrumSampleMapping(SampleControlPoint samplePoint)
|
||||
{
|
||||
Time = samplePoint.Time;
|
||||
Centre = samplePoint.GetSampleInfo();
|
||||
Rim = samplePoint.GetSampleInfo(SampleInfo.HIT_CLAP);
|
||||
}
|
||||
|
||||
public void RetrieveChannels(AudioManager audio)
|
||||
{
|
||||
CentreChannel = Centre.GetChannel(audio.Sample);
|
||||
RimChannel = Rim.GetChannel(audio.Sample);
|
||||
}
|
||||
|
||||
public int CompareTo(DrumSampleMapping other) => Time.CompareTo(other.Time);
|
||||
}
|
||||
}
|
@ -15,6 +15,7 @@ using OpenTK.Graphics;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Rulesets.Taiko.Judgements;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Game.Rulesets.Taiko.Audio;
|
||||
|
||||
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
{
|
||||
@ -228,7 +229,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
// While the swell hasn't been fully judged, input is still blocked so it doesn't fall through to other hitobjects
|
||||
// This causes the playfield to not play sounds, so they need to be handled locally
|
||||
|
||||
var mappingIndex = HitObject.ProgressionSamples.BinarySearch(new SwellSampleMapping { Time = Time.Current });
|
||||
var mappingIndex = HitObject.ProgressionSamples.BinarySearch(new DrumSampleMapping { Time = Time.Current });
|
||||
if (mappingIndex < 0)
|
||||
mappingIndex = ~mappingIndex - 1;
|
||||
|
||||
|
@ -7,6 +7,7 @@ using osu.Game.Audio;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.ControlPoints;
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
using osu.Game.Rulesets.Taiko.Audio;
|
||||
|
||||
namespace osu.Game.Rulesets.Taiko.Objects
|
||||
{
|
||||
@ -21,25 +22,17 @@ namespace osu.Game.Rulesets.Taiko.Objects
|
||||
/// </summary>
|
||||
public int RequiredHits = 10;
|
||||
|
||||
public List<SwellSampleMapping> ProgressionSamples = new List<SwellSampleMapping>();
|
||||
public List<DrumSampleMapping> ProgressionSamples = new List<DrumSampleMapping>();
|
||||
|
||||
protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty)
|
||||
{
|
||||
base.ApplyDefaultsToSelf(controlPointInfo, difficulty);
|
||||
|
||||
var progressionSamplePoints =
|
||||
new[] { controlPointInfo.SamplePointAt(StartTime) }
|
||||
var progressionSamplePoints = new[] { controlPointInfo.SamplePointAt(StartTime) }
|
||||
.Concat(controlPointInfo.SamplePoints.Where(p => p.Time > StartTime && p.Time <= EndTime));
|
||||
|
||||
foreach (var point in progressionSamplePoints)
|
||||
{
|
||||
ProgressionSamples.Add(new SwellSampleMapping
|
||||
{
|
||||
Time = point.Time,
|
||||
Centre = point.GetSampleInfo(),
|
||||
Rim = point.GetSampleInfo(SampleInfo.HIT_CLAP)
|
||||
});
|
||||
}
|
||||
ProgressionSamples.Add(new DrumSampleMapping(point));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,28 +0,0 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Audio.Sample;
|
||||
using osu.Game.Audio;
|
||||
|
||||
namespace osu.Game.Rulesets.Taiko.Objects
|
||||
{
|
||||
public class SwellSampleMapping : IComparable<SwellSampleMapping>
|
||||
{
|
||||
public double Time;
|
||||
public SampleInfo Centre;
|
||||
public SampleInfo Rim;
|
||||
|
||||
public SampleChannel CentreChannel { get; private set; }
|
||||
public SampleChannel RimChannel { get; private set; }
|
||||
|
||||
public void RetrieveChannels(AudioManager audio)
|
||||
{
|
||||
CentreChannel = Centre.GetChannel(audio.Sample);
|
||||
RimChannel = Rim.GetChannel(audio.Sample);
|
||||
}
|
||||
|
||||
public int CompareTo(SwellSampleMapping other) => Time.CompareTo(other.Time);
|
||||
}
|
||||
}
|
@ -44,6 +44,7 @@
|
||||
<Reference Include="System.Core" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Audio\DrumSampleMapping.cs" />
|
||||
<Compile Include="Beatmaps\TaikoBeatmapConverter.cs" />
|
||||
<Compile Include="Judgements\TaikoDrumRollTickJudgement.cs" />
|
||||
<Compile Include="Judgements\TaikoStrongHitJudgement.cs" />
|
||||
@ -74,7 +75,6 @@
|
||||
<Compile Include="Objects\Hit.cs" />
|
||||
<Compile Include="Objects\RimHit.cs" />
|
||||
<Compile Include="Objects\Swell.cs" />
|
||||
<Compile Include="Objects\SwellSampleMapping.cs" />
|
||||
<Compile Include="Replays\TaikoFramedReplayInputHandler.cs" />
|
||||
<Compile Include="Replays\TaikoAutoGenerator.cs" />
|
||||
<Compile Include="Objects\TaikoHitObject.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user