A game framework written with osu! in mind.
at master 34 lines 948 B view raw
1// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. 2// See the LICENCE file in the repository root for full licence text. 3 4#nullable enable 5 6using osu.Framework.Audio.Mixing.Bass; 7 8namespace osu.Framework.Audio.Sample 9{ 10 internal sealed class SampleBass : Sample 11 { 12 public int SampleId => factory.SampleId; 13 14 public override bool IsLoaded => factory.IsLoaded; 15 16 private readonly SampleBassFactory factory; 17 private readonly BassAudioMixer mixer; 18 19 internal SampleBass(SampleBassFactory factory, BassAudioMixer mixer) 20 { 21 this.factory = factory; 22 this.mixer = mixer; 23 24 PlaybackConcurrency.BindTo(factory.PlaybackConcurrency); 25 } 26 27 protected override SampleChannel CreateChannel() 28 { 29 var channel = new SampleChannelBass(this); 30 mixer.Add(channel); 31 return channel; 32 } 33 } 34}