mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-16 08:38:00 +00:00
using getTicksAtTime for better accuracy when getting progress
This commit is contained in:
parent
d72fba9bf7
commit
7bd133ca02
1 changed files with 3 additions and 1 deletions
|
@ -576,7 +576,9 @@ define(["Tone/core/Tone", "Tone/core/Clock", "Tone/type/Type", "Tone/core/Timeli
|
||||||
Object.defineProperty(Tone.Transport.prototype, "progress", {
|
Object.defineProperty(Tone.Transport.prototype, "progress", {
|
||||||
get : function(){
|
get : function(){
|
||||||
if (this.loop){
|
if (this.loop){
|
||||||
return (this.ticks - this._loopStart) / (this._loopEnd - this._loopStart);
|
var now = this.now();
|
||||||
|
var ticks = this._clock.getTicksAtTime(now);
|
||||||
|
return (ticks - this._loopStart) / (this._loopEnd - this._loopStart);
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue