From 3f4f1ff75e1077575e0cae3d342049270edff80b Mon Sep 17 00:00:00 2001 From: alzeih Date: Sat, 14 Aug 2010 14:24:25 +1200 Subject: [PATCH] MusicSeekPosition --- OpenRA.Game/Sound.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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; + } + } } }