Class 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
    • Constructor Detail

      • Sonification

        public Sonification()
    • 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.