Skip to content

Commit

Permalink
Merge pull request #3923 from oerc-music/develop-annote
Browse files Browse the repository at this point in the history
Replace AttPlist with PlistInterface in AnnotScore inheritance
  • Loading branch information
lpugin authored Jan 29, 2025
2 parents 38c81c9 + ab7fdbc commit b3f2fca
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
5 changes: 4 additions & 1 deletion include/vrv/annotscore.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "atts_shared.h"
#include "controlelement.h"
#include "editorial.h"
#include "plistinterface.h"
#include "timeinterface.h"

namespace vrv {
Expand All @@ -23,7 +24,7 @@ namespace vrv {
/**
* This class models the MEI <annot> element where @type is score.
*/
class AnnotScore : public ControlElement, public TimeSpanningInterface, public AttPlist {
class AnnotScore : public ControlElement, public PlistInterface, public TimeSpanningInterface {
public:
/**
* @name Constructors, destructors, and other standard methods
Expand All @@ -41,6 +42,8 @@ class AnnotScore : public ControlElement, public TimeSpanningInterface, public A
* @name Getter to interfaces
*/
///@{
PlistInterface *GetPlistInterface() override { return vrv_cast<PlistInterface *>(this); }
const PlistInterface *GetPlistInterface() const override { return vrv_cast<const PlistInterface *>(this); }
TimePointInterface *GetTimePointInterface() override { return vrv_cast<TimePointInterface *>(this); }
const TimePointInterface *GetTimePointInterface() const override
{
Expand Down
6 changes: 3 additions & 3 deletions src/annotscore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ namespace vrv {

static const ClassRegistrar<AnnotScore> s_factory("annotScore", ANNOTSCORE);

AnnotScore::AnnotScore() : ControlElement(ANNOTSCORE, "annotscore-"), AttPlist()
AnnotScore::AnnotScore() : ControlElement(ANNOTSCORE, "annotscore-"), PlistInterface(), TimeSpanningInterface()
{
this->RegisterInterface(PlistInterface::GetAttClasses(), PlistInterface::IsInterface());
this->RegisterInterface(TimeSpanningInterface::GetAttClasses(), TimeSpanningInterface::IsInterface());
this->RegisterAttClass(ATT_PLIST);

this->Reset();
}
Expand All @@ -41,7 +41,7 @@ AnnotScore::~AnnotScore() {}
void AnnotScore::Reset()
{
ControlElement::Reset();
this->ResetPlist();
PlistInterface::Reset();
TimeSpanningInterface::Reset();
}

Expand Down
8 changes: 4 additions & 4 deletions src/iomei.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1979,7 +1979,8 @@ void MEIOutput::WriteAnnotScore(pugi::xml_node currentNode, AnnotScore *annotSco
assert(annotScore);

this->WriteControlElement(currentNode, annotScore);
this->WriteTimePointInterface(currentNode, annotScore);
this->WritePlistInterface(currentNode, annotScore);
this->WriteTimeSpanningInterface(currentNode, annotScore);
annotScore->WritePlist(currentNode);
// Currently ignoring annot contents -- normal annot looks at child elements here
}
Expand Down Expand Up @@ -7721,10 +7722,9 @@ bool MEIInput::ReadAnnot(Object *parent, pugi::xml_node annot)
bool MEIInput::ReadAnnotScore(Object *parent, pugi::xml_node annot)
{
AnnotScore *vrvAnnotScore = new AnnotScore();
// Note: there probably needs to be more in here (see model methods)

BracketSpan *vrvBracketSpan = new BracketSpan();
this->ReadControlElement(annot, vrvBracketSpan);
this->ReadControlElement(annot, vrvAnnotScore);
this->ReadPlistInterface(annot, vrvAnnotScore);
this->ReadTimeSpanningInterface(annot, vrvAnnotScore);

vrvAnnotScore->ReadPlist(annot);
Expand Down

0 comments on commit b3f2fca

Please sign in to comment.