org.game.JVirus
Class Sound

java.lang.Object
  |
  +--org.game.JVirus.Sound

public final class Sound
extends java.lang.Object

Sound system of JVirus. Only static methods here.

See Also:
Resource

Field Summary
protected static javax.sound.midi.Sequence[] background_sound_array
          music list
static int FX_BEAM
          Number of sound
static int FX_EAT1
          Number of sound
static int FX_EAT2
          Number of sound
static int FX_FALL
          Number of sound
static int FX_GATE_OPEN
          Number of sound
static int FX_LOSE
          Number of sound
static int FX_MOVE
          Number of sound
protected static java.lang.String[] fx_names
          sound names list to load from disk
static int FX_WIN
          Number of sound
protected static javax.sound.sampled.Clip[] fxs
          wav list
protected static int fxVolume
          sound volume
protected static boolean ignoreStopEvent
          if the music track run to end it start again.
protected static int lastTrackNumber
          last played track
protected static javax.sound.midi.Sequencer midiSequencer
          midi Sequencer
protected static int musicVolume
          music volume
 
Method Summary
static void closeSoundSystem()
          close the sound system
static int getBackgroundCount()
          get music files count
protected static void initFX()
          init the sound system
protected static void initMidi()
          init the music system
static void playBackground(int number)
          play a music files
static void playFX(int number)
          play a wav
static void playLastBackground()
           
static void setBackgroundMute(boolean b)
          set the music to mute
static void setBackgroundVolume(int volume)
          set the music volume
static void setFXVolume(int volume)
          set sound volume
static void stopBackground()
          stop music
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FX_MOVE

public static final int FX_MOVE
Number of sound

FX_EAT1

public static final int FX_EAT1
Number of sound

FX_EAT2

public static final int FX_EAT2
Number of sound

FX_WIN

public static final int FX_WIN
Number of sound

FX_GATE_OPEN

public static final int FX_GATE_OPEN
Number of sound

FX_FALL

public static final int FX_FALL
Number of sound

FX_LOSE

public static final int FX_LOSE
Number of sound

FX_BEAM

public static final int FX_BEAM
Number of sound

fx_names

protected static final java.lang.String[] fx_names
sound names list to load from disk

background_sound_array

protected static javax.sound.midi.Sequence[] background_sound_array
music list

ignoreStopEvent

protected static boolean ignoreStopEvent
if the music track run to end it start again. If the stop event coming from the programm and the track is not run to end, then not start again.

musicVolume

protected static int musicVolume
music volume

lastTrackNumber

protected static int lastTrackNumber
last played track

midiSequencer

protected static javax.sound.midi.Sequencer midiSequencer
midi Sequencer

fxs

protected static javax.sound.sampled.Clip[] fxs
wav list

fxVolume

protected static int fxVolume
sound volume
Method Detail

getBackgroundCount

public static int getBackgroundCount()
get music files count

playBackground

public static void playBackground(int number)
play a music files

playLastBackground

public static void playLastBackground()

setBackgroundVolume

public static void setBackgroundVolume(int volume)
set the music volume

setBackgroundMute

public static void setBackgroundMute(boolean b)
set the music to mute

stopBackground

public static void stopBackground()
stop music

playFX

public static void playFX(int number)
play a wav

setFXVolume

public static void setFXVolume(int volume)
set sound volume

closeSoundSystem

public static void closeSoundSystem()
close the sound system

initMidi

protected static void initMidi()
init the music system

initFX

protected static void initFX()
init the sound system