forked from onaluf/gameQuery
-
Notifications
You must be signed in to change notification settings - Fork 1
/
jquery.gamequery.soundwrapper.bogus.js
36 lines (29 loc) · 1.2 KB
/
jquery.gamequery.soundwrapper.bogus.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/**
* gameQuery rev. $Revision$
*
* Copyright (c) 2008 Selim Arsever (gamequery.onaluf.org)
* licensed under the MIT (MIT-LICENSE.txt)
*/
// this allows use of the convenient $ notation in a plugin
(function($) {
// Here is a bogus soundWrapper written as an example
$.extend({
SoundWrapper: function(url, loop) {
this.soundready = false;
// start loading the sound. Should turn this.ready to true once done.
this.load = function(){this.soundready = true};
// plays the sound if this.ready == true
this.play = function(){};
// pauses the sound if it is playing
this.pause = function(){};
// stops the sound if it is playing, rewind (even if paused)
this.stop = function(){};
// mutes the sound without stopping it
this.muted = function(mute){}
// returns true if the sound is ready to be played
this.ready = function(){return this.soundready};
// add the sound to the manager
$.gameQuery.resourceManager.addSound(this);
return true;
}},$.gameQuery);
})(jQuery);