Skip to content

Commit

Permalink
Reorders Sound Systems signatures to match Popup Systems. (#8728)
Browse files Browse the repository at this point in the history
  • Loading branch information
keronshb authored Jun 12, 2022
1 parent 78fb4b8 commit f7b1bda
Show file tree
Hide file tree
Showing 138 changed files with 257 additions and 272 deletions.
2 changes: 1 addition & 1 deletion Content.Client/Actions/ActionsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ protected override bool PerformBasicActions(EntityUid user, ActionType action)
}

if (action.Sound != null)
SoundSystem.Play(Filter.Local(), action.Sound.GetSound(), user, action.AudioParams);
SoundSystem.Play(action.Sound.GetSound(), Filter.Local(), user, action.AudioParams);

return performedAction;
}
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Administration/BwoinkSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected override void OnBwoinkTextMessage(BwoinkTextMessage message, EntitySes
var localPlayer = _playerManager.LocalPlayer;
if (localPlayer?.UserId != message.TrueSender)
{
SoundSystem.Play(Filter.Local(), "/Audio/Effects/adminhelp.ogg");
SoundSystem.Play("/Audio/Effects/adminhelp.ogg", Filter.Local());
_clyde.RequestWindowAttention();
}

Expand Down
6 changes: 2 additions & 4 deletions Content.Client/Audio/AmbientSoundSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,9 @@ private void ProcessNearbyAmbience(EntityCoordinates coordinates)
.WithPlayOffset(_random.NextFloat(0.0f, 100.0f))
.WithMaxDistance(comp.Range);

var stream = SoundSystem.Play(
var stream = SoundSystem.Play(sound,
Filter.Local(),
sound,
comp.Owner,
audioParams);
comp.Owner, audioParams);

if (stream == null) continue;

Expand Down
4 changes: 2 additions & 2 deletions Content.Client/Audio/BackgroundAudioSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ private void StartAmbience()
EndAmbience();
if (!CanPlayCollection(_currentCollection)) return;
var file = _robustRandom.Pick(_currentCollection.PickFiles).ToString();
_ambientStream = SoundSystem.Play(Filter.Local(), file, _ambientParams.WithVolume(_ambientParams.Volume + _configManager.GetCVar(CCVars.AmbienceVolume)));
_ambientStream = SoundSystem.Play(file, Filter.Local(), _ambientParams.WithVolume(_ambientParams.Volume + _configManager.GetCVar(CCVars.AmbienceVolume)));
}

private void EndAmbience()
Expand Down Expand Up @@ -255,7 +255,7 @@ public void StartLobbyMusic()
{
return;
}
_lobbyStream = SoundSystem.Play(Filter.Local(), file, _lobbyParams);
_lobbyStream = SoundSystem.Play(file, Filter.Local(), _lobbyParams);
}

private void EndLobbyMusic()
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Audio/ClientAdminSoundSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private void PlayAdminSound(AdminSoundEvent soundEvent)
{
if(!_adminAudioEnabled) return;

var stream = SoundSystem.Play(Filter.Local(), soundEvent.Filename, soundEvent.AudioParams);
var stream = SoundSystem.Play(soundEvent.Filename, Filter.Local(), soundEvent.AudioParams);
_adminAudio.Add(stream);
}

Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Doors/DoorSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ protected override void UpdateAppearance(EntityUid uid, DoorComponent? door = nu
protected override void PlaySound(EntityUid uid, string sound, AudioParams audioParams, EntityUid? predictingPlayer, bool predicted)
{
if (GameTiming.InPrediction && GameTiming.IsFirstTimePredicted)
SoundSystem.Play(Filter.Local(), sound, uid, audioParams);
SoundSystem.Play(sound, Filter.Local(), uid, audioParams);
}
}
2 changes: 1 addition & 1 deletion Content.Client/GameTicking/Managers/ClientGameTicker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ private void RoundRestartCleanup(RoundRestartCleanupEvent ev)
if (string.IsNullOrEmpty(RestartSound))
return;

SoundSystem.Play(Filter.Empty(), RestartSound);
SoundSystem.Play(RestartSound, Filter.Empty());

// Cleanup the sound, we only want it to play when the round restarts after it ends normally.
RestartSound = null;
Expand Down
4 changes: 2 additions & 2 deletions Content.Client/Kitchen/EntitySystems/MicrowaveSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public void StartSoundLoop(MicrowaveComponent microwave)
{
StopSoundLoop(microwave);

microwave.PlayingStream = SoundSystem.Play(Filter.Local(), microwave.LoopingSound.GetSound(), microwave.Owner,
AudioParams.Default.WithMaxDistance(5).WithLoop(true));
microwave.PlayingStream = SoundSystem.Play(microwave.LoopingSound.GetSound(), Filter.Local(),
microwave.Owner, AudioParams.Default.WithMaxDistance(5).WithLoop(true));
}

