gr.teicrete.mta.midi.mappings
Class Mapper

java.lang.Object
  extended by gr.teicrete.mta.midi.mappings.Mapper
All Implemented Interfaces:
EobodyEventListener, java.util.EventListener

public class Mapper
extends java.lang.Object
implements EobodyEventListener


Constructor Summary
Mapper()
          The constructor for the Mapper object
 
Method Summary
 void clearMappings()
           
 void closeDevice()
           
 void controlChangeReceived(ControlChangeEvent evt)
          Method invoked from ControlChangeEvents
 EobodyEventFactory getEventFactory()
          Method to obtain the Mapper's EobodyEventFactory object which fires the events
 ControllerChannel[] getMappings()
          Method to obtain the currently set ControllerChanner array
 void keyPressureReceived(KeyPressureEvent evt)
          Method invoked from KeyPressureEvents
 void loadMappings(java.lang.String mappingsFile)
          Method to load mappings from the specified Properties file
 void noteOffReceived(NoteOffEvent evt)
          Method invoked from NoteOffEvents
 void noteOnReceived(NoteOnEvent evt)
          Method invoked from NoteOnEvents
 void pitchBendReceived(PitchBendEvent evt)
          Method invoked from PitchBendEvents
 void polyPressureReceived(PolyPressureEvent evt)
          Method invoked from PolyPressureEvents
 void programChangeReceived(ProgramChangeEvent evt)
          Method invoked from ProgramChangeEvents
 boolean updateMapping(int channel, Mappable target)
          Method to set a new map target for a specific ControllerChannel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Mapper

public Mapper()
The constructor for the Mapper object

Method Detail

loadMappings

public void loadMappings(java.lang.String mappingsFile)
Method to load mappings from the specified Properties file

Parameters:
mappingsFile - The filepath of the Properties file containing the mappings

updateMapping

public boolean updateMapping(int channel,
                             Mappable target)
Method to set a new map target for a specific ControllerChannel

Parameters:
channel - An integer representing the number of the ControllerChannel
target - The Mappable object for the new map target
Returns:
replace returns true if mapping is replacing a previous mapping, returns false if mapping channel was previously empty

keyPressureReceived

public void keyPressureReceived(KeyPressureEvent evt)
Description copied from interface: EobodyEventListener
Method invoked from KeyPressureEvents

Specified by:
keyPressureReceived in interface EobodyEventListener
Parameters:
evt - The event

polyPressureReceived

public void polyPressureReceived(PolyPressureEvent evt)
Description copied from interface: EobodyEventListener
Method invoked from PolyPressureEvents

Specified by:
polyPressureReceived in interface EobodyEventListener
Parameters:
evt - The event

pitchBendReceived

public void pitchBendReceived(PitchBendEvent evt)
Description copied from interface: EobodyEventListener
Method invoked from PitchBendEvents

Specified by:
pitchBendReceived in interface EobodyEventListener
Parameters:
evt - The event

programChangeReceived

public void programChangeReceived(ProgramChangeEvent evt)
Description copied from interface: EobodyEventListener
Method invoked from ProgramChangeEvents

Specified by:
programChangeReceived in interface EobodyEventListener
Parameters:
evt - The event

controlChangeReceived

public void controlChangeReceived(ControlChangeEvent evt)
Description copied from interface: EobodyEventListener
Method invoked from ControlChangeEvents

Specified by:
controlChangeReceived in interface EobodyEventListener
Parameters:
evt - The event

noteOnReceived

public void noteOnReceived(NoteOnEvent evt)
Description copied from interface: EobodyEventListener
Method invoked from NoteOnEvents

Specified by:
noteOnReceived in interface EobodyEventListener
Parameters:
evt - The event

noteOffReceived

public void noteOffReceived(NoteOffEvent evt)
Description copied from interface: EobodyEventListener
Method invoked from NoteOffEvents

Specified by:
noteOffReceived in interface EobodyEventListener
Parameters:
evt - The event

getEventFactory

public EobodyEventFactory getEventFactory()
Method to obtain the Mapper's EobodyEventFactory object which fires the events

Returns:
An EobodyEventFactory object which is the source of the EobodyEvents

clearMappings

public void clearMappings()

closeDevice

public void closeDevice()

getMappings

public ControllerChannel[] getMappings()
Method to obtain the currently set ControllerChanner array

Returns:
The ControllerChannel array reference