function Lyric( text, lyrLineDesc ) 
{
    this.hasTimeIndices = function() { return (this.fTimeIndices != null); }
    this.getTimeIndices = function() { return this.fTimeIndices; }
    this.addTimeIndex = function(val) 
    { 
	if( this.fTimeIndices == null )
	    this.fTimeIndices = new Array();
	this.fTimeIndices[this.fTimeIndices.length] = val;
	return true; 
    }

    /**
     * get the language translator for this lyric
     */
    this.getTranslator = function() 
    { 
	/* if we have one for this lyric, use it, else use block's */
    	if(this.fTranslator != null) return this.fTranslator; 
	else  { return this.getBlock().getTranslator(); }
    }

    /**
     * set the language translator for this lyric
     */
    this.setTranslator = function(translator) { this.fTranslator = translator; }

    /**
     * get the font to apply for this lyric
     */
    this.getDefaultFont = function() 
    { 
	/* use block's */
	return this.getBlock().getDefaultFont();
    }

    /**
     * get the font sizes of the lyric
     */
    this.getDefaultFontSize = function()
    {
	/* use block's */
	return this.getBlock().getDefaultLyricFontSize();
    }

    /**
     * get the font color of the lyric
     */
    this.getDefaultFontColor = function()
    {
	/* use block's */
	return this.getBlock().getDefaultLyricFontColor();
    }

    /**
     * get the (translated) text of the lyric
     * @return the text of the lyric
     * @type String
     */
    this.getText = function() { 
	return this.fLineDesc.getTranslator().translate(this.fText);
    }

    /**
     * get the raw (untranslated) text of the lyric
     * @return the text of the lyric
     * @type String
     */
    this.getRawText = function() { return this.fText; }

    /**
     * set the text of the lyric
     * @param {String} t	new text
     * @return true or false as to whether text was successfully set or not
     * @type boolean
     */
    this.setText = function(t) { this.fText = t; }

    /**
     * get the notation to which this lyric belongs to
     * @type SongBlockNotation
     */
    this.getNotation = function() { return this.parent; }

    /**
     * get the block to which this swara belongs to
     * @type SongBlock
     */
    this.getBlock = function() 
    { 
	var n = this.getNotation();
	if( n ) return n.getBlock();
	return null;
    }

    /**
     * get the lyric line description for the lyric line to which this lyric
     * belongs to
     * @type LyricLineDesc
     */
    this.getLyricLine = function() { return this.fLineDesc; }

    /**
     * set the lyric line description for the lyric line to which this lyric
     * belongs to
     * @type LyricLineDesc
     */
    this.setLyricLine = function(line) { this.fLineDesc = line; }

     /**
      * serialize contents to xml
      */
     this.toXML = function() {
	var x = XMLUtils.createXMLNode("l");
	x.setAttribute("label", this.fText );
	return x;
     }

    /**
     * override of {@link SongBlockPart#fromXML}
     */
    this.fromXML = function(xml) {
	// validate
	var reason = null;
	var label = null;
	if( !XMLUtils.isXMLNode(xml, "l" )) reason = "not a lyric node";
	else  {
	    label = xml.getAttribute("label").replace( /\\/g, "");
	    if( label == null )  reason = "no label for lyric";
	}
	if( reason != null ) return new FromXMLResult(null, reason);
	return new FromXMLResult(new Lyric( label ), null);
    }

    if( !lyrLineDesc ) lyrLineDesc = null;
    /**
     * get the lyric line description for the lyric line to which this lyric belongs to
     * @type LyricLineDesc
     * @private
     */
    this.fLineDesc = lyrLineDesc;

    /**
     * the text of the lyric
     * @type String
     * @private
     */
    this.fText  = text;

    this.fTimeIndices = null;
}
/**
 * @class represents a lyric 
 * Represents a lyric in a notation {@link SongBlockNotation}
 * @constructor
 * @param {String}  	  text		text of the lyric
 * @param {LyricLineDesc} lyrLineDesc	the lyric line to which this lyric
 *					belongs to
 */
