Allow mods to control how looped sounds are used.
This commit is contained in:
committed by
Matthias Mailänder
parent
68fddf818c
commit
3f0c3a8b9c
@@ -129,9 +129,14 @@ namespace OpenRA
|
||||
soundEngine.StopAllSounds();
|
||||
}
|
||||
|
||||
public void EndLoop(ISound sound)
|
||||
public void SetLooped(ISound sound, bool looped)
|
||||
{
|
||||
soundEngine.SetSoundLooping(false, sound);
|
||||
soundEngine.SetSoundLooping(looped, sound);
|
||||
}
|
||||
|
||||
public void SetPosition(ISound sound, WPos position)
|
||||
{
|
||||
soundEngine.SetSoundPosition(sound, position);
|
||||
}
|
||||
|
||||
public void MuteAudio()
|
||||
|
||||
@@ -29,6 +29,7 @@ namespace OpenRA
|
||||
void SetListenerPosition(WPos position);
|
||||
void SetSoundVolume(float volume, ISound music, ISound video);
|
||||
void SetSoundLooping(bool looping, ISound sound);
|
||||
void SetSoundPosition(ISound sound, WPos position);
|
||||
}
|
||||
|
||||
public class SoundDevice
|
||||
|
||||
@@ -57,6 +57,7 @@ namespace OpenRA.Platforms.Default
|
||||
public void StopAllSounds() { }
|
||||
public void SetListenerPosition(WPos position) { }
|
||||
public void SetSoundLooping(bool looping, ISound sound) { }
|
||||
public void SetSoundPosition(ISound sound, WPos position) { }
|
||||
public void Dispose() { }
|
||||
}
|
||||
|
||||
|
||||
@@ -350,6 +350,11 @@ namespace OpenRA.Platforms.Default
|
||||
((OpenAlSound)sound)?.SetLooping(looping);
|
||||
}
|
||||
|
||||
public void SetSoundPosition(ISound sound, WPos position)
|
||||
{
|
||||
((OpenAlSound)sound)?.SetPosition(position);
|
||||
}
|
||||
|
||||
~OpenAlSoundEngine()
|
||||
{
|
||||
Dispose(false);
|
||||
|
||||
Reference in New Issue
Block a user