diff --git a/src/engine/abstract/ARRepeatBegin.cpp b/src/engine/abstract/ARRepeatBegin.cpp index 33946768..3a408136 100644 --- a/src/engine/abstract/ARRepeatBegin.cpp +++ b/src/engine/abstract/ARRepeatBegin.cpp @@ -12,12 +12,17 @@ */ -#include - #include "ARRepeatBegin.h" #include "ARRepeatEnd.h" #include "TimeUnwrap.h" +#include "TagParameterString.h" +#include "TagParameterStrings.h" +ARRepeatBegin::ARRepeatBegin() +{ + setupTagParameters (gMaps->sARRepeatMap); + dur.setNumerator(-1); +} void ARRepeatBegin::browse(TimeUnwrap& mapper) const { @@ -30,3 +35,8 @@ void ARRepeatBegin::setRepeatEnd(const ARRepeatEnd *myr) dur = myr->getRelativeTimePosition() - getRelativeTimePosition(); } +bool ARRepeatBegin::hidden () const +{ + return getParameter(kHiddenStr, true)->getBool(); +} + diff --git a/src/engine/abstract/ARRepeatBegin.h b/src/engine/abstract/ARRepeatBegin.h index d83724a9..bca1641a 100644 --- a/src/engine/abstract/ARRepeatBegin.h +++ b/src/engine/abstract/ARRepeatBegin.h @@ -38,7 +38,7 @@ See the [Repeat Signs](@EXAMPLES/repeats/) example. class ARRepeatBegin : public ARMTParameter { public: - ARRepeatBegin() { dur.setNumerator(-1); } + ARRepeatBegin(); virtual ~ARRepeatBegin() {} virtual const char* getTagName() const { return "ARRepeatBegin"; }; @@ -50,6 +50,7 @@ class ARRepeatBegin : public ARMTParameter ARMusicalObject *isARRepeatBegin() { return this; } const ARBar::TRanges& getRanges () const { return fRanges; } void setRanges (const ARBar::TRanges& r) { fRanges = r; } + bool hidden () const; private: ARBar::TRanges fRanges; diff --git a/src/engine/abstract/ARRepeatEnd.h b/src/engine/abstract/ARRepeatEnd.h index 277061a9..a2dafc0c 100644 --- a/src/engine/abstract/ARRepeatEnd.h +++ b/src/engine/abstract/ARRepeatEnd.h @@ -17,6 +17,8 @@ #include "ARBar.h" #include "TimeUnwrap.h" +#include "TagParameterString.h" +#include "TagParameterStrings.h" class ARRepeatBegin; @@ -39,13 +41,14 @@ See the [Repeat Signs](@EXAMPLES/repeats/) example. class ARRepeatEnd : public ARBar { public: - ARRepeatEnd(ARRepeatBegin * curbeg = 0) { rangesetting = RANGEDC; } + ARRepeatEnd(ARRepeatBegin * curbeg = 0) { rangesetting = RANGEDC; setupTagParameters (gMaps->sARRepeatMap); } virtual ~ARRepeatEnd() { } virtual const char* getTagName() const { return "ARRepeatEnd"; }; virtual std::string getGMNName() const { return "\\repeatEnd"; }; ARMusicalObject *isARRepeatEnd() { return this; } + bool hidden () const { return getParameter(kHiddenStr, true)->getBool(); } virtual void browse(TimeUnwrap& mapper) const { mapper.AtPos (this, TimeUnwrap::kRepeatEnd); } diff --git a/src/engine/graphic/GRRepeatBegin.cpp b/src/engine/graphic/GRRepeatBegin.cpp index 96650893..051eb243 100644 --- a/src/engine/graphic/GRRepeatBegin.cpp +++ b/src/engine/graphic/GRRepeatBegin.cpp @@ -47,6 +47,7 @@ GRRepeatBegin::GRRepeatBegin(const ARRepeatBegin *ar, GRStaff * inStaff, bool p_ fDx = ar->getDX()->getValue(); fDy = ar->getDY()->getValue(); updateBoundingBox(); + if (ar->hidden()) mShow = false; } // -------------------------------------------------------------------------- @@ -155,8 +156,10 @@ void GRRepeatBegin::DrawDots( VGDevice & hdc ) const } float x = getXOffset() + hlspace * 2.4f; + const VGFont* savedfont = hdc.GetMusicFont(); DrawSymbol(hdc, kDotSymbol, x, y1, pointSize); DrawSymbol(hdc, kDotSymbol, x, y2, pointSize); + hdc.SetMusicFont(savedfont); } // -------------------------------------------------------------------------- diff --git a/src/engine/graphic/GRRepeatEnd.cpp b/src/engine/graphic/GRRepeatEnd.cpp index 10e5c07c..aecabc77 100644 --- a/src/engine/graphic/GRRepeatEnd.cpp +++ b/src/engine/graphic/GRRepeatEnd.cpp @@ -35,6 +35,7 @@ GRRepeatEnd::GRRepeatEnd( const ARRepeatEnd * ar, GRStaff * inStaff, const TYPE_ { setGRStaff (inStaff); InitRepeatEnd(); + if (ar->hidden()) mShow = false; } const ARRepeatEnd* GRRepeatEnd::getARRepeatEnd() { @@ -117,9 +118,11 @@ void GRRepeatEnd::DrawDots( VGDevice & hdc ) const } float x = -hlspace * 0.75f - getXOffset(); + const VGFont* savedfont = hdc.GetMusicFont(); hdc.SetFontAlign(VGDevice::kAlignBaseLeft); DrawSymbol(hdc, kDotSymbol, x, y1, pointSize); DrawSymbol(hdc, kDotSymbol, x, y2, pointSize); + hdc.SetMusicFont(savedfont); } // --------------------------------------------------------------------------