o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1349321360.3192298nC: @value"Â{I" class:EFI"ProcessedAsset;FI"logical_path;FI"web-app/sound.js;FI" pathname;FI"_/Users/patricknegri/Desenvolvimento/iugu-ux/vendor/assets/javascripts/web-app/sound.coffee;FI"content_type;FI"application/javascript;FI" mtime;FI"2012-10-02T20:05:24-03:00;FI" length;Fi‹ I" digest;F"%3115e3e9b86bc1e09c1dca0688b383b8I" 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); ;TI"dependency_digest;F"%c439c6567435b71b7787a09e2619549eI"required_paths;F[I"_/Users/patricknegri/Desenvolvimento/iugu-ux/vendor/assets/javascripts/web-app/sound.coffee;FI"dependency_paths;F[{I" path;FI"_/Users/patricknegri/Desenvolvimento/iugu-ux/vendor/assets/javascripts/web-app/sound.coffee;FI" mtime;FI"2012-10-02T20:05:24-03:00;FI" digest;F"%4d5d516259b996a0083978f5b1b93a2bI" _version;F"%9f3b95dd7ea3030dc35985c0a8020862