fm.liveswitch.dtmf.Tone Class Reference

A DTMF (telephone-event) tone. More...

Public Member Functions

fm.liveswitch.dtmf.Tone clone ()
 Clones this instance. More...
 
fm.liveswitch.dtmf.Tone clone (int duration)
 Clones this instance. More...
 
int getDuration ()
 Gets the duration in milliseconds. More...
 
boolean getEnd ()
 Gets whether this is the final tone raised for the current value. More...
 
String getValue ()
 Gets the value. More...
 
String toJson ()
 Serializes to JSON. More...
 
 Tone (String value)
 Initializes a new instance of the fm.liveswitch.dtmf.Tone class. More...
 
 Tone (String value, int duration)
 Initializes a new instance of the fm.liveswitch.dtmf.Tone class. More...
 
fm.liveswitch.dtmf.Packet toPacket (int clockRate)
 Serializes to a packet. More...
 
String toString ()
 Serializes to a string. More...
 

Static Public Member Functions

static fm.liveswitch.dtmf.Tone fromJson (String toneJson)
 Deserializes from JSON. More...
 
static fm.liveswitch.dtmf.Tone[] fromJsonArray (String tonesJson)
 Deserializes an array from JSON. More...
 
static fm.liveswitch.dtmf.Tone fromPacket (fm.liveswitch.dtmf.Packet packet, int clockRate)
 Deserializes from a packet. More...
 
static fm.liveswitch.dtmf.Tone[] fromToneString (String toneString)
 Converts a DTMF tone string into an array of tones. More...
 
static fm.liveswitch.dtmf.Tone[] fromToneString (String toneString, int duration)
 Converts a DTMF tone string into an array of tones. More...
 
static fm.liveswitch.dtmf.Tone[] fromToneString (String toneString, int duration, int interToneGap)
 Converts a DTMF tone string into an array of tones. More...
 
static fm.liveswitch.dtmf.Tone getA ()
 Gets A tone. More...
 
static String getAValue ()
 Gets the A value ("A"). More...
 
static fm.liveswitch.dtmf.Tone getB ()
 Gets the B tone. More...
 
static String getBValue ()
 Gets the B value ("B"). More...
 
static fm.liveswitch.dtmf.Tone getC ()
 Gets the C tone. More...
 
static String getCValue ()
 Gets the C value ("C"). More...
 
static fm.liveswitch.dtmf.Tone getD ()
 Gets the D tone. More...
 
static String getDValue ()
 Gets the D value ("D"). More...
 
static fm.liveswitch.dtmf.Tone getEight ()
 Gets the eight tone. More...
 
static String getEightValue ()
 Gets the eight value ("8"). More...
 
static fm.liveswitch.dtmf.Tone getEmpty ()
 Gets the empty tone. More...
 
static String getEmptyValue ()
 Gets the empty value (""). More...
 
static fm.liveswitch.dtmf.Tone getFive ()
 Gets the five tone. More...
 
static String getFiveValue ()
 Gets the five value ("5"). More...
 
static fm.liveswitch.dtmf.Tone getFour ()
 Gets the four tone. More...
 
static String getFourValue ()
 Gets the four value ("4"). More...
 
static fm.liveswitch.dtmf.Tone getHash ()
 Gets the hash tone. More...
 
static String getHashValue ()
 Gets the hash value ("#"). More...
 
static fm.liveswitch.dtmf.Tone getNine ()
 Gets the nine tone. More...
 
static String getNineValue ()
 Gets the nine value ("9"). More...
 
static fm.liveswitch.dtmf.Tone getOne ()
 Gets the one tone. More...
 
static String getOneValue ()
 Gets the one value ("1"). More...
 
static fm.liveswitch.dtmf.Tone getPause ()
 Gets the pause tone. More...
 
static int getPauseDuration ()
 Gets the pause duration in milliseconds (2000). More...
 
static String getPauseValue ()
 Gets the pause value (","). More...
 
static fm.liveswitch.dtmf.Tone getSeven ()
 Gets the seven tone. More...
 
static String getSevenValue ()
 Gets the seven value ("7"). More...
 
static fm.liveswitch.dtmf.Tone getSix ()
 Gets the six tone. More...
 
static String getSixValue ()
 Gets the six value ("6"). More...
 
static fm.liveswitch.dtmf.Tone getStar ()
 Gets the star tone. More...
 
static String getStarValue ()
 Gets the star value ("*"). More...
 
static fm.liveswitch.dtmf.Tone getThree ()
 Gets the three tone. More...
 
static String getThreeValue ()
 Gets the three value ("3"). More...
 
static fm.liveswitch.dtmf.Tone getTwo ()
 Gets the two tone. More...
 
static String getTwoValue ()
 Gets the two value ("2"). More...
 
static fm.liveswitch.dtmf.Tone getZero ()
 Gets the zero tone. More...
 
static String getZeroValue ()
 Gets the zero value ("0"). More...
 
static String toJson (fm.liveswitch.dtmf.Tone tone)
 Serializes to JSON. More...
 
