alphaTab.ICursorHandler
Classes implementing this interface can handle the cursor placement logic as the playback in alphaTab progresses.
interface ICursorHandlerMethods​
onAttach​
Called when this handler activates. This can be on dynamic cursor creation or when setting a custom handler with cursors already created.
| Parameter | Summary |
|---|---|
cursorsAll | A container holding information about the cursor elements. |
onDetach​
Called when this handler deactivates. This can be on dynamic cursor destroy or when setting a new custom handler.
| Parameter | Summary |
|---|---|
cursorsAll | A container holding information about the cursor elements. |
placeBarCursor​
Instructs the handler to place the bar cursor for the given beat bounds instantly .
- JavaScript
- C#
- Kotlin
placeBarCursor(barCursor: IContainer, beatBounds: BeatBounds): voidvoid PlaceBarCursor(IContainer barCursor, BeatBounds beatBounds)fun placeBarCursor(barCursor: IContainer, beatBounds: BeatBounds): Unit| Parameter | Summary |
|---|---|
barCursorAll | The bar cursor. |
beatBoundsAll | The bounds of the currently active beat. |
placeBeatCursor​
Instructs the handler to place the beat cursor for the given beat bounds instantly.
- JavaScript
- C#
- Kotlin
placeBeatCursor(beatCursor: IContainer, beatBounds: BeatBounds, startBeatX: number): voidvoid PlaceBeatCursor(IContainer beatCursor, BeatBounds beatBounds, double startBeatX)fun placeBeatCursor(beatCursor: IContainer, beatBounds: BeatBounds, startBeatX: Double): Unit| Parameter | Summary |
|---|---|
beatCursorAll | (no description) |
beatBoundsAll | The bounds of the currently active beat. |
startBeatXAll | (no description) |
transitionBeatCursor​
Instructs the handler to initiate a transition of the beat cursor (e.g. for dynamic animation).
- JavaScript
- C#
- Kotlin
transitionBeatCursor(beatCursor: IContainer, beatBounds: BeatBounds, startBeatX: number, nextBeatX: number, duration: number, cursorMode: MidiTickLookupFindBeatResultCursorMode): voidvoid TransitionBeatCursor(IContainer beatCursor, BeatBounds beatBounds, double startBeatX, double nextBeatX, double duration, MidiTickLookupFindBeatResultCursorMode cursorMode)fun transitionBeatCursor(beatCursor: IContainer, beatBounds: BeatBounds, startBeatX: Double, nextBeatX: Double, duration: Double, cursorMode: MidiTickLookupFindBeatResultCursorMode): Unit| Parameter | Summary |
|---|---|
beatCursorAll | The beat cursor |
beatBoundsAll | The bounds of the currently active beat. |
startBeatXAll | The X-position where the transition of the beat cursor should start. |
nextBeatXAll | The X-position where the transition of the beat cursor should end (typically the next beat or end of bar depending on the cursor mode and seeks) |
durationAll | The duration in milliseconds on how long the transition should take. |
cursorModeAll | The active cursor mode for the cursor placement. |