@class represents a lyric
Represents a lyric in a notation  SongBlockNotation
@constructor
@param {String}        text          text of the lyric
@param {LyricLineDesc} lyrLineDesc   the lyric line to which this lyric
belongs to
@class represents a lyric Represents a lyric in a notation SongBlockNotation @constructor @param { String } text text of the lyric @param { LyricLineDesc } lyrLineDesc the lyric line to which this lyric belongs to
function Lyric( text, lyrLineDesc ) 
{
    this.hasTimeIndices = function() { return (this.fTimeIndices != null); }
    this.getTimeIndices = function() { return this.fTimeIndices; }
    this.addTimeIndex = function(val) 
    { 
	if( this.fTimeIndices == null )
	    this.fTimeIndices = new Array();
	this.fTimeIndices[this.fTimeIndices.length] = val;
	return true; 
    }
    this.getTranslator = function() 
    { 
    	if(this.fTranslator != null) return this.fTranslator; 
	else  { return this.getBlock().getTranslator(); }
    }
    this.setTranslator = function(translator) { this.fTranslator = translator; }
    this.getDefaultFont = function() 
    { 
	return this.getBlock().getDefaultFont();
    }
    this.getDefaultFontSize = function()
    {
	return this.getBlock().getDefaultLyricFontSize();
    }
    this.getDefaultFontColor = function()
    {
	return this.getBlock().getDefaultLyricFontColor();
    }
    this.getText = function() { 
	return this.fLineDesc.getTranslator().translate(this.fText);
    }
    this.getRawText = function() { return this.fText; }
    this.setText = function(t) { this.fText = t; }
    this.getNotation = function() { return this.parent; }
    this.getBlock = function() 
    { 
	var n = this.getNotation();
	if( n ) return n.getBlock();
	return null;
    }
    this.getLyricLine = function() { return this.fLineDesc; }
    this.setLyricLine = function(line) { this.fLineDesc = line; }
     this.toXML = function() {
	var x = XMLUtils.createXMLNode("l");
	x.setAttribute("label", this.fText );
	return x;
     }
    this.fromXML = function(xml) {
	var reason = null;
	var label = null;
	if( !XMLUtils.isXMLNode(xml, "l" )) reason = "not a lyric node";
	else  {
	    label = xml.getAttribute("label").replace( /\\/g, "");
	    if( label == null )  reason = "no label for lyric";
	}
	if( reason != null ) return new FromXMLResult(null, reason);
	return new FromXMLResult(new Lyric( label ), null);
    }
    if( !lyrLineDesc ) lyrLineDesc = null;
    this.fLineDesc = lyrLineDesc;
    this.fText  = text;
    this.fTimeIndices = null;
}
function Lyric ( text , lyrLineDesc ) { this . hasTimeIndices = function ( ) { return ( this . fTimeIndices != null ) ; } this . getTimeIndices = function ( ) { return this . fTimeIndices ; } this . addTimeIndex = function ( val ) { if ( this . fTimeIndices == null ) this . fTimeIndices = new Array ( ) ; this . fTimeIndices [ this . fTimeIndices . length ] = val ; return true ; } this . getTranslator = function ( ) { if ( this . fTranslator != null ) return this . fTranslator ; else { return this . getBlock ( ) . getTranslator ( ) ; } } this . setTranslator = function ( translator ) { this . fTranslator = translator ; } this . getDefaultFont = function ( ) { return this . getBlock ( ) . getDefaultFont ( ) ; } this . getDefaultFontSize = function ( ) { return this . getBlock ( ) . getDefaultLyricFontSize ( ) ; } this . getDefaultFontColor = function ( ) { return this . getBlock ( ) . getDefaultLyricFontColor ( ) ; } this . getText = function ( ) { return this . fLineDesc . getTranslator ( ) . translate ( this . fText ) ; } this . getRawText = function ( ) { return this . fText ; } this . setText = function ( t ) { this . fText = t ; } this . getNotation = function ( ) { return this . parent ; } this . getBlock = function ( ) { var n = this . getNotation ( ) ; if ( n ) return n . getBlock ( ) ; return null ; } this . getLyricLine = function ( ) { return this . fLineDesc ; } this . setLyricLine = function ( line ) { this . fLineDesc = line ; } this . toXML = function ( ) { var x = XMLUtils . createXMLNode ( "l" ) ; x . setAttribute ( "label" , this . fText ) ; return x ; } this . fromXML = function ( xml ) { var reason = null ; var label = null ; if ( ! XMLUtils . isXMLNode ( xml , "l" ) ) reason = "not a lyric node" ; else { label = xml . getAttribute ( "label" ) . replace ( / \\ / g , "" ) ; if ( label == null ) reason = "no label for lyric" ; } if ( reason != null ) return new FromXMLResult ( null , reason ) ; return new FromXMLResult ( new Lyric ( label ) , null ) ; } if ( ! lyrLineDesc ) lyrLineDesc = null ; this . fLineDesc = lyrLineDesc ; this . fText = text ; this . fTimeIndices = null ; }
@class represents a lyric
 Represents a lyric in a notation {@link SongBlockNotation}
 @constructor
 @param {String}        text          text of the lyric
 @param {LyricLineDesc} lyrLineDesc   the lyric line to which this lyric
                                      belongs to
@class represents a lyric Represents a lyric in a notation { @link SongBlockNotation } @constructor @param { String } text text of the lyric @param { LyricLineDesc } lyrLineDesc the lyric line to which this lyric belongs to
/**
     * get the language translator for this lyric
     */ /* if we have one for this lyric, use it, else use block's */ /**
     * set the language translator for this lyric
     */ /**
     * get the font to apply for this lyric
     */ /* use block's */ /**
     * get the font sizes of the lyric
     */ /* use block's */ /**
     * get the font color of the lyric
     */ /* use block's */ /**
     * get the (translated) text of the lyric
     * @return the text of the lyric
     * @type String
     */ /**
     * get the raw (untranslated) text of the lyric
     * @return the text of the lyric
     * @type String
     */ /**
     * set the text of the lyric
     * @param {String} t	new text
     * @return true or false as to whether text was successfully set or not
     * @type boolean
     */ /**
     * get the notation to which this lyric belongs to
     * @type SongBlockNotation
     */ /**
     * get the block to which this swara belongs to
     * @type SongBlock
     */ /**
     * get the lyric line description for the lyric line to which this lyric
     * belongs to
     * @type LyricLineDesc
     */ /**
     * set the lyric line description for the lyric line to which this lyric
     * belongs to
     * @type LyricLineDesc
     */ /**
      * serialize contents to xml
      */ /**
     * override of {@link SongBlockPart#fromXML}
     */ // validate /**
     * get the lyric line description for the lyric line to which this lyric belongs to
     * @type LyricLineDesc
     * @private
     */ /**
     * the text of the lyric
     * @type String
     * @private
     */