Class Sonification
- java.lang.Object
-
- org.zkoss.chart.Optionable
-
- org.zkoss.chart.Sonification
-
- All Implemented Interfaces:
Serializable
,OptionDataListener
,org.zkoss.json.JSONAware
public class Sonification extends Optionable
Options for configuring sonification and audio charts. Requires the sonification module to be loaded.- Since:
- 11.2.0.0
- Author:
- Jamson Chan
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.zkoss.chart.Optionable
NOT_NULL_VALUE, options
-
-
Constructor Summary
Constructors Constructor Description Sonification()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Number
getAfterSeriesWait()
Returns the time to wait in milliseconds after each data series when playing the series one after the other.DefaultInstrumentOptions
getDefaultInstrumentOptions()
Returns the default sonification options for all instrument tracks.DefaultSpeechOptions
getDefaultSpeechOptions()
Returns the default sonification options for all speech tracks.Number
getDuration()
Returns the total duration of the sonification, in milliseconds.org.zkoss.json.JavaScriptValue
getEvents()
Returns the event handlers for the sonification.GlobalContextTrack
getGlobalContextTracks()
Returns the GlobalContextTrack options, if any, Otherwise, create a new one.GlobalContextTrack
getGlobalContextTracks(int index)
Returns the GlobalContextTrack options from given index, if any, Otherwise, create a new one.int
getGlobalContextTracksSize()
Returns the size of globalContextTracks.GlobalTrack
getGlobalTracks()
Returns the GlobatTrack options, if any, Otherwise, create a new one.GlobalTrack
getGlobalTracks(int index)
Returns the GlobatTrack options from given index, if any, Otherwise, create a new one.int
getGlobalTracksSize()
Returns the size of globalTracks.Number
getMasterVolume()
Returns overall/master volume for the sonification, from 0 to 1.String
getOrder()
Returns what order to play the data series in, either sequential where the series play individually one after the other, or simultaneous where the series play all at once.PointGrouping
getPointGrouping()
Returns the PointGrouping object.Number
getUpdateInterval()
Returns how long to wait between each recomputation of the sonification, if the chart updates rapidly.boolean
isEnabled()
Returns whether to enable or disable the sonification functionality for the chart.boolean
isShowCrosshair()
Returns whether to show X and Y axis crosshairs (if they exist) as the chart plays.boolean
isShowTooltip()
Returns whether to Show tooltip as the chart plays.void
setAfterSeriesWait(Number afterSeriesWait)
Sets the time to wait in milliseconds after each data series when playing the series one after the other.void
setDefaultInstrumentOptions(DefaultInstrumentOptions defaultInstrumentOptions)
Sets the default sonification options for all instrument tracks.void
setDefaultSpeechOptions(DefaultSpeechOptions defaultSpeechOptions)
Sets the default sonification options for all speech tracks.void
setDuration(Number duration)
Sets the total duration of the sonification, in milliseconds.void
setEnabled(boolean enabled)
Sets whether to enable or disable the sonification functionality for the chart.void
setEvents(org.zkoss.json.JavaScriptValue events)
Sets the event handlers for the sonification.void
setMasterVolume(Number masterVolume)
Sets overall/master volume for the sonification, from 0 to 1.void
setOrder(String order)
Sets what order to play the data series in, either sequential where the series play individually one after the other, or simultaneous where the series play all at once.void
setPointGrouping(PointGrouping pointGrouping)
Sets the PointGrouping object.void
setShowCrosshair(boolean showCrosshair)
Sets whether to show X and Y axis crosshairs (if they exist) as the chart plays.void
setShowTooltip(boolean showTooltip)
Sets whether to Show tooltip as the chart plays.void
setUpdateInterval(Number updateInterval)
Sets how long to wait between each recomputation of the sonification, if the chart updates rapidly.-
Methods inherited from class org.zkoss.chart.Optionable
addExtraAttr, addOptionDataListener, clearOptonDataListener, clone, containsKey, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, getAttr, getAttr, getClientState, getExtraAttr, merge, onChange, removeExtraAttr, removeKey, removeOptionDataListener, setAttr, setAttr, setAttr, setAttr, toJSONString, toString
-
-
-
-
Method Detail
-
getAfterSeriesWait
public Number getAfterSeriesWait()
Returns the time to wait in milliseconds after each data series when playing the series one after the other.Default:
700
-
setAfterSeriesWait
public void setAfterSeriesWait(Number afterSeriesWait)
Sets the time to wait in milliseconds after each data series when playing the series one after the other.
-
getDefaultInstrumentOptions
public DefaultInstrumentOptions getDefaultInstrumentOptions()
Returns the default sonification options for all instrument tracks.If specific options are also set on individual tracks or per series, those will override these options.
-
setDefaultInstrumentOptions
public void setDefaultInstrumentOptions(DefaultInstrumentOptions defaultInstrumentOptions)
Sets the default sonification options for all instrument tracks.If specific options are also set on individual tracks or per series, those will override these options.
-
getDefaultSpeechOptions
public DefaultSpeechOptions getDefaultSpeechOptions()
Returns the default sonification options for all speech tracks.
-
setDefaultSpeechOptions
public void setDefaultSpeechOptions(DefaultSpeechOptions defaultSpeechOptions)
Sets the default sonification options for all speech tracks.
-
getDuration
public Number getDuration()
Returns the total duration of the sonification, in milliseconds.Default:
6000
-
setDuration
public void setDuration(Number duration)
Sets the total duration of the sonification, in milliseconds.
-
isEnabled
public boolean isEnabled()
Returns whether to enable or disable the sonification functionality for the chart.Default:
true
-
setEnabled
public void setEnabled(boolean enabled)
Sets whether to enable or disable the sonification functionality for the chart.
-
getEvents
public org.zkoss.json.JavaScriptValue getEvents()
Returns the event handlers for the sonification.Default:
null
-
setEvents
public void setEvents(org.zkoss.json.JavaScriptValue events)
Sets the event handlers for the sonification.
-
getGlobalContextTracksSize
public int getGlobalContextTracksSize()
Returns the size of globalContextTracks.
-
getGlobalContextTracks
public GlobalContextTrack getGlobalContextTracks()
Returns the GlobalContextTrack options, if any, Otherwise, create a new one.Returns the first node (index 0) by default.
Context tracks to add globally, an array of either instrument tracks, speech tracks, or a mix.
Context tracks are not tied to data points, but play at a set interval - either based on time or on prop values.
-
getGlobalContextTracks
public GlobalContextTrack getGlobalContextTracks(int index)
Returns the GlobalContextTrack options from given index, if any, Otherwise, create a new one.Context tracks to add globally, an array of either instrument tracks, speech tracks, or a mix.
Context tracks are not tied to data points, but play at a set interval - either based on time or on prop values.
-
getGlobalTracksSize
public int getGlobalTracksSize()
Returns the size of globalTracks.
-
getGlobalTracks
public GlobalTrack getGlobalTracks()
Returns the GlobatTrack options, if any, Otherwise, create a new one.Returns the first node (index 0) by default.
Global tracks to add to every series.
Defined as an array of either instrument or speech tracks, or a combination.
-
getGlobalTracks
public GlobalTrack getGlobalTracks(int index)
Returns the GlobatTrack options from given index, if any, Otherwise, create a new one.Global tracks to add to every series.
Defined as an array of either instrument or speech tracks, or a combination.
-
getMasterVolume
public Number getMasterVolume()
Returns overall/master volume for the sonification, from 0 to 1.Default:
0.7
-
setMasterVolume
public void setMasterVolume(Number masterVolume)
Sets overall/master volume for the sonification, from 0 to 1.
-
getOrder
public String getOrder()
Returns what order to play the data series in, either sequential where the series play individually one after the other, or simultaneous where the series play all at once.Default:
"sequential"
-
setOrder
public void setOrder(String order)
Sets what order to play the data series in, either sequential where the series play individually one after the other, or simultaneous where the series play all at once.
-
getPointGrouping
public PointGrouping getPointGrouping()
Returns the PointGrouping object. Options for grouping data points together when sonifying. This allows for the visual presentation to contain more points than what is being played. If not enabled, all visible / uncropped points are played.
-
setPointGrouping
public void setPointGrouping(PointGrouping pointGrouping)
Sets the PointGrouping object. Options for grouping data points together when sonifying. This allows for the visual presentation to contain more points than what is being played. If not enabled, all visible / uncropped points are played.
-
isShowCrosshair
public boolean isShowCrosshair()
Returns whether to show X and Y axis crosshairs (if they exist) as the chart plays. Note that if multiple tracks that play at different times try to show the crosshairs, it can be glitchy, so it is recommended in those cases to turn this on/off for individual tracks using the showPlayMarker option.Default:
true
-
setShowCrosshair
public void setShowCrosshair(boolean showCrosshair)
Sets whether to show X and Y axis crosshairs (if they exist) as the chart plays. Note that if multiple tracks that play at different times try to show the crosshairs, it can be glitchy, so it is recommended in those cases to turn this on/off for individual tracks using the showPlayMarker option.
-
isShowTooltip
public boolean isShowTooltip()
Returns whether to Show tooltip as the chart plays. Note that if multiple tracks that play at different times try to show the tooltip, it can be glitchy, so it is recommended in those cases to turn this on/off for individual tracks using the showPlayMarker option.Default:
true
-
setShowTooltip
public void setShowTooltip(boolean showTooltip)
Sets whether to Show tooltip as the chart plays. Note that if multiple tracks that play at different times try to show the tooltip, it can be glitchy, so it is recommended in those cases to turn this on/off for individual tracks using the showPlayMarker option.
-
getUpdateInterval
public Number getUpdateInterval()
Returns how long to wait between each recomputation of the sonification, if the chart updates rapidly. This avoids slowing down processes like panning.Given in milliseconds.Default:
200
-
setUpdateInterval
public void setUpdateInterval(Number updateInterval)
Sets how long to wait between each recomputation of the sonification, if the chart updates rapidly. This avoids slowing down processes like panning.Given in milliseconds.
-
-