All Packages Class Hierarchy This Package Previous Next Index
Class guinea.logic.GenericTest
java.lang.Object
|
+----guinea.logic.Test
|
+----guinea.logic.GenericTest
- public class GenericTest
- extends Test
- implements PropertyLoader, Serializable
A generic base class for tests. It handles many of the duties of
most tests.
Variable Index
- ·
autoPlaySample
- The sample to play automatically when item starts.
- ·
fadeLength
- The length of crossfade in free parallel sample swithing.
- ·
fadeType
- The type of crossfade, default is 'linear'.
- ·
played
- A counter that contains the names of the samples that have
not(!) been played yet during current item.
- ·
playName
- Name of control that does the playing control.
- ·
sampleComb
- A combination of samples that are used to implement
cross-fading.
- ·
sampleHash
- A table of samples used during current test item.
- ·
showSamplePlaying
- Whether to show to the subject which sample is currently
playing.
Constructor Index
- ·
GenericTest()
-
Method Index
- ·
controlPerformed(ControlEvent, SessionSubject)
- Process control messages from the subject UI.
- ·
createNewSession()
-
- ·
endItemSamples()
- Unload samples and do sample clean-ups when current item has
ended.
- ·
endItemSamples_base()
- Common clean-up routines for item samples.
- ·
endItemSamples_free()
- Do sample clean-ups for free-sequence samples.
- ·
endItemSamples_seq()
- Do sample clean-ups for fixed-sequence samples.
- ·
getSampleSwitchingFadeLength()
- Get the length of crossfade.
- ·
getSampleSwitchingFadeType()
- Get the cross-fade type.
- ·
hasListenedSamples()
- Tests whether all item samples have been listened to.
- ·
initItemSamples()
- Load and create sample objects for playing.
- ·
initItemSamples_base()
- Called by the initItemSamples() method to do basic
initialization of samples.
- ·
initItemSamples_free()
- Called by the initItemSamples() method to do
additional initializations needed for free-sequence tests.
- ·
initItemSamples_seq()
- Called by the initItemSamples() method to do
additional initializations needed for fixed-sequence tests.
- ·
propertyLoad(Properties, String)
-
- ·
runItem()
- Run the current item.
- ·
runSequence()
- Run the sample sequence.
- ·
samplePlay(String)
- Play an item sample.
- ·
setSampleSwitchingFadeLength(double)
- Set the length of the crossfade from one sample to another.
- ·
setSampleSwitchingFadeType(String)
- Set the cross-fade type.
Variables
·
sampleComb
protected transient ParallelSamples sampleComb
- A combination of samples that are used to implement
cross-fading.
·
sampleHash
protected transient Hashtable sampleHash
- A table of samples used during current test item. Keys are
sample parameter names, such as A, B, or
Ref.
·
autoPlaySample
protected String autoPlaySample
- The sample to play automatically when item starts.
·
played
protected transient KeyCounter played
- A counter that contains the names of the samples that have
not(!) been played yet during current item. This parameter
name will probably be changed in the future, since the name is
a bit misleading.
·
playName
protected String playName
- Name of control that does the playing control. The default is
play.
·
showSamplePlaying
protected boolean showSamplePlaying
- Whether to show to the subject which sample is currently
playing. Default is
true
.
·
fadeLength
protected double fadeLength
- The length of crossfade in free parallel sample swithing. The
value is given in seconds. The default is 0.04 (40ms).
·
fadeType
protected String fadeType
- The type of crossfade, default is 'linear'.
- See Also:
- FADE_LINEAR
Constructors
·
GenericTest
public GenericTest()
Methods
·
setSampleSwitchingFadeType
public void setSampleSwitchingFadeType(String fadeType)
- Set the cross-fade type.
- Parameters:
- fadeType - the type of fade.
- See Also:
- setFadeType
·
getSampleSwitchingFadeType
public String getSampleSwitchingFadeType()
- Get the cross-fade type.
- Returns:
- the type of the cross-fade.
- See Also:
- getFadeType
·
setSampleSwitchingFadeLength
public void setSampleSwitchingFadeLength(double fadeLength)
- Set the length of the crossfade from one sample to another.
- Parameters:
- fadeLength - the length of fade in seconds.
- See Also:
- setFadeLength
·
getSampleSwitchingFadeLength
public double getSampleSwitchingFadeLength()
- Get the length of crossfade.
- Returns:
- the length of crossfade in seconds.
- See Also:
- getFadeLength
·
runSequence
protected void runSequence() throws InterruptedException
- Run the sample sequence.
- Throws: InterruptedException
- an exception is thrown if
sequence was interrupted for some reason .
- Overrides:
- runSequence in class Test
·
runItem
protected void runItem() throws InterruptedException
- Run the current item. This method is run at the start of item
after it has been initialized when using free sequence.
- Throws: InterruptedException
- an exception is thrown if
sequence was interrupted for some reason .
- Overrides:
- runItem in class Test
·
initItemSamples
protected void initItemSamples() throws Exception
- Load and create sample objects for playing. Information about
samples are read from the information about the current item.
The initItemSamples_base() method is called for
common basic initialization of item samples. In addition,
based on the type of selected sequence type, either
initItemSamples_free() or
initItemSamples_seq() is called.
- Throws: Exception
- initialization of samples may throw a
exception if something went wrong.
- Overrides:
- initItemSamples in class Test
- See Also:
- initItemSamples_base, initItemSamples_free, initItemSamples_seq
·
initItemSamples_base
protected void initItemSamples_base() throws Exception
- Called by the initItemSamples() method to do basic
initialization of samples. This method makes sure the item
samples are loaded. Sub-classes generally extend this method
to decode the item parameters to get samples of the current
item.
- Throws: Exception
- Initialization of samples may throw a
exception if something went wrong.
- See Also:
- initItemSamples
·
initItemSamples_free
protected void initItemSamples_free() throws Exception
- Called by the initItemSamples() method to do
additional initializations needed for free-sequence tests. In
this case, a parallel sample is created to handle cross-fading
between item samples.
- Throws: Exception
- Initialization of samples may throw a
exception if something went wrong.
- See Also:
- initItemSamples
·
initItemSamples_seq
protected void initItemSamples_seq() throws Exception
- Called by the initItemSamples() method to do
additional initializations needed for fixed-sequence tests.
In this case, nothing needs to be done.
- Throws: Exception
- Initialization of samples may throw a
exception if something went wrong.
- See Also:
- initItemSamples
·
endItemSamples
protected void endItemSamples()
- Unload samples and do sample clean-ups when current item has
ended. Based on the selected sequence type, either
endItemSamples_free() or
endItemSamples_seq() is called to do sample cleanup
routines. Last, the endItemSamples_base() is called
to unload the samples.
- Overrides:
- endItemSamples in class Test
- See Also:
- endItemSamples_base, endItemSamples_free, endItemSamples_seq
·
endItemSamples_base
protected void endItemSamples_base()
- Common clean-up routines for item samples. It is called by
the endItemSamples() method to unload all samples
after free or fixed-sequence clean-ups have been done.
- See Also:
- endItemSamples
·
endItemSamples_free
protected void endItemSamples_free()
- Do sample clean-ups for free-sequence samples. It is called
by the endItemSamples() method. This method stops
and destroys (breaks up) the parallel sample created for
performing cross-fading.
- See Also:
- endItemSamples
·
endItemSamples_seq
protected void endItemSamples_seq()
- Do sample clean-ups for fixed-sequence samples. It is called
by the endItemSamples() method. This method stops
all samples.
- See Also:
- endItemSamples
·
hasListenedSamples
protected boolean hasListenedSamples()
- Tests whether all item samples have been listened to.
- Returns:
-
True
if all item samples have been
played.
·
samplePlay
protected void samplePlay(String name)
- Play an item sample.
- Parameters:
- name - The name of sample to play. In this context, the
names are parameter names, such as A, B, or
Ref. A
null
name stops current
sample.
·
controlPerformed
public void controlPerformed(ControlEvent e,
SessionSubject subj)
- Process control messages from the subject UI. This method
catches and processes the events from the
'sample-play' controller. Other events are passed to
the super-class for processing.
- Parameters:
- e - A control event.
- subj - The session subject that sent this event.
- Overrides:
- controlPerformed in class Test
- See Also:
- samplePlay, playName
·
createNewSession
public Test createNewSession()
- Overrides:
- createNewSession in class Test
·
propertyLoad
public void propertyLoad(Properties p,
String name) throws IllegalArgumentException
- Overrides:
- propertyLoad in class Test
All Packages Class Hierarchy This Package Previous Next Index