public void addLyric(final FrameBodySYLT sync) {
// SYLT frames are made of individual lines
final Iterator<?> iterator = sync.iterator();
ObjectLyrics3Line newLine;
ObjectID3v2LyricLine currentLine;
ObjectLyrics3TimeStamp timeStamp;
final HashMap<String, ObjectLyrics3Line> lineMap = new HashMap<String, ObjectLyrics3Line>();
while (iterator.hasNext()) {
currentLine = (ObjectID3v2LyricLine) iterator.next();
// create copy to use in new tag
currentLine = new ObjectID3v2LyricLine(currentLine);
timeStamp = new ObjectLyrics3TimeStamp("Time Stamp");
timeStamp.setTimeStamp(currentLine.getTimeStamp(), sync.getTimeStampFormat());
if (lineMap.containsKey(currentLine.getText())) {
newLine = (ObjectLyrics3Line) lineMap.get(currentLine.getText());
newLine.addTimeStamp(timeStamp);
} else {
newLine = new ObjectLyrics3Line("Lyric Line");
newLine.setLyric(currentLine);
newLine.setTimeStamp(timeStamp);
lineMap.put(currentLine.getText(), newLine);
this.lines.add(newLine);
// appendToObjectList(newLine);
}
}
}