Skip to content

Commit a074c04

Browse files
committed
Opened up API for tick cache
1 parent e105715 commit a074c04

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Build/JavaScript/jquery.alphaTab.alphaSynth.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,17 @@
4848
var selectionEnd = null;
4949
var selecting = false;
5050

51-
function getTickCache(element) {
51+
api.getTickCache = function(element) {
5252
return element.data('alphaSynthTickCache');
5353
}
54-
function getCursorCache(element) {
54+
api.getCursorCache = function(element) {
5555
return element.data('alphaSynthCursorCache');
5656
}
5757

5858
// updates the cursors to highlight the beat at the specified tick position
5959
api.playerCursorUpdateTick = function(element, context, tick) {
6060
requestAnimationFrame(function() {
61-
var cache = getTickCache(element);
61+
var cache = api.getTickCache(element);
6262
if(cache) {
6363
var tracks = api.tracks(element, context);
6464
if(tracks.length > 0) {
@@ -73,7 +73,7 @@
7373

7474
api.playerCursorSelectRange = function(element, context, startBeat, endBeat) {
7575

76-
var cache = getCursorCache(element);
76+
var cache = api.getCursorCache(element);
7777
if(!cache) {
7878
return;
7979
}
@@ -167,7 +167,7 @@
167167
api.playerCursorUpdateBeat = function(element, context, beat, nextBeat, duration) {
168168
if(beat == null) return;
169169

170-
var cache = getCursorCache(element);
170+
var cache = api.getCursorCache(element);
171171
if(!cache) {
172172
return;
173173
}
@@ -417,7 +417,7 @@
417417
}
418418

419419
// get the start and stop ticks (which consider properly repeats)
420-
var tickCache = getTickCache(element);
420+
var tickCache = api.getTickCache(element);
421421
var realMasterBarStart = tickCache.GetMasterBarStart(selectionStart.beat.Voice.Bar.get_MasterBar());
422422

423423
// move to selection start
@@ -447,7 +447,7 @@
447447
}
448448

449449
api.getBeatAtPos = function(element, context, x, y) {
450-
var cache = getCursorCache(element);
450+
var cache = api.getCursorCache(element);
451451
return cache.GetBeatAtPos(x, y);
452452
};
453453

0 commit comments

Comments
 (0)