Crossfire JXClient, Trunk  R20561
com.realtime.crossfire.jxclient.sound.SoundWatcher Class Reference

Monitors sound and sound2 commands received from the server to generate sound effects. More...

+ Collaboration diagram for com.realtime.crossfire.jxclient.sound.SoundWatcher:

Public Member Functions

 SoundWatcher (@NotNull final CrossfireServerConnection crossfireServerConnection, @NotNull final SoundManager soundManager)
 Creates a new instance. More...
 

Private Attributes

final CrossfireSoundListener crossfireSoundListener
 The crossfire sound listener. More...
 
final SoundManager soundManager
 The SoundManager instance to watch. More...
 

Detailed Description

Monitors sound and sound2 commands received from the server to generate sound effects.

Author
Andreas Kirschbaum

Definition at line 33 of file SoundWatcher.java.

Constructor & Destructor Documentation

◆ SoundWatcher()

com.realtime.crossfire.jxclient.sound.SoundWatcher.SoundWatcher ( @NotNull final CrossfireServerConnection  crossfireServerConnection,
@NotNull final SoundManager  soundManager 
)

Creates a new instance.

Parameters
crossfireServerConnectionthe connection to watch
soundManagerthe sound manager instance to watch

Definition at line 65 of file SoundWatcher.java.

References com.realtime.crossfire.jxclient.sound.SoundWatcher.crossfireSoundListener, and com.realtime.crossfire.jxclient.sound.SoundWatcher.soundManager.

Member Data Documentation

◆ crossfireSoundListener

final CrossfireSoundListener com.realtime.crossfire.jxclient.sound.SoundWatcher.crossfireSoundListener
private
Initial value:
= new CrossfireSoundListener() {
@Override
public void commandSoundReceived(final int x, final int y, final int num, final int type) {
}
@Override
public void commandSound2Received(final int x, final int y, final int dir, final int volume, final int type, @NotNull final String action, @NotNull final String name) {
soundManager.playClip(Sounds.CHARACTER, name, action);
}
}

The crossfire sound listener.

Definition at line 46 of file SoundWatcher.java.

Referenced by com.realtime.crossfire.jxclient.sound.SoundWatcher.SoundWatcher().

◆ soundManager

final SoundManager com.realtime.crossfire.jxclient.sound.SoundWatcher.soundManager
private

The SoundManager instance to watch.

Definition at line 39 of file SoundWatcher.java.

Referenced by com.realtime.crossfire.jxclient.sound.SoundWatcher.SoundWatcher().


The documentation for this class was generated from the following file: