com.confusionists.mjdjApi.morph
Class AbstractMorph

java.lang.Object
  extended by com.confusionists.mjdjApi.morph.AbstractMorph
All Implemented Interfaces:
Morph

public abstract class AbstractMorph
extends java.lang.Object
implements Morph

AbstractMorph is the abstract base class for implementers of Midi Morphs (i.e., translators).

Author:
DanielRosenstark [at_sign] confusionists.com

Constructor Summary
AbstractMorph()
           
 
Method Summary
 java.util.List<java.lang.String> getInDeviceNames()
           
 java.util.List<java.lang.String> getOutDeviceNames()
           
 MjdjService getService()
           
 boolean isPlayTimedTasks()
           
 void setInDeviceNames(java.util.List<java.lang.String> value)
          Call by Mjdj before init is called.
 void setOutDeviceNames(java.util.List<java.lang.String> value)
          Call by Mjdj before init is called.
 void setPlayTimedTasks(boolean playTimedTasks)
           
 void setService(MjdjService service)
          Mjdj will call this method to give the Morph instance access to the Mjdj system: this happens before init is called.
 void shutdown()
          Called before the Morph is taken out of service, e.g., if Morphs are reloaded or if the system is shutting down.
 void toggleUi()
          Subclasses can produce a UI that is as complicated as they like for each Morph.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.confusionists.mjdjApi.morph.Morph
diagnose, getName, getSerializable, init, process, setSerializable
 

Constructor Detail

AbstractMorph

public AbstractMorph()
Method Detail

shutdown

public void shutdown()
Called before the Morph is taken out of service, e.g., if Morphs are reloaded or if the system is shutting down.

Specified by:
shutdown in interface Morph

setInDeviceNames

public void setInDeviceNames(java.util.List<java.lang.String> value)
Description copied from interface: Morph
Call by Mjdj before init is called. Subclasses can generally inherit this default implementation.

Specified by:
setInDeviceNames in interface Morph
Parameters:
value - is a List of the in device names.

getInDeviceNames

public java.util.List<java.lang.String> getInDeviceNames()
Specified by:
getInDeviceNames in interface Morph

setOutDeviceNames

public void setOutDeviceNames(java.util.List<java.lang.String> value)
Description copied from interface: Morph
Call by Mjdj before init is called. Subclasses should generally inherit this default implementation.

Specified by:
setOutDeviceNames in interface Morph
Parameters:
value - is a List of the in device names.

getOutDeviceNames

public java.util.List<java.lang.String> getOutDeviceNames()
Specified by:
getOutDeviceNames in interface Morph

setService

public void setService(MjdjService service)
Description copied from interface: Morph
Mjdj will call this method to give the Morph instance access to the Mjdj system: this happens before init is called.

Specified by:
setService in interface Morph
Parameters:
service - an MjdjService instance.

getService

public MjdjService getService()

toggleUi

public void toggleUi()
Description copied from interface: Morph
Subclasses can produce a UI that is as complicated as they like for each Morph. It should become visible (and even always-on-top) when this method is called, or the opposite.

Specified by:
toggleUi in interface Morph

setPlayTimedTasks

public void setPlayTimedTasks(boolean playTimedTasks)
Specified by:
setPlayTimedTasks in interface Morph
Parameters:
playTimedTasks - Used by the default implementation of MidiTimerTask to play or not play: true by default

isPlayTimedTasks

public boolean isPlayTimedTasks()
Specified by:
isPlayTimedTasks in interface Morph
Returns:
true by default. Otherwise returns whether the morph expects timed events to play or not. used by MidiTimerTask.