mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Initial sample + samplechannel rework
This commit is contained in:
@ -22,8 +22,8 @@ namespace osu.Game.Graphics.UserInterface
|
||||
private const int text_size = 17;
|
||||
private const int transition_length = 80;
|
||||
|
||||
private SampleChannel sampleClick;
|
||||
private SampleChannel sampleHover;
|
||||
private Sample sampleClick;
|
||||
private Sample sampleHover;
|
||||
|
||||
private TextContainer text;
|
||||
|
||||
|
@ -17,7 +17,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
/// </summary>
|
||||
public class HoverClickSounds : HoverSounds
|
||||
{
|
||||
private SampleChannel sampleClick;
|
||||
private Sample sampleClick;
|
||||
private readonly MouseButton[] buttons;
|
||||
|
||||
/// <summary>
|
||||
|
@ -20,7 +20,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
/// </summary>
|
||||
public class HoverSounds : CompositeDrawable
|
||||
{
|
||||
private SampleChannel sampleHover;
|
||||
private Sample sampleHover;
|
||||
|
||||
/// <summary>
|
||||
/// Length of debounce for hover sound playback, in milliseconds.
|
||||
|
@ -40,8 +40,8 @@ namespace osu.Game.Graphics.UserInterface
|
||||
protected readonly Nub Nub;
|
||||
|
||||
private readonly OsuTextFlowContainer labelText;
|
||||
private SampleChannel sampleChecked;
|
||||
private SampleChannel sampleUnchecked;
|
||||
private Sample sampleChecked;
|
||||
private Sample sampleUnchecked;
|
||||
|
||||
public OsuCheckbox()
|
||||
{
|
||||
|
@ -25,7 +25,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
/// </summary>
|
||||
private const int max_decimal_digits = 5;
|
||||
|
||||
private SampleChannel sample;
|
||||
private Sample sample;
|
||||
private double lastSampleTime;
|
||||
private T lastSampleValue;
|
||||
|
||||
@ -157,14 +157,14 @@ namespace osu.Game.Graphics.UserInterface
|
||||
lastSampleValue = value;
|
||||
|
||||
lastSampleTime = Clock.CurrentTime;
|
||||
sample.Frequency.Value = 1 + NormalizedValue * 0.2f;
|
||||
|
||||
var channel = sample.Play();
|
||||
|
||||
channel.Frequency.Value = 1 + NormalizedValue * 0.2f;
|
||||
if (NormalizedValue == 0)
|
||||
sample.Frequency.Value -= 0.4f;
|
||||
channel.Frequency.Value -= 0.4f;
|
||||
else if (NormalizedValue == 1)
|
||||
sample.Frequency.Value += 0.4f;
|
||||
|
||||
sample.Play();
|
||||
channel.Frequency.Value += 0.4f;
|
||||
}
|
||||
|
||||
private void updateTooltipText(T value)
|
||||
|
@ -23,11 +23,11 @@ namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
public class OsuTextBox : BasicTextBox
|
||||
{
|
||||
private readonly SampleChannel[] textAddedSamples = new SampleChannel[4];
|
||||
private SampleChannel capsTextAddedSample;
|
||||
private SampleChannel textRemovedSample;
|
||||
private SampleChannel textCommittedSample;
|
||||
private SampleChannel caretMovedSample;
|
||||
private readonly Sample[] textAddedSamples = new Sample[4];
|
||||
private Sample capsTextAddedSample;
|
||||
private Sample textRemovedSample;
|
||||
private Sample textCommittedSample;
|
||||
private Sample caretMovedSample;
|
||||
|
||||
/// <summary>
|
||||
/// Whether to allow playing a different samples based on the type of character.
|
||||
|
Reference in New Issue
Block a user