static String toJsonArray (fm.liveswitch.dtmf.Tone[] tones)
 Serializes an array to JSON. More...
 
static String toToneString (fm.liveswitch.dtmf.Tone[] tones)
 Converts an array of DTMF tones into a tone string. More...
 

Detailed Description

A DTMF (telephone-event) tone.

Constructor & Destructor Documentation

◆ Tone() [1/2]

fm.liveswitch.dtmf.Tone.Tone ( String  value)

Initializes a new instance of the fm.liveswitch.dtmf.Tone class.

Parameters
valueThe value.

◆ Tone() [2/2]

fm.liveswitch.dtmf.Tone.Tone ( String  value,
int  duration 
)

Initializes a new instance of the fm.liveswitch.dtmf.Tone class.

Parameters
valueThe value.
durationThe duration.

Member Function Documentation

◆ clone() [1/2]

fm.liveswitch.dtmf.Tone fm.liveswitch.dtmf.Tone.clone ( )

Clones this instance.

◆ clone() [2/2]

fm.liveswitch.dtmf.Tone fm.liveswitch.dtmf.Tone.clone ( int  duration)

Clones this instance.

Parameters
durationThe new duration.

◆ fromJson()

static fm.liveswitch.dtmf.Tone fm.liveswitch.dtmf.Tone.fromJson ( String  toneJson)
static

Deserializes from JSON.

Parameters
toneJsonThe JSON.

◆ fromJsonArray()

static fm.liveswitch.dtmf.Tone [] fm.liveswitch.dtmf.Tone.fromJsonArray ( String  tonesJson)
static

Deserializes an array from JSON.

Parameters
tonesJsonThe JSON.

◆ fromPacket()

static fm.liveswitch.dtmf.Tone fm.liveswitch.dtmf.Tone.fromPacket ( fm.liveswitch.dtmf.Packet  packet,
int  clockRate 
)
static

Deserializes from a packet.

Parameters
packetThe packet.
clockRateThe clock rate.

◆ fromToneString() [1/3]

static fm.liveswitch.dtmf.Tone [] fm.liveswitch.dtmf.Tone.fromToneString ( String  toneString)
static

Converts a DTMF tone string into an array of tones.

Each tone will have a duration of 100ms and an inter-tone gap of 100ms.

Parameters
toneStringThe tone string.

◆ fromToneString() [2/3]

static fm.liveswitch.dtmf.Tone [] fm.liveswitch.dtmf.Tone.fromToneString ( String  toneString,
int  duration 
)
static

Converts a DTMF tone string into an array of tones.

Each tone will have an inter-tone gap of 100ms.

Parameters
toneStringThe tone string.
durationThe duration, in milliseconds (minimum of 40, maximum of 2,000).

◆ fromToneString() [3/3]

static fm.liveswitch.dtmf.Tone [] fm.liveswitch.dtmf.Tone.fromToneString ( String  toneString,
int  duration,
int  interToneGap 
)
static

Converts a DTMF tone string into an array of tones.

Parameters
toneStringThe tone string.
durationThe duration, in milliseconds (minimum of 40, maximum of 2,000).
interToneGapThe time between tones, in milliseconds (minimum of 40).

◆ getA()

static fm.liveswitch.dtmf.Tone fm.liveswitch.dtmf.Tone.getA ( )
static

Gets A tone.

◆ getAValue()

static String fm.liveswitch.dtmf.Tone.getAValue ( )
static

Gets the A value ("A").

◆ getB()

static fm.liveswitch.dtmf.Tone fm.liveswitch.dtmf.Tone.getB ( )
static

Gets the B tone.

◆ getBValue()

static String fm.liveswitch.dtmf.Tone.getBValue ( )
static

Gets the B value ("B").

◆ getC()

static fm.liveswitch.dtmf.Tone fm.liveswitch.dtmf.Tone.getC ( )
static

Gets the C tone.

◆ getCValue()

static String fm.liveswitch.dtmf.Tone.getCValue ( )
static

Gets the C value ("C").

◆ getD()

static fm.liveswitch.dtmf.Tone fm.liveswitch.dtmf.Tone.getD ( )
static

Gets the D tone.

◆ getDuration()

int fm.liveswitch.dtmf.Tone.getDuration ( )

Gets the duration in milliseconds.

◆ getDValue()

static String fm.liveswitch.dtmf.Tone.getDValue ( )
static

Gets the D value ("D").

◆ getEight()

static fm.liveswitch.dtmf.Tone fm.liveswitch.dtmf.Tone.getEight ( )
static

Gets the eight tone.

◆ getEightValue()

static String fm.liveswitch.dtmf.Tone.getEightValue ( )
static

Gets the eight value ("8").

◆ getEmpty()

static fm.liveswitch.dtmf.Tone fm.liveswitch.dtmf.Tone.getEmpty ( )
static

Gets the empty tone.

◆ getEmptyValue()

static String fm.liveswitch.dtmf.Tone.getEmptyValue ( )
static

Gets the empty value ("").

