Skip to content
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

Merged
merged 9 commits into from
Dec 17, 2024

Conversation

DILewis
Copy link
Contributor

@DILewis DILewis commented Dec 17, 2024

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

src/iomei.cpp Outdated Show resolved Hide resolved
src/iomei.cpp Outdated
Comment on lines 7695 to 7719
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);
}
Copy link
Contributor

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.

Copy link
Contributor Author

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

@lpugin lpugin merged commit 3291628 into rism-digital:develop-annote Dec 17, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants