| title | activeBeatsChanged | ||||||
|---|---|---|---|---|---|---|---|
| sidebar_custom_props |
|
import { Tabs, TabItem, CodeBadge, SinceBadge, DynHeading, Link, Signature } from '@site/src/reference-commons'
This event is fired when the currently active beats across all tracks change. Unlike the playedBeatChanged event this event contains the beats of all tracks and voices independent of them being rendered.<Signature style="block" js={[["keyword","readonly"],["whitespace"," "],["identifier","activeBeatsChanged"],["token",":"],["whitespace"," "],["identifier","IEventEmitterOfT","/docs/reference/types/ieventemitteroft"],["token","<"],["identifier","ActiveBeatsChangedEventArgs","/docs/reference/types/synth/activebeatschangedeventargs"],["token",">"],["token",";"]]} csharp={[["identifier","IEventEmitterOfT","/docs/reference/types/ieventemitteroft"],["token","<"],["identifier","ActiveBeatsChangedEventArgs","/docs/reference/types/synth/activebeatschangedeventargs"],["token",">"],["whitespace"," "],["identifier","ActiveBeatsChanged"],["whitespace"," "],["token","{"],["whitespace"," "],["keyword","get"],["token",";"],["whitespace"," "],["token","}"]]} kotlin={[["keyword","val"],["whitespace"," "],["identifier","activeBeatsChanged"],["token",":"],["whitespace"," "],["identifier","IEventEmitterOfT","/docs/reference/types/ieventemitteroft"],["token","<"],["identifier","ActiveBeatsChangedEventArgs","/docs/reference/types/synth/activebeatschangedeventargs"],["token",">"]]} />
<Tabs defaultValue="javascript" values={[ { label: "JavaScript", value: "javascript"}, { label: "C#", value: "csharp"}, { label: "Android", value: "android"} ]}
```js const api = new alphaTab.AlphaTabApi(document.querySelector('#alphaTab')); api.activeBeatsChanged.on(args => { updateHighlights(args.activeBeats); }); ``` ```cs var api = new AlphaTabApi(...); api.ActiveBeatsChanged.On(args => { UpdateHighlights(args.ActiveBeats); }); ``` ```kotlin val api = AlphaTabApi(...) api.activeBeatsChanged.on { args -> updateHighlights(args.activeBeats) } ```