added toSeconds method

no longer relies on the inherited method
This commit is contained in:
Yotam Mann 2016-09-20 18:25:06 -04:00
parent 9379165928
commit 0856efe50f

View file

@ -70,6 +70,15 @@ define(["Tone/core/Tone", "Tone/type/Time"], function (Tone) {
return this.eval();
};
/**
* Return the time in seconds.
* @return {Seconds}
*/
Tone.TransportTime.prototype.toSeconds = function(){
var val = this._expr();
return val + (this._plusNow ? Tone.Transport.seconds : 0);
};
/**
* Return the time as a frequency value
* @return {Frequency}