com.confusionists.mjdjApi.util
Interface MjdjService


public interface MjdjService

MjdjService is the gateway into the Mjdj system: all access to Mjdj is given through a provided MjdjService instance.

Author:
DanielRosenstark [at_sign] confusionists.com

Method Summary
 void debugLog(java.lang.String text)
          Display to the Mjdj logging pane if debugging is on
 void debugLog(java.lang.String string, java.lang.Exception exception)
          Display to the Mjdj logging pane if debugging is on
 float getAfterBeat()
           
 boolean isDebug()
           
 boolean isMorphActive(java.lang.String name)
           
 void log(java.lang.String text)
          Display to the Mjdj logging pane.
 void log(java.lang.String string, java.lang.Exception exception)
          Display to the Mjdj logging pane.
 void morph(MessageWrapper message, java.lang.String from)
          Send messages to the Mjdj morphs.
 void morph(MessageWrapper message, java.lang.String from, Morph afterMorph)
           
 boolean schedule(MidiTimerTask task, int beatsBeforeLaunch)
           
 boolean schedule(MidiTimerTask task, int beatsBeforeLaunch, float delayAfterBeat)
          Schedules the task to fire at beatsBeforeLaunch quarter-notes plus delayAfterBeat in proportion of one beat.
 boolean scheduleInMs(MidiTimerTask task, int delay)
           
 void send(byte[] bytes)
          Send to all output MIDI devices
 void send(byte[] bytes, java.util.List<java.lang.String> sendToNames)
           
 void send(MessageWrapper message)
          Sends to all outbound MIDI devices
 void send(MessageWrapper message, java.util.List<java.lang.String> sendToNames)
           
 void send(MessageWrapper message, java.lang.String sendToName)
           
 void sendKeystrokes(java.lang.String keystrokes)
           
 void setMorphActive(java.lang.String name, boolean status)
          Shuts the checkbox of a Morph implementer on or off
 

Method Detail

log

void log(java.lang.String text)
Display to the Mjdj logging pane.


log

void log(java.lang.String string,
         java.lang.Exception exception)
Display to the Mjdj logging pane.


debugLog

void debugLog(java.lang.String text)
Display to the Mjdj logging pane if debugging is on


debugLog

void debugLog(java.lang.String string,
              java.lang.Exception exception)
Display to the Mjdj logging pane if debugging is on


morph

void morph(MessageWrapper message,
           java.lang.String from)
Send messages to the Mjdj morphs.

Parameters:
message -
from - The name of the MIDI Device that received the message. Morphs receive this name in their process method, which may be used for filtering.

morph

void morph(MessageWrapper message,
           java.lang.String from,
           Morph afterMorph)
Parameters:
message -
from - can be null, name of the device the message is (pretending to be) from
afterMorph - can be null. It's a String that matches the getName() of the afterMorph. Only morphs lower on the list than the afterMorph will get the message

send

void send(MessageWrapper message)
Sends to all outbound MIDI devices


send

void send(MessageWrapper message,
          java.util.List<java.lang.String> sendToNames)
Parameters:
message -
sendToNames - List of names of outbound MIDI devices which will receive the message.

send

void send(MessageWrapper message,
          java.lang.String sendToName)
Parameters:
message -
sendToName - On the device matching this name is sent the message

send

void send(byte[] bytes,
          java.util.List<java.lang.String> sendToNames)
          throws javax.sound.midi.InvalidMidiDataException
Parameters:
bytes - Raw midi message
sendToNames - List of names of outbound MIDI devices which will receive the message.
Throws:
javax.sound.midi.InvalidMidiDataException

send

void send(byte[] bytes)
          throws javax.sound.midi.InvalidMidiDataException
Send to all output MIDI devices

Parameters:
bytes -
Throws:
javax.sound.midi.InvalidMidiDataException

setMorphActive

void setMorphActive(java.lang.String name,
                    boolean status)
Shuts the checkbox of a Morph implementer on or off

Parameters:
name - Name of other Morph as returned from getName()
status -

isMorphActive

boolean isMorphActive(java.lang.String name)
Parameters:
name - Name of other Morph as returned from getName()
Returns:
whether the Morph in question is active (true) or not

sendKeystrokes

void sendKeystrokes(java.lang.String keystrokes)

getAfterBeat

float getAfterBeat()
Returns:
The proportion of the beat (quarter note, generally speaking) has elapsed up until right now.

schedule

boolean schedule(MidiTimerTask task,
                 int beatsBeforeLaunch)
Parameters:
task -
beatsBeforeLaunch - - schedules from RIGHT NOW plus beatsBeforeLaunch beats. Beats refer to quarter-notes, generally. "Right now" means how far after the quarter-note we are now from the last quarter note.
Returns:
true if scheduled, false if scheduling fails for any reason

schedule

boolean schedule(MidiTimerTask task,
                 int beatsBeforeLaunch,
                 float delayAfterBeat)
Schedules the task to fire at beatsBeforeLaunch quarter-notes plus delayAfterBeat in proportion of one beat.

Parameters:
task -
beatsBeforeLaunch -
delayAfterBeat - - in proportion of a beat
Returns:
true if scheduled, false if scheduling fails for any reason

scheduleInMs

boolean scheduleInMs(MidiTimerTask task,
                     int delay)
Parameters:
task -
delay - in milliseconds
Returns:
false if not scheduled for any reason, otherwise true.

isDebug

boolean isDebug()
Returns:
true if debug mode is on inside Mjdj, otherwise false.