Class GlobalTrack
- java.lang.Object
-
- org.zkoss.chart.Optionable
-
- org.zkoss.chart.GlobalTrack
-
- All Implemented Interfaces:
Serializable
,OptionDataListener
,org.zkoss.json.JSONAware
- Direct Known Subclasses:
DefaultInstrumentOptions
,GlobalContextTrack
,Track
public class GlobalTrack extends Optionable
Global tracks to add to every series.Defined as an array of either instrument or speech tracks, or a combination.
- 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 GlobalTrack()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getActiveWhen()
Returns the ActiveWhen object.String
getInstrument()
Returns instrument to use for playing.Mapping
getMapping()
Returns the Mapping object.String
getMidiName()
Returns the name to use for a track when exporting to MIDI.PointGrouping
getPointGrouping()
Returns the options for point grouping, specifically for instrument tracks.String
getType()
Returns the type of track.boolean
isRoundToMusicalNotes()
Returns the round pitch mapping to musical notes.boolean
isShowPlayMarker()
Returns the round pitch mapping to musical notes.void
setActiveWhen(ActiveWhen activeWhen)
Sets the ActiveWhen object.void
setActiveWhen(org.zkoss.json.JavaScriptValue activeWhen)
Sets the JavaScriptValue of active when.void
setInstrument(String instrument)
Sets instrument to use for playing.void
setMapping(Mapping mapping)
Sets the Mapping object.void
setMidiName(String midiName)
Sets the name to use for a track when exporting to MIDI.void
setPointGrouping(PointGrouping pointGrouping)
Sets the options for point grouping, specifically for instrument tracks.void
setRoundToMusicalNotes(boolean roundToMusicalNotes)
Sets the round pitch mapping to musical notes.void
setShowPlayMarker(boolean showPlayMarker)
Sets the round pitch mapping to musical notes.void
setType(String type)
Sets the type of track.-
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
-
getActiveWhen
public Object getActiveWhen()
Returns the ActiveWhen object.Define a condition for when a track should be active and not.
Can either be a function callback or a configuration object.
If a function is used, it should return a
boolean
for whether or not the track should be active. The function is called for each audio event, and receives a parameter object withtime
, and potentiallypoint
andvalue
properties depending on the track.point
is available if the audio event is related to a data point.value
is available if the track is used as a context track, andvalueInterval
is used.
-
setActiveWhen
public void setActiveWhen(ActiveWhen activeWhen)
Sets the ActiveWhen object.Define a condition for when a track should be active and not.
Can either be a function callback or a configuration object.
If a function is used, it should return a
boolean
for whether or not the track should be active. The function is called for each audio event, and receives a parameter object withtime
, and potentiallypoint
andvalue
properties depending on the track.point
is available if the audio event is related to a data point.value
is available if the track is used as a context track, andvalueInterval
is used.
-
setActiveWhen
public void setActiveWhen(org.zkoss.json.JavaScriptValue activeWhen)
Sets the JavaScriptValue of active when.Define a condition for when a track should be active and not.
Can either be a function callback or a configuration object.
If a function is used, it should return a
boolean
for whether or not the track should be active. The function is called for each audio event, and receives a parameter object withtime
, and potentiallypoint
andvalue
properties depending on the track.point
is available if the audio event is related to a data point.value
is available if the track is used as a context track, andvalueInterval
is used.
-
getInstrument
public String getInstrument()
Returns instrument to use for playing.Can either be a string referencing a synth preset, or it can be a synth configuration object.
Default:
"piano"
-
setInstrument
public void setInstrument(String instrument)
Sets instrument to use for playing.Can either be a string referencing a synth preset, or it can be a synth configuration object.
-
getMapping
public Mapping getMapping()
Returns the Mapping object.Mapping options for the audio parameters.
All parameters can be either:
- A string, referencing a point property to map to.
- A number, setting the value of the audio parameter directly.
- A callback function, returning the value programmatically.
- An object defining detailed configuration of the mapping.
-
setMapping
public void setMapping(Mapping mapping)
Sets the Mapping object.Mapping options for the audio parameters.
All parameters can be either:
- A string, referencing a point property to map to.
- A number, setting the value of the audio parameter directly.
- A callback function, returning the value programmatically.
- An object defining detailed configuration of the mapping.
-
getMidiName
public String getMidiName()
Returns the name to use for a track when exporting to MIDI. By default it uses the series name if the track is related to a series. Default: null
-
setMidiName
public void setMidiName(String midiName)
Sets the name to use for a track when exporting to MIDI. By default it uses the series name if the track is related to a series.
-
getPointGrouping
public PointGrouping getPointGrouping()
Returns the options for point grouping, specifically for instrument tracks.
-
setPointGrouping
public void setPointGrouping(PointGrouping pointGrouping)
Sets the options for point grouping, specifically for instrument tracks.
-
isRoundToMusicalNotes
public boolean isRoundToMusicalNotes()
Returns the round pitch mapping to musical notes.If false, will play the exact mapped note, even if it is out of tune compared to the musical notes as defined by 440Hz standard tuning.
Default:
true
-
setRoundToMusicalNotes
public void setRoundToMusicalNotes(boolean roundToMusicalNotes)
Sets the round pitch mapping to musical notes.If false, will play the exact mapped note, even if it is out of tune compared to the musical notes as defined by 440Hz standard tuning.
-
isShowPlayMarker
public boolean isShowPlayMarker()
Returns the round pitch mapping to musical notes.If false, will play the exact mapped note, even if it is out of tune compared to the musical notes as defined by 440Hz standard tuning.
Default:
true
-
setShowPlayMarker
public void setShowPlayMarker(boolean showPlayMarker)
Sets the round pitch mapping to musical notes.If false, will play the exact mapped note, even if it is out of tune compared to the musical notes as defined by 440Hz standard tuning.
-
getType
public String getType()
Returns the type of track. Always"instrument"
for instrument tracks, and "speech" forspeech
tracks.Default:
"instrument"
-
setType
public void setType(String type)
Sets the type of track. Always"instrument"
for instrument tracks, and "speech" forspeech
tracks.
-
-