Permalink
Browse files

Document the sound object.

  • Loading branch information...
jverkoey committed Feb 27, 2010
1 parent 0665ba8 commit a6bb31ca785e5d0d704b84f9be84f52e99af4974
Showing with 23 additions and 22 deletions.
  1. +23 −22 dev/engine/class.sound.js
View
@@ -22,7 +22,8 @@ goog.require('Breeze.Engine');
* Creating a Sound object will create a jPlayer object, load the data, and then call the optional
* callback method once the sound is loaded.
*
- * @param path string The sound URL.
+ * @param {string} path The URL of the sound.
+ * @param {Object.<string, *>} options
* @constructor
*/
Breeze.Engine.Sound = function(path, options) {
@@ -33,7 +34,11 @@ Breeze.Engine.Sound = function(path, options) {
var settings = {};
goog.object.extend(settings, defaults, options);
- this._loaded = false;
+ /**
+ * @type {boolean}
+ * @private
+ */
+ this.loaded_ = false;
/*
var audioHolder = window.jQuery('<div>');
@@ -46,7 +51,7 @@ Breeze.Engine.Sound = function(path, options) {
audioHolder.jPlayer({
oggSupport: Modernizr.audio.ogg && !Modernizr.audio.mp3,
mp3Support: true,
- ready: function () {
+ ready= function () {
audioHolder
.jPlayer("onProgressChange", this.onProgressChange.bind(this))
.jPlayer("setFile", path+'.mp3', path+'.ogg');
@@ -62,27 +67,23 @@ Breeze.Engine.Sound = function(path, options) {
//this._audio = audioHolder;
};
-Breeze.Engine.Sound.prototype = {
-
- play : function() {
- //this._audio.jPlayer("play");
- },
-
- stop : function() {
- //this._audio.jPlayer("stop");
- },
+Breeze.Engine.Sound.prototype.play = function() {
+ //this._audio.jPlayer("play");
+};
- setVolume : function(perc) {
- //this._audio.jPlayer("volume", perc * 100);
- },
+Breeze.Engine.Sound.prototype.stop = function() {
+ //this._audio.jPlayer("stop");
+};
- getPlayedTime : function() {
- //return this._playedTime;
- },
+Breeze.Engine.Sound.prototype.setVolume = function(perc) {
+ //this._audio.jPlayer("volume", perc * 100);
+};
- onProgressChange : function(loadPercent, playedPercentRelative, playedPercentAbsolute, playedTime, totalTime) {
- //this._playedTime = playedTime;
- //this._totalTime = totalTime;
- }
+Breeze.Engine.Sound.prototype.getPlayedTime = function() {
+ //return this._playedTime;
+};
+Breeze.Engine.Sound.prototype.onProgressChange = function(loadPercent, playedPercentRelative, playedPercentAbsolute, playedTime, totalTime) {
+ //this._playedTime = playedTime;
+ //this._totalTime = totalTime;
};

0 comments on commit a6bb31c

Please sign in to comment.