MetaHeaderTag meta = new MetaHeaderTag();//((MetaHeaderTag) root.getContent().get(0));
BodyHeaderTag body = new BodyHeaderTag();//((BodyHeaderTag) root.getContent().get(1));
root.add(meta);
root.add(body);
HouseTag currentHouse = new HouseTag(1);
body.add(currentHouse);
for (ABCSongTagSimple tag : metaData) {
if (tag instanceof TitleTag) {
foundTitleMetaTag = true;
}
meta.add(tag);
}
if (!foundTitleMetaTag) {
throw new MissingTitleTagException("Initialization list for songXMLHolder must contain a TitleTag!");
}
LineNumberReader lr = new LineNumberReader(new FileReader(inputFile));
// scan = new Scanner(file);
while (lr.ready()) {
String currentLine = lr.readLine();//scan.nextLine();
if (currentLine.compareToIgnoreCase("") == 0) {
do {
currentHouse.add(new LineTag(currentLine,lr.getLineNumber()));
currentLine = lr.readLine(); //scan.nextLine();
}while(currentLine.compareTo("") == 0);
// currentHouse.setSpecValue(SongTagSpecs.Keys.OFFSET, lr.getLineNumber() - Integer.parseInt(currentHouse.getSpecValue(SongTagSpecs.Keys.LINE))); // setting lower boundery of house
currentHouse = new HouseTag(lr.getLineNumber()); // makeing new house to continue reading lines
body.add(currentHouse);
}
currentHouse.add(new LineTag(currentLine, lr.getLineNumber()));
}
}