Skip to content

Commit

Permalink
add GRVisitor support
Browse files Browse the repository at this point in the history
  • Loading branch information
dfober committed Dec 5, 2023
1 parent c0de812 commit 21f229b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/engine/graphic/GROctava.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ GROctava::~GROctava()
{
}

void GROctava::accept (GRVisitor& visitor) {
visitor.visitStart (this);
visitor.visitEnd (this);
}

bool GROctava::DeleteStaff(GRStaff * grstaff)
{
delete mAssociated; // makes sure that associated notes are deleted before the GROctava
Expand Down
3 changes: 3 additions & 0 deletions src/engine/graphic/GROctava.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "TagParameterString.h"
#include "GRARNotationElement.h"
#include "GRPositionTag.h"
#include "GRVisitor.h"

class NVstring;
class GRStaff;
Expand All @@ -36,11 +37,13 @@ class GROctava : public GRARNotationElement, public GRPositionTag
GROctava( GRStaff *, const NVstring & txt, const AROctava* ar, bool bassa );
virtual ~GROctava();

virtual void accept (GRVisitor& visitor);
virtual void tellPosition(GObject *caller, const NVPoint & );

virtual void OnDraw( VGDevice & hdc ) const;
virtual void setColRef(const TagParameterString *tps);
virtual bool DeleteStaff(GRStaff * grstaff);
virtual int getOctava() const { return fOctava; };

private:
typedef struct segment {
Expand Down
4 changes: 4 additions & 0 deletions src/engine/operations/GRVisitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class GRIntens;
class GRKey;
class GRMeter;
class GRMusic;
class GROctava;
class GRPage;
class GRRange;
class GRSingleNote;
Expand Down Expand Up @@ -105,6 +106,9 @@ class GRVisitor

virtual void visitStart (GRSingleRest* o) {}
virtual void visitEnd (GRSingleRest* o) {}

virtual void visitStart (GROctava* o) {}
virtual void visitEnd (GROctava* o) {}
};

#endif

0 comments on commit 21f229b

Please sign in to comment.