/**
 * Meta information to a continous stream
 * @ignore
 * @markdown
<p>Example:</p>
    var streamInfo = new econda.media.Stream({
        name: "SatTV Regional",
        type: "video"
    });
    
    // or for a radio station
    var streamInfo = new econda.media.Stream({
        name: "Ultimate Dudelfunk",
        type: "audio"
    });
    
    // set stream info in StreamTracker
    tracker.setStream(streamInfo);
    tracker.init();

 * @class econda.media.Stream
 */
econda.media.Stream = function(cfg)
{
    var __p = {
        /**
         * @cfg {String} name Name of Stream
         */
        name: null,
        
        /**
         * @cfg {String} [type="video"] Media type (audio / video)
         */
        type: "video"
    };
    
    this.__defaultProperty = "name";
    
    /**
     * Set stream name
     * @method
     * @chainable
     * @param {String} name stream name
     */
    this.setName = function(name)
    {
        if(typeof name != 'string') {
            econda.debug.error("Wrong type for Stream.name. Get: " + name, name);
        } else {
            __p["name"] = name;
        }
        return this;
    };
    
    /**
     * Returns name of stream
     * @method
     * @return {String}
     */
    this.getName = function()
    {
        return __p["name"];
    };
    
    /**
     * Set media type of stream.
     * @method
     * @chainable
     * @param {String} type "video" or "audio"
     */
    this.setType = function(type)
    {
        if(typeof type != 'string') {
            econda.debug.error("Got invalid media type in Stream.setType: " + type, type);
            return this;
        }
        type = type.toLowerCase();
        if(type != 'audio' && type != 'video') {
            econda.debug.error("Got invalid media type. Must be audio or video. Got: " + type, type);
            return this;
        }
        __p["type"] = type;
        return this;
    };
    
    /**
     * Get stream type
     * @method
     * @return {String}
     */
    this.getType = function()
    {
        return __p["type"];
    };
    
    return this.setup(cfg, __p);
};
econda.media.Stream.prototype = new econda.base.Object();