mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-16 00:27:58 +00:00
readonly loaded
boolean if the buffer is loaded
This commit is contained in:
parent
7cd7bb1536
commit
a6bb882758
2 changed files with 14 additions and 0 deletions
|
@ -365,6 +365,19 @@ define(["Tone/core/Tone", "Tone/core/Buffer", "Tone/source/Source", "Tone/source
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If all the buffer is loaded
|
||||||
|
* @memberOf Tone.Player#
|
||||||
|
* @type {Boolean}
|
||||||
|
* @name loaded
|
||||||
|
* @readOnly
|
||||||
|
*/
|
||||||
|
Object.defineProperty(Tone.Player.prototype, "loaded", {
|
||||||
|
get : function(){
|
||||||
|
return this._buffer.loaded;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dispose and disconnect.
|
* Dispose and disconnect.
|
||||||
* @return {Tone.Player} this
|
* @return {Tone.Player} this
|
||||||
|
|
|
@ -41,6 +41,7 @@ define(["helper/Basic", "Tone/source/Player", "helper/Offline",
|
||||||
|
|
||||||
it("loads a url which was passed in", function(done){
|
it("loads a url which was passed in", function(done){
|
||||||
var player = new Player("./audio/sine.wav", function(){
|
var player = new Player("./audio/sine.wav", function(){
|
||||||
|
expect(player.loaded).to.be.true;
|
||||||
player.dispose();
|
player.dispose();
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue