hmi.elckerlyc.planunit
Interface PlanUnit

All Known Subinterfaces:
SpeechUnit
All Known Implementing Classes:
AbstractPlanUnit, AbstractSpeechUnit, AudioUnit, DirectTTSUnit, GazeTMU, InterruptUnit, PhysicalTMU, PointingTMU, TextSpeechUnit, TimedFaceUnit, TimedMotionUnit, TransitionTMU, TTSUnit, WaitUnit, WavAudioUnit, WavTTSUnit

public interface PlanUnit


Method Summary
 void addFeedbackListener(BMLFeedbackListener fb)
          Adds a feedback listener
 void feedback(BMLSyncPointProgressFeedback fb)
          Send feedback to all feedback listeners
 List<String> getAvailableSyncs()
          Get the list of sync ids that can be used in this behavior.
 BMLBlockPeg getBMLBlockPeg()
          Get the BML block to which this PlanUnit belongs
 String getBMLId()
          Get the BML block id of the PlanUnit
 double getEndTime()
          Get the global end time of the PlanUnit, TimePeg.VALUEUNKNOWN if not known (yet)
 String getId()
          Get the behaviour id of the PlanUnit
 double getPreferedDuration()
          0 is unknown/persistent
 double getRelativeTime(String syncId)
          Get the relative timing of this sync id Implementing classes should at least provide valid relative times for the BML sync points
 String getReplacementGroup()
          Get the PlanUnit replacement group (=typically the BML behavior) Used to determine the currently active persistent PlanUnit for this group in the player Only one group is active at a time null is none
 double getStartTime()
          Get the global start time of the PlanUnit, TimePeg.VALUEUNKNOWN if not known (yet)
 PlanUnitState getState()
          Get the plan unit state
 double getTime(String syncId)
          Get the global time of sync syncId of the PlanUnit, TimePeg.VALUEUNKNOWN if not known (yet)
 TimePeg getTimePeg(String syncId)
          null is not set
 boolean hasValidTiming()
          Checks if the timing of this plan unit is 'valid' (e.g. stuff like start is earlier than end, but also planunit specific stuff like biomechanically possible timing).
 boolean isDone()
          State is done?
 boolean isLurking()
          State is lurking?
 boolean isPlaying()
          In PlanUnitState.IN_EXEC or PlanUnitState.SUBSIDING
 boolean isSubUnit()
          Return true if this unit is a subunit of another planunit (e.g. a visime or speech-related timed motion unit)
 void play(double time)
          Plays the unit at global time time.
 void reset()
          Resets the plan unit.
 void setParameterValue(String paramId, float value)
          Sets a parameter value
 void setParameterValue(String paramId, String value)
          Sets a parameter value
 void setState(PlanUnitState newState)
          Set the plan unit state
 void setTimePeg(String syncId, TimePeg peg)
          Assigns a TimePeg to a sync in the PlanUnit
 void start(double time)
          Starts the Plan unit, is called only once before the first play is called.
 void stop(double time)
          Stop the Plan unit.
 

Method Detail

getBMLBlockPeg

BMLBlockPeg getBMLBlockPeg()
Get the BML block to which this PlanUnit belongs


getId

String getId()
Get the behaviour id of the PlanUnit


getBMLId

String getBMLId()
Get the BML block id of the PlanUnit


feedback

void feedback(BMLSyncPointProgressFeedback fb)
Send feedback to all feedback listeners

Parameters:
fb - feedback to send

addFeedbackListener

void addFeedbackListener(BMLFeedbackListener fb)
Adds a feedback listener

Parameters:
fb - feedback listener to add

setState

void setState(PlanUnitState newState)
Set the plan unit state


getState

PlanUnitState getState()
Get the plan unit state


start

void start(double time)
           throws PlayException
Starts the Plan unit, is called only once before the first play is called.

Parameters:
time - global time, used for feedback
Throws:
PlayException

stop

void stop(double time)
          throws PlayException
Stop the Plan unit.

Parameters:
time - global time, used for feedback
Throws:
PlayException

play

void play(double time)
          throws PlayException
Plays the unit at global time time. Is allowed to be a blocking call.

Throws:
PlayException

reset

void reset()
Resets the plan unit. That is: set the


getReplacementGroup

String getReplacementGroup()
Get the PlanUnit replacement group (=typically the BML behavior) Used to determine the currently active persistent PlanUnit for this group in the player Only one group is active at a time null is none


getStartTime

double getStartTime()
Get the global start time of the PlanUnit, TimePeg.VALUEUNKNOWN if not known (yet)


getEndTime

double getEndTime()
Get the global end time of the PlanUnit, TimePeg.VALUEUNKNOWN if not known (yet)


getTime

double getTime(String syncId)
Get the global time of sync syncId of the PlanUnit, TimePeg.VALUEUNKNOWN if not known (yet)


getAvailableSyncs

List<String> getAvailableSyncs()
Get the list of sync ids that can be used in this behavior. The list is ordered in relative time and maintains the BML order for BML syncIds. All BML syncs should be present in this list.


getRelativeTime

double getRelativeTime(String syncId)
                       throws RelativeSyncNotFoundException
Get the relative timing of this sync id Implementing classes should at least provide valid relative times for the BML sync points

Returns:
relative time in range [0..1]
Throws:
RelativeSyncNotFoundException

getTimePeg

TimePeg getTimePeg(String syncId)
null is not set


setTimePeg

void setTimePeg(String syncId,
                TimePeg peg)
Assigns a TimePeg to a sync in the PlanUnit


isLurking

boolean isLurking()
State is lurking?


isDone

boolean isDone()
State is done?


isSubUnit

boolean isSubUnit()
Return true if this unit is a subunit of another planunit (e.g. a visime or speech-related timed motion unit)


getPreferedDuration

double getPreferedDuration()
0 is unknown/persistent


isPlaying

boolean isPlaying()
In PlanUnitState.IN_EXEC or PlanUnitState.SUBSIDING

Returns:

hasValidTiming

boolean hasValidTiming()
Checks if the timing of this plan unit is 'valid' (e.g. stuff like start is earlier than end, but also planunit specific stuff like biomechanically possible timing).

Returns:
true if valid

setParameterValue

void setParameterValue(String paramId,
                       String value)
Sets a parameter value


setParameterValue

void setParameterValue(String paramId,
                       float value)
Sets a parameter value