mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-29 23:57:29 +00:00
* Add a basic API to JukeboxSystem * Update Content.Shared/Audio/Jukebox/SharedJukeboxSystem.cs Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> * Remove pointless Dirty * Move SetSelectedTrack Dirty inside if block * logMissing: false * Remove pointless Audio.Stop call * Poke tests --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
20 lines
551 B
C#
20 lines
551 B
C#
using Robust.Shared.Audio.Systems;
|
|
|
|
namespace Content.Shared.Audio.Jukebox;
|
|
|
|
public abstract class SharedJukeboxSystem : EntitySystem
|
|
{
|
|
[Dependency] protected readonly SharedAudioSystem Audio = default!;
|
|
|
|
/// <summary>
|
|
/// Returns whether or not the given jukebox is currently playing a song.
|
|
/// </summary>
|
|
public bool IsPlaying(Entity<JukeboxComponent?> entity)
|
|
{
|
|
if (!Resolve(entity, ref entity.Comp))
|
|
return false;
|
|
|
|
return entity.Comp.AudioStream is { } audio && Audio.IsPlaying(audio);
|
|
}
|
|
}
|