o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1361449319.910347C : @value"€ {I" class:EFI"BundledAsset;FI"logical_path;FI"web-app/sound.js;FI" pathname;FI"t/Users/patricknegri/.rvm/gems/ruby-1.9.2-p290/gems/iugu-ux-0.9.2/vendor/assets/javascripts/web-app/sound.coffee;FI"content_type;FI"application/javascript;FI" mtime;FI"2013-01-17T19:18:49-02:00;FI" length;Fi‹ I" digest;F"%76e632e13285f738c02f712230691edcI" source;FI"‹ (function() { var _Sound; _Sound = (function() { _Sound.prototype.format = $.browser.webkit ? ".mp3" : ".wav"; _Sound.prototype.soundPath = "/assets/s/"; _Sound.prototype.sound = []; _Sound.prototype.environmentSound = null; _Sound.prototype.maxChannels = 8; function _Sound() { var i, _i; this.sound.size = 8; for (i = _i = 0; _i <= 7; i = ++_i) { this.sound[i] = null; } } _Sound.prototype.loadSoundChannel = function(name) { var snd; snd = new Audio(this.soundPath + name + this.format); snd.preload = false; snd.load(); return snd; }; _Sound.prototype.enableDesktopLoop = function(env) { if (typeof env.loop === 'boolean') { return env.loop = true; } else { return env.addEventListener('ended', function() { this.currentTime = 0; return this.play(); }, false); } }; _Sound.prototype.playDesktop = function(name, options) { var aChannel, i, _i; if (options == null) { options = {}; } if (options.environmentSound) { if (this.environmentSound) { this.environmentSound.stop(); } this.environmentSound = this.loadSoundChannel(name); if (options.environmentSound) { this.enableDesktopLoop(this.environmentSound); } this.environmentSound.play(); return; } aChannel = false; for (i = _i = 0; _i <= 8; i = ++_i) { if (this.sound[i] === null) { aChannel = i; break; } else if (this.sound[i] && (this.sound[i].currentTime === this.sound[i].duration || this.sound[i].currentTime === 0)) { aChannel = i; break; } } this.sound[aChannel] = this.loadSoundChannel(name); if (options.environmentSound) { this.enableDesktopLoop(this.sound[aChannel]); } return this.sound[aChannel].play(); }; _Sound.prototype.stopDesktop = function(channel) { if (this.sound[channel] && (this.sound[channel].currentTime === this.sound[channel].duration || this.sound[channel].currentTime === 0)) { return this.sound[channel].stop(); } }; _Sound.prototype.stopEnvironmentDesktop = function() { if (this.environmentSound) { return this.environmentSound.stop(); } }; _Sound.prototype.play = function(name, options) { if (options == null) { options = {}; } if (!IS_MOBILE) { return this.playDesktop(name, options); } }; _Sound.prototype.stop = function(channel) { if (!IS_MOBILE) { return this.stopDesktop(channel); } }; _Sound.prototype.stopEnvironment = function() { if (!IS_MOBILE) { return this.stopEnvironmentDesktop(); } }; return _Sound; })(); window.Sound = new _Sound(); }).call(this); ;FI"required_assets_digest;F"%b146b6f4c845c7b2f2011cfc59dc43a2I" _version;F"%6776f581a4329e299531e1d52aa59832