devs.musicpackage
Class DanceGenerator

java.lang.Object
  extended by java.lang.Thread
      extended by biocell.BioThread
          extended by nns.BioSensor
              extended by devs.musicpackage.DanceGenerator
All Implemented Interfaces:
BioDevice, com.lightdev.lib.audio.PlayerListener, SpectrumAnalyzerListener, java.awt.event.ActionListener, java.lang.Runnable, java.util.EventListener, MNSListener

public class DanceGenerator
extends BioSensor
implements com.lightdev.lib.audio.PlayerListener, java.awt.event.ActionListener, SpectrumAnalyzerListener

Author:
nabhoth

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static float VOLUME_CORRECTION
           
 
Fields inherited from class nns.BioSensor
EXTERO_SENSOR, INTERO_SENSOR, PROPRIO_SENSOR
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Fields inherited from interface biocell.BioDevice
BLOCKED, BUSY, CYCLING, DONE, END, PAUSED, RESUMED, START, WAIT
 
Constructor Summary
DanceGenerator(BioSensorListener nns)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void decoded(com.lightdev.lib.audio.Player p, byte[] buf, int byteCount)
           
 void exception(com.lightdev.lib.audio.Player p, java.lang.Exception ex)
           
 SpectrumAnalyzer getAnalyzer()
           
 java.lang.String getCurrentsong()
           
 com.lightdev.lib.audio.Player getPlayer()
          get the currently running play thread
 kj.dsp.KJDigitalSignalProcessingAudioDataConsumer getSynchronizer()
           
 int getVolume()
          get the currently set volume
 void process(MNSEvent cnv)
          loads a CNSEvent into a listener
 void progress(com.lightdev.lib.audio.Player p, long progressValue)
           
 void setAnalyzer(SpectrumAnalyzer analyzer)
           
 void setCurrentsong(java.lang.String currentsong)
           
 void setPlayer(com.lightdev.lib.audio.Player player)
           
 void setSynchronizer(kj.dsp.KJDigitalSignalProcessingAudioDataConsumer synchronizer)
           
 void stateChanged(com.lightdev.lib.audio.Player p, int fromStatus, int toStatus)
           
 void update(int[] coeffs)
           
 
Methods inherited from class nns.BioSensor
addListener, addListener, addSensorListener, geState, getControls, getCurrentPosition, getCurrentState, getListener, getname, getType, load, loadCNTR, seState, setListener, setname, setType
 
Methods inherited from class biocell.BioThread
getCurrentmood, getMoodParam, getstate, setMood, stepEnergy
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VOLUME_CORRECTION

public static final float VOLUME_CORRECTION
See Also:
Constant Field Values
Constructor Detail

DanceGenerator

public DanceGenerator(BioSensorListener nns)
Parameters:
name -
Method Detail

update

public void update(int[] coeffs)
Specified by:
update in interface SpectrumAnalyzerListener

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

process

public void process(MNSEvent cnv)
Description copied from interface: MNSListener
loads a CNSEvent into a listener

Specified by:
process in interface MNSListener
Overrides:
process in class BioSensor

stateChanged

public void stateChanged(com.lightdev.lib.audio.Player p,
                         int fromStatus,
                         int toStatus)
Specified by:
stateChanged in interface com.lightdev.lib.audio.PlayerListener

progress

public void progress(com.lightdev.lib.audio.Player p,
                     long progressValue)
Specified by:
progress in interface com.lightdev.lib.audio.PlayerListener

decoded

public void decoded(com.lightdev.lib.audio.Player p,
                    byte[] buf,
                    int byteCount)
Specified by:
decoded in interface com.lightdev.lib.audio.PlayerListener

exception

public void exception(com.lightdev.lib.audio.Player p,
                      java.lang.Exception ex)
Specified by:
exception in interface com.lightdev.lib.audio.PlayerListener

getPlayer

public com.lightdev.lib.audio.Player getPlayer()
get the currently running play thread

Returns:
PlayThread the running thread or null if none

getVolume

public int getVolume()
get the currently set volume

Returns:
int the volume

getCurrentsong

public java.lang.String getCurrentsong()
Returns:
Returns the currentsong.

setCurrentsong

public void setCurrentsong(java.lang.String currentsong)
Parameters:
currentsong - The currentsong to set.

getAnalyzer

public SpectrumAnalyzer getAnalyzer()
Returns:
Returns the analyzer.

setAnalyzer

public void setAnalyzer(SpectrumAnalyzer analyzer)
Parameters:
analyzer - The analyzer to set.

getSynchronizer

public kj.dsp.KJDigitalSignalProcessingAudioDataConsumer getSynchronizer()
Returns:
Returns the synchronizer.

setSynchronizer

public void setSynchronizer(kj.dsp.KJDigitalSignalProcessingAudioDataConsumer synchronizer)
Parameters:
synchronizer - The synchronizer to set.

setPlayer

public void setPlayer(com.lightdev.lib.audio.Player player)
Parameters:
player - The player to set.