public class EMSSound extends EMSElement
EMSMessage
,
Serialized FormModifier and Type | Field and Description |
---|---|
static EMSSound |
CHIMES_HIGH
Predefined Sound: Chimes High
|
static EMSSound |
CHIMES_LOW
Predefined Sound: Chimes Low
|
static EMSSound |
CHORD_HIGH
Predefined Sound: Chord High
|
static EMSSound |
CHORD_LOW
Predefined Sound: Chord Low
|
static EMSSound |
CLAPS
Predefined Sound: Claps
|
static EMSSound |
DING
Predefined Sound: Ding
|
static EMSSound |
DRUM
Predefined Sound: Drum
|
static EMSSound |
FANFAR
Predefined Sound: FanFar
|
static EMSSound |
NOTIFY
Predefined Sound: Notify
|
static EMSSound |
TADA
Predefined Sound: TaDa
|
Constructor and Description |
---|
EMSSound(int number)
Construct a predefined EMS Sound element.
|
EMSSound(java.lang.String iMelody)
Construct a new user-defined EMS Sound element.
|
Modifier and Type | Method and Description |
---|---|
int |
getPredefinedSound()
Gets the number of the predefined sound.
|
java.lang.String |
getUserDefinedSound()
Gets user defined sound as iMelody.
|
static EMSSound[] |
splitMelody(java.lang.String iMelody)
Splits a iMelody in multiple parts if the length of the melody doesn't fit
in a single EMSSound element.
|
java.lang.String |
toString() |
public static final EMSSound CHIMES_HIGH
public static final EMSSound CHIMES_LOW
public static final EMSSound DING
public static final EMSSound TADA
public static final EMSSound NOTIFY
public static final EMSSound DRUM
public static final EMSSound CLAPS
public static final EMSSound FANFAR
public static final EMSSound CHORD_HIGH
public static final EMSSound CHORD_LOW
public EMSSound(java.lang.String iMelody) throws java.lang.IllegalArgumentException
Example:
String myMelody = "BEGIN:IMELODY\n"+ "VERSION:1.2\n"+ "FORMAT:CLASS1.0\n"+ "BEAT:120\n"+ "MELODY:*5#d5*5#f5*5b2*6c3*5#d5*5a5*5b2*6#d3*4b5*5g5*6e1r4\n"+ "END:IMELODY"; EMSSound sound = new EMSSound(myMelody);
iMelody
- the sound data coded according to the iMelody format.java.lang.IllegalArgumentException
- if the sound is null or exceeds 128 bytes.public EMSSound(int number)
number
- the number of the predefined sound.public static EMSSound[] splitMelody(java.lang.String iMelody) throws java.lang.IllegalArgumentException
iMelody
- the iMelodyjava.lang.IllegalArgumentException
- if the iMelody cannot be parsedjava.lang.IllegalArgumentException
- if the header and footer parameters exceed 126 bytespublic int getPredefinedSound()
public java.lang.String getUserDefinedSound()
public java.lang.String toString()
toString
in class java.lang.Object
object XP, Inc. © 2000-2013. All rights reserved object XP