public void StopSoundLoop(MicrowaveComponent microwave)
Expand Down
5 changes: 2 additions & 3 deletions Content.Client/Light/Visualizers/ExpendableLightVisualizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ void TryStopStream(IPlayingAudioStream? stream)
TryStopStream(expendableLight.PlayingStream);
if (expendableLight.LoopedSound != null)
{
expendableLight.PlayingStream = SoundSystem.Play(Filter.Local(),
expendableLight.LoopedSound, expendableLight.Owner,
SharedExpendableLightComponent.LoopedSoundParams.WithLoop(true));
expendableLight.PlayingStream = SoundSystem.Play(expendableLight.LoopedSound, Filter.Local(),
expendableLight.Owner, SharedExpendableLightComponent.LoopedSoundParams.WithLoop(true));
}
break;
}
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Voting/VoteManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private void ReceiveVoteData(MsgVoteData message)
}

@new = true;
SoundSystem.Play(Filter.Local(), "/Audio/Effects/voteding.ogg");
SoundSystem.Play("/Audio/Effects/voteding.ogg", Filter.Local());

// New vote from the server.
var vote = new ActiveVote(voteId)
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Weapons/Ranged/Systems/FlyBySoundSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ private void OnCollide(EntityUid uid, FlyBySoundComponent component, StartCollid
if (args.OurFixture.ID != FlyByFixture ||
!_random.Prob(component.Prob)) return;

SoundSystem.Play(Filter.Local(), component.Sound.GetSound(), uid, component.Sound.Params);
SoundSystem.Play(component.Sound.GetSound(), Filter.Local(), uid, component.Sound.Params);
}
}
2 changes: 1 addition & 1 deletion Content.Client/Weapons/Ranged/Systems/GunSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public override void Shoot(GunComponent gun, List<IShootable> ammo, EntityCoordi
protected override void PlaySound(EntityUid gun, string? sound, EntityUid? user = null)
{
if (sound == null || user == null || !Timing.IsFirstTimePredicted) return;
SoundSystem.Play(Filter.Local(), sound, gun);
SoundSystem.Play(sound, Filter.Local(), gun);
}

protected override void Popup(string message, EntityUid? uid, EntityUid? user)
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/AME/AntimatterEngineSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private void OnPartInteractUsing(EntityUid uid, AMEPartComponent component, Inte

var ent = EntityManager.SpawnEntity("AMEShielding", mapGrid.GridTileToLocal(snapPos));

SoundSystem.Play(Filter.Pvs(uid), component.UnwrapSound.GetSound(), uid);
SoundSystem.Play(component.UnwrapSound.GetSound(), Filter.Pvs(uid), uid);

EntityManager.QueueDeleteEntity(uid);
}
Expand Down
4 changes: 2 additions & 2 deletions Content.Server/AME/Components/AMEControllerComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,12 @@ private int GetCoreCount()

private void ClickSound()
{
SoundSystem.Play(Filter.Pvs(Owner), _clickSound.GetSound(), Owner, AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(_clickSound.GetSound(), Filter.Pvs(Owner), Owner, AudioParams.Default.WithVolume(-2f));
}

private void InjectSound(bool overloading)
{
SoundSystem.Play(Filter.Pvs(Owner), _injectSound.GetSound(), Owner, AudioParams.Default.WithVolume(overloading ? 10f : 0f));
SoundSystem.Play(_injectSound.GetSound(), Filter.Pvs(Owner), Owner, AudioParams.Default.WithVolume(overloading ? 10f : 0f));
}
}

Expand Down
2 changes: 1 addition & 1 deletion Content.Server/AirlockPainter/AirlockPainterSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ private void OnDoAfterComplete(AirlockPainterDoAfterComplete ev)
if (TryComp<AppearanceComponent>(ev.Target, out var appearance) &&
TryComp<PaintableAirlockComponent>(ev.Target, out PaintableAirlockComponent? airlock))
{
SoundSystem.Play(Filter.Pvs(ev.User, entityManager:EntityManager), ev.Component.SpraySound.GetSound(), ev.User);
SoundSystem.Play(ev.Component.SpraySound.GetSound(), Filter.Pvs(ev.User, entityManager:EntityManager), ev.User);
appearance.SetData(DoorVisuals.BaseRSI, ev.Sprite);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/AlertLevel/AlertLevelSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public void SetLevel(EntityUid station, string level, bool playSound, bool annou
{
if (detail.Sound != null)
{
SoundSystem.Play(Filter.Broadcast(), detail.Sound.GetSound());
SoundSystem.Play(detail.Sound.GetSound(), Filter.Broadcast());
}
else
{
Expand Down
14 changes: 7 additions & 7 deletions Content.Server/Arcade/Components/SpaceVillainArcadeComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ private void UserInterfaceOnOnReceiveMessage(ServerBoundUserInterfaceMessage ser
Game?.ExecutePlayerAction(msg.PlayerAction);
break;
case PlayerAction.NewGame:
SoundSystem.Play(Filter.Pvs(Owner), _newGameSound.GetSound(), Owner, AudioParams.Default.WithVolume(-4f));
SoundSystem.Play(_newGameSound.GetSound(), Filter.Pvs(Owner), Owner, AudioParams.Default.WithVolume(-4f));

Game = new SpaceVillainGame(this);
UserInterface?.SendMessage(Game.GenerateMetaDataMessage());
Expand Down Expand Up @@ -200,7 +200,7 @@ public void ExecutePlayerAction(PlayerAction action)
_latestPlayerActionMessage = Loc.GetString("space-villain-game-player-attack-message",
("enemyName", _enemyName),
("attackAmount", attackAmount));
SoundSystem.Play(Filter.Pvs(_owner.Owner), _owner._playerAttackSound.GetSound(), _owner.Owner, AudioParams.Default.WithVolume(-4f));
SoundSystem.Play(_owner._playerAttackSound.GetSound(), Filter.Pvs(_owner.Owner), _owner.Owner, AudioParams.Default.WithVolume(-4f));
if (!_owner.EnemyInvincibilityFlag)
_enemyHp -= attackAmount;
_turtleTracker -= _turtleTracker > 0 ? 1 : 0;
Expand All @@ -211,7 +211,7 @@ public void ExecutePlayerAction(PlayerAction action)
_latestPlayerActionMessage = Loc.GetString("space-villain-game-player-heal-message",
("magicPointAmount", pointAmount),
("healAmount", healAmount));
SoundSystem.Play(Filter.Pvs(_owner.Owner), _owner._playerHealSound.GetSound(), _owner.Owner, AudioParams.Default.WithVolume(-4f));
SoundSystem.Play(_owner._playerHealSound.GetSound(), Filter.Pvs(_owner.Owner), _owner.Owner, AudioParams.Default.WithVolume(-4f));
if (!_owner.PlayerInvincibilityFlag)
_playerMp -= pointAmount;
_playerHp += healAmount;
Expand All @@ -220,7 +220,7 @@ public void ExecutePlayerAction(PlayerAction action)
case PlayerAction.Recharge:
var chargeAmount = _random.Next(4, 7);
_latestPlayerActionMessage = Loc.GetString("space-villain-game-player-recharge-message", ("regainedPoints", chargeAmount));
SoundSystem.Play(Filter.Pvs(_owner.Owner), _owner._playerChargeSound.GetSound(), _owner.Owner, AudioParams.Default.WithVolume(-4f));
SoundSystem.Play(_owner._playerChargeSound.GetSound(), Filter.Pvs(_owner.Owner), _owner.Owner, AudioParams.Default.WithVolume(-4f));
_playerMp += chargeAmount;
_turtleTracker -= _turtleTracker > 0 ? 1 : 0;
break;
Expand Down Expand Up @@ -254,7 +254,7 @@ private bool CheckGameConditions()
UpdateUi(Loc.GetString("space-villain-game-player-wins-message"),
Loc.GetString("space-villain-game-enemy-dies-message", ("enemyName", _enemyName)),
true);
SoundSystem.Play(Filter.Pvs(_owner.Owner), _owner._winSound.GetSound(), _owner.Owner, AudioParams.Default.WithVolume(-4f));
SoundSystem.Play(_owner._winSound.GetSound(), Filter.Pvs(_owner.Owner), _owner.Owner, AudioParams.Default.WithVolume(-4f));
_owner.ProcessWin();
return false;
}
Expand All @@ -267,7 +267,7 @@ private bool CheckGameConditions()
UpdateUi(Loc.GetString("space-villain-game-player-loses-message"),
Loc.GetString("space-villain-game-enemy-cheers-message", ("enemyName", _enemyName)),
true);
SoundSystem.Play(Filter.Pvs(_owner.Owner), _owner._gameOverSound.GetSound(), _owner.Owner, AudioParams.Default.WithVolume(-4f));
SoundSystem.Play(_owner._gameOverSound.GetSound(), Filter.Pvs(_owner.Owner), _owner.Owner, AudioParams.Default.WithVolume(-4f));
return false;
}
if (_enemyHp <= 0 || _enemyMp <= 0)
Expand All @@ -276,7 +276,7 @@ private bool CheckGameConditions()
UpdateUi(Loc.GetString("space-villain-game-player-loses-message"),
Loc.GetString("space-villain-game-enemy-dies-with-player-message ", ("enemyName", _enemyName)),
true);
SoundSystem.Play(Filter.Pvs(_owner.Owner), _owner._gameOverSound.GetSound(), _owner.Owner, AudioParams.Default.WithVolume(-4f));
SoundSystem.Play(_owner._gameOverSound.GetSound(), Filter.Pvs(_owner.Owner), _owner.Owner, AudioParams.Default.WithVolume(-4f));
return false;
}

Expand Down
6 changes: 3 additions & 3 deletions Content.Server/Atmos/Components/GasTankComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public void ConnectToInternals()
_connectStream?.Stop();

if (_connectSound != null)
_connectStream = SoundSystem.Play(Filter.Pvs(Owner, entityManager: _entMan), _connectSound.GetSound(), Owner, _connectSound.Params);
_connectStream = SoundSystem.Play(_connectSound.GetSound(), Filter.Pvs(Owner, entityManager: _entMan), Owner, _connectSound.Params);

UpdateUserInterface();
}
Expand All @@ -162,7 +162,7 @@ public void DisconnectFromInternals(EntityUid? owner = null)
_disconnectStream?.Stop();

if (_disconnectSound != null)
_disconnectStream = SoundSystem.Play(Filter.Pvs(Owner, entityManager: _entMan), _disconnectSound.GetSound(), Owner, _disconnectSound.Params);
_disconnectStream = SoundSystem.Play(_disconnectSound.GetSound(), Filter.Pvs(Owner, entityManager: _entMan), Owner, _disconnectSound.Params);

UpdateUserInterface();
}
Expand Down Expand Up @@ -260,7 +260,7 @@ public void CheckStatus(AtmosphereSystem? atmosphereSystem=null)
if(environment != null)
atmosphereSystem.Merge(environment, Air);

SoundSystem.Play(Filter.Pvs(Owner), _ruptureSound.GetSound(), _entMan.GetComponent<TransformComponent>(Owner).Coordinates, AudioHelpers.WithVariation(0.125f));
SoundSystem.Play(_ruptureSound.GetSound(), Filter.Pvs(Owner), _entMan.GetComponent<TransformComponent>(Owner).Coordinates, AudioHelpers.WithVariation(0.125f));

_entMan.QueueDeleteEntity(Owner);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ private void HighPressureMovements(GridAtmosphereComponent gridAtmosphere, TileA
if(_spaceWindSoundCooldown == 0 && !string.IsNullOrEmpty(SpaceWindSound))
{
var coordinates = tile.GridIndices.ToEntityCoordinates(tile.GridIndex, _mapManager);
SoundSystem.Play(Filter.Pvs(coordinates), SpaceWindSound, coordinates,
AudioHelpers.WithVariation(0.125f).WithVolume(MathHelper.Clamp(tile.PressureDifference / 10, 10, 100)));
SoundSystem.Play(SpaceWindSound, Filter.Pvs(coordinates),
coordinates, AudioHelpers.WithVariation(0.125f).WithVolume(MathHelper.Clamp(tile.PressureDifference / 10, 10, 100)));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ private void ProcessHotspot(GridAtmosphereComponent gridAtmosphere, TileAtmosphe
// A few details on the audio parameters for fire.
// The greater the fire state, the lesser the pitch variation.
// The greater the fire state, the greater the volume.
SoundSystem.Play(Filter.Pvs(coordinates), HotspotSound, coordinates,
AudioHelpers.WithVariation(0.15f/tile.Hotspot.State).WithVolume(-5f + 5f * tile.Hotspot.State));
SoundSystem.Play(HotspotSound, Filter.Pvs(coordinates),
coordinates, AudioHelpers.WithVariation(0.15f/tile.Hotspot.State).WithVolume(-5f + 5f * tile.Hotspot.State));
}

if (_hotspotSoundCooldown > HotspotSoundCooldownCycles)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ private void PlayAlertSound(EntityUid uid, AtmosMonitorComponent? monitor = null
{
if (!Resolve(uid, ref monitor)) return;

SoundSystem.Play(Filter.Pvs(uid), monitor.AlarmSound.GetSound(), uid, AudioParams.Default.WithVolume(monitor.AlarmVolume));
SoundSystem.Play(monitor.AlarmSound.GetSound(), Filter.Pvs(uid), uid, AudioParams.Default.WithVolume(monitor.AlarmVolume));
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ private void OnStartup(EntityUid uid, GasValveComponent component, ComponentStar
private void OnActivate(EntityUid uid, GasValveComponent component, ActivateInWorldEvent args)
{
Toggle(uid, component);
SoundSystem.Play(Filter.Pvs(component.Owner), component.ValveSound.GetSound(), component.Owner, AudioHelpers.WithVariation(0.25f));
SoundSystem.Play(component.ValveSound.GetSound(), Filter.Pvs(component.Owner), component.Owner, AudioHelpers.WithVariation(0.25f));
}

public void Set(EntityUid uid, GasValveComponent component, bool value)
Expand Down
Loading

0 comments on commit f7b1bda

Please sign in to comment.