diff --git a/OpenRA.Game/Sound.cs b/OpenRA.Game/Sound.cs index 73ab065ea8..fede85fde1 100644 --- a/OpenRA.Game/Sound.cs +++ b/OpenRA.Game/Sound.cs @@ -148,6 +148,11 @@ namespace OpenRA } } + public static float MusicSeekPosition + { + get { return (music != null)? music.SeekPosition : 0; } + } + // Returns true if it played a phrase public static bool PlayVoice(string phrase, Actor voicedUnit) { @@ -198,6 +203,7 @@ namespace OpenRA interface ISound { float Volume { get; set; } + float SeekPosition { get; } } class OpenAlSoundEngine : ISoundEngine @@ -400,5 +406,15 @@ namespace OpenRA Al.alSourcef(source, Al.AL_GAIN, volume = value); } } + + public float SeekPosition + { + get + { + float pos; + Al.alGetSourcef(source, Al.AL_SEC_OFFSET, out pos); + return pos; + } + } } }