@Environment(value=CLIENT) public class SoundSystem extends Object
Modifier and Type | Field and Description |
---|---|
private Channel |
channel |
private SoundListener |
listener |
private List<SoundInstanceListener> |
listeners |
private SoundManager |
loader |
private static Logger |
LOGGER |
private static Marker |
MARKER |
private List<Sound> |
preloadedSounds |
private GameOptions |
settings |
private Map<SoundInstance,Integer> |
soundEndTicks |
private SoundEngine |
soundEngine |
private SoundLoader |
soundLoader |
private Multimap<SoundCategory,SoundInstance> |
sounds |
private List<TickableSoundInstance> |
soundsToPlayNextTick |
private Map<SoundInstance,Channel.SourceManager> |
sources |
private boolean |
started |
private Map<SoundInstance,Integer> |
startTicks |
private SoundExecutor |
taskQueue |
private List<TickableSoundInstance> |
tickingSounds |
private int |
ticks |
private static Set<Identifier> |
unknownSounds |
Constructor and Description |
---|
SoundSystem(SoundManager loader,
GameOptions settings,
ResourceManager resourceManager) |
Modifier and Type | Method and Description |
---|---|
void |
addPreloadedSound(Sound sound) |
private static boolean |
canRepeatInstantly(SoundInstance soundInstance) |
private float |
getAdjustedPitch(SoundInstance soundInstance) |
private float |
getAdjustedVolume(SoundInstance soundInstance) |
String |
getDebugString() |
private float |
getSoundVolume(SoundCategory soundCategory) |
boolean |
isPlaying(SoundInstance soundInstance) |
private static boolean |
isRepeatDelayed(SoundInstance soundInstance) |
void |
pauseAll() |
void |
play(SoundInstance soundInstance) |
void |
play(SoundInstance sound,
int delay) |
void |
playNextTick(TickableSoundInstance sound) |
void |
registerListener(SoundInstanceListener soundInstanceListener) |
void |
reloadSounds() |
void |
resumeAll() |
private static boolean |
shouldRepeatInstantly(SoundInstance soundInstance) |
private void |
start() |
void |
stop() |
void |
stop(SoundInstance soundInstance) |
void |
stopAll() |
void |
stopSounds(Identifier identifier,
SoundCategory soundCategory) |
private void |
tick() |
void |
tick(boolean bool) |
void |
unregisterListener(SoundInstanceListener soundInstanceListener) |
void |
updateListenerPosition(Camera camera) |
void |
updateSoundVolume(SoundCategory soundCategory,
float volume) |
private static final Marker MARKER
private static final Logger LOGGER
private static final Set<Identifier> unknownSounds
private final SoundManager loader
private final GameOptions settings
private boolean started
private final SoundEngine soundEngine
private final SoundListener listener
private final SoundLoader soundLoader
private final SoundExecutor taskQueue
private final Channel channel
private int ticks
private final Map<SoundInstance,Channel.SourceManager> sources
private final Multimap<SoundCategory,SoundInstance> sounds
private final List<TickableSoundInstance> tickingSounds
private final Map<SoundInstance,Integer> startTicks
private final Map<SoundInstance,Integer> soundEndTicks
private final List<SoundInstanceListener> listeners
private final List<TickableSoundInstance> soundsToPlayNextTick
public SoundSystem(SoundManager loader, GameOptions settings, ResourceManager resourceManager)
public void reloadSounds()
private void start()
private float getSoundVolume(@Nullable SoundCategory soundCategory)
public void updateSoundVolume(SoundCategory soundCategory, float volume)
public void stop()
public void stop(SoundInstance soundInstance)
public void stopAll()
public void registerListener(SoundInstanceListener soundInstanceListener)
public void unregisterListener(SoundInstanceListener soundInstanceListener)
public void tick(boolean bool)
private void tick()
private static boolean canRepeatInstantly(SoundInstance soundInstance)
private static boolean isRepeatDelayed(SoundInstance soundInstance)
private static boolean shouldRepeatInstantly(SoundInstance soundInstance)
public boolean isPlaying(SoundInstance soundInstance)
public void play(SoundInstance soundInstance)
public void playNextTick(TickableSoundInstance sound)
public void addPreloadedSound(Sound sound)
private float getAdjustedPitch(SoundInstance soundInstance)
private float getAdjustedVolume(SoundInstance soundInstance)
public void pauseAll()
public void resumeAll()
public void play(SoundInstance sound, int delay)
public void updateListenerPosition(Camera camera)
public void stopSounds(@Nullable Identifier identifier, @Nullable SoundCategory soundCategory)
public String getDebugString()