◆ getEnd()

boolean fm.liveswitch.dtmf.Tone.getEnd ( )

Gets whether this is the final tone raised for the current value.

◆ getFive()

static fm.liveswitch.dtmf.Tone fm.liveswitch.dtmf.Tone.getFive ( )
static

Gets the five tone.

◆ getFiveValue()

static String fm.liveswitch.dtmf.Tone.getFiveValue ( )
static

Gets the five value ("5").

◆ getFour()

static fm.liveswitch.dtmf.Tone fm.liveswitch.dtmf.Tone.getFour ( )
static

Gets the four tone.

◆ getFourValue()

static String fm.liveswitch.dtmf.Tone.getFourValue ( )
static

Gets the four value ("4").

◆ getHash()

static fm.liveswitch.dtmf.Tone fm.liveswitch.dtmf.Tone.getHash ( )
static

Gets the hash tone.

◆ getHashValue()

static String fm.liveswitch.dtmf.Tone.getHashValue ( )
static

Gets the hash value ("#").

◆ getNine()

static fm.liveswitch.dtmf.Tone fm.liveswitch.dtmf.Tone.getNine ( )
static

Gets the nine tone.

◆ getNineValue()

static String fm.liveswitch.dtmf.Tone.getNineValue ( )
static

Gets the nine value ("9").

◆ getOne()

static fm.liveswitch.dtmf.Tone fm.liveswitch.dtmf.Tone.getOne ( )
static

Gets the one tone.

◆ getOneValue()

static String fm.liveswitch.dtmf.Tone.getOneValue ( )
static

Gets the one value ("1").

◆ getPause()

static fm.liveswitch.dtmf.Tone fm.liveswitch.dtmf.Tone.getPause ( )
static

Gets the pause tone.

◆ getPauseDuration()

static int fm.liveswitch.dtmf.Tone.getPauseDuration ( )
static

Gets the pause duration in milliseconds (2000).

◆ getPauseValue()

static String fm.liveswitch.dtmf.Tone.getPauseValue ( )
static

Gets the pause value (",").

◆ getSeven()

static fm.liveswitch.dtmf.Tone fm.liveswitch.dtmf.Tone.getSeven ( )
static

Gets the seven tone.

◆ getSevenValue()

static String fm.liveswitch.dtmf.Tone.getSevenValue ( )
static

Gets the seven value ("7").

◆ getSix()

static fm.liveswitch.dtmf.Tone fm.liveswitch.dtmf.Tone.getSix ( )
static

Gets the six tone.

◆ getSixValue()

static String fm.liveswitch.dtmf.Tone.getSixValue ( )
static

Gets the six value ("6").

◆ getStar()

static fm.liveswitch.dtmf.Tone fm.liveswitch.dtmf.Tone.getStar ( )
static

Gets the star tone.

◆ getStarValue()

static String fm.liveswitch.dtmf.Tone.getStarValue ( )
static

Gets the star value ("*").

◆ getThree()

static fm.liveswitch.dtmf.Tone fm.liveswitch.dtmf.Tone.getThree ( )
static

Gets the three tone.

◆ getThreeValue()

static String fm.liveswitch.dtmf.Tone.getThreeValue ( )
static

Gets the three value ("3").

◆ getTwo()

static fm.liveswitch.dtmf.Tone fm.liveswitch.dtmf.Tone.getTwo ( )
static

Gets the two tone.

◆ getTwoValue()

static String fm.liveswitch.dtmf.Tone.getTwoValue ( )
static

Gets the two value ("2").

◆ getValue()

String fm.liveswitch.dtmf.Tone.getValue ( )

Gets the value.

◆ getZero()

static fm.liveswitch.dtmf.Tone fm.liveswitch.dtmf.Tone.getZero ( )
static

Gets the zero tone.

◆ getZeroValue()

static String fm.liveswitch.dtmf.Tone.getZeroValue ( )
static

Gets the zero value ("0").

◆ toJson() [1/2]

String fm.liveswitch.dtmf.Tone.toJson ( )

Serializes to JSON.

◆ toJson() [2/2]

static String fm.liveswitch.dtmf.Tone.toJson ( fm.liveswitch.dtmf.Tone  tone)
static

Serializes to JSON.

◆ toJsonArray()

static String fm.liveswitch.dtmf.Tone.toJsonArray ( fm.liveswitch.dtmf.Tone[]  tones)
static

Serializes an array to JSON.

Parameters
tonesThe array.

◆ toPacket()

fm.liveswitch.dtmf.Packet fm.liveswitch.dtmf.Tone.toPacket ( int  clockRate)

Serializes to a packet.

Parameters
clockRateThe clock rate.

◆ toString()

String fm.liveswitch.dtmf.Tone.toString ( )

Serializes to a string.

◆ toToneString()

static String fm.liveswitch.dtmf.Tone.toToneString ( fm.liveswitch.dtmf.Tone[]  tones)
static

Converts an array of DTMF tones into a tone string.

This discards duration and inter-tone gap data.

Parameters
tonesThe tones.