-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add initial support for <annot type="score"> (classes and round trip read/write) #3896
Conversation
src/iomei.cpp
Outdated
AnnotScore *vrvAnnotScore = new AnnotScore(); | ||
// this->ReadEditorialElement(annot, vrvAnnotScore); | ||
|
||
vrvAnnotScore->ReadPlist(annot); | ||
// vrvAnnotScore->ReadSource(annot); | ||
|
||
parent->AddChild(vrvAnnotScore); | ||
// vrvAnnotScore->m_content.reset(); | ||
|
||
bool hasNonTextContent = false; | ||
// copy all the nodes inside into the document | ||
for (pugi::xml_node child = annot.first_child(); child; child = child.next_sibling()) { | ||
const std::string nodeName = child.name(); | ||
if (!hasNonTextContent && (!nodeName.empty())) hasNonTextContent = true; | ||
// vrvAnnotScore->m_content.append_copy(child); | ||
} | ||
this->ReadUnsupportedAttr(annot, vrvAnnotScore); | ||
// Unless annot has only text we do not load children because they are preserved in Annot::m_content | ||
if (hasNonTextContent) { | ||
return true; | ||
} | ||
else { | ||
// vrvAnnot->m_content.remove_children(); | ||
return this->ReadTextChildren(vrvAnnotScore, annot, vrvAnnotScore); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep only what you use now and remove the commented code. We can easily put things back whenever needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've taken cancelled code out of here, but left a few comments to remind myself what's gone
Co-authored-by: Laurent Pugin <[email protected]>
Class definitions, etc for a new type of annotation, 'annotScore', for annotations that we might want to appear in a score application. This PR also includes functionality for reading and writing (hopefully) transparently.
I'm putting some examples to test into this repo