* @param sync
*/
public void addLyric(FrameBodySYLT sync) {
// SYLT frames are made of individual lines
Iterator<ID3v2LyricLine> iterator = sync.iterator();
Lyrics3Line newLine;
ID3v2LyricLine currentLine;
Lyrics3TimeStamp timeStamp;
HashMap<String, Lyrics3Line> lineMap = new HashMap<String, Lyrics3Line>();
while (iterator.hasNext()) {
currentLine = iterator.next();
// createField copy to use in new tag
currentLine = new ID3v2LyricLine(currentLine);
timeStamp = new Lyrics3TimeStamp("Time Stamp", this);
timeStamp.setTimeStamp(currentLine.getTimeStamp(), (byte) sync.getTimeStampFormat());
if (lineMap.containsKey(currentLine.getText())) {
newLine = lineMap.get(currentLine.getText());
newLine.addTimeStamp(timeStamp);
} else {
newLine = new Lyrics3Line("Lyric Line", this);
newLine.setLyric(currentLine);
newLine.setTimeStamp(timeStamp);
lineMap.put(currentLine.getText(), newLine);
lines.add(newLine);
}
}
}