private Caption parseDialogueForASS(String[] line, String[] dialogueFormat, float timer, TimedTextObject tto) {
		
		Caption newCaption = new Caption();
		
		for (int i = 0; i < dialogueFormat.length; i++) {
			String trimmedDialogueFormat = dialogueFormat[i].trim();
			//we go through every format parameter and save the interesting values
			if (trimmedDialogueFormat.equalsIgnoreCase("Style")){
				//we save the style
				Style s =  tto.styling.get(line[i].trim());
				if (s!=null)
					newCaption.style= s;
				else
					tto.warnings+="undefined style: "+line[i].trim()+"\n\n";
			} else if (trimmedDialogueFormat.equalsIgnoreCase("Start")){
				//we save the starting time
				newCaption.start=new Time("h:mm:ss.cs",line[i].trim());
			} else if (trimmedDialogueFormat.equalsIgnoreCase("End")){
				//we save the starting time
				newCaption.end=new Time("h:mm:ss.cs",line[i].trim());
			} else if (trimmedDialogueFormat.equalsIgnoreCase("Text")) {
				//we save the text
				String captionText = line[i];
				newCaption.rawContent = captionText;
				//text is cleaned before being inserted into the caption
				newCaption.content = captionText.replaceAll("\\{.*?\\}", "").replace("\n", "<br />").replace("\\N", "<br />");
			}
		}
		
		//timer is applied
    	if (timer != 100){
    		newCaption.start.mseconds /= (timer/100);
    		newCaption.end.mseconds /= (timer/100);
    	}
		return newCaption;
	}