|
WIMM Labs |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.wimm.framework.os.Beeper.Sequence
public static final class Beeper.Sequence
Describes a sequence of beeps and breaks (pauses).
Sequences can be played using the Beeper
.
Constructor Summary | |
---|---|
Beeper.Sequence(boolean repeats)
Constructor for an empty sequence. |
|
Beeper.Sequence(int[][] pattern,
boolean repeats)
Constructor for a sequence of beeps and breaks (pauses). |
Method Summary | |
---|---|
Beeper.Sequence |
addBeep(Beeper.Beep beep)
Adds a Beeper.Beep at the end of the sequence. |
Beeper.Sequence |
addBeep(int duration,
int pitch)
Adds a Beeper.Beep at the end of the sequence using the provided duration and pitch . |
Beeper.Sequence |
addBreak(int duration)
Adds a break (pause) at the end of the sequence using the provided duration . |
int |
duration()
The sum of the duration of all beeps and breaks in the sequence. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Beeper.Sequence(boolean repeats)
repeats
- true
if the sequence should start from the beginning after finishing.public Beeper.Sequence(int[][] pattern, boolean repeats)
pattern
- An array of integer pairs representing the beeps and breaks.
The first integer in each pair is the duration.
If the second integer is positive, then the pair is treated as a Beeper.Beep
and the second integer becomes the pitch.
If the second integer is negative, then the pair is treated as a break and the second integer is ignored.
The following array describes a 500ms beep, followed by a 100ms pause,
followed by a 100ms beep, followed by a 100ms pause:
{ {500, 220}, {100, -1}, {100, 220}, {100, -1} }
repeats
- true
if the sequence should start from the beginning after finishing.Method Detail |
---|
public Beeper.Sequence addBeep(Beeper.Beep beep)
Beeper.Beep
at the end of the sequence.
beep
- The Beeper.Beep
.public Beeper.Sequence addBeep(int duration, int pitch)
Beeper.Beep
at the end of the sequence using the provided duration
and pitch
.
duration
- The length of the beep in milliseconds. Values range from 0 to 5000.pitch
- The tone of the beep. Values range from 0 to 255. Low=0, High=255.public Beeper.Sequence addBreak(int duration)
duration
.
duration
- The length of the break in milliseconds. Values range from 0 to 5000.public int duration()
|
WIMM Labs |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |