|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Class Summary | |
---|---|
MusicLibrary | A MusicLibrary stores an array of playlists for use with music. |
Playlist | Represent a set of sounds that will be presented to a SoundPlayer in a certain order as defined by the Playlists playmodes. |
SfxLibrary | A SfxLibrary stores an array of playlists for use with sound-effects. |
SoundLibrary | A SoundLibrary stores a number of playlists. |
SoundPlayer | Class for playing sound. |
Enum Summary | |
---|---|
SoundLibrary.SoundEffect |
This package contains the classes for handling sfx/music in FreeCol.
FreeCol
initializes the libraries and Canvas
initializes the players. Pointers to the library-objects and player-objects are stored in most of the GUI-classes.
This is the method for playing sounds (provided you have got access to the pointers):
if (sfxPlayer != null) { sfxPlayer.play(sfxLibrary.get(sfxLibrary.ILLEGAL_MOVE)); } if (musicPlayer != null) { musicPlayer.play(musicLibrary.get(musicLibrary.INTRO)); }
Notice the if-statement checking wether or not the sfxPlayer-object is null. Beeing null indicates that sound is disabled.
|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |