Skip to content

Commit afac9b0

Browse files
committed
remove obsolete bindable
1 parent f65b40f commit afac9b0

2 files changed

Lines changed: 1 addition & 22 deletions

File tree

osu.Framework/Audio/AudioManager.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,6 @@ public class AudioManager : AudioCollectionManager<AudioComponent>
123123
MaxValue = 1
124124
};
125125

126-
/// <summary>
127-
/// Whether a global mixer is being used for audio routing.
128-
/// For now, this is only the case on Windows when using shared mode WASAPI initialisation.
129-
/// </summary>
130-
public IBindable<bool> UsingGlobalMixer => usingGlobalMixer;
131-
132-
private readonly Bindable<bool> usingGlobalMixer = new BindableBool();
133-
134126
/// <summary>
135127
/// If a global mixer is being used, this will be the BASS handle for it.
136128
/// If non-null, all game mixers should be added to this mixer.
@@ -198,7 +190,6 @@ public AudioManager(AudioThread audioThread, ResourceStore<byte[]> trackStore, R
198190
AudioDevice.ValueChanged += _ => scheduler.AddOnce(initCurrentDevice);
199191
UseExperimentalWasapi.ValueChanged += _ => scheduler.AddOnce(initCurrentDevice);
200192
// initCurrentDevice not required for changes to `GlobalMixerHandle` as it is only changed when experimental wasapi is toggled (handled above).
201-
GlobalMixerHandle.ValueChanged += handle => usingGlobalMixer.Value = handle.NewValue.HasValue;
202193

203194
AddItem(TrackMixer = createAudioMixer(null, nameof(TrackMixer)));
204195
AddItem(SampleMixer = createAudioMixer(null, nameof(SampleMixer)));

osu.Framework/Graphics/Visualisation/Audio/AudioChannelDisplay.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
using System;
55
using ManagedBass;
66
using ManagedBass.Mix;
7-
using osu.Framework.Allocation;
87
using osu.Framework.Audio;
9-
using osu.Framework.Bindables;
108
using osu.Framework.Graphics.Containers;
119
using osu.Framework.Graphics.Shapes;
1210
using osu.Framework.Graphics.Sprites;
@@ -30,7 +28,6 @@ public partial class AudioChannelDisplay : CompositeDrawable
3028
private float maxPeak = float.MinValue;
3129
private double lastMaxPeakTime;
3230
private readonly bool isOutputChannel;
33-
private IBindable<bool> usingGlobalMixer = null!;
3431

3532
public AudioChannelDisplay(int channelHandle, bool isOutputChannel = false)
3633
{
@@ -103,22 +100,13 @@ public AudioChannelDisplay(int channelHandle, bool isOutputChannel = false)
103100
};
104101
}
105102

106-
[BackgroundDependencyLoader]
107-
private void load(AudioManager audioManager)
108-
{
109-
usingGlobalMixer = audioManager.UsingGlobalMixer.GetBoundCopy();
110-
}
111-
112103
protected override void Update()
113104
{
114105
base.Update();
115106

116107
float[] levels = new float[2];
117108

118-
if (isOutputChannel && !usingGlobalMixer.Value)
119-
Bass.ChannelGetLevel(ChannelHandle, levels, 1 / 1000f * sample_window, LevelRetrievalFlags.Stereo);
120-
else
121-
BassMix.ChannelGetLevel(ChannelHandle, levels, 1 / 1000f * sample_window, LevelRetrievalFlags.Stereo);
109+
BassMix.ChannelGetLevel(ChannelHandle, levels, 1 / 1000f * sample_window, LevelRetrievalFlags.Stereo);
122110

123111
float curPeakL = levels[0];
124112
float curPeakR = levels[1];

0 commit comments

Comments
 (0)