(function() {
    "use strict";

    var fn = timbre.fn;
    var modules = timbre.modules;
    
    fn.register("audio", function(_args) {
        var params;
        if (fn.isDictionary(_args[0])) {
            params = _args.shift();
        }
        
        var instance = timbre.apply(null, ["buffer"].concat(_args));
        
        instance._.isLoaded = false;
        instance._.isEnded  = true;
        
        Object.defineProperties(instance, {
            isLoaded: {
                get: function() {
                    return this._.isLoaded;
                }
            }
        });
        
        instance.load = load;
        
        if (params) {
            instance.once("init", function() {
                instance.set(params);
            });
        }
        
        return instance;
    });
    
    var load = function(src) {
        var self = this, _ = this._;
        var dfd = new modules.Deferred(this);
        
        var args = arguments, i = 1;
        
        dfd.done(function() {
            this._.emit("done");
        }.bind(this));
        
        if (typeof args[i] === "function") {
            dfd.done(args[i++]);
            if (typeof args[i] === "function") {
                dfd.fail(args[i++]);
            }
        }
        
        _.loadedTime = 0;
        
        var onloadedmetadata = function(result, msg) {
            var _ = self._;
            if (result) {
                _.samplerate = result.samplerate;
                _.buffer     = result.buffer;
                _.phase      = 0;
                _.phaseIncr  = result.samplerate / timbre.samplerate;
                _.duration   = result.duration * 1000;
                _.isEnded    = false;
                _.currentTime = 0;
                if (_.isReversed) {
                    _.phaseIncr *= -1;
                    _.phase = result.buffer.length + _.phaseIncr;
                }
                self._.emit("loadedmetadata");
            } else {
                dfd.reject(msg);
            }
        };
        
        var onloadeddata = function() {
            self._.isLoaded  = true;
            self._.plotFlush = true;
            self._.emit("loadeddata");
            dfd.resolveWith(self);
        };
        
        new modules.Decoder().decode(src, onloadedmetadata, onloadeddata);
        
        return dfd.promise();
    };
    
})();

@@ -637,16 +637,54 @@
 = load;%0A
+        instance.loadthis = loadthis;%0A
         
@@ -2415,24 +2415,122 @@
 se();%0A    %7D;
+%0A%0A    var loadthis = function() %7B%0A        load.apply(this, arguments);%0A        return this;%0A    %7D;
 %0A    %0A%7D)();%0A

add .loadthis()