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 ObjectgetActiveWhen()Returns the ActiveWhen object.StringgetInstrument()Returns instrument to use for playing.MappinggetMapping()Returns the Mapping object.StringgetMidiName()Returns the name to use for a track when exporting to MIDI.PointGroupinggetPointGrouping()Returns the options for point grouping, specifically for instrument tracks.StringgetType()Returns the type of track.booleanisRoundToMusicalNotes()Returns the round pitch mapping to musical notes.booleanisShowPlayMarker()Returns the round pitch mapping to musical notes.voidsetActiveWhen(ActiveWhen activeWhen)Sets the ActiveWhen object.voidsetActiveWhen(org.zkoss.json.JavaScriptValue activeWhen)Sets the JavaScriptValue of active when.voidsetInstrument(String instrument)Sets instrument to use for playing.voidsetMapping(Mapping mapping)Sets the Mapping object.voidsetMidiName(String midiName)Sets the name to use for a track when exporting to MIDI.voidsetPointGrouping(PointGrouping pointGrouping)Sets the options for point grouping, specifically for instrument tracks.voidsetRoundToMusicalNotes(boolean roundToMusicalNotes)Sets the round pitch mapping to musical notes.voidsetShowPlayMarker(boolean showPlayMarker)Sets the round pitch mapping to musical notes.voidsetType(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
booleanfor whether or not the track should be active. The function is called for each audio event, and receives a parameter object withtime, and potentiallypointandvalueproperties depending on the track.pointis available if the audio event is related to a data point.valueis available if the track is used as a context track, andvalueIntervalis 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
booleanfor whether or not the track should be active. The function is called for each audio event, and receives a parameter object withtime, and potentiallypointandvalueproperties depending on the track.pointis available if the audio event is related to a data point.valueis available if the track is used as a context track, andvalueIntervalis 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
booleanfor whether or not the track should be active. The function is called for each audio event, and receives a parameter object withtime, and potentiallypointandvalueproperties depending on the track.pointis available if the audio event is related to a data point.valueis available if the track is used as a context track, andvalueIntervalis 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" forspeechtracks.Default:
"instrument"
-
setType
public void setType(String type)
Sets the type of track. Always"instrument"for instrument tracks, and "speech" forspeechtracks.
-
-