A game framework written with osu! in mind.

Add marker interface and move documentation

+24 -12
+17
osu.Framework/Audio/IHasAmplitudes.cs
··· 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 + using osu.Framework.Audio.Track; 5 + 6 + namespace osu.Framework.Audio 7 + { 8 + public interface IHasAmplitudes 9 + { 10 + /// <summary> 11 + /// Current amplitude of stereo channels where 1 is full volume and 0 is silent. 12 + /// LeftChannel and RightChannel represent the maximum current amplitude of all of the left and right channels respectively. 13 + /// The most recent values are returned. Synchronisation between channels should not be expected. 14 + /// </summary> 15 + ChannelAmplitudes CurrentAmplitudes { get; } 16 + } 17 + }
+1 -1
osu.Framework/Audio/Sample/ISampleChannel.cs
··· 6 6 /// <summary> 7 7 /// A channel playing back an audio sample. 8 8 /// </summary> 9 - public interface ISampleChannel 9 + public interface ISampleChannel : IHasAmplitudes 10 10 { 11 11 /// <summary> 12 12 /// Start playback.
-5
osu.Framework/Audio/Sample/SampleChannel.cs
··· 54 54 55 55 public override bool IsAlive => base.IsAlive && !Played; 56 56 57 - /// <summary> 58 - /// Current amplitude of stereo channels where 1 is full volume and 0 is silent. 59 - /// LeftChannel and RightChannel represent the maximum current amplitude of all of the left and right channels respectively. 60 - /// The most recent values are returned. Synchronisation between channels should not be expected. 61 - /// </summary> 62 57 public virtual ChannelAmplitudes CurrentAmplitudes { get; } = new ChannelAmplitudes(); 63 58 } 64 59 }
+1 -1
osu.Framework/Audio/Track/ITrack.cs
··· 6 6 /// <summary> 7 7 /// An audio track. 8 8 /// </summary> 9 - public interface ITrack 9 + public interface ITrack : IHasAmplitudes 10 10 { 11 11 /// <summary> 12 12 /// States if this track should repeat.
-5
osu.Framework/Audio/Track/Track.cs
··· 112 112 113 113 public override bool HasCompleted => IsLoaded && !IsRunning && CurrentTime >= Length; 114 114 115 - /// <summary> 116 - /// Current amplitude of stereo channels where 1 is full volume and 0 is silent. 117 - /// LeftChannel and RightChannel represent the maximum current amplitude of all of the left and right channels respectively. 118 - /// The most recent values are returned. Synchronisation between channels should not be expected. 119 - /// </summary> 120 115 public virtual ChannelAmplitudes CurrentAmplitudes { get; } = new ChannelAmplitudes(); 121 116 122 117 protected override void UpdateState()
+3
osu.Framework/Graphics/Audio/DrawableSample.cs
··· 2 2 // See the LICENCE file in the repository root for full licence text. 3 3 4 4 using osu.Framework.Audio.Sample; 5 + using osu.Framework.Audio.Track; 5 6 6 7 namespace osu.Framework.Graphics.Audio 7 8 { ··· 36 37 get => channel.Looping; 37 38 set => channel.Looping = value; 38 39 } 40 + 41 + public ChannelAmplitudes CurrentAmplitudes => channel.CurrentAmplitudes; 39 42 } 40 43 }
+2
osu.Framework/Graphics/Audio/DrawableTrack.cs
··· 56 56 public void Start() => track.Start(); 57 57 58 58 public void Stop() => track.Stop(); 59 + 60 + public ChannelAmplitudes CurrentAmplitudes => track.CurrentAmplitudes; 59 61 } 60 62 }