From bd5186613621201a05f724ec21d5f14584ccfe6e Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Wed, 27 May 2015 21:55:37 +0200 Subject: [PATCH 001/114] Adding proport to all the makefiles --- Verovio.xcodeproj/project.pbxproj | 6 ++++++ emscripten/build.sh | 1 + java/build.sh | 1 + python/setup.py | 3 ++- src/proport.cpp | 6 +++--- tools/CMakeLists.txt | 1 + 6 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Verovio.xcodeproj/project.pbxproj b/Verovio.xcodeproj/project.pbxproj index be07fa0f273..e72ddb1af3c 100644 --- a/Verovio.xcodeproj/project.pbxproj +++ b/Verovio.xcodeproj/project.pbxproj @@ -27,6 +27,7 @@ 4D4221061998A8CE00963292 /* atts_mensural.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DEE29031940BCC100C76319 /* atts_mensural.cpp */; }; 4D4221071998A8CE00963292 /* atts_mensural.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DEE29031940BCC100C76319 /* atts_mensural.cpp */; }; 4D43C30C1A9BB22A00EA28F3 /* view_mensural.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D43C30B1A9BB22A00EA28F3 /* view_mensural.cpp */; }; + 4D46000A1B165779000D7878 /* proport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D4600091B165779000D7878 /* proport.cpp */; }; 4D763EC61987D04E003FCAB5 /* metersig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D763EC51987D04D003FCAB5 /* metersig.cpp */; }; 4D763EC71987D04E003FCAB5 /* metersig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D763EC51987D04D003FCAB5 /* metersig.cpp */; }; 4D763EC91987D067003FCAB5 /* metersig.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D763EC81987D067003FCAB5 /* metersig.h */; }; @@ -213,6 +214,8 @@ 4D422100199805E400963292 /* attdef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = attdef.h; path = include/vrv/attdef.h; sourceTree = ""; }; 4D422103199805F700963292 /* att.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = att.cpp; path = src/att.cpp; sourceTree = ""; }; 4D43C30B1A9BB22A00EA28F3 /* view_mensural.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = view_mensural.cpp; path = src/view_mensural.cpp; sourceTree = ""; }; + 4D4600091B165779000D7878 /* proport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = proport.cpp; path = src/proport.cpp; sourceTree = ""; }; + 4D46000B1B165786000D7878 /* proport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = proport.h; path = include/vrv/proport.h; sourceTree = ""; }; 4D763EC51987D04D003FCAB5 /* metersig.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = metersig.cpp; path = src/metersig.cpp; sourceTree = ""; }; 4D763EC81987D067003FCAB5 /* metersig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = metersig.h; path = include/vrv/metersig.h; sourceTree = ""; }; 4D797B041A67C55F007637BD /* devicecontextbase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = devicecontextbase.h; path = include/vrv/devicecontextbase.h; sourceTree = ""; }; @@ -615,6 +618,8 @@ 8F59292218854BF800FE51AD /* multirest.h */, 8F086ECC188539540037FD8E /* note.cpp */, 8F59292318854BF800FE51AD /* note.h */, + 4D4600091B165779000D7878 /* proport.cpp */, + 4D46000B1B165786000D7878 /* proport.h */, 8F086ED1188539540037FD8E /* rest.cpp */, 8F59292818854BF800FE51AD /* rest.h */, 4DB3072E1AC9ED2500EE0982 /* space.cpp */, @@ -795,6 +800,7 @@ 8F086EF1188539540037FD8E /* keysig.cpp in Sources */, 4D43C30C1A9BB22A00EA28F3 /* view_mensural.cpp in Sources */, 8F086EF2188539540037FD8E /* layer.cpp in Sources */, + 4D46000A1B165779000D7878 /* proport.cpp in Sources */, 4DF2AF801A62FC4A0016F869 /* drawinglistinterface.cpp in Sources */, 8F086EF3188539540037FD8E /* layerelement.cpp in Sources */, 8F086EF5188539540037FD8E /* measure.cpp in Sources */, diff --git a/emscripten/build.sh b/emscripten/build.sh index bbb1ef804bd..d25971d75bb 100755 --- a/emscripten/build.sh +++ b/emscripten/build.sh @@ -125,6 +125,7 @@ python $EMCC $CHATTY \ $VEROVIO_ROOT/src/page.cpp \ $VEROVIO_ROOT/src/pitchinterface.cpp \ $VEROVIO_ROOT/src/positioninterface.cpp \ + $VEROVIO_ROOT/src/proport.cpp \ $VEROVIO_ROOT/src/view.cpp \ $VEROVIO_ROOT/src/view_beam.cpp \ $VEROVIO_ROOT/src/view_element.cpp \ diff --git a/java/build.sh b/java/build.sh index 8596ddeeeb1..0cfbbdbb72b 100755 --- a/java/build.sh +++ b/java/build.sh @@ -44,6 +44,7 @@ FILES="../src/accid.cpp \ ../src/page.cpp \ ../src/pitchinterface.cpp \ ../src/positioninterface.cpp \ + ../src/proport.cpp \ ../src/view.cpp \ ../src/view_beam.cpp \ ../src/view_element.cpp \ diff --git a/python/setup.py b/python/setup.py index 7732e5dcea4..4fea6a5c399 100755 --- a/python/setup.py +++ b/python/setup.py @@ -47,7 +47,8 @@ '../src/object.cpp', '../src/page.cpp', '../src/pitchinterface.cpp', - '../src/positioninterface.cpp', + '../src/positioninterface.cpp', + '../src/proport.cpp', '../src/view.cpp', '../src/view_beam.cpp', '../src/view_element.cpp', diff --git a/src/proport.cpp b/src/proport.cpp index 6ffc2f5afbd..82a8599f00a 100755 --- a/src/proport.cpp +++ b/src/proport.cpp @@ -15,8 +15,8 @@ namespace vrv { //---------------------------------------------------------------------------- Proport::Proport(): - LayerElement("msig-") - //AttMeterSigLog() + LayerElement("prop-"), + AttDurationRatio() { Reset(); } @@ -41,7 +41,7 @@ Proport::~Proport() void Proport::Reset() { LayerElement::Reset(); - //ResetMeterSigLog(); + ResetDurationRatio(); } } // namespace vrv diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index f029cbbafd4..05a6c386ba0 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -47,6 +47,7 @@ add_executable (verovio ../src/page.cpp ../src/pitchinterface.cpp ../src/positioninterface.cpp + ../src/proport.cpp ../src/view.cpp ../src/view_beam.cpp ../src/view_element.cpp From d215cd1c357222d245beefba95e9990aaa9fa031 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Tue, 30 Jun 2015 10:30:51 +0200 Subject: [PATCH 002/114] Adding mensural note heads --- data/Bravura.xml | 4 + .../E938-mensuralNoteheadSemibrevisBlack.xml | 5 ++ .../E939-mensuralNoteheadSemibrevisVoid.xml | 5 ++ .../E93C-mensuralNoteheadMinimaWhite.xml | 5 ++ .../E93D-mensuralNoteheadSemiminimaWhite.xml | 5 ++ data/Gootville.xml | 4 + .../E938-mensuralNoteheadSemibrevisBlack.xml | 5 ++ .../E939-mensuralNoteheadSemibrevisVoid.xml | 5 ++ .../E93C-mensuralNoteheadMinimaWhite.xml | 5 ++ .../E93D-mensuralNoteheadSemiminimaWhite.xml | 5 ++ data/Leipzig.xml | 4 + .../E938-mensuralNoteheadSemibrevisBlack.xml | 5 ++ .../E939-mensuralNoteheadSemibrevisVoid.xml | 5 ++ .../E93C-mensuralNoteheadMinimaWhite.xml | 5 ++ .../E93D-mensuralNoteheadSemiminimaWhite.xml | 5 ++ fonts/Leipzig-5.0.sfd | 88 +++++++++++++++++-- fonts/Leipzig.svg | 12 ++- fonts/supported.xsl | 8 +- include/vrv/smufl.h | 6 +- 19 files changed, 172 insertions(+), 14 deletions(-) create mode 100644 data/Bravura/E938-mensuralNoteheadSemibrevisBlack.xml create mode 100644 data/Bravura/E939-mensuralNoteheadSemibrevisVoid.xml create mode 100644 data/Bravura/E93C-mensuralNoteheadMinimaWhite.xml create mode 100644 data/Bravura/E93D-mensuralNoteheadSemiminimaWhite.xml create mode 100644 data/Gootville/E938-mensuralNoteheadSemibrevisBlack.xml create mode 100644 data/Gootville/E939-mensuralNoteheadSemibrevisVoid.xml create mode 100644 data/Gootville/E93C-mensuralNoteheadMinimaWhite.xml create mode 100644 data/Gootville/E93D-mensuralNoteheadSemiminimaWhite.xml create mode 100644 data/Leipzig/E938-mensuralNoteheadSemibrevisBlack.xml create mode 100644 data/Leipzig/E939-mensuralNoteheadSemibrevisVoid.xml create mode 100644 data/Leipzig/E93C-mensuralNoteheadMinimaWhite.xml create mode 100644 data/Leipzig/E93D-mensuralNoteheadSemiminimaWhite.xml diff --git a/data/Bravura.xml b/data/Bravura.xml index ff2028fcf79..9aed5046ea1 100644 --- a/data/Bravura.xml +++ b/data/Bravura.xml @@ -65,4 +65,8 @@ + + + + diff --git a/data/Bravura/E938-mensuralNoteheadSemibrevisBlack.xml b/data/Bravura/E938-mensuralNoteheadSemibrevisBlack.xml new file mode 100644 index 00000000000..9b0cf8a784c --- /dev/null +++ b/data/Bravura/E938-mensuralNoteheadSemibrevisBlack.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E939-mensuralNoteheadSemibrevisVoid.xml b/data/Bravura/E939-mensuralNoteheadSemibrevisVoid.xml new file mode 100644 index 00000000000..f02c2942641 --- /dev/null +++ b/data/Bravura/E939-mensuralNoteheadSemibrevisVoid.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E93C-mensuralNoteheadMinimaWhite.xml b/data/Bravura/E93C-mensuralNoteheadMinimaWhite.xml new file mode 100644 index 00000000000..18d456d6bea --- /dev/null +++ b/data/Bravura/E93C-mensuralNoteheadMinimaWhite.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E93D-mensuralNoteheadSemiminimaWhite.xml b/data/Bravura/E93D-mensuralNoteheadSemiminimaWhite.xml new file mode 100644 index 00000000000..6e80f10c8f1 --- /dev/null +++ b/data/Bravura/E93D-mensuralNoteheadSemiminimaWhite.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville.xml b/data/Gootville.xml index fddb8a23083..4a47c835027 100644 --- a/data/Gootville.xml +++ b/data/Gootville.xml @@ -65,4 +65,8 @@ + + + + diff --git a/data/Gootville/E938-mensuralNoteheadSemibrevisBlack.xml b/data/Gootville/E938-mensuralNoteheadSemibrevisBlack.xml new file mode 100644 index 00000000000..ec0833b6f56 --- /dev/null +++ b/data/Gootville/E938-mensuralNoteheadSemibrevisBlack.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E939-mensuralNoteheadSemibrevisVoid.xml b/data/Gootville/E939-mensuralNoteheadSemibrevisVoid.xml new file mode 100644 index 00000000000..ff0a0b3599b --- /dev/null +++ b/data/Gootville/E939-mensuralNoteheadSemibrevisVoid.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E93C-mensuralNoteheadMinimaWhite.xml b/data/Gootville/E93C-mensuralNoteheadMinimaWhite.xml new file mode 100644 index 00000000000..7c2dfa1015b --- /dev/null +++ b/data/Gootville/E93C-mensuralNoteheadMinimaWhite.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E93D-mensuralNoteheadSemiminimaWhite.xml b/data/Gootville/E93D-mensuralNoteheadSemiminimaWhite.xml new file mode 100644 index 00000000000..f9c6b785caf --- /dev/null +++ b/data/Gootville/E93D-mensuralNoteheadSemiminimaWhite.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig.xml b/data/Leipzig.xml index ece8a6d7bcf..32ce77f39dc 100644 --- a/data/Leipzig.xml +++ b/data/Leipzig.xml @@ -65,4 +65,8 @@ + + + + diff --git a/data/Leipzig/E938-mensuralNoteheadSemibrevisBlack.xml b/data/Leipzig/E938-mensuralNoteheadSemibrevisBlack.xml new file mode 100644 index 00000000000..76d4be285dc --- /dev/null +++ b/data/Leipzig/E938-mensuralNoteheadSemibrevisBlack.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E939-mensuralNoteheadSemibrevisVoid.xml b/data/Leipzig/E939-mensuralNoteheadSemibrevisVoid.xml new file mode 100644 index 00000000000..2b12cde9b2c --- /dev/null +++ b/data/Leipzig/E939-mensuralNoteheadSemibrevisVoid.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E93C-mensuralNoteheadMinimaWhite.xml b/data/Leipzig/E93C-mensuralNoteheadMinimaWhite.xml new file mode 100644 index 00000000000..a037aedf373 --- /dev/null +++ b/data/Leipzig/E93C-mensuralNoteheadMinimaWhite.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E93D-mensuralNoteheadSemiminimaWhite.xml b/data/Leipzig/E93D-mensuralNoteheadSemiminimaWhite.xml new file mode 100644 index 00000000000..2eb5b06411a --- /dev/null +++ b/data/Leipzig/E93D-mensuralNoteheadSemiminimaWhite.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/fonts/Leipzig-5.0.sfd b/fonts/Leipzig-5.0.sfd index ff4c7fb70b2..a1cfa3ac674 100644 --- a/fonts/Leipzig-5.0.sfd +++ b/fonts/Leipzig-5.0.sfd @@ -20,7 +20,7 @@ OS2Version: 0 OS2_WeightWidthSlopeOnly: 0 OS2_UseTypoMetrics: 1 CreationTime: 1395388130 -ModificationTime: 1420559201 +ModificationTime: 1435652447 PfmFamily: 17 TTFWeight: 500 TTFWidth: 5 @@ -49,11 +49,11 @@ NameList: Adobe Glyph List DisplaySize: -72 AntiAlias: 1 FitToEm: 1 -WinInfo: 57450 15 7 +WinInfo: 59700 15 7 BeginPrivate: 0 EndPrivate TeXData: 1 0 0 346030 173015 115343 0 1048576 115343 783286 444596 497025 792723 393216 433062 380633 303038 157286 324010 404750 52429 2506097 1059062 262144 -BeginChars: 1114115 65 +BeginChars: 1114115 69 StartChar: uniE0A3 Encoding: 57507 57507 0 @@ -430,15 +430,15 @@ StartChar: uniE0A2 Encoding: 57506 57506 11 Width: 405 VWidth: 2048 -Flags: HW +Flags: HWO LayerCount: 2 Fore SplineSet -198 133 m 4 +198 133 m 0 300 133 405 88 405 0 c 0 - 405 -92 307 -133 198 -133 c 0 + 405 -92 307 -133 198 -133 c 4 97 -133 0 -87 0 0 c 256 - 0 88 93 133 198 133 c 4 + 0 88 93 133 198 133 c 0 293 -21 m 0 293 -7 290 8 285 23 c 0 278 43 267 61 252 77 c 0 @@ -3349,5 +3349,79 @@ SplineSet -0 74 0 37 0 -0 c 5 EndSplineSet EndChar + +StartChar: uniE938 +Encoding: 59704 59704 65 +Width: 312 +VWidth: 2048 +Flags: HWO +LayerCount: 2 +Fore +SplineSet +155 194 m 5 + 312 0 l 5 + 155 -192 l 5 + 0 0 l 5 + 155 194 l 5 +EndSplineSet +EndChar + +StartChar: uniE939 +Encoding: 59705 59705 66 +Width: 312 +VWidth: 2048 +Flags: HWO +LayerCount: 2 +Fore +SplineSet +155 194 m 5 + 312 0 l 5 + 155 -192 l 5 + 0 0 l 5 + 155 194 l 5 +125 111 m 5 + 68 38 l 5 + 190 -111 l 5 + 246 -40 l 5 + 125 111 l 5 +EndSplineSet +EndChar + +StartChar: uniE93D +Encoding: 59709 59709 67 +Width: 312 +VWidth: 2048 +Flags: HWO +LayerCount: 2 +Fore +SplineSet +155 194 m 5 + 312 0 l 5 + 155 -192 l 5 + 0 0 l 5 + 155 194 l 5 +EndSplineSet +EndChar + +StartChar: uniE93C +Encoding: 59708 59708 68 +Width: 312 +VWidth: 2048 +Flags: HWO +LayerCount: 2 +Fore +SplineSet +155 194 m 5 + 312 0 l 5 + 155 -192 l 5 + 0 0 l 5 + 155 194 l 5 +125 111 m 5 + 68 38 l 5 + 190 -111 l 5 + 246 -40 l 5 + 125 111 l 5 +EndSplineSet +EndChar EndChars EndSplineFont diff --git a/fonts/Leipzig.svg b/fonts/Leipzig.svg index 43d799fd2cc..1fc04344ab6 100644 --- a/fonts/Leipzig.svg +++ b/fonts/Leipzig.svg @@ -5,7 +5,7 @@ --> -Created by FontForge 20120731 at Tue Jan 6 16:47:08 2015 +Created by FontForge 20120731 at Tue Jun 30 10:21:18 2015 By laurent Created by Etienne Darbellay, Jean-Francois Marti and Laurent Pugin with FontForge 2.0. This font is licensed under the SIL Open Font License \(http://scripts.sil.org/OFL\). @@ -22,7 +22,7 @@ Created by Etienne Darbellay, Jean-Francois Marti and Laurent Pugin with FontFor bbox="-0.780581 -893 698 1317" underline-thickness="50" underline-position="-50" - unicode-range="U+E003-E889" + unicode-range="U+E003-E93D" /> + + + + diff --git a/fonts/supported.xsl b/fonts/supported.xsl index a5a3787f519..5db336b91f2 100644 --- a/fonts/supported.xsl +++ b/fonts/supported.xsl @@ -2185,13 +2185,13 @@ - - + + - - + + diff --git a/include/vrv/smufl.h b/include/vrv/smufl.h index 7e9a3785836..0ed4383cf55 100644 --- a/include/vrv/smufl.h +++ b/include/vrv/smufl.h @@ -87,10 +87,14 @@ enum { SMUFL_E887_tuplet7 = 0xE887, SMUFL_E888_tuplet8 = 0xE888, SMUFL_E889_tuplet9 = 0xE889, + SMUFL_E938_mensuralNoteheadSemibrevisBlack = 0xE938, + SMUFL_E939_mensuralNoteheadSemibrevisVoid = 0xE939, + SMUFL_E93C_mensuralNoteheadMinimaWhite = 0xE93C, + SMUFL_E93D_mensuralNoteheadSemiminimaWhite = 0xE93D, }; /** The number of glyphs for verification **/ -#define SMUFL_COUNT 65 +#define SMUFL_COUNT 69 } // vrv namespace From 4da7eb65adae9cc52e65460370d57ffcde086c59 Mon Sep 17 00:00:00 2001 From: Don Byrd Date: Tue, 30 Jun 2015 16:37:49 -0600 Subject: [PATCH 003/114] Correct typos --- include/vrv/doc.h | 4 ++-- src/system.cpp | 4 +++- tools/main.cpp | 8 ++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/include/vrv/doc.h b/include/vrv/doc.h index c22c745f54d..4a7965dd129 100644 --- a/include/vrv/doc.h +++ b/include/vrv/doc.h @@ -229,9 +229,9 @@ class Doc: public Object /** The page currently being drawn */ Page *m_drawingPage; - /** Half a the space between to staff lines for normal and small staff */ + /** Half of the space between two staff lines for normal and small staff */ int m_drawingUnit[2]; - /** Space between to staff lines for normal and small staff */ + /** Space between two staff lines for normal and small staff */ int m_drawingDoubleUnit[2]; /** Height of a five line staff for normal and small staff */ int m_drawingStaffSize[2]; diff --git a/src/system.cpp b/src/system.cpp index 7c4de215319..9f25c6cfcfa 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -226,9 +226,11 @@ int System::JustifyX( ArrayPtrVoid params ) (*ratio) = (double)((*systemFullWidth) - this->GetDrawingLabelsWidth() - this->m_systemLeftMar - this->m_systemRightMar) / ((double)m_drawingTotalWidth - this->GetDrawingLabelsWidth()); + LogDebug("System::JustifyX: *ratio=%lf", (*ratio)); + if ((*ratio) < 0.8 ) { // Arbitrary value for avoiding over-compressed justification - LogWarning("Justification stop because of a ratio smaller the 0.8"); + LogWarning("Justification stop because of a ratio smaller than 0.8"); //return FUNCTOR_SIBLINGS; } diff --git a/tools/main.cpp b/tools/main.cpp index 0687157c913..a58065b7f4e 100644 --- a/tools/main.cpp +++ b/tools/main.cpp @@ -342,24 +342,24 @@ int main(int argc, char** argv) data_stream << line << endl; } if ( !toolkit.LoadString( data_stream.str() ) ) { - cerr << "The input could not be loaded" << endl; + cerr << "The input could not be loaded." << endl; exit(1); } } else { if ( !toolkit.LoadFile( infile ) ) { - cerr << "The file '" << infile << "' could not be open" << endl; + cerr << "The file '" << infile << "' could not be opened." << endl; exit(1); } } // Check the page range if (page > toolkit.GetPageCount()) { - cerr << "The page requested (" << page << ") is not in the page range (max is " << toolkit.GetPageCount() << ")" << endl; + cerr << "The page requested (" << page << ") is not in the page range (max is " << toolkit.GetPageCount() << ")." << endl; exit(1); } if (page < 1) { - cerr << "The page number has to be greater than 0" << endl; + cerr << "The page number has to be greater than 0." << endl; exit(1); } From 66aaace399d67a9424248fc154ca7a8f8baad0ac Mon Sep 17 00:00:00 2001 From: Don Byrd Date: Tue, 30 Jun 2015 16:43:15 -0600 Subject: [PATCH 004/114] Add support for _proport_ element; correct typos --- Verovio.xcodeproj/project.pbxproj | 6 ++++++ include/vrv/iomei.h | 3 +++ include/vrv/view.h | 4 +++- src/iomei.cpp | 27 +++++++++++++++++++++++++++ src/view_graph.cpp | 31 +++++++++++++++++++++++++++---- 5 files changed, 66 insertions(+), 5 deletions(-) mode change 100644 => 100755 src/view_graph.cpp diff --git a/Verovio.xcodeproj/project.pbxproj b/Verovio.xcodeproj/project.pbxproj index be07fa0f273..648ec27a7a0 100644 --- a/Verovio.xcodeproj/project.pbxproj +++ b/Verovio.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 1579B3431B15033100B16F5C /* proport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1579B3421B15033100B16F5C /* proport.cpp */; }; 2D2A799A1A69812C000A441B /* chord.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D2A79991A69812C000A441B /* chord.cpp */; }; 4D1D733C1A1D0390001E08F6 /* smufl.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D1D733B1A1D0390001E08F6 /* smufl.h */; }; 4D1D733E1A1D08CD001E08F6 /* glyph.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D1D733D1A1D08CD001E08F6 /* glyph.h */; }; @@ -196,6 +197,8 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 1579B3411B15031D00B16F5C /* proport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = proport.h; path = include/vrv/proport.h; sourceTree = ""; }; + 1579B3421B15033100B16F5C /* proport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = proport.cpp; path = src/proport.cpp; sourceTree = ""; }; 2D2A79991A69812C000A441B /* chord.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = chord.cpp; path = src/chord.cpp; sourceTree = ""; }; 2D2A799B1A698137000A441B /* chord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = chord.h; path = include/vrv/chord.h; sourceTree = ""; }; 4D1D733B1A1D0390001E08F6 /* smufl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = smufl.h; path = include/vrv/smufl.h; sourceTree = ""; }; @@ -615,6 +618,8 @@ 8F59292218854BF800FE51AD /* multirest.h */, 8F086ECC188539540037FD8E /* note.cpp */, 8F59292318854BF800FE51AD /* note.h */, + 1579B3411B15031D00B16F5C /* proport.h */, + 1579B3421B15033100B16F5C /* proport.cpp */, 8F086ED1188539540037FD8E /* rest.cpp */, 8F59292818854BF800FE51AD /* rest.h */, 4DB3072E1AC9ED2500EE0982 /* space.cpp */, @@ -795,6 +800,7 @@ 8F086EF1188539540037FD8E /* keysig.cpp in Sources */, 4D43C30C1A9BB22A00EA28F3 /* view_mensural.cpp in Sources */, 8F086EF2188539540037FD8E /* layer.cpp in Sources */, + 1579B3431B15033100B16F5C /* proport.cpp in Sources */, 4DF2AF801A62FC4A0016F869 /* drawinglistinterface.cpp in Sources */, 8F086EF3188539540037FD8E /* layerelement.cpp in Sources */, 8F086EF5188539540037FD8E /* measure.cpp in Sources */, diff --git a/include/vrv/iomei.h b/include/vrv/iomei.h index 5edff34245d..c4409a48998 100644 --- a/include/vrv/iomei.h +++ b/include/vrv/iomei.h @@ -39,6 +39,7 @@ class MultiRest; class Note; class PitchInterface; class PositionInterface; +class Proport; class Rdg; class Rest; class ScoreDef; @@ -131,6 +132,7 @@ class MeiOutput: public FileOutputStream void WriteMeiMRest( pugi::xml_node currentNode, MRest *mRest ); void WriteMeiMultiRest( pugi::xml_node currentNode, MultiRest *multiRest ); void WriteMeiNote( pugi::xml_node currentNode, Note *note ); + void WriteMeiProport( pugi::xml_node currentNode, Proport *proport ); void WriteMeiRest( pugi::xml_node currentNode, Rest *rest ); void WriteMeiSpace( pugi::xml_node currentNode, Space *space ); void WriteMeiTuplet( pugi::xml_node currentNode, Tuplet *tuplet ); @@ -290,6 +292,7 @@ class MeiInput: public FileInputStream bool ReadMeiMRest( Object *parent, pugi::xml_node mRest ); bool ReadMeiMultiRest( Object *parent, pugi::xml_node multiRest ); bool ReadMeiNote( Object *parent, pugi::xml_node note ); + bool ReadMeiProport( Object *parent, pugi::xml_node proport ); bool ReadMeiRest( Object *parent, pugi::xml_node rest ); bool ReadMeiSpace( Object *parent, pugi::xml_node space ); bool ReadMeiSyl( Object *parent, pugi::xml_node syl ); diff --git a/include/vrv/view.h b/include/vrv/view.h index 6b898e554c7..34dbc4118ee 100644 --- a/include/vrv/view.h +++ b/include/vrv/view.h @@ -244,6 +244,7 @@ class View void DrawMRest( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); void DrawMultiRest( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); void DrawNote( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); + void DrawProport( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); void DrawRest( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); void DrawSpace( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); void DrawSyl( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); @@ -317,8 +318,9 @@ class View void DrawHorizontalLine ( DeviceContext *dc, int x1, int x2, int y1, int nbr); void DrawSmuflCode ( DeviceContext *dc, int x, int y, wchar_t code, int staffSize, bool dimin ); void DrawTieOrSlurBezier(DeviceContext *dc, int x, int y, int x1, int y1, bool direction); - void DrawSmuflString ( DeviceContext *dc, int x, int y, std::wstring s, int centrer, int staffSize = 0); + void DrawSmuflString ( DeviceContext *dc, int x, int y, std::wstring s, bool center, int staffSize = 0); void DrawLyricString ( DeviceContext *dc, int x, int y, std::wstring s, int staffSize = 0); + void DrawPartFullRectangle( DeviceContext *dc, int x1, int y1, int x2, int y2, int fillSection); void DrawFullRectangle( DeviceContext *dc, int x1, int y1, int x2, int y2); void DrawObliquePolygon ( DeviceContext *dc, int x1, int y1, int x2, int y2, int height); void DrawDot ( DeviceContext *dc, int x, int y ); diff --git a/src/iomei.cpp b/src/iomei.cpp index a391d956ab3..dfb985b4a0b 100644 --- a/src/iomei.cpp +++ b/src/iomei.cpp @@ -30,6 +30,7 @@ #include "multirest.h" #include "note.h" #include "page.h" +#include "proport.h" #include "rest.h" #include "slur.h" #include "space.h" @@ -213,6 +214,10 @@ bool MeiOutput::WriteObject( Object *object ) m_currentNode = m_currentNode.append_child("note"); WriteMeiNote( m_currentNode, dynamic_cast(object) ); } + else if (dynamic_cast(object)) { + m_currentNode = m_currentNode.append_child("proport"); + WriteMeiProport( m_currentNode, dynamic_cast(object) ); + } else if (dynamic_cast(object)) { m_currentNode = m_currentNode.append_child("rest"); WriteMeiRest( m_currentNode, dynamic_cast(object) ); @@ -588,6 +593,13 @@ void MeiOutput::WriteMeiRest( pugi::xml_node currentNode, Rest *rest ) WritePositionInterface(currentNode, rest); return; } + +void MeiOutput::WriteMeiProport( pugi::xml_node currentNode, Proport *proport ) +{ + WriteLayerElement( currentNode, proport ); + //meterSig->WriteMeterSigLog(currentNode); + return; +} void MeiOutput::WriteMeiSpace( pugi::xml_node currentNode, Space *space ) { @@ -1380,6 +1392,9 @@ bool MeiInput::ReadMeiLayerChildren( Object *parent, pugi::xml_node parentNode, else if ( elementName == "multiRest" ) { success = ReadMeiMultiRest( parent, xmlElement ); } + else if ( elementName == "proport" ) { + success = ReadMeiProport( parent, xmlElement ); + } else if ( elementName == "space" ) { success = ReadMeiSpace( parent, xmlElement ); } @@ -1601,6 +1616,18 @@ bool MeiInput::ReadMeiRest( Object *parent, pugi::xml_node rest ) return true; } +bool MeiInput::ReadMeiProport( Object *parent, pugi::xml_node proport ) +{ + Proport *vrvProport = new Proport(); + ReadLayerElement(proport, vrvProport); + + //vrvMeterSig->ReadMeterSigLog(meterSig); + vrvProport->ReadDurationRatio( proport ); + + AddLayerElement(parent, vrvProport); + return true; +} + bool MeiInput::ReadMeiSpace( Object *parent, pugi::xml_node space ) { Space *vrvSpace = new Space(); diff --git a/src/view_graph.cpp b/src/view_graph.cpp old mode 100644 new mode 100755 index bdc7148fbb2..6c603d44626 --- a/src/view_graph.cpp +++ b/src/view_graph.cpp @@ -50,7 +50,30 @@ void View::DrawHorizontalLine ( DeviceContext *dc, int x1, int x2, int y1, int n return; } -void View::DrawFullRectangle( DeviceContext *dc, int x1, int y1, int x2, int y2 ) /* dessine rectangle plein */ + /* Draw rectangle partly filled in, as specified by : 1=top, 2=bottom, 3=left side, + 4=right side; 0=don't fill in any part. ??SO FAR, IS IGNORED. + */ + void View::DrawPartFullRectangle( DeviceContext *dc, int x1, int y1, int x2, int y2, int fillSection ) + { + assert( dc ); // DC cannot be NULL + + SwapY( &y1, &y2 ); + + //dc->SetPen( m_currentColour, 0, AxSOLID ); + //dc->SetBrush( AxWHITE, AxTRANSPARENT ); + dc->SetPen( AxBLUE, 0, AxSOLID ); + dc->SetBrush( AxRED, AxTRANSPARENT ); + + dc->DrawRectangle( ToDeviceContextX( x1 ), ToDeviceContextY(y1), ToDeviceContextX(x2 - x1) , ToDeviceContextX( y1 - y2 )); + + dc->ResetPen(); + dc->ResetBrush(); + + return; + } + + + void View::DrawFullRectangle( DeviceContext *dc, int x1, int y1, int x2, int y2 ) /* dessine rectangle plein */ { assert( dc ); // DC cannot be NULL @@ -138,7 +161,7 @@ void View::DrawSmuflCode ( DeviceContext *dc, int x, int y, wchar_t code, return; } -void View::DrawSmuflString ( DeviceContext *dc, int x, int y, std::wstring s, int centrer, int staffSize) +void View::DrawSmuflString ( DeviceContext *dc, int x, int y, std::wstring s, bool center, int staffSize) { assert( dc ); // DC cannot be NULL @@ -149,9 +172,9 @@ void View::DrawSmuflString ( DeviceContext *dc, int x, int y, std::wstring s, in fontCorr = m_doc->m_drawingFontHeightAscent[staffSize][0]; } - if ( centrer ) + if ( center ) { - LogDebug("Centering string not implemented with DeviceContext"); + //LogDebug("Centering string not implemented with DeviceContext"); ??WHAT DOES THIS MEAN? int w, h; dc->GetSmuflTextExtent( s, &w, &h ); From f7b8ac8c8e3350c48ab87b34ed90345cc5d40dcd Mon Sep 17 00:00:00 2001 From: Don Byrd Date: Thu, 9 Jul 2015 11:30:34 -0400 Subject: [PATCH 005/114] Add support for _proport_ element; prepare to add fixed spacing for mensural notation; add control of symbol and staff line sizes and thicknesses for mensural notation; correct typos --- src/aligner.cpp | 37 ++++++++++++++++++++--------------- src/view_element.cpp | 45 +++++++++++++++++++++++++++++++++++++++++-- src/view_mensural.cpp | 36 +++++++++++++++++++++++++--------- src/view_page.cpp | 9 +++++++-- src/vrv.cpp | 9 +++++---- tools/main.cpp | 6 +++--- 6 files changed, 107 insertions(+), 35 deletions(-) diff --git a/src/aligner.cpp b/src/aligner.cpp index 81f9118efb7..f004ff52028 100644 --- a/src/aligner.cpp +++ b/src/aligner.cpp @@ -168,7 +168,7 @@ Alignment* MeasureAligner::GetAlignmentAtTime( double time, AlignmentType type ) if ( vrv::AreEqual( alignment_time, time ) ) { // we found a default alignment, but we are inserting a grace note (another layer) // we need the grace note to be inserted before so we stop here - // this does not work when we have grace notes simultanously at different voices because + // this does not work when we have grace notes simultanously in different voices because // they will all have their own alignment. We need something more sophisticated that takes // care of the staff/layer number (or using the layer uuid?) if ( (alignment->GetType() == ALIGNMENT_DEFAULT) && (type == ALIGNMENT_GRACENOTE) ) { @@ -195,9 +195,9 @@ Alignment* MeasureAligner::GetAlignmentAtTime( double time, AlignmentType type ) // we always to insert _before_ the last one - m_rightAlignment is added in Reset() idx = GetAlignmentCount() - 1; } - Alignment *newAlignement = new Alignment( time, type ); - AddAlignment( newAlignement, idx ); - return newAlignement; + Alignment *newAlignment = new Alignment( time, type ); + AddAlignment( newAlignment, idx ); + return newAlignment; } void MeasureAligner::SetMaxTime( double time ) @@ -208,7 +208,7 @@ void MeasureAligner::SetMaxTime( double time ) } //---------------------------------------------------------------------------- -// Alignement +// Alignment //---------------------------------------------------------------------------- Alignment::Alignment( ): @@ -288,7 +288,7 @@ int StaffAlignment::SetAligmentYPos( ArrayPtrVoid params ) int StaffAlignment::IntegrateBoundingBoxYShift( ArrayPtrVoid params ) { - // param 0: the cumulated shift + // param 0: the accumulated shift // param 1: the functor to be redirected to the SystemAligner (unused) int *shift = static_cast(params[0]); @@ -304,14 +304,14 @@ int StaffAlignment::IntegrateBoundingBoxYShift( ArrayPtrVoid params ) int MeasureAligner::IntegrateBoundingBoxXShift( ArrayPtrVoid params ) { - // param 0: the cumulated shift - // param 1: the cumulated justifiable shift + // param 0: the accumulated shift + // param 1: the accumulated justifiable shift // param 2: the functor to be redirected to the MeasureAligner (unused) int *shift = static_cast(params[0]); int *justifiable_shift = static_cast(params[1]); // We start a new MeasureAligner - // Reset the cumulated shift to 0; + // Reset the accumulated shift to 0; (*shift) = 0; (*justifiable_shift) = -1; @@ -320,8 +320,8 @@ int MeasureAligner::IntegrateBoundingBoxXShift( ArrayPtrVoid params ) int Alignment::IntegrateBoundingBoxXShift( ArrayPtrVoid params ) { - // param 0: the cumulated shift - // param 1: the cumulated justifiable shift + // param 0: the accumulated shift + // param 1: the accumulated justifiable shift // param 2: the functor to be redirected to the MeasureAligner (unused) int *shift = static_cast(params[0]); int *justifiable_shift = static_cast(params[1]); @@ -372,8 +372,15 @@ int Alignment::SetAligmentXPos( ArrayPtrVoid params ) int intervalXRel = 0; double intervalTime = (m_time - (*previousTime)); if ( intervalTime > 0.0 ) { - intervalXRel = pow( intervalTime, 0.60 ) * 2.5; // 2.5 is an abritrary value - } + // Compute "ideal" horizontal space to allow. For modern notation (CMN), + // this is a function of time (duration); we may increase it later to + // keep symbols from overlapping. For mensural notation, ideal spacing is + // as tight as possible without overlapping. + if (true) // ??TEMPORARY! + intervalXRel = pow( intervalTime, 0.60 ) * 2.5; // 2.5 is an arbitrary value + else + intervalXRel = 20; // ??EXPERIMENTAL! A very small value => space as tightly as possible + } m_xRel = (*previousXRel) + (intervalXRel) * DEFINITON_FACTOR; (*previousTime) = m_time; @@ -400,7 +407,7 @@ int MeasureAligner::JustifyX( ArrayPtrVoid params ) int width = GetRightAlignment()->GetXRel() + GetRightAlignment()->GetMaxWidth(); // the ratio in the measure has to take into account the non justifiable width - // for element within the margin, we do not move them + // for elements within the margin, we do not move them // for after the margin (right) we have a position that is given by: // (m_xRel - margin) * measureRatio + margin, where measureRatio is given by: // (ratio - 1) * (margin / justifiable) + ratio @@ -432,7 +439,7 @@ int Alignment::JustifyX( ArrayPtrVoid params ) } // the ratio in the measure has to take into account the non justifiable width - // for element within the margin, we do not move them + // for elements within the margin, we do not move them // for after the margin (right) we have a position that is given by: // (m_xRel - margin) * measureRatio + margin, where measureRatio is given by: // (ratio - 1) * (margin / justifiable) + ratio diff --git a/src/view_element.cpp b/src/view_element.cpp index 31319042d6c..7e24d08bf05 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -30,6 +30,7 @@ #include "mrest.h" #include "multirest.h" #include "note.h" +#include "proport.h" #include "rest.h" #include "slur.h" #include "space.h" @@ -102,6 +103,9 @@ void View::DrawLayerElement( DeviceContext *dc, LayerElement *element, Layer *la else if (dynamic_cast(element)) { DrawDurationElement(dc, element, layer, staff, measure); } + else if (dynamic_cast(element)) { + DrawProport(dc, element, layer, staff, measure); + } else if (dynamic_cast(element)) { DrawDurationElement(dc, element, layer, staff, measure); } @@ -1200,12 +1204,12 @@ void View::DrawMeterSigFigures( DeviceContext *dc, int x, int y, int num, int nu dc->SetFont( &m_doc->m_drawingSmuflFonts[staff->staffSize][0] ); wtext = IntToTimeSigFigures(num); - DrawSmuflString ( dc, x, ynum, wtext, 1, staff->staffSize); // '1' = centrer + DrawSmuflString ( dc, x, ynum, wtext, true, staff->staffSize); // true = center if (numBase) { wtext = IntToTimeSigFigures(numBase); - DrawSmuflString ( dc, x, yden, wtext, 1, staff->staffSize); // '1' = centrer + DrawSmuflString ( dc, x, yden, wtext, true, staff->staffSize); // true = center } dc->ResetFont(); @@ -1539,6 +1543,43 @@ void View::DrawDot( DeviceContext *dc, LayerElement *element, Layer *layer, Staf dc->EndGraphic(element, this ); } + + +void View::DrawProport( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ) +{ + assert(layer); // Pointer to layer cannot be NULL" + assert(staff); // Pointer to staff cannot be NULL" + assert(dynamic_cast(element)); // Element must be a Mensur" + + int x1, x2, y1, y2; + + Proport *proport = dynamic_cast(element); + + dc->StartGraphic( element, "", element->GetUuid() ); + + int y = staff->GetDrawingY() - (m_doc->m_drawingUnit[ staff->staffSize ]*4); + int x = element->GetDrawingX(); + + x1 = x+120; x2 = x1+150; // ??TEST: JUST DRAW AN ARBITRARY RECTANGLE + y1 = y; y2 = y+50+(50*proport->GetNum()); + //DrawFullRectangle( dc,x1,y1,x2,y2); + DrawPartFullRectangle( dc,x1,y1,x2,y2, 0); + + if (proport->HasNum()) + { + x = element->GetDrawingX(); + //if (proport->GetSign() || proport->HasTempus()) // ??WHAT SHOULD THIS BE? + { + x += m_doc->m_drawingUnit[staff->staffSize] * 5; // step forward because we have a sign or a meter symbol + } + int numbase = proport->HasNumbase() ? proport->GetNumbase() : 0; + DrawMeterSigFigures ( dc, x, staff->GetDrawingY(), proport->GetNum(), numbase, staff); + } + + + dc->EndGraphic(element, this ); +} + int View::GetSylY( Syl *syl, Staff *staff ) { diff --git a/src/view_mensural.cpp b/src/view_mensural.cpp index c49f963b232..6e6ccc8eada 100644 --- a/src/view_mensural.cpp +++ b/src/view_mensural.cpp @@ -25,6 +25,13 @@ namespace vrv { + enum { + SMUFL_E938_mensNoteheadSemibrevisBlack, + SMUFL_E939_mensNoteheadSemibrevisVoid, + SMUFL_E93C_mensNoteheadMinimaWhite, + SMUFL_E93D_mensNoteheadSemiminimaWhite // for fusa as well as semiminima + }; + int View::s_drawingLigX[2], View::s_drawingLigY[2]; // pour garder coord. des ligatures bool View::s_drawingLigObliqua = false; // marque le 1e passage pour une oblique @@ -88,12 +95,12 @@ void View::DrawMensuralNote ( DeviceContext *dc, LayerElement *element, Layer *l else if (drawingDur < DUR_1) { DrawMaximaToBrevis( dc, noteY, element, layer, staff); } - // Whole notes + // Whole notes ??WE WANT SEMIBREVIS'ES, NOT WHOLE NOTES!!! CHANGE THIS, AND SIMILARLY FOR SHORTER DURATIONS!!!!!!!! else if (drawingDur == DUR_1) { if (note->GetColored()==BOOLEAN_true) - fontNo = SMUFL_E0FA_noteheadWholeFilled; + fontNo = SMUFL_E938_mensNoteheadSemibrevisBlack; else - fontNo = SMUFL_E0A2_noteheadWhole; + fontNo = SMUFL_E939_mensNoteheadSemibrevisVoid; DrawSmuflCode( dc, xNote, noteY, fontNo, staff->staffSize, note->m_cueSize ); } @@ -195,15 +202,22 @@ void View::DrawMensur( DeviceContext *dc, LayerElement *element, Layer *layer, S } - +/* The entire mensuration sign fits easily between two staff lines, so the radius is considerably less + than half the distance between them. ??HOW MUCH LESS? WHERE SHOULD THESE REALLY BE SET, doc.h? */ +#define CIRCLE_RADIUS_FACTOR 0.32 +/* Set default vertical position as distance below the top of the staff of center of the circle */ +#define STAFFLINES_BELOW_TOP 1.5 + void View::DrawMensurCircle( DeviceContext *dc, int x, int yy, Staff *staff ) { assert( dc ); // DC cannot be NULL - int y = ToDeviceContextY (yy - m_doc->m_drawingDoubleUnit[ staff->staffSize ] * 2); + int y = ToDeviceContextY (yy - m_doc->m_drawingDoubleUnit[ staff->staffSize ] * STAFFLINES_BELOW_TOP); int r = ToDeviceContextX( m_doc->m_drawingDoubleUnit[ staff->staffSize ]); + r = (int)(CIRCLE_RADIUS_FACTOR*r); - dc->SetPen( m_currentColour, m_doc->m_style->m_staffLineWidth, AxSOLID ); + int lineWidth = (int)(m_doc->m_style->m_staffLineWidth * 0.5); + dc->SetPen( m_currentColour, lineWidth, AxSOLID ); dc->SetBrush( m_currentColour, AxTRANSPARENT ); dc->DrawCircle( ToDeviceContextX(x), y, r ); @@ -219,8 +233,9 @@ void View::DrawMensurHalfCircle( DeviceContext *dc, int x, int yy, Staff *staff dc->SetPen( m_currentColour, m_doc->m_style->m_staffLineWidth, AxSOLID ); dc->SetBrush( m_currentColour, AxTRANSPARENT ); - int y = ToDeviceContextY (yy - m_doc->m_drawingDoubleUnit[ staff->staffSize ]); + int y = ToDeviceContextY (yy - m_doc->m_drawingDoubleUnit[ staff->staffSize ] * STAFFLINES_BELOW_TOP); int r = ToDeviceContextX( m_doc->m_drawingDoubleUnit[ staff->staffSize ]); + r = (int)(CIRCLE_RADIUS_FACTOR*r); x = ToDeviceContextX (x); x -= 3*r/3; @@ -255,12 +270,15 @@ void View::DrawMensurReversedHalfCircle( DeviceContext *dc, int x, int yy, Staff return; } +/* Set size rel. to dist. between staff lines of mensural-notation dot, e.g., within mensuration signs */ +#define MENSUR_DOTSIZE 0.15 + void View::DrawMensurDot ( DeviceContext *dc, int x, int yy, Staff *staff ) { assert( dc ); // DC cannot be NULL - int y = ToDeviceContextY (yy - m_doc->m_drawingDoubleUnit[ staff->staffSize ] * 2); - int r = m_doc->m_drawingUnit[staff->staffSize] * 2 / 3; + int y = ToDeviceContextY (yy - m_doc->m_drawingDoubleUnit[ staff->staffSize ] * STAFFLINES_BELOW_TOP); + int r = m_doc->m_drawingUnit[staff->staffSize] * MENSUR_DOTSIZE; dc->SetPen( m_currentColour, 1, AxSOLID ); dc->SetBrush( m_currentColour, AxSOLID ); diff --git a/src/view_page.cpp b/src/view_page.cpp index 753be3504e3..d4878df157a 100644 --- a/src/view_page.cpp +++ b/src/view_page.cpp @@ -737,7 +737,10 @@ void View::DrawStaff( DeviceContext *dc, Staff *staff, Measure *measure, System } -void View::DrawStaffLines( DeviceContext *dc, Staff *staff, Measure *measure, System *system ) +/* Linewidth for staff lines in mensural notation, relative to the "normal" width of staff lines */ +#define MENSURAL_LINEWIDTH_FACTOR 0.5 + + void View::DrawStaffLines( DeviceContext *dc, Staff *staff, Measure *measure, System *system ) { assert( dc ); // DC cannot be NULL @@ -754,7 +757,9 @@ void View::DrawStaffLines( DeviceContext *dc, Staff *staff, Measure *measure, Sy x1 = measure->GetDrawingX(); x2 = x1 + measure->GetWidth(); // - m_doc->m_style->m_barlineWidth / 2; - dc->SetPen( m_currentColour, ToDeviceContextX( m_doc->m_style->m_staffLineWidth ), AxSOLID ); + //dc->SetPen( m_currentColour, ToDeviceContextX( m_doc->m_style->m_staffLineWidth ), AxSOLID ); + int lineWidth = (int)(m_doc->m_style->m_staffLineWidth * MENSURAL_LINEWIDTH_FACTOR); + dc->SetPen( m_currentColour, ToDeviceContextX( lineWidth ), AxSOLID ); dc->SetBrush( m_currentColour , AxSOLID ); for(j = 0;j < staff->m_drawingLines; j++) diff --git a/src/vrv.cpp b/src/vrv.cpp index 6a7119323b2..82264bd2e47 100644 --- a/src/vrv.cpp +++ b/src/vrv.cpp @@ -46,17 +46,18 @@ bool Resources::InitFonts() { // We will need to rethink this for adding the option to add custom fonts // Font Bravura first since it is expected to have always all symbols - if (!LoadFont("Bravura")) LogError("Bravura font could not be loaded"); + if (!LoadFont("Bravura")) LogError("Bravura font could not be loaded."); // The Leipzig as the default font - if (!LoadFont("Leipzig")) LogError("Leipzig font could not be loaded"); + if (!LoadFont("Leipzig")) LogError("Leipzig font could not be loaded."); if ( m_font.size() < SMUFL_COUNT ) { - LogError("All default SMUFL glyphs could not be loaded"); + LogError("Expected %d default SMUFL glyphs but could load only %d.", + SMUFL_COUNT, m_font.size()); return false; } if ( !InitTextFont() ) { - LogError("Text font could not be initialized"); + LogError("Text font could not be initialized."); return false; } diff --git a/tools/main.cpp b/tools/main.cpp index a58065b7f4e..9b22f164d77 100644 --- a/tools/main.cpp +++ b/tools/main.cpp @@ -296,13 +296,13 @@ int main(int argc, char** argv) // Make sure the user uses a valid Resource path // Save many headaches for empty SVGs if(!dir_exists(vrv::Resources::GetPath())) { - cerr << "The resources path " << vrv::Resources::GetPath() << " could not be found, please use -r option." << endl; + cerr << "The resources path " << vrv::Resources::GetPath() << " could not be found; please use -r option." << endl; exit(1); } // Loaded the music font from the resource diretory if (!Resources::InitFonts()) { - cerr << "The music font could not be loaded, please verify the content of the directory." << endl; + cerr << "The music font could not be loaded; please check the contents of the resource directory." << endl; exit(1); } @@ -313,7 +313,7 @@ int main(int argc, char** argv) } if (outformat != "svg" && outformat != "mei") { - cerr << "Output format can only be: mei svg" << endl; + cerr << "Output format can only be 'mei' or 'svg'." << endl; exit(1); } From 8fa23dc3d9a0bce377810b70d796c9b41f5162ec Mon Sep 17 00:00:00 2001 From: Don Byrd Date: Thu, 9 Jul 2015 11:32:07 -0400 Subject: [PATCH 006/114] Correct typo (in formatting only) --- src/view_page.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/view_page.cpp b/src/view_page.cpp index d4878df157a..6c503a7dec1 100644 --- a/src/view_page.cpp +++ b/src/view_page.cpp @@ -740,7 +740,7 @@ void View::DrawStaff( DeviceContext *dc, Staff *staff, Measure *measure, System /* Linewidth for staff lines in mensural notation, relative to the "normal" width of staff lines */ #define MENSURAL_LINEWIDTH_FACTOR 0.5 - void View::DrawStaffLines( DeviceContext *dc, Staff *staff, Measure *measure, System *system ) +void View::DrawStaffLines( DeviceContext *dc, Staff *staff, Measure *measure, System *system ) { assert( dc ); // DC cannot be NULL From 452df33df08a11822b54783ccc918b41f5e9a4b3 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Wed, 15 Jul 2015 09:15:48 +0200 Subject: [PATCH 007/114] Update license in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ea5638807ab..41a5b5b69f9 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Verovio can be used as a standalone command-line tool for converting a MEI files Verovio follows the [Standard Music Font Layout (SMuFL)](http://www.smufl.org) specification and the font can be changed for personalizing the output. -The project page is http://www.verovio.org. Verovio is available under the GPL license (see LICENSE.txt). +The project page is http://www.verovio.org. Verovio is available under the LGPL license (see LICENSE.txt). LibMEI ------ From bbf383dedafc7dc0c4a0e1b8e75e75623bf95370 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Wed, 15 Jul 2015 09:48:13 +0200 Subject: [PATCH 008/114] Hotfix for PAE import for bug in 0.9.8 --- src/iopae.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/iopae.cpp b/src/iopae.cpp index 9061ab3c655..696e8bfa09a 100644 --- a/src/iopae.cpp +++ b/src/iopae.cpp @@ -373,6 +373,7 @@ void PaeInput::parsePlainAndEasy(std::istream &infile) { StaffGrp *staffGrp = new StaffGrp(); StaffDef *staffDef = new StaffDef(); staffDef->SetN( 1 ); + staffDef->SetLines(5); if (staffDefClef) { ClefAttr clefAttr; clefAttr.SetClefShape(staffDefClef->GetShape()); From 48ccb59720cefacb36ba50ac615009b075e5203c Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Wed, 15 Jul 2015 13:22:57 +0200 Subject: [PATCH 009/114] Fixing bug with stem.dir in beam --- src/view_beam.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/view_beam.cpp b/src/view_beam.cpp index b88373ff85b..1519e91cafa 100644 --- a/src/view_beam.cpp +++ b/src/view_beam.cpp @@ -226,7 +226,7 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta avgY /= elementCount; // If we have one stem direction in the beam, then don't look at the layer - if (stemDir != STEMDIRECTION_NONE) stemDir = layer->GetDrawingStemDir(); // force layer direction if it exists + if (stemDir == STEMDIRECTION_NONE) stemDir = layer->GetDrawingStemDir(); // force layer direction if it exists // Automatic stem direction if nothing in the notes or in the layer if (stemDir == STEMDIRECTION_NONE) { From 0f84337ad16b17371bd30d04ba0a0622c3336832 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Wed, 15 Jul 2015 13:48:14 +0200 Subject: [PATCH 010/114] Skipping note child accid in spacing --- include/vrv/vrvdef.h | 3 +++ src/accid.cpp | 2 +- src/object.cpp | 11 ++++++----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/include/vrv/vrvdef.h b/include/vrv/vrvdef.h index e9bd7235570..73fbda4dc22 100644 --- a/include/vrv/vrvdef.h +++ b/include/vrv/vrvdef.h @@ -71,6 +71,9 @@ enum FunctorCode { /** All values set to -1 (no limit) since this has not major incidence **/ +/** Define the maximum levels between a note and its accids **/ +#define MAX_ACCID_DEPTH -1 + /** Define the maximum levels between a beam and its notes **/ #define MAX_BEAM_DEPTH -1 diff --git a/src/accid.cpp b/src/accid.cpp index bfd2d87ebe9..d7186d58e45 100644 --- a/src/accid.cpp +++ b/src/accid.cpp @@ -50,7 +50,7 @@ int Accid::PreparePointersByLayer( ArrayPtrVoid params ) // param 0: the current Note (not used) //Note **currentNote = static_cast(params[0]); - Note *note = dynamic_cast( this->GetFirstParent( &typeid(Note) ) ); + Note *note = dynamic_cast( this->GetFirstParent( &typeid(Note), MAX_ACCID_DEPTH ) ); if ( !note ) { return FUNCTOR_CONTINUE; } diff --git a/src/object.cpp b/src/object.cpp index 86477d69dfd..589bcf1dda0 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -1113,11 +1113,8 @@ int Object::SetBoundingBoxXShift( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } - if ( current->IsNote() ) { - Chord* chordParent = dynamic_cast(current->GetFirstParent( &typeid( Chord ), MAX_CHORD_DEPTH)); - if( chordParent ) { - return FUNCTOR_CONTINUE; - } + if ( current->IsNote() && dynamic_cast(current->GetFirstParent( &typeid( Chord ), MAX_CHORD_DEPTH ) ) ) { + return FUNCTOR_CONTINUE; } if ( current->IsTie() ) { @@ -1132,6 +1129,10 @@ int Object::SetBoundingBoxXShift( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } + if ( current->IsAccid() && dynamic_cast(current->GetFirstParent( &typeid( Note ), MAX_ACCID_DEPTH ) ) ) { + return FUNCTOR_CONTINUE; + } + // the negative offset it the part of the bounding box that overflows on the left // |____x_____| // ---- = negative offset From b824e43e4851d582b1a3e317d61da00390fa26a4 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Thu, 16 Jul 2015 07:52:26 +0200 Subject: [PATCH 011/114] Adjusting left margin for barline attributes --- include/vrv/object.h | 1 + src/doc.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/include/vrv/object.h b/include/vrv/object.h index f6b5ece89b5..df9e8d916dc 100644 --- a/include/vrv/object.h +++ b/include/vrv/object.h @@ -363,6 +363,7 @@ class Object /** * Align the measures by adjusting the m_drawingXRel position looking at the MeasureAligner. + * param 0: the cumulated shift */ virtual int AlignMeasures( ArrayPtrVoid params ) { return FUNCTOR_CONTINUE; }; diff --git a/src/doc.cpp b/src/doc.cpp index 43df030cdb2..5af303f6edb 100644 --- a/src/doc.cpp +++ b/src/doc.cpp @@ -397,6 +397,7 @@ short Doc::GetLeftMargin( const std::type_info *elementType ) { if (typeid(Barline) == *elementType) return 5; + if (typeid(BarlineAttr) == *elementType) return 25; else if (typeid(Chord) == *elementType) return 10; else if (typeid(Clef) == *elementType) return -20; else if (typeid(MRest) == *elementType) return 30; From d0a4c2cb206af13141e05cb3f5acda21996f783e Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Thu, 16 Jul 2015 23:23:14 +0200 Subject: [PATCH 012/114] WIP Improving lyric spacing and taking into account editorial accid (@func="edit") --- include/vrv/style.h | 5 +++++ src/aligner.cpp | 6 +++++- src/bboxdevicecontext.cpp | 3 ++- src/svgdevicecontext.cpp | 1 + src/view_element.cpp | 14 ++++++++++---- 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/include/vrv/style.h b/include/vrv/style.h index 1419f9c8e12..a3b730a3f66 100644 --- a/include/vrv/style.h +++ b/include/vrv/style.h @@ -81,6 +81,11 @@ namespace vrv { //---------------------------------------------------------------------------- // Style //---------------------------------------------------------------------------- + +#define TEMP_STYLE_ACCID_EDIT_SPACE 4.0 * PARAM_DENOMINATOR + +#define TEMP_STYLE_LYIRC_LINE_SPACE 5.0 * PARAM_DENOMINATOR + /** * This class contains the document default environment variables. diff --git a/src/aligner.cpp b/src/aligner.cpp index 81f9118efb7..4af8cfee782 100644 --- a/src/aligner.cpp +++ b/src/aligner.cpp @@ -15,6 +15,7 @@ //---------------------------------------------------------------------------- +#include "style.h" #include "vrv.h" namespace vrv { @@ -272,7 +273,10 @@ int StaffAlignment::SetAligmentYPos( ArrayPtrVoid params ) int **interlineSizes = static_cast(params[2]); // take into account the number of lyrics - m_yShift -= this->GetVerseCount() * 2 * (*interlineSizes[0]) + (*interlineSizes[0]); + if (this->GetVerseCount() > 0) { + // We need + 1 lyric line space + m_yShift -= (this->GetVerseCount() + 1) * TEMP_STYLE_LYIRC_LINE_SPACE * (*interlineSizes[0] / 2) / PARAM_DENOMINATOR; + } int min_shift = (*staffMargin) + (*previousStaffHeight); diff --git a/src/bboxdevicecontext.cpp b/src/bboxdevicecontext.cpp index efab3566dc1..9838ac1740f 100644 --- a/src/bboxdevicecontext.cpp +++ b/src/bboxdevicecontext.cpp @@ -311,11 +311,12 @@ void BBoxDeviceContext::DrawText(const std::string& text, const std::wstring wte int w, h; GetTextExtent(wtext, &w, &h); m_textWidth += w; + m_textHeight = std::max( m_textHeight, h ); // very approximative, we should use GetTextExtend once implemented //m_textWidth += length * m_fontStack.top()->GetPointSize() / 7; // ignore y bounding boxes for text //m_textHeight = m_fontStack.top()->GetPointSize(); - UpdateBB( m_textX, m_textY, m_textX + m_textWidth, m_textY + m_textHeight); + UpdateBB( m_textX, m_textY, m_textX + m_textWidth, m_textY - m_textHeight); } diff --git a/src/svgdevicecontext.cpp b/src/svgdevicecontext.cpp index 082292ec008..b86529338b5 100644 --- a/src/svgdevicecontext.cpp +++ b/src/svgdevicecontext.cpp @@ -457,6 +457,7 @@ void SvgDeviceContext::DrawRoundedRectangle(int x, int y, int width, int height, rectChild.append_attribute( "height" ) = height; rectChild.append_attribute( "rx" ) = radius; rectChild.append_attribute( "style") = StringFormat("stroke-width: %d;", m_penStack.top().GetWidth()).c_str(); + //rectChild.append_attribute( "fill-opacity" ) = "0.0"; // for empy rectangles } void SvgDeviceContext::StartText(int x, int y, char alignement) diff --git a/src/view_element.cpp b/src/view_element.cpp index 07f6cf8304c..50456d7dd74 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -374,7 +374,10 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St /************** Accidentals/dots/peripherals: **************/ if (note->m_drawingAccid) { - xAccid = xNote - 1.5 * m_doc->m_drawingAccidWidth[staffSize][note->m_cueSize]; + xAccid = xNote; + if (note->m_drawingAccid->GetFunc() != FUNC_edit) { + xAccid -= 1.5 * m_doc->m_drawingAccidWidth[staffSize][note->m_cueSize]; + } note->m_drawingAccid->SetDrawingX( xAccid ); note->m_drawingAccid->SetDrawingY( noteY ); @@ -1403,10 +1406,12 @@ void View::DrawAccid( DeviceContext *dc, LayerElement *element, Layer *layer, St // Parent will be NULL if we are drawing a note @accid (see DrawNote) - the y value is already set if ( accid->m_parent ) { - //accid->SetDrawingY( accid->GetDrawingY() + CalculatePitchPosY( staff, accid->GetPloc(), layer->GetClefOffset( accid ), accid->GetOloc()) ); + accid->SetDrawingY( accid->GetDrawingY() + CalculatePitchPosY( staff, accid->GetPloc(), layer->GetClefOffset( accid ), accid->GetOloc()) ); + } + if ( accid->GetFunc() == FUNC_edit ) { + accid->SetDrawingY( staff->GetDrawingY() + TEMP_STYLE_ACCID_EDIT_SPACE * m_doc->m_drawingUnit[staff->staffSize] / PARAM_DENOMINATOR ); } - // Get the offset int x = accid->GetDrawingX(); int y = accid->GetDrawingY(); @@ -1516,7 +1521,8 @@ int View::GetSylY( Syl *syl, Staff *staff ) int y = syl->GetStart()->GetDrawingY(); if (staff->GetAlignment() ) { - y = staff->GetDrawingY() + staff->GetAlignment()->GetMaxHeight() - syl->m_drawingVerse * m_doc->m_drawingUnit[staff->staffSize] * 4; + y = staff->GetDrawingY() + staff->GetAlignment()->GetMaxHeight() - + syl->m_drawingVerse * TEMP_STYLE_LYIRC_LINE_SPACE * m_doc->m_drawingUnit[staff->staffSize] / PARAM_DENOMINATOR; } return y; } From 46a62e83ac725a2a949c31b9336b52454b1159e7 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Thu, 16 Jul 2015 23:54:48 +0200 Subject: [PATCH 013/114] Code consistency --- src/doc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc.cpp b/src/doc.cpp index 5af303f6edb..16be20ba261 100644 --- a/src/doc.cpp +++ b/src/doc.cpp @@ -397,7 +397,7 @@ short Doc::GetLeftMargin( const std::type_info *elementType ) { if (typeid(Barline) == *elementType) return 5; - if (typeid(BarlineAttr) == *elementType) return 25; + else if (typeid(BarlineAttr) == *elementType) return 25; else if (typeid(Chord) == *elementType) return 10; else if (typeid(Clef) == *elementType) return -20; else if (typeid(MRest) == *elementType) return 30; From ce68e57107c00dbb711901bfd04966e3bdb0f13c Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Thu, 16 Jul 2015 23:55:51 +0200 Subject: [PATCH 014/114] Fixing bug in tuplet flat list filtering --- src/tuplet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tuplet.cpp b/src/tuplet.cpp index 212353308eb..fa08b587674 100644 --- a/src/tuplet.cpp +++ b/src/tuplet.cpp @@ -49,7 +49,7 @@ void Tuplet::FilterList( ListOfObjects *childList ) while ( iter != childList->end()) { LayerElement *currentElement = dynamic_cast(*iter); - if ( currentElement && !currentElement->HasDurationInterface() ) + if ( !currentElement || !currentElement->HasDurationInterface() ) { iter = childList->erase( iter ); } else { From b6aae1ac16cf49b258b20c4684598dd9d45f5d77 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Fri, 17 Jul 2015 09:49:52 +0200 Subject: [PATCH 015/114] Fixing stem bug with whole note chords --- src/view_element.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/view_element.cpp b/src/view_element.cpp index 50456d7dd74..0e2376423af 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -903,7 +903,7 @@ void View::DrawChord( DeviceContext *dc, LayerElement *element, Layer *layer, St int drawingDur = chord->GetDur(); //(unless we're in a beam) - if (!(inBeam && drawingDur > DUR_4)) { + if (!inBeam && (drawingDur > DUR_1)) { int yMax, yMin; chord->GetYExtremes(&yMax, &yMin); From 9b6f5ca752e316f85141057b8f77853ef30b9b3c Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sat, 18 Jul 2015 14:40:42 -0400 Subject: [PATCH 016/114] Support for editorial accid (above only) --- include/vrv/style.h | 4 +++- src/view_beam.cpp | 26 +++++++++++++++++--------- src/view_element.cpp | 24 ++++++++++++++++++++++-- 3 files changed, 42 insertions(+), 12 deletions(-) diff --git a/include/vrv/style.h b/include/vrv/style.h index a3b730a3f66..8765791f661 100644 --- a/include/vrv/style.h +++ b/include/vrv/style.h @@ -82,8 +82,10 @@ namespace vrv { // Style //---------------------------------------------------------------------------- -#define TEMP_STYLE_ACCID_EDIT_SPACE 4.0 * PARAM_DENOMINATOR +// the space between the staff and an editorial accid in units +#define TEMP_STYLE_ACCID_EDIT_SPACE 3.5 * PARAM_DENOMINATOR +// the space between each lyric line in units #define TEMP_STYLE_LYIRC_LINE_SPACE 5.0 * PARAM_DENOMINATOR diff --git a/src/view_beam.cpp b/src/view_beam.cpp index 1519e91cafa..84936c665c0 100644 --- a/src/view_beam.cpp +++ b/src/view_beam.cpp @@ -319,16 +319,14 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta /* pente correcte: entre 0 et env 0.4 (0.2 a 0.4) */ startingY = (s_y - beamSlope * s_x) / elementCount; - + /******************************************************************/ // Start the Beam graphic and draw the children dc->StartGraphic( element, "", element->GetUuid() ); - - DrawLayerChildren(dc, beam, layer, staff, measure); /******************************************************************/ - // Calculate the stem lengths and draw them + // Calculate the stem lengths double oldYPos; //holds y position before calculation to determine if beam needs extra height double expectedY; @@ -363,14 +361,24 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta el->m_drawingStemStart.y = fy2; el->m_drawingStemEnd.y = fy1; el->m_drawingStemDir = stemDir; - - if((el->IsNote() && ! dynamic_cast(el)->IsChordTone()) || el->IsChord()){ - DrawVerticalLine (dc,fy2, fy1, (*beamElementCoords)[i]->m_x, m_doc->m_style->m_stemWidth); - } } + + + /******************************************************************/ + // Draw the children + + DrawLayerChildren(dc, beam, layer, staff, measure); /******************************************************************/ - // Draw the beam full bars + // Draw the stems and the beam full bars + + for (i=0; im_element; + if((el->IsNote() && !dynamic_cast(el)->IsChordTone()) || el->IsChord()) { + DrawVerticalLine (dc, el->m_drawingStemStart.y, el->m_drawingStemEnd.y, el->m_drawingStemStart.x, m_doc->m_style->m_stemWidth); + } + } // Number of bars to draw - if we do not have changing values, draw // the number of bars according to the shortestDur value. Otherwise draw diff --git a/src/view_element.cpp b/src/view_element.cpp index 0e2376423af..af735680c78 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -902,7 +902,7 @@ void View::DrawChord( DeviceContext *dc, LayerElement *element, Layer *layer, St int drawingDur = chord->GetDur(); - //(unless we're in a beam) + //(unless we're in a beam or whole notes) if (!inBeam && (drawingDur > DUR_1)) { int yMax, yMin; chord->GetYExtremes(&yMax, &yMin); @@ -1408,8 +1408,28 @@ void View::DrawAccid( DeviceContext *dc, LayerElement *element, Layer *layer, St if ( accid->m_parent ) { accid->SetDrawingY( accid->GetDrawingY() + CalculatePitchPosY( staff, accid->GetPloc(), layer->GetClefOffset( accid ), accid->GetOloc()) ); } + + /************** editorial accidental **************/ + if ( accid->GetFunc() == FUNC_edit ) { - accid->SetDrawingY( staff->GetDrawingY() + TEMP_STYLE_ACCID_EDIT_SPACE * m_doc->m_drawingUnit[staff->staffSize] / PARAM_DENOMINATOR ); + // position is currently only above the staff + int y = staff->GetDrawingY(); + // look at the note position and adjust it if necessary + Note *note = dynamic_cast( accid->GetFirstParent( &typeid(Note), MAX_ACCID_DEPTH ) ); + if ( note ) { + if ( note->GetDrawingY() > y ) { + y = note->GetDrawingY() + m_doc->m_drawingUnit[staff->staffSize]; + } + if ( (note->m_drawingStemDir == STEMDIRECTION_up) && (note->m_drawingStemEnd.y > y )) { + y = note->m_drawingStemEnd.y; + } + + // adjust the x position so it is centered + int radius = m_doc->m_drawingNoteRadius[staff->staffSize][note->m_cueSize]; + if ( note->GetActualDur() < DUR_2 ) radius += radius/3; + accid->SetDrawingX( accid->GetDrawingX() + radius / 2 ); + } + accid->SetDrawingY( y + TEMP_STYLE_ACCID_EDIT_SPACE * m_doc->m_drawingUnit[staff->staffSize] / PARAM_DENOMINATOR ); } int x = accid->GetDrawingX(); From f5893d5424a490aa3ef99dea83d20cabda53d14b Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sun, 19 Jul 2015 17:54:50 -0400 Subject: [PATCH 017/114] Adding comment --- src/view_beam.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/view_beam.cpp b/src/view_beam.cpp index 84936c665c0..2ae019decb5 100644 --- a/src/view_beam.cpp +++ b/src/view_beam.cpp @@ -356,6 +356,7 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta fy2 = (*beamElementCoords)[i]->m_yTop - m_doc->m_drawingUnit[staff->staffSize]/4; } + // All notes and chords, including notes within chords, get their stem value stored LayerElement *el = (*beamElementCoords)[i]->m_element; el->m_drawingStemStart.x = el->m_drawingStemEnd.x = (*beamElementCoords)[i]->m_x; el->m_drawingStemStart.y = fy2; From f2d1fc591a6b9d53990897e6427a3c4ef683e8b3 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Mon, 20 Jul 2015 07:16:58 -0400 Subject: [PATCH 018/114] Adding "-dev" in version number for non release builds --- include/vrv/vrvdef.h | 4 +++- src/vrv.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/vrv/vrvdef.h b/include/vrv/vrvdef.h index 73fbda4dc22..f84f3577163 100644 --- a/include/vrv/vrvdef.h +++ b/include/vrv/vrvdef.h @@ -49,7 +49,9 @@ typedef std::map > MapOfLedgerLineFlags; #define VERSION_MAJOR 0 #define VERSION_MINOR 9 -#define VERSION_REVISION 8 +#define VERSION_REVISION 9 +// Adds "-dev" in the version number - should be set to false for releases +#define VERSION_DEV true #define is_in(x,a,b) (((x) >= std::min((a),(b))) && ((x) <= std::max((a),(b)))) diff --git a/src/vrv.cpp b/src/vrv.cpp index 6a7119323b2..935166ef375 100644 --- a/src/vrv.cpp +++ b/src/vrv.cpp @@ -466,7 +466,9 @@ std::string GetFilename( std::string fullpath ) } std::string GetVersion() { - return StringFormat("%d.%d.%d-%s", VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION, GIT_COMMIT ); + std::string dev; + if (VERSION_DEV) dev = "-dev"; + return StringFormat("%d.%d.%d%s-%s", VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION, dev.c_str(), GIT_COMMIT ); } } // namespace vrv \ No newline at end of file From cc49c9a20cc3cf8b3195ed2ac90230cf33dedc0e Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Mon, 20 Jul 2015 16:31:17 -0400 Subject: [PATCH 019/114] Adding option for disabling Plain and Easy import --- include/vrv/iopae.h | 7 +++++-- python/setup.py | 2 +- src/iopae.cpp | 24 +++++++++++++++++------- tools/CMakeLists.txt | 6 ++++++ 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/include/vrv/iopae.h b/include/vrv/iopae.h index ad03bb993ff..2445cf88c83 100644 --- a/include/vrv/iopae.h +++ b/include/vrv/iopae.h @@ -226,7 +226,9 @@ class PaeInput: public FileInputStream virtual bool ImportFile( ); virtual bool ImportString(std::string pae); - + +#ifndef NO_PAE_SUPPORT + private: // function declarations: @@ -260,7 +262,8 @@ class PaeInput: public FileInputStream // input functions void getAtRecordKeyValue (char *key, char* value, const char* input); - + +#endif // NO_PAE_SUPPORT public: diff --git a/python/setup.py b/python/setup.py index 9e1f708dccc..c66935bc315 100755 --- a/python/setup.py +++ b/python/setup.py @@ -82,7 +82,7 @@ extra_compile_args=['-Wno-write-strings', '-Wno-overloaded-virtual', '-Wno-unused-private-field']) setup (name = 'verovio', - version = '0.9.4', + version = '0.9.9', url = "www.verovio.org", description = """A library and toolkit for engraving MEI music notation into SVG""", ext_modules = [verovio_module], diff --git a/src/iopae.cpp b/src/iopae.cpp index 696e8bfa09a..807057d305b 100644 --- a/src/iopae.cpp +++ b/src/iopae.cpp @@ -32,8 +32,9 @@ //---------------------------------------------------------------------------- - +#ifndef NO_PAE_SUPPORT #include +#endif namespace vrv { @@ -83,24 +84,31 @@ PaeInput::~PaeInput() bool PaeInput::ImportFile() { - +#ifndef NO_PAE_SUPPORT std::ifstream infile; infile.open(m_filename.c_str()); - parsePlainAndEasy(infile); - return true; +#else + LogError("Plain and Easy import is not supported in the build."); + return false; +#endif } bool PaeInput::ImportString(std::string pae) { - +#ifndef NO_PAE_SUPPORT std::istringstream in_stream(pae); - parsePlainAndEasy(in_stream); - return true; +#else + LogError("Plain and Easy import is not support in the build."); + return false; +#endif + } + +#ifndef NO_PAE_SUPPORT ////////////////////////////// // @@ -1325,4 +1333,6 @@ void PaeInput::getAtRecordKeyValue(char *key, char* value, } } +#endif // NO_PAE_SUPPORT + } // namespace vrv diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index de818eade60..f889b42202a 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -4,12 +4,18 @@ project(Verovio) SET(CMAKE_BUILD_TYPE Release) +option(NO_PAE_SUPPORT "Disable Plain and Easy support" OFF) + add_definitions(-g) EXEC_PROGRAM(../tools/get_git_commit.sh ARGS OUTPUT_VARIABLE GIT_COMMIT) include_directories(/usr/local/include ../include ../include/vrv ../libmei) +if(NO_PAE_SUPPORT) + add_definitions(-DNO_PAE_SUPPORT) +endif() + add_executable (verovio main.cpp ../src/accid.cpp From 3ca12d754daf6b0286781bcecd98ba35e9c58d87 Mon Sep 17 00:00:00 2001 From: Don Byrd Date: Tue, 21 Jul 2015 03:07:10 -0400 Subject: [PATCH 020/114] Modularize the "ideal space" code in Aligner: pull it out of SetAligmentXPos() to make a new function, IdealHorizSpace . --- include/vrv/aligner.h | 3 +++ src/aligner.cpp | 28 ++++++++++++++++++---------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/include/vrv/aligner.h b/include/vrv/aligner.h index 7a6013dbb1e..0cd98562794 100644 --- a/include/vrv/aligner.h +++ b/include/vrv/aligner.h @@ -201,6 +201,9 @@ class Alignment: public Object */ virtual int IntegrateBoundingBoxXShift( ArrayPtrVoid params ); + + virtual int IdealHorizSpace(double intervalTime, bool isMensural); + /** * Set the position of the Alignment. * Looks at the time different with the previous Alignment. diff --git a/src/aligner.cpp b/src/aligner.cpp index f004ff52028..b56ed5239cf 100644 --- a/src/aligner.cpp +++ b/src/aligner.cpp @@ -359,6 +359,23 @@ int MeasureAligner::SetAligmentXPos( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } + +/* Compute "ideal" horizontal space to allow for a given time interval. For modern +notation (CMN), this is a function of the interval; for short intervals, it may not +be enough to keep consecutive symbols from overlapping. For mensural notation, ideal +spacing is as tight as possible without overlapping and with just a bit of space +between symbols. */ +int Alignment::IdealHorizSpace(double intervalTime, bool isMensural) +{ + int intervalXRel = 0; + if (isMensural) + intervalXRel = 20; // ??EXPERIMENTAL! A very small value => space as tightly as possible + else + intervalXRel = pow( intervalTime, 0.60 ) * 2.5; // 2.5 is an arbitrary value; so is 0.60 + return intervalXRel; +} + + int Alignment::SetAligmentXPos( ArrayPtrVoid params ) { // param 0: the previous time position @@ -371,16 +388,7 @@ int Alignment::SetAligmentXPos( ArrayPtrVoid params ) int intervalXRel = 0; double intervalTime = (m_time - (*previousTime)); - if ( intervalTime > 0.0 ) { - // Compute "ideal" horizontal space to allow. For modern notation (CMN), - // this is a function of time (duration); we may increase it later to - // keep symbols from overlapping. For mensural notation, ideal spacing is - // as tight as possible without overlapping. - if (true) // ??TEMPORARY! - intervalXRel = pow( intervalTime, 0.60 ) * 2.5; // 2.5 is an arbitrary value - else - intervalXRel = 20; // ??EXPERIMENTAL! A very small value => space as tightly as possible - } + if ( intervalTime > 0.0 ) intervalXRel = IdealHorizSpace(intervalTime, true); // ??2ND PARAM = IS MENSURAL! m_xRel = (*previousXRel) + (intervalXRel) * DEFINITON_FACTOR; (*previousTime) = m_time; From 1ec5f7d4da3f83d333b7ad0d5e60b686321eaf78 Mon Sep 17 00:00:00 2001 From: Don Byrd Date: Tue, 21 Jul 2015 03:10:16 -0400 Subject: [PATCH 021/114] Take advantage of our new mensural notehead glyphs => white-notation semibreves work! (Or are they colored black-notation semibreves? Hmmm...) --- src/view_mensural.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/view_mensural.cpp b/src/view_mensural.cpp index 6e6ccc8eada..644f74e9e71 100644 --- a/src/view_mensural.cpp +++ b/src/view_mensural.cpp @@ -23,14 +23,7 @@ #include "staff.h" #include "style.h" -namespace vrv { - - enum { - SMUFL_E938_mensNoteheadSemibrevisBlack, - SMUFL_E939_mensNoteheadSemibrevisVoid, - SMUFL_E93C_mensNoteheadMinimaWhite, - SMUFL_E93D_mensNoteheadSemiminimaWhite // for fusa as well as semiminima - }; +namespace vrv { int View::s_drawingLigX[2], View::s_drawingLigY[2]; // pour garder coord. des ligatures bool View::s_drawingLigObliqua = false; // marque le 1e passage pour une oblique @@ -98,9 +91,9 @@ void View::DrawMensuralNote ( DeviceContext *dc, LayerElement *element, Layer *l // Whole notes ??WE WANT SEMIBREVIS'ES, NOT WHOLE NOTES!!! CHANGE THIS, AND SIMILARLY FOR SHORTER DURATIONS!!!!!!!! else if (drawingDur == DUR_1) { if (note->GetColored()==BOOLEAN_true) - fontNo = SMUFL_E938_mensNoteheadSemibrevisBlack; + fontNo = SMUFL_E938_mensuralNoteheadSemibrevisBlack; else - fontNo = SMUFL_E939_mensNoteheadSemibrevisVoid; + fontNo = SMUFL_E939_mensuralNoteheadSemibrevisVoid; DrawSmuflCode( dc, xNote, noteY, fontNo, staff->staffSize, note->m_cueSize ); } @@ -203,7 +196,7 @@ void View::DrawMensur( DeviceContext *dc, LayerElement *element, Layer *layer, S } /* The entire mensuration sign fits easily between two staff lines, so the radius is considerably less - than half the distance between them. ??HOW MUCH LESS? WHERE SHOULD THESE REALLY BE SET, doc.h? */ + than half the distance between them. ??HOW MUCH LESS? THESE PROBABLY BELONG IN style.h . */ #define CIRCLE_RADIUS_FACTOR 0.32 /* Set default vertical position as distance below the top of the staff of center of the circle */ #define STAFFLINES_BELOW_TOP 1.5 From 310265418e21c8bfa4328ffe900f65cce73a4d19 Mon Sep 17 00:00:00 2001 From: Don Byrd Date: Tue, 21 Jul 2015 03:12:44 -0400 Subject: [PATCH 022/114] Fix typo & punctuation error in "Usage". --- tools/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/main.cpp b/tools/main.cpp index 9b22f164d77..b6764ebc1f7 100644 --- a/tools/main.cpp +++ b/tools/main.cpp @@ -86,7 +86,7 @@ void display_usage() { cerr << " -o, --outfile=FILE_NAME Output file name (use \"-\" for standard output)" << endl; - cerr << " -r, --recources=PATH Path to SVG resources (default is " << vrv::Resources::GetPath() << ")" << endl; + cerr << " -r, --resources=PATH Path to SVG resources (default is " << vrv::Resources::GetPath() << ")" << endl; cerr << " -s, --scale=FACTOR Scale percent (default is " << DEFAULT_SCALE << ")" << endl; @@ -101,7 +101,7 @@ void display_usage() { cerr << " --all-pages Output all pages with one output file per page" << endl; - cerr << " --font=FONT Select the music font to use (default is Leipzig, Bravura and Gootville are also available)" << endl; + cerr << " --font=FONT Select the music font to use (default is Leipzig; Bravura and Gootville are also available)" << endl; cerr << " --help Display this message" << endl; From 5982cc6232b63068cbd7192ca4dce48dcc15044c Mon Sep 17 00:00:00 2001 From: Don Byrd Date: Tue, 21 Jul 2015 03:14:09 -0400 Subject: [PATCH 023/114] I didn't change this, Xcode did, and I don't know why :-) . --- Verovio.xcodeproj/project.pbxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Verovio.xcodeproj/project.pbxproj b/Verovio.xcodeproj/project.pbxproj index 648ec27a7a0..14d442cd05b 100644 --- a/Verovio.xcodeproj/project.pbxproj +++ b/Verovio.xcodeproj/project.pbxproj @@ -201,7 +201,7 @@ 1579B3421B15033100B16F5C /* proport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = proport.cpp; path = src/proport.cpp; sourceTree = ""; }; 2D2A79991A69812C000A441B /* chord.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = chord.cpp; path = src/chord.cpp; sourceTree = ""; }; 2D2A799B1A698137000A441B /* chord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = chord.h; path = include/vrv/chord.h; sourceTree = ""; }; - 4D1D733B1A1D0390001E08F6 /* smufl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = smufl.h; path = include/vrv/smufl.h; sourceTree = ""; }; + 4D1D733B1A1D0390001E08F6 /* smufl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = smufl.h; path = include/vrv/smufl.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 4D1D733D1A1D08CD001E08F6 /* glyph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glyph.h; path = include/vrv/glyph.h; sourceTree = ""; }; 4D1D733F1A1D08DC001E08F6 /* glyph.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = glyph.cpp; path = src/glyph.cpp; sourceTree = ""; }; 4D22C41818890E6100D0831F /* mrest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mrest.cpp; path = src/mrest.cpp; sourceTree = ""; }; From 9f9f1a091a829e9412f3d21507a04d04d54d3fa8 Mon Sep 17 00:00:00 2001 From: Don Byrd Date: Tue, 21 Jul 2015 03:35:10 -0400 Subject: [PATCH 024/114] Rename _IdealHorizSpace_ to _HorizontalSpaceForDuration_. --- include/vrv/aligner.h | 2 +- src/aligner.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/vrv/aligner.h b/include/vrv/aligner.h index 0cd98562794..74667812eb5 100644 --- a/include/vrv/aligner.h +++ b/include/vrv/aligner.h @@ -202,7 +202,7 @@ class Alignment: public Object virtual int IntegrateBoundingBoxXShift( ArrayPtrVoid params ); - virtual int IdealHorizSpace(double intervalTime, bool isMensural); + virtual int HorizontalSpaceForDuration(double intervalTime, bool isMensural); /** * Set the position of the Alignment. diff --git a/src/aligner.cpp b/src/aligner.cpp index b56ed5239cf..51dd1d3a122 100644 --- a/src/aligner.cpp +++ b/src/aligner.cpp @@ -365,7 +365,7 @@ notation (CMN), this is a function of the interval; for short intervals, it may be enough to keep consecutive symbols from overlapping. For mensural notation, ideal spacing is as tight as possible without overlapping and with just a bit of space between symbols. */ -int Alignment::IdealHorizSpace(double intervalTime, bool isMensural) +int Alignment::HorizontalSpaceForDuration(double intervalTime, bool isMensural) { int intervalXRel = 0; if (isMensural) @@ -388,7 +388,7 @@ int Alignment::SetAligmentXPos( ArrayPtrVoid params ) int intervalXRel = 0; double intervalTime = (m_time - (*previousTime)); - if ( intervalTime > 0.0 ) intervalXRel = IdealHorizSpace(intervalTime, true); // ??2ND PARAM = IS MENSURAL! + if ( intervalTime > 0.0 ) intervalXRel = HorizontalSpaceForDuration(intervalTime, true); // ??2ND PARAM = IS MENSURAL! m_xRel = (*previousXRel) + (intervalXRel) * DEFINITON_FACTOR; (*previousTime) = m_time; From 75a7ea6d8ee66de821c3918058a9f2198a19247b Mon Sep 17 00:00:00 2001 From: Don Byrd Date: Tue, 21 Jul 2015 05:26:36 -0400 Subject: [PATCH 025/114] Replace needlessly complex coding for testing Boolean variables, e.g.: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit if (note->GetColored()==BOOLEAN_true) … with if (note->GetColored()) ... --- src/view_mensural.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/view_mensural.cpp b/src/view_mensural.cpp index 644f74e9e71..15eea561de1 100644 --- a/src/view_mensural.cpp +++ b/src/view_mensural.cpp @@ -88,18 +88,17 @@ void View::DrawMensuralNote ( DeviceContext *dc, LayerElement *element, Layer *l else if (drawingDur < DUR_1) { DrawMaximaToBrevis( dc, noteY, element, layer, staff); } - // Whole notes ??WE WANT SEMIBREVIS'ES, NOT WHOLE NOTES!!! CHANGE THIS, AND SIMILARLY FOR SHORTER DURATIONS!!!!!!!! else if (drawingDur == DUR_1) { - if (note->GetColored()==BOOLEAN_true) + if (note->GetColored()) fontNo = SMUFL_E938_mensuralNoteheadSemibrevisBlack; else fontNo = SMUFL_E939_mensuralNoteheadSemibrevisVoid; DrawSmuflCode( dc, xNote, noteY, fontNo, staff->staffSize, note->m_cueSize ); } - // Other values - else { - if (note->GetColored()==BOOLEAN_true) { + // Other values ??WE WANT MENSURAL NOTEHEADS, NOT CMN!!!!!!!! + else { + if (note->GetColored()) { if (drawingDur == DUR_2) fontNo = SMUFL_E0A4_noteheadBlack; else fontNo = SMUFL_E0A3_noteheadHalf; } @@ -455,7 +454,7 @@ void View::DrawLigature ( DeviceContext *dc, int y, LayerElement *element, Layer yy2 = y2; y5 = y1+ m_doc->m_drawingDoubleUnit[staff->staffSize]; y2 += m_doc->m_drawingDoubleUnit[staff->staffSize]; // on monte d'un INTERL - if (note->GetColored()==BOOLEAN_true) + if (note->GetColored()) DrawObliquePolygon ( dc, x1, y1, x2, yy2, m_doc->m_drawingDoubleUnit[staff->staffSize]); else { DrawObliquePolygon ( dc, x1, y1, x2, yy2, 5); From a44d87aa8687b7682db200a5f1f3bfdb4f023959 Mon Sep 17 00:00:00 2001 From: Don Byrd Date: Tue, 21 Jul 2015 06:00:12 -0400 Subject: [PATCH 026/114] Further clean up code for #defines for mensural notation style: rename, re-arrange, & clarify comments. --- src/view_mensural.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/view_mensural.cpp b/src/view_mensural.cpp index 15eea561de1..90678f5d224 100644 --- a/src/view_mensural.cpp +++ b/src/view_mensural.cpp @@ -194,19 +194,23 @@ void View::DrawMensur( DeviceContext *dc, LayerElement *element, Layer *layer, S } -/* The entire mensuration sign fits easily between two staff lines, so the radius is considerably less - than half the distance between them. ??HOW MUCH LESS? THESE PROBABLY BELONG IN style.h . */ -#define CIRCLE_RADIUS_FACTOR 0.32 -/* Set default vertical position as distance below the top of the staff of center of the circle */ -#define STAFFLINES_BELOW_TOP 1.5 +/* Set size of mensuration sign circle relative to space between staff lines. The entire mensuration sign fits easily between two staff lines, so the radius is considerably less than half the distance between them. + ??THESE #defines PROBABLY BELONG IN style.h . */ +#define MCIRCLE_RADIUS_FACTOR 0.32 +/* Set default vertical position of mensuration sign circle as distance below the top of the staff for center + of the circle */ +#define MCIRCLE_STAFFLINES_BELOW_TOP 1.5 +/* Set size rel. to dist. between staff lines of mensural-notation dot, e.g., within mensuration signs */ +#define MENSUR_DOTSIZE 0.15 + void View::DrawMensurCircle( DeviceContext *dc, int x, int yy, Staff *staff ) { assert( dc ); // DC cannot be NULL - int y = ToDeviceContextY (yy - m_doc->m_drawingDoubleUnit[ staff->staffSize ] * STAFFLINES_BELOW_TOP); + int y = ToDeviceContextY (yy - m_doc->m_drawingDoubleUnit[ staff->staffSize ] * MCIRCLE_STAFFLINES_BELOW_TOP); int r = ToDeviceContextX( m_doc->m_drawingDoubleUnit[ staff->staffSize ]); - r = (int)(CIRCLE_RADIUS_FACTOR*r); + r = (int)(MCIRCLE_RADIUS_FACTOR*r); int lineWidth = (int)(m_doc->m_style->m_staffLineWidth * 0.5); dc->SetPen( m_currentColour, lineWidth, AxSOLID ); @@ -225,9 +229,9 @@ void View::DrawMensurHalfCircle( DeviceContext *dc, int x, int yy, Staff *staff dc->SetPen( m_currentColour, m_doc->m_style->m_staffLineWidth, AxSOLID ); dc->SetBrush( m_currentColour, AxTRANSPARENT ); - int y = ToDeviceContextY (yy - m_doc->m_drawingDoubleUnit[ staff->staffSize ] * STAFFLINES_BELOW_TOP); + int y = ToDeviceContextY (yy - m_doc->m_drawingDoubleUnit[ staff->staffSize ] * MCIRCLE_STAFFLINES_BELOW_TOP); int r = ToDeviceContextX( m_doc->m_drawingDoubleUnit[ staff->staffSize ]); - r = (int)(CIRCLE_RADIUS_FACTOR*r); + r = (int)(MCIRCLE_RADIUS_FACTOR*r); x = ToDeviceContextX (x); x -= 3*r/3; @@ -262,14 +266,11 @@ void View::DrawMensurReversedHalfCircle( DeviceContext *dc, int x, int yy, Staff return; } -/* Set size rel. to dist. between staff lines of mensural-notation dot, e.g., within mensuration signs */ -#define MENSUR_DOTSIZE 0.15 - void View::DrawMensurDot ( DeviceContext *dc, int x, int yy, Staff *staff ) { assert( dc ); // DC cannot be NULL - int y = ToDeviceContextY (yy - m_doc->m_drawingDoubleUnit[ staff->staffSize ] * STAFFLINES_BELOW_TOP); + int y = ToDeviceContextY (yy - m_doc->m_drawingDoubleUnit[ staff->staffSize ] * MCIRCLE_STAFFLINES_BELOW_TOP); int r = m_doc->m_drawingUnit[staff->staffSize] * MENSUR_DOTSIZE; dc->SetPen( m_currentColour, 1, AxSOLID ); From cc585e7ed80a78bd0368e76b4164e98e7924aa5e Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Tue, 21 Jul 2015 07:39:33 -0400 Subject: [PATCH 027/114] Adding method for setting the resource path from the toolkit --- include/vrv/toolkit.h | 6 ++++++ include/vrv/vrv.h | 1 + src/toolkit.cpp | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/include/vrv/toolkit.h b/include/vrv/toolkit.h index 30632e45d1c..278d9f27e5c 100644 --- a/include/vrv/toolkit.h +++ b/include/vrv/toolkit.h @@ -46,6 +46,12 @@ class Toolkit Toolkit( bool initFont = true ); virtual ~Toolkit(); ///@} + + /** + * Set the resource path. To be called if the constructor had initFont=false. + * This needs refactoring. + */ + bool SetResourcePath( const std::string &path ); /** * Load a file with the specified type. diff --git a/include/vrv/vrv.h b/include/vrv/vrv.h index 63dbf98046e..60223f1741e 100644 --- a/include/vrv/vrv.h +++ b/include/vrv/vrv.h @@ -11,6 +11,7 @@ #include #include +#include #include #include #include diff --git a/src/toolkit.cpp b/src/toolkit.cpp index edfcff37c09..4ba66c13ff1 100644 --- a/src/toolkit.cpp +++ b/src/toolkit.cpp @@ -68,6 +68,12 @@ Toolkit::~Toolkit() free( m_cString ); } } + +bool Toolkit::SetResourcePath( const std::string &path ) +{ + Resources::SetPath( path ); + return Resources::InitFonts(); +}; bool Toolkit::SetBorder( int border ) { From 885db280674a2470f88030efd29af3d2a9be81fa Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Wed, 22 Jul 2015 17:05:59 -0400 Subject: [PATCH 028/114] Reverting commit 75a7ea6d8ee66de821c3918058a9f2198a19247b --- src/view_mensural.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/view_mensural.cpp b/src/view_mensural.cpp index c49f963b232..8ecb29a8174 100644 --- a/src/view_mensural.cpp +++ b/src/view_mensural.cpp @@ -88,12 +88,12 @@ void View::DrawMensuralNote ( DeviceContext *dc, LayerElement *element, Layer *l else if (drawingDur < DUR_1) { DrawMaximaToBrevis( dc, noteY, element, layer, staff); } - // Whole notes + // Whole notes ??WE WANT SEMIBREVIS'ES, NOT WHOLE NOTES!!! CHANGE THIS, AND SIMILARLY FOR SHORTER DURATIONS!!!!!!!! else if (drawingDur == DUR_1) { if (note->GetColored()==BOOLEAN_true) - fontNo = SMUFL_E0FA_noteheadWholeFilled; + fontNo = SMUFL_E938_mensuralNoteheadSemibrevisBlack; else - fontNo = SMUFL_E0A2_noteheadWhole; + fontNo = SMUFL_E939_mensuralNoteheadSemibrevisVoid; DrawSmuflCode( dc, xNote, noteY, fontNo, staff->staffSize, note->m_cueSize ); } From 350bed1cba75f9107097dc802cad5b11c03a7822 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sat, 25 Jul 2015 01:19:51 +0100 Subject: [PATCH 029/114] Adding att. placement support in libmei with data_STAFFREL --- include/vrv/att.h | 3 ++ include/vrv/attdef.h | 10 ++++ include/vrv/textdirective.h | 48 +++++++++++++++++++ include/vrv/textdirinterface.h | 85 ++++++++++++++++++++++++++++++++++ libmei/atts_shared.cpp | 12 ++--- libmei/atts_shared.h | 6 +-- src/att.cpp | 29 ++++++++++++ src/textdirective.cpp | 43 +++++++++++++++++ src/textdirinterface.cpp | 63 +++++++++++++++++++++++++ 9 files changed, 290 insertions(+), 9 deletions(-) create mode 100644 include/vrv/textdirective.h create mode 100644 include/vrv/textdirinterface.h create mode 100644 src/textdirective.cpp create mode 100644 src/textdirinterface.cpp diff --git a/include/vrv/att.h b/include/vrv/att.h index 20eb7b37adc..94bcc2ff30e 100644 --- a/include/vrv/att.h +++ b/include/vrv/att.h @@ -170,6 +170,9 @@ class Att std::string ProlatioToStr(data_PROLATIO data); data_PROLATIO StrToProlatio(std::string value); + + std::string StaffRelToStr(data_STAFFREL data); + data_STAFFREL StrToStaffRel(std::string value); std::string StemDirectionToStr(data_STEMDIRECTION data); data_STEMDIRECTION StrToStemDirection(std::string value); diff --git a/include/vrv/attdef.h b/include/vrv/attdef.h index eb79eff763a..2b8bca3e902 100644 --- a/include/vrv/attdef.h +++ b/include/vrv/attdef.h @@ -359,6 +359,16 @@ enum data_PLACE { PLACE_above, PLACE_below }; + +/** + * MEI data.STAFFREL + */ +enum data_STAFFREL { + STAFFREL_NONE = 0, + STAFFREL_above, + STAFFREL_below, + STAFFREL_within +}; /** * MEI data.STEMDIRECTION diff --git a/include/vrv/textdirective.h b/include/vrv/textdirective.h new file mode 100644 index 00000000000..8a40497b0fa --- /dev/null +++ b/include/vrv/textdirective.h @@ -0,0 +1,48 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: textdirective.h +// Author: Laurent Pugin +// Created: 2015 +// Copyright (c) Authors and others. All rights reserved. +///////////////////////////////////////////////////////////////////////////// + + +#ifndef __VRV_TEXT_DIRECTIVE_H__ +#define __VRV_TEXT_DIRECTIVE_H__ + +#include "textdirinterface.h" + +namespace vrv { + +//---------------------------------------------------------------------------- +// MeasureTempo +//---------------------------------------------------------------------------- + +/** + * This class is an interface for elements at the measure level + */ +class MeasureTempo: public MeasureElement, public TempoInterface +{ +public: + /** + * @name Constructors, destructors, reset methods + * Reset method reset all attribute classes + */ + ///@{ + MeasureTempo(); + virtual ~MeasureTempo(); + virtual void Reset(); + ///@} + +protected: + +private: + +public: + +private: + +}; + +} // namespace vrv + +#endif diff --git a/include/vrv/textdirinterface.h b/include/vrv/textdirinterface.h new file mode 100644 index 00000000000..f1d878aabcf --- /dev/null +++ b/include/vrv/textdirinterface.h @@ -0,0 +1,85 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: textdirinterface.h +// Author: Laurent Pugin +// Created: 2015 +// Copyright (c) Authors and others. All rights reserved. +///////////////////////////////////////////////////////////////////////////// + + +#ifndef __VRV_TEXT_DIR_INTERFACE_H__ +#define __VRV_TEXT_DIR_INTERFACE_H__ + +#include "atts_shared.h" +#include "vrvdef.h" + +namespace vrv { + +//---------------------------------------------------------------------------- +// TextDirInterface +//---------------------------------------------------------------------------- + +/** + * This class is an interface for elements implementing a text directive, such + * as , , or + * It is not an abstract class but should not be instanciate directly. + */ +class TextDirInterface: + public AttCommon +{ +public: + /** + * @name Constructors, destructors, reset methods + * Reset method reset all attribute classes + */ + ///@{ + TextDirInterface(); + virtual ~TextDirInterface(); + virtual void Reset(); + ///@} + +protected: + +private: + +public: + +private: + +}; + +//---------------------------------------------------------------------------- +// Tempo +//---------------------------------------------------------------------------- + +/** + * This class is an interface for elements. + * It is defined as an interface because it can be attached to + * MeasureElement or LayerElement in MeasureTempo and LayerTempo respectively + * It is not an abstract class but should not be instanciate directly. + */ +class TempoInterface: public TextDirInterface, +{ +public: + /** + * @name Constructors, destructors, reset methods + * Reset method reset all attribute classes + */ + ///@{ + TempoInterface(); + virtual ~TempoInterface(); + virtual void Reset(); + ///@} + +protected: + +private: + +public: + +private: + +}; + +} // namespace vrv + +#endif diff --git a/libmei/atts_shared.cpp b/libmei/atts_shared.cpp index 41352e3ebdd..fae2e1b6626 100644 --- a/libmei/atts_shared.cpp +++ b/libmei/atts_shared.cpp @@ -4154,13 +4154,13 @@ AttPlacement::~AttPlacement() { } void AttPlacement::ResetPlacement() { - m_place = ""; + m_place = STAFFREL_NONE; } bool AttPlacement::ReadPlacement( pugi::xml_node element ) { bool hasAttribute = false; if (element.attribute("place")) { - this->SetPlace(StrToStr(element.attribute("place").value())); + this->SetPlace(StrToStaffRel(element.attribute("place").value())); element.remove_attribute("place"); hasAttribute = true; } @@ -4170,7 +4170,7 @@ bool AttPlacement::ReadPlacement( pugi::xml_node element ) { bool AttPlacement::WritePlacement( pugi::xml_node element ) { bool wroteAttribute = false; if (this->HasPlace()) { - element.append_attribute("place") = StrToStr(this->GetPlace()).c_str(); + element.append_attribute("place") = StaffRelToStr(this->GetPlace()).c_str(); wroteAttribute = true; } return wroteAttribute; @@ -4178,7 +4178,7 @@ bool AttPlacement::WritePlacement( pugi::xml_node element ) { bool AttPlacement::HasPlace( ) { - return (m_place != ""); + return (m_place != STAFFREL_NONE); } @@ -7698,7 +7698,7 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu if (dynamic_cast(element) ) { AttPlacement *att = dynamic_cast(element); if (attrType == "place") { - att->SetPlace(att->StrToStr(attrValue)); + att->SetPlace(att->StrToStaffRel(attrValue)); return true; } } @@ -8866,7 +8866,7 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { if (dynamic_cast(element) ) { AttPlacement *att = dynamic_cast(element); if (att->HasPlace()) { - attributes->push_back(std::make_pair("place", att->StrToStr(att->GetPlace()))); + attributes->push_back(std::make_pair("place", att->StaffRelToStr(att->GetPlace()))); } } if (dynamic_cast(element) ) { diff --git a/libmei/atts_shared.h b/libmei/atts_shared.h index d6aa77368da..0fcab69384a 100644 --- a/libmei/atts_shared.h +++ b/libmei/atts_shared.h @@ -3604,8 +3604,8 @@ class AttPlacement: public Att * to the default value) **/ ///@{ - void SetPlace(std::string place_) { m_place = place_; }; - std::string GetPlace() const { return m_place; }; + void SetPlace(data_STAFFREL place_) { m_place = place_; }; + data_STAFFREL GetPlace() const { return m_place; }; bool HasPlace( ); ///@} @@ -3615,7 +3615,7 @@ class AttPlacement: public Att * Captures the placement of the item with respect to the staff with which it is * associated. **/ - std::string m_place; + data_STAFFREL m_place; /* include */ }; diff --git a/src/att.cpp b/src/att.cpp index 7beab356289..24f0f3f7515 100644 --- a/src/att.cpp +++ b/src/att.cpp @@ -828,6 +828,35 @@ data_PROLATIO Att::StrToProlatio(std::string value) return PROLATIO_NONE; } +std::string Att::StaffRelToStr( data_STAFFREL data ) +{ + std::string value; + switch(data) + { + case STAFFREL_above : value = "above"; break; + case STAFFREL_below : value = "below"; break; + case STAFFREL_within : value = "within"; break; + default: + LogWarning("Unknown staffrel '%d'", data); + value = ""; + break; + } + return value; +} + +data_STAFFREL Att::StrToStaffRel(std::string value) +{ + if (value == "below") return STAFFREL_below; + else if (value == "above") return STAFFREL_above; + else if (value == "within") return STAFFREL_within; + else { + LogWarning("Unsupported staffrel '%s'", value.c_str() ); + } + // default + return STAFFREL_NONE; +} + + std::string Att::StemDirectionToStr(data_STEMDIRECTION data) { std::string value; diff --git a/src/textdirective.cpp b/src/textdirective.cpp new file mode 100644 index 00000000000..d7d37d5c851 --- /dev/null +++ b/src/textdirective.cpp @@ -0,0 +1,43 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: textdirective.cpp +// Author: Laurent Pugin +// Created: 2015 +// Copyright (c) Authors and others. All rights reserved. +///////////////////////////////////////////////////////////////////////////// + + +#include "textdirective.h" + +//---------------------------------------------------------------------------- + +#include + +//---------------------------------------------------------------------------- + +#include "measureelement.h" + +namespace vrv { + +//---------------------------------------------------------------------------- +// MeasureTempo +//---------------------------------------------------------------------------- + +MeasureTempo::MeasureTempo(): + MeasureElement(), + TempoInterface() +{ + Reset(); +} + + +MeasureTempo::~MeasureTempo() +{ +} + +void MeasureTempo::Reset() +{ + MeasureElement::Reset(); + TempoInterface::Reset(); +} + +} // namespace vrv diff --git a/src/textdirinterface.cpp b/src/textdirinterface.cpp new file mode 100644 index 00000000000..ac58e533b22 --- /dev/null +++ b/src/textdirinterface.cpp @@ -0,0 +1,63 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: textdirinterface.cpp +// Author: Laurent Pugin +// Created: 2015 +// Copyright (c) Authors and others. All rights reserved. +///////////////////////////////////////////////////////////////////////////// + + +#include "textdirinterface.h" + +//---------------------------------------------------------------------------- + +#include + +//---------------------------------------------------------------------------- + +#include "layerelement.h" +#include "staff.h" +#include "vrv.h" + +namespace vrv { + +//---------------------------------------------------------------------------- +// TextDirInterface +//---------------------------------------------------------------------------- + +TextDirInterface::TextDirInterface(): + AttCommon() +{ + Reset(); +} + + +TextDirInterface::~TextDirInterface() +{ +} + +void TextDirInterface::Reset() +{ + AttCommon::Reset(); +} + +//---------------------------------------------------------------------------- +// TempoInterface +//---------------------------------------------------------------------------- + +TempoInterface::TempoInterface(): + TextDirInterface() +{ + Reset(); +} + + +TempoInterface::~TempoInterface() +{ +} + +void TempoInterface::Reset() +{ + TempoInterface::Reset(); +} + +} // namespace vrv From 053675f0f6d701867fa5a3ea7d69ecf9d56e0c60 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sat, 25 Jul 2015 01:24:30 +0100 Subject: [PATCH 030/114] Adding text directive interface and tempo (measure level) classes --- Verovio.xcodeproj/project.pbxproj | 22 +++++++++++++++++++++- include/vrv/textdirective.h | 1 + include/vrv/textdirinterface.h | 6 ++++-- src/textdirinterface.cpp | 11 ++++++----- 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/Verovio.xcodeproj/project.pbxproj b/Verovio.xcodeproj/project.pbxproj index 215d5ebe497..8af31c11abf 100644 --- a/Verovio.xcodeproj/project.pbxproj +++ b/Verovio.xcodeproj/project.pbxproj @@ -46,6 +46,12 @@ 4D9C53141B52E4AE0003C6EC /* utf8.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D9C53101B52E4AE0003C6EC /* utf8.h */; }; 4DA3FCD319B61DB300CBDFE6 /* atts_cmn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DEE28EF1940BCC100C76319 /* atts_cmn.cpp */; }; 4DA3FCD419B61DB400CBDFE6 /* atts_cmn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DEE28EF1940BCC100C76319 /* atts_cmn.cpp */; }; + 4DA60EE01B6307A8006E2DFC /* textdirective.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DA60EDE1B6307A8006E2DFC /* textdirective.h */; }; + 4DA60EE11B6307A8006E2DFC /* textdirinterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DA60EDF1B6307A8006E2DFC /* textdirinterface.h */; }; + 4DA60EE41B6307B9006E2DFC /* textdirective.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DA60EE21B6307B9006E2DFC /* textdirective.cpp */; }; + 4DA60EE51B6307B9006E2DFC /* textdirective.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DA60EE21B6307B9006E2DFC /* textdirective.cpp */; }; + 4DA60EE61B6307B9006E2DFC /* textdirinterface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DA60EE31B6307B9006E2DFC /* textdirinterface.cpp */; }; + 4DA60EE71B6307B9006E2DFC /* textdirinterface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DA60EE31B6307B9006E2DFC /* textdirinterface.cpp */; }; 4DA80D961A6ACF5D0089802D /* style.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DA80D951A6ACF5D0089802D /* style.cpp */; }; 4DA80D971A6ACF5D0089802D /* style.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DA80D951A6ACF5D0089802D /* style.cpp */; }; 4DB3072F1AC9ED2500EE0982 /* space.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DB3072E1AC9ED2500EE0982 /* space.cpp */; }; @@ -228,11 +234,15 @@ 4D9A9C18199F561200028D93 /* verse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = verse.cpp; path = src/verse.cpp; sourceTree = ""; }; 4D9A9C1B199F576100028D93 /* syl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = syl.h; path = include/vrv/syl.h; sourceTree = ""; }; 4D9A9C1D19A1DE2000028D93 /* syl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = syl.cpp; path = src/syl.cpp; sourceTree = ""; }; - 4D9C5F3A1ADBBBEB005D3031 /* git_commit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = git_commit.h; path = include/vrv/git_commit.h; sourceTree = SOURCE_ROOT; }; 4D9C530D1B52E4AE0003C6EC /* checked.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = checked.h; path = include/utf8/checked.h; sourceTree = ""; }; 4D9C530E1B52E4AE0003C6EC /* core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = core.h; path = include/utf8/core.h; sourceTree = ""; }; 4D9C530F1B52E4AE0003C6EC /* unchecked.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = unchecked.h; path = include/utf8/unchecked.h; sourceTree = ""; }; 4D9C53101B52E4AE0003C6EC /* utf8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = utf8.h; path = include/utf8.h; sourceTree = ""; }; + 4D9C5F3A1ADBBBEB005D3031 /* git_commit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = git_commit.h; path = include/vrv/git_commit.h; sourceTree = SOURCE_ROOT; }; + 4DA60EDE1B6307A8006E2DFC /* textdirective.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = textdirective.h; path = include/vrv/textdirective.h; sourceTree = ""; }; + 4DA60EDF1B6307A8006E2DFC /* textdirinterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = textdirinterface.h; path = include/vrv/textdirinterface.h; sourceTree = ""; }; + 4DA60EE21B6307B9006E2DFC /* textdirective.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = textdirective.cpp; path = src/textdirective.cpp; sourceTree = ""; }; + 4DA60EE31B6307B9006E2DFC /* textdirinterface.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = textdirinterface.cpp; path = src/textdirinterface.cpp; sourceTree = ""; }; 4DA80D941A6940120089802D /* style.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = style.h; path = include/vrv/style.h; sourceTree = ""; }; 4DA80D951A6ACF5D0089802D /* style.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = style.cpp; path = src/style.cpp; sourceTree = ""; }; 4DB3072D1AC9ED1800EE0982 /* space.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = space.h; path = include/vrv/space.h; sourceTree = ""; }; @@ -426,6 +436,8 @@ 8F59292718854BF800FE51AD /* positioninterface.h */, 4DF289FE1A7545E500BA9F7D /* timeinterface.cpp */, 4DF289FC1A7545CC00BA9F7D /* timeinterface.h */, + 4DA60EE31B6307B9006E2DFC /* textdirinterface.cpp */, + 4DA60EDF1B6307A8006E2DFC /* textdirinterface.h */, ); name = interfaces; sourceTree = ""; @@ -531,6 +543,8 @@ 4D1D733B1A1D0390001E08F6 /* smufl.h */, 4DA80D951A6ACF5D0089802D /* style.cpp */, 4DA80D941A6940120089802D /* style.h */, + 4DA60EE21B6307B9006E2DFC /* textdirective.cpp */, + 4DA60EDE1B6307A8006E2DFC /* textdirective.h */, 8F086EBF188539540037FD8E /* toolkit.cpp */, 8F59291618854BF800FE51AD /* toolkit.h */, ); @@ -677,6 +691,7 @@ 8F59294118854BF800FE51AD /* iomusxml.h in Headers */, 8F59294218854BF800FE51AD /* iopae.h in Headers */, 8F59294318854BF800FE51AD /* keysig.h in Headers */, + 4DA60EE01B6307A8006E2DFC /* textdirective.h in Headers */, 8F59294418854BF800FE51AD /* layer.h in Headers */, 8F59294518854BF800FE51AD /* layerelement.h in Headers */, 8F59294718854BF800FE51AD /* measure.h in Headers */, @@ -704,6 +719,7 @@ 4D22C41C18890E9900D0831F /* mrest.h in Headers */, 4D22C42418891FC000D0831F /* pugixml.hpp in Headers */, 4D22C42518891FC300D0831F /* pugiconfig.hpp in Headers */, + 4DA60EE11B6307A8006E2DFC /* textdirinterface.h in Headers */, 4D9C53121B52E4AE0003C6EC /* core.h in Headers */, 4D763EC91987D067003FCAB5 /* metersig.h in Headers */, 4D422101199805E400963292 /* att.h in Headers */, @@ -806,6 +822,7 @@ 8F086EE2188539540037FD8E /* aligner.cpp in Sources */, 8F086EE4188539540037FD8E /* barline.cpp in Sources */, 8F086EE5188539540037FD8E /* bboxdevicecontext.cpp in Sources */, + 4DA60EE41B6307B9006E2DFC /* textdirective.cpp in Sources */, 8F086EE6188539540037FD8E /* beam.cpp in Sources */, 8F086EE7188539540037FD8E /* clef.cpp in Sources */, 8F086EE8188539540037FD8E /* devicecontext.cpp in Sources */, @@ -852,6 +869,7 @@ 8F086F0D188539540037FD8E /* vrv.cpp in Sources */, 4D22C41918890E6100D0831F /* mrest.cpp in Sources */, 4D22C42018891D6D00D0831F /* pugixml.cpp in Sources */, + 4DA60EE61B6307B9006E2DFC /* textdirinterface.cpp in Sources */, 4D983005192E959E00320037 /* main.cpp in Sources */, 4DEE291B1940BCC100C76319 /* atts_shared.cpp in Sources */, 4D763EC61987D04E003FCAB5 /* metersig.cpp in Sources */, @@ -892,6 +910,7 @@ 8F3DD34218854B2E0051330C /* durationinterface.cpp in Sources */, 8F3DD34418854B2E0051330C /* keysig.cpp in Sources */, 4DF28A001A7545E500BA9F7D /* timeinterface.cpp in Sources */, + 4DA60EE71B6307B9006E2DFC /* textdirinterface.cpp in Sources */, 8F3DD34618854B2E0051330C /* layerelement.cpp in Sources */, 8F3DD34818854B2E0051330C /* mensur.cpp in Sources */, 8F3DD34A18854B2E0051330C /* multirest.cpp in Sources */, @@ -912,6 +931,7 @@ 8F3DD32418854B090051330C /* io.cpp in Sources */, 8F3DD32618854B090051330C /* iodarms.cpp in Sources */, 4DF2AF811A62FC4A0016F869 /* drawinglistinterface.cpp in Sources */, + 4DA60EE51B6307B9006E2DFC /* textdirective.cpp in Sources */, 8F3DD32818854B090051330C /* iomei.cpp in Sources */, 8F3DD32A18854B090051330C /* iomusxml.cpp in Sources */, 8F3DD32C18854B090051330C /* iopae.cpp in Sources */, diff --git a/include/vrv/textdirective.h b/include/vrv/textdirective.h index 8a40497b0fa..4ecedc6ab44 100644 --- a/include/vrv/textdirective.h +++ b/include/vrv/textdirective.h @@ -9,6 +9,7 @@ #ifndef __VRV_TEXT_DIRECTIVE_H__ #define __VRV_TEXT_DIRECTIVE_H__ +#include "measureelement.h" #include "textdirinterface.h" namespace vrv { diff --git a/include/vrv/textdirinterface.h b/include/vrv/textdirinterface.h index f1d878aabcf..d7cecd413f9 100644 --- a/include/vrv/textdirinterface.h +++ b/include/vrv/textdirinterface.h @@ -24,7 +24,9 @@ namespace vrv { * It is not an abstract class but should not be instanciate directly. */ class TextDirInterface: - public AttCommon + public AttCommon, + public AttPlacement, + public AttStaffident { public: /** @@ -57,7 +59,7 @@ class TextDirInterface: * MeasureElement or LayerElement in MeasureTempo and LayerTempo respectively * It is not an abstract class but should not be instanciate directly. */ -class TempoInterface: public TextDirInterface, +class TempoInterface: public TextDirInterface { public: /** diff --git a/src/textdirinterface.cpp b/src/textdirinterface.cpp index ac58e533b22..fcdacb43325 100644 --- a/src/textdirinterface.cpp +++ b/src/textdirinterface.cpp @@ -14,9 +14,6 @@ //---------------------------------------------------------------------------- -#include "layerelement.h" -#include "staff.h" -#include "vrv.h" namespace vrv { @@ -25,7 +22,9 @@ namespace vrv { //---------------------------------------------------------------------------- TextDirInterface::TextDirInterface(): - AttCommon() + AttCommon(), + AttPlacement(), + AttStaffident() { Reset(); } @@ -37,7 +36,9 @@ TextDirInterface::~TextDirInterface() void TextDirInterface::Reset() { - AttCommon::Reset(); + ResetCommon(); + ResetPlacement(); + ResetStaffident(); } //---------------------------------------------------------------------------- From 2d9f6fd9fd8d25028f7831e1bd41040578a773ee Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sat, 25 Jul 2015 06:41:55 +0100 Subject: [PATCH 031/114] Reading and writing (measure level) --- include/vrv/iomei.h | 21 +++++++++++++ include/vrv/textdirective.h | 1 + src/iomei.cpp | 61 +++++++++++++++++++++++++++++++++++-- src/textdirective.cpp | 3 +- src/textdirinterface.cpp | 2 +- 5 files changed, 82 insertions(+), 6 deletions(-) diff --git a/include/vrv/iomei.h b/include/vrv/iomei.h index 0a93309f244..adbbe26f6d0 100644 --- a/include/vrv/iomei.h +++ b/include/vrv/iomei.h @@ -33,6 +33,7 @@ class LayerElement; class Lem; class Measure; class MeasureElement; +class MeasureTempo; class Mensur; class MeterSig; class MRest; @@ -48,6 +49,8 @@ class Space; class Staff; class Syl; class System; +class TempoInterface; +class TextDirInterface; class Tie; class TimeSpanningInterface; class Tuplet; @@ -156,6 +159,13 @@ class MeiOutput: public FileOutputStream bool WriteMeiAnnot( pugi::xml_node currentNode, Annot *annot ); ///@} + /** + * @name Methods for wrinting text directive elements. + */ + ///@{ + void WriteMeiTempo( pugi::xml_node currentNode, MeasureTempo *tempo ); + ///@} + /** * @name Methods for wrinting other mei elements */ @@ -186,6 +196,8 @@ class MeiOutput: public FileOutputStream void WriteDurationInterface( pugi::xml_node currentNode, DurationInterface *interface ); void WritePitchInterface( pugi::xml_node currentNode, PitchInterface *interface ); void WritePositionInterface( pugi::xml_node currentNode, PositionInterface *interface ); + void WriteTempoInterface( pugi::xml_node currentNode, TempoInterface *interface ); + void WriteTextDirInterface( pugi::xml_node currentNode, TextDirInterface *interface ); void WriteTimeSpanningInterface( pugi::xml_node currentNode, TimeSpanningInterface *interface ); ///@} @@ -307,6 +319,13 @@ class MeiInput: public FileInputStream bool ReadMeiSlur( Object *parent, pugi::xml_node slur ); bool ReadMeiTie( Object *parent, pugi::xml_node tie ); ///@} + + /** + * @name Methods for reading MEI text directives + */ + ///@{ + bool ReadMeiMeasureTempo( Object *parent, pugi::xml_node tempo ); + ///@} /** * @name Methods for reading critical apparatus. @@ -330,6 +349,8 @@ class MeiInput: public FileInputStream bool ReadDurationInterface( pugi::xml_node element, DurationInterface *interface ); bool ReadPitchInterface( pugi::xml_node element, PitchInterface *interface ); bool ReadPositionInterface( pugi::xml_node element, PositionInterface *interface ); + bool ReadTempoInterface( pugi::xml_node element, TempoInterface *interface ); + bool ReadTextDirInterface( pugi::xml_node element, TextDirInterface *interface ); bool ReadTimeSpanningInterface( pugi::xml_node element, TimeSpanningInterface *interface ); ///@} diff --git a/include/vrv/textdirective.h b/include/vrv/textdirective.h index 4ecedc6ab44..0e617974657 100644 --- a/include/vrv/textdirective.h +++ b/include/vrv/textdirective.h @@ -32,6 +32,7 @@ class MeasureTempo: public MeasureElement, public TempoInterface MeasureTempo(); virtual ~MeasureTempo(); virtual void Reset(); + virtual std::string GetClassName( ) { return "Tempo"; }; ///@} protected: diff --git a/src/iomei.cpp b/src/iomei.cpp index d9b62f66980..254cd6b72a5 100644 --- a/src/iomei.cpp +++ b/src/iomei.cpp @@ -36,6 +36,7 @@ #include "staff.h" #include "syl.h" #include "system.h" +#include "textdirective.h" #include "tie.h" #include "tuplet.h" #include "verse.h" @@ -169,6 +170,10 @@ bool MeiOutput::WriteObject( Object *object ) m_currentNode = m_currentNode.append_child("slur"); WriteMeiSlur( m_currentNode, dynamic_cast(object) ); } + else if (dynamic_cast(object)) { + m_currentNode = m_currentNode.append_child("tempo"); + WriteMeiTempo( m_currentNode, dynamic_cast(object) ); + } else if (dynamic_cast(object)) { m_currentNode = m_currentNode.append_child("tie"); WriteMeiTie( m_currentNode, dynamic_cast(object) ); @@ -662,6 +667,14 @@ void MeiOutput::WriteMeiSyl( pugi::xml_node currentNode, Syl *syl ) WriteText( currentNode, syl ); return; } + +void MeiOutput::WriteMeiTempo( pugi::xml_node currentNode, MeasureTempo *tempo ) +{ + currentNode.append_attribute( "xml:id" ) = UuidToMeiStr( tempo ).c_str(); + WriteTempoInterface(currentNode, tempo); + WriteText( currentNode, tempo ); + return; +} void MeiOutput::WriteDurationInterface(pugi::xml_node element, vrv::DurationInterface *interface) { @@ -686,6 +699,18 @@ void MeiOutput::WritePositionInterface(pugi::xml_node element, vrv::PositionInte interface->WriteStafflocPitched(element); } +void MeiOutput::WriteTempoInterface( pugi::xml_node element, vrv::TempoInterface *interface) +{ + WriteTextDirInterface(element, interface); +} + +void MeiOutput::WriteTextDirInterface(pugi::xml_node element, vrv::TextDirInterface *interface) +{ + interface->WriteCommon(element); + interface->WritePlacement(element); + interface->WriteStaffident(element); +} + void MeiOutput::WriteTimeSpanningInterface(pugi::xml_node element, vrv::TimeSpanningInterface *interface) { interface->WriteStartendid(element); @@ -1296,12 +1321,15 @@ bool MeiInput::ReadMeiMeasureChildren( Object *parent, pugi::xml_node parentNode LogWarning( " not readable as and ignored" ); } } - else if ( std::string( current.name() ) == "tie" ) { - success = ReadMeiTie( parent, current ); - } else if ( std::string( current.name() ) == "slur" ) { success = ReadMeiSlur( parent, current ); } + else if ( std::string( current.name() ) == "tempo" ) { + success = ReadMeiMeasureTempo( parent, current ); + } + else if ( std::string( current.name() ) == "tie" ) { + success = ReadMeiTie( parent, current ); + } else { LogWarning("Unsupported '<%s>' within ", current.name() ); } @@ -1756,6 +1784,19 @@ bool MeiInput::ReadMeiVerse(Object *parent, pugi::xml_node verse) return ReadMeiLayerChildren(vrvVerse, verse, vrvVerse); } + +bool MeiInput::ReadMeiMeasureTempo(Object *parent, pugi::xml_node tempo) +{ + MeasureTempo *vrvMeasureTempo = new MeasureTempo(); + SetMeiUuid(tempo, vrvMeasureTempo); + + ReadTempoInterface(tempo, vrvMeasureTempo); + ReadText( tempo, vrvMeasureTempo ); + + AddMeasureElement(parent, vrvMeasureTempo); + + return true; +} bool MeiInput::ReadDurationInterface(pugi::xml_node element, DurationInterface *interface) { @@ -1783,6 +1824,20 @@ bool MeiInput::ReadPositionInterface(pugi::xml_node element, PositionInterface * return true; } +bool MeiInput::ReadTempoInterface(pugi::xml_node element, TempoInterface *interface) +{ + ReadTextDirInterface(element, interface); + return true; +} + +bool MeiInput::ReadTextDirInterface(pugi::xml_node element, TextDirInterface *interface) +{ + interface->ReadCommon(element); + interface->ReadPlacement(element); + interface->ReadStaffident(element); + return true; +} + bool MeiInput::ReadTimeSpanningInterface(pugi::xml_node element, TimeSpanningInterface *interface) { interface->ReadStartendid(element); diff --git a/src/textdirective.cpp b/src/textdirective.cpp index d7d37d5c851..0fd250fe330 100644 --- a/src/textdirective.cpp +++ b/src/textdirective.cpp @@ -23,8 +23,7 @@ namespace vrv { //---------------------------------------------------------------------------- MeasureTempo::MeasureTempo(): - MeasureElement(), - TempoInterface() + MeasureElement("tempo-"), TempoInterface() { Reset(); } diff --git a/src/textdirinterface.cpp b/src/textdirinterface.cpp index fcdacb43325..47be1771409 100644 --- a/src/textdirinterface.cpp +++ b/src/textdirinterface.cpp @@ -58,7 +58,7 @@ TempoInterface::~TempoInterface() void TempoInterface::Reset() { - TempoInterface::Reset(); + TextDirInterface::Reset(); } } // namespace vrv From ef9efb5058e6b16c13e6635113d78cfccd813918 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sat, 25 Jul 2015 07:45:16 +0100 Subject: [PATCH 032/114] Updating makefiles --- emscripten/build.sh | 4 +++- java/build.sh | 2 ++ python/setup.py | 4 +++- tools/CMakeLists.txt | 2 ++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/emscripten/build.sh b/emscripten/build.sh index 337c5de2361..b87d51433b7 100755 --- a/emscripten/build.sh +++ b/emscripten/build.sh @@ -144,7 +144,9 @@ python $EMCC $CHATTY \ $VEROVIO_ROOT/src/style.cpp \ $VEROVIO_ROOT/src/svgdevicecontext.cpp \ $VEROVIO_ROOT/src/syl.cpp \ - $VEROVIO_ROOT/src/system.cpp \ + $VEROVIO_ROOT/src/system.cpp \ + $VEROVIO_ROOT/src/textdirective.cpp \ + $VEROVIO_ROOT/src/textdirinterface.cpp \ $VEROVIO_ROOT/src/tie.cpp \ $VEROVIO_ROOT/src/timeinterface.cpp \ $VEROVIO_ROOT/src/toolkit.cpp \ diff --git a/java/build.sh b/java/build.sh index 73c835065ca..ef3752e640c 100755 --- a/java/build.sh +++ b/java/build.sh @@ -60,6 +60,8 @@ FILES="../src/accid.cpp \ ../src/svgdevicecontext.cpp \ ../src/syl.cpp \ ../src/system.cpp \ + ../src/textdirective.cpp \ + ../src/textdirinterface.cpp \ ../src/tie.cpp \ ../src/timeinterface.cpp \ ../src/toolkit.cpp \ diff --git a/python/setup.py b/python/setup.py index c66935bc315..f5529ff6aea 100755 --- a/python/setup.py +++ b/python/setup.py @@ -64,7 +64,9 @@ '../src/svgdevicecontext.cpp', '../src/syl.cpp', '../src/system.cpp', - '../src/tie.cpp', + '../src/textdirective.cpp', + '../src/textdirinterface.cpp', + '../src/tie.cpp', '../src/timeinterface.cpp', '../src/toolkit.cpp', '../src/tuplet.cpp', diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index f889b42202a..4a7db282dd6 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -69,6 +69,8 @@ add_executable (verovio ../src/svgdevicecontext.cpp ../src/syl.cpp ../src/system.cpp + ../src/textdirective.cpp + ../src/textdirinterface.cpp ../src/tie.cpp ../src/timeinterface.cpp ../src/toolkit.cpp From abad2538d44cad3ce25e3dd12e402e894cf248aa Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sat, 25 Jul 2015 22:01:46 +0100 Subject: [PATCH 033/114] Adding support --- include/vrv/editorial.h | 28 ++++++++++ include/vrv/iomei.h | 7 ++- src/editorial.cpp | 19 +++++++ src/iomei.cpp | 114 +++++++++++++++++++++++++++++++--------- 4 files changed, 142 insertions(+), 26 deletions(-) diff --git a/include/vrv/editorial.h b/include/vrv/editorial.h index c95f6acdaa7..ad6f682f3f2 100644 --- a/include/vrv/editorial.h +++ b/include/vrv/editorial.h @@ -184,6 +184,34 @@ class Rdg: public EditorialElement private: +}; + +//---------------------------------------------------------------------------- +// Supplied +//---------------------------------------------------------------------------- + +class Supplied: public EditorialElement +{ +public: + /** + * @name Constructors, destructors, and other standard methods + * Reset method reset all attribute classes + */ + ///@{ + Supplied(); + virtual ~Supplied(); + virtual void Reset(); + virtual std::string GetClassName( ) { return "Supplied"; }; + ///@} + +protected: + +private: + +public: + +private: + }; //---------------------------------------------------------------------------- diff --git a/include/vrv/iomei.h b/include/vrv/iomei.h index adbbe26f6d0..f019076f39d 100644 --- a/include/vrv/iomei.h +++ b/include/vrv/iomei.h @@ -47,6 +47,7 @@ class ScoreDef; class Slur; class Space; class Staff; +class Supplied; class Syl; class System; class TempoInterface; @@ -156,6 +157,7 @@ class MeiOutput: public FileOutputStream bool WriteMeiApp( pugi::xml_node currentNode, App *app ); bool WriteMeiLem( pugi::xml_node currentNode, Lem *lem ); bool WriteMeiRdg( pugi::xml_node currentNode, Rdg *rdg ); + bool WriteMeiSupplied( pugi::xml_node currentNode, Supplied *supplied ); bool WriteMeiAnnot( pugi::xml_node currentNode, Annot *annot ); ///@} @@ -328,14 +330,15 @@ class MeiInput: public FileInputStream ///@} /** - * @name Methods for reading critical apparatus. - * Only one child of is loaded + * @name Methods for reading critical apparatus, other editorial markup and . * The filter is propagated (if any) */ ///@{ bool ReadMeiApp( Object *parent, pugi::xml_node app, EditorialLevel level, Object *filter = NULL ); bool ReadMeiAppChildren( Object *parent, pugi::xml_node parentNode, EditorialLevel level, Object *filter = NULL ); bool ReadMeiLemOrRdg( Object *parent, pugi::xml_node lemOrRdg, EditorialLevel level, Object *filter = NULL ); + bool ReadMeiSupplied( Object *parent, pugi::xml_node supplied, EditorialLevel level, Object *filter = NULL ); + bool ReadMeiEditorialChildren( Object *parent, pugi::xml_node supplied, EditorialLevel level, Object *filter = NULL ); bool ReadMeiAnnot( Object *parent, pugi::xml_node annot ); ///@} ///@} diff --git a/src/editorial.cpp b/src/editorial.cpp index 82836ffa5fd..2f44ca20e57 100644 --- a/src/editorial.cpp +++ b/src/editorial.cpp @@ -180,6 +180,25 @@ void Rdg::Reset() { EditorialElement::Reset(); } + +//---------------------------------------------------------------------------- +// Supplied +//---------------------------------------------------------------------------- + +Supplied::Supplied( ): + EditorialElement("supplied-") +{ + Reset(); +} + +Supplied::~Supplied() +{ +} + +void Supplied::Reset() +{ + EditorialElement::Reset(); +} //---------------------------------------------------------------------------- // Annot diff --git a/src/iomei.cpp b/src/iomei.cpp index 254cd6b72a5..0505cce7b03 100644 --- a/src/iomei.cpp +++ b/src/iomei.cpp @@ -268,6 +268,10 @@ bool MeiOutput::WriteObject( Object *object ) m_currentNode = m_currentNode.append_child("rdg"); WriteMeiRdg( m_currentNode, dynamic_cast(object) ); } + else if (dynamic_cast(object)) { + m_currentNode = m_currentNode.append_child("supplied"); + WriteMeiSupplied( m_currentNode, dynamic_cast(object) ); + } else if (dynamic_cast(object)) { m_currentNode = m_currentNode.append_child("annot"); WriteMeiAnnot( m_currentNode, dynamic_cast(object) ); @@ -764,6 +768,12 @@ bool MeiOutput::WriteMeiRdg( pugi::xml_node currentNode, Rdg *rdg ) WriteEditorialElement(currentNode, rdg); return true; }; + +bool MeiOutput::WriteMeiSupplied( pugi::xml_node currentNode, Supplied *supplied ) +{ + WriteEditorialElement(currentNode, supplied); + return true; +}; bool MeiOutput::WriteMeiAnnot( pugi::xml_node currentNode, Annot *annot ) { @@ -876,12 +886,17 @@ bool MeiInput::IsAllowed(std::string element, vrv::Object *filterParent) } const std::type_info *elementType = &typeid(*filterParent); + // editorial if ( element == "app" ) { return true; } - if ( element == "annot" ) { + else if ( element == "annot" ) { + return true; + } + else if ( element == "supplied" ) { return true; } + // filter for notes else if (*elementType == typeid(Note)) { if ( element == "accid" ) return true; @@ -889,6 +904,7 @@ bool MeiInput::IsAllowed(std::string element, vrv::Object *filterParent) else if ( element == "verse" ) return true; else return false; } + // filter for Verse else if (*elementType == typeid(Verse)) { if ( element == "syl" ) return true; @@ -1073,7 +1089,18 @@ bool MeiInput::ReadMeiSystemChildren( Object *parent, pugi::xml_node parentNode Measure *unmeasured = NULL; for( current = parentNode.first_child( ); current; current = current.next_sibling( ) ) { if (!success) break; - if ( std::string( current.name() ) == "scoreDef" ) { + // editorial + else if ( std::string( current.name() ) == "app" ) { + success = ReadMeiApp( parent, current, EDITORIAL_SYSTEM ); + } + else if ( std::string( current.name() ) == "annot" ) { + success = ReadMeiAnnot( parent, current ); + } + else if ( std::string( current.name() ) == "supplied" ) { + success = ReadMeiSupplied( parent, current, EDITORIAL_SYSTEM ); + } + // content + else if ( std::string( current.name() ) == "scoreDef" ) { // we should not have scoredef with unmeasured within a system... (?) assert(!unmeasured); ReadMeiScoreDef( parent, current ); @@ -1108,12 +1135,6 @@ bool MeiInput::ReadMeiSystemChildren( Object *parent, pugi::xml_node parentNode } success = ReadMeiMeasure(parent, current); } - else if ( std::string( current.name() ) == "app" ) { - success = ReadMeiApp( parent, current, EDITORIAL_SYSTEM ); - } - else if ( std::string( current.name() ) == "annot" ) { - success = ReadMeiAnnot( parent, current ); - } else { LogWarning("Unsupported '<%s>' within ", current.name() ); } @@ -1167,12 +1188,17 @@ bool MeiInput::ReadMeiScoreDefChildren( Object *parent, pugi::xml_node parentNod pugi::xml_node current; for( current = parentNode.first_child( ); current; current = current.next_sibling( ) ) { if (!success) break; + // editorial if ( std::string( current.name() ) == "app" ) { success = ReadMeiApp( parent, current, EDITORIAL_SCOREDEF); } - if ( std::string( current.name() ) == "annot" ) { + else if ( std::string( current.name() ) == "annot" ) { success = ReadMeiAnnot( parent, current ); } + else if ( std::string( current.name() ) == "supplied" ) { + success = ReadMeiSupplied( parent, current, EDITORIAL_SCOREDEF ); + } + // content else if ( std::string( current.name() ) == "staffGrp" ) { success = ReadMeiStaffGrp( parent, current ); } @@ -1211,12 +1237,17 @@ bool MeiInput::ReadMeiStaffGrpChildren( Object *parent, pugi::xml_node parentNod pugi::xml_node current; for( current = parentNode.first_child( ); current; current = current.next_sibling( ) ) { if (!success) break; + // editorial if ( std::string( current.name() ) == "app" ) { success = ReadMeiApp( parent, current, EDITORIAL_STAFFGRP ); } - if ( std::string( current.name() ) == "annot" ) { + else if ( std::string( current.name() ) == "annot" ) { success = ReadMeiAnnot( parent, current ); } + else if ( std::string( current.name() ) == "supplied" ) { + success = ReadMeiSupplied( parent, current, EDITORIAL_STAFFGRP ); + } + // content else if ( std::string( current.name() ) == "staffGrp" ) { success = ReadMeiStaffGrp( parent, current); } @@ -1307,20 +1338,20 @@ bool MeiInput::ReadMeiMeasureChildren( Object *parent, pugi::xml_node parentNode pugi::xml_node current; for( current = parentNode.first_child( ); current; current = current.next_sibling( ) ) { if (!success) break; + // editorial if ( std::string( current.name() ) == "app" ) { success = ReadMeiApp( parent, current, EDITORIAL_MEASURE); } - if ( std::string( current.name() ) == "annot" ) { + else if ( std::string( current.name() ) == "annot" ) { success = ReadMeiAnnot( parent, current ); } + else if ( std::string( current.name() ) == "supplied" ) { + success = ReadMeiSupplied( parent, current, EDITORIAL_MEASURE ); + } + // content else if ( std::string( current.name() ) == "staff" ) { success = ReadMeiStaff( parent, current ); } - else if ( std::string( current.name() ) == "tupletSpan" ) { - if (!ReadTupletSpanAsTuplet( dynamic_cast( parent ), current )) { - LogWarning( " not readable as and ignored" ); - } - } else if ( std::string( current.name() ) == "slur" ) { success = ReadMeiSlur( parent, current ); } @@ -1330,6 +1361,11 @@ bool MeiInput::ReadMeiMeasureChildren( Object *parent, pugi::xml_node parentNode else if ( std::string( current.name() ) == "tie" ) { success = ReadMeiTie( parent, current ); } + else if ( std::string( current.name() ) == "tupletSpan" ) { + if (!ReadTupletSpanAsTuplet( dynamic_cast( parent ), current )) { + LogWarning( " not readable as and ignored" ); + } + } else { LogWarning("Unsupported '<%s>' within ", current.name() ); } @@ -1395,12 +1431,17 @@ bool MeiInput::ReadMeiStaffChildren( Object *parent, pugi::xml_node parentNode ) pugi::xml_node current; for( current = parentNode.first_child( ); current; current = current.next_sibling( ) ) { if (!success) break; + // editorial if ( std::string( current.name() ) == "app" ) { success = ReadMeiApp( parent, current, EDITORIAL_STAFF); } - if ( std::string( current.name() ) == "annot" ) { + else if ( std::string( current.name() ) == "annot" ) { success = ReadMeiAnnot( parent, current ); } + else if ( std::string( current.name() ) == "supplied" ) { + success = ReadMeiSupplied( parent, current, EDITORIAL_STAFF ); + } + //content else if ( std::string( current.name() ) == "layer" ) { success = ReadMeiLayer( parent, current); } @@ -1499,6 +1540,9 @@ bool MeiInput::ReadMeiLayerChildren( Object *parent, pugi::xml_node parentNode, else if ( elementName == "space" ) { success = ReadMeiSpace( parent, xmlElement ); } + else if ( elementName == "supplied" ) { + success = ReadMeiSupplied( parent, xmlElement, EDITORIAL_LAYER, filter ); + } else if ( elementName == "syl" ) { success = ReadMeiSyl( parent, xmlElement ); } @@ -1971,23 +2015,40 @@ bool MeiInput::ReadMeiLemOrRdg( Object *parent, pugi::xml_node lemOrRdg, Editori ReadEditorialElement( lemOrRdg, vrvLemOrRdg ); dynamic_cast( parent )->AddLemOrRdg(vrvLemOrRdg); + return ReadMeiEditorialChildren(vrvLemOrRdg, lemOrRdg, level, filter); +} + +bool MeiInput::ReadMeiSupplied( Object *parent, pugi::xml_node supplied, EditorialLevel level, Object *filter ) +{ + Supplied *vrvSupplied = new Supplied();; + + ReadEditorialElement( supplied, vrvSupplied ); + parent->AddEditorialElement(vrvSupplied); + + return ReadMeiEditorialChildren(vrvSupplied, supplied, level, filter); +} + +bool MeiInput::ReadMeiEditorialChildren( Object *parent, pugi::xml_node parentNode, EditorialLevel level, Object *filter ) +{ + assert( dynamic_cast( parent ) ); + if (level == EDITORIAL_SYSTEM) { - return ReadMeiSystemChildren(vrvLemOrRdg, lemOrRdg); + return ReadMeiSystemChildren(parent, parentNode); } else if (level == EDITORIAL_SCOREDEF) { - return ReadMeiScoreDefChildren(vrvLemOrRdg, lemOrRdg); + return ReadMeiScoreDefChildren(parent, parentNode); } else if (level == EDITORIAL_STAFFGRP) { - return ReadMeiStaffGrpChildren(vrvLemOrRdg, lemOrRdg); + return ReadMeiStaffGrpChildren(parent, parentNode); } else if (level == EDITORIAL_MEASURE) { - return ReadMeiMeasureChildren(vrvLemOrRdg, lemOrRdg); + return ReadMeiMeasureChildren(parent, parentNode); } else if (level == EDITORIAL_STAFF) { - return ReadMeiStaffChildren(vrvLemOrRdg, lemOrRdg); + return ReadMeiStaffChildren(parent, parentNode); } else if (level == EDITORIAL_LAYER) { - return ReadMeiLayerChildren(vrvLemOrRdg, lemOrRdg, filter); + return ReadMeiLayerChildren(parent, parentNode, filter); } else { return false; @@ -2094,12 +2155,17 @@ void MeiInput::AddMeasureElement(Object *parent, MeasureElement *element) bool MeiInput::ReadScoreBasedMei( pugi::xml_node element ) { bool success = true; + // editorial if ( (std::string( element.name() ) == "app") ) { success = ReadMeiApp( m_system, element, EDITORIAL_SYSTEM ); } - if ( (std::string( element.name() ) == "annot") ) { + else if ( (std::string( element.name() ) == "annot") ) { success = ReadMeiAnnot( m_system, element ); } + else if ( (std::string( element.name() ) == "supplied") ) { + success = ReadMeiSupplied( m_system, element, EDITORIAL_SYSTEM ); + } + // content else if ( std::string( element.name() ) == "measure" ) { // This is the call that will put us back on the page-based reading loop success = ReadMeiMeasure( m_system, element ); From 64a6cba76f7d3e24951f64882705b32d49a67d59 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Mon, 3 Aug 2015 23:54:36 +0100 Subject: [PATCH 034/114] Updating to emscripten 1.34 (removing JS function wrapper) --- emscripten/build.sh | 2 +- emscripten/verovio-wrapper-end.js | 1 - emscripten/verovio-wrapper-start.js | 1 - src/object.cpp | 12 ++++++++---- 4 files changed, 9 insertions(+), 7 deletions(-) delete mode 100644 emscripten/verovio-wrapper-end.js delete mode 100644 emscripten/verovio-wrapper-start.js diff --git a/emscripten/build.sh b/emscripten/build.sh index b87d51433b7..4313e860687 100755 --- a/emscripten/build.sh +++ b/emscripten/build.sh @@ -183,7 +183,7 @@ if [ $? -eq 0 ]; then if [ "$WEBWORKER" = true ]; then cat build/verovio.js verovio-proxy.js > "build/$FILENAME" else - cat verovio-wrapper-start.js build/verovio.js verovio-wrapper-end.js verovio-proxy.js verovio-unload-listener.js > "build/$FILENAME" + cat build/verovio.js verovio-proxy.js verovio-unload-listener.js > "build/$FILENAME" fi # all good echo "build/$FILENAME written" diff --git a/emscripten/verovio-wrapper-end.js b/emscripten/verovio-wrapper-end.js deleted file mode 100644 index 2d9c82a92f7..00000000000 --- a/emscripten/verovio-wrapper-end.js +++ /dev/null @@ -1 +0,0 @@ -})() \ No newline at end of file diff --git a/emscripten/verovio-wrapper-start.js b/emscripten/verovio-wrapper-start.js deleted file mode 100644 index 7410c620771..00000000000 --- a/emscripten/verovio-wrapper-start.js +++ /dev/null @@ -1 +0,0 @@ -(function() { \ No newline at end of file diff --git a/src/object.cpp b/src/object.cpp index 589bcf1dda0..a7e1b31413d 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -417,7 +417,8 @@ Object *Object::GetFirstChild( const std::type_info *elementType ) int i; for (iter = m_children.begin(), i = 0; iter != m_children.end(); ++iter, i++) { - if ( typeid(**iter) == *elementType ) + Object *o = *iter; + if ( typeid(*o) == *elementType ) { return *iter; } @@ -447,7 +448,8 @@ Object *Object::GetNextSibling( const std::type_info *elementType ) if ( !elementType ) { return *iter; } - if ( typeid(**iter) == *elementType ) + Object *o = *iter; + if ( typeid(*o) == *elementType ) { return *iter; } @@ -477,7 +479,8 @@ Object *Object::GetPreviousSibling( const std::type_info *elementType ) if ( !elementType ) { return *iter; } - if ( typeid(**iter) == *elementType ) + Object *o = *iter; + if ( typeid(*o) == *elementType ) { return *iter; } @@ -560,7 +563,8 @@ void Object::Process(Functor *functor, ArrayPtrVoid params, Functor *endFunctor, for (attComparisonIter = filters->begin(); attComparisonIter != filters->end(); attComparisonIter++) { // if yes, we will use it (*attComparisonIter) for evaluating if the object matches // the attribute (see below) - if ((*attComparisonIter)->GetType() == &typeid(**iter)) { + Object *o = *iter; + if ((*attComparisonIter)->GetType() == &typeid(*o)) { hasAttComparison = true; break; } From f6d4b41ce6e2e3a7e1a03379c8ed7300ab48007f Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Wed, 5 Aug 2015 09:59:17 +0100 Subject: [PATCH 035/114] Adding att.source to lem, rdg, and supplied --- include/vrv/doc.h | 5 ----- include/vrv/editorial.h | 9 ++++++--- include/vrv/iomei.h | 3 ++- src/editorial.cpp | 12 ++++++++--- src/iomei.cpp | 45 +++++++++++++++++++++++++++-------------- 5 files changed, 47 insertions(+), 27 deletions(-) diff --git a/include/vrv/doc.h b/include/vrv/doc.h index 523b0d0c837..9697c94538f 100644 --- a/include/vrv/doc.h +++ b/include/vrv/doc.h @@ -212,11 +212,6 @@ class Doc: public Object */ Style *m_style; - /** - * The source id. Exact use to be clarified. - */ - std::string m_source; - /** * Holds the top scoreDef. * In a standard MEI file, this is the encoded before the first
. diff --git a/include/vrv/editorial.h b/include/vrv/editorial.h index ad6f682f3f2..0510fe57d4c 100644 --- a/include/vrv/editorial.h +++ b/include/vrv/editorial.h @@ -134,7 +134,8 @@ class App: public EditorialElement // Lem //---------------------------------------------------------------------------- -class Lem: public EditorialElement +class Lem: public EditorialElement, + public AttSource { public: /** @@ -162,7 +163,8 @@ class Lem: public EditorialElement // Rdg //---------------------------------------------------------------------------- -class Rdg: public EditorialElement +class Rdg: public EditorialElement, + public AttSource { public: /** @@ -190,7 +192,8 @@ class Rdg: public EditorialElement // Supplied //---------------------------------------------------------------------------- -class Supplied: public EditorialElement +class Supplied: public EditorialElement, + public AttSource { public: /** diff --git a/include/vrv/iomei.h b/include/vrv/iomei.h index f019076f39d..548ed78ef6a 100644 --- a/include/vrv/iomei.h +++ b/include/vrv/iomei.h @@ -336,7 +336,8 @@ class MeiInput: public FileInputStream ///@{ bool ReadMeiApp( Object *parent, pugi::xml_node app, EditorialLevel level, Object *filter = NULL ); bool ReadMeiAppChildren( Object *parent, pugi::xml_node parentNode, EditorialLevel level, Object *filter = NULL ); - bool ReadMeiLemOrRdg( Object *parent, pugi::xml_node lemOrRdg, EditorialLevel level, Object *filter = NULL ); + bool ReadMeiLem( Object *parent, pugi::xml_node lem, EditorialLevel level, Object *filter = NULL ); + bool ReadMeiRdg( Object *parent, pugi::xml_node rdg, EditorialLevel level, Object *filter = NULL ); bool ReadMeiSupplied( Object *parent, pugi::xml_node supplied, EditorialLevel level, Object *filter = NULL ); bool ReadMeiEditorialChildren( Object *parent, pugi::xml_node supplied, EditorialLevel level, Object *filter = NULL ); bool ReadMeiAnnot( Object *parent, pugi::xml_node annot ); diff --git a/src/editorial.cpp b/src/editorial.cpp index 2f44ca20e57..a15033b04ca 100644 --- a/src/editorial.cpp +++ b/src/editorial.cpp @@ -148,7 +148,8 @@ void App::AddLemOrRdg(EditorialElement *child) //---------------------------------------------------------------------------- Lem::Lem( ): - EditorialElement("lem-") + EditorialElement("lem-"), + AttSource() { Reset(); } @@ -160,6 +161,7 @@ Lem::~Lem() void Lem::Reset() { EditorialElement::Reset(); + ResetSource(); } //---------------------------------------------------------------------------- @@ -167,7 +169,8 @@ void Lem::Reset() //---------------------------------------------------------------------------- Rdg::Rdg( ): - EditorialElement("rdg-") + EditorialElement("rdg-"), + AttSource() { Reset(); } @@ -179,6 +182,7 @@ Rdg::~Rdg() void Rdg::Reset() { EditorialElement::Reset(); + ResetSource(); } //---------------------------------------------------------------------------- @@ -186,7 +190,8 @@ void Rdg::Reset() //---------------------------------------------------------------------------- Supplied::Supplied( ): - EditorialElement("supplied-") + EditorialElement("supplied-"), + AttSource() { Reset(); } @@ -198,6 +203,7 @@ Supplied::~Supplied() void Supplied::Reset() { EditorialElement::Reset(); + ResetSource(); } //---------------------------------------------------------------------------- diff --git a/src/iomei.cpp b/src/iomei.cpp index 0505cce7b03..5ff0d33f211 100644 --- a/src/iomei.cpp +++ b/src/iomei.cpp @@ -760,18 +760,21 @@ bool MeiOutput::WriteMeiApp( pugi::xml_node currentNode, App *app ) bool MeiOutput::WriteMeiLem( pugi::xml_node currentNode, Lem *lem ) { WriteEditorialElement(currentNode, lem); + lem->WriteSource( currentNode ); return true; }; bool MeiOutput::WriteMeiRdg( pugi::xml_node currentNode, Rdg *rdg ) { WriteEditorialElement(currentNode, rdg); + rdg->WriteSource( currentNode ); return true; }; bool MeiOutput::WriteMeiSupplied( pugi::xml_node currentNode, Supplied *supplied ) { WriteEditorialElement(currentNode, supplied); + supplied->WriteSource( currentNode ); return true; }; @@ -1964,10 +1967,10 @@ bool MeiInput::ReadMeiAppChildren( Object *parent, pugi::xml_node parentNode, Ed for( current = parentNode.first_child( ); current; current = current.next_sibling( ) ) { if (!success) break; if ( std::string( current.name() ) == "lem" ) { - success = ReadMeiLemOrRdg( parent, current, level, filter); + success = ReadMeiLem( parent, current, level, filter); } else if ( std::string( current.name() ) == "rdg" ) { - success = ReadMeiLemOrRdg( parent, current, level, filter); + success = ReadMeiRdg( parent, current, level, filter); } else { LogWarning("Unsupported '<%s>' within ", current.name() ); @@ -1997,32 +2000,44 @@ bool MeiInput::ReadMeiAppChildren( Object *parent, pugi::xml_node parentNode, Ed return success; } -bool MeiInput::ReadMeiLemOrRdg( Object *parent, pugi::xml_node lemOrRdg, EditorialLevel level, Object *filter ) - +bool MeiInput::ReadMeiLem( Object *parent, pugi::xml_node lem, EditorialLevel level, Object *filter ) { assert( dynamic_cast( parent ) ); - EditorialElement *vrvLemOrRdg; - if ( std::string( lemOrRdg.name() ) == "lem" ) { - vrvLemOrRdg = new Lem(); - } - else { - vrvLemOrRdg = new Rdg(); - } + Lem *vrvLem = new Lem(); // By default make them all hidden. MeiInput::ReadMeiAppChildren will make one visible. - vrvLemOrRdg->m_visibility = Hidden; + vrvLem->m_visibility = Hidden; - ReadEditorialElement( lemOrRdg, vrvLemOrRdg ); - dynamic_cast( parent )->AddLemOrRdg(vrvLemOrRdg); + ReadEditorialElement( lem, vrvLem ); + vrvLem->ReadSource( lem ); - return ReadMeiEditorialChildren(vrvLemOrRdg, lemOrRdg, level, filter); + dynamic_cast( parent )->AddLemOrRdg( vrvLem ); + + return ReadMeiEditorialChildren(vrvLem, lem, level, filter); } +bool MeiInput::ReadMeiRdg( Object *parent, pugi::xml_node rdg, EditorialLevel level, Object *filter ) +{ + assert( dynamic_cast( parent ) ); + + Rdg *vrvRdg = new Rdg(); + // By default make them all hidden. MeiInput::ReadMeiAppChildren will make one visible. + vrvRdg->m_visibility = Hidden; + + ReadEditorialElement( rdg, vrvRdg ); + vrvRdg->ReadSource( rdg ); + + dynamic_cast( parent )->AddLemOrRdg(vrvRdg); + + return ReadMeiEditorialChildren(vrvRdg, rdg, level, filter); +} + bool MeiInput::ReadMeiSupplied( Object *parent, pugi::xml_node supplied, EditorialLevel level, Object *filter ) { Supplied *vrvSupplied = new Supplied();; ReadEditorialElement( supplied, vrvSupplied ); + vrvSupplied->ReadSource( supplied ); parent->AddEditorialElement(vrvSupplied); return ReadMeiEditorialChildren(vrvSupplied, supplied, level, filter); From 3e0ae112ca58e23b192ca156768fb414d6058302 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Wed, 5 Aug 2015 14:23:36 +0100 Subject: [PATCH 036/114] Commenting alignment types --- include/vrv/aligner.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/vrv/aligner.h b/include/vrv/aligner.h index 7a6013dbb1e..c0fc33c6b8f 100644 --- a/include/vrv/aligner.h +++ b/include/vrv/aligner.h @@ -24,12 +24,14 @@ class MeasureAligner; * this to avoid notes aligning to it */ enum AlignmentType { + // Non-justiable ALIGNMENT_MEASURE_START = 0, ALIGNMENT_BARLINE, ALIGNMENT_CLEF_ATTR, ALIGNMENT_KEYSIG_ATTR, ALIGNMENT_MENSUR_ATTR, ALIGNMENT_METERSIG_ATTR, + // Justifiable ALIGNMENT_CLEF, ALIGNMENT_KEYSIG, ALIGNMENT_MENSUR, From 018d46e3b8ffc6acc300fc6bfa619dd8d552fdec Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Thu, 6 Aug 2015 23:53:50 +0200 Subject: [PATCH 037/114] Grace alignment finalized --- include/vrv/aligner.h | 9 +-------- src/aligner.cpp | 35 ++++++++--------------------------- src/doc.cpp | 2 -- src/layerelement.cpp | 4 ++-- src/object.cpp | 37 +++++++++++++++++++++---------------- src/page.cpp | 2 +- src/svgdevicecontext.cpp | 4 ++-- 7 files changed, 35 insertions(+), 58 deletions(-) diff --git a/include/vrv/aligner.h b/include/vrv/aligner.h index 6c6a38cf56c..871cb8817f7 100644 --- a/include/vrv/aligner.h +++ b/include/vrv/aligner.h @@ -184,9 +184,6 @@ class Alignment: public Object void SetMaxWidth( int maxWidth ); int GetMaxWidth() { return m_maxWidth; }; - void SetMaxLeftSide( int maxLeftSide ); - int GetMaxLeftSide() { return m_maxLeftSide; }; - /** * @name Set and get the time value of the alignment */ @@ -262,10 +259,6 @@ class Alignment: public Object * alignment of the end of the measure (ALIGNMENT_MEASURE_END). */ int m_maxWidth; - /** - * Stores the maximum left side bearing (distance between the left-most point and the x-rel) - */ - int m_maxLeftSide; /** * Stores the time at which the alignment occur. * It is set by Object::AlignHorizontally. @@ -309,7 +302,7 @@ class MeasureAligner: public Object */ virtual void Reset(); - Alignment* GetAlignmentAtTime( double time, AlignmentType type ); + Alignment* GetAlignmentAtTime( double time, AlignmentType type, bool hasEndAlignment = true ); /** * Keep the maximum time of the measure. diff --git a/src/aligner.cpp b/src/aligner.cpp index 511c748ad16..cfaf57cb989 100644 --- a/src/aligner.cpp +++ b/src/aligner.cpp @@ -155,7 +155,7 @@ void MeasureAligner::AddAlignment( Alignment *alignment, int idx ) } } -Alignment* MeasureAligner::GetAlignmentAtTime( double time, AlignmentType type ) +Alignment* MeasureAligner::GetAlignmentAtTime( double time, AlignmentType type, bool hasEndAlignment ) { int i; int idx = -1; // the index if we reach the end. @@ -168,19 +168,7 @@ Alignment* MeasureAligner::GetAlignmentAtTime( double time, AlignmentType type ) double alignment_time = alignment->GetTime(); if ( vrv::AreEqual( alignment_time, time ) ) { - // we found a default alignment, but we are inserting a grace note (another layer) - // we need the grace note to be inserted before so we stop here - // this does not work when we have grace notes simultanously at different voices because - // they will all have their own alignment. We need something more sophisticated that takes - // care of the staff/layer number (or using the layer uuid?) - if ( (alignment->GetType() == ALIGNMENT_DEFAULT) && (type == ALIGNMENT_GRACENOTE) ) { - return alignment; - } - else if ( (alignment->GetType() == ALIGNMENT_GRACENOTE) && (type == ALIGNMENT_DEFAULT) ) { - //alignment->SetType(ALIGNMENT_DEFAULT); - return alignment; - } - else if (alignment->GetType() == type) { + if (alignment->GetType() == type) { return alignment; } else if ( alignment->GetType() > type ) { @@ -196,9 +184,10 @@ Alignment* MeasureAligner::GetAlignmentAtTime( double time, AlignmentType type ) } // nothing found if ( idx == -1 ) { - // this is tricky! Because we want m_rightAlignment to always stay at the end, + // this is tricky! Because we want m_rightAlignment to always stay at the end (with hasEndAlignment), // we always to insert _before_ the last one - m_rightAlignment is added in Reset() - idx = GetAlignmentCount() - 1; + if ( hasEndAlignment ) idx = GetAlignmentCount() - 1; + else idx = GetAlignmentCount(); } Alignment *newAlignement = new Alignment( time, type ); AddAlignment( newAlignement, idx ); @@ -240,8 +229,10 @@ void GraceAligner::AlignStack( ) Note *note = dynamic_cast( m_noteStack[i-1] ); // get the duration of the event double duration = note->LayerElement::GetAlignmentDuration( NULL, NULL, false ); + // Time goes backward with grace notes time -= duration; - note->SetGraceAlignment( this->GetAlignmentAtTime( time, ALIGNMENT_DEFAULT ) ); + // Set the hasEndAlignment to false with grace notes because we don't have an end-measure alignment + note->SetGraceAlignment( this->GetAlignmentAtTime( time, ALIGNMENT_DEFAULT, false ) ); } m_noteStack.clear(); } @@ -256,7 +247,6 @@ Alignment::Alignment( ): m_xRel = 0; m_xShift = 0; m_maxWidth = 0; - m_maxLeftSide = 0; m_time = 0.0; m_type = ALIGNMENT_DEFAULT; m_graceAligner = NULL; @@ -268,7 +258,6 @@ Alignment::Alignment( double time, AlignmentType type ): m_xRel = 0; m_xShift = 0; m_maxWidth = 0; - m_maxLeftSide = 0; m_time = time; m_type = type; m_graceAligner = NULL; @@ -300,14 +289,6 @@ void Alignment::SetMaxWidth( int maxWidth ) m_maxWidth = maxWidth; } } - -void Alignment::SetMaxLeftSide( int maxLeftSide ) -{ - if ( maxLeftSide > m_maxLeftSide ) { - LogDebug("Max left size %d", maxLeftSide); - m_maxLeftSide = maxLeftSide; - } -} GraceAligner *Alignment::GetGraceAligner( ) { diff --git a/src/doc.cpp b/src/doc.cpp index 94be1332d18..a04118fa11c 100644 --- a/src/doc.cpp +++ b/src/doc.cpp @@ -395,7 +395,6 @@ int Doc::GetPageCount( ) short Doc::GetLeftMargin( const std::type_info *elementType ) { - return 0; if (typeid(Barline) == *elementType) return 5; else if (typeid(BarlineAttr) == *elementType) return 25; else if (typeid(Chord) == *elementType) return 10; @@ -408,7 +407,6 @@ short Doc::GetLeftMargin( const std::type_info *elementType ) short Doc::GetRightMargin( const std::type_info *elementType ) { - return 0; if (typeid(Clef) == *elementType) return 30; else if (typeid(KeySig) == *elementType) return 30; else if (typeid(Mensur) == *elementType) return 30; diff --git a/src/layerelement.cpp b/src/layerelement.cpp index 62baf49614d..5a0610663ee 100644 --- a/src/layerelement.cpp +++ b/src/layerelement.cpp @@ -376,7 +376,7 @@ int LayerElement::AlignHorizontally( ArrayPtrVoid params ) type = ALIGNMENT_MULTIREST; } else if ( this->IsGraceNote() ) { - //type = ALIGNMENT_GRACENOTE; + type = ALIGNMENT_GRACENOTE; } else if ( this->IsBeam() || this->IsTuplet() || this->IsVerse() || this->IsSyl() ) { type = ALIGNMENT_CONTAINER; @@ -455,7 +455,7 @@ int LayerElement::SetDrawingXY( ArrayPtrVoid params ) Note *note = dynamic_cast(this); if (note && note->HasGraceAlignment() ) { this->SetDrawingX( this->GetDrawingX() - note->GetAlignment()->GetGraceAligner()->GetWidth() - + note->GetGraceAlignment()->GetXRel() - note->GetAlignment()->GetMaxLeftSide() ); + + note->GetGraceAlignment()->GetXRel() ); } } else diff --git a/src/object.cpp b/src/object.cpp index 503a09588f5..d21aa0d27f9 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -1105,8 +1105,8 @@ int Object::SetBoundingBoxGraceXShift( ArrayPtrVoid params ) } // the next minimal position if given by the right side of the bounding box + the spacing of the element - //(*min_pos) = note->GetGraceAlignment()->GetXRel() + note->m_contentBB_x2 + doc->GetRightMargin(&typeid(*note)) * doc->m_drawingUnit[0] / PARAM_DENOMINATOR; - (*min_pos) = note->GetGraceAlignment()->GetXRel() + note->m_contentBB_x2; + (*min_pos) = note->GetGraceAlignment()->GetXRel() + note->m_contentBB_x2 + doc->GetRightMargin(&typeid(*note)) * doc->m_drawingUnit[0] / PARAM_DENOMINATOR; + //(*min_pos) = note->GetGraceAlignment()->GetXRel() + note->m_contentBB_x2; //note->GetGraceAlignment()->SetMaxWidth( note->m_contentBB_x2 + doc->GetRightMargin(&typeid(*note)) * doc->m_drawingUnit[0] / PARAM_DENOMINATOR ); note->GetGraceAlignment()->SetMaxWidth( note->m_contentBB_x2 ); @@ -1196,7 +1196,8 @@ int Object::SetBoundingBoxXShift( ArrayPtrVoid params ) // the negative offset it the part of the bounding box that overflows on the left // |____x_____| // ---- = negative offset - int negative_offset = - (current->m_contentBB_x1) + (doc->GetLeftMargin(&typeid(*current)) * doc->m_drawingUnit[0] / PARAM_DENOMINATOR); + int negative_offset = - (current->m_contentBB_x1); + if (!current->IsGraceNote()) negative_offset += (doc->GetLeftMargin(&typeid(*current)) * doc->m_drawingUnit[0] / PARAM_DENOMINATOR); // this should never happen (but can with glyphs not exactly registered at position x=0 in the SMuFL font used if ( negative_offset < 0 ) negative_offset = 0; @@ -1210,28 +1211,32 @@ int Object::SetBoundingBoxXShift( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } - if (current->IsGraceNote()) { - current->GetAlignment()->SetXShift( current->GetAlignment()->GetGraceAligner()->GetWidth() ); - //LogDebug("Grace group with %d notes", current->GetAlignment()->GetGraceAligner()->GetChildCount() ); - return FUNCTOR_CONTINUE; - } - else { - current->GetAlignment()->SetMaxLeftSide( negative_offset ); + // with a grace note, also take into account the full with of the group given by the GraceAligner + if (current->GetAlignment()->HasGraceAligner()) { + negative_offset += current->GetAlignment()->GetGraceAligner()->GetWidth(); } - if (current->GetAlignment()->HasGraceAligner() && !current->IsGraceNote()) { - LogDebug("Has grace alignment, %s", current->GetClassName().c_str()); - negative_offset += current->GetAlignment()->GetGraceAligner()->GetWidth(); + int currentX = current->GetAlignment()->GetXRel(); + // with grace note, take into account the position of the note in the grace group + if (current->IsGraceNote()) { + Note *note = dynamic_cast(current); + currentX += note->GetGraceAlignment()->GetXRel(); } // check if the element overlaps with the preceeding one given by (*min_pos) - int overlap = (*min_pos) - current->GetAlignment()->GetXRel() + negative_offset; + int overlap = (*min_pos) - currentX + negative_offset; - if ( (current->GetAlignment()->GetXRel() - negative_offset) < (*min_pos) ) { + if ( (currentX - negative_offset) < (*min_pos) ) { current->GetAlignment()->SetXShift( overlap ); } - //LogDebug("%s min_pos %d; negative offset %d; drawXRel %d; overlap %d; m_drawingX %d", current->GetClassName().c_str(), (*min_pos), negative_offset, current->GetAlignment()->GetXRel(), overlap, current->GetDrawingX() ); + // do not ajust the min pos and the max width since this is already handled by + // the GraceAligner + if ( current->IsGraceNote() ) { + (*min_pos) = current->GetAlignment()->GetXRel(); + current->GetAlignment()->SetMaxWidth( 0 ); + return FUNCTOR_CONTINUE; + } // the next minimal position if given by the right side of the bounding box + the spacing of the element (*min_pos) = current->GetAlignment()->GetXRel() + current->m_contentBB_x2 + doc->GetRightMargin(&typeid(*current)) * doc->m_drawingUnit[0] / PARAM_DENOMINATOR; diff --git a/src/page.cpp b/src/page.cpp index ba4690338ba..0b453a92b78 100644 --- a/src/page.cpp +++ b/src/page.cpp @@ -148,7 +148,7 @@ void Page::LayOutHorizontally( ) Functor setAlignmentX( &Object::SetAligmentXPos ); // Special case: because we redirect the functor, pass is a parameter to itself (!) params.push_back( &setAlignmentX ); - //this->Process( &setAlignmentX, params ); + this->Process( &setAlignmentX, params ); // Render it for filling the bounding boxing View view; diff --git a/src/svgdevicecontext.cpp b/src/svgdevicecontext.cpp index 2eff9b80d96..865013ba163 100644 --- a/src/svgdevicecontext.cpp +++ b/src/svgdevicecontext.cpp @@ -181,7 +181,7 @@ void SvgDeviceContext::ResumeGraphic( DocObject *object, std::string gId ) void SvgDeviceContext::EndGraphic(DocObject *object, View *view ) { - bool drawBoundingBox = true; + bool drawBoundingBox = false; if (drawBoundingBox && view) // && view->DrawBoundingBoxes()) // DrawBoundingBoxes is not defined { SetPen( AxRED, 10, AxDOT_DASH ); @@ -460,7 +460,7 @@ void SvgDeviceContext::DrawRoundedRectangle(int x, int y, int width, int height, rectChild.append_attribute( "height" ) = height; rectChild.append_attribute( "rx" ) = radius; rectChild.append_attribute( "style") = StringFormat("stroke-width: %d;", m_penStack.top().GetWidth()).c_str(); - rectChild.append_attribute( "fill-opacity" ) = "0.0"; // for empy rectangles + //rectChild.append_attribute( "fill-opacity" ) = "0.0"; // for empty rectangles with bounding boxes } void SvgDeviceContext::StartText(int x, int y, char alignement) From 3579914a55fab230297b7a59c6644cf04a8d5e76 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Fri, 7 Aug 2015 00:16:17 +0200 Subject: [PATCH 038/114] Reseting pointers properly --- include/vrv/note.h | 1 + src/layerelement.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/vrv/note.h b/include/vrv/note.h index 9bd944e87ab..d7fbc83994a 100644 --- a/include/vrv/note.h +++ b/include/vrv/note.h @@ -83,6 +83,7 @@ class Note: public LayerElement, public DurationInterface, public PitchInterface Alignment *GetGraceAlignment(); void SetGraceAlignment( Alignment *graceAlignment ); bool HasGraceAlignment( ) { return (m_graceAlignment != NULL); }; + void ResetGraceAlignment( ) { m_graceAlignment = NULL; }; ///@} /** diff --git a/src/layerelement.cpp b/src/layerelement.cpp index 5a0610663ee..14fa451d56e 100644 --- a/src/layerelement.cpp +++ b/src/layerelement.cpp @@ -139,6 +139,10 @@ LayerElement *LayerElement::GetChildCopy( bool newUuid ) void LayerElement::ResetHorizontalAlignment() { m_drawingX = 0; + m_alignment = NULL; + if ( this->IsNote() ) { + dynamic_cast(this)->ResetGraceAlignment(); + } } bool LayerElement::IsAccid( ) From 10c08ca023881ed86b12edcaa767e7d15ef6b5ca Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Fri, 7 Aug 2015 22:43:55 +0200 Subject: [PATCH 039/114] Removing m_cueSize and fixing acciacatura --- include/vrv/accid.h | 5 ++ include/vrv/att.h | 3 ++ include/vrv/attdef.h | 10 ++++ include/vrv/layerelement.h | 12 +++-- include/vrv/note.h | 4 +- include/vrv/style.h | 2 +- libmei/atts_cmn.cpp | 12 ++--- libmei/atts_cmn.h | 6 +-- src/att.cpp | 27 ++++++++++ src/beam.cpp | 4 +- src/iomei.cpp | 20 ++------ src/iopae.cpp | 10 ++-- src/layerelement.cpp | 13 +++-- src/note.cpp | 6 ++- src/style.cpp | 4 +- src/view_beam.cpp | 6 +-- src/view_element.cpp | 102 ++++++++++++++++++++++++------------- src/view_mensural.cpp | 12 +++-- src/view_tuplet.cpp | 5 +- 19 files changed, 170 insertions(+), 93 deletions(-) diff --git a/include/vrv/accid.h b/include/vrv/accid.h index e9dec144259..66c9c45b147 100644 --- a/include/vrv/accid.h +++ b/include/vrv/accid.h @@ -49,6 +49,11 @@ class Accid: public LayerElement, public PositionInterface, private: public: + /** + * Indicates if is cue size for accid object created for @accid. + * See Note::PreparePointersByLayer and View::DrawAccid + */ + bool m_drawingCueSize; private: diff --git a/include/vrv/att.h b/include/vrv/att.h index 94bcc2ff30e..605086f882b 100644 --- a/include/vrv/att.h +++ b/include/vrv/att.h @@ -131,6 +131,9 @@ class Att std::string FuncToStr(data_FUNC data); data_FUNC StrToFunc(std::string value); + + std::string GraceToStr(data_GRACE data); + data_GRACE StrToGrace(std::string value); std::string KeySignatureToStr(data_KEYSIGNATURE data); data_KEYSIGNATURE StrToKeySignature(std::string value); diff --git a/include/vrv/attdef.h b/include/vrv/attdef.h index 2b8bca3e902..adc02f057da 100644 --- a/include/vrv/attdef.h +++ b/include/vrv/attdef.h @@ -197,6 +197,16 @@ enum data_FONTWEIGHT { FONTWEIGHT_normal }; +/** + * MEI data.GRACE + */ +enum data_GRACE { + GRACE_NONE = 0, + GRACE_acc, + GRACE_unacc, + GRACE_unknown +}; + /** * MEI values for @func (no datatype in MEI) diff --git a/include/vrv/layerelement.h b/include/vrv/layerelement.h index 846c3a08c19..8cb18258240 100644 --- a/include/vrv/layerelement.h +++ b/include/vrv/layerelement.h @@ -100,6 +100,11 @@ class LayerElement: public DocObject bool IsVerse(); bool IsGraceNote(); ///@} + + /** + * Returns true if the element is a note or a note child and the note has a @grace + */ + bool IsCueSize(); Alignment *GetAlignment() { return m_alignment; }; @@ -134,10 +139,9 @@ class LayerElement: public DocObject public: /** Absolute position X. This is used for facsimile (transcription) encoding */ int m_xAbs; - /** Indicates if cue size - to be changed to MEI equivalent (size="cue") */ - bool m_cueSize; - - /** If this is a note, store here the stem coordinates (useful for ex. tuplets) */ + /** + * If this is a note, store here the stem coordinates (useful for ex. tuplets) + */ Point m_drawingStemStart; // beginning point, the one near the note Point m_drawingStemEnd; // end point (!), near beam or stem /** diff --git a/include/vrv/note.h b/include/vrv/note.h index d7fbc83994a..361f88dbfb8 100644 --- a/include/vrv/note.h +++ b/include/vrv/note.h @@ -44,6 +44,7 @@ typedef std::vector ChordCluster; class Note: public LayerElement, public DurationInterface, public PitchInterface, public AttColoration, + public AttGraced, public AttNoteLogMensural, public AttStemmed, public AttTiepresent @@ -138,9 +139,6 @@ class Note: public LayerElement, public DurationInterface, public PitchInterface private: public: - /** indicates if the appoggiatura is slashed (i.e. it is an acciaccatura) - used with cueSize = true */ - bool m_acciaccatura; // To be changed to Att grace="acc" /** embellishment on this note **/ unsigned int m_embellishment; // To be changed to Att diff --git a/include/vrv/style.h b/include/vrv/style.h index 8765791f661..2b2c79913ed 100644 --- a/include/vrv/style.h +++ b/include/vrv/style.h @@ -43,7 +43,7 @@ namespace vrv { #define MIN_BARLINE_WIDTH 1.0 #define MAX_BARLINE_WIDTH 8.0 -#define DEFAULT_STAFFLINE_WITDH 3.0 +#define DEFAULT_STAFFLINE_WITDH 2.0 #define MIN_STAFFLINE_WIDTH 1.0 #define MAX_STAFFLINE_WIDTH 8.0 diff --git a/libmei/atts_cmn.cpp b/libmei/atts_cmn.cpp index ea1d4731264..60c57d7ae31 100644 --- a/libmei/atts_cmn.cpp +++ b/libmei/atts_cmn.cpp @@ -725,14 +725,14 @@ AttGraced::~AttGraced() { } void AttGraced::ResetGraced() { - m_grace = ""; + m_grace = GRACE_NONE; m_graceTime = ""; } bool AttGraced::ReadGraced( pugi::xml_node element ) { bool hasAttribute = false; if (element.attribute("grace")) { - this->SetGrace(StrToStr(element.attribute("grace").value())); + this->SetGrace(StrToGrace(element.attribute("grace").value())); element.remove_attribute("grace"); hasAttribute = true; } @@ -747,7 +747,7 @@ bool AttGraced::ReadGraced( pugi::xml_node element ) { bool AttGraced::WriteGraced( pugi::xml_node element ) { bool wroteAttribute = false; if (this->HasGrace()) { - element.append_attribute("grace") = StrToStr(this->GetGrace()).c_str(); + element.append_attribute("grace") = GraceToStr(this->GetGrace()).c_str(); wroteAttribute = true; } if (this->HasGraceTime()) { @@ -759,7 +759,7 @@ bool AttGraced::WriteGraced( pugi::xml_node element ) { bool AttGraced::HasGrace( ) { - return (m_grace != ""); + return (m_grace != GRACE_NONE); } bool AttGraced::HasGraceTime( ) @@ -1873,7 +1873,7 @@ bool Att::SetCmn( Object *element, std::string attrType, std::string attrValue ) if (dynamic_cast(element) ) { AttGraced *att = dynamic_cast(element); if (attrType == "grace") { - att->SetGrace(att->StrToStr(attrValue)); + att->SetGrace(att->StrToGrace(attrValue)); return true; } if (attrType == "graceTime") { @@ -2165,7 +2165,7 @@ void Att::GetCmn( Object *element, ArrayOfStrAttr *attributes ) { if (dynamic_cast(element) ) { AttGraced *att = dynamic_cast(element); if (att->HasGrace()) { - attributes->push_back(std::make_pair("grace", att->StrToStr(att->GetGrace()))); + attributes->push_back(std::make_pair("grace", att->GraceToStr(att->GetGrace()))); } if (att->HasGraceTime()) { attributes->push_back(std::make_pair("graceTime", att->StrToStr(att->GetGraceTime()))); diff --git a/libmei/atts_cmn.h b/libmei/atts_cmn.h index a3b0c92db9d..51ed6cc4e25 100644 --- a/libmei/atts_cmn.h +++ b/libmei/atts_cmn.h @@ -664,8 +664,8 @@ class AttGraced: public Att * to the default value) **/ ///@{ - void SetGrace(std::string grace_) { m_grace = grace_; }; - std::string GetGrace() const { return m_grace; }; + void SetGrace(data_GRACE grace_) { m_grace = grace_; }; + data_GRACE GetGrace() const { return m_grace; }; bool HasGrace( ); // @@ -680,7 +680,7 @@ class AttGraced: public Att * Marks a note or chord as a "grace" (without a definitive written duration) and * records from which other note/chord it should "steal" time. **/ - std::string m_grace; + data_GRACE m_grace; /** Records the amount of time to be "stolen" from a non-grace note/chord. **/ std::string m_graceTime; diff --git a/src/att.cpp b/src/att.cpp index 24f0f3f7515..16b3c9d09b5 100644 --- a/src/att.cpp +++ b/src/att.cpp @@ -434,6 +434,33 @@ data_FUNC Att::StrToFunc(std::string value) return FUNC_NONE; } +std::string Att::GraceToStr(data_GRACE data) +{ + std::string value; + switch(data) + { + case GRACE_acc : value = "acc"; break; + case GRACE_unacc : value = "unacc"; break; + case GRACE_unknown : value = "unknown"; break; + default: + LogWarning("Unknown mode '%d'", data); + value = ""; + break; + } + return value; +} + +data_GRACE Att::StrToGrace(std::string value) +{ + if (value == "acc") return GRACE_acc; + else if (value == "unacc") return GRACE_unacc; + else if (value == "unknown") return GRACE_unknown; + else { + LogWarning("Unsupported pitch name '%s'", value.c_str() ); + } + return GRACE_NONE; +} + std::string Att::KeySignatureToStr(data_KEYSIGNATURE data) { std::string value; diff --git a/src/beam.cpp b/src/beam.cpp index 5bfb7d686a1..e7bf32b33a5 100644 --- a/src/beam.cpp +++ b/src/beam.cpp @@ -70,14 +70,14 @@ void Beam::FilterList( ListOfObjects *childList ) // and the note is cueSize // assume all the beam is of grace notes if (childList->begin() == iter) { - if (n->m_cueSize) + if (n->HasGrace()) firstNoteGrace = true; } // if the first note in beam was NOT a grace // we have grace notes embedded in a beam // drop them - if ( !firstNoteGrace && n->m_cueSize == true) + if ( !firstNoteGrace && n->HasGrace() == true) iter = childList->erase( iter ); else iter++; diff --git a/src/iomei.cpp b/src/iomei.cpp index 5ff0d33f211..5b06bead4b7 100644 --- a/src/iomei.cpp +++ b/src/iomei.cpp @@ -548,11 +548,7 @@ void MeiOutput::WriteMeiChord( pugi::xml_node currentNode, Chord *chord ) chord->WriteCommon(currentNode); chord->WriteStemmed(currentNode); chord->WriteTiepresent(currentNode); - - if ( chord->m_cueSize ) { - currentNode.append_attribute( "grace" ) = "unknown"; - } - + return; } @@ -623,13 +619,11 @@ void MeiOutput::WriteMeiNote( pugi::xml_node currentNode, Note *note ) WriteDurationInterface(currentNode, note); WritePitchInterface(currentNode, note); note->WriteColoration(currentNode); + note->WriteGraced(currentNode); note->WriteNoteLogMensural(currentNode); note->WriteStemmed(currentNode); note->WriteTiepresent(currentNode); - if ( note->m_cueSize ) { - currentNode.append_attribute( "grace" ) = "unknown"; - } return; } @@ -1627,10 +1621,6 @@ bool MeiInput::ReadMeiChord( Object *parent, pugi::xml_node chord) vrvChord->ReadStemmed(chord); vrvChord->ReadTiepresent(chord); - if ( chord.attribute( "grace" ) ) { - vrvChord->m_cueSize = true; - } - AddLayerElement(parent, vrvChord); return ReadMeiLayerChildren(vrvChord, chord); } @@ -1743,15 +1733,11 @@ bool MeiInput::ReadMeiNote( Object *parent, pugi::xml_node note ) ReadDurationInterface(note, vrvNote); ReadPitchInterface(note, vrvNote); vrvNote->ReadColoration(note); + vrvNote->ReadGraced(note); vrvNote->ReadNoteLogMensural(note); vrvNote->ReadStemmed(note); vrvNote->ReadTiepresent(note); - // grace - if ( note.attribute( "grace" ) ) { - vrvNote->m_cueSize = true; // - } - AddLayerElement(parent, vrvNote); // We can drop this once we allow and child diff --git a/src/iopae.cpp b/src/iopae.cpp index 807057d305b..6c795274305 100644 --- a/src/iopae.cpp +++ b/src/iopae.cpp @@ -1185,12 +1185,16 @@ void PaeInput::parseNote(NoteObject note) { // this case is simpler. NOTE a note can not be acciacctura AND appoggiatura // Acciaccatura rests do not exist if (note.acciaccatura && dynamic_cast(element)) { - element->m_cueSize = true; - dynamic_cast(element)->m_acciaccatura = true; + Note *note = dynamic_cast(element); + note->SetDur(DURATION_8); + note->SetGrace(GRACE_acc); + note->SetStemDir(STEMDIRECTION_up); } if (note.appoggiatura > 0) { - element->m_cueSize = true; + Note *note = dynamic_cast(element); + note->SetGrace(GRACE_unacc); + note->SetStemDir(STEMDIRECTION_up); } if (note.beam == BEAM_INITIAL) { diff --git a/src/layerelement.cpp b/src/layerelement.cpp index 14fa451d56e..c4a22ac92b1 100644 --- a/src/layerelement.cpp +++ b/src/layerelement.cpp @@ -64,8 +64,6 @@ void LayerElement::Reset() { DocObject::Reset(); - m_cueSize = false; - m_xAbs = VRV_UNSET; m_drawingX = 0; m_drawingY = 0; @@ -85,8 +83,6 @@ LayerElement& LayerElement::operator=( const LayerElement& element ) { if ( this != &element ) // not self assignement { - // is this necessary? - m_cueSize = element.m_cueSize; // pointers have to be NULL m_parent = NULL; m_alignment = NULL; @@ -219,7 +215,7 @@ bool LayerElement::IsNote() bool LayerElement::IsGraceNote() { Note *note = dynamic_cast(this); - return (note && note->m_cueSize); + return (note && note->HasGrace()); } bool LayerElement::HasPitchInterface() @@ -262,6 +258,13 @@ bool LayerElement::IsVerse() return (dynamic_cast(this)); } +bool LayerElement::IsCueSize() +{ + if (this->IsNote()) return dynamic_cast(this)->HasGrace(); + Note *note = dynamic_cast(this->GetFirstParent(&typeid(Note), MAX_ACCID_DEPTH ) ); + return ( note && ( note->HasGrace() ) ); +} + void LayerElement::AdjustPname( int *pname, int *oct ) { if ((*pname) < PITCHNAME_c) diff --git a/src/note.cpp b/src/note.cpp index e05a2bcd837..bb759aaed31 100644 --- a/src/note.cpp +++ b/src/note.cpp @@ -29,6 +29,7 @@ namespace vrv { Note::Note(): LayerElement("note-"), DurationInterface(), PitchInterface(), AttColoration(), + AttGraced(), AttNoteLogMensural(), AttStemmed(), AttTiepresent() @@ -60,12 +61,12 @@ void Note::Reset() PitchInterface::Reset(); ResetColoration(); + ResetGraced(); ResetNoteLogMensural(); ResetStemmed(); ResetTiepresent(); // TO BE REMOVED - m_acciaccatura = false; m_embellishment = EMB_NONE; // tie pointers ResetDrawingTieAttr(); @@ -254,7 +255,8 @@ int Note::PreparePointersByLayer( ArrayPtrVoid params ) this->m_drawingAccid->SetOloc(this->GetOct()); this->m_drawingAccid->SetPloc(this->GetPname()); this->m_drawingAccid->SetAccid(this->GetAccid()); - this->m_drawingAccid->m_cueSize = this->m_cueSize; + // We need to set the drawing cue size since there will be no access to the note + this->m_drawingAccid->m_drawingCueSize = this->HasGrace(); } (*currentNote) = this; diff --git a/src/style.cpp b/src/style.cpp index a00159feafa..de8bf044098 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -39,8 +39,8 @@ Style::Style() */ m_smallStaffNum = 4; m_smallStaffDen = 5; - m_graceNum = 3; - m_graceDen = 4; + m_graceNum = 5; + m_graceDen = 7; m_pageHeight = DEFAULT_PAGE_HEIGHT * DEFINITON_FACTOR; m_pageWidth = DEFAULT_PAGE_WIDTH * DEFINITON_FACTOR; diff --git a/src/view_beam.cpp b/src/view_beam.cpp index 2ae019decb5..d80fa28debc 100644 --- a/src/view_beam.cpp +++ b/src/view_beam.cpp @@ -248,7 +248,7 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta } // We look only at the last note for checking if cuesized. Somehow arbitrarily - if ((*beamElementCoords)[last]->m_element->m_cueSize == false) { + if ((*beamElementCoords)[last]->m_element->IsCueSize() == false) { beamWidthBlack = m_doc->m_drawingBeamWidth[staff->staffSize]; beamWidthWhite = m_doc->m_drawingBeamWhiteWidth[staff->staffSize]; } @@ -266,7 +266,7 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta verticalShift = ((shortestDur-DUR_8)*(beamWidth)); //if the beam has smaller-size notes - if ((*beamElementCoords)[last]->m_element->m_cueSize) { + if ((*beamElementCoords)[last]->m_element->IsCueSize()) { verticalShift += m_doc->m_drawingUnit[staff->staffSize]*5; } else { @@ -293,7 +293,7 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta } (*beamElementCoords)[i]->m_yBeam = (*beamElementCoords)[i]->m_y + verticalShift; - (*beamElementCoords)[i]->m_x += dx[(*beamElementCoords)[i]->m_element->m_cueSize]; + (*beamElementCoords)[i]->m_x += dx[(*beamElementCoords)[i]->m_element->IsCueSize()]; s_y += (*beamElementCoords)[i]->m_yBeam; s_y2 += (*beamElementCoords)[i]->m_yBeam * (*beamElementCoords)[i]->m_yBeam; diff --git a/src/view_element.cpp b/src/view_element.cpp index af735680c78..054716d2de1 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -192,6 +192,8 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St Chord *inChord = note->IsChordTone(); + bool drawingCueSize = note->HasGrace(); + bool inBeam = false; // Get the immediate parent of the note @@ -200,7 +202,7 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St // This note is beamed and cue sized if (beam_parent != NULL) { - if (note->m_cueSize == true) { + if (drawingCueSize == true) { // Get the Parent of the parent // we want to see if we are in a group of // beamed cue notes @@ -232,13 +234,13 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St drawingDur = note->GetDrawingDur(); drawingDur = ((note->GetColored()==BOOLEAN_true) && drawingDur > DUR_1) ? (drawingDur+1) : drawingDur; - int radius = m_doc->m_drawingNoteRadius[staffSize][note->m_cueSize]; + int radius = m_doc->m_drawingNoteRadius[staffSize][drawingCueSize]; if (drawingDur > DUR_1 || (drawingDur == DUR_1 && staff->notAnc)) { // annuler provisoirement la modif. des lignes addit. - ledge = m_doc->m_drawingLedgerLine[staffSize][note->m_cueSize]; + ledge = m_doc->m_drawingLedgerLine[staffSize][drawingCueSize]; } else { - ledge = m_doc->m_drawingLedgerLine[staffSize][note->m_cueSize]; + ledge = m_doc->m_drawingLedgerLine[staffSize][drawingCueSize]; radius += radius/3; } @@ -319,7 +321,7 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St else fontNo = SMUFL_E0A2_noteheadWhole; - DrawSmuflCode( dc, xNote, noteY, fontNo, staff->staffSize, note->m_cueSize ); + DrawSmuflCode( dc, xNote, noteY, fontNo, staff->staffSize, drawingCueSize ); } // Other values else { @@ -330,7 +332,7 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St fontNo = SMUFL_E0A4_noteheadBlack; } - DrawSmuflCode( dc, xNote, noteY, fontNo, staff->staffSize, note->m_cueSize ); + DrawSmuflCode( dc, xNote, noteY, fontNo, staff->staffSize, drawingCueSize ); if (!(inBeam && drawingDur > DUR_4) && !inChord) { DrawStem(dc, note, staff, note->m_drawingStemDir, radius, xStem, noteY); @@ -376,7 +378,7 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St if (note->m_drawingAccid) { xAccid = xNote; if (note->m_drawingAccid->GetFunc() != FUNC_edit) { - xAccid -= 1.5 * m_doc->m_drawingAccidWidth[staffSize][note->m_cueSize]; + xAccid -= 1.5 * m_doc->m_drawingAccidWidth[staffSize][drawingCueSize]; } note->m_drawingAccid->SetDrawingX( xAccid ); @@ -424,10 +426,16 @@ void View::DrawStem( DeviceContext *dc, LayerElement *object, Staff *staff, data int staffY = staff->GetDrawingY(); int baseStem, totalFlagStemHeight, flagStemHeight, nbFlags; int drawingDur = dynamic_cast(object)->GetActualDur(); + bool drawingCueSize = object->IsCueSize(); int verticalCenter = staffY - m_doc->m_drawingDoubleUnit[staffSize]*2; - baseStem = object->m_cueSize ? ( m_doc->m_drawingUnit[staffSize]*5) : ( m_doc->m_drawingUnit[staffSize]*7); - flagStemHeight = object->m_cueSize ? m_doc->m_drawingUnit[staffSize] : m_doc->m_drawingDoubleUnit[staffSize]; + baseStem = m_doc->m_drawingUnit[staffSize]*7; + flagStemHeight = m_doc->m_drawingDoubleUnit[staffSize]; + if (drawingCueSize) { + baseStem = baseStem * m_doc->m_style->m_graceNum / m_doc->m_style->m_graceDen; + flagStemHeight = flagStemHeight * m_doc->m_style->m_graceNum / m_doc->m_style->m_graceDen; + } + nbFlags = drawingDur - DUR_8; totalFlagStemHeight = flagStemHeight * (nbFlags * 2 - 1) / 2; @@ -456,7 +464,10 @@ void View::DrawStem( DeviceContext *dc, LayerElement *object, Staff *staff, data int stemY2 = y2; if (drawingDur > DUR_4) { // if we have flags, shorten the stem to make sure we have a nice overlap with the flag glyph - stemY2 = (dir == STEMDIRECTION_up) ? y2 - m_doc->m_drawingUnit[staffSize] : y2 + m_doc->m_drawingUnit[staffSize]; + int shortener = (drawingCueSize) ? + m_doc->m_drawingUnit[staffSize] * m_doc->m_style->m_graceNum / m_doc->m_style->m_graceDen : + m_doc->m_drawingUnit[staffSize]; + stemY2 = (dir == STEMDIRECTION_up) ? y2 - shortener : y2 + shortener; } // draw the stems and the flags @@ -469,9 +480,9 @@ void View::DrawStem( DeviceContext *dc, LayerElement *object, Staff *staff, data object->m_drawingStemDir = STEMDIRECTION_up; if (drawingDur > DUR_4) { - DrawSmuflCode( dc, x2 - m_doc->m_style->m_stemWidth, y2, SMUFL_E240_flag8thUp, staff->staffSize, object->m_cueSize ); + DrawSmuflCode( dc, x2 - m_doc->m_style->m_stemWidth, y2, SMUFL_E240_flag8thUp, staff->staffSize, drawingCueSize ); for (int i=0; i < nbFlags; i++) - DrawSmuflCode( dc, x2 - m_doc->m_style->m_stemWidth, y2 - (i + 1) * flagStemHeight, SMUFL_E240_flag8thUp, staff->staffSize, object->m_cueSize ); + DrawSmuflCode( dc, x2 - m_doc->m_style->m_stemWidth, y2 - (i + 1) * flagStemHeight, SMUFL_E240_flag8thUp, staff->staffSize, drawingCueSize ); } } else { @@ -483,13 +494,12 @@ void View::DrawStem( DeviceContext *dc, LayerElement *object, Staff *staff, data object->m_drawingStemDir = STEMDIRECTION_down; if (drawingDur > DUR_4) { - DrawSmuflCode( dc, x2 , y2, SMUFL_E241_flag8thDown , staff->staffSize, object->m_cueSize ); + DrawSmuflCode( dc, x2 , y2, SMUFL_E241_flag8thDown , staff->staffSize, drawingCueSize ); for (int i=0; i < nbFlags; i++) - DrawSmuflCode( dc, x2, y2 + (i + 1) * flagStemHeight, SMUFL_E241_flag8thDown, staff->staffSize, - object->m_cueSize ); + DrawSmuflCode( dc, x2, y2 + (i + 1) * flagStemHeight, SMUFL_E241_flag8thDown, staff->staffSize, drawingCueSize ); } } - if (object->m_cueSize && dynamic_cast(object)->m_acciaccatura) { + if ( drawingCueSize && ( dynamic_cast(object)->GetGrace() == GRACE_acc ) ) { DrawAcciaccaturaSlash(dc, object); } @@ -503,8 +513,9 @@ void View::DrawLedgerLines ( DeviceContext *dc, LayerElement *element, Staff *st int staffY = staff->GetDrawingY(); int staffSize = staff->staffSize; int betweenLines = m_doc->m_drawingDoubleUnit[staffSize]; - int ledge = m_doc->m_drawingLedgerLine[staffSize][element->m_cueSize]; - int noteDiameter = m_doc->m_drawingNoteRadius[staffSize][element->m_cueSize] * 2; + bool drawingCueSize = element->IsCueSize(); + int ledge = m_doc->m_drawingLedgerLine[staffSize][drawingCueSize]; + int noteDiameter = m_doc->m_drawingNoteRadius[staffSize][drawingCueSize] * 2; //prep start and end positions of ledger line depending on stem direction and doubleLength int xLedgerStart, xLedgerEnd; @@ -557,6 +568,7 @@ void View::DrawRest ( DeviceContext *dc, LayerElement *element, Layer *layer, St Rest *rest = dynamic_cast(element); + bool drawingCueSize = rest->IsCueSize(); int drawingDur = rest->GetActualDur(); int x = element->GetDrawingX(); int y = element->GetDrawingY(); @@ -568,7 +580,7 @@ void View::DrawRest ( DeviceContext *dc, LayerElement *element, Layer *layer, St if (drawingDur > DUR_2) { - x -= m_doc->m_drawingNoteRadius[staff->staffSize][rest->m_cueSize]; + x -= m_doc->m_drawingNoteRadius[staff->staffSize][drawingCueSize]; } switch (drawingDur) @@ -576,8 +588,8 @@ void View::DrawRest ( DeviceContext *dc, LayerElement *element, Layer *layer, St case DUR_LG: DrawLongRest ( dc, x, y, staff); break; case DUR_BR: DrawBreveRest( dc, x, y, staff); break; case DUR_1: - case DUR_2: DrawWholeRest ( dc, x, y, drawingDur, rest->GetDots(), rest->m_cueSize, staff); break; - default: DrawQuarterRest( dc, x, y, drawingDur, rest->GetDots(), rest->m_cueSize, staff); + case DUR_2: DrawWholeRest ( dc, x, y, drawingDur, rest->GetDots(), drawingCueSize, staff); break; + default: DrawQuarterRest( dc, x, y, drawingDur, rest->GetDots(), drawingCueSize, staff); } if(rest->GetFermata() != PLACE_NONE) { @@ -869,7 +881,8 @@ void View::DrawChord( DeviceContext *dc, LayerElement *element, Layer *layer, St int staffSize = staff->staffSize; int staffY = staff->GetDrawingY(); int verticalCenter = staffY - m_doc->m_drawingDoubleUnit[staffSize]*2; - int radius = m_doc->m_drawingNoteRadius[staffSize][chord->m_cueSize]; + bool drawingCueSize = chord->IsCueSize(); + int radius = m_doc->m_drawingNoteRadius[staffSize][drawingCueSize]; int fullUnit = m_doc->m_drawingUnit[staffSize]; bool inBeam = false; @@ -879,7 +892,7 @@ void View::DrawChord( DeviceContext *dc, LayerElement *element, Layer *layer, St // This note is beamed and cue sized if (beam_parent != NULL) { - if (chord->m_cueSize == true) { + if (drawingCueSize == true) { // Get the Parent of the parent // we want to see if we are in a group of // beamed cue notes @@ -1140,14 +1153,14 @@ void View::DrawClef( DeviceContext *dc, LayerElement *element, Layer *layer, Sta break; } - bool cueSize = clef->m_cueSize; + bool cueSize = false; // force cue size for intermediate clefs if (clef->GetFirstParent(&typeid(Layer))) cueSize = true; if (!cueSize) a -= m_doc->m_drawingUnit[staff->staffSize] * 2; - DrawSmuflCode ( dc, a, b, sym, staff->staffSize, cueSize ); + DrawSmuflCode ( dc, a, b, sym, staff->staffSize, cueSize ); dc->EndGraphic(element, this ); } @@ -1407,6 +1420,7 @@ void View::DrawAccid( DeviceContext *dc, LayerElement *element, Layer *layer, St // Parent will be NULL if we are drawing a note @accid (see DrawNote) - the y value is already set if ( accid->m_parent ) { accid->SetDrawingY( accid->GetDrawingY() + CalculatePitchPosY( staff, accid->GetPloc(), layer->GetClefOffset( accid ), accid->GetOloc()) ); + accid->m_drawingCueSize = accid->IsCueSize(); } /************** editorial accidental **************/ @@ -1425,7 +1439,7 @@ void View::DrawAccid( DeviceContext *dc, LayerElement *element, Layer *layer, St } // adjust the x position so it is centered - int radius = m_doc->m_drawingNoteRadius[staff->staffSize][note->m_cueSize]; + int radius = m_doc->m_drawingNoteRadius[staff->staffSize][accid->m_drawingCueSize]; if ( note->GetActualDur() < DUR_2 ) radius += radius/3; accid->SetDrawingX( accid->GetDrawingX() + radius / 2 ); } @@ -1457,7 +1471,7 @@ void View::DrawAccid( DeviceContext *dc, LayerElement *element, Layer *layer, St // mensural notation if (staff->notAnc) { symc = SMUFL_E262_accidentalSharp; - DrawSmuflCode ( dc, x, y, symc, staff->staffSize, accid->m_cueSize ); + DrawSmuflCode ( dc, x, y, symc, staff->staffSize, accid->m_drawingCueSize ); y += 7*m_doc->m_drawingUnit[staff->staffSize]; // LP } else { symc = SMUFL_E263_accidentalDoubleSharp; @@ -1471,7 +1485,7 @@ void View::DrawAccid( DeviceContext *dc, LayerElement *element, Layer *layer, St default : break; } - DrawSmuflCode ( dc, x, y, symc, staff->staffSize, accid->m_cueSize ); + DrawSmuflCode ( dc, x, y, symc, staff->staffSize, accid->m_drawingCueSize ); dc->EndGraphic(element, this ); } @@ -1503,7 +1517,7 @@ void View::DrawCustos( DeviceContext *dc, LayerElement *element, Layer *layer, S y -= m_doc->m_drawingUnit[staff->staffSize] - m_doc->m_drawingUnit[staff->staffSize]/4; // LP - correction in 2.0.0 // HARDCODED (smufl code wrong) - DrawSmuflCode( dc, x, y, 35, staff->staffSize, custos->m_cueSize ); + DrawSmuflCode( dc, x, y, 35, staff->staffSize, false ); dc->EndGraphic(element, this ); //RZ @@ -1865,18 +1879,36 @@ void View::DrawTie( DeviceContext *dc, LayerElement *element, Layer *layer, Staf void View::DrawAcciaccaturaSlash(DeviceContext *dc, LayerElement *element) { Note *note = dynamic_cast(element); + assert( note ); + + Staff *staff = dynamic_cast( note->GetFirstParent( &typeid( Staff ) ) ); + assert( staff ); if (note->GetActualDur() < DUR_8) return; - dc->SetPen(AxBLACK, 2, AxSOLID); + dc->SetPen(AxBLACK, m_doc->m_style->m_stemWidth, AxSOLID); dc->SetBrush( AxBLACK, AxSOLID ); + int positionShift = m_doc->m_drawingUnit[staff->staffSize] * m_doc->m_style->m_graceNum / m_doc->m_style->m_graceDen; + int positionShiftX1 = positionShift * 3 / 2; + int positionShiftY1 = positionShift * 2; + int positionShiftX2 = positionShift * 3; + int positionShiftY2 = positionShift * 6; + // HARDCODED - if (element->m_drawingStemDir) - dc->DrawLine(element->m_drawingStemStart.x - 10, ToDeviceContextY(element->m_drawingStemStart.y + 10), element->m_drawingStemStart.x + 20, ToDeviceContextY(element->m_drawingStemStart.y + 40)); - else - dc->DrawLine(element->m_drawingStemStart.x - 10, ToDeviceContextY(element->m_drawingStemStart.y - 10), element->m_drawingStemStart.x + 20, ToDeviceContextY(element->m_drawingStemStart.y - 40)); + if (element->m_drawingStemDir == STEMDIRECTION_up) { + dc->DrawLine( + ToDeviceContextX(element->m_drawingStemStart.x - positionShiftX1 ), + ToDeviceContextY(element->m_drawingStemStart.y + positionShiftY1), + ToDeviceContextX(element->m_drawingStemStart.x + positionShiftX2), + ToDeviceContextY(element->m_drawingStemStart.y + positionShiftY2)); + } else { + dc->DrawLine(ToDeviceContextX(element->m_drawingStemStart.x - positionShiftX1), + ToDeviceContextY(element->m_drawingStemStart.y - positionShiftY1), + ToDeviceContextX(element->m_drawingStemStart.x + positionShiftX2), + ToDeviceContextY(element->m_drawingStemStart.y - positionShiftY2)); + } dc->ResetPen(); dc->ResetBrush(); @@ -1948,7 +1980,7 @@ void View::DrawTrill(DeviceContext *dc, LayerElement *element, Staff *staff) { int x, y; // It shoud be moved according to half of the trill size - x = element->GetDrawingX() - m_doc->m_drawingAccidWidth[staff->staffSize][element->m_cueSize]; + x = element->GetDrawingX() - m_doc->m_drawingAccidWidth[staff->staffSize][false]; // HARDCODED if ((element->GetDrawingY()) < staff->GetDrawingY()) diff --git a/src/view_mensural.cpp b/src/view_mensural.cpp index c49f963b232..d6e68063827 100644 --- a/src/view_mensural.cpp +++ b/src/view_mensural.cpp @@ -44,6 +44,7 @@ void View::DrawMensuralNote ( DeviceContext *dc, LayerElement *element, Layer *l int noteY = element->GetDrawingY(); int xLedger, xNote, xStem; int drawingDur; + bool drawingCueSize; int staffY = staff->GetDrawingY(); wchar_t fontNo; int ledge; @@ -53,14 +54,15 @@ void View::DrawMensuralNote ( DeviceContext *dc, LayerElement *element, Layer *l xLedger = xStem; drawingDur = note->GetDrawingDur(); + drawingCueSize = note->HasGrace(); - int radius = m_doc->m_drawingNoteRadius[staffSize][note->m_cueSize]; + int radius = m_doc->m_drawingNoteRadius[staffSize][drawingCueSize]; if (drawingDur > DUR_1 || (drawingDur == DUR_1 && staff->notAnc)) { // annuler provisoirement la modif. des lignes addit. - ledge = m_doc->m_drawingLedgerLine[staffSize][note->m_cueSize]; + ledge = m_doc->m_drawingLedgerLine[staffSize][drawingCueSize]; } else { - ledge = m_doc->m_drawingLedgerLine[staffSize][note->m_cueSize]; + ledge = m_doc->m_drawingLedgerLine[staffSize][drawingCueSize]; radius += radius/3; } @@ -95,7 +97,7 @@ void View::DrawMensuralNote ( DeviceContext *dc, LayerElement *element, Layer *l else fontNo = SMUFL_E0A2_noteheadWhole; - DrawSmuflCode( dc, xNote, noteY, fontNo, staff->staffSize, note->m_cueSize ); + DrawSmuflCode( dc, xNote, noteY, fontNo, staff->staffSize, drawingCueSize ); } // Other values else { @@ -108,7 +110,7 @@ void View::DrawMensuralNote ( DeviceContext *dc, LayerElement *element, Layer *l else fontNo = SMUFL_E0A3_noteheadHalf; } - DrawSmuflCode( dc, xNote, noteY, fontNo, staff->staffSize, note->m_cueSize ); + DrawSmuflCode( dc, xNote, noteY, fontNo, staff->staffSize, drawingCueSize ); DrawStem(dc, note, staff, note->m_drawingStemDir, radius, xStem, noteY); } diff --git a/src/view_tuplet.cpp b/src/view_tuplet.cpp index 927d3542762..3a7afd0d408 100644 --- a/src/view_tuplet.cpp +++ b/src/view_tuplet.cpp @@ -249,8 +249,9 @@ void View::DrawTupletPostponed( DeviceContext *dc, Tuplet *tuplet, Layer *layer, // since the number is slanted, move the center left // by 4 pixels so it seems more centered to the eye int txt_x = center.x - (txt_length / 2); - // we need to move down the figure of half of it height, which is about an accid width - int txt_y = center.y - m_doc->m_drawingAccidWidth[staff->staffSize][tuplet->m_cueSize]; + // we need to move down the figure of half of it height, which is about an accid width; + // also, cue size is not supported. Does it has to? + int txt_y = center.y - m_doc->m_drawingAccidWidth[staff->staffSize][false]; if (tuplet->GetNum()) { DrawSmuflString(dc, txt_x, txt_y, notes, false, staff->staffSize); From 4c7b58c3e9d92f2fbab44438da94ea5e51c57da4 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Fri, 7 Aug 2015 23:01:45 +0200 Subject: [PATCH 040/114] Adding version number option --- tools/main.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/tools/main.cpp b/tools/main.cpp index e5deaf9c5b5..c7626a2b735 100644 --- a/tools/main.cpp +++ b/tools/main.cpp @@ -62,9 +62,14 @@ bool dir_exists (string dir) { } } +void display_version() { + cerr << "verovio-" << GetVersion() << endl; +} + void display_usage() { - cerr << "Verovio " << GetVersion() << endl << "Usage:" << endl << endl; + display_version(); + cerr << endl << "Usage:" << endl << endl; cerr << " verovio [-f format] [-s scale] [-t type] [-r resources] [-o outfile] infile" << endl << endl; // These need to be kept in alphabetical order: @@ -91,6 +96,8 @@ void display_usage() { cerr << " -s, --scale=FACTOR Scale percent (default is " << DEFAULT_SCALE << ")" << endl; cerr << " -t, --type=OUTPUT_TYPE Select output format: mei, svg (default is svg)" << endl; + + cerr << " -v, --version Display the version number" << endl; cerr << " -w, --page-width=WIDTH Specify the page width (default is " << DEFAULT_PAGE_WIDTH << ")" << endl; @@ -148,6 +155,7 @@ int main(int argc, char** argv) int show_bounding_boxes = 0; int page = 1; int show_help = 0; + int show_version = 0; // Create the toolkit instance without loading the font because // the resource path might be specified in the parameters @@ -188,11 +196,12 @@ int main(int argc, char** argv) {"spacing-staff", required_argument, 0, 0}, {"spacing-system", required_argument, 0, 0}, {"type", required_argument, 0, 't'}, + {"version", no_argument, &show_version, 1}, {0, 0, 0, 0} }; int option_index = 0; - while ((c = getopt_long(argc, argv, "b:f:h:o:p:r:s:t:w:", long_options, &option_index)) != -1) + while ((c = getopt_long(argc, argv, "b:f:h:o:p:r:s:t:w:v", long_options, &option_index)) != -1) { switch (c) { @@ -256,6 +265,10 @@ int main(int argc, char** argv) exit(1); } break; + + case 'v': + show_version = 1; + break; case 'w': if ( !toolkit.SetPageWidth( atoi(optarg) ) ) { @@ -273,6 +286,11 @@ int main(int argc, char** argv) } } + if (show_version) { + display_version(); + exit(0); + } + if (show_help) { display_usage(); exit(0); From 7850be85163a169b6115ee961d56895a3de4686c Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sat, 8 Aug 2015 12:49:42 +0200 Subject: [PATCH 041/114] Updating command-line version output --- tools/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/main.cpp b/tools/main.cpp index c7626a2b735..536f549ac68 100644 --- a/tools/main.cpp +++ b/tools/main.cpp @@ -63,7 +63,7 @@ bool dir_exists (string dir) { } void display_version() { - cerr << "verovio-" << GetVersion() << endl; + cerr << "Verovio " << GetVersion() << endl; } void display_usage() { From a3a6ddb496644940de76ef3dd0472edc931d7480 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sat, 8 Aug 2015 14:35:34 +0200 Subject: [PATCH 042/114] Removing unused code --- include/vrv/view.h | 1 - src/view_element.cpp | 141 ++----------------------------------------- src/view_page.cpp | 10 +-- 3 files changed, 7 insertions(+), 145 deletions(-) diff --git a/include/vrv/view.h b/include/vrv/view.h index 6b898e554c7..e1d1b3883c1 100644 --- a/include/vrv/view.h +++ b/include/vrv/view.h @@ -247,7 +247,6 @@ class View void DrawRest( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); void DrawSpace( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); void DrawSyl( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); - void DrawTie( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); void DrawTuplet( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); void DrawVerse( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); ///@} diff --git a/src/view_element.cpp b/src/view_element.cpp index 054716d2de1..b08024527bd 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -105,24 +105,22 @@ void View::DrawLayerElement( DeviceContext *dc, LayerElement *element, Layer *la else if (dynamic_cast(element)) { DrawDurationElement(dc, element, layer, staff, measure); } - else if (dynamic_cast(element)) { - DrawTie(dc, element, layer, staff, measure); - } else if (dynamic_cast(element)) { DrawSpace(dc, element, layer, staff, measure); } else if (dynamic_cast(element)) { DrawSyl(dc, element, layer, staff, measure); } - else if (dynamic_cast(element)) { - DrawTie(dc, element, layer, staff, measure); - } else if (dynamic_cast(element)) { DrawTuplet(dc, element, layer, staff, measure); } else if (dynamic_cast(element)) { DrawVerse(dc, element, layer, staff, measure); } + else { + // This should never happen + LogError("Element '%s' cannot be drawn", element->GetClassName().c_str()); + } m_currentColour = previousColor; } @@ -1745,137 +1743,6 @@ void View::DrawKeySig( DeviceContext *dc, LayerElement *element, Layer *layer, S } -void View::DrawTie( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ) -{ - assert(layer); // Pointer to layer cannot be NULL" - assert(staff); // Pointer to staff cannot be NULL" - assert(dynamic_cast(element) || dynamic_cast(element)); // The element must be a tie - - bool up = false; - LayerElement *note1 = NULL; - LayerElement *note2 = NULL; - - // coordinates for the tie/slur - int x1, x2, y1, y2; - up = true; - data_STEMDIRECTION noteStemDir = STEMDIRECTION_NONE; - - Tie *tie = dynamic_cast(element); - Slur *slur = dynamic_cast(element); - if ( tie ) { - note1 = tie->GetStart(); - note2 = tie->GetEnd(); - } else if ( slur ) { - note1 = slur->GetStart(); - note2 = slur->GetEnd(); - } - - if ( !note1 && !note2 ) { - // no note, obviously nothing to do... - return; - } - - System *currentSystem = dynamic_cast( staff->GetFirstParent( &typeid(System) ) ); - System *parentSystem1 = NULL; - System *parentSystem2 = NULL; - - // In order to know if we are drawing a normal tie or a tie splitted over two systems, we need - // to look at the parent system of each note. - if ( note1 ) { - parentSystem1 = dynamic_cast( note1->GetFirstParent( &typeid(System) ) ); - } - if ( note2 ) { - parentSystem2 = dynamic_cast( note2->GetFirstParent( &typeid(System) ) ); - } - - // This is the case when the tie is split over two system of two pages. - // In this case, we are now drawing its beginning to the end of the measure (i.e., the last aligner) - if ( parentSystem2 && currentSystem && ( parentSystem2 != currentSystem) ) { - Alignment *nextAlignement = note1->GetAlignment(); - while (nextAlignement) { - if (nextAlignement->GetType() == ALIGNMENT_MEASURE_END) break; - nextAlignement = dynamic_cast(nextAlignement->GetNextSibling()); - } - if (!nextAlignement) { - return; - } - y1 = y2 = note1->GetDrawingY(); - x1 = note1->GetDrawingX(); - x2 = measure->GetDrawingX() + nextAlignement->GetXRel(); - assert(dynamic_cast(note1)); - noteStemDir = dynamic_cast(note1)->m_drawingStemDir; - //DrawTieOrSlurBezier(dc, note1->GetDrawingX(), y - 14, x2, y - 14, true); - } - // Now this is the case when the tie is split but we are drawing the end of it - else if ( parentSystem1 && currentSystem && ( parentSystem1 != currentSystem) ) { - Alignment *previousAlignement = note2->GetAlignment(); - while (previousAlignement) { - if (previousAlignement->GetType() != ALIGNMENT_DEFAULT) break; - previousAlignement = dynamic_cast(previousAlignement->GetPreviousSibling()); - } - if (!previousAlignement) { - return; - } - y1 = y2 = note2->GetDrawingY(); - x2 = note2->GetDrawingX(); - x1 = x2 - m_doc->m_drawingDoubleUnit[ staff->staffSize ]; - assert(dynamic_cast(note2)); - noteStemDir = dynamic_cast(note2)->m_drawingStemDir; - //DrawTieOrSlurBezier(dc, x1, y - 14, note2->GetDrawingX(), y - 14, true); - } - // Finally the normal case - else { - assert( note1 && note2 ); - // Copied from DrawNote - // We could use the stamDir information - // but then we have to take in account (1) beams (2) stemmed and non stemmed notes tied together - y1 = note1->GetDrawingY(); - y2 = note2->GetDrawingY(); - x1 = note1->GetDrawingX(); - x2 = note2->GetDrawingX(); - assert(dynamic_cast(note1)); - // for now we only look at the first note - needs to be improved - // m_drawingStemDir it not set properly in beam - needs to be fixed. - noteStemDir = dynamic_cast(note1)->m_drawingStemDir; - /* - assert(dynamic_cast(note2)); - if (dynamic_cast(note2)->m_drawingStemDir != noteStemDir) { - LogDebug("Diverging stem directions (%d;%d)", noteStemDir, dynamic_cast(note2)->m_drawingStemDir); - } - */ - } - - assert( dynamic_cast(note1)); - if (noteStemDir == STEMDIRECTION_up) { - up = false; - } - else if (noteStemDir == STEMDIRECTION_NONE) { - // no information from the note stem directions, look at the position in the notes - int center = staff->GetDrawingY() - m_doc->m_drawingDoubleUnit[staff->staffSize] * 2; - up = (y1 > center) ? true : false; - } - - // FIXME, take in account elements that can be netween notes, eg keys time etc - // 20 height nice with 70, not nice with 50 - // Also remove HARDCODED values! - if (up) { - y1 += m_doc->m_drawingUnit[staff->staffSize] * 1.6; - y2 += m_doc->m_drawingUnit[staff->staffSize] * 1.6; - } - else { - y1 -= m_doc->m_drawingUnit[staff->staffSize] * 1.6; - y2 -= m_doc->m_drawingUnit[staff->staffSize] * 1.6; - } - - dc->StartGraphic( element, "", element->GetUuid() ); - dc->DeactivateGraphic(); - DrawTieOrSlurBezier(dc, x1, y1, x2, y2, !up); - dc->ReactivateGraphic(); - dc->EndGraphic(element, this ); - - -} - void View::DrawAcciaccaturaSlash(DeviceContext *dc, LayerElement *element) { Note *note = dynamic_cast(element); diff --git a/src/view_page.cpp b/src/view_page.cpp index 083122d0bc1..291f3104c35 100644 --- a/src/view_page.cpp +++ b/src/view_page.cpp @@ -1113,13 +1113,9 @@ void View::DrawLayerList( DeviceContext *dc, Layer *layer, Staff *staff, Measure DrawTupletPostponed( dc, tuplet, layer, staff ); dc->EndResumedGraphic(tuplet, this); } - else if ( (typeid(*element) == *elementType) && (*elementType == typeid(Tie) ) ) { - // Not sure about ReStart and ReEnd Tie and Slur - DrawTie( dc, element, layer, staff, measure ); - } - else if ( (typeid(*element) == *elementType) && (*elementType == typeid(Slur) ) ) { - // Not sure about ReStart and ReEnd Tie and Slur - DrawTie( dc, element, layer, staff, measure ); + else { + // This should never happen + LogError("Element '%s' in the layer list cannot be drawn", element->GetClassName().c_str()); } } } From a6597bee1d724d7606336494897a5f7472db11b8 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sat, 8 Aug 2015 14:50:01 +0200 Subject: [PATCH 043/114] Changing emscripten optimization to O3 --- emscripten/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emscripten/build.sh b/emscripten/build.sh index 4313e860687..78e97bf0f99 100755 --- a/emscripten/build.sh +++ b/emscripten/build.sh @@ -28,7 +28,7 @@ if [ ! -d data ]; then mkdir data; fi # Empirically, the memory amount required is approx. 5 times the file size (as an indication). # We can disable this for a light version that uses the default memory settings ASM="\ - -O2 --memory-init-file 0 \ + -O3 --memory-init-file 0 \ -s ASM_JS=1 \ -s TOTAL_MEMORY=128*1024*1024 \ -s TOTAL_STACK=64*1024*1024" @@ -49,7 +49,7 @@ while getopts "lwv:h:c" opt; do l) echo "light version (-l)" ASM="\ - -O2 --memory-init-file 0 \ + -O3 --memory-init-file 0 \ -s ASM_JS=1 " ASM_NAME="-light" ;; From 860c3d46846b7943383d0c5d7dbb737f1c6f1906 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Mon, 10 Aug 2015 17:22:14 +0200 Subject: [PATCH 044/114] No line in front of a single stave. Fixes #134 --- src/view_page.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/view_page.cpp b/src/view_page.cpp index 291f3104c35..c99f22343d2 100644 --- a/src/view_page.cpp +++ b/src/view_page.cpp @@ -231,7 +231,7 @@ void View::DrawStaffGrp( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp y_bottom -= m_doc->m_style->m_staffLineWidth / 2; // actually draw the line, the brace or the bracket - if ( topStaffGrp ) { + if ( topStaffGrp && ( (firstDef != lastDef) || (staffGrp->GetSymbol() != STAFFGRP_NONE) ) ) { DrawVerticalLine( dc , y_top, y_bottom, x, m_doc->m_style->m_barlineWidth ); } // this will need to be changed with the next version of MEI will line means additional thick line @@ -1082,12 +1082,8 @@ void View::DrawLayer( DeviceContext *dc, Layer *layer, Staff *staff, Measure *me DrawLayerChildren(dc, layer, layer, staff, measure); - // first draw the tuplets + // first draw the postponed tuplets DrawLayerList(dc, layer, staff, measure, &typeid(Tuplet) ); - // then ties - DrawLayerList(dc, layer, staff, measure, &typeid(Tie) ); - // then slurs - DrawLayerList(dc, layer, staff, measure, &typeid(Slur) ); dc->EndGraphic( layer, this ); } From cde33dd74e991f9d74eb4acf63d5c200e6d8aea2 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Tue, 11 Aug 2015 11:22:29 +0200 Subject: [PATCH 045/114] Adjusting spacing. Fixes #84 and #135 --- include/vrv/doc.h | 4 +- include/vrv/style.h | 98 +++++++++++++++++++++++++++++++++++++++++++-- src/doc.cpp | 38 +++++++++--------- src/keysig.cpp | 6 ++- src/style.cpp | 22 ++++++++++ 5 files changed, 140 insertions(+), 28 deletions(-) diff --git a/include/vrv/doc.h b/include/vrv/doc.h index 9697c94538f..7a8c168199d 100644 --- a/include/vrv/doc.h +++ b/include/vrv/doc.h @@ -96,8 +96,8 @@ class Doc: public Object * These should eventually be set at parameters. */ ///@{ - short GetLeftMargin( const std::type_info *elementType ); - short GetRightMargin( const std::type_info *elementType ); + char GetLeftMargin( const std::type_info *elementType ); + char GetRightMargin( const std::type_info *elementType ); ///@} /* diff --git a/include/vrv/style.h b/include/vrv/style.h index 2b2c79913ed..b3e2b9f1684 100644 --- a/include/vrv/style.h +++ b/include/vrv/style.h @@ -19,14 +19,14 @@ namespace vrv { #define MIN_UNIT 6 #define MAX_UNIT 18 -#define DEFAULT_PAGE_RIGHT_MAR 50 -#define MIN_PAGE_RIGHT_MAR 0 -#define MAX_PAGE_RIGHT_MAR 500 - #define DEFAULT_PAGE_LEFT_MAR 50 #define MIN_PAGE_LEFT_MAR 0 #define MAX_PAGE_LEFT_MAR 500 +#define DEFAULT_PAGE_RIGHT_MAR 50 +#define MIN_PAGE_RIGHT_MAR 0 +#define MAX_PAGE_RIGHT_MAR 500 + #define DEFAULT_PAGE_TOP_MAR 50 #define MIN_PAGE_TOP_MAR 0 #define MAX_PAGE_TOP_MAR 500 @@ -78,6 +78,74 @@ namespace vrv { #define MIN_MEASURE_WIDTH 1.0 #define MAX_MEASURE_WIDTH 30.0 +/** Left margins */ + +#define DEFAULT_LEFT_MARGIN_BARLINE 0.5 +#define MIN_LEFT_MARGIN_BARLINE -10.0 +#define MAX_LEFT_MARGIN_BARLINE 10.0 + +#define DEFAULT_LEFT_MARGIN_BARLINE_ATTR 2.5 +#define MIN_LEFT_MARGIN_BARLINE_ATTR -10.0 +#define MAX_LEFT_MARGIN_BARLINE_ATTR 10.0 + +#define DEFAULT_LEFT_MARGIN_CHORD 1.0 +#define MIN_LEFT_MARGIN_CHORD -10.0 +#define MAX_LEFT_MARGIN_CHORD 10.0 + +#define DEFAULT_LEFT_MARGIN_CLEF -2.0 +#define MIN_LEFT_MARGIN_CLEF -10.0 +#define MAX_LEFT_MARGIN_CLEF 10.0 + +#define DEFAULT_LEFT_MARGIN_MREST 3.0 +#define MIN_LEFT_MARGIN_MREST -10.0 +#define MAX_LEFT_MARGIN_MREST 10.0 + +#define DEFAULT_LEFT_MARGIN_NOTE 1.0 +#define MIN_LEFT_MARGIN_NOTE -10.0 +#define MAX_LEFT_MARGIN_NOTE 10.0 + +#define DEFAULT_LEFT_MARGIN_DEFAULT 0.0 +#define MIN_LEFT_MARGIN_DEFAULT -10.0 +#define MAX_LEFT_MARGIN_DEFAULT 10.0 + +/** Right margins */ + +#define DEFAULT_RIGHT_MARGIN_BARLINE 3.0 +#define MIN_RIGHT_MARGIN_BARLINE 0.0 +#define MAX_RIGHT_MARGIN_BARLINE 10.0 + +#define DEFAULT_RIGHT_MARGIN_BARLINE_ATTR 0.0 +#define MIN_RIGHT_MARGIN_BARLINE_ATTR 0.0 +#define MAX_RIGHT_MARGIN_BARLINE_ATTR 10.0 + +#define DEFAULT_RIGHT_MARGIN_CLEF 2.0 +#define MIN_RIGHT_MARGIN_CLEF 0.0 +#define MAX_RIGHT_MARGIN_CLEF 10.0 + +#define DEFAULT_RIGHT_MARGIN_KEYSIG 2.5 +#define MIN_RIGHT_MARGIN_KEYSIG 0.0 +#define MAX_RIGHT_MARGIN_KEYSIG 10.0 + +#define DEFAULT_RIGHT_MARGIN_MENSUR 3.0 +#define MIN_RIGHT_MARGIN_MENSUR 0.0 +#define MAX_RIGHT_MARGIN_MENSUR 10.0 + +#define DEFAULT_RIGHT_MARGIN_METERSIG 3.0 +#define MIN_RIGHT_MARGIN_METERSIG 0.0 +#define MAX_RIGHT_MARGIN_METERSIG 10.0 + +#define DEFAULT_RIGHT_MARGIN_MREST 3.0 +#define MIN_RIGHT_MARGIN_MREST 0.0 +#define MAX_RIGHT_MARGIN_MREST 10.0 + +#define DEFAULT_RIGHT_MARGIN_MULTIREST 3.0 +#define MIN_RIGHT_MARGIN_MULTIREST 0.0 +#define MAX_RIGHT_MARGIN_MULTIREST 10.0 + +#define DEFAULT_RIGHT_MARGIN_DEFAULT 1.0 +#define MIN_RIGHT_MARGIN_DEFAULT 0.0 +#define MAX_RIGHT_MARGIN_DEFAULT 10.0 + //---------------------------------------------------------------------------- // Style //---------------------------------------------------------------------------- @@ -144,6 +212,28 @@ class Style /** The lyrics size (in units / PARAM_DENOMINATOR) */ int m_lyricSize; + /** The layout left margin by element */ + char m_leftMarginBarline; + char m_leftMarginBarlineAttr; + char m_leftMarginChord; + char m_leftMarginClef; + char m_leftMarginMRest; + char m_leftMarginNote; + /** The default left margin */ + char m_leftMarginDefault; + + /** The layout right margin by element */ + char m_rightMarginClef; + char m_rightMarginKeySig; + char m_rightMarginMensur; + char m_rightMarginMeterSig; + char m_rightMarginBarline; + char m_rightMarginBarlineAttr; + char m_rightMarginMRest; + char m_rightMarginMultiRest; + /** The default right margin */ + char m_rightMarginDefault; + }; diff --git a/src/doc.cpp b/src/doc.cpp index a04118fa11c..2707fac6a46 100644 --- a/src/doc.cpp +++ b/src/doc.cpp @@ -393,30 +393,28 @@ int Doc::GetPageCount( ) } -short Doc::GetLeftMargin( const std::type_info *elementType ) +char Doc::GetLeftMargin( const std::type_info *elementType ) { - if (typeid(Barline) == *elementType) return 5; - else if (typeid(BarlineAttr) == *elementType) return 25; - else if (typeid(Chord) == *elementType) return 10; - else if (typeid(Clef) == *elementType) return -20; - else if (typeid(MRest) == *elementType) return 30; - else if (typeid(Note) == *elementType) return 10; - return 0; - + if (typeid(Barline) == *elementType) return m_style->m_leftMarginBarline; + else if (typeid(BarlineAttr) == *elementType) return m_style->m_leftMarginBarlineAttr; + else if (typeid(Chord) == *elementType) return m_style->m_leftMarginChord; + else if (typeid(Clef) == *elementType) return m_style->m_leftMarginClef; + else if (typeid(MRest) == *elementType) return m_style->m_leftMarginMRest; + else if (typeid(Note) == *elementType) return m_style->m_leftMarginNote; + return m_style->m_leftMarginDefault; } -short Doc::GetRightMargin( const std::type_info *elementType ) +char Doc::GetRightMargin( const std::type_info *elementType ) { - if (typeid(Clef) == *elementType) return 30; - else if (typeid(KeySig) == *elementType) return 30; - else if (typeid(Mensur) == *elementType) return 30; - else if (typeid(MeterSig) == *elementType) return 30; - else if (typeid(Barline) == *elementType) return 30; - else if (typeid(BarlineAttr) == *elementType) return 0; - else if (typeid(MRest) == *elementType) return 30; - else if (typeid(MultiRest) == *elementType) return 30; - //else if (typeid(Note) == *elementType) return 10; - return 10; + if (typeid(Barline) == *elementType) return m_style->m_rightMarginBarline; + else if (typeid(BarlineAttr) == *elementType) return m_style->m_rightMarginBarlineAttr; + else if (typeid(Clef) == *elementType) return m_style->m_rightMarginClef; + else if (typeid(KeySig) == *elementType) return m_style->m_rightMarginKeySig; + else if (typeid(Mensur) == *elementType) return m_style->m_rightMarginMensur; + else if (typeid(MeterSig) == *elementType) return m_style->m_rightMarginMeterSig; + else if (typeid(MRest) == *elementType) return m_style->m_rightMarginMRest; + else if (typeid(MultiRest) == *elementType) return m_style->m_rightMarginMultiRest; + return m_style->m_rightMarginDefault; } void Doc:: SetPageHeight( int pageHeight ) diff --git a/src/keysig.cpp b/src/keysig.cpp index 737da8930c3..93c0767867a 100644 --- a/src/keysig.cpp +++ b/src/keysig.cpp @@ -147,7 +147,8 @@ void KeySig::ConvertToMei() else return; } -unsigned char KeySig::GetAlterationAt(int pos) { +unsigned char KeySig::GetAlterationAt(int pos) +{ data_PITCHNAME *alteration_set; if (pos > 6) @@ -161,7 +162,8 @@ unsigned char KeySig::GetAlterationAt(int pos) { return alteration_set[pos]; } -int KeySig::GetOctave(unsigned char pitch, int clefId) { +int KeySig::GetOctave(unsigned char pitch, int clefId) +{ int alter_set = 0; // flats int key_set = 0; diff --git a/src/style.cpp b/src/style.cpp index de8bf044098..ba6e1c1c487 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -53,6 +53,28 @@ Style::Style() m_lyricSize = DEFAULT_LYRIC_SIZE * PARAM_DENOMINATOR; m_minMeasureWidth = (short)(DEFAULT_MEASURE_WIDTH * PARAM_DENOMINATOR); + + /** The layout right margin by element */ + m_rightMarginBarline = DEFAULT_RIGHT_MARGIN_BARLINE * DEFINITON_FACTOR; + m_rightMarginBarlineAttr = DEFAULT_RIGHT_MARGIN_BARLINE_ATTR * DEFINITON_FACTOR; + m_rightMarginClef = DEFAULT_RIGHT_MARGIN_CLEF * DEFINITON_FACTOR; + m_rightMarginKeySig = DEFAULT_RIGHT_MARGIN_KEYSIG * DEFINITON_FACTOR; + m_rightMarginMensur = DEFAULT_RIGHT_MARGIN_MENSUR * DEFINITON_FACTOR; + m_rightMarginMeterSig = DEFAULT_RIGHT_MARGIN_METERSIG * DEFINITON_FACTOR; + m_rightMarginMRest = DEFAULT_RIGHT_MARGIN_MREST * DEFINITON_FACTOR; + m_rightMarginMultiRest = DEFAULT_RIGHT_MARGIN_MULTIREST * DEFINITON_FACTOR; + /** The default right margin */ + m_rightMarginDefault = DEFAULT_RIGHT_MARGIN_DEFAULT * DEFINITON_FACTOR; + + /** The layout left margin by element */ + m_leftMarginBarline = DEFAULT_LEFT_MARGIN_BARLINE * DEFINITON_FACTOR; + m_leftMarginBarlineAttr = DEFAULT_LEFT_MARGIN_BARLINE_ATTR * DEFINITON_FACTOR; + m_leftMarginChord = DEFAULT_LEFT_MARGIN_CHORD * DEFINITON_FACTOR; + m_leftMarginClef = DEFAULT_LEFT_MARGIN_CLEF * DEFINITON_FACTOR; + m_leftMarginMRest = DEFAULT_LEFT_MARGIN_MREST * DEFINITON_FACTOR; + m_leftMarginNote = DEFAULT_LEFT_MARGIN_NOTE * DEFINITON_FACTOR; + /** The default left margin */ + m_leftMarginDefault = DEFAULT_LEFT_MARGIN_DEFAULT * DEFINITON_FACTOR; } Style::~Style() From 276a3e68b7319e7e9c8292b80e79e309e0399654 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Wed, 12 Aug 2015 09:54:35 +0200 Subject: [PATCH 046/114] WIP keysig --- include/vrv/keysig.h | 3 +++ include/vrv/object.h | 14 ---------- src/object.cpp | 63 -------------------------------------------- src/scoredef.cpp | 8 +++--- 4 files changed, 7 insertions(+), 81 deletions(-) diff --git a/include/vrv/keysig.h b/include/vrv/keysig.h index a5b46d10112..5fc7bff6e86 100644 --- a/include/vrv/keysig.h +++ b/include/vrv/keysig.h @@ -106,6 +106,9 @@ class KeySigAttr: public Object, private: public: + /** */ + data_ACCIDENTAL_EXPLICIT m_drawingCancelAccid; + char m_drawingCancelAccidCount; private: diff --git a/include/vrv/object.h b/include/vrv/object.h index 0ddd577fb98..adfc2c9eb69 100644 --- a/include/vrv/object.h +++ b/include/vrv/object.h @@ -241,20 +241,6 @@ class Object */ Object *GetFirstChild( const std::type_info *elementType ); - /** - * Return the previous sibling object of the specified type. - * If no type is specified, returns the previous object. - * Returns NULL if not found in both cases. - */ - Object *GetPreviousSibling( const std::type_info *elementType = NULL ); - - /** - * Return the next sibling object of the specified type. - * If no type is specified, returns the next object. - * Returns NULL if not found in both cases. - */ - Object *GetNextSibling( const std::type_info *elementType = NULL ); - /** * Fill the list of all the children LayerElement. * This is used for navigating in a Layer (See Layer::GetPrevious and Layer::GetNext). diff --git a/src/object.cpp b/src/object.cpp index d21aa0d27f9..16558323b55 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -426,69 +426,6 @@ Object *Object::GetFirstChild( const std::type_info *elementType ) return NULL; } -Object *Object::GetNextSibling( const std::type_info *elementType ) -{ - if (!m_parent) { - return NULL; - } - - ArrayOfObjects::iterator iter; - bool foundCurrent = false; - for (iter = this->m_parent->m_children.begin(); iter != this->m_parent->m_children.end(); ++iter) - { - // we have not found the current object - if ( this == *iter ) { - foundCurrent = true; - // continue to find the next sibling - continue; - } - else if (!foundCurrent) { - continue; - } - if ( !elementType ) { - return *iter; - } - Object *o = *iter; - if ( typeid(*o) == *elementType ) - { - return *iter; - } - } - return NULL; -} - -Object *Object::GetPreviousSibling( const std::type_info *elementType ) -{ - if (!m_parent) { - return NULL; - } - - ArrayOfObjects::reverse_iterator iter; - bool foundCurrent = false; - for (iter = this->m_parent->m_children.rbegin(); iter != this->m_parent->m_children.rend(); ++iter) - { - // we have not found the current object - if ( this == *iter ) { - foundCurrent = true; - // continue to find the next sibling - continue; - } - else if (!foundCurrent) { - continue; - } - if ( !elementType ) { - return *iter; - } - Object *o = *iter; - if ( typeid(*o) == *elementType ) - { - return *iter; - } - } - return NULL; -} - - bool Object::GetSameAs( std::string *id, std::string *filename, int idx ) { int i = 0; diff --git a/src/scoredef.cpp b/src/scoredef.cpp index 2b67fac0365..33ff01fceb3 100644 --- a/src/scoredef.cpp +++ b/src/scoredef.cpp @@ -168,9 +168,9 @@ Clef *ScoreOrStaffDefAttrInterface::GetClefCopy() const else { ClefAttr *current_attr = dynamic_cast(m_clef); copy = new Clef(current_attr); + copy->SetScoreOrStaffDefAttr(true); } assert(copy); - copy->SetScoreOrStaffDefAttr(true); return copy; } @@ -186,9 +186,9 @@ KeySig *ScoreOrStaffDefAttrInterface::GetKeySigCopy() const else { KeySigAttr *current_attr = dynamic_cast(m_keySig); copy = new KeySig(current_attr); + copy->SetScoreOrStaffDefAttr(true); } assert(copy); - copy->SetScoreOrStaffDefAttr(true); return copy; } @@ -204,9 +204,9 @@ Mensur *ScoreOrStaffDefAttrInterface::GetMensurCopy() const else { MensurAttr *current_attr = dynamic_cast(m_mensur); copy = new Mensur(current_attr); + copy->SetScoreOrStaffDefAttr(true); } assert(copy); - copy->SetScoreOrStaffDefAttr(true); return copy; } @@ -222,9 +222,9 @@ MeterSig *ScoreOrStaffDefAttrInterface::GetMeterSigCopy() const else { MeterSigAttr *current_attr = dynamic_cast(m_meterSig); copy = new MeterSig(current_attr); + copy->SetScoreOrStaffDefAttr(true); } assert(copy); - copy->SetScoreOrStaffDefAttr(true); return copy; } From db6ab53c27432c5d5326afda121b6db8fead14b8 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Thu, 13 Aug 2015 17:16:46 +0200 Subject: [PATCH 047/114] WIP: removing dynamic cast by implementing home-brew classes indentifications --- emscripten/build.sh | 2 + include/vrv/accid.h | 3 +- include/vrv/aligner.h | 23 +- include/vrv/att.h | 37 +- include/vrv/att_comparison.h | 10 +- include/vrv/barline.h | 2 + include/vrv/beam.h | 1 + include/vrv/chord.h | 5 +- include/vrv/clef.h | 3 + include/vrv/custos.h | 1 + include/vrv/doc.h | 3 +- include/vrv/dot.h | 5 +- include/vrv/durationinterface.h | 2 +- include/vrv/editorial.h | 7 +- include/vrv/keysig.h | 3 + include/vrv/layer.h | 9 +- include/vrv/layerelement.h | 7 +- include/vrv/measure.h | 19 +- include/vrv/measureelement.h | 1 + include/vrv/mensur.h | 3 + include/vrv/metersig.h | 3 + include/vrv/mrest.h | 1 + include/vrv/multirest.h | 3 +- include/vrv/note.h | 11 +- include/vrv/object.h | 114 ++-- include/vrv/page.h | 1 + include/vrv/pitchinterface.h | 2 +- include/vrv/positioninterface.h | 3 +- include/vrv/rest.h | 1 + include/vrv/scoredef.h | 9 +- include/vrv/slur.h | 7 +- include/vrv/space.h | 1 + include/vrv/staff.h | 15 +- include/vrv/syl.h | 7 +- include/vrv/system.h | 23 +- include/vrv/tie.h | 7 +- include/vrv/timeinterface.h | 8 +- include/vrv/tuplet.h | 1 + include/vrv/verse.h | 5 +- include/vrv/vrvdef.h | 57 ++ libmei/atts_analysis.cpp | 56 +- libmei/atts_analysis.h | 14 + libmei/atts_cmn.cpp | 280 ++++----- libmei/atts_cmn.h | 70 +++ libmei/atts_cmnornaments.cpp | 32 +- libmei/atts_cmnornaments.h | 8 + libmei/atts_critapp.cpp | 16 +- libmei/atts_critapp.h | 4 + libmei/atts_edittrans.cpp | 32 +- libmei/atts_edittrans.h | 8 + libmei/atts_facsimile.cpp | 8 +- libmei/atts_facsimile.h | 2 + libmei/atts_figtable.cpp | 8 +- libmei/atts_figtable.h | 2 + libmei/atts_harmony.cpp | 24 +- libmei/atts_harmony.h | 6 + libmei/atts_header.cpp | 8 +- libmei/atts_header.h | 2 + libmei/atts_linkalign.cpp | 8 +- libmei/atts_linkalign.h | 2 + libmei/atts_lyrics.cpp | 8 +- libmei/atts_lyrics.h | 2 + libmei/atts_mensural.cpp | 56 +- libmei/atts_mensural.h | 14 + libmei/atts_midi.cpp | 48 +- libmei/atts_midi.h | 12 + libmei/atts_neumes.cpp | 16 +- libmei/atts_neumes.h | 4 + libmei/atts_pagebased.cpp | 8 +- libmei/atts_pagebased.h | 2 + libmei/atts_shared.cpp | 992 ++++++++++++++++---------------- libmei/atts_shared.h | 248 ++++++++ libmei/atts_tablature.cpp | 16 +- libmei/atts_tablature.h | 4 + src/accid.cpp | 11 +- src/aligner.cpp | 68 +-- src/att.cpp | 4 +- src/barline.cpp | 1 + src/chord.cpp | 24 +- src/clef.cpp | 15 +- src/doc.cpp | 44 +- src/dot.cpp | 6 +- src/durationinterface.cpp | 15 +- src/editorial.cpp | 24 +- src/iomei.cpp | 6 +- src/keysig.cpp | 21 +- src/layer.cpp | 29 +- src/layerelement.cpp | 68 +-- src/measure.cpp | 56 +- src/mensur.cpp | 15 +- src/metersig.cpp | 14 +- src/multirest.cpp | 8 +- src/note.cpp | 37 +- src/object.cpp | 118 ++-- src/page.cpp | 26 +- src/pitchinterface.cpp | 5 +- src/positioninterface.cpp | 3 +- src/scoredef.cpp | 27 +- src/slur.cpp | 6 +- src/staff.cpp | 39 +- src/syl.cpp | 18 +- src/system.cpp | 64 +-- src/tie.cpp | 6 +- src/timeinterface.cpp | 20 +- src/toolkit.cpp | 10 +- src/tuplet.cpp | 5 +- src/verse.cpp | 17 +- src/view_element.cpp | 14 +- src/view_page.cpp | 58 +- src/view_tuplet.cpp | 2 +- 110 files changed, 2003 insertions(+), 1346 deletions(-) diff --git a/emscripten/build.sh b/emscripten/build.sh index 78e97bf0f99..10f797082d8 100755 --- a/emscripten/build.sh +++ b/emscripten/build.sh @@ -30,6 +30,8 @@ if [ ! -d data ]; then mkdir data; fi ASM="\ -O3 --memory-init-file 0 \ -s ASM_JS=1 \ + --profiling -g2 \ + -s OUTLINING_LIMIT=10000 -s TOTAL_MEMORY=128*1024*1024 \ -s TOTAL_STACK=64*1024*1024" ASM_NAME="" diff --git a/include/vrv/accid.h b/include/vrv/accid.h index 66c9c45b147..d90a3e7989f 100644 --- a/include/vrv/accid.h +++ b/include/vrv/accid.h @@ -32,6 +32,7 @@ class Accid: public LayerElement, public PositionInterface, virtual ~Accid(); virtual void Reset(); virtual std::string GetClassName( ) { return "Accid"; }; + virtual int Is() { return ACCID; }; ///@} @@ -42,7 +43,7 @@ class Accid: public LayerElement, public PositionInterface, /** * See Object::PreparePointersByLayer */ - virtual int PreparePointersByLayer( ArrayPtrVoid params ); + virtual int PreparePointersByLayer( ArrayPtrVoid *params ); protected: diff --git a/include/vrv/aligner.h b/include/vrv/aligner.h index 871cb8817f7..ddbc8aec0c0 100644 --- a/include/vrv/aligner.h +++ b/include/vrv/aligner.h @@ -62,6 +62,7 @@ class SystemAligner: public Object // constructors and destructors SystemAligner(); virtual ~SystemAligner(); + virtual int Is() { return SYSTEM_ALIGNER; } int GetStaffAlignmentCount() const { return (int)m_children.size(); }; @@ -108,6 +109,7 @@ class StaffAlignment: public Object // constructors and destructors StaffAlignment(); virtual ~StaffAlignment(); + virtual int Is() { return STAFF_ALIGNMENT; } void SetYRel( int yRel ) { m_yRel = yRel; }; int GetYRel() { return m_yRel; }; @@ -131,13 +133,13 @@ class StaffAlignment: public Object * Set the position of the StaffAlignment. * Functor redirected from System. */ - virtual int SetAligmentYPos( ArrayPtrVoid params ); + virtual int SetAligmentYPos( ArrayPtrVoid *params ); /** * Correct the Y alignment once the the content of a system has been aligned and laid out. * Special case of functor redirected from System. */ - virtual int IntegrateBoundingBoxYShift( ArrayPtrVoid params ); + virtual int IntegrateBoundingBoxYShift( ArrayPtrVoid *params ); private: @@ -174,6 +176,7 @@ class Alignment: public Object Alignment( ); Alignment( double time, AlignmentType type = ALIGNMENT_DEFAULT ); virtual ~Alignment(); + virtual int Is() { return ALIGNMENT; } void SetXRel( int x_rel ); int GetXRel() { return m_xRel; }; @@ -215,25 +218,25 @@ class Alignment: public Object * Correct the X alignment of grace notes once the the content of a system has been aligned and laid out. * Special case that redirects the functor to the GraceAligner. */ - virtual int IntegrateBoundingBoxGraceXShift( ArrayPtrVoid params ); + virtual int IntegrateBoundingBoxGraceXShift( ArrayPtrVoid *params ); /** * Correct the X alignment once the the content of a system has been aligned and laid out. * Special case of functor redirected from Measure. */ - virtual int IntegrateBoundingBoxXShift( ArrayPtrVoid params ); + virtual int IntegrateBoundingBoxXShift( ArrayPtrVoid *params ); /** * Set the position of the Alignment. * Looks at the time different with the previous Alignment. */ - virtual int SetAligmentXPos( ArrayPtrVoid params ); + virtual int SetAligmentXPos( ArrayPtrVoid *params ); /** * Justify the X positions * Special case of functor redirected from Measure. */ - virtual int JustifyX( ArrayPtrVoid params ); + virtual int JustifyX( ArrayPtrVoid *params ); private: @@ -294,6 +297,7 @@ class MeasureAligner: public Object // constructors and destructors MeasureAligner(); virtual ~MeasureAligner(); + virtual int Is() { return MEASURE_ALIGNER; } int GetAlignmentCount() const { return (int)m_children.size(); }; @@ -337,20 +341,20 @@ class MeasureAligner: public Object * Correct the X alignment once the the content of a system has been aligned and laid out. * Special case of functor redirected from Measure. */ - virtual int IntegrateBoundingBoxXShift( ArrayPtrVoid params ); + virtual int IntegrateBoundingBoxXShift( ArrayPtrVoid *params ); /** * Set the position of the Alignment. * Looks at the time different with the previous Alignment. * For each MeasureAlignment, we need to reset the previous time position. */ - virtual int SetAligmentXPos( ArrayPtrVoid params ); + virtual int SetAligmentXPos( ArrayPtrVoid *params ); /** * Justify the X positions * Special case of functor redirected from Measure. */ - virtual int JustifyX( ArrayPtrVoid params ); + virtual int JustifyX( ArrayPtrVoid *params ); private: void AddAlignment( Alignment *alignment, int idx = -1 ); @@ -388,6 +392,7 @@ class GraceAligner: public MeasureAligner // constructors and destructors GraceAligner( ); virtual ~GraceAligner(); + virtual int Is() { return GRACE_ALIGNER; } /** * Because the grace notes appear from left to right but need to be aligned diff --git a/include/vrv/att.h b/include/vrv/att.h index 605086f882b..01fc4007aa4 100644 --- a/include/vrv/att.h +++ b/include/vrv/att.h @@ -16,7 +16,7 @@ #include "attdef.h" namespace vrv { - + class Object; //---------------------------------------------------------------------------- @@ -199,6 +199,33 @@ class Att }; +//---------------------------------------------------------------------------- +// AttInterface +//---------------------------------------------------------------------------- + +class AttInterface +{ + +public: + AttInterface() {}; + virtual ~AttInterface() {}; + + /** + * + */ + void RegisterInterfaceAttClass( int attClassId ) { m_interfaceAttClasses.push_back( attClassId ); }; + std::vector *GetAttClasses() { return &m_interfaceAttClasses; }; + + virtual int InterfaceId() { return 0; }; + + +private: + /** + * + */ + std::vector m_interfaceAttClasses; +}; + //---------------------------------------------------------------------------- // AttComparison //---------------------------------------------------------------------------- @@ -207,18 +234,18 @@ class AttComparison { public: - AttComparison( const std::type_info *elementType ) { - m_elementType = elementType; + AttComparison( int classId ) { + m_classId = classId; }; virtual bool operator() (Object *object); - const std::type_info *GetType() { return m_elementType; }; + int GetType() { return m_classId; }; bool MatchesType( Object *object ); protected: - const std::type_info *m_elementType; + int m_classId; }; } // namespace vrv diff --git a/include/vrv/att_comparison.h b/include/vrv/att_comparison.h index 222757e953a..68abc711ad8 100644 --- a/include/vrv/att_comparison.h +++ b/include/vrv/att_comparison.h @@ -20,8 +20,8 @@ class AttCommonNComparison: public AttComparison { public: - AttCommonNComparison( const std::type_info *elementType, const int n ): - AttComparison( elementType ) + AttCommonNComparison( int AttClassId, const int n ): + AttComparison( AttClassId ) { m_n = n; }; @@ -31,9 +31,15 @@ class AttCommonNComparison: public AttComparison virtual bool operator() (Object *object) { if (!MatchesType(object)) return false; + /* AttCommon *element = dynamic_cast(object); if (!element) return false; return (element->GetN() == m_n); + */ + + if (!object->HasAttClass( ATT_COMMON )) return false; + AttCommon *element = dynamic_cast(object); + return (element->GetN() == m_n); } private: diff --git a/include/vrv/barline.h b/include/vrv/barline.h index 4c4b9bc499c..f9557c82527 100644 --- a/include/vrv/barline.h +++ b/include/vrv/barline.h @@ -35,6 +35,7 @@ class Barline: public LayerElement, virtual void Reset(); virtual Object* Clone() { return new Barline(*this); }; virtual std::string GetClassName( ) { return "Barline"; }; + virtual int Is() { return BAR_LINE; }; ///@} /** @@ -80,6 +81,7 @@ class BarlineAttr: public Barline virtual ~BarlineAttr(); virtual Object* Clone() { return new BarlineAttr(*this); }; virtual std::string GetClassName( ) { return "BarlineAttr"; }; + virtual int Is() { return BAR_LINE_ATTR; }; ///@} }; diff --git a/include/vrv/beam.h b/include/vrv/beam.h index b39cea87373..9c89ea1a6c0 100644 --- a/include/vrv/beam.h +++ b/include/vrv/beam.h @@ -40,6 +40,7 @@ class Beam: public LayerElement, public ObjectListInterface, public DrawingListI virtual ~Beam(); virtual void Reset(); virtual std::string GetClassName( ) { return "Beam"; }; + virtual int Is() { return BEAM; }; ///@} int GetNoteCount() const { return (int)m_children.size(); }; diff --git a/include/vrv/chord.h b/include/vrv/chord.h index 0cdb819139f..4aaabb4fa48 100644 --- a/include/vrv/chord.h +++ b/include/vrv/chord.h @@ -48,6 +48,7 @@ class Chord: public LayerElement, public ObjectListInterface, public DurationInt virtual ~Chord(); virtual void Reset(); virtual std::string GetClassName( ) { return "Chord"; }; + virtual int Is() { return CHORD; }; ///@} /** @@ -86,12 +87,12 @@ class Chord: public LayerElement, public ObjectListInterface, public DurationInt /** * See Object::PrepareTieAttr */ - virtual int PrepareTieAttr( ArrayPtrVoid params ); + virtual int PrepareTieAttr( ArrayPtrVoid *params ); /** * See Object::PrepareTieAttr */ - virtual int PrepareTieAttrEnd( ArrayPtrVoid params ); + virtual int PrepareTieAttrEnd( ArrayPtrVoid *params ); protected: /** diff --git a/include/vrv/clef.h b/include/vrv/clef.h index fc7ef4dd803..fe160f5da24 100644 --- a/include/vrv/clef.h +++ b/include/vrv/clef.h @@ -36,10 +36,12 @@ class Clef: public LayerElement, ///@{ Clef(); Clef( ClefAttr *clefAttr ); + void Init(); virtual ~Clef(); virtual void Reset(); virtual Object* Clone() { return new Clef(*this); }; virtual std::string GetClassName( ) { return "Clef"; }; + virtual int Is() { return CLEF; }; ///@} /** @@ -81,6 +83,7 @@ class ClefAttr: public Object, virtual ~ClefAttr(); virtual void Reset(); virtual std::string GetClassName( ) { return "ClefAttr"; }; + virtual int Is() { return CLEF_ATTR; }; virtual Object* Clone() { return new ClefAttr(*this); }; ///@} diff --git a/include/vrv/custos.h b/include/vrv/custos.h index 4494534fe5f..b5254d04e09 100644 --- a/include/vrv/custos.h +++ b/include/vrv/custos.h @@ -30,6 +30,7 @@ class Custos: public LayerElement, public PositionInterface virtual ~Custos(); virtual void Reset(); virtual std::string GetClassName( ) { return "Custos"; }; + virtual int Is() { return CUSTOS; }; ///@} protected: diff --git a/include/vrv/doc.h b/include/vrv/doc.h index 7a8c168199d..7890e39472d 100644 --- a/include/vrv/doc.h +++ b/include/vrv/doc.h @@ -39,6 +39,7 @@ class Doc: public Object // constructors and destructors Doc(); virtual ~Doc(); + virtual int Is() { return DOC; } void AddPage( Page *page ); @@ -185,7 +186,7 @@ class Doc: public Object * Functor for setting wordpos and connector ends * The functor is process by doc at the end of a document of closing opened syl. */ - virtual int PrepareLyricsEnd( ArrayPtrVoid params ); + virtual int PrepareLyricsEnd( ArrayPtrVoid *params ); private: /** diff --git a/include/vrv/dot.h b/include/vrv/dot.h index b9fbf741b6b..aedbef1c86a 100644 --- a/include/vrv/dot.h +++ b/include/vrv/dot.h @@ -32,6 +32,7 @@ class Dot: public LayerElement, public PositionInterface virtual ~Dot(); virtual void Reset(); virtual std::string GetClassName( ) { return "Dot"; }; + virtual int Is() { return DOT; }; ///@} @@ -42,12 +43,12 @@ class Dot: public LayerElement, public PositionInterface /** * See Object::PreparePointersByLayer */ - virtual int PreparePointersByLayer( ArrayPtrVoid params ); + virtual int PreparePointersByLayer( ArrayPtrVoid *params ); /** * Reset the drawing values before calling PrepareDrawing after changes. */ - virtual int ResetDarwing( ArrayPtrVoid params ); + virtual int ResetDarwing( ArrayPtrVoid *params ); protected: diff --git a/include/vrv/durationinterface.h b/include/vrv/durationinterface.h index c0792c25a65..1baef6b6b25 100644 --- a/include/vrv/durationinterface.h +++ b/include/vrv/durationinterface.h @@ -25,7 +25,7 @@ class Object; * This class is an interface for elements with duration, such as notes and rests. * It is not an abstract class but should not be instanciate directly. */ -class DurationInterface: +class DurationInterface: public AttInterface, public AttAugmentdots, public AttBeamsecondary, public AttDurationMusical, diff --git a/include/vrv/editorial.h b/include/vrv/editorial.h index 0510fe57d4c..ea0ab7e22a9 100644 --- a/include/vrv/editorial.h +++ b/include/vrv/editorial.h @@ -52,6 +52,7 @@ class EditorialElement: public DocObject, EditorialElement(std::string classid); virtual ~EditorialElement(); virtual void Reset(); + virtual int Is() { return EDITORIAL_ELEMENT; }; ///@} /** @@ -77,7 +78,7 @@ class EditorialElement: public DocObject, * For EditorialElement, this means only moving them since their width is not * taken into account. Only system children EditorialElement are processed. */ - virtual int CastOffSystems( ArrayPtrVoid params ); + virtual int CastOffSystems( ArrayPtrVoid *params ); protected: @@ -107,6 +108,7 @@ class App: public EditorialElement virtual ~App(); virtual void Reset(); virtual std::string GetClassName( ) { return "App"; }; + virtual int Is() { return APP; }; ///@} /** Getter for level **/ @@ -147,6 +149,7 @@ class Lem: public EditorialElement, virtual ~Lem(); virtual void Reset(); virtual std::string GetClassName( ) { return "Lem"; }; + virtual int Is() { return LEM; }; ///@} protected: @@ -176,6 +179,7 @@ class Rdg: public EditorialElement, virtual ~Rdg(); virtual void Reset(); virtual std::string GetClassName( ) { return "Rdg"; }; + virtual int Is() { return RDG; }; ///@} protected: @@ -205,6 +209,7 @@ class Supplied: public EditorialElement, virtual ~Supplied(); virtual void Reset(); virtual std::string GetClassName( ) { return "Supplied"; }; + virtual int Is() { return SUPPLIED; }; ///@} protected: diff --git a/include/vrv/keysig.h b/include/vrv/keysig.h index a5b46d10112..ba2a4e5b163 100644 --- a/include/vrv/keysig.h +++ b/include/vrv/keysig.h @@ -45,10 +45,12 @@ class KeySig: public LayerElement, KeySig(); KeySig(int num_alter, char alter); KeySig( KeySigAttr *keySigAttr ); + void Init(); virtual ~KeySig(); virtual void Reset(); virtual Object* Clone() { return new KeySig(*this); }; virtual std::string GetClassName( ) { return "KeySig"; }; + virtual int Is() { return KEY_SIG; }; unsigned char GetAlterationAt(int pos); int GetOctave(unsigned char pitch, int clefId); @@ -100,6 +102,7 @@ class KeySigAttr: public Object, virtual ~KeySigAttr(); virtual void Reset(); virtual std::string GetClassName( ) { return "KeySigAttr"; }; + virtual int Is() { return KEY_SIG_ATTR; }; virtual Object* Clone() { return new KeySigAttr(*this); }; ///@} diff --git a/include/vrv/layer.h b/include/vrv/layer.h index 590d1591339..4f6d7fd325d 100644 --- a/include/vrv/layer.h +++ b/include/vrv/layer.h @@ -51,6 +51,7 @@ class Layer: public DocObject, public DrawingListInterface, public ObjectListInt virtual ~Layer(); virtual void Reset(); virtual std::string GetClassName( ) { return "Layer"; }; + virtual int Is() { return LAYER; }; ///@} void AddLayerElement( LayerElement *element, int idx = -1 ); @@ -151,23 +152,23 @@ class Layer: public DocObject, public DrawingListInterface, public ObjectListInt /** * Align horizontally the content of a layer. */ - virtual int AlignHorizontally( ArrayPtrVoid params ); + virtual int AlignHorizontally( ArrayPtrVoid *params ); /** * Align horizontally the content of a layer. */ - virtual int AlignHorizontallyEnd( ArrayPtrVoid params ); + virtual int AlignHorizontallyEnd( ArrayPtrVoid *params ); /** * Builds a tree of int (IntTree) with the staff/layer/verse numbers * and for staff/layer to be then processed. */ - virtual int PrepareProcessingLists( ArrayPtrVoid params ); + virtual int PrepareProcessingLists( ArrayPtrVoid *params ); /** * Set the drawing position (m_drawingX and m_drawingY) values for objects */ - virtual int SetDrawingXY( ArrayPtrVoid params ); + virtual int SetDrawingXY( ArrayPtrVoid *params ); private: diff --git a/include/vrv/layerelement.h b/include/vrv/layerelement.h index 8cb18258240..b010a799a96 100644 --- a/include/vrv/layerelement.h +++ b/include/vrv/layerelement.h @@ -41,6 +41,7 @@ class LayerElement: public DocObject LayerElement(std::string classid); virtual ~LayerElement(); virtual void Reset(); + virtual int Is() { return LAYER_ELEMENT; }; ///@} LayerElement& operator=( const LayerElement& element ); // copy assignement - this need to be changed to the Object::Clone way; @@ -122,17 +123,17 @@ class LayerElement: public DocObject /** * See Object::AlignHorizontally */ - virtual int AlignHorizontally( ArrayPtrVoid params ); + virtual int AlignHorizontally( ArrayPtrVoid *params ); /** * See Object::PrepareTimeSpanning */ - virtual int PrepareTimeSpanning( ArrayPtrVoid params ); + virtual int PrepareTimeSpanning( ArrayPtrVoid *params ); /** * Set the drawing position (m_drawingX and m_drawingY) values for objects */ - virtual int SetDrawingXY( ArrayPtrVoid params ); + virtual int SetDrawingXY( ArrayPtrVoid *params ); private: diff --git a/include/vrv/measure.h b/include/vrv/measure.h index c8022358a52..279f102ed83 100644 --- a/include/vrv/measure.h +++ b/include/vrv/measure.h @@ -43,6 +43,7 @@ class Measure: public DocObject, virtual ~Measure(); virtual void Reset(); virtual std::string GetClassName( ) { return "Measure"; }; + virtual int Is() { return MEASURE; }; ///@} /** @@ -111,53 +112,53 @@ class Measure: public DocObject, /** * AlignHorizontally the content of a measure. */ - virtual int AlignHorizontally( ArrayPtrVoid params ); + virtual int AlignHorizontally( ArrayPtrVoid *params ); /** * AlignVertically the content of a measure. */ - virtual int AlignVertically( ArrayPtrVoid params ); + virtual int AlignVertically( ArrayPtrVoid *params ); /** * Correct the X alignment of grace notes once the the content of a system has been aligned and laid out. * Special case that redirects the functor to the GraceAligner. */ - virtual int IntegrateBoundingBoxGraceXShift( ArrayPtrVoid params ); + virtual int IntegrateBoundingBoxGraceXShift( ArrayPtrVoid *params ); /** * Correct the X alignment once the the content of a system has been aligned and laid out. * Special case that redirects the functor to the MeasureAligner. */ - virtual int IntegrateBoundingBoxXShift( ArrayPtrVoid params ); + virtual int IntegrateBoundingBoxXShift( ArrayPtrVoid *params ); /** * Set the position of the Alignment. * Special case that redirects the functor to the MeasureAligner. */ - virtual int SetAligmentXPos( ArrayPtrVoid params ); + virtual int SetAligmentXPos( ArrayPtrVoid *params ); /** * Align the measures by adjusting the m_drawingXRel position looking at the MeasureAligner. * This method also moves the end position of the measure according to the barLine width. */ - virtual int AlignMeasures( ArrayPtrVoid params ); + virtual int AlignMeasures( ArrayPtrVoid *params ); /** * Justify the X positions * Special case that redirects the functor to the MeasureAligner. */ - virtual int JustifyX( ArrayPtrVoid params ); + virtual int JustifyX( ArrayPtrVoid *params ); /** * Fill a page by adding systems with the appropriate length * */ - virtual int CastOffSystems( ArrayPtrVoid params ); + virtual int CastOffSystems( ArrayPtrVoid *params ); /** * Set the drawing position (m_drawingX and m_drawingY) values for objects */ - virtual int SetDrawingXY( ArrayPtrVoid params ); + virtual int SetDrawingXY( ArrayPtrVoid *params ); public: diff --git a/include/vrv/measureelement.h b/include/vrv/measureelement.h index 781c31c0b55..5171ef6251a 100644 --- a/include/vrv/measureelement.h +++ b/include/vrv/measureelement.h @@ -33,6 +33,7 @@ class MeasureElement: public DocObject MeasureElement(std::string classid); virtual ~MeasureElement(); virtual void Reset(); + virtual int Is() { return MEASURE_ELEMENT; }; ///@} private: diff --git a/include/vrv/mensur.h b/include/vrv/mensur.h index 3b52216ba39..dbe7f3aaac6 100644 --- a/include/vrv/mensur.h +++ b/include/vrv/mensur.h @@ -39,9 +39,11 @@ class Mensur: public LayerElement, ///@{ Mensur(); Mensur( MensurAttr *mensurAttr ); + void Init(); virtual ~Mensur(); virtual void Reset(); virtual std::string GetClassName( ) { return "Mensur"; }; + virtual int Is() { return MENSUR; }; virtual Object* Clone() { return new Mensur(*this); }; ///@} @@ -85,6 +87,7 @@ class MensurAttr: public Object, virtual ~MensurAttr(); virtual void Reset(); virtual std::string GetClassName( ) { return "MensurAttr"; }; + virtual int Is() { return MENSUR_ATTR; }; virtual Object* Clone() { return new MensurAttr(*this); }; ///@} diff --git a/include/vrv/metersig.h b/include/vrv/metersig.h index 56f8c240301..72279670504 100644 --- a/include/vrv/metersig.h +++ b/include/vrv/metersig.h @@ -34,9 +34,11 @@ class MeterSig: public LayerElement, ///@{ MeterSig(); MeterSig( MeterSigAttr *meterSigAttr ); + void Init(); virtual ~MeterSig(); virtual void Reset(); virtual std::string GetClassName( ) { return "MeterSig"; }; + virtual int Is() { return METER_SIG; }; virtual Object* Clone() { return new MeterSig(*this); }; ///@} @@ -70,6 +72,7 @@ class MeterSigAttr: public Object, virtual ~MeterSigAttr(); virtual void Reset(); virtual std::string GetClassName( ) { return "MeterSigAttr"; }; + virtual int Is() { return METER_SIG_ATTR; }; virtual Object* Clone() { return new MeterSigAttr(*this); }; ///@} diff --git a/include/vrv/mrest.h b/include/vrv/mrest.h index 1d10f2ea337..4ef519d4378 100644 --- a/include/vrv/mrest.h +++ b/include/vrv/mrest.h @@ -32,6 +32,7 @@ class MRest: public LayerElement virtual ~MRest(); virtual void Reset(); virtual std::string GetClassName( ){ return "MRest"; }; ; + virtual int Is() { return MREST; }; ///@} private: diff --git a/include/vrv/multirest.h b/include/vrv/multirest.h index bb0d425ec8e..ca3db626cf0 100644 --- a/include/vrv/multirest.h +++ b/include/vrv/multirest.h @@ -31,10 +31,11 @@ class MultiRest: public LayerElement, */ ///@{ MultiRest(); - MultiRest(int number); + //MultiRest(int number); virtual ~MultiRest(); virtual void Reset(); virtual std::string GetClassName( ) { return "MultiRest"; }; + virtual int Is() { return MULTI_REST; }; ///@} private: diff --git a/include/vrv/note.h b/include/vrv/note.h index 361f88dbfb8..177fb2b943a 100644 --- a/include/vrv/note.h +++ b/include/vrv/note.h @@ -59,6 +59,7 @@ class Note: public LayerElement, public DurationInterface, public PitchInterface virtual ~Note(); virtual void Reset(); virtual std::string GetClassName( ) { return "Note"; }; + virtual int Is() { return NOTE; }; ///@} /** @@ -114,27 +115,27 @@ class Note: public LayerElement, public DurationInterface, public PitchInterface /** * See Object::PrepareTieAttr */ - virtual int PrepareTieAttr( ArrayPtrVoid params ); + virtual int PrepareTieAttr( ArrayPtrVoid *params ); /** * Functor for setting wordpos and connector ends * The functor is process by staff/layer/verse using an ArrayOfAttComparisons filter. */ - virtual int PrepareLyrics( ArrayPtrVoid params ); + virtual int PrepareLyrics( ArrayPtrVoid *params ); /** * See Object::PreparePointersByLayer */ - virtual int PreparePointersByLayer( ArrayPtrVoid params ); + virtual int PreparePointersByLayer( ArrayPtrVoid *params ); /** */ - virtual int FillStaffCurrentTimeSpanning( ArrayPtrVoid params ); + virtual int FillStaffCurrentTimeSpanning( ArrayPtrVoid *params ); /** * Reset the drawing values before calling PrepareDrawing after changes. */ - virtual int ResetDarwing( ArrayPtrVoid params ); + virtual int ResetDarwing( ArrayPtrVoid *params ); private: diff --git a/include/vrv/object.h b/include/vrv/object.h index 0ddd577fb98..1cb2dc619cc 100644 --- a/include/vrv/object.h +++ b/include/vrv/object.h @@ -19,7 +19,7 @@ #include "vrvdef.h" namespace vrv { - + class Doc; class EditorialElement; class FileOutputStream; @@ -68,6 +68,15 @@ class Object Object(); Object(std::string classid); virtual ~Object(); + virtual int Is(); + + /** + * + */ + void RegisterAttClass( int attClassId ) { m_attClasses.push_back( attClassId ); }; + bool HasAttClass( int attClassId ) { return std::find(m_attClasses.begin(), m_attClasses.end(), attClassId) != m_attClasses.end(); }; + void RegisterInterface( std::vector *attClasses, int interfaceId ); + bool HasInterface( int interfaceId ); /** * Reset the object, that is 1) removing all childs and 2) resetting all attributes. @@ -198,7 +207,7 @@ class Object * Look for a child with the specified type (returns NULL if not found) * This method is a wrapper to a Object::FindByType functor. */ - Object *FindChildByType( const std::type_info *elementType, + Object *FindChildByType( int classId, int deepness = UNLIMITED_DEPTH, bool direction = FORWARD ); /** @@ -228,13 +237,13 @@ class Object * Return the first parent of the specified type. * The maxSteps parameter limit the search to a certain number of level if not -1. */ - Object *GetFirstParent( const std::type_info *elementType, int maxSteps = -1 ); + Object *GetFirstParent( const int elementType, int maxSteps = -1 ); /** * Return the last parent that is NOT of the specified type. * The maxSteps parameter limit the search to a certain number of level if not -1. */ - Object *GetLastParentNot( const std::type_info *elementType, int maxSteps = -1 ); + Object *GetLastParentNot( const int elementType, int maxSteps = -1 ); /** * Return the first of the specified type. @@ -309,8 +318,8 @@ class Object * Deepness allow to specify how many child levels should be processed UNLIMITED_DEPTH means no * limit (EditorialElement objects do not count). */ - virtual void Process( Functor *functor, ArrayPtrVoid params, Functor *endFunctor = NULL, - ArrayOfAttComparisons * filters = NULL, int deepness = UNLIMITED_DEPTH, + virtual void Process( Functor *functor, ArrayPtrVoid *params, Functor *endFunctor = NULL, + ArrayOfAttComparisons *filters = NULL, int deepness = UNLIMITED_DEPTH, bool direction = FORWARD ); //----------// @@ -320,33 +329,33 @@ class Object /** * Add each LayerElements and its children to a flat list */ - virtual int AddLayerElementToFlatList( ArrayPtrVoid params ); + virtual int AddLayerElementToFlatList( ArrayPtrVoid *params ); /** * Find a Object with a specified uuid. * param 0: the uuid we are looking for. * param 1: the pointer to pointer to the Object retrieved (if found). */ - virtual int FindByUuid( ArrayPtrVoid params ); + virtual int FindByUuid( ArrayPtrVoid *params ); /** * Find a Object with a AttComparison functor . * param 0: the pointer to the AttComparsion we are evaluating. * param 1: the pointer to pointer to the Object retrieved (if found). */ - virtual int FindByAttComparison( ArrayPtrVoid params ); + virtual int FindByAttComparison( ArrayPtrVoid *params ); /** * Save the content of and object by calling the appropriate FileOutputStream method * param 0: a pointer to the FileOutputStream. */ - virtual int Save( ArrayPtrVoid params ); + virtual int Save( ArrayPtrVoid *params ); /** * Save the content of and object by calling the appropriate FileOutputStream method * param 0: a pointer to the FileOutputStream. */ - virtual int SaveEnd( ArrayPtrVoid params ); + virtual int SaveEnd( ArrayPtrVoid *params ); /** * @name Functors for aligning the content horizontally @@ -359,60 +368,60 @@ class Object * It creates it if no other note or event occurs at its position. * Any functor overriding this one needs to call ResetHorizontalAlignment */ - virtual int AlignHorizontally( ArrayPtrVoid params ); + virtual int AlignHorizontally( ArrayPtrVoid *params ); /** * For each Layer, align the grace note stacked in GraceAlignment */ - virtual int AlignHorizontallyEnd( ArrayPtrVoid params ) { return FUNCTOR_CONTINUE; }; + virtual int AlignHorizontallyEnd( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; /** * Align the measures by adjusting the m_drawingXRel position looking at the MeasureAligner. * param 0: the cumulated shift */ - virtual int AlignMeasures( ArrayPtrVoid params ) { return FUNCTOR_CONTINUE; }; + virtual int AlignMeasures( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; /** * Store the width of the system in the MeasureAligner for justification * This method is called at the end of a system. */ - virtual int AlignMeasuresEnd( ArrayPtrVoid params ) { return FUNCTOR_CONTINUE; }; + virtual int AlignMeasuresEnd( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; /** * Correct the X alignment once the the content of a system has been aligned and laid out * See Measure::IntegrateBoundingBoxXShift for actual implementation */ - virtual int IntegrateBoundingBoxGraceXShift( ArrayPtrVoid params ) { return FUNCTOR_CONTINUE; }; + virtual int IntegrateBoundingBoxGraceXShift( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; /** * Correct the X alignment once the the content of a system has been aligned and laid out * See Measure::IntegrateBoundingBoxXShift for actual implementation */ - virtual int IntegrateBoundingBoxXShift( ArrayPtrVoid params ) { return FUNCTOR_CONTINUE; }; + virtual int IntegrateBoundingBoxXShift( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; /** * Set the position of the Alignment. * Looks at the time different with the previous Alignment. */ - virtual int SetAligmentXPos( ArrayPtrVoid params ) { return FUNCTOR_CONTINUE; }; + virtual int SetAligmentXPos( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; /** * Lay out the X positions of the grace notes looking that the bounding boxes. * The m_xShift is updated appropriately */ - virtual int SetBoundingBoxGraceXShift( ArrayPtrVoid params ); + virtual int SetBoundingBoxGraceXShift( ArrayPtrVoid *params ); /** * Lay out the X positions of the staff content looking that the bounding boxes. * The m_xShift is updated appropriately */ - virtual int SetBoundingBoxXShift( ArrayPtrVoid params ); + virtual int SetBoundingBoxXShift( ArrayPtrVoid *params ); /** * Lay out the X positions of the staff content looking that the bounding boxes. * This is the Functor called at the end of the measure or a layer. */ - virtual int SetBoundingBoxXShiftEnd( ArrayPtrVoid params ); + virtual int SetBoundingBoxXShiftEnd( ArrayPtrVoid *params ); ///@} @@ -426,42 +435,42 @@ class Object * For each Staff, instanciate its StaffAlignment. * Any functor overriding this one needs to call ResetVerticalAlignment */ - virtual int AlignVertically( ArrayPtrVoid params ); + virtual int AlignVertically( ArrayPtrVoid *params ); /** * Align the system by adjusting the m_drawingYRel position looking at the SystemAligner. */ - virtual int AlignSystems( ArrayPtrVoid params ) { return FUNCTOR_CONTINUE; }; + virtual int AlignSystems( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; /** * Store the height of the system in the SystemAligner for justification * This method is called at the end of a system. */ - virtual int AlignSystemsEnd( ArrayPtrVoid params ) { return FUNCTOR_CONTINUE; }; + virtual int AlignSystemsEnd( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; /** * Correct the Y alignment once the the content of a system has been aligned and laid out * See System::IntegrateBoundingBoxYShift for actual implementation */ - virtual int IntegrateBoundingBoxYShift( ArrayPtrVoid params ) { return FUNCTOR_CONTINUE; }; + virtual int IntegrateBoundingBoxYShift( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; /** * Set the position of the StaffAlignment. */ - virtual int SetAligmentYPos( ArrayPtrVoid params ) { return FUNCTOR_CONTINUE; }; + virtual int SetAligmentYPos( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; /** * Lay out the Y positions of the staff looking that the bounding box of each staff. * The m_yShift is updated appropriately */ - virtual int SetBoundingBoxYShift( ArrayPtrVoid params ); + virtual int SetBoundingBoxYShift( ArrayPtrVoid *params ); /** * Lay out the Y positions of the staff looking that the bounding boxes of each staff * This is the Functor called at the end of the system or a measure. */ - virtual int SetBoundingBoxYShiftEnd( ArrayPtrVoid params ); + virtual int SetBoundingBoxYShiftEnd( ArrayPtrVoid *params ); ///@} @@ -474,13 +483,13 @@ class Object * Replace all the staffDefs in a scoreDef. * param 0: a pointer to the scoreDef we are going to replace the staffDefs */ - virtual int ReplaceStaffDefsInScoreDef( ArrayPtrVoid params ) { return FUNCTOR_CONTINUE; }; + virtual int ReplaceStaffDefsInScoreDef( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; /** * Set the initial scoreDef of each page. * This is necessary for integrating changes that occur within a page. */ - virtual int SetCurrentScoreDef( ArrayPtrVoid params ); + virtual int SetCurrentScoreDef( ArrayPtrVoid *params ); /** * Set the initial scoreDef of each page. @@ -490,7 +499,7 @@ class Object * param 2: bool the mensur flag. * param 3: bool the metersig flag. */ - virtual int SetStaffDefRedrawFlags( ArrayPtrVoid params ) { return FUNCTOR_CONTINUE; }; + virtual int SetStaffDefRedrawFlags( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; ///@} @@ -500,7 +509,7 @@ class Object * param 0: IntTree* * param 1: IntTree* */ - virtual int PrepareProcessingLists( ArrayPtrVoid params ) { return FUNCTOR_CONTINUE; }; + virtual int PrepareProcessingLists( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; /** * Matches start and end for TimeSpanningInterface elements (such as tie or slur) @@ -509,7 +518,7 @@ class Object * param 0: std::vector* that holds the current elements to match * param 1: bool* fillList for indicating whether the elements have to be stack or not */ - virtual int PrepareTimeSpanning( ArrayPtrVoid params ) { return FUNCTOR_CONTINUE; }; + virtual int PrepareTimeSpanning( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; /** * Processes Chord and Note for matching @tie by processing by Layer and by looking @@ -517,7 +526,7 @@ class Object * param 0: std::vector* that holds the current notes with open ties * param 1: Chord** currentChord for the current chord if in a chord */ - virtual int PrepareTieAttr( ArrayPtrVoid params ) { return FUNCTOR_CONTINUE; }; + virtual int PrepareTieAttr( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; /** * Processes Chord and Note for matching @tie by processing by Layer; resets the @@ -525,7 +534,7 @@ class Object * param 0: std::vector* that holds the current notes with open ties (unused) * param 1: Chord** currentChord for the current chord if in a chord */ - virtual int PrepareTieAttrEnd( ArrayPtrVoid params ) { return FUNCTOR_CONTINUE; }; + virtual int PrepareTieAttrEnd( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; /** * Processes by Layer and set drawing pointers. @@ -533,36 +542,36 @@ class Object * Set Note::m_drawingAccid for Note elements having an Accid child * param 0: Note** currentNote for the current not to w */ - virtual int PreparePointersByLayer( ArrayPtrVoid params ) { return FUNCTOR_CONTINUE; }; + virtual int PreparePointersByLayer( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; /** * Functor for setting wordpos and connector ends * The functor is process by staff/layer/verse using an ArrayOfAttComparisons filter. */ - virtual int PrepareLyrics( ArrayPtrVoid params ) { return FUNCTOR_CONTINUE; }; + virtual int PrepareLyrics( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; /** * Functor for setting wordpos and connector ends * The functor is process by doc at the end of a document of closing opened syl. */ - virtual int PrepareLyricsEnd( ArrayPtrVoid params ) { return FUNCTOR_CONTINUE; }; + virtual int PrepareLyricsEnd( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; /** * Goes through all the TimeSpanningInterface element and set them a current to each staff * where require. For Note with DrawingTieAttr, the functor is redireted to the tie object * param 0: std::vector* of the current running TimeSpanningInterface elements */ - virtual int FillStaffCurrentTimeSpanning( ArrayPtrVoid params ) { return FUNCTOR_CONTINUE; }; + virtual int FillStaffCurrentTimeSpanning( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; /** * Reset the drawing values before calling PrepareDrawing after changes. */ - virtual int ResetDarwing( ArrayPtrVoid params ) { return FUNCTOR_CONTINUE; }; + virtual int ResetDarwing( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; /** * Set the drawing position (m_drawingX and m_drawingY) values for objects */ - virtual int SetDrawingXY( ArrayPtrVoid params ) { return FUNCTOR_CONTINUE; }; + virtual int SetDrawingXY( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; /** * @name Functors for justification @@ -572,12 +581,12 @@ class Object /** * Justify the X positions */ - virtual int JustifyX( ArrayPtrVoid params ) { return FUNCTOR_CONTINUE; }; + virtual int JustifyX( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; /** * Justify the Y positions */ - virtual int JustifyY( ArrayPtrVoid params ) { return FUNCTOR_CONTINUE; }; + virtual int JustifyY( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; ///@} @@ -590,18 +599,18 @@ class Object * Fill a page by adding systems with the appropriate length. * */ - virtual int CastOffSystems( ArrayPtrVoid params ) { return FUNCTOR_CONTINUE; }; + virtual int CastOffSystems( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; /** * */ - virtual int CastOffPages( ArrayPtrVoid params ) { return FUNCTOR_CONTINUE; }; + virtual int CastOffPages( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; /** * Undo the cast of of both pages and system. * This is used by Doc::ContinuousLayout for putting all pages / system continously. */ - virtual int UnCastOff( ArrayPtrVoid params ) { return FUNCTOR_CONTINUE; }; + virtual int UnCastOff( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; ///@} @@ -650,9 +659,13 @@ class Object */ ArrayOfObjects::iterator m_iteratorEnd, m_iteratorCurrent; const std::type_info *m_iteratorElementType; + + /** + * + */ + std::vector m_attClasses; }; - //---------------------------------------------------------------------------- // DocObject //---------------------------------------------------------------------------- @@ -667,6 +680,7 @@ class DocObject: public Object DocObject(); DocObject(std::string classid); virtual ~DocObject(); + virtual int Is() { return DOC_OBJECT; } /** * Refreshes the views from Doc. @@ -795,18 +809,18 @@ class ObjectListInterface class Functor { private: - int (Object::*obj_fpt)( ArrayPtrVoid params ); // pointer to member function + int (Object::*obj_fpt)( ArrayPtrVoid *params ); // pointer to member function public: // constructor - takes pointer to an object and pointer to a member and stores // them in two private variables Functor( ); - Functor( int(Object::*_obj_fpt)( ArrayPtrVoid )); + Functor( int(Object::*_obj_fpt)( ArrayPtrVoid* )); virtual ~Functor() {}; // override function "Call" - virtual void Call( Object *ptr, ArrayPtrVoid params ); + virtual void Call( Object *ptr, ArrayPtrVoid *params ); private: diff --git a/include/vrv/page.h b/include/vrv/page.h index b3d6f73e0fc..ecf042d77dc 100644 --- a/include/vrv/page.h +++ b/include/vrv/page.h @@ -40,6 +40,7 @@ class Page: public DocObject virtual ~Page(); virtual void Reset(); virtual std::string GetClassName( ) { return "Page"; }; + virtual int Is() { return PAGE; }; ///@} void AddSystem( System *system ); diff --git a/include/vrv/pitchinterface.h b/include/vrv/pitchinterface.h index e3bf7d64c0d..703be22b681 100644 --- a/include/vrv/pitchinterface.h +++ b/include/vrv/pitchinterface.h @@ -21,7 +21,7 @@ namespace vrv { * This class is an interface for elements with pitch, such as notes and neumes. * It is not an abstract class but should not be instanciate directly. */ -class PitchInterface: +class PitchInterface: public AttInterface, public AttAccidental, public AttOctave, public AttPitch diff --git a/include/vrv/positioninterface.h b/include/vrv/positioninterface.h index 7facba31a27..5383eb1acbc 100644 --- a/include/vrv/positioninterface.h +++ b/include/vrv/positioninterface.h @@ -22,7 +22,8 @@ namespace vrv { * It is not an abstract class but should not be instanciate directly. * For now, the position is handled in a similar way that for PitchInterface, that is with a pitch and octave. */ -class PositionInterface: public AttStafflocPitched +class PositionInterface: public AttInterface, + public AttStafflocPitched { public: /** diff --git a/include/vrv/rest.h b/include/vrv/rest.h index 8278a0b6de3..217fac23936 100644 --- a/include/vrv/rest.h +++ b/include/vrv/rest.h @@ -34,6 +34,7 @@ class Rest: public LayerElement, public DurationInterface, public PositionInterf virtual ~Rest(); virtual void Reset(); virtual std::string GetClassName( ) { return "Rest"; }; + virtual int Is() { return REST; }; ///@} private: diff --git a/include/vrv/scoredef.h b/include/vrv/scoredef.h index 18bb6dea700..00ca1d5fe65 100644 --- a/include/vrv/scoredef.h +++ b/include/vrv/scoredef.h @@ -155,6 +155,7 @@ class ScoreDef: public Object, public ScoreOrStaffDefAttrInterface, public Objec virtual ~ScoreDef(); virtual void Reset(); virtual std::string GetClassName( ) { return "ScoreDef"; }; + virtual int Is() { return SCORE_DEF; }; ///@} void AddStaffGrp( StaffGrp *staffGrp ); @@ -199,7 +200,7 @@ class ScoreDef: public Object, public ScoreOrStaffDefAttrInterface, public Objec * For ScoreDef, this means only moving them since their width is not taken into * account */ - virtual int CastOffSystems( ArrayPtrVoid params ); + virtual int CastOffSystems( ArrayPtrVoid *params ); protected: /** @@ -240,6 +241,7 @@ class StaffGrp: public Object, public ObjectListInterface virtual Object* Clone() { return new StaffGrp(*this); }; virtual void Reset(); virtual std::string GetClassName( ) { return "StaffGrp"; }; + virtual int Is() { return STAFF_GRP; }; ///@} void AddStaffDef( StaffDef *staffDef ); @@ -307,6 +309,7 @@ class StaffDef: public Object, public ScoreOrStaffDefAttrInterface, virtual Object* Clone() { return new StaffDef(*this); }; virtual void Reset(); virtual std::string GetClassName( ) { return "StaffDef"; }; + virtual int Is() { return STAFF_DEF; }; ///@} /** @@ -335,7 +338,7 @@ class StaffDef: public Object, public ScoreOrStaffDefAttrInterface, * Calls ScoreDef::Replace. * param 0: a pointer to the scoreDef we are going to replace the staffDefs */ - virtual int ReplaceStaffDefsInScoreDef( ArrayPtrVoid params ); + virtual int ReplaceStaffDefsInScoreDef( ArrayPtrVoid *params ); /** * Set flags for the staff set for indicating whether clefs, keysig, etc. needs to be redrawn. @@ -344,7 +347,7 @@ class StaffDef: public Object, public ScoreOrStaffDefAttrInterface, * param 1: bool keysig flag. * param 2: bool the mensur flag. */ - virtual int SetStaffDefRedrawFlags( ArrayPtrVoid params ); + virtual int SetStaffDefRedrawFlags( ArrayPtrVoid *params ); private: diff --git a/include/vrv/slur.h b/include/vrv/slur.h index 75105a98709..472b9d523ba 100644 --- a/include/vrv/slur.h +++ b/include/vrv/slur.h @@ -30,6 +30,7 @@ class Slur: public MeasureElement, public TimeSpanningInterface virtual ~Slur(); virtual void Reset(); virtual std::string GetClassName( ) { return "Slur"; }; + virtual int Is() { return SLUR; }; ///@} //----------// @@ -39,17 +40,17 @@ class Slur: public MeasureElement, public TimeSpanningInterface /** * See Object::FillStaffCurrentTimeSpanning */ - virtual int FillStaffCurrentTimeSpanning( ArrayPtrVoid params ); + virtual int FillStaffCurrentTimeSpanning( ArrayPtrVoid *params ); /** * See Object::PrepareTimeSpanning */ - virtual int PrepareTimeSpanning( ArrayPtrVoid params ); + virtual int PrepareTimeSpanning( ArrayPtrVoid *params ); /** * Reset the drawing values before calling PrepareDrawing after changes. */ - virtual int ResetDarwing( ArrayPtrVoid params ); + virtual int ResetDarwing( ArrayPtrVoid *params ); private: diff --git a/include/vrv/space.h b/include/vrv/space.h index 832be52b634..517f6db6267 100644 --- a/include/vrv/space.h +++ b/include/vrv/space.h @@ -33,6 +33,7 @@ class Space: public LayerElement, public DurationInterface virtual ~Space(); virtual void Reset(); virtual std::string GetClassName( ){ return "Space"; }; ; + virtual int Is() { return SPACE; }; ///@} private: diff --git a/include/vrv/staff.h b/include/vrv/staff.h index e4db5b3eb27..329f39c217b 100644 --- a/include/vrv/staff.h +++ b/include/vrv/staff.h @@ -43,7 +43,8 @@ class Staff: public MeasureElement, Staff( int n = -1 ); virtual ~Staff(); virtual void Reset(); - virtual std::string GetClassName( ) { return "Staff"; }; + virtual std::string GetClassName( ) { return "Staff"; }; + virtual int Is() { return STAFF; }; ///@} void AddLayer( Layer *layer ); @@ -77,33 +78,33 @@ class Staff: public MeasureElement, /** * Currently unused - kept for "documentation" */ - virtual bool GetPosOnPage( ArrayPtrVoid params ); + virtual bool GetPosOnPage( ArrayPtrVoid *params ); /** * Align the content of a staff vertically. */ - virtual int AlignVertically( ArrayPtrVoid params ); + virtual int AlignVertically( ArrayPtrVoid *params ); /** */ - virtual int FillStaffCurrentTimeSpanning( ArrayPtrVoid params ); + virtual int FillStaffCurrentTimeSpanning( ArrayPtrVoid *params ); /** * Functor for setting running lyrics in staves * This is necessary for that starts in one measure and ends in another one * The functor is process by staff/layer/verse using an ArrayOfAttComparisons filter. */ - virtual int FillStaffCurrentLyrics( ArrayPtrVoid params ); + virtual int FillStaffCurrentLyrics( ArrayPtrVoid *params ); /** * Reset the drawing values before calling PrepareDrawing after changes. */ - virtual int ResetDarwing( ArrayPtrVoid params ); + virtual int ResetDarwing( ArrayPtrVoid *params ); /** * Set the drawing position (m_drawingX and m_drawingY) values for objects */ - virtual int SetDrawingXY( ArrayPtrVoid params ); + virtual int SetDrawingXY( ArrayPtrVoid *params ); public: /** diff --git a/include/vrv/syl.h b/include/vrv/syl.h index 4342804cc49..ea464e5bca6 100644 --- a/include/vrv/syl.h +++ b/include/vrv/syl.h @@ -41,6 +41,7 @@ class Syl: public LayerElement, public TimeSpanningInterface, virtual ~Syl(); virtual void Reset(); virtual std::string GetClassName( ) { return "Syl"; }; + virtual int Is() { return SYL; }; ///@} //----------// @@ -52,17 +53,17 @@ class Syl: public LayerElement, public TimeSpanningInterface, * The functor is process by staff/layer/verse using an ArrayOfAttComparisons filter * See PrepareDarwing */ - virtual int PrepareLyrics( ArrayPtrVoid params ); + virtual int PrepareLyrics( ArrayPtrVoid *params ); /** * See Object::FillStaffCurrentTimeSpanning */ - virtual int FillStaffCurrentTimeSpanning( ArrayPtrVoid params ); + virtual int FillStaffCurrentTimeSpanning( ArrayPtrVoid *params ); /** * Reset the drawing values before calling PrepareDrawing after changes. */ - virtual int ResetDarwing( ArrayPtrVoid params ); + virtual int ResetDarwing( ArrayPtrVoid *params ); private: diff --git a/include/vrv/system.h b/include/vrv/system.h index 93b9b2d2b46..1c0f71fde20 100644 --- a/include/vrv/system.h +++ b/include/vrv/system.h @@ -40,6 +40,7 @@ class System: public DocObject, public DrawingListInterface virtual ~System(); virtual void Reset(); virtual std::string GetClassName( ) { return "System"; }; + virtual int Is() { return SYSTEM; }; ///@} void AddMeasure( Measure *measure ); @@ -87,63 +88,63 @@ class System: public DocObject, public DrawingListInterface /** * Align the content of a system vertically. */ - virtual int AlignVertically( ArrayPtrVoid params ); + virtual int AlignVertically( ArrayPtrVoid *params ); /** * Set the position of the StaffAlignment. * Redirect the functor to the SytemAligner */ - virtual int SetAligmentYPos( ArrayPtrVoid params ); + virtual int SetAligmentYPos( ArrayPtrVoid *params ); /** * Correct the Y alignment once the the content of a system has been aligned and laid out. * Special case that redirects the functor to the SystemAligner. */ - virtual int IntegrateBoundingBoxYShift( ArrayPtrVoid params ); + virtual int IntegrateBoundingBoxYShift( ArrayPtrVoid *params ); /** * Align the system by adjusting the m_drawingYRel position looking at the SystemAligner. */ - virtual int AlignSystems( ArrayPtrVoid params ); + virtual int AlignSystems( ArrayPtrVoid *params ); /** * Align the measures by adjusting the m_drawingXRel position looking at the MeasureAligner. * In System object resets the shift to 0; */ - virtual int AlignMeasures( ArrayPtrVoid params ); + virtual int AlignMeasures( ArrayPtrVoid *params ); /** * Store the width of the system in the MeasureAligner for justification */ - virtual int AlignMeasuresEnd( ArrayPtrVoid params ); + virtual int AlignMeasuresEnd( ArrayPtrVoid *params ); /** * Justify the X positions * Special case that redirects the functor to the MeasureAligner. */ - virtual int JustifyX( ArrayPtrVoid params ); + virtual int JustifyX( ArrayPtrVoid *params ); /** * Lay out the Y positions of the staff looking that the bounding boxes of each staff * This is the Functor called at the end of the system or a measure. */ - virtual int SetBoundingBoxYShiftEnd( ArrayPtrVoid params ); + virtual int SetBoundingBoxYShiftEnd( ArrayPtrVoid *params ); /** * */ - virtual int CastOffPages( ArrayPtrVoid params ); + virtual int CastOffPages( ArrayPtrVoid *params ); /** * Undo the cast of the system. * This is used by Doc::ContinuousLayout */ - virtual int UnCastOff( ArrayPtrVoid params ); + virtual int UnCastOff( ArrayPtrVoid *params ); /** * Set the drawing position (m_drawingX and m_drawingY) values for objects */ - virtual int SetDrawingXY( ArrayPtrVoid params ); + virtual int SetDrawingXY( ArrayPtrVoid *params ); private: diff --git a/include/vrv/tie.h b/include/vrv/tie.h index 57d5407aa69..34262947856 100644 --- a/include/vrv/tie.h +++ b/include/vrv/tie.h @@ -32,6 +32,7 @@ class Tie: public MeasureElement, public TimeSpanningInterface virtual ~Tie(); virtual void Reset(); virtual std::string GetClassName( ) { return "Tie"; }; + virtual int Is() { return TIE; }; ///@} ///@} @@ -42,17 +43,17 @@ class Tie: public MeasureElement, public TimeSpanningInterface /** * See Object::FillStaffCurrentTimeSpanning */ - virtual int FillStaffCurrentTimeSpanning( ArrayPtrVoid params ); + virtual int FillStaffCurrentTimeSpanning( ArrayPtrVoid *params ); /** * See Object::PrepareTimeSpanning */ - virtual int PrepareTimeSpanning( ArrayPtrVoid params ); + virtual int PrepareTimeSpanning( ArrayPtrVoid *params ); /** * Reset the drawing values before calling PrepareDrawing after changes. */ - virtual int ResetDarwing( ArrayPtrVoid params ); + virtual int ResetDarwing( ArrayPtrVoid *params ); private: diff --git a/include/vrv/timeinterface.h b/include/vrv/timeinterface.h index 3b57b5bb40e..c1236b69032 100644 --- a/include/vrv/timeinterface.h +++ b/include/vrv/timeinterface.h @@ -25,7 +25,7 @@ class LayerElement; * This class is an interface for elements with duration, such as notes and rests. * It is not an abstract class but should not be instanciate directly. */ -class TimeSpanningInterface: +class TimeSpanningInterface: public AttInterface, public AttStartendid, public AttStartid, public AttTimestampMusical, @@ -85,17 +85,17 @@ class TimeSpanningInterface: /** * See Object::FillStaffCurrentTimeSpanning */ - virtual int FillStaffCurrentTimeSpanning( ArrayPtrVoid params, DocObject *object ); + virtual int FillStaffCurrentTimeSpanning( ArrayPtrVoid *params, DocObject *object ); /** * See Object::PrepareTimeSpanning */ - virtual int PrepareTimeSpanning( ArrayPtrVoid params, DocObject *object ); + virtual int PrepareTimeSpanning( ArrayPtrVoid *params, DocObject *object ); /** * See Object::ResetDrawing */ - virtual int ResetDrawing( ArrayPtrVoid params, DocObject *object ); + virtual int ResetDrawing( ArrayPtrVoid *params, DocObject *object ); private: /** diff --git a/include/vrv/tuplet.h b/include/vrv/tuplet.h index a5e52beb327..0af4847256f 100644 --- a/include/vrv/tuplet.h +++ b/include/vrv/tuplet.h @@ -33,6 +33,7 @@ class Tuplet: public LayerElement, public ObjectListInterface, virtual ~Tuplet(); virtual void Reset(); virtual std::string GetClassName( ) { return "Tuplet"; }; + virtual int Is() { return TUPLET; }; ///@} int GetNoteCount() const { return (int)m_children.size(); }; diff --git a/include/vrv/verse.h b/include/vrv/verse.h index 2c792dab41d..1cbca87443b 100644 --- a/include/vrv/verse.h +++ b/include/vrv/verse.h @@ -33,6 +33,7 @@ class Verse: public LayerElement, virtual ~Verse(); virtual void Reset(); virtual std::string GetClassName( ) { return "Verse"; }; + virtual int Is() { return VERSE; }; ///@} /** @@ -49,13 +50,13 @@ class Verse: public LayerElement, * Align the content of a staff vertically. * See Object::AlignVertically */ - virtual int AlignVertically( ArrayPtrVoid params ); + virtual int AlignVertically( ArrayPtrVoid *params ); /** * Builds a tree of int (IntTree) with the staff/layer/verse numbers * and for staff/layer to be then processed. */ - virtual int PrepareProcessingLists( ArrayPtrVoid params ); + virtual int PrepareProcessingLists( ArrayPtrVoid *params ); protected: diff --git a/include/vrv/vrvdef.h b/include/vrv/vrvdef.h index f84f3577163..a9507e47211 100644 --- a/include/vrv/vrvdef.h +++ b/include/vrv/vrvdef.h @@ -40,6 +40,63 @@ typedef std::vector ArrayOfBeamElementCoords; typedef std::map > MapOfLedgerLineFlags; +//---------------------------------------------------------------------------- +// Object defines +//---------------------------------------------------------------------------- + +enum { + OBJECT = 0, + ACCID, + ALIGNMENT, + APP, + ANNOT, + BAR_LINE, + BAR_LINE_ATTR, + BEAM, + CHORD, + CLEF, + CLEF_ATTR, + CUSTOS, + DOC, + DOC_OBJECT, + DOT, + EDITORIAL_ELEMENT, + GRACE_ALIGNER, + KEY_SIG, + KEY_SIG_ATTR, + LAYER, + LAYER_ELEMENT, + LEM, + MEASURE, + MEASURE_ELEMENT, + MEASURE_ALIGNER, + MENSUR, + MENSUR_ATTR, + METER_SIG, + METER_SIG_ATTR, + MREST, + MULTI_REST, + NOTE, + PAGE, + RDG, + REST, + SCORE_DEF, + SLUR, + SPACE, + STAFF, + STAFF_ALIGNMENT, + STAFF_DEF, + STAFF_GRP, + SUPPLIED, + SYL, + SYSTEM, + SYSTEM_ALIGNER, + SYSTEM_ALIGNMENT, + TIE, + TUPLET, + VERSE +}; + //---------------------------------------------------------------------------- // Global defines //---------------------------------------------------------------------------- diff --git a/libmei/atts_analysis.cpp b/libmei/atts_analysis.cpp index 2765491c1fd..1c7d2efa306 100644 --- a/libmei/atts_analysis.cpp +++ b/libmei/atts_analysis.cpp @@ -399,8 +399,8 @@ bool AttSolfa::HasPsolfa( ) /* include */ bool Att::SetAnalysis( Object *element, std::string attrType, std::string attrValue ) { - if (dynamic_cast(element) ) { - AttCommonAnl *att = dynamic_cast(element); + if (element->HasAttClass( ATT_COMMONANL ) ) { + AttCommonAnl *att = reinterpret_cast(element); if (attrType == "copyof") { att->SetCopyof(att->StrToStr(attrValue)); return true; @@ -426,43 +426,43 @@ bool Att::SetAnalysis( Object *element, std::string attrType, std::string attrVa return true; } } - if (dynamic_cast(element) ) { - AttHarmonicfunction *att = dynamic_cast(element); + if (element->HasAttClass( ATT_HARMONICFUNCTION ) ) { + AttHarmonicfunction *att = reinterpret_cast(element); if (attrType == "deg") { att->SetDeg(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttIntervalharmonic *att = dynamic_cast(element); + if (element->HasAttClass( ATT_INTERVALHARMONIC ) ) { + AttIntervalharmonic *att = reinterpret_cast(element); if (attrType == "inth") { att->SetInth(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttIntervallicdesc *att = dynamic_cast(element); + if (element->HasAttClass( ATT_INTERVALLICDESC ) ) { + AttIntervallicdesc *att = reinterpret_cast(element); if (attrType == "intm") { att->SetIntm(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttMelodicfunction *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MELODICFUNCTION ) ) { + AttMelodicfunction *att = reinterpret_cast(element); if (attrType == "mfunc") { att->SetMfunc(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttPitchclass *att = dynamic_cast(element); + if (element->HasAttClass( ATT_PITCHCLASS ) ) { + AttPitchclass *att = reinterpret_cast(element); if (attrType == "pclass") { att->SetPclass(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttSolfa *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SOLFA ) ) { + AttSolfa *att = reinterpret_cast(element); if (attrType == "psolfa") { att->SetPsolfa(att->StrToStr(attrValue)); return true; @@ -473,8 +473,8 @@ bool Att::SetAnalysis( Object *element, std::string attrType, std::string attrVa } void Att::GetAnalysis( Object *element, ArrayOfStrAttr *attributes ) { - if (dynamic_cast(element) ) { - AttCommonAnl *att = dynamic_cast(element); + if (element->HasAttClass( ATT_COMMONANL ) ) { + AttCommonAnl *att = reinterpret_cast(element); if (att->HasCopyof()) { attributes->push_back(std::make_pair("copyof", att->StrToStr(att->GetCopyof()))); } @@ -494,38 +494,38 @@ void Att::GetAnalysis( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("synch", att->StrToStr(att->GetSynch()))); } } - if (dynamic_cast(element) ) { - AttHarmonicfunction *att = dynamic_cast(element); + if (element->HasAttClass( ATT_HARMONICFUNCTION ) ) { + AttHarmonicfunction *att = reinterpret_cast(element); if (att->HasDeg()) { attributes->push_back(std::make_pair("deg", att->StrToStr(att->GetDeg()))); } } - if (dynamic_cast(element) ) { - AttIntervalharmonic *att = dynamic_cast(element); + if (element->HasAttClass( ATT_INTERVALHARMONIC ) ) { + AttIntervalharmonic *att = reinterpret_cast(element); if (att->HasInth()) { attributes->push_back(std::make_pair("inth", att->StrToStr(att->GetInth()))); } } - if (dynamic_cast(element) ) { - AttIntervallicdesc *att = dynamic_cast(element); + if (element->HasAttClass( ATT_INTERVALLICDESC ) ) { + AttIntervallicdesc *att = reinterpret_cast(element); if (att->HasIntm()) { attributes->push_back(std::make_pair("intm", att->StrToStr(att->GetIntm()))); } } - if (dynamic_cast(element) ) { - AttMelodicfunction *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MELODICFUNCTION ) ) { + AttMelodicfunction *att = reinterpret_cast(element); if (att->HasMfunc()) { attributes->push_back(std::make_pair("mfunc", att->StrToStr(att->GetMfunc()))); } } - if (dynamic_cast(element) ) { - AttPitchclass *att = dynamic_cast(element); + if (element->HasAttClass( ATT_PITCHCLASS ) ) { + AttPitchclass *att = reinterpret_cast(element); if (att->HasPclass()) { attributes->push_back(std::make_pair("pclass", att->StrToStr(att->GetPclass()))); } } - if (dynamic_cast(element) ) { - AttSolfa *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SOLFA ) ) { + AttSolfa *att = reinterpret_cast(element); if (att->HasPsolfa()) { attributes->push_back(std::make_pair("psolfa", att->StrToStr(att->GetPsolfa()))); } diff --git a/libmei/atts_analysis.h b/libmei/atts_analysis.h index 33afabe0b39..0bbddbf34af 100644 --- a/libmei/atts_analysis.h +++ b/libmei/atts_analysis.h @@ -28,6 +28,8 @@ namespace vrv { // AttCommonAnl //---------------------------------------------------------------------------- +#define ATT_COMMONANL 1 + class AttCommonAnl: public Att { public: @@ -107,6 +109,8 @@ class AttCommonAnl: public Att // AttHarmonicfunction //---------------------------------------------------------------------------- +#define ATT_HARMONICFUNCTION 2 + class AttHarmonicfunction: public Att { public: @@ -151,6 +155,8 @@ class AttHarmonicfunction: public Att // AttIntervalharmonic //---------------------------------------------------------------------------- +#define ATT_INTERVALHARMONIC 3 + class AttIntervalharmonic: public Att { public: @@ -192,6 +198,8 @@ class AttIntervalharmonic: public Att // AttIntervallicdesc //---------------------------------------------------------------------------- +#define ATT_INTERVALLICDESC 4 + class AttIntervallicdesc: public Att { public: @@ -235,6 +243,8 @@ class AttIntervallicdesc: public Att // AttMelodicfunction //---------------------------------------------------------------------------- +#define ATT_MELODICFUNCTION 5 + class AttMelodicfunction: public Att { public: @@ -273,6 +283,8 @@ class AttMelodicfunction: public Att // AttPitchclass //---------------------------------------------------------------------------- +#define ATT_PITCHCLASS 6 + class AttPitchclass: public Att { public: @@ -311,6 +323,8 @@ class AttPitchclass: public Att // AttSolfa //---------------------------------------------------------------------------- +#define ATT_SOLFA 7 + class AttSolfa: public Att { public: diff --git a/libmei/atts_cmn.cpp b/libmei/atts_cmn.cpp index 60c57d7ae31..9559f511ad5 100644 --- a/libmei/atts_cmn.cpp +++ b/libmei/atts_cmn.cpp @@ -1753,43 +1753,43 @@ bool AttTupletVis::HasNumFormat( ) /* include */ bool Att::SetCmn( Object *element, std::string attrType, std::string attrValue ) { - if (dynamic_cast(element) ) { - AttArpegLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_ARPEGLOG ) ) { + AttArpegLog *att = reinterpret_cast(element); if (attrType == "order") { att->SetOrder(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttArpegVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_ARPEGVIS ) ) { + AttArpegVis *att = reinterpret_cast(element); if (attrType == "arrow") { att->SetArrow(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttBTremLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_BTREMLOG ) ) { + AttBTremLog *att = reinterpret_cast(element); if (attrType == "form") { att->SetForm(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttBeamed *att = dynamic_cast(element); + if (element->HasAttClass( ATT_BEAMED ) ) { + AttBeamed *att = reinterpret_cast(element); if (attrType == "beam") { att->SetBeam(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttBeamedwith *att = dynamic_cast(element); + if (element->HasAttClass( ATT_BEAMEDWITH ) ) { + AttBeamedwith *att = reinterpret_cast(element); if (attrType == "beamWith") { att->SetBeamWith(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttBeamingLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_BEAMINGLOG ) ) { + AttBeamingLog *att = reinterpret_cast(element); if (attrType == "beamGroup") { att->SetBeamGroup(att->StrToStr(attrValue)); return true; @@ -1799,8 +1799,8 @@ bool Att::SetCmn( Object *element, std::string attrType, std::string attrValue ) return true; } } - if (dynamic_cast(element) ) { - AttBeamrend *att = dynamic_cast(element); + if (element->HasAttClass( ATT_BEAMREND ) ) { + AttBeamrend *att = reinterpret_cast(element); if (attrType == "rend") { att->SetRend(att->StrToStr(attrValue)); return true; @@ -1810,50 +1810,50 @@ bool Att::SetCmn( Object *element, std::string attrType, std::string attrValue ) return true; } } - if (dynamic_cast(element) ) { - AttBeamsecondary *att = dynamic_cast(element); + if (element->HasAttClass( ATT_BEAMSECONDARY ) ) { + AttBeamsecondary *att = reinterpret_cast(element); if (attrType == "breaksecInt") { att->SetBreaksec(att->StrToInt(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttBeatRptVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_BEATRPTVIS ) ) { + AttBeatRptVis *att = reinterpret_cast(element); if (attrType == "rend") { att->SetRend(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttBendGes *att = dynamic_cast(element); + if (element->HasAttClass( ATT_BENDGES ) ) { + AttBendGes *att = reinterpret_cast(element); if (attrType == "amount") { att->SetAmount(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttCutout *att = dynamic_cast(element); + if (element->HasAttClass( ATT_CUTOUT ) ) { + AttCutout *att = reinterpret_cast(element); if (attrType == "cutout") { att->SetCutout(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttExpandable *att = dynamic_cast(element); + if (element->HasAttClass( ATT_EXPANDABLE ) ) { + AttExpandable *att = reinterpret_cast(element); if (attrType == "expand") { att->SetExpand(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttFTremLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_FTREMLOG ) ) { + AttFTremLog *att = reinterpret_cast(element); if (attrType == "form") { att->SetForm(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttFermataVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_FERMATAVIS ) ) { + AttFermataVis *att = reinterpret_cast(element); if (attrType == "form") { att->SetForm(att->StrToStr(attrValue)); return true; @@ -1863,15 +1863,15 @@ bool Att::SetCmn( Object *element, std::string attrType, std::string attrValue ) return true; } } - if (dynamic_cast(element) ) { - AttGlissVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_GLISSVIS ) ) { + AttGlissVis *att = reinterpret_cast(element); if (attrType == "text") { att->SetText(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttGraced *att = dynamic_cast(element); + if (element->HasAttClass( ATT_GRACED ) ) { + AttGraced *att = reinterpret_cast(element); if (attrType == "grace") { att->SetGrace(att->StrToGrace(attrValue)); return true; @@ -1881,22 +1881,22 @@ bool Att::SetCmn( Object *element, std::string attrType, std::string attrValue ) return true; } } - if (dynamic_cast(element) ) { - AttHairpinLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_HAIRPINLOG ) ) { + AttHairpinLog *att = reinterpret_cast(element); if (attrType == "form") { att->SetForm(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttHairpinVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_HAIRPINVIS ) ) { + AttHairpinVis *att = reinterpret_cast(element); if (attrType == "opening") { att->SetOpening(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttHarpPedalLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_HARPPEDALLOG ) ) { + AttHarpPedalLog *att = reinterpret_cast(element); if (attrType == "c") { att->SetC(att->StrToStr(attrValue)); return true; @@ -1926,36 +1926,36 @@ bool Att::SetCmn( Object *element, std::string attrType, std::string attrValue ) return true; } } - if (dynamic_cast(element) ) { - AttLvpresent *att = dynamic_cast(element); + if (element->HasAttClass( ATT_LVPRESENT ) ) { + AttLvpresent *att = reinterpret_cast(element); if (attrType == "lv") { att->SetLv(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttMultiRestVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MULTIRESTVIS ) ) { + AttMultiRestVis *att = reinterpret_cast(element); if (attrType == "block") { att->SetBlock(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttNoteGesCmn *att = dynamic_cast(element); + if (element->HasAttClass( ATT_NOTEGESCMN ) ) { + AttNoteGesCmn *att = reinterpret_cast(element); if (attrType == "gliss") { att->SetGliss(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttNumbered *att = dynamic_cast(element); + if (element->HasAttClass( ATT_NUMBERED ) ) { + AttNumbered *att = reinterpret_cast(element); if (attrType == "numInt") { att->SetNum(att->StrToInt(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttNumberplacement *att = dynamic_cast(element); + if (element->HasAttClass( ATT_NUMBERPLACEMENT ) ) { + AttNumberplacement *att = reinterpret_cast(element); if (attrType == "numPlace") { att->SetNumPlace(att->StrToStr(attrValue)); return true; @@ -1965,57 +1965,57 @@ bool Att::SetCmn( Object *element, std::string attrType, std::string attrValue ) return true; } } - if (dynamic_cast(element) ) { - AttOctaveLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_OCTAVELOG ) ) { + AttOctaveLog *att = reinterpret_cast(element); if (attrType == "coll") { att->SetColl(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttPedalLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_PEDALLOG ) ) { + AttPedalLog *att = reinterpret_cast(element); if (attrType == "dir") { att->SetDir(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttPedalVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_PEDALVIS ) ) { + AttPedalVis *att = reinterpret_cast(element); if (attrType == "style") { att->SetStyle(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttPianopedals *att = dynamic_cast(element); + if (element->HasAttClass( ATT_PIANOPEDALS ) ) { + AttPianopedals *att = reinterpret_cast(element); if (attrType == "pedalStyle") { att->SetPedalStyle(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttRehearsal *att = dynamic_cast(element); + if (element->HasAttClass( ATT_REHEARSAL ) ) { + AttRehearsal *att = reinterpret_cast(element); if (attrType == "rehEnclose") { att->SetRehEnclose(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttScoreDefVisCmn *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SCOREDEFVISCMN ) ) { + AttScoreDefVisCmn *att = reinterpret_cast(element); if (attrType == "gridShow") { att->SetGridShow(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttSlurrend *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SLURREND ) ) { + AttSlurrend *att = reinterpret_cast(element); if (attrType == "slurRend") { att->SetSlurRend(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttStemmedCmn *att = dynamic_cast(element); + if (element->HasAttClass( ATT_STEMMEDCMN ) ) { + AttStemmedCmn *att = reinterpret_cast(element); if (attrType == "stemMod") { att->SetStemMod(att->StrToStr(attrValue)); return true; @@ -2025,22 +2025,22 @@ bool Att::SetCmn( Object *element, std::string attrType, std::string attrValue ) return true; } } - if (dynamic_cast(element) ) { - AttTierend *att = dynamic_cast(element); + if (element->HasAttClass( ATT_TIEREND ) ) { + AttTierend *att = reinterpret_cast(element); if (attrType == "tieRend") { att->SetTieRend(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttTremmeasured *att = dynamic_cast(element); + if (element->HasAttClass( ATT_TREMMEASURED ) ) { + AttTremmeasured *att = reinterpret_cast(element); if (attrType == "measperf") { att->SetMeasperf(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttTupletVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_TUPLETVIS ) ) { + AttTupletVis *att = reinterpret_cast(element); if (attrType == "bracketPlace") { att->SetBracketPlace(att->StrToStr(attrValue)); return true; @@ -2063,38 +2063,38 @@ bool Att::SetCmn( Object *element, std::string attrType, std::string attrValue ) } void Att::GetCmn( Object *element, ArrayOfStrAttr *attributes ) { - if (dynamic_cast(element) ) { - AttArpegLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_ARPEGLOG ) ) { + AttArpegLog *att = reinterpret_cast(element); if (att->HasOrder()) { attributes->push_back(std::make_pair("order", att->StrToStr(att->GetOrder()))); } } - if (dynamic_cast(element) ) { - AttArpegVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_ARPEGVIS ) ) { + AttArpegVis *att = reinterpret_cast(element); if (att->HasArrow()) { attributes->push_back(std::make_pair("arrow", att->StrToStr(att->GetArrow()))); } } - if (dynamic_cast(element) ) { - AttBTremLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_BTREMLOG ) ) { + AttBTremLog *att = reinterpret_cast(element); if (att->HasForm()) { attributes->push_back(std::make_pair("form", att->StrToStr(att->GetForm()))); } } - if (dynamic_cast(element) ) { - AttBeamed *att = dynamic_cast(element); + if (element->HasAttClass( ATT_BEAMED ) ) { + AttBeamed *att = reinterpret_cast(element); if (att->HasBeam()) { attributes->push_back(std::make_pair("beam", att->StrToStr(att->GetBeam()))); } } - if (dynamic_cast(element) ) { - AttBeamedwith *att = dynamic_cast(element); + if (element->HasAttClass( ATT_BEAMEDWITH ) ) { + AttBeamedwith *att = reinterpret_cast(element); if (att->HasBeamWith()) { attributes->push_back(std::make_pair("beamWith", att->StrToStr(att->GetBeamWith()))); } } - if (dynamic_cast(element) ) { - AttBeamingLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_BEAMINGLOG ) ) { + AttBeamingLog *att = reinterpret_cast(element); if (att->HasBeamGroup()) { attributes->push_back(std::make_pair("beamGroup", att->StrToStr(att->GetBeamGroup()))); } @@ -2102,8 +2102,8 @@ void Att::GetCmn( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("beamRests", att->StrToStr(att->GetBeamRests()))); } } - if (dynamic_cast(element) ) { - AttBeamrend *att = dynamic_cast(element); + if (element->HasAttClass( ATT_BEAMREND ) ) { + AttBeamrend *att = reinterpret_cast(element); if (att->HasRend()) { attributes->push_back(std::make_pair("rend", att->StrToStr(att->GetRend()))); } @@ -2111,44 +2111,44 @@ void Att::GetCmn( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("slopeDbl", att->DblToStr(att->GetSlope()))); } } - if (dynamic_cast(element) ) { - AttBeamsecondary *att = dynamic_cast(element); + if (element->HasAttClass( ATT_BEAMSECONDARY ) ) { + AttBeamsecondary *att = reinterpret_cast(element); if (att->HasBreaksec()) { attributes->push_back(std::make_pair("breaksecInt", att->IntToStr(att->GetBreaksec()))); } } - if (dynamic_cast(element) ) { - AttBeatRptVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_BEATRPTVIS ) ) { + AttBeatRptVis *att = reinterpret_cast(element); if (att->HasRend()) { attributes->push_back(std::make_pair("rend", att->StrToStr(att->GetRend()))); } } - if (dynamic_cast(element) ) { - AttBendGes *att = dynamic_cast(element); + if (element->HasAttClass( ATT_BENDGES ) ) { + AttBendGes *att = reinterpret_cast(element); if (att->HasAmount()) { attributes->push_back(std::make_pair("amount", att->StrToStr(att->GetAmount()))); } } - if (dynamic_cast(element) ) { - AttCutout *att = dynamic_cast(element); + if (element->HasAttClass( ATT_CUTOUT ) ) { + AttCutout *att = reinterpret_cast(element); if (att->HasCutout()) { attributes->push_back(std::make_pair("cutout", att->StrToStr(att->GetCutout()))); } } - if (dynamic_cast(element) ) { - AttExpandable *att = dynamic_cast(element); + if (element->HasAttClass( ATT_EXPANDABLE ) ) { + AttExpandable *att = reinterpret_cast(element); if (att->HasExpand()) { attributes->push_back(std::make_pair("expand", att->StrToStr(att->GetExpand()))); } } - if (dynamic_cast(element) ) { - AttFTremLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_FTREMLOG ) ) { + AttFTremLog *att = reinterpret_cast(element); if (att->HasForm()) { attributes->push_back(std::make_pair("form", att->StrToStr(att->GetForm()))); } } - if (dynamic_cast(element) ) { - AttFermataVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_FERMATAVIS ) ) { + AttFermataVis *att = reinterpret_cast(element); if (att->HasForm()) { attributes->push_back(std::make_pair("form", att->StrToStr(att->GetForm()))); } @@ -2156,14 +2156,14 @@ void Att::GetCmn( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("shape", att->StrToStr(att->GetShape()))); } } - if (dynamic_cast(element) ) { - AttGlissVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_GLISSVIS ) ) { + AttGlissVis *att = reinterpret_cast(element); if (att->HasText()) { attributes->push_back(std::make_pair("text", att->StrToStr(att->GetText()))); } } - if (dynamic_cast(element) ) { - AttGraced *att = dynamic_cast(element); + if (element->HasAttClass( ATT_GRACED ) ) { + AttGraced *att = reinterpret_cast(element); if (att->HasGrace()) { attributes->push_back(std::make_pair("grace", att->GraceToStr(att->GetGrace()))); } @@ -2171,20 +2171,20 @@ void Att::GetCmn( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("graceTime", att->StrToStr(att->GetGraceTime()))); } } - if (dynamic_cast(element) ) { - AttHairpinLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_HAIRPINLOG ) ) { + AttHairpinLog *att = reinterpret_cast(element); if (att->HasForm()) { attributes->push_back(std::make_pair("form", att->StrToStr(att->GetForm()))); } } - if (dynamic_cast(element) ) { - AttHairpinVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_HAIRPINVIS ) ) { + AttHairpinVis *att = reinterpret_cast(element); if (att->HasOpening()) { attributes->push_back(std::make_pair("opening", att->StrToStr(att->GetOpening()))); } } - if (dynamic_cast(element) ) { - AttHarpPedalLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_HARPPEDALLOG ) ) { + AttHarpPedalLog *att = reinterpret_cast(element); if (att->HasC()) { attributes->push_back(std::make_pair("c", att->StrToStr(att->GetC()))); } @@ -2207,32 +2207,32 @@ void Att::GetCmn( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("b", att->StrToStr(att->GetB()))); } } - if (dynamic_cast(element) ) { - AttLvpresent *att = dynamic_cast(element); + if (element->HasAttClass( ATT_LVPRESENT ) ) { + AttLvpresent *att = reinterpret_cast(element); if (att->HasLv()) { attributes->push_back(std::make_pair("lv", att->StrToStr(att->GetLv()))); } } - if (dynamic_cast(element) ) { - AttMultiRestVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MULTIRESTVIS ) ) { + AttMultiRestVis *att = reinterpret_cast(element); if (att->HasBlock()) { attributes->push_back(std::make_pair("block", att->StrToStr(att->GetBlock()))); } } - if (dynamic_cast(element) ) { - AttNoteGesCmn *att = dynamic_cast(element); + if (element->HasAttClass( ATT_NOTEGESCMN ) ) { + AttNoteGesCmn *att = reinterpret_cast(element); if (att->HasGliss()) { attributes->push_back(std::make_pair("gliss", att->StrToStr(att->GetGliss()))); } } - if (dynamic_cast(element) ) { - AttNumbered *att = dynamic_cast(element); + if (element->HasAttClass( ATT_NUMBERED ) ) { + AttNumbered *att = reinterpret_cast(element); if (att->HasNum()) { attributes->push_back(std::make_pair("numInt", att->IntToStr(att->GetNum()))); } } - if (dynamic_cast(element) ) { - AttNumberplacement *att = dynamic_cast(element); + if (element->HasAttClass( ATT_NUMBERPLACEMENT ) ) { + AttNumberplacement *att = reinterpret_cast(element); if (att->HasNumPlace()) { attributes->push_back(std::make_pair("numPlace", att->StrToStr(att->GetNumPlace()))); } @@ -2240,50 +2240,50 @@ void Att::GetCmn( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("numVisible", att->StrToStr(att->GetNumVisible()))); } } - if (dynamic_cast(element) ) { - AttOctaveLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_OCTAVELOG ) ) { + AttOctaveLog *att = reinterpret_cast(element); if (att->HasColl()) { attributes->push_back(std::make_pair("coll", att->StrToStr(att->GetColl()))); } } - if (dynamic_cast(element) ) { - AttPedalLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_PEDALLOG ) ) { + AttPedalLog *att = reinterpret_cast(element); if (att->HasDir()) { attributes->push_back(std::make_pair("dir", att->StrToStr(att->GetDir()))); } } - if (dynamic_cast(element) ) { - AttPedalVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_PEDALVIS ) ) { + AttPedalVis *att = reinterpret_cast(element); if (att->HasStyle()) { attributes->push_back(std::make_pair("style", att->StrToStr(att->GetStyle()))); } } - if (dynamic_cast(element) ) { - AttPianopedals *att = dynamic_cast(element); + if (element->HasAttClass( ATT_PIANOPEDALS ) ) { + AttPianopedals *att = reinterpret_cast(element); if (att->HasPedalStyle()) { attributes->push_back(std::make_pair("pedalStyle", att->StrToStr(att->GetPedalStyle()))); } } - if (dynamic_cast(element) ) { - AttRehearsal *att = dynamic_cast(element); + if (element->HasAttClass( ATT_REHEARSAL ) ) { + AttRehearsal *att = reinterpret_cast(element); if (att->HasRehEnclose()) { attributes->push_back(std::make_pair("rehEnclose", att->StrToStr(att->GetRehEnclose()))); } } - if (dynamic_cast(element) ) { - AttScoreDefVisCmn *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SCOREDEFVISCMN ) ) { + AttScoreDefVisCmn *att = reinterpret_cast(element); if (att->HasGridShow()) { attributes->push_back(std::make_pair("gridShow", att->StrToStr(att->GetGridShow()))); } } - if (dynamic_cast(element) ) { - AttSlurrend *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SLURREND ) ) { + AttSlurrend *att = reinterpret_cast(element); if (att->HasSlurRend()) { attributes->push_back(std::make_pair("slurRend", att->StrToStr(att->GetSlurRend()))); } } - if (dynamic_cast(element) ) { - AttStemmedCmn *att = dynamic_cast(element); + if (element->HasAttClass( ATT_STEMMEDCMN ) ) { + AttStemmedCmn *att = reinterpret_cast(element); if (att->HasStemMod()) { attributes->push_back(std::make_pair("stemMod", att->StrToStr(att->GetStemMod()))); } @@ -2291,20 +2291,20 @@ void Att::GetCmn( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("stemWith", att->StrToStr(att->GetStemWith()))); } } - if (dynamic_cast(element) ) { - AttTierend *att = dynamic_cast(element); + if (element->HasAttClass( ATT_TIEREND ) ) { + AttTierend *att = reinterpret_cast(element); if (att->HasTieRend()) { attributes->push_back(std::make_pair("tieRend", att->StrToStr(att->GetTieRend()))); } } - if (dynamic_cast(element) ) { - AttTremmeasured *att = dynamic_cast(element); + if (element->HasAttClass( ATT_TREMMEASURED ) ) { + AttTremmeasured *att = reinterpret_cast(element); if (att->HasMeasperf()) { attributes->push_back(std::make_pair("measperf", att->StrToStr(att->GetMeasperf()))); } } - if (dynamic_cast(element) ) { - AttTupletVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_TUPLETVIS ) ) { + AttTupletVis *att = reinterpret_cast(element); if (att->HasBracketPlace()) { attributes->push_back(std::make_pair("bracketPlace", att->StrToStr(att->GetBracketPlace()))); } diff --git a/libmei/atts_cmn.h b/libmei/atts_cmn.h index 51ed6cc4e25..42ab2580d68 100644 --- a/libmei/atts_cmn.h +++ b/libmei/atts_cmn.h @@ -28,6 +28,8 @@ namespace vrv { // AttArpegLog //---------------------------------------------------------------------------- +#define ATT_ARPEGLOG 8 + class AttArpegLog: public Att { public: @@ -66,6 +68,8 @@ class AttArpegLog: public Att // AttArpegVis //---------------------------------------------------------------------------- +#define ATT_ARPEGVIS 9 + class AttArpegVis: public Att { public: @@ -104,6 +108,8 @@ class AttArpegVis: public Att // AttBTremLog //---------------------------------------------------------------------------- +#define ATT_BTREMLOG 10 + class AttBTremLog: public Att { public: @@ -142,6 +148,8 @@ class AttBTremLog: public Att // AttBeamed //---------------------------------------------------------------------------- +#define ATT_BEAMED 11 + class AttBeamed: public Att { public: @@ -180,6 +188,8 @@ class AttBeamed: public Att // AttBeamedwith //---------------------------------------------------------------------------- +#define ATT_BEAMEDWITH 12 + class AttBeamedwith: public Att { public: @@ -222,6 +232,8 @@ class AttBeamedwith: public Att // AttBeamingLog //---------------------------------------------------------------------------- +#define ATT_BEAMINGLOG 13 + class AttBeamingLog: public Att { public: @@ -273,6 +285,8 @@ class AttBeamingLog: public Att // AttBeamrend //---------------------------------------------------------------------------- +#define ATT_BEAMREND 14 + class AttBeamrend: public Att { public: @@ -318,6 +332,8 @@ class AttBeamrend: public Att // AttBeamsecondary //---------------------------------------------------------------------------- +#define ATT_BEAMSECONDARY 15 + class AttBeamsecondary: public Att { public: @@ -361,6 +377,8 @@ class AttBeamsecondary: public Att // AttBeatRptVis //---------------------------------------------------------------------------- +#define ATT_BEATRPTVIS 16 + class AttBeatRptVis: public Att { public: @@ -399,6 +417,8 @@ class AttBeatRptVis: public Att // AttBendGes //---------------------------------------------------------------------------- +#define ATT_BENDGES 17 + class AttBendGes: public Att { public: @@ -441,6 +461,8 @@ class AttBendGes: public Att // AttCutout //---------------------------------------------------------------------------- +#define ATT_CUTOUT 18 + class AttCutout: public Att { public: @@ -479,6 +501,8 @@ class AttCutout: public Att // AttExpandable //---------------------------------------------------------------------------- +#define ATT_EXPANDABLE 19 + class AttExpandable: public Att { public: @@ -522,6 +546,8 @@ class AttExpandable: public Att // AttFTremLog //---------------------------------------------------------------------------- +#define ATT_FTREMLOG 20 + class AttFTremLog: public Att { public: @@ -560,6 +586,8 @@ class AttFTremLog: public Att // AttFermataVis //---------------------------------------------------------------------------- +#define ATT_FERMATAVIS 21 + class AttFermataVis: public Att { public: @@ -605,6 +633,8 @@ class AttFermataVis: public Att // AttGlissVis //---------------------------------------------------------------------------- +#define ATT_GLISSVIS 22 + class AttGlissVis: public Att { public: @@ -643,6 +673,8 @@ class AttGlissVis: public Att // AttGraced //---------------------------------------------------------------------------- +#define ATT_GRACED 23 + class AttGraced: public Att { public: @@ -691,6 +723,8 @@ class AttGraced: public Att // AttHairpinLog //---------------------------------------------------------------------------- +#define ATT_HAIRPINLOG 24 + class AttHairpinLog: public Att { public: @@ -729,6 +763,8 @@ class AttHairpinLog: public Att // AttHairpinVis //---------------------------------------------------------------------------- +#define ATT_HAIRPINVIS 25 + class AttHairpinVis: public Att { public: @@ -770,6 +806,8 @@ class AttHairpinVis: public Att // AttHarpPedalLog //---------------------------------------------------------------------------- +#define ATT_HARPPEDALLOG 26 + class AttHarpPedalLog: public Att { public: @@ -850,6 +888,8 @@ class AttHarpPedalLog: public Att // AttLvpresent //---------------------------------------------------------------------------- +#define ATT_LVPRESENT 27 + class AttLvpresent: public Att { public: @@ -891,6 +931,8 @@ class AttLvpresent: public Att // AttMultiRestVis //---------------------------------------------------------------------------- +#define ATT_MULTIRESTVIS 28 + class AttMultiRestVis: public Att { public: @@ -933,6 +975,8 @@ class AttMultiRestVis: public Att // AttNoteGesCmn //---------------------------------------------------------------------------- +#define ATT_NOTEGESCMN 29 + class AttNoteGesCmn: public Att { public: @@ -971,6 +1015,8 @@ class AttNoteGesCmn: public Att // AttNumbered //---------------------------------------------------------------------------- +#define ATT_NUMBERED 30 + class AttNumbered: public Att { public: @@ -1012,6 +1058,8 @@ class AttNumbered: public Att // AttNumberplacement //---------------------------------------------------------------------------- +#define ATT_NUMBERPLACEMENT 31 + class AttNumberplacement: public Att { public: @@ -1057,6 +1105,8 @@ class AttNumberplacement: public Att // AttOctaveLog //---------------------------------------------------------------------------- +#define ATT_OCTAVELOG 32 + class AttOctaveLog: public Att { public: @@ -1101,6 +1151,8 @@ class AttOctaveLog: public Att // AttPedalLog //---------------------------------------------------------------------------- +#define ATT_PEDALLOG 33 + class AttPedalLog: public Att { public: @@ -1139,6 +1191,8 @@ class AttPedalLog: public Att // AttPedalVis //---------------------------------------------------------------------------- +#define ATT_PEDALVIS 34 + class AttPedalVis: public Att { public: @@ -1177,6 +1231,8 @@ class AttPedalVis: public Att // AttPianopedals //---------------------------------------------------------------------------- +#define ATT_PIANOPEDALS 35 + class AttPianopedals: public Att { public: @@ -1215,6 +1271,8 @@ class AttPianopedals: public Att // AttRehearsal //---------------------------------------------------------------------------- +#define ATT_REHEARSAL 36 + class AttRehearsal: public Att { public: @@ -1253,6 +1311,8 @@ class AttRehearsal: public Att // AttScoreDefVisCmn //---------------------------------------------------------------------------- +#define ATT_SCOREDEFVISCMN 37 + class AttScoreDefVisCmn: public Att { public: @@ -1291,6 +1351,8 @@ class AttScoreDefVisCmn: public Att // AttSlurrend //---------------------------------------------------------------------------- +#define ATT_SLURREND 38 + class AttSlurrend: public Att { public: @@ -1329,6 +1391,8 @@ class AttSlurrend: public Att // AttStemmedCmn //---------------------------------------------------------------------------- +#define ATT_STEMMEDCMN 39 + class AttStemmedCmn: public Att { public: @@ -1381,6 +1445,8 @@ class AttStemmedCmn: public Att // AttTierend //---------------------------------------------------------------------------- +#define ATT_TIEREND 40 + class AttTierend: public Att { public: @@ -1419,6 +1485,8 @@ class AttTierend: public Att // AttTremmeasured //---------------------------------------------------------------------------- +#define ATT_TREMMEASURED 41 + class AttTremmeasured: public Att { public: @@ -1457,6 +1525,8 @@ class AttTremmeasured: public Att // AttTupletVis //---------------------------------------------------------------------------- +#define ATT_TUPLETVIS 42 + class AttTupletVis: public Att { public: diff --git a/libmei/atts_cmnornaments.cpp b/libmei/atts_cmnornaments.cpp index 34cd482a6e4..d27c0e6fbed 100644 --- a/libmei/atts_cmnornaments.cpp +++ b/libmei/atts_cmnornaments.cpp @@ -240,8 +240,8 @@ bool AttTurnLog::HasForm( ) /* include */ bool Att::SetCmnornaments( Object *element, std::string attrType, std::string attrValue ) { - if (dynamic_cast(element) ) { - AttMordentLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MORDENTLOG ) ) { + AttMordentLog *att = reinterpret_cast(element); if (attrType == "form") { att->SetForm(att->StrToStr(attrValue)); return true; @@ -251,15 +251,15 @@ bool Att::SetCmnornaments( Object *element, std::string attrType, std::string at return true; } } - if (dynamic_cast(element) ) { - AttOrnam *att = dynamic_cast(element); + if (element->HasAttClass( ATT_ORNAM ) ) { + AttOrnam *att = reinterpret_cast(element); if (attrType == "ornam") { att->SetOrnam(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttOrnamentaccid *att = dynamic_cast(element); + if (element->HasAttClass( ATT_ORNAMENTACCID ) ) { + AttOrnamentaccid *att = reinterpret_cast(element); if (attrType == "accidupper") { att->SetAccidupper(att->StrToStr(attrValue)); return true; @@ -269,8 +269,8 @@ bool Att::SetCmnornaments( Object *element, std::string attrType, std::string at return true; } } - if (dynamic_cast(element) ) { - AttTurnLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_TURNLOG ) ) { + AttTurnLog *att = reinterpret_cast(element); if (attrType == "delayed") { att->SetDelayed(att->StrToStr(attrValue)); return true; @@ -285,8 +285,8 @@ bool Att::SetCmnornaments( Object *element, std::string attrType, std::string at } void Att::GetCmnornaments( Object *element, ArrayOfStrAttr *attributes ) { - if (dynamic_cast(element) ) { - AttMordentLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MORDENTLOG ) ) { + AttMordentLog *att = reinterpret_cast(element); if (att->HasForm()) { attributes->push_back(std::make_pair("form", att->StrToStr(att->GetForm()))); } @@ -294,14 +294,14 @@ void Att::GetCmnornaments( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("long", att->StrToStr(att->GetLong()))); } } - if (dynamic_cast(element) ) { - AttOrnam *att = dynamic_cast(element); + if (element->HasAttClass( ATT_ORNAM ) ) { + AttOrnam *att = reinterpret_cast(element); if (att->HasOrnam()) { attributes->push_back(std::make_pair("ornam", att->StrToStr(att->GetOrnam()))); } } - if (dynamic_cast(element) ) { - AttOrnamentaccid *att = dynamic_cast(element); + if (element->HasAttClass( ATT_ORNAMENTACCID ) ) { + AttOrnamentaccid *att = reinterpret_cast(element); if (att->HasAccidupper()) { attributes->push_back(std::make_pair("accidupper", att->StrToStr(att->GetAccidupper()))); } @@ -309,8 +309,8 @@ void Att::GetCmnornaments( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("accidlower", att->StrToStr(att->GetAccidlower()))); } } - if (dynamic_cast(element) ) { - AttTurnLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_TURNLOG ) ) { + AttTurnLog *att = reinterpret_cast(element); if (att->HasDelayed()) { attributes->push_back(std::make_pair("delayed", att->StrToStr(att->GetDelayed()))); } diff --git a/libmei/atts_cmnornaments.h b/libmei/atts_cmnornaments.h index f5091a5ac59..96ea60352ff 100644 --- a/libmei/atts_cmnornaments.h +++ b/libmei/atts_cmnornaments.h @@ -28,6 +28,8 @@ namespace vrv { // AttMordentLog //---------------------------------------------------------------------------- +#define ATT_MORDENTLOG 43 + class AttMordentLog: public Att { public: @@ -76,6 +78,8 @@ class AttMordentLog: public Att // AttOrnam //---------------------------------------------------------------------------- +#define ATT_ORNAM 44 + class AttOrnam: public Att { public: @@ -118,6 +122,8 @@ class AttOrnam: public Att // AttOrnamentaccid //---------------------------------------------------------------------------- +#define ATT_ORNAMENTACCID 45 + class AttOrnamentaccid: public Att { public: @@ -163,6 +169,8 @@ class AttOrnamentaccid: public Att // AttTurnLog //---------------------------------------------------------------------------- +#define ATT_TURNLOG 46 + class AttTurnLog: public Att { public: diff --git a/libmei/atts_critapp.cpp b/libmei/atts_critapp.cpp index 5bcacc8143c..b84e72d17b7 100644 --- a/libmei/atts_critapp.cpp +++ b/libmei/atts_critapp.cpp @@ -109,15 +109,15 @@ bool AttSource::HasSource( ) /* include */ bool Att::SetCritapp( Object *element, std::string attrType, std::string attrValue ) { - if (dynamic_cast(element) ) { - AttCrit *att = dynamic_cast(element); + if (element->HasAttClass( ATT_CRIT ) ) { + AttCrit *att = reinterpret_cast(element); if (attrType == "cause") { att->SetCause(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttSource *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SOURCE ) ) { + AttSource *att = reinterpret_cast(element); if (attrType == "source") { att->SetSource(att->StrToStr(attrValue)); return true; @@ -128,14 +128,14 @@ bool Att::SetCritapp( Object *element, std::string attrType, std::string attrVal } void Att::GetCritapp( Object *element, ArrayOfStrAttr *attributes ) { - if (dynamic_cast(element) ) { - AttCrit *att = dynamic_cast(element); + if (element->HasAttClass( ATT_CRIT ) ) { + AttCrit *att = reinterpret_cast(element); if (att->HasCause()) { attributes->push_back(std::make_pair("cause", att->StrToStr(att->GetCause()))); } } - if (dynamic_cast(element) ) { - AttSource *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SOURCE ) ) { + AttSource *att = reinterpret_cast(element); if (att->HasSource()) { attributes->push_back(std::make_pair("source", att->StrToStr(att->GetSource()))); } diff --git a/libmei/atts_critapp.h b/libmei/atts_critapp.h index 6a56654d495..a49e801f3f2 100644 --- a/libmei/atts_critapp.h +++ b/libmei/atts_critapp.h @@ -28,6 +28,8 @@ namespace vrv { // AttCrit //---------------------------------------------------------------------------- +#define ATT_CRIT 47 + class AttCrit: public Att { public: @@ -69,6 +71,8 @@ class AttCrit: public Att // AttSource //---------------------------------------------------------------------------- +#define ATT_SOURCE 48 + class AttSource: public Att { public: diff --git a/libmei/atts_edittrans.cpp b/libmei/atts_edittrans.cpp index 93b4540bb35..65a97d490c8 100644 --- a/libmei/atts_edittrans.cpp +++ b/libmei/atts_edittrans.cpp @@ -210,15 +210,15 @@ bool AttReasonident::HasReason( ) /* include */ bool Att::SetEdittrans( Object *element, std::string attrType, std::string attrValue ) { - if (dynamic_cast(element) ) { - AttAgentident *att = dynamic_cast(element); + if (element->HasAttClass( ATT_AGENTIDENT ) ) { + AttAgentident *att = reinterpret_cast(element); if (attrType == "agent") { att->SetAgent(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttEdit *att = dynamic_cast(element); + if (element->HasAttClass( ATT_EDIT ) ) { + AttEdit *att = reinterpret_cast(element); if (attrType == "cert") { att->SetCert(att->StrToStr(attrValue)); return true; @@ -228,15 +228,15 @@ bool Att::SetEdittrans( Object *element, std::string attrType, std::string attrV return true; } } - if (dynamic_cast(element) ) { - AttExtent *att = dynamic_cast(element); + if (element->HasAttClass( ATT_EXTENT ) ) { + AttExtent *att = reinterpret_cast(element); if (attrType == "extent") { att->SetExtent(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttReasonident *att = dynamic_cast(element); + if (element->HasAttClass( ATT_REASONIDENT ) ) { + AttReasonident *att = reinterpret_cast(element); if (attrType == "reason") { att->SetReason(att->StrToStr(attrValue)); return true; @@ -247,14 +247,14 @@ bool Att::SetEdittrans( Object *element, std::string attrType, std::string attrV } void Att::GetEdittrans( Object *element, ArrayOfStrAttr *attributes ) { - if (dynamic_cast(element) ) { - AttAgentident *att = dynamic_cast(element); + if (element->HasAttClass( ATT_AGENTIDENT ) ) { + AttAgentident *att = reinterpret_cast(element); if (att->HasAgent()) { attributes->push_back(std::make_pair("agent", att->StrToStr(att->GetAgent()))); } } - if (dynamic_cast(element) ) { - AttEdit *att = dynamic_cast(element); + if (element->HasAttClass( ATT_EDIT ) ) { + AttEdit *att = reinterpret_cast(element); if (att->HasCert()) { attributes->push_back(std::make_pair("cert", att->StrToStr(att->GetCert()))); } @@ -262,14 +262,14 @@ void Att::GetEdittrans( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("evidence", att->StrToStr(att->GetEvidence()))); } } - if (dynamic_cast(element) ) { - AttExtent *att = dynamic_cast(element); + if (element->HasAttClass( ATT_EXTENT ) ) { + AttExtent *att = reinterpret_cast(element); if (att->HasExtent()) { attributes->push_back(std::make_pair("extent", att->StrToStr(att->GetExtent()))); } } - if (dynamic_cast(element) ) { - AttReasonident *att = dynamic_cast(element); + if (element->HasAttClass( ATT_REASONIDENT ) ) { + AttReasonident *att = reinterpret_cast(element); if (att->HasReason()) { attributes->push_back(std::make_pair("reason", att->StrToStr(att->GetReason()))); } diff --git a/libmei/atts_edittrans.h b/libmei/atts_edittrans.h index 3c16fef48a9..9c6bf176ba6 100644 --- a/libmei/atts_edittrans.h +++ b/libmei/atts_edittrans.h @@ -28,6 +28,8 @@ namespace vrv { // AttAgentident //---------------------------------------------------------------------------- +#define ATT_AGENTIDENT 49 + class AttAgentident: public Att { public: @@ -69,6 +71,8 @@ class AttAgentident: public Att // AttEdit //---------------------------------------------------------------------------- +#define ATT_EDIT 50 + class AttEdit: public Att { public: @@ -118,6 +122,8 @@ class AttEdit: public Att // AttExtent //---------------------------------------------------------------------------- +#define ATT_EXTENT 51 + class AttExtent: public Att { public: @@ -156,6 +162,8 @@ class AttExtent: public Att // AttReasonident //---------------------------------------------------------------------------- +#define ATT_REASONIDENT 52 + class AttReasonident: public Att { public: diff --git a/libmei/atts_facsimile.cpp b/libmei/atts_facsimile.cpp index b8c6e259274..b4b53144957 100644 --- a/libmei/atts_facsimile.cpp +++ b/libmei/atts_facsimile.cpp @@ -68,8 +68,8 @@ void AttFacsimile::getCoords() { } bool Att::SetFacsimile( Object *element, std::string attrType, std::string attrValue ) { - if (dynamic_cast(element) ) { - AttFacsimile *att = dynamic_cast(element); + if (element->HasAttClass( ATT_FACSIMILE ) ) { + AttFacsimile *att = reinterpret_cast(element); if (attrType == "facs") { att->SetFacs(att->StrToStr(attrValue)); return true; @@ -80,8 +80,8 @@ bool Att::SetFacsimile( Object *element, std::string attrType, std::string attrV } void Att::GetFacsimile( Object *element, ArrayOfStrAttr *attributes ) { - if (dynamic_cast(element) ) { - AttFacsimile *att = dynamic_cast(element); + if (element->HasAttClass( ATT_FACSIMILE ) ) { + AttFacsimile *att = reinterpret_cast(element); if (att->HasFacs()) { attributes->push_back(std::make_pair("facs", att->StrToStr(att->GetFacs()))); } diff --git a/libmei/atts_facsimile.h b/libmei/atts_facsimile.h index 052beca36ba..173106aa3f4 100644 --- a/libmei/atts_facsimile.h +++ b/libmei/atts_facsimile.h @@ -28,6 +28,8 @@ namespace vrv { // AttFacsimile //---------------------------------------------------------------------------- +#define ATT_FACSIMILE 53 + class AttFacsimile: public Att { public: diff --git a/libmei/atts_figtable.cpp b/libmei/atts_figtable.cpp index 2ee9a5d798c..15357ebb863 100644 --- a/libmei/atts_figtable.cpp +++ b/libmei/atts_figtable.cpp @@ -81,8 +81,8 @@ bool AttTabular::HasRowspan( ) /* include */ bool Att::SetFigtable( Object *element, std::string attrType, std::string attrValue ) { - if (dynamic_cast(element) ) { - AttTabular *att = dynamic_cast(element); + if (element->HasAttClass( ATT_TABULAR ) ) { + AttTabular *att = reinterpret_cast(element); if (attrType == "colspanInt") { att->SetColspan(att->StrToInt(attrValue)); return true; @@ -97,8 +97,8 @@ bool Att::SetFigtable( Object *element, std::string attrType, std::string attrVa } void Att::GetFigtable( Object *element, ArrayOfStrAttr *attributes ) { - if (dynamic_cast(element) ) { - AttTabular *att = dynamic_cast(element); + if (element->HasAttClass( ATT_TABULAR ) ) { + AttTabular *att = reinterpret_cast(element); if (att->HasColspan()) { attributes->push_back(std::make_pair("colspanInt", att->IntToStr(att->GetColspan()))); } diff --git a/libmei/atts_figtable.h b/libmei/atts_figtable.h index 0cd69a73cc2..44bcb38bcba 100644 --- a/libmei/atts_figtable.h +++ b/libmei/atts_figtable.h @@ -28,6 +28,8 @@ namespace vrv { // AttTabular //---------------------------------------------------------------------------- +#define ATT_TABULAR 54 + class AttTabular: public Att { public: diff --git a/libmei/atts_harmony.cpp b/libmei/atts_harmony.cpp index a65130f8f8d..7f370f9f851 100644 --- a/libmei/atts_harmony.cpp +++ b/libmei/atts_harmony.cpp @@ -167,22 +167,22 @@ bool AttHarmVis::HasRendgrid( ) /* include */ bool Att::SetHarmony( Object *element, std::string attrType, std::string attrValue ) { - if (dynamic_cast(element) ) { - AttFretlocation *att = dynamic_cast(element); + if (element->HasAttClass( ATT_FRETLOCATION ) ) { + AttFretlocation *att = reinterpret_cast(element); if (attrType == "fret") { att->SetFret(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttHarmLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_HARMLOG ) ) { + AttHarmLog *att = reinterpret_cast(element); if (attrType == "chordref") { att->SetChordref(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttHarmVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_HARMVIS ) ) { + AttHarmVis *att = reinterpret_cast(element); if (attrType == "extender") { att->SetExtender(att->StrToStr(attrValue)); return true; @@ -197,20 +197,20 @@ bool Att::SetHarmony( Object *element, std::string attrType, std::string attrVal } void Att::GetHarmony( Object *element, ArrayOfStrAttr *attributes ) { - if (dynamic_cast(element) ) { - AttFretlocation *att = dynamic_cast(element); + if (element->HasAttClass( ATT_FRETLOCATION ) ) { + AttFretlocation *att = reinterpret_cast(element); if (att->HasFret()) { attributes->push_back(std::make_pair("fret", att->StrToStr(att->GetFret()))); } } - if (dynamic_cast(element) ) { - AttHarmLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_HARMLOG ) ) { + AttHarmLog *att = reinterpret_cast(element); if (att->HasChordref()) { attributes->push_back(std::make_pair("chordref", att->StrToStr(att->GetChordref()))); } } - if (dynamic_cast(element) ) { - AttHarmVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_HARMVIS ) ) { + AttHarmVis *att = reinterpret_cast(element); if (att->HasExtender()) { attributes->push_back(std::make_pair("extender", att->StrToStr(att->GetExtender()))); } diff --git a/libmei/atts_harmony.h b/libmei/atts_harmony.h index 493fb08c865..fbbd4e2dc7a 100644 --- a/libmei/atts_harmony.h +++ b/libmei/atts_harmony.h @@ -28,6 +28,8 @@ namespace vrv { // AttFretlocation //---------------------------------------------------------------------------- +#define ATT_FRETLOCATION 55 + class AttFretlocation: public Att { public: @@ -66,6 +68,8 @@ class AttFretlocation: public Att // AttHarmLog //---------------------------------------------------------------------------- +#define ATT_HARMLOG 56 + class AttHarmLog: public Att { public: @@ -104,6 +108,8 @@ class AttHarmLog: public Att // AttHarmVis //---------------------------------------------------------------------------- +#define ATT_HARMVIS 57 + class AttHarmVis: public Att { public: diff --git a/libmei/atts_header.cpp b/libmei/atts_header.cpp index 2e027ae6d60..1835cc4d268 100644 --- a/libmei/atts_header.cpp +++ b/libmei/atts_header.cpp @@ -66,8 +66,8 @@ bool AttRegularmethod::HasMethod( ) /* include */ bool Att::SetHeader( Object *element, std::string attrType, std::string attrValue ) { - if (dynamic_cast(element) ) { - AttRegularmethod *att = dynamic_cast(element); + if (element->HasAttClass( ATT_REGULARMETHOD ) ) { + AttRegularmethod *att = reinterpret_cast(element); if (attrType == "method") { att->SetMethod(att->StrToStr(attrValue)); return true; @@ -78,8 +78,8 @@ bool Att::SetHeader( Object *element, std::string attrType, std::string attrValu } void Att::GetHeader( Object *element, ArrayOfStrAttr *attributes ) { - if (dynamic_cast(element) ) { - AttRegularmethod *att = dynamic_cast(element); + if (element->HasAttClass( ATT_REGULARMETHOD ) ) { + AttRegularmethod *att = reinterpret_cast(element); if (att->HasMethod()) { attributes->push_back(std::make_pair("method", att->StrToStr(att->GetMethod()))); } diff --git a/libmei/atts_header.h b/libmei/atts_header.h index e287aa0d5e4..0dd92d11cac 100644 --- a/libmei/atts_header.h +++ b/libmei/atts_header.h @@ -28,6 +28,8 @@ namespace vrv { // AttRegularmethod //---------------------------------------------------------------------------- +#define ATT_REGULARMETHOD 58 + class AttRegularmethod: public Att { public: diff --git a/libmei/atts_linkalign.cpp b/libmei/atts_linkalign.cpp index 8faefba1641..db52b27102c 100644 --- a/libmei/atts_linkalign.cpp +++ b/libmei/atts_linkalign.cpp @@ -66,8 +66,8 @@ bool AttAlignment::HasWhen( ) /* include */ bool Att::SetLinkalign( Object *element, std::string attrType, std::string attrValue ) { - if (dynamic_cast(element) ) { - AttAlignment *att = dynamic_cast(element); + if (element->HasAttClass( ATT_ALIGNMENT ) ) { + AttAlignment *att = reinterpret_cast(element); if (attrType == "when") { att->SetWhen(att->StrToStr(attrValue)); return true; @@ -78,8 +78,8 @@ bool Att::SetLinkalign( Object *element, std::string attrType, std::string attrV } void Att::GetLinkalign( Object *element, ArrayOfStrAttr *attributes ) { - if (dynamic_cast(element) ) { - AttAlignment *att = dynamic_cast(element); + if (element->HasAttClass( ATT_ALIGNMENT ) ) { + AttAlignment *att = reinterpret_cast(element); if (att->HasWhen()) { attributes->push_back(std::make_pair("when", att->StrToStr(att->GetWhen()))); } diff --git a/libmei/atts_linkalign.h b/libmei/atts_linkalign.h index e57df581d54..e2ff634f69e 100644 --- a/libmei/atts_linkalign.h +++ b/libmei/atts_linkalign.h @@ -28,6 +28,8 @@ namespace vrv { // AttAlignment //---------------------------------------------------------------------------- +#define ATT_ALIGNMENT 59 + class AttAlignment: public Att { public: diff --git a/libmei/atts_lyrics.cpp b/libmei/atts_lyrics.cpp index 75a83a61692..59149f77b8d 100644 --- a/libmei/atts_lyrics.cpp +++ b/libmei/atts_lyrics.cpp @@ -81,8 +81,8 @@ bool AttVerseLog::HasRhythm( ) /* include */ bool Att::SetLyrics( Object *element, std::string attrType, std::string attrValue ) { - if (dynamic_cast(element) ) { - AttVerseLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_VERSELOG ) ) { + AttVerseLog *att = reinterpret_cast(element); if (attrType == "refrain") { att->SetRefrain(att->StrToStr(attrValue)); return true; @@ -97,8 +97,8 @@ bool Att::SetLyrics( Object *element, std::string attrType, std::string attrValu } void Att::GetLyrics( Object *element, ArrayOfStrAttr *attributes ) { - if (dynamic_cast(element) ) { - AttVerseLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_VERSELOG ) ) { + AttVerseLog *att = reinterpret_cast(element); if (att->HasRefrain()) { attributes->push_back(std::make_pair("refrain", att->StrToStr(att->GetRefrain()))); } diff --git a/libmei/atts_lyrics.h b/libmei/atts_lyrics.h index 24ecab87c4e..eebaf573b71 100644 --- a/libmei/atts_lyrics.h +++ b/libmei/atts_lyrics.h @@ -28,6 +28,8 @@ namespace vrv { // AttVerseLog //---------------------------------------------------------------------------- +#define ATT_VERSELOG 60 + class AttVerseLog: public Att { public: diff --git a/libmei/atts_mensural.cpp b/libmei/atts_mensural.cpp index 77b51aa8275..779662ceab1 100644 --- a/libmei/atts_mensural.cpp +++ b/libmei/atts_mensural.cpp @@ -504,15 +504,15 @@ bool AttRestVisMensural::HasSpaces( ) /* include */ bool Att::SetMensural( Object *element, std::string attrType, std::string attrValue ) { - if (dynamic_cast(element) ) { - AttLigatureLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_LIGATURELOG ) ) { + AttLigatureLog *att = reinterpret_cast(element); if (attrType == "form") { att->SetForm(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttMensurVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MENSURVIS ) ) { + AttMensurVis *att = reinterpret_cast(element); if (attrType == "form") { att->SetForm(att->StrToStr(attrValue)); return true; @@ -522,8 +522,8 @@ bool Att::SetMensural( Object *element, std::string attrType, std::string attrVa return true; } } - if (dynamic_cast(element) ) { - AttMensuralLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MENSURALLOG ) ) { + AttMensuralLog *att = reinterpret_cast(element); if (attrType == "mensurDot") { att->SetMensurDot(att->StrToBool(attrValue)); return true; @@ -545,8 +545,8 @@ bool Att::SetMensural( Object *element, std::string attrType, std::string attrVa return true; } } - if (dynamic_cast(element) ) { - AttMensuralShared *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MENSURALSHARED ) ) { + AttMensuralShared *att = reinterpret_cast(element); if (attrType == "modusmaior") { att->SetModusmaior(att->StrToModusmaior(attrValue)); return true; @@ -564,8 +564,8 @@ bool Att::SetMensural( Object *element, std::string attrType, std::string attrVa return true; } } - if (dynamic_cast(element) ) { - AttMensuralVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MENSURALVIS ) ) { + AttMensuralVis *att = reinterpret_cast(element); if (attrType == "mensurColor") { att->SetMensurColor(att->StrToStr(attrValue)); return true; @@ -587,15 +587,15 @@ bool Att::SetMensural( Object *element, std::string attrType, std::string attrVa return true; } } - if (dynamic_cast(element) ) { - AttNoteLogMensural *att = dynamic_cast(element); + if (element->HasAttClass( ATT_NOTELOGMENSURAL ) ) { + AttNoteLogMensural *att = reinterpret_cast(element); if (attrType == "lig") { att->SetLig(att->StrToLigature(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttRestVisMensural *att = dynamic_cast(element); + if (element->HasAttClass( ATT_RESTVISMENSURAL ) ) { + AttRestVisMensural *att = reinterpret_cast(element); if (attrType == "spacesInt") { att->SetSpaces(att->StrToInt(attrValue)); return true; @@ -606,14 +606,14 @@ bool Att::SetMensural( Object *element, std::string attrType, std::string attrVa } void Att::GetMensural( Object *element, ArrayOfStrAttr *attributes ) { - if (dynamic_cast(element) ) { - AttLigatureLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_LIGATURELOG ) ) { + AttLigatureLog *att = reinterpret_cast(element); if (att->HasForm()) { attributes->push_back(std::make_pair("form", att->StrToStr(att->GetForm()))); } } - if (dynamic_cast(element) ) { - AttMensurVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MENSURVIS ) ) { + AttMensurVis *att = reinterpret_cast(element); if (att->HasForm()) { attributes->push_back(std::make_pair("form", att->StrToStr(att->GetForm()))); } @@ -621,8 +621,8 @@ void Att::GetMensural( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("orient", att->OrientationToStr(att->GetOrient()))); } } - if (dynamic_cast(element) ) { - AttMensuralLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MENSURALLOG ) ) { + AttMensuralLog *att = reinterpret_cast(element); if (att->HasMensurDot()) { attributes->push_back(std::make_pair("mensurDot", att->BoolToStr(att->GetMensurDot()))); } @@ -639,8 +639,8 @@ void Att::GetMensural( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("proportNumbase", att->IntToStr(att->GetProportNumbase()))); } } - if (dynamic_cast(element) ) { - AttMensuralShared *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MENSURALSHARED ) ) { + AttMensuralShared *att = reinterpret_cast(element); if (att->HasModusmaior()) { attributes->push_back(std::make_pair("modusmaior", att->ModusmaiorToStr(att->GetModusmaior()))); } @@ -654,8 +654,8 @@ void Att::GetMensural( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("tempus", att->TempusToStr(att->GetTempus()))); } } - if (dynamic_cast(element) ) { - AttMensuralVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MENSURALVIS ) ) { + AttMensuralVis *att = reinterpret_cast(element); if (att->HasMensurColor()) { attributes->push_back(std::make_pair("mensurColor", att->StrToStr(att->GetMensurColor()))); } @@ -672,14 +672,14 @@ void Att::GetMensural( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("mensurSize", att->StrToStr(att->GetMensurSize()))); } } - if (dynamic_cast(element) ) { - AttNoteLogMensural *att = dynamic_cast(element); + if (element->HasAttClass( ATT_NOTELOGMENSURAL ) ) { + AttNoteLogMensural *att = reinterpret_cast(element); if (att->HasLig()) { attributes->push_back(std::make_pair("lig", att->LigatureToStr(att->GetLig()))); } } - if (dynamic_cast(element) ) { - AttRestVisMensural *att = dynamic_cast(element); + if (element->HasAttClass( ATT_RESTVISMENSURAL ) ) { + AttRestVisMensural *att = reinterpret_cast(element); if (att->HasSpaces()) { attributes->push_back(std::make_pair("spacesInt", att->IntToStr(att->GetSpaces()))); } diff --git a/libmei/atts_mensural.h b/libmei/atts_mensural.h index 44d3c5d5bca..db3e19bd41a 100644 --- a/libmei/atts_mensural.h +++ b/libmei/atts_mensural.h @@ -28,6 +28,8 @@ namespace vrv { // AttLigatureLog //---------------------------------------------------------------------------- +#define ATT_LIGATURELOG 61 + class AttLigatureLog: public Att { public: @@ -66,6 +68,8 @@ class AttLigatureLog: public Att // AttMensurVis //---------------------------------------------------------------------------- +#define ATT_MENSURVIS 62 + class AttMensurVis: public Att { public: @@ -111,6 +115,8 @@ class AttMensurVis: public Att // AttMensuralLog //---------------------------------------------------------------------------- +#define ATT_MENSURALLOG 63 + class AttMensuralLog: public Att { public: @@ -188,6 +194,8 @@ class AttMensuralLog: public Att // AttMensuralShared //---------------------------------------------------------------------------- +#define ATT_MENSURALSHARED 64 + class AttMensuralShared: public Att { public: @@ -247,6 +255,8 @@ class AttMensuralShared: public Att // AttMensuralVis //---------------------------------------------------------------------------- +#define ATT_MENSURALVIS 65 + class AttMensuralVis: public Att { public: @@ -316,6 +326,8 @@ class AttMensuralVis: public Att // AttNoteLogMensural //---------------------------------------------------------------------------- +#define ATT_NOTELOGMENSURAL 66 + class AttNoteLogMensural: public Att { public: @@ -354,6 +366,8 @@ class AttNoteLogMensural: public Att // AttRestVisMensural //---------------------------------------------------------------------------- +#define ATT_RESTVISMENSURAL 67 + class AttRestVisMensural: public Att { public: diff --git a/libmei/atts_midi.cpp b/libmei/atts_midi.cpp index f5e7058c5ac..86749cc591e 100644 --- a/libmei/atts_midi.cpp +++ b/libmei/atts_midi.cpp @@ -371,8 +371,8 @@ bool AttTimebase::HasPpq( ) /* include */ bool Att::SetMidi( Object *element, std::string attrType, std::string attrValue ) { - if (dynamic_cast(element) ) { - AttChannelized *att = dynamic_cast(element); + if (element->HasAttClass( ATT_CHANNELIZED ) ) { + AttChannelized *att = reinterpret_cast(element); if (attrType == "midiChannel") { att->SetMidiChannel(att->StrToStr(attrValue)); return true; @@ -390,8 +390,8 @@ bool Att::SetMidi( Object *element, std::string attrType, std::string attrValue return true; } } - if (dynamic_cast(element) ) { - AttMidiinstrument *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MIDIINSTRUMENT ) ) { + AttMidiinstrument *att = reinterpret_cast(element); if (attrType == "midiInstrnum") { att->SetMidiInstrnum(att->StrToStr(attrValue)); return true; @@ -409,29 +409,29 @@ bool Att::SetMidi( Object *element, std::string attrType, std::string attrValue return true; } } - if (dynamic_cast(element) ) { - AttMidinumber *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MIDINUMBER ) ) { + AttMidinumber *att = reinterpret_cast(element); if (attrType == "numInt") { att->SetNum(att->StrToInt(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttMiditempo *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MIDITEMPO ) ) { + AttMiditempo *att = reinterpret_cast(element); if (attrType == "midiTempo") { att->SetMidiTempo(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttMidivalue *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MIDIVALUE ) ) { + AttMidivalue *att = reinterpret_cast(element); if (attrType == "val") { att->SetVal(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttTimebase *att = dynamic_cast(element); + if (element->HasAttClass( ATT_TIMEBASE ) ) { + AttTimebase *att = reinterpret_cast(element); if (attrType == "ppqInt") { att->SetPpq(att->StrToInt(attrValue)); return true; @@ -442,8 +442,8 @@ bool Att::SetMidi( Object *element, std::string attrType, std::string attrValue } void Att::GetMidi( Object *element, ArrayOfStrAttr *attributes ) { - if (dynamic_cast(element) ) { - AttChannelized *att = dynamic_cast(element); + if (element->HasAttClass( ATT_CHANNELIZED ) ) { + AttChannelized *att = reinterpret_cast(element); if (att->HasMidiChannel()) { attributes->push_back(std::make_pair("midiChannel", att->StrToStr(att->GetMidiChannel()))); } @@ -457,8 +457,8 @@ void Att::GetMidi( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("midiTrackInt", att->IntToStr(att->GetMidiTrack()))); } } - if (dynamic_cast(element) ) { - AttMidiinstrument *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MIDIINSTRUMENT ) ) { + AttMidiinstrument *att = reinterpret_cast(element); if (att->HasMidiInstrnum()) { attributes->push_back(std::make_pair("midiInstrnum", att->StrToStr(att->GetMidiInstrnum()))); } @@ -472,26 +472,26 @@ void Att::GetMidi( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("midiVolume", att->StrToStr(att->GetMidiVolume()))); } } - if (dynamic_cast(element) ) { - AttMidinumber *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MIDINUMBER ) ) { + AttMidinumber *att = reinterpret_cast(element); if (att->HasNum()) { attributes->push_back(std::make_pair("numInt", att->IntToStr(att->GetNum()))); } } - if (dynamic_cast(element) ) { - AttMiditempo *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MIDITEMPO ) ) { + AttMiditempo *att = reinterpret_cast(element); if (att->HasMidiTempo()) { attributes->push_back(std::make_pair("midiTempo", att->StrToStr(att->GetMidiTempo()))); } } - if (dynamic_cast(element) ) { - AttMidivalue *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MIDIVALUE ) ) { + AttMidivalue *att = reinterpret_cast(element); if (att->HasVal()) { attributes->push_back(std::make_pair("val", att->StrToStr(att->GetVal()))); } } - if (dynamic_cast(element) ) { - AttTimebase *att = dynamic_cast(element); + if (element->HasAttClass( ATT_TIMEBASE ) ) { + AttTimebase *att = reinterpret_cast(element); if (att->HasPpq()) { attributes->push_back(std::make_pair("ppqInt", att->IntToStr(att->GetPpq()))); } diff --git a/libmei/atts_midi.h b/libmei/atts_midi.h index 30bb3d51a50..fa1f7ac77e6 100644 --- a/libmei/atts_midi.h +++ b/libmei/atts_midi.h @@ -28,6 +28,8 @@ namespace vrv { // AttChannelized //---------------------------------------------------------------------------- +#define ATT_CHANNELIZED 68 + class AttChannelized: public Att { public: @@ -87,6 +89,8 @@ class AttChannelized: public Att // AttMidiinstrument //---------------------------------------------------------------------------- +#define ATT_MIDIINSTRUMENT 69 + class AttMidiinstrument: public Att { public: @@ -149,6 +153,8 @@ class AttMidiinstrument: public Att // AttMidinumber //---------------------------------------------------------------------------- +#define ATT_MIDINUMBER 70 + class AttMidinumber: public Att { public: @@ -190,6 +196,8 @@ class AttMidinumber: public Att // AttMiditempo //---------------------------------------------------------------------------- +#define ATT_MIDITEMPO 71 + class AttMiditempo: public Att { public: @@ -231,6 +239,8 @@ class AttMiditempo: public Att // AttMidivalue //---------------------------------------------------------------------------- +#define ATT_MIDIVALUE 72 + class AttMidivalue: public Att { public: @@ -269,6 +279,8 @@ class AttMidivalue: public Att // AttTimebase //---------------------------------------------------------------------------- +#define ATT_TIMEBASE 73 + class AttTimebase: public Att { public: diff --git a/libmei/atts_neumes.cpp b/libmei/atts_neumes.cpp index b6940d703e0..6459232f178 100644 --- a/libmei/atts_neumes.cpp +++ b/libmei/atts_neumes.cpp @@ -139,8 +139,8 @@ bool AttUneumeLog::HasName( ) /* include */ bool Att::SetNeumes( Object *element, std::string attrType, std::string attrValue ) { - if (dynamic_cast(element) ) { - AttIneumeLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_INEUMELOG ) ) { + AttIneumeLog *att = reinterpret_cast(element); if (attrType == "form") { att->SetForm(att->StrToStr(attrValue)); return true; @@ -150,8 +150,8 @@ bool Att::SetNeumes( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttUneumeLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_UNEUMELOG ) ) { + AttUneumeLog *att = reinterpret_cast(element); if (attrType == "form") { att->SetForm(att->StrToStr(attrValue)); return true; @@ -166,8 +166,8 @@ bool Att::SetNeumes( Object *element, std::string attrType, std::string attrValu } void Att::GetNeumes( Object *element, ArrayOfStrAttr *attributes ) { - if (dynamic_cast(element) ) { - AttIneumeLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_INEUMELOG ) ) { + AttIneumeLog *att = reinterpret_cast(element); if (att->HasForm()) { attributes->push_back(std::make_pair("form", att->StrToStr(att->GetForm()))); } @@ -175,8 +175,8 @@ void Att::GetNeumes( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("name", att->StrToStr(att->GetName()))); } } - if (dynamic_cast(element) ) { - AttUneumeLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_UNEUMELOG ) ) { + AttUneumeLog *att = reinterpret_cast(element); if (att->HasForm()) { attributes->push_back(std::make_pair("form", att->StrToStr(att->GetForm()))); } diff --git a/libmei/atts_neumes.h b/libmei/atts_neumes.h index a41db8ca631..99e7fb80aaa 100644 --- a/libmei/atts_neumes.h +++ b/libmei/atts_neumes.h @@ -28,6 +28,8 @@ namespace vrv { // AttIneumeLog //---------------------------------------------------------------------------- +#define ATT_INEUMELOG 74 + class AttIneumeLog: public Att { public: @@ -73,6 +75,8 @@ class AttIneumeLog: public Att // AttUneumeLog //---------------------------------------------------------------------------- +#define ATT_UNEUMELOG 75 + class AttUneumeLog: public Att { public: diff --git a/libmei/atts_pagebased.cpp b/libmei/atts_pagebased.cpp index fb3d7d3614b..7cf17e72d4b 100644 --- a/libmei/atts_pagebased.cpp +++ b/libmei/atts_pagebased.cpp @@ -66,8 +66,8 @@ bool AttSurface::HasSurface( ) /* include */ bool Att::SetPagebased( Object *element, std::string attrType, std::string attrValue ) { - if (dynamic_cast(element) ) { - AttSurface *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SURFACE ) ) { + AttSurface *att = reinterpret_cast(element); if (attrType == "surface") { att->SetSurface(att->StrToStr(attrValue)); return true; @@ -78,8 +78,8 @@ bool Att::SetPagebased( Object *element, std::string attrType, std::string attrV } void Att::GetPagebased( Object *element, ArrayOfStrAttr *attributes ) { - if (dynamic_cast(element) ) { - AttSurface *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SURFACE ) ) { + AttSurface *att = reinterpret_cast(element); if (att->HasSurface()) { attributes->push_back(std::make_pair("surface", att->StrToStr(att->GetSurface()))); } diff --git a/libmei/atts_pagebased.h b/libmei/atts_pagebased.h index 746cb958541..07999270a6c 100644 --- a/libmei/atts_pagebased.h +++ b/libmei/atts_pagebased.h @@ -28,6 +28,8 @@ namespace vrv { // AttSurface //---------------------------------------------------------------------------- +#define ATT_SURFACE 76 + class AttSurface: public Att { public: diff --git a/libmei/atts_shared.cpp b/libmei/atts_shared.cpp index fae2e1b6626..f35179eb29a 100644 --- a/libmei/atts_shared.cpp +++ b/libmei/atts_shared.cpp @@ -6945,57 +6945,57 @@ bool AttXy2::HasY2( ) /* include */ bool Att::SetShared( Object *element, std::string attrType, std::string attrValue ) { - if (dynamic_cast(element) ) { - AttAccidLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_ACCIDLOG ) ) { + AttAccidLog *att = reinterpret_cast(element); if (attrType == "func") { att->SetFunc(att->StrToFunc(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttAccidental *att = dynamic_cast(element); + if (element->HasAttClass( ATT_ACCIDENTAL ) ) { + AttAccidental *att = reinterpret_cast(element); if (attrType == "accid") { att->SetAccid(att->StrToAccidentalExplicit(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttAccidentalPerformed *att = dynamic_cast(element); + if (element->HasAttClass( ATT_ACCIDENTALPERFORMED ) ) { + AttAccidentalPerformed *att = reinterpret_cast(element); if (attrType == "accidGes") { att->SetAccidGes(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttAltsym *att = dynamic_cast(element); + if (element->HasAttClass( ATT_ALTSYM ) ) { + AttAltsym *att = reinterpret_cast(element); if (attrType == "altsym") { att->SetAltsym(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttArticulation *att = dynamic_cast(element); + if (element->HasAttClass( ATT_ARTICULATION ) ) { + AttArticulation *att = reinterpret_cast(element); if (attrType == "artic") { att->SetArtic(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttArticulationPerformed *att = dynamic_cast(element); + if (element->HasAttClass( ATT_ARTICULATIONPERFORMED ) ) { + AttArticulationPerformed *att = reinterpret_cast(element); if (attrType == "articGes") { att->SetArticGes(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttAugmentdots *att = dynamic_cast(element); + if (element->HasAttClass( ATT_AUGMENTDOTS ) ) { + AttAugmentdots *att = reinterpret_cast(element); if (attrType == "dots") { att->SetDots(att->StrToInt(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttAuthorized *att = dynamic_cast(element); + if (element->HasAttClass( ATT_AUTHORIZED ) ) { + AttAuthorized *att = reinterpret_cast(element); if (attrType == "authority") { att->SetAuthority(att->StrToStr(attrValue)); return true; @@ -7005,15 +7005,15 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttBarLineLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_BARLINELOG ) ) { + AttBarLineLog *att = reinterpret_cast(element); if (attrType == "rend") { att->SetRend(att->StrToBarRendition(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttBarplacement *att = dynamic_cast(element); + if (element->HasAttClass( ATT_BARPLACEMENT ) ) { + AttBarplacement *att = reinterpret_cast(element); if (attrType == "barplace") { att->SetBarplace(att->StrToStr(attrValue)); return true; @@ -7023,8 +7023,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttBeamingVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_BEAMINGVIS ) ) { + AttBeamingVis *att = reinterpret_cast(element); if (attrType == "beamColor") { att->SetBeamColor(att->StrToStr(attrValue)); return true; @@ -7038,43 +7038,43 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttBibl *att = dynamic_cast(element); + if (element->HasAttClass( ATT_BIBL ) ) { + AttBibl *att = reinterpret_cast(element); if (attrType == "analog") { att->SetAnalog(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttCalendared *att = dynamic_cast(element); + if (element->HasAttClass( ATT_CALENDARED ) ) { + AttCalendared *att = reinterpret_cast(element); if (attrType == "calendar") { att->SetCalendar(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttCanonical *att = dynamic_cast(element); + if (element->HasAttClass( ATT_CANONICAL ) ) { + AttCanonical *att = reinterpret_cast(element); if (attrType == "dbkey") { att->SetDbkey(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttChordVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_CHORDVIS ) ) { + AttChordVis *att = reinterpret_cast(element); if (attrType == "cluster") { att->SetCluster(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttClefLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_CLEFLOG ) ) { + AttClefLog *att = reinterpret_cast(element); if (attrType == "cautionary") { att->SetCautionary(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttCleffingLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_CLEFFINGLOG ) ) { + AttCleffingLog *att = reinterpret_cast(element); if (attrType == "clefShape") { att->SetClefShape(att->StrToClefShape(attrValue)); return true; @@ -7092,8 +7092,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttCleffingVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_CLEFFINGVIS ) ) { + AttCleffingVis *att = reinterpret_cast(element); if (attrType == "clefColor") { att->SetClefColor(att->StrToStr(attrValue)); return true; @@ -7103,36 +7103,36 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttClefshape *att = dynamic_cast(element); + if (element->HasAttClass( ATT_CLEFSHAPE ) ) { + AttClefshape *att = reinterpret_cast(element); if (attrType == "shape") { att->SetShape(att->StrToClefShape(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttCoded *att = dynamic_cast(element); + if (element->HasAttClass( ATT_CODED ) ) { + AttCoded *att = reinterpret_cast(element); if (attrType == "code") { att->SetCode(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttColor *att = dynamic_cast(element); + if (element->HasAttClass( ATT_COLOR ) ) { + AttColor *att = reinterpret_cast(element); if (attrType == "color") { att->SetColor(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttColoration *att = dynamic_cast(element); + if (element->HasAttClass( ATT_COLORATION ) ) { + AttColoration *att = reinterpret_cast(element); if (attrType == "colored") { att->SetColored(att->StrToBool(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttCommon *att = dynamic_cast(element); + if (element->HasAttClass( ATT_COMMON ) ) { + AttCommon *att = reinterpret_cast(element); if (attrType == "label") { att->SetLabel(att->StrToStr(attrValue)); return true; @@ -7146,8 +7146,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttCoordinated *att = dynamic_cast(element); + if (element->HasAttClass( ATT_COORDINATED ) ) { + AttCoordinated *att = reinterpret_cast(element); if (attrType == "ulxInt") { att->SetUlx(att->StrToInt(attrValue)); return true; @@ -7165,8 +7165,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttCurvature *att = dynamic_cast(element); + if (element->HasAttClass( ATT_CURVATURE ) ) { + AttCurvature *att = reinterpret_cast(element); if (attrType == "bezier") { att->SetBezier(att->StrToStr(attrValue)); return true; @@ -7180,22 +7180,22 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttCurverend *att = dynamic_cast(element); + if (element->HasAttClass( ATT_CURVEREND ) ) { + AttCurverend *att = reinterpret_cast(element); if (attrType == "rend") { att->SetRend(att->StrToBarRendition(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttCustosLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_CUSTOSLOG ) ) { + AttCustosLog *att = reinterpret_cast(element); if (attrType == "target") { att->SetTarget(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttDatable *att = dynamic_cast(element); + if (element->HasAttClass( ATT_DATABLE ) ) { + AttDatable *att = reinterpret_cast(element); if (attrType == "enddate") { att->SetEnddate(att->StrToStr(attrValue)); return true; @@ -7217,22 +7217,22 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttDatapointing *att = dynamic_cast(element); + if (element->HasAttClass( ATT_DATAPOINTING ) ) { + AttDatapointing *att = reinterpret_cast(element); if (attrType == "data") { att->SetData(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttDeclaring *att = dynamic_cast(element); + if (element->HasAttClass( ATT_DECLARING ) ) { + AttDeclaring *att = reinterpret_cast(element); if (attrType == "decls") { att->SetDecls(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttDistances *att = dynamic_cast(element); + if (element->HasAttClass( ATT_DISTANCES ) ) { + AttDistances *att = reinterpret_cast(element); if (attrType == "dynamDist") { att->SetDynamDist(att->StrToStr(attrValue)); return true; @@ -7246,22 +7246,22 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttDotLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_DOTLOG ) ) { + AttDotLog *att = reinterpret_cast(element); if (attrType == "form") { att->SetForm(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttDurationAdditive *att = dynamic_cast(element); + if (element->HasAttClass( ATT_DURATIONADDITIVE ) ) { + AttDurationAdditive *att = reinterpret_cast(element); if (attrType == "dur") { att->SetDur(att->StrToDur(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttDurationDefault *att = dynamic_cast(element); + if (element->HasAttClass( ATT_DURATIONDEFAULT ) ) { + AttDurationDefault *att = reinterpret_cast(element); if (attrType == "durDefault") { att->SetDurDefault(att->StrToStr(attrValue)); return true; @@ -7275,22 +7275,22 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttDurationMusical *att = dynamic_cast(element); + if (element->HasAttClass( ATT_DURATIONMUSICAL ) ) { + AttDurationMusical *att = reinterpret_cast(element); if (attrType == "dur") { att->SetDur(att->StrToDur(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttDurationPerformed *att = dynamic_cast(element); + if (element->HasAttClass( ATT_DURATIONPERFORMED ) ) { + AttDurationPerformed *att = reinterpret_cast(element); if (attrType == "durGes") { att->SetDurGes(att->StrToDur(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttDurationRatio *att = dynamic_cast(element); + if (element->HasAttClass( ATT_DURATIONRATIO ) ) { + AttDurationRatio *att = reinterpret_cast(element); if (attrType == "num") { att->SetNum(att->StrToInt(attrValue)); return true; @@ -7300,64 +7300,64 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttEnclosingchars *att = dynamic_cast(element); + if (element->HasAttClass( ATT_ENCLOSINGCHARS ) ) { + AttEnclosingchars *att = reinterpret_cast(element); if (attrType == "enclose") { att->SetEnclose(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttFermatapresent *att = dynamic_cast(element); + if (element->HasAttClass( ATT_FERMATAPRESENT ) ) { + AttFermatapresent *att = reinterpret_cast(element); if (attrType == "fermata") { att->SetFermata(att->StrToPlace(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttHandident *att = dynamic_cast(element); + if (element->HasAttClass( ATT_HANDIDENT ) ) { + AttHandident *att = reinterpret_cast(element); if (attrType == "hand") { att->SetHand(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttHorizontalalign *att = dynamic_cast(element); + if (element->HasAttClass( ATT_HORIZONTALALIGN ) ) { + AttHorizontalalign *att = reinterpret_cast(element); if (attrType == "halign") { att->SetHalign(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttInstrumentident *att = dynamic_cast(element); + if (element->HasAttClass( ATT_INSTRUMENTIDENT ) ) { + AttInstrumentident *att = reinterpret_cast(element); if (attrType == "instr") { att->SetInstr(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttInternetmedia *att = dynamic_cast(element); + if (element->HasAttClass( ATT_INTERNETMEDIA ) ) { + AttInternetmedia *att = reinterpret_cast(element); if (attrType == "mimetype") { att->SetMimetype(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttJoined *att = dynamic_cast(element); + if (element->HasAttClass( ATT_JOINED ) ) { + AttJoined *att = reinterpret_cast(element); if (attrType == "join") { att->SetJoin(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttKeySigLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_KEYSIGLOG ) ) { + AttKeySigLog *att = reinterpret_cast(element); if (attrType == "mode") { att->SetMode(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttKeySigDefaultLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_KEYSIGDEFAULTLOG ) ) { + AttKeySigDefaultLog *att = reinterpret_cast(element); if (attrType == "keyAccid") { att->SetKeyAccid(att->StrToAccidentalImplicit(attrValue)); return true; @@ -7379,8 +7379,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttKeySigDefaultVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_KEYSIGDEFAULTVIS ) ) { + AttKeySigDefaultVis *att = reinterpret_cast(element); if (attrType == "keySigShow") { att->SetKeySigShow(att->StrToStr(attrValue)); return true; @@ -7390,50 +7390,50 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttLabelsAddl *att = dynamic_cast(element); + if (element->HasAttClass( ATT_LABELSADDL ) ) { + AttLabelsAddl *att = reinterpret_cast(element); if (attrType == "labelAbbr") { att->SetLabelAbbr(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttLang *att = dynamic_cast(element); + if (element->HasAttClass( ATT_LANG ) ) { + AttLang *att = reinterpret_cast(element); if (attrType == "lang") { att->SetLang(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttLayerLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_LAYERLOG ) ) { + AttLayerLog *att = reinterpret_cast(element); if (attrType == "def") { att->SetDef(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttLayerident *att = dynamic_cast(element); + if (element->HasAttClass( ATT_LAYERIDENT ) ) { + AttLayerident *att = reinterpret_cast(element); if (attrType == "layer") { att->SetLayer(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttLineloc *att = dynamic_cast(element); + if (element->HasAttClass( ATT_LINELOC ) ) { + AttLineloc *att = reinterpret_cast(element); if (attrType == "line") { att->SetLine(att->StrToInt(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttLinerend *att = dynamic_cast(element); + if (element->HasAttClass( ATT_LINEREND ) ) { + AttLinerend *att = reinterpret_cast(element); if (attrType == "rend") { att->SetRend(att->StrToBarRendition(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttLyricstyle *att = dynamic_cast(element); + if (element->HasAttClass( ATT_LYRICSTYLE ) ) { + AttLyricstyle *att = reinterpret_cast(element); if (attrType == "lyricAlign") { att->SetLyricAlign(att->StrToStr(attrValue)); return true; @@ -7459,8 +7459,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttMeasureLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MEASURELOG ) ) { + AttMeasureLog *att = reinterpret_cast(element); if (attrType == "left") { att->SetLeft(att->StrToBarRendition(attrValue)); return true; @@ -7470,15 +7470,15 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttMeasurement *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MEASUREMENT ) ) { + AttMeasurement *att = reinterpret_cast(element); if (attrType == "unit") { att->SetUnit(att->StrToInt(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttMediabounds *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MEDIABOUNDS ) ) { + AttMediabounds *att = reinterpret_cast(element); if (attrType == "begin") { att->SetBegin(att->StrToStr(attrValue)); return true; @@ -7492,15 +7492,15 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttMedium *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MEDIUM ) ) { + AttMedium *att = reinterpret_cast(element); if (attrType == "medium") { att->SetMedium(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttMeiversion *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MEIVERSION ) ) { + AttMeiversion *att = reinterpret_cast(element); if (attrType == "meiversion") { att->SetMeiversion(att->StrToStr(attrValue)); return true; @@ -7510,8 +7510,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttMensurLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MENSURLOG ) ) { + AttMensurLog *att = reinterpret_cast(element); if (attrType == "dot") { att->SetDot(att->StrToBool(attrValue)); return true; @@ -7521,8 +7521,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttMeterSigLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_METERSIGLOG ) ) { + AttMeterSigLog *att = reinterpret_cast(element); if (attrType == "count") { att->SetCount(att->StrToInt(attrValue)); return true; @@ -7536,15 +7536,15 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttMeterSigVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_METERSIGVIS ) ) { + AttMeterSigVis *att = reinterpret_cast(element); if (attrType == "rend") { att->SetRend(att->StrToBarRendition(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttMeterSigDefaultLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_METERSIGDEFAULTLOG ) ) { + AttMeterSigDefaultLog *att = reinterpret_cast(element); if (attrType == "meterCount") { att->SetMeterCount(att->StrToInt(attrValue)); return true; @@ -7554,8 +7554,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttMeterSigDefaultVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_METERSIGDEFAULTVIS ) ) { + AttMeterSigDefaultVis *att = reinterpret_cast(element); if (attrType == "meterRend") { att->SetMeterRend(att->StrToStr(attrValue)); return true; @@ -7569,15 +7569,15 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttMeterconformance *att = dynamic_cast(element); + if (element->HasAttClass( ATT_METERCONFORMANCE ) ) { + AttMeterconformance *att = reinterpret_cast(element); if (attrType == "metcon") { att->SetMetcon(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttMeterconformanceBar *att = dynamic_cast(element); + if (element->HasAttClass( ATT_METERCONFORMANCEBAR ) ) { + AttMeterconformanceBar *att = reinterpret_cast(element); if (attrType == "metcon") { att->SetMetcon(att->StrToStr(attrValue)); return true; @@ -7587,8 +7587,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttMmtempo *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MMTEMPO ) ) { + AttMmtempo *att = reinterpret_cast(element); if (attrType == "mm") { att->SetMm(att->StrToStr(attrValue)); return true; @@ -7602,15 +7602,15 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttMultinummeasures *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MULTINUMMEASURES ) ) { + AttMultinummeasures *att = reinterpret_cast(element); if (attrType == "multiNumber") { att->SetMultiNumber(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttName *att = dynamic_cast(element); + if (element->HasAttClass( ATT_NAME ) ) { + AttName *att = reinterpret_cast(element); if (attrType == "nymref") { att->SetNymref(att->StrToStr(attrValue)); return true; @@ -7620,8 +7620,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttNoteGes *att = dynamic_cast(element); + if (element->HasAttClass( ATT_NOTEGES ) ) { + AttNoteGes *att = reinterpret_cast(element); if (attrType == "octGes") { att->SetOctGes(att->StrToStr(attrValue)); return true; @@ -7635,29 +7635,29 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttNoteVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_NOTEVIS ) ) { + AttNoteVis *att = reinterpret_cast(element); if (attrType == "headshape") { att->SetHeadshape(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttOctave *att = dynamic_cast(element); + if (element->HasAttClass( ATT_OCTAVE ) ) { + AttOctave *att = reinterpret_cast(element); if (attrType == "oct") { att->SetOct(att->StrToInt(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttOctavedefault *att = dynamic_cast(element); + if (element->HasAttClass( ATT_OCTAVEDEFAULT ) ) { + AttOctavedefault *att = reinterpret_cast(element); if (attrType == "octaveDefault") { att->SetOctaveDefault(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttOctavedisplacement *att = dynamic_cast(element); + if (element->HasAttClass( ATT_OCTAVEDISPLACEMENT ) ) { + AttOctavedisplacement *att = reinterpret_cast(element); if (attrType == "dis") { att->SetDis(att->StrToOctaveDis(attrValue)); return true; @@ -7667,43 +7667,43 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttOnelinestaff *att = dynamic_cast(element); + if (element->HasAttClass( ATT_ONELINESTAFF ) ) { + AttOnelinestaff *att = reinterpret_cast(element); if (attrType == "ontheline") { att->SetOntheline(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttPadLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_PADLOG ) ) { + AttPadLog *att = reinterpret_cast(element); if (attrType == "num") { att->SetNum(att->StrToInt(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttPbVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_PBVIS ) ) { + AttPbVis *att = reinterpret_cast(element); if (attrType == "func") { att->SetFunc(att->StrToFunc(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttPitch *att = dynamic_cast(element); + if (element->HasAttClass( ATT_PITCH ) ) { + AttPitch *att = reinterpret_cast(element); if (attrType == "pname") { att->SetPname(att->StrToPitchName(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttPlacement *att = dynamic_cast(element); + if (element->HasAttClass( ATT_PLACEMENT ) ) { + AttPlacement *att = reinterpret_cast(element); if (attrType == "place") { att->SetPlace(att->StrToStaffRel(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttPlist *att = dynamic_cast(element); + if (element->HasAttClass( ATT_PLIST ) ) { + AttPlist *att = reinterpret_cast(element); if (attrType == "plist") { att->SetPlist(att->StrToStr(attrValue)); return true; @@ -7713,8 +7713,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttPointing *att = dynamic_cast(element); + if (element->HasAttClass( ATT_POINTING ) ) { + AttPointing *att = reinterpret_cast(element); if (attrType == "actuate") { att->SetActuate(att->StrToStr(attrValue)); return true; @@ -7740,36 +7740,36 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttRelativesize *att = dynamic_cast(element); + if (element->HasAttClass( ATT_RELATIVESIZE ) ) { + AttRelativesize *att = reinterpret_cast(element); if (attrType == "size") { att->SetSize(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttResponsibility *att = dynamic_cast(element); + if (element->HasAttClass( ATT_RESPONSIBILITY ) ) { + AttResponsibility *att = reinterpret_cast(element); if (attrType == "resp") { att->SetResp(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttSbVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SBVIS ) ) { + AttSbVis *att = reinterpret_cast(element); if (attrType == "rend") { att->SetRend(att->StrToBarRendition(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttScalable *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SCALABLE ) ) { + AttScalable *att = reinterpret_cast(element); if (attrType == "scale") { att->SetScale(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttScoreDefGes *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SCOREDEFGES ) ) { + AttScoreDefGes *att = reinterpret_cast(element); if (attrType == "tunePname") { att->SetTunePname(att->StrToStr(attrValue)); return true; @@ -7783,8 +7783,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttScoreDefVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SCOREDEFVIS ) ) { + AttScoreDefVis *att = reinterpret_cast(element); if (attrType == "endingRend") { att->SetEndingRend(att->StrToStr(attrValue)); return true; @@ -7870,50 +7870,50 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttSectionVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SECTIONVIS ) ) { + AttSectionVis *att = reinterpret_cast(element); if (attrType == "restart") { att->SetRestart(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttSequence *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SEQUENCE ) ) { + AttSequence *att = reinterpret_cast(element); if (attrType == "seqInt") { att->SetSeq(att->StrToInt(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttSlashcount *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SLASHCOUNT ) ) { + AttSlashcount *att = reinterpret_cast(element); if (attrType == "slash") { att->SetSlash(att->StrToInt(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttSlurpresent *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SLURPRESENT ) ) { + AttSlurpresent *att = reinterpret_cast(element); if (attrType == "slur") { att->SetSlur(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttSpaceVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SPACEVIS ) ) { + AttSpaceVis *att = reinterpret_cast(element); if (attrType == "compressable") { att->SetCompressable(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttStaffLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_STAFFLOG ) ) { + AttStaffLog *att = reinterpret_cast(element); if (attrType == "def") { att->SetDef(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttStaffDefVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_STAFFDEFVIS ) ) { + AttStaffDefVis *att = reinterpret_cast(element); if (attrType == "gridShow") { att->SetGridShow(att->StrToBool(attrValue)); return true; @@ -7939,36 +7939,36 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttStaffGrpVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_STAFFGRPVIS ) ) { + AttStaffGrpVis *att = reinterpret_cast(element); if (attrType == "barthru") { att->SetBarthru(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttStaffgroupingsym *att = dynamic_cast(element); + if (element->HasAttClass( ATT_STAFFGROUPINGSYM ) ) { + AttStaffgroupingsym *att = reinterpret_cast(element); if (attrType == "symbol") { att->SetSymbol(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttStaffident *att = dynamic_cast(element); + if (element->HasAttClass( ATT_STAFFIDENT ) ) { + AttStaffident *att = reinterpret_cast(element); if (attrType == "staff") { att->SetStaff(att->StrToInt(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttStaffloc *att = dynamic_cast(element); + if (element->HasAttClass( ATT_STAFFLOC ) ) { + AttStaffloc *att = reinterpret_cast(element); if (attrType == "loc") { att->SetLoc(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttStafflocPitched *att = dynamic_cast(element); + if (element->HasAttClass( ATT_STAFFLOCPITCHED ) ) { + AttStafflocPitched *att = reinterpret_cast(element); if (attrType == "ploc") { att->SetPloc(att->StrToPitchName(attrValue)); return true; @@ -7978,22 +7978,22 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttStartendid *att = dynamic_cast(element); + if (element->HasAttClass( ATT_STARTENDID ) ) { + AttStartendid *att = reinterpret_cast(element); if (attrType == "endid") { att->SetEndid(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttStartid *att = dynamic_cast(element); + if (element->HasAttClass( ATT_STARTID ) ) { + AttStartid *att = reinterpret_cast(element); if (attrType == "startid") { att->SetStartid(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttStemmed *att = dynamic_cast(element); + if (element->HasAttClass( ATT_STEMMED ) ) { + AttStemmed *att = reinterpret_cast(element); if (attrType == "stemDir") { att->SetStemDir(att->StrToStemDirection(attrValue)); return true; @@ -8015,8 +8015,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttSylLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SYLLOG ) ) { + AttSylLog *att = reinterpret_cast(element); if (attrType == "con") { att->SetCon(att->StrToCon(attrValue)); return true; @@ -8026,15 +8026,15 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttSyltext *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SYLTEXT ) ) { + AttSyltext *att = reinterpret_cast(element); if (attrType == "syl") { att->SetSyl(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttTextstyle *att = dynamic_cast(element); + if (element->HasAttClass( ATT_TEXTSTYLE ) ) { + AttTextstyle *att = reinterpret_cast(element); if (attrType == "textFam") { att->SetTextFam(att->StrToStr(attrValue)); return true; @@ -8056,22 +8056,22 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttTiepresent *att = dynamic_cast(element); + if (element->HasAttClass( ATT_TIEPRESENT ) ) { + AttTiepresent *att = reinterpret_cast(element); if (attrType == "tie") { att->SetTie(att->StrToTie(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttTimestampMusical *att = dynamic_cast(element); + if (element->HasAttClass( ATT_TIMESTAMPMUSICAL ) ) { + AttTimestampMusical *att = reinterpret_cast(element); if (attrType == "tstamp") { att->SetTstamp(att->StrToDbl(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttTimestampPerformed *att = dynamic_cast(element); + if (element->HasAttClass( ATT_TIMESTAMPPERFORMED ) ) { + AttTimestampPerformed *att = reinterpret_cast(element); if (attrType == "tstampGesInt") { att->SetTstampGes(att->StrToInt(attrValue)); return true; @@ -8081,15 +8081,15 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttTimestamp2Musical *att = dynamic_cast(element); + if (element->HasAttClass( ATT_TIMESTAMP2MUSICAL ) ) { + AttTimestamp2Musical *att = reinterpret_cast(element); if (attrType == "tstamp2") { att->SetTstamp2(att->StrToTstamp2(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttTransposition *att = dynamic_cast(element); + if (element->HasAttClass( ATT_TRANSPOSITION ) ) { + AttTransposition *att = reinterpret_cast(element); if (attrType == "transDiatDbl") { att->SetTransDiat(att->StrToDbl(attrValue)); return true; @@ -8099,15 +8099,15 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttTupletpresent *att = dynamic_cast(element); + if (element->HasAttClass( ATT_TUPLETPRESENT ) ) { + AttTupletpresent *att = reinterpret_cast(element); if (attrType == "tuplet") { att->SetTuplet(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttTyped *att = dynamic_cast(element); + if (element->HasAttClass( ATT_TYPED ) ) { + AttTyped *att = reinterpret_cast(element); if (attrType == "type") { att->SetType(att->StrToStr(attrValue)); return true; @@ -8117,8 +8117,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttTypography *att = dynamic_cast(element); + if (element->HasAttClass( ATT_TYPOGRAPHY ) ) { + AttTypography *att = reinterpret_cast(element); if (attrType == "fontfam") { att->SetFontfam(att->StrToStr(attrValue)); return true; @@ -8140,36 +8140,36 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttVisibility *att = dynamic_cast(element); + if (element->HasAttClass( ATT_VISIBILITY ) ) { + AttVisibility *att = reinterpret_cast(element); if (attrType == "visible") { att->SetVisible(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttVisualoffsetHo *att = dynamic_cast(element); + if (element->HasAttClass( ATT_VISUALOFFSETHO ) ) { + AttVisualoffsetHo *att = reinterpret_cast(element); if (attrType == "ho") { att->SetHo(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttVisualoffsetTo *att = dynamic_cast(element); + if (element->HasAttClass( ATT_VISUALOFFSETTO ) ) { + AttVisualoffsetTo *att = reinterpret_cast(element); if (attrType == "to") { att->SetTo(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttVisualoffsetVo *att = dynamic_cast(element); + if (element->HasAttClass( ATT_VISUALOFFSETVO ) ) { + AttVisualoffsetVo *att = reinterpret_cast(element); if (attrType == "vo") { att->SetVo(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttVisualoffset2Ho *att = dynamic_cast(element); + if (element->HasAttClass( ATT_VISUALOFFSET2HO ) ) { + AttVisualoffset2Ho *att = reinterpret_cast(element); if (attrType == "startho") { att->SetStartho(att->StrToStr(attrValue)); return true; @@ -8179,8 +8179,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttVisualoffset2To *att = dynamic_cast(element); + if (element->HasAttClass( ATT_VISUALOFFSET2TO ) ) { + AttVisualoffset2To *att = reinterpret_cast(element); if (attrType == "startto") { att->SetStartto(att->StrToStr(attrValue)); return true; @@ -8190,8 +8190,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttVisualoffset2Vo *att = dynamic_cast(element); + if (element->HasAttClass( ATT_VISUALOFFSET2VO ) ) { + AttVisualoffset2Vo *att = reinterpret_cast(element); if (attrType == "startvo") { att->SetStartvo(att->StrToStr(attrValue)); return true; @@ -8201,22 +8201,22 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttWhitespace *att = dynamic_cast(element); + if (element->HasAttClass( ATT_WHITESPACE ) ) { + AttWhitespace *att = reinterpret_cast(element); if (attrType == "space") { att->SetSpace(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttWidth *att = dynamic_cast(element); + if (element->HasAttClass( ATT_WIDTH ) ) { + AttWidth *att = reinterpret_cast(element); if (attrType == "width") { att->SetWidth(att->StrToStr(attrValue)); return true; } } - if (dynamic_cast(element) ) { - AttXy *att = dynamic_cast(element); + if (element->HasAttClass( ATT_XY ) ) { + AttXy *att = reinterpret_cast(element); if (attrType == "xDbl") { att->SetX(att->StrToDbl(attrValue)); return true; @@ -8226,8 +8226,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } } - if (dynamic_cast(element) ) { - AttXy2 *att = dynamic_cast(element); + if (element->HasAttClass( ATT_XY2 ) ) { + AttXy2 *att = reinterpret_cast(element); if (attrType == "x2Dbl") { att->SetX2(att->StrToDbl(attrValue)); return true; @@ -8242,50 +8242,50 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { - if (dynamic_cast(element) ) { - AttAccidLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_ACCIDLOG ) ) { + AttAccidLog *att = reinterpret_cast(element); if (att->HasFunc()) { attributes->push_back(std::make_pair("func", att->FuncToStr(att->GetFunc()))); } } - if (dynamic_cast(element) ) { - AttAccidental *att = dynamic_cast(element); + if (element->HasAttClass( ATT_ACCIDENTAL ) ) { + AttAccidental *att = reinterpret_cast(element); if (att->HasAccid()) { attributes->push_back(std::make_pair("accid", att->AccidentalExplicitToStr(att->GetAccid()))); } } - if (dynamic_cast(element) ) { - AttAccidentalPerformed *att = dynamic_cast(element); + if (element->HasAttClass( ATT_ACCIDENTALPERFORMED ) ) { + AttAccidentalPerformed *att = reinterpret_cast(element); if (att->HasAccidGes()) { attributes->push_back(std::make_pair("accidGes", att->StrToStr(att->GetAccidGes()))); } } - if (dynamic_cast(element) ) { - AttAltsym *att = dynamic_cast(element); + if (element->HasAttClass( ATT_ALTSYM ) ) { + AttAltsym *att = reinterpret_cast(element); if (att->HasAltsym()) { attributes->push_back(std::make_pair("altsym", att->StrToStr(att->GetAltsym()))); } } - if (dynamic_cast(element) ) { - AttArticulation *att = dynamic_cast(element); + if (element->HasAttClass( ATT_ARTICULATION ) ) { + AttArticulation *att = reinterpret_cast(element); if (att->HasArtic()) { attributes->push_back(std::make_pair("artic", att->StrToStr(att->GetArtic()))); } } - if (dynamic_cast(element) ) { - AttArticulationPerformed *att = dynamic_cast(element); + if (element->HasAttClass( ATT_ARTICULATIONPERFORMED ) ) { + AttArticulationPerformed *att = reinterpret_cast(element); if (att->HasArticGes()) { attributes->push_back(std::make_pair("articGes", att->StrToStr(att->GetArticGes()))); } } - if (dynamic_cast(element) ) { - AttAugmentdots *att = dynamic_cast(element); + if (element->HasAttClass( ATT_AUGMENTDOTS ) ) { + AttAugmentdots *att = reinterpret_cast(element); if (att->HasDots()) { attributes->push_back(std::make_pair("dots", att->IntToStr(att->GetDots()))); } } - if (dynamic_cast(element) ) { - AttAuthorized *att = dynamic_cast(element); + if (element->HasAttClass( ATT_AUTHORIZED ) ) { + AttAuthorized *att = reinterpret_cast(element); if (att->HasAuthority()) { attributes->push_back(std::make_pair("authority", att->StrToStr(att->GetAuthority()))); } @@ -8293,14 +8293,14 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("authURI", att->StrToStr(att->GetAuthURI()))); } } - if (dynamic_cast(element) ) { - AttBarLineLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_BARLINELOG ) ) { + AttBarLineLog *att = reinterpret_cast(element); if (att->HasRend()) { attributes->push_back(std::make_pair("rend", att->BarRenditionToStr(att->GetRend()))); } } - if (dynamic_cast(element) ) { - AttBarplacement *att = dynamic_cast(element); + if (element->HasAttClass( ATT_BARPLACEMENT ) ) { + AttBarplacement *att = reinterpret_cast(element); if (att->HasBarplace()) { attributes->push_back(std::make_pair("barplace", att->StrToStr(att->GetBarplace()))); } @@ -8308,8 +8308,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("taktplace", att->StrToStr(att->GetTaktplace()))); } } - if (dynamic_cast(element) ) { - AttBeamingVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_BEAMINGVIS ) ) { + AttBeamingVis *att = reinterpret_cast(element); if (att->HasBeamColor()) { attributes->push_back(std::make_pair("beamColor", att->StrToStr(att->GetBeamColor()))); } @@ -8320,38 +8320,38 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("beamSlopeDbl", att->DblToStr(att->GetBeamSlope()))); } } - if (dynamic_cast(element) ) { - AttBibl *att = dynamic_cast(element); + if (element->HasAttClass( ATT_BIBL ) ) { + AttBibl *att = reinterpret_cast(element); if (att->HasAnalog()) { attributes->push_back(std::make_pair("analog", att->StrToStr(att->GetAnalog()))); } } - if (dynamic_cast(element) ) { - AttCalendared *att = dynamic_cast(element); + if (element->HasAttClass( ATT_CALENDARED ) ) { + AttCalendared *att = reinterpret_cast(element); if (att->HasCalendar()) { attributes->push_back(std::make_pair("calendar", att->StrToStr(att->GetCalendar()))); } } - if (dynamic_cast(element) ) { - AttCanonical *att = dynamic_cast(element); + if (element->HasAttClass( ATT_CANONICAL ) ) { + AttCanonical *att = reinterpret_cast(element); if (att->HasDbkey()) { attributes->push_back(std::make_pair("dbkey", att->StrToStr(att->GetDbkey()))); } } - if (dynamic_cast(element) ) { - AttChordVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_CHORDVIS ) ) { + AttChordVis *att = reinterpret_cast(element); if (att->HasCluster()) { attributes->push_back(std::make_pair("cluster", att->StrToStr(att->GetCluster()))); } } - if (dynamic_cast(element) ) { - AttClefLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_CLEFLOG ) ) { + AttClefLog *att = reinterpret_cast(element); if (att->HasCautionary()) { attributes->push_back(std::make_pair("cautionary", att->StrToStr(att->GetCautionary()))); } } - if (dynamic_cast(element) ) { - AttCleffingLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_CLEFFINGLOG ) ) { + AttCleffingLog *att = reinterpret_cast(element); if (att->HasClefShape()) { attributes->push_back(std::make_pair("clefShape", att->ClefShapeToStr(att->GetClefShape()))); } @@ -8365,8 +8365,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("clefDisPlace", att->PlaceToStr(att->GetClefDisPlace()))); } } - if (dynamic_cast(element) ) { - AttCleffingVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_CLEFFINGVIS ) ) { + AttCleffingVis *att = reinterpret_cast(element); if (att->HasClefColor()) { attributes->push_back(std::make_pair("clefColor", att->StrToStr(att->GetClefColor()))); } @@ -8374,32 +8374,32 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("clefVisible", att->StrToStr(att->GetClefVisible()))); } } - if (dynamic_cast(element) ) { - AttClefshape *att = dynamic_cast(element); + if (element->HasAttClass( ATT_CLEFSHAPE ) ) { + AttClefshape *att = reinterpret_cast(element); if (att->HasShape()) { attributes->push_back(std::make_pair("shape", att->ClefShapeToStr(att->GetShape()))); } } - if (dynamic_cast(element) ) { - AttCoded *att = dynamic_cast(element); + if (element->HasAttClass( ATT_CODED ) ) { + AttCoded *att = reinterpret_cast(element); if (att->HasCode()) { attributes->push_back(std::make_pair("code", att->StrToStr(att->GetCode()))); } } - if (dynamic_cast(element) ) { - AttColor *att = dynamic_cast(element); + if (element->HasAttClass( ATT_COLOR ) ) { + AttColor *att = reinterpret_cast(element); if (att->HasColor()) { attributes->push_back(std::make_pair("color", att->StrToStr(att->GetColor()))); } } - if (dynamic_cast(element) ) { - AttColoration *att = dynamic_cast(element); + if (element->HasAttClass( ATT_COLORATION ) ) { + AttColoration *att = reinterpret_cast(element); if (att->HasColored()) { attributes->push_back(std::make_pair("colored", att->BoolToStr(att->GetColored()))); } } - if (dynamic_cast(element) ) { - AttCommon *att = dynamic_cast(element); + if (element->HasAttClass( ATT_COMMON ) ) { + AttCommon *att = reinterpret_cast(element); if (att->HasLabel()) { attributes->push_back(std::make_pair("label", att->StrToStr(att->GetLabel()))); } @@ -8410,8 +8410,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("base", att->StrToStr(att->GetBase()))); } } - if (dynamic_cast(element) ) { - AttCoordinated *att = dynamic_cast(element); + if (element->HasAttClass( ATT_COORDINATED ) ) { + AttCoordinated *att = reinterpret_cast(element); if (att->HasUlx()) { attributes->push_back(std::make_pair("ulxInt", att->IntToStr(att->GetUlx()))); } @@ -8425,8 +8425,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("lryInt", att->IntToStr(att->GetLry()))); } } - if (dynamic_cast(element) ) { - AttCurvature *att = dynamic_cast(element); + if (element->HasAttClass( ATT_CURVATURE ) ) { + AttCurvature *att = reinterpret_cast(element); if (att->HasBezier()) { attributes->push_back(std::make_pair("bezier", att->StrToStr(att->GetBezier()))); } @@ -8437,20 +8437,20 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("curvedir", att->StrToStr(att->GetCurvedir()))); } } - if (dynamic_cast(element) ) { - AttCurverend *att = dynamic_cast(element); + if (element->HasAttClass( ATT_CURVEREND ) ) { + AttCurverend *att = reinterpret_cast(element); if (att->HasRend()) { attributes->push_back(std::make_pair("rend", att->BarRenditionToStr(att->GetRend()))); } } - if (dynamic_cast(element) ) { - AttCustosLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_CUSTOSLOG ) ) { + AttCustosLog *att = reinterpret_cast(element); if (att->HasTarget()) { attributes->push_back(std::make_pair("target", att->StrToStr(att->GetTarget()))); } } - if (dynamic_cast(element) ) { - AttDatable *att = dynamic_cast(element); + if (element->HasAttClass( ATT_DATABLE ) ) { + AttDatable *att = reinterpret_cast(element); if (att->HasEnddate()) { attributes->push_back(std::make_pair("enddate", att->StrToStr(att->GetEnddate()))); } @@ -8467,20 +8467,20 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("startdate", att->StrToStr(att->GetStartdate()))); } } - if (dynamic_cast(element) ) { - AttDatapointing *att = dynamic_cast(element); + if (element->HasAttClass( ATT_DATAPOINTING ) ) { + AttDatapointing *att = reinterpret_cast(element); if (att->HasData()) { attributes->push_back(std::make_pair("data", att->StrToStr(att->GetData()))); } } - if (dynamic_cast(element) ) { - AttDeclaring *att = dynamic_cast(element); + if (element->HasAttClass( ATT_DECLARING ) ) { + AttDeclaring *att = reinterpret_cast(element); if (att->HasDecls()) { attributes->push_back(std::make_pair("decls", att->StrToStr(att->GetDecls()))); } } - if (dynamic_cast(element) ) { - AttDistances *att = dynamic_cast(element); + if (element->HasAttClass( ATT_DISTANCES ) ) { + AttDistances *att = reinterpret_cast(element); if (att->HasDynamDist()) { attributes->push_back(std::make_pair("dynamDist", att->StrToStr(att->GetDynamDist()))); } @@ -8491,20 +8491,20 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("textDist", att->StrToStr(att->GetTextDist()))); } } - if (dynamic_cast(element) ) { - AttDotLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_DOTLOG ) ) { + AttDotLog *att = reinterpret_cast(element); if (att->HasForm()) { attributes->push_back(std::make_pair("form", att->StrToStr(att->GetForm()))); } } - if (dynamic_cast(element) ) { - AttDurationAdditive *att = dynamic_cast(element); + if (element->HasAttClass( ATT_DURATIONADDITIVE ) ) { + AttDurationAdditive *att = reinterpret_cast(element); if (att->HasDur()) { attributes->push_back(std::make_pair("dur", att->DurToStr(att->GetDur()))); } } - if (dynamic_cast(element) ) { - AttDurationDefault *att = dynamic_cast(element); + if (element->HasAttClass( ATT_DURATIONDEFAULT ) ) { + AttDurationDefault *att = reinterpret_cast(element); if (att->HasDurDefault()) { attributes->push_back(std::make_pair("durDefault", att->StrToStr(att->GetDurDefault()))); } @@ -8515,20 +8515,20 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("numbaseDefaultInt", att->IntToStr(att->GetNumbaseDefault()))); } } - if (dynamic_cast(element) ) { - AttDurationMusical *att = dynamic_cast(element); + if (element->HasAttClass( ATT_DURATIONMUSICAL ) ) { + AttDurationMusical *att = reinterpret_cast(element); if (att->HasDur()) { attributes->push_back(std::make_pair("dur", att->DurToStr(att->GetDur()))); } } - if (dynamic_cast(element) ) { - AttDurationPerformed *att = dynamic_cast(element); + if (element->HasAttClass( ATT_DURATIONPERFORMED ) ) { + AttDurationPerformed *att = reinterpret_cast(element); if (att->HasDurGes()) { attributes->push_back(std::make_pair("durGes", att->DurToStr(att->GetDurGes()))); } } - if (dynamic_cast(element) ) { - AttDurationRatio *att = dynamic_cast(element); + if (element->HasAttClass( ATT_DURATIONRATIO ) ) { + AttDurationRatio *att = reinterpret_cast(element); if (att->HasNum()) { attributes->push_back(std::make_pair("num", att->IntToStr(att->GetNum()))); } @@ -8536,56 +8536,56 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("numbase", att->IntToStr(att->GetNumbase()))); } } - if (dynamic_cast(element) ) { - AttEnclosingchars *att = dynamic_cast(element); + if (element->HasAttClass( ATT_ENCLOSINGCHARS ) ) { + AttEnclosingchars *att = reinterpret_cast(element); if (att->HasEnclose()) { attributes->push_back(std::make_pair("enclose", att->StrToStr(att->GetEnclose()))); } } - if (dynamic_cast(element) ) { - AttFermatapresent *att = dynamic_cast(element); + if (element->HasAttClass( ATT_FERMATAPRESENT ) ) { + AttFermatapresent *att = reinterpret_cast(element); if (att->HasFermata()) { attributes->push_back(std::make_pair("fermata", att->PlaceToStr(att->GetFermata()))); } } - if (dynamic_cast(element) ) { - AttHandident *att = dynamic_cast(element); + if (element->HasAttClass( ATT_HANDIDENT ) ) { + AttHandident *att = reinterpret_cast(element); if (att->HasHand()) { attributes->push_back(std::make_pair("hand", att->StrToStr(att->GetHand()))); } } - if (dynamic_cast(element) ) { - AttHorizontalalign *att = dynamic_cast(element); + if (element->HasAttClass( ATT_HORIZONTALALIGN ) ) { + AttHorizontalalign *att = reinterpret_cast(element); if (att->HasHalign()) { attributes->push_back(std::make_pair("halign", att->StrToStr(att->GetHalign()))); } } - if (dynamic_cast(element) ) { - AttInstrumentident *att = dynamic_cast(element); + if (element->HasAttClass( ATT_INSTRUMENTIDENT ) ) { + AttInstrumentident *att = reinterpret_cast(element); if (att->HasInstr()) { attributes->push_back(std::make_pair("instr", att->StrToStr(att->GetInstr()))); } } - if (dynamic_cast(element) ) { - AttInternetmedia *att = dynamic_cast(element); + if (element->HasAttClass( ATT_INTERNETMEDIA ) ) { + AttInternetmedia *att = reinterpret_cast(element); if (att->HasMimetype()) { attributes->push_back(std::make_pair("mimetype", att->StrToStr(att->GetMimetype()))); } } - if (dynamic_cast(element) ) { - AttJoined *att = dynamic_cast(element); + if (element->HasAttClass( ATT_JOINED ) ) { + AttJoined *att = reinterpret_cast(element); if (att->HasJoin()) { attributes->push_back(std::make_pair("join", att->StrToStr(att->GetJoin()))); } } - if (dynamic_cast(element) ) { - AttKeySigLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_KEYSIGLOG ) ) { + AttKeySigLog *att = reinterpret_cast(element); if (att->HasMode()) { attributes->push_back(std::make_pair("mode", att->StrToStr(att->GetMode()))); } } - if (dynamic_cast(element) ) { - AttKeySigDefaultLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_KEYSIGDEFAULTLOG ) ) { + AttKeySigDefaultLog *att = reinterpret_cast(element); if (att->HasKeyAccid()) { attributes->push_back(std::make_pair("keyAccid", att->AccidentalImplicitToStr(att->GetKeyAccid()))); } @@ -8602,8 +8602,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("keySigMixed", att->StrToStr(att->GetKeySigMixed()))); } } - if (dynamic_cast(element) ) { - AttKeySigDefaultVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_KEYSIGDEFAULTVIS ) ) { + AttKeySigDefaultVis *att = reinterpret_cast(element); if (att->HasKeySigShow()) { attributes->push_back(std::make_pair("keySigShow", att->StrToStr(att->GetKeySigShow()))); } @@ -8611,44 +8611,44 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("keySigShowchange", att->StrToStr(att->GetKeySigShowchange()))); } } - if (dynamic_cast(element) ) { - AttLabelsAddl *att = dynamic_cast(element); + if (element->HasAttClass( ATT_LABELSADDL ) ) { + AttLabelsAddl *att = reinterpret_cast(element); if (att->HasLabelAbbr()) { attributes->push_back(std::make_pair("labelAbbr", att->StrToStr(att->GetLabelAbbr()))); } } - if (dynamic_cast(element) ) { - AttLang *att = dynamic_cast(element); + if (element->HasAttClass( ATT_LANG ) ) { + AttLang *att = reinterpret_cast(element); if (att->HasLang()) { attributes->push_back(std::make_pair("lang", att->StrToStr(att->GetLang()))); } } - if (dynamic_cast(element) ) { - AttLayerLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_LAYERLOG ) ) { + AttLayerLog *att = reinterpret_cast(element); if (att->HasDef()) { attributes->push_back(std::make_pair("def", att->StrToStr(att->GetDef()))); } } - if (dynamic_cast(element) ) { - AttLayerident *att = dynamic_cast(element); + if (element->HasAttClass( ATT_LAYERIDENT ) ) { + AttLayerident *att = reinterpret_cast(element); if (att->HasLayer()) { attributes->push_back(std::make_pair("layer", att->StrToStr(att->GetLayer()))); } } - if (dynamic_cast(element) ) { - AttLineloc *att = dynamic_cast(element); + if (element->HasAttClass( ATT_LINELOC ) ) { + AttLineloc *att = reinterpret_cast(element); if (att->HasLine()) { attributes->push_back(std::make_pair("line", att->IntToStr(att->GetLine()))); } } - if (dynamic_cast(element) ) { - AttLinerend *att = dynamic_cast(element); + if (element->HasAttClass( ATT_LINEREND ) ) { + AttLinerend *att = reinterpret_cast(element); if (att->HasRend()) { attributes->push_back(std::make_pair("rend", att->BarRenditionToStr(att->GetRend()))); } } - if (dynamic_cast(element) ) { - AttLyricstyle *att = dynamic_cast(element); + if (element->HasAttClass( ATT_LYRICSTYLE ) ) { + AttLyricstyle *att = reinterpret_cast(element); if (att->HasLyricAlign()) { attributes->push_back(std::make_pair("lyricAlign", att->StrToStr(att->GetLyricAlign()))); } @@ -8668,8 +8668,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("lyricWeight", att->StrToStr(att->GetLyricWeight()))); } } - if (dynamic_cast(element) ) { - AttMeasureLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MEASURELOG ) ) { + AttMeasureLog *att = reinterpret_cast(element); if (att->HasLeft()) { attributes->push_back(std::make_pair("left", att->BarRenditionToStr(att->GetLeft()))); } @@ -8677,14 +8677,14 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("right", att->BarRenditionToStr(att->GetRight()))); } } - if (dynamic_cast(element) ) { - AttMeasurement *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MEASUREMENT ) ) { + AttMeasurement *att = reinterpret_cast(element); if (att->HasUnit()) { attributes->push_back(std::make_pair("unit", att->IntToStr(att->GetUnit()))); } } - if (dynamic_cast(element) ) { - AttMediabounds *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MEDIABOUNDS ) ) { + AttMediabounds *att = reinterpret_cast(element); if (att->HasBegin()) { attributes->push_back(std::make_pair("begin", att->StrToStr(att->GetBegin()))); } @@ -8695,14 +8695,14 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("betype", att->StrToStr(att->GetBetype()))); } } - if (dynamic_cast(element) ) { - AttMedium *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MEDIUM ) ) { + AttMedium *att = reinterpret_cast(element); if (att->HasMedium()) { attributes->push_back(std::make_pair("medium", att->StrToStr(att->GetMedium()))); } } - if (dynamic_cast(element) ) { - AttMeiversion *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MEIVERSION ) ) { + AttMeiversion *att = reinterpret_cast(element); if (att->HasMeiversion()) { attributes->push_back(std::make_pair("meiversion", att->StrToStr(att->GetMeiversion()))); } @@ -8710,8 +8710,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("meiversionNum", att->StrToStr(att->GetMeiversionNum()))); } } - if (dynamic_cast(element) ) { - AttMensurLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MENSURLOG ) ) { + AttMensurLog *att = reinterpret_cast(element); if (att->HasDot()) { attributes->push_back(std::make_pair("dot", att->BoolToStr(att->GetDot()))); } @@ -8719,8 +8719,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("sign", att->MensurationSignToStr(att->GetSign()))); } } - if (dynamic_cast(element) ) { - AttMeterSigLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_METERSIGLOG ) ) { + AttMeterSigLog *att = reinterpret_cast(element); if (att->HasCount()) { attributes->push_back(std::make_pair("count", att->IntToStr(att->GetCount()))); } @@ -8731,14 +8731,14 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("unit", att->IntToStr(att->GetUnit()))); } } - if (dynamic_cast(element) ) { - AttMeterSigVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_METERSIGVIS ) ) { + AttMeterSigVis *att = reinterpret_cast(element); if (att->HasRend()) { attributes->push_back(std::make_pair("rend", att->BarRenditionToStr(att->GetRend()))); } } - if (dynamic_cast(element) ) { - AttMeterSigDefaultLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_METERSIGDEFAULTLOG ) ) { + AttMeterSigDefaultLog *att = reinterpret_cast(element); if (att->HasMeterCount()) { attributes->push_back(std::make_pair("meterCount", att->IntToStr(att->GetMeterCount()))); } @@ -8746,8 +8746,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("meterUnit", att->IntToStr(att->GetMeterUnit()))); } } - if (dynamic_cast(element) ) { - AttMeterSigDefaultVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_METERSIGDEFAULTVIS ) ) { + AttMeterSigDefaultVis *att = reinterpret_cast(element); if (att->HasMeterRend()) { attributes->push_back(std::make_pair("meterRend", att->StrToStr(att->GetMeterRend()))); } @@ -8758,14 +8758,14 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("meterSym", att->MeterSignToStr(att->GetMeterSym()))); } } - if (dynamic_cast(element) ) { - AttMeterconformance *att = dynamic_cast(element); + if (element->HasAttClass( ATT_METERCONFORMANCE ) ) { + AttMeterconformance *att = reinterpret_cast(element); if (att->HasMetcon()) { attributes->push_back(std::make_pair("metcon", att->StrToStr(att->GetMetcon()))); } } - if (dynamic_cast(element) ) { - AttMeterconformanceBar *att = dynamic_cast(element); + if (element->HasAttClass( ATT_METERCONFORMANCEBAR ) ) { + AttMeterconformanceBar *att = reinterpret_cast(element); if (att->HasMetcon()) { attributes->push_back(std::make_pair("metcon", att->StrToStr(att->GetMetcon()))); } @@ -8773,8 +8773,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("control", att->StrToStr(att->GetControl()))); } } - if (dynamic_cast(element) ) { - AttMmtempo *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MMTEMPO ) ) { + AttMmtempo *att = reinterpret_cast(element); if (att->HasMm()) { attributes->push_back(std::make_pair("mm", att->StrToStr(att->GetMm()))); } @@ -8785,14 +8785,14 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("mmDots", att->StrToStr(att->GetMmDots()))); } } - if (dynamic_cast(element) ) { - AttMultinummeasures *att = dynamic_cast(element); + if (element->HasAttClass( ATT_MULTINUMMEASURES ) ) { + AttMultinummeasures *att = reinterpret_cast(element); if (att->HasMultiNumber()) { attributes->push_back(std::make_pair("multiNumber", att->StrToStr(att->GetMultiNumber()))); } } - if (dynamic_cast(element) ) { - AttName *att = dynamic_cast(element); + if (element->HasAttClass( ATT_NAME ) ) { + AttName *att = reinterpret_cast(element); if (att->HasNymref()) { attributes->push_back(std::make_pair("nymref", att->StrToStr(att->GetNymref()))); } @@ -8800,8 +8800,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("role", att->StrToStr(att->GetRole()))); } } - if (dynamic_cast(element) ) { - AttNoteGes *att = dynamic_cast(element); + if (element->HasAttClass( ATT_NOTEGES ) ) { + AttNoteGes *att = reinterpret_cast(element); if (att->HasOctGes()) { attributes->push_back(std::make_pair("octGes", att->StrToStr(att->GetOctGes()))); } @@ -8812,26 +8812,26 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("pnum", att->StrToStr(att->GetPnum()))); } } - if (dynamic_cast(element) ) { - AttNoteVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_NOTEVIS ) ) { + AttNoteVis *att = reinterpret_cast(element); if (att->HasHeadshape()) { attributes->push_back(std::make_pair("headshape", att->StrToStr(att->GetHeadshape()))); } } - if (dynamic_cast(element) ) { - AttOctave *att = dynamic_cast(element); + if (element->HasAttClass( ATT_OCTAVE ) ) { + AttOctave *att = reinterpret_cast(element); if (att->HasOct()) { attributes->push_back(std::make_pair("oct", att->IntToStr(att->GetOct()))); } } - if (dynamic_cast(element) ) { - AttOctavedefault *att = dynamic_cast(element); + if (element->HasAttClass( ATT_OCTAVEDEFAULT ) ) { + AttOctavedefault *att = reinterpret_cast(element); if (att->HasOctaveDefault()) { attributes->push_back(std::make_pair("octaveDefault", att->StrToStr(att->GetOctaveDefault()))); } } - if (dynamic_cast(element) ) { - AttOctavedisplacement *att = dynamic_cast(element); + if (element->HasAttClass( ATT_OCTAVEDISPLACEMENT ) ) { + AttOctavedisplacement *att = reinterpret_cast(element); if (att->HasDis()) { attributes->push_back(std::make_pair("dis", att->OctaveDisToStr(att->GetDis()))); } @@ -8839,38 +8839,38 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("disPlace", att->PlaceToStr(att->GetDisPlace()))); } } - if (dynamic_cast(element) ) { - AttOnelinestaff *att = dynamic_cast(element); + if (element->HasAttClass( ATT_ONELINESTAFF ) ) { + AttOnelinestaff *att = reinterpret_cast(element); if (att->HasOntheline()) { attributes->push_back(std::make_pair("ontheline", att->StrToStr(att->GetOntheline()))); } } - if (dynamic_cast(element) ) { - AttPadLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_PADLOG ) ) { + AttPadLog *att = reinterpret_cast(element); if (att->HasNum()) { attributes->push_back(std::make_pair("num", att->IntToStr(att->GetNum()))); } } - if (dynamic_cast(element) ) { - AttPbVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_PBVIS ) ) { + AttPbVis *att = reinterpret_cast(element); if (att->HasFunc()) { attributes->push_back(std::make_pair("func", att->FuncToStr(att->GetFunc()))); } } - if (dynamic_cast(element) ) { - AttPitch *att = dynamic_cast(element); + if (element->HasAttClass( ATT_PITCH ) ) { + AttPitch *att = reinterpret_cast(element); if (att->HasPname()) { attributes->push_back(std::make_pair("pname", att->PitchNameToStr(att->GetPname()))); } } - if (dynamic_cast(element) ) { - AttPlacement *att = dynamic_cast(element); + if (element->HasAttClass( ATT_PLACEMENT ) ) { + AttPlacement *att = reinterpret_cast(element); if (att->HasPlace()) { attributes->push_back(std::make_pair("place", att->StaffRelToStr(att->GetPlace()))); } } - if (dynamic_cast(element) ) { - AttPlist *att = dynamic_cast(element); + if (element->HasAttClass( ATT_PLIST ) ) { + AttPlist *att = reinterpret_cast(element); if (att->HasPlist()) { attributes->push_back(std::make_pair("plist", att->StrToStr(att->GetPlist()))); } @@ -8878,8 +8878,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("evaluate", att->StrToStr(att->GetEvaluate()))); } } - if (dynamic_cast(element) ) { - AttPointing *att = dynamic_cast(element); + if (element->HasAttClass( ATT_POINTING ) ) { + AttPointing *att = reinterpret_cast(element); if (att->HasActuate()) { attributes->push_back(std::make_pair("actuate", att->StrToStr(att->GetActuate()))); } @@ -8899,32 +8899,32 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("title", att->StrToStr(att->GetTitle()))); } } - if (dynamic_cast(element) ) { - AttRelativesize *att = dynamic_cast(element); + if (element->HasAttClass( ATT_RELATIVESIZE ) ) { + AttRelativesize *att = reinterpret_cast(element); if (att->HasSize()) { attributes->push_back(std::make_pair("size", att->StrToStr(att->GetSize()))); } } - if (dynamic_cast(element) ) { - AttResponsibility *att = dynamic_cast(element); + if (element->HasAttClass( ATT_RESPONSIBILITY ) ) { + AttResponsibility *att = reinterpret_cast(element); if (att->HasResp()) { attributes->push_back(std::make_pair("resp", att->StrToStr(att->GetResp()))); } } - if (dynamic_cast(element) ) { - AttSbVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SBVIS ) ) { + AttSbVis *att = reinterpret_cast(element); if (att->HasRend()) { attributes->push_back(std::make_pair("rend", att->BarRenditionToStr(att->GetRend()))); } } - if (dynamic_cast(element) ) { - AttScalable *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SCALABLE ) ) { + AttScalable *att = reinterpret_cast(element); if (att->HasScale()) { attributes->push_back(std::make_pair("scale", att->StrToStr(att->GetScale()))); } } - if (dynamic_cast(element) ) { - AttScoreDefGes *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SCOREDEFGES ) ) { + AttScoreDefGes *att = reinterpret_cast(element); if (att->HasTunePname()) { attributes->push_back(std::make_pair("tunePname", att->StrToStr(att->GetTunePname()))); } @@ -8935,8 +8935,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("tuneTemper", att->StrToStr(att->GetTuneTemper()))); } } - if (dynamic_cast(element) ) { - AttScoreDefVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SCOREDEFVIS ) ) { + AttScoreDefVis *att = reinterpret_cast(element); if (att->HasEndingRend()) { attributes->push_back(std::make_pair("endingRend", att->StrToStr(att->GetEndingRend()))); } @@ -9001,44 +9001,44 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("vuHeight", att->StrToStr(att->GetVuHeight()))); } } - if (dynamic_cast(element) ) { - AttSectionVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SECTIONVIS ) ) { + AttSectionVis *att = reinterpret_cast(element); if (att->HasRestart()) { attributes->push_back(std::make_pair("restart", att->StrToStr(att->GetRestart()))); } } - if (dynamic_cast(element) ) { - AttSequence *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SEQUENCE ) ) { + AttSequence *att = reinterpret_cast(element); if (att->HasSeq()) { attributes->push_back(std::make_pair("seqInt", att->IntToStr(att->GetSeq()))); } } - if (dynamic_cast(element) ) { - AttSlashcount *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SLASHCOUNT ) ) { + AttSlashcount *att = reinterpret_cast(element); if (att->HasSlash()) { attributes->push_back(std::make_pair("slash", att->IntToStr(att->GetSlash()))); } } - if (dynamic_cast(element) ) { - AttSlurpresent *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SLURPRESENT ) ) { + AttSlurpresent *att = reinterpret_cast(element); if (att->HasSlur()) { attributes->push_back(std::make_pair("slur", att->StrToStr(att->GetSlur()))); } } - if (dynamic_cast(element) ) { - AttSpaceVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SPACEVIS ) ) { + AttSpaceVis *att = reinterpret_cast(element); if (att->HasCompressable()) { attributes->push_back(std::make_pair("compressable", att->StrToStr(att->GetCompressable()))); } } - if (dynamic_cast(element) ) { - AttStaffLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_STAFFLOG ) ) { + AttStaffLog *att = reinterpret_cast(element); if (att->HasDef()) { attributes->push_back(std::make_pair("def", att->StrToStr(att->GetDef()))); } } - if (dynamic_cast(element) ) { - AttStaffDefVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_STAFFDEFVIS ) ) { + AttStaffDefVis *att = reinterpret_cast(element); if (att->HasGridShow()) { attributes->push_back(std::make_pair("gridShow", att->BoolToStr(att->GetGridShow()))); } @@ -9058,32 +9058,32 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("spacing", att->StrToStr(att->GetSpacing()))); } } - if (dynamic_cast(element) ) { - AttStaffGrpVis *att = dynamic_cast(element); + if (element->HasAttClass( ATT_STAFFGRPVIS ) ) { + AttStaffGrpVis *att = reinterpret_cast(element); if (att->HasBarthru()) { attributes->push_back(std::make_pair("barthru", att->StrToStr(att->GetBarthru()))); } } - if (dynamic_cast(element) ) { - AttStaffgroupingsym *att = dynamic_cast(element); + if (element->HasAttClass( ATT_STAFFGROUPINGSYM ) ) { + AttStaffgroupingsym *att = reinterpret_cast(element); if (att->HasSymbol()) { attributes->push_back(std::make_pair("symbol", att->StrToStr(att->GetSymbol()))); } } - if (dynamic_cast(element) ) { - AttStaffident *att = dynamic_cast(element); + if (element->HasAttClass( ATT_STAFFIDENT ) ) { + AttStaffident *att = reinterpret_cast(element); if (att->HasStaff()) { attributes->push_back(std::make_pair("staff", att->IntToStr(att->GetStaff()))); } } - if (dynamic_cast(element) ) { - AttStaffloc *att = dynamic_cast(element); + if (element->HasAttClass( ATT_STAFFLOC ) ) { + AttStaffloc *att = reinterpret_cast(element); if (att->HasLoc()) { attributes->push_back(std::make_pair("loc", att->StrToStr(att->GetLoc()))); } } - if (dynamic_cast(element) ) { - AttStafflocPitched *att = dynamic_cast(element); + if (element->HasAttClass( ATT_STAFFLOCPITCHED ) ) { + AttStafflocPitched *att = reinterpret_cast(element); if (att->HasPloc()) { attributes->push_back(std::make_pair("ploc", att->PitchNameToStr(att->GetPloc()))); } @@ -9091,20 +9091,20 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("oloc", att->IntToStr(att->GetOloc()))); } } - if (dynamic_cast(element) ) { - AttStartendid *att = dynamic_cast(element); + if (element->HasAttClass( ATT_STARTENDID ) ) { + AttStartendid *att = reinterpret_cast(element); if (att->HasEndid()) { attributes->push_back(std::make_pair("endid", att->StrToStr(att->GetEndid()))); } } - if (dynamic_cast(element) ) { - AttStartid *att = dynamic_cast(element); + if (element->HasAttClass( ATT_STARTID ) ) { + AttStartid *att = reinterpret_cast(element); if (att->HasStartid()) { attributes->push_back(std::make_pair("startid", att->StrToStr(att->GetStartid()))); } } - if (dynamic_cast(element) ) { - AttStemmed *att = dynamic_cast(element); + if (element->HasAttClass( ATT_STEMMED ) ) { + AttStemmed *att = reinterpret_cast(element); if (att->HasStemDir()) { attributes->push_back(std::make_pair("stemDir", att->StemDirectionToStr(att->GetStemDir()))); } @@ -9121,8 +9121,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("stemY", att->IntToStr(att->GetStemY()))); } } - if (dynamic_cast(element) ) { - AttSylLog *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SYLLOG ) ) { + AttSylLog *att = reinterpret_cast(element); if (att->HasCon()) { attributes->push_back(std::make_pair("con", att->ConToStr(att->GetCon()))); } @@ -9130,14 +9130,14 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("wordpos", att->WordPosToStr(att->GetWordpos()))); } } - if (dynamic_cast(element) ) { - AttSyltext *att = dynamic_cast(element); + if (element->HasAttClass( ATT_SYLTEXT ) ) { + AttSyltext *att = reinterpret_cast(element); if (att->HasSyl()) { attributes->push_back(std::make_pair("syl", att->StrToStr(att->GetSyl()))); } } - if (dynamic_cast(element) ) { - AttTextstyle *att = dynamic_cast(element); + if (element->HasAttClass( ATT_TEXTSTYLE ) ) { + AttTextstyle *att = reinterpret_cast(element); if (att->HasTextFam()) { attributes->push_back(std::make_pair("textFam", att->StrToStr(att->GetTextFam()))); } @@ -9154,20 +9154,20 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("textWeight", att->StrToStr(att->GetTextWeight()))); } } - if (dynamic_cast(element) ) { - AttTiepresent *att = dynamic_cast(element); + if (element->HasAttClass( ATT_TIEPRESENT ) ) { + AttTiepresent *att = reinterpret_cast(element); if (att->HasTie()) { attributes->push_back(std::make_pair("tie", att->TieToStr(att->GetTie()))); } } - if (dynamic_cast(element) ) { - AttTimestampMusical *att = dynamic_cast(element); + if (element->HasAttClass( ATT_TIMESTAMPMUSICAL ) ) { + AttTimestampMusical *att = reinterpret_cast(element); if (att->HasTstamp()) { attributes->push_back(std::make_pair("tstamp", att->DblToStr(att->GetTstamp()))); } } - if (dynamic_cast(element) ) { - AttTimestampPerformed *att = dynamic_cast(element); + if (element->HasAttClass( ATT_TIMESTAMPPERFORMED ) ) { + AttTimestampPerformed *att = reinterpret_cast(element); if (att->HasTstampGes()) { attributes->push_back(std::make_pair("tstampGesInt", att->IntToStr(att->GetTstampGes()))); } @@ -9175,14 +9175,14 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("tstampReal", att->StrToStr(att->GetTstampReal()))); } } - if (dynamic_cast(element) ) { - AttTimestamp2Musical *att = dynamic_cast(element); + if (element->HasAttClass( ATT_TIMESTAMP2MUSICAL ) ) { + AttTimestamp2Musical *att = reinterpret_cast(element); if (att->HasTstamp2()) { attributes->push_back(std::make_pair("tstamp2", att->Tstamp2ToStr(att->GetTstamp2()))); } } - if (dynamic_cast(element) ) { - AttTransposition *att = dynamic_cast(element); + if (element->HasAttClass( ATT_TRANSPOSITION ) ) { + AttTransposition *att = reinterpret_cast(element); if (att->HasTransDiat()) { attributes->push_back(std::make_pair("transDiatDbl", att->DblToStr(att->GetTransDiat()))); } @@ -9190,14 +9190,14 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("transSemiDbl", att->DblToStr(att->GetTransSemi()))); } } - if (dynamic_cast(element) ) { - AttTupletpresent *att = dynamic_cast(element); + if (element->HasAttClass( ATT_TUPLETPRESENT ) ) { + AttTupletpresent *att = reinterpret_cast(element); if (att->HasTuplet()) { attributes->push_back(std::make_pair("tuplet", att->StrToStr(att->GetTuplet()))); } } - if (dynamic_cast(element) ) { - AttTyped *att = dynamic_cast(element); + if (element->HasAttClass( ATT_TYPED ) ) { + AttTyped *att = reinterpret_cast(element); if (att->HasType()) { attributes->push_back(std::make_pair("type", att->StrToStr(att->GetType()))); } @@ -9205,8 +9205,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("subtype", att->StrToStr(att->GetSubtype()))); } } - if (dynamic_cast(element) ) { - AttTypography *att = dynamic_cast(element); + if (element->HasAttClass( ATT_TYPOGRAPHY ) ) { + AttTypography *att = reinterpret_cast(element); if (att->HasFontfam()) { attributes->push_back(std::make_pair("fontfam", att->StrToStr(att->GetFontfam()))); } @@ -9223,32 +9223,32 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("fontweight", att->FontweightToStr(att->GetFontweight()))); } } - if (dynamic_cast(element) ) { - AttVisibility *att = dynamic_cast(element); + if (element->HasAttClass( ATT_VISIBILITY ) ) { + AttVisibility *att = reinterpret_cast(element); if (att->HasVisible()) { attributes->push_back(std::make_pair("visible", att->StrToStr(att->GetVisible()))); } } - if (dynamic_cast(element) ) { - AttVisualoffsetHo *att = dynamic_cast(element); + if (element->HasAttClass( ATT_VISUALOFFSETHO ) ) { + AttVisualoffsetHo *att = reinterpret_cast(element); if (att->HasHo()) { attributes->push_back(std::make_pair("ho", att->StrToStr(att->GetHo()))); } } - if (dynamic_cast(element) ) { - AttVisualoffsetTo *att = dynamic_cast(element); + if (element->HasAttClass( ATT_VISUALOFFSETTO ) ) { + AttVisualoffsetTo *att = reinterpret_cast(element); if (att->HasTo()) { attributes->push_back(std::make_pair("to", att->StrToStr(att->GetTo()))); } } - if (dynamic_cast(element) ) { - AttVisualoffsetVo *att = dynamic_cast(element); + if (element->HasAttClass( ATT_VISUALOFFSETVO ) ) { + AttVisualoffsetVo *att = reinterpret_cast(element); if (att->HasVo()) { attributes->push_back(std::make_pair("vo", att->StrToStr(att->GetVo()))); } } - if (dynamic_cast(element) ) { - AttVisualoffset2Ho *att = dynamic_cast(element); + if (element->HasAttClass( ATT_VISUALOFFSET2HO ) ) { + AttVisualoffset2Ho *att = reinterpret_cast(element); if (att->HasStartho()) { attributes->push_back(std::make_pair("startho", att->StrToStr(att->GetStartho()))); } @@ -9256,8 +9256,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("endho", att->StrToStr(att->GetEndho()))); } } - if (dynamic_cast(element) ) { - AttVisualoffset2To *att = dynamic_cast(element); + if (element->HasAttClass( ATT_VISUALOFFSET2TO ) ) { + AttVisualoffset2To *att = reinterpret_cast(element); if (att->HasStartto()) { attributes->push_back(std::make_pair("startto", att->StrToStr(att->GetStartto()))); } @@ -9265,8 +9265,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("endto", att->StrToStr(att->GetEndto()))); } } - if (dynamic_cast(element) ) { - AttVisualoffset2Vo *att = dynamic_cast(element); + if (element->HasAttClass( ATT_VISUALOFFSET2VO ) ) { + AttVisualoffset2Vo *att = reinterpret_cast(element); if (att->HasStartvo()) { attributes->push_back(std::make_pair("startvo", att->StrToStr(att->GetStartvo()))); } @@ -9274,20 +9274,20 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("endvo", att->StrToStr(att->GetEndvo()))); } } - if (dynamic_cast(element) ) { - AttWhitespace *att = dynamic_cast(element); + if (element->HasAttClass( ATT_WHITESPACE ) ) { + AttWhitespace *att = reinterpret_cast(element); if (att->HasSpace()) { attributes->push_back(std::make_pair("space", att->StrToStr(att->GetSpace()))); } } - if (dynamic_cast(element) ) { - AttWidth *att = dynamic_cast(element); + if (element->HasAttClass( ATT_WIDTH ) ) { + AttWidth *att = reinterpret_cast(element); if (att->HasWidth()) { attributes->push_back(std::make_pair("width", att->StrToStr(att->GetWidth()))); } } - if (dynamic_cast(element) ) { - AttXy *att = dynamic_cast(element); + if (element->HasAttClass( ATT_XY ) ) { + AttXy *att = reinterpret_cast(element); if (att->HasX()) { attributes->push_back(std::make_pair("xDbl", att->DblToStr(att->GetX()))); } @@ -9295,8 +9295,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("yDbl", att->DblToStr(att->GetY()))); } } - if (dynamic_cast(element) ) { - AttXy2 *att = dynamic_cast(element); + if (element->HasAttClass( ATT_XY2 ) ) { + AttXy2 *att = reinterpret_cast(element); if (att->HasX2()) { attributes->push_back(std::make_pair("x2Dbl", att->DblToStr(att->GetX2()))); } diff --git a/libmei/atts_shared.h b/libmei/atts_shared.h index 0fcab69384a..2a14c5bfac2 100644 --- a/libmei/atts_shared.h +++ b/libmei/atts_shared.h @@ -28,6 +28,8 @@ namespace vrv { // AttAccidLog //---------------------------------------------------------------------------- +#define ATT_ACCIDLOG 77 + class AttAccidLog: public Att { public: @@ -66,6 +68,8 @@ class AttAccidLog: public Att // AttAccidental //---------------------------------------------------------------------------- +#define ATT_ACCIDENTAL 78 + class AttAccidental: public Att { public: @@ -104,6 +108,8 @@ class AttAccidental: public Att // AttAccidentalPerformed //---------------------------------------------------------------------------- +#define ATT_ACCIDENTALPERFORMED 79 + class AttAccidentalPerformed: public Att { public: @@ -145,6 +151,8 @@ class AttAccidentalPerformed: public Att // AttAltsym //---------------------------------------------------------------------------- +#define ATT_ALTSYM 80 + class AttAltsym: public Att { public: @@ -186,6 +194,8 @@ class AttAltsym: public Att // AttArticulation //---------------------------------------------------------------------------- +#define ATT_ARTICULATION 81 + class AttArticulation: public Att { public: @@ -230,6 +240,8 @@ class AttArticulation: public Att // AttArticulationPerformed //---------------------------------------------------------------------------- +#define ATT_ARTICULATIONPERFORMED 82 + class AttArticulationPerformed: public Att { public: @@ -268,6 +280,8 @@ class AttArticulationPerformed: public Att // AttAugmentdots //---------------------------------------------------------------------------- +#define ATT_AUGMENTDOTS 83 + class AttAugmentdots: public Att { public: @@ -306,6 +320,8 @@ class AttAugmentdots: public Att // AttAuthorized //---------------------------------------------------------------------------- +#define ATT_AUTHORIZED 84 + class AttAuthorized: public Att { public: @@ -357,6 +373,8 @@ class AttAuthorized: public Att // AttBarLineLog //---------------------------------------------------------------------------- +#define ATT_BARLINELOG 85 + class AttBarLineLog: public Att { public: @@ -395,6 +413,8 @@ class AttBarLineLog: public Att // AttBarplacement //---------------------------------------------------------------------------- +#define ATT_BARPLACEMENT 86 + class AttBarplacement: public Att { public: @@ -449,6 +469,8 @@ class AttBarplacement: public Att // AttBeamingVis //---------------------------------------------------------------------------- +#define ATT_BEAMINGVIS 87 + class AttBeamingVis: public Att { public: @@ -501,6 +523,8 @@ class AttBeamingVis: public Att // AttBibl //---------------------------------------------------------------------------- +#define ATT_BIBL 88 + class AttBibl: public Att { public: @@ -542,6 +566,8 @@ class AttBibl: public Att // AttCalendared //---------------------------------------------------------------------------- +#define ATT_CALENDARED 89 + class AttCalendared: public Att { public: @@ -583,6 +609,8 @@ class AttCalendared: public Att // AttCanonical //---------------------------------------------------------------------------- +#define ATT_CANONICAL 90 + class AttCanonical: public Att { public: @@ -621,6 +649,8 @@ class AttCanonical: public Att // AttChordVis //---------------------------------------------------------------------------- +#define ATT_CHORDVIS 91 + class AttChordVis: public Att { public: @@ -663,6 +693,8 @@ class AttChordVis: public Att // AttClefLog //---------------------------------------------------------------------------- +#define ATT_CLEFLOG 92 + class AttClefLog: public Att { public: @@ -704,6 +736,8 @@ class AttClefLog: public Att // AttCleffingLog //---------------------------------------------------------------------------- +#define ATT_CLEFFINGLOG 93 + class AttCleffingLog: public Att { public: @@ -767,6 +801,8 @@ class AttCleffingLog: public Att // AttCleffingVis //---------------------------------------------------------------------------- +#define ATT_CLEFFINGVIS 94 + class AttCleffingVis: public Att { public: @@ -812,6 +848,8 @@ class AttCleffingVis: public Att // AttClefshape //---------------------------------------------------------------------------- +#define ATT_CLEFSHAPE 95 + class AttClefshape: public Att { public: @@ -850,6 +888,8 @@ class AttClefshape: public Att // AttCoded //---------------------------------------------------------------------------- +#define ATT_CODED 96 + class AttCoded: public Att { public: @@ -888,6 +928,8 @@ class AttCoded: public Att // AttColor //---------------------------------------------------------------------------- +#define ATT_COLOR 97 + class AttColor: public Att { public: @@ -929,6 +971,8 @@ class AttColor: public Att // AttColoration //---------------------------------------------------------------------------- +#define ATT_COLORATION 98 + class AttColoration: public Att { public: @@ -974,6 +1018,8 @@ class AttColoration: public Att // AttCommon //---------------------------------------------------------------------------- +#define ATT_COMMON 99 + class AttCommon: public Att { public: @@ -1032,6 +1078,8 @@ class AttCommon: public Att // AttCoordinated //---------------------------------------------------------------------------- +#define ATT_COORDINATED 100 + class AttCoordinated: public Att { public: @@ -1091,6 +1139,8 @@ class AttCoordinated: public Att // AttCurvature //---------------------------------------------------------------------------- +#define ATT_CURVATURE 101 + class AttCurvature: public Att { public: @@ -1151,6 +1201,8 @@ class AttCurvature: public Att // AttCurverend //---------------------------------------------------------------------------- +#define ATT_CURVEREND 102 + class AttCurverend: public Att { public: @@ -1189,6 +1241,8 @@ class AttCurverend: public Att // AttCustosLog //---------------------------------------------------------------------------- +#define ATT_CUSTOSLOG 103 + class AttCustosLog: public Att { public: @@ -1230,6 +1284,8 @@ class AttCustosLog: public Att // AttDatable //---------------------------------------------------------------------------- +#define ATT_DATABLE 104 + class AttDatable: public Att { public: @@ -1296,6 +1352,8 @@ class AttDatable: public Att // AttDatapointing //---------------------------------------------------------------------------- +#define ATT_DATAPOINTING 105 + class AttDatapointing: public Att { public: @@ -1334,6 +1392,8 @@ class AttDatapointing: public Att // AttDeclaring //---------------------------------------------------------------------------- +#define ATT_DECLARING 106 + class AttDeclaring: public Att { public: @@ -1375,6 +1435,8 @@ class AttDeclaring: public Att // AttDistances //---------------------------------------------------------------------------- +#define ATT_DISTANCES 107 + class AttDistances: public Att { public: @@ -1430,6 +1492,8 @@ class AttDistances: public Att // AttDotLog //---------------------------------------------------------------------------- +#define ATT_DOTLOG 108 + class AttDotLog: public Att { public: @@ -1468,6 +1532,8 @@ class AttDotLog: public Att // AttDurationAdditive //---------------------------------------------------------------------------- +#define ATT_DURATIONADDITIVE 109 + class AttDurationAdditive: public Att { public: @@ -1512,6 +1578,8 @@ class AttDurationAdditive: public Att // AttDurationDefault //---------------------------------------------------------------------------- +#define ATT_DURATIONDEFAULT 110 + class AttDurationDefault: public Att { public: @@ -1574,6 +1642,8 @@ class AttDurationDefault: public Att // AttDurationMusical //---------------------------------------------------------------------------- +#define ATT_DURATIONMUSICAL 111 + class AttDurationMusical: public Att { public: @@ -1618,6 +1688,8 @@ class AttDurationMusical: public Att // AttDurationPerformed //---------------------------------------------------------------------------- +#define ATT_DURATIONPERFORMED 112 + class AttDurationPerformed: public Att { public: @@ -1661,6 +1733,8 @@ class AttDurationPerformed: public Att // AttDurationRatio //---------------------------------------------------------------------------- +#define ATT_DURATIONRATIO 113 + class AttDurationRatio: public Att { public: @@ -1712,6 +1786,8 @@ class AttDurationRatio: public Att // AttEnclosingchars //---------------------------------------------------------------------------- +#define ATT_ENCLOSINGCHARS 114 + class AttEnclosingchars: public Att { public: @@ -1755,6 +1831,8 @@ class AttEnclosingchars: public Att // AttFermatapresent //---------------------------------------------------------------------------- +#define ATT_FERMATAPRESENT 115 + class AttFermatapresent: public Att { public: @@ -1797,6 +1875,8 @@ class AttFermatapresent: public Att // AttHandident //---------------------------------------------------------------------------- +#define ATT_HANDIDENT 116 + class AttHandident: public Att { public: @@ -1838,6 +1918,8 @@ class AttHandident: public Att // AttHorizontalalign //---------------------------------------------------------------------------- +#define ATT_HORIZONTALALIGN 117 + class AttHorizontalalign: public Att { public: @@ -1876,6 +1958,8 @@ class AttHorizontalalign: public Att // AttInstrumentident //---------------------------------------------------------------------------- +#define ATT_INSTRUMENTIDENT 118 + class AttInstrumentident: public Att { public: @@ -1917,6 +2001,8 @@ class AttInstrumentident: public Att // AttInternetmedia //---------------------------------------------------------------------------- +#define ATT_INTERNETMEDIA 119 + class AttInternetmedia: public Att { public: @@ -1959,6 +2045,8 @@ class AttInternetmedia: public Att // AttJoined //---------------------------------------------------------------------------- +#define ATT_JOINED 120 + class AttJoined: public Att { public: @@ -2004,6 +2092,8 @@ class AttJoined: public Att // AttKeySigLog //---------------------------------------------------------------------------- +#define ATT_KEYSIGLOG 121 + class AttKeySigLog: public Att { public: @@ -2042,6 +2132,8 @@ class AttKeySigLog: public Att // AttKeySigDefaultLog //---------------------------------------------------------------------------- +#define ATT_KEYSIGDEFAULTLOG 122 + class AttKeySigDefaultLog: public Att { public: @@ -2124,6 +2216,8 @@ class AttKeySigDefaultLog: public Att // AttKeySigDefaultVis //---------------------------------------------------------------------------- +#define ATT_KEYSIGDEFAULTVIS 123 + class AttKeySigDefaultVis: public Att { public: @@ -2169,6 +2263,8 @@ class AttKeySigDefaultVis: public Att // AttLabelsAddl //---------------------------------------------------------------------------- +#define ATT_LABELSADDL 124 + class AttLabelsAddl: public Att { public: @@ -2210,6 +2306,8 @@ class AttLabelsAddl: public Att // AttLang //---------------------------------------------------------------------------- +#define ATT_LANG 125 + class AttLang: public Att { public: @@ -2248,6 +2346,8 @@ class AttLang: public Att // AttLayerLog //---------------------------------------------------------------------------- +#define ATT_LAYERLOG 126 + class AttLayerLog: public Att { public: @@ -2286,6 +2386,8 @@ class AttLayerLog: public Att // AttLayerident //---------------------------------------------------------------------------- +#define ATT_LAYERIDENT 127 + class AttLayerident: public Att { public: @@ -2324,6 +2426,8 @@ class AttLayerident: public Att // AttLineloc //---------------------------------------------------------------------------- +#define ATT_LINELOC 128 + class AttLineloc: public Att { public: @@ -2366,6 +2470,8 @@ class AttLineloc: public Att // AttLinerend //---------------------------------------------------------------------------- +#define ATT_LINEREND 129 + class AttLinerend: public Att { public: @@ -2404,6 +2510,8 @@ class AttLinerend: public Att // AttLyricstyle //---------------------------------------------------------------------------- +#define ATT_LYRICSTYLE 130 + class AttLyricstyle: public Att { public: @@ -2477,6 +2585,8 @@ class AttLyricstyle: public Att // AttMeasureLog //---------------------------------------------------------------------------- +#define ATT_MEASURELOG 131 + class AttMeasureLog: public Att { public: @@ -2526,6 +2636,8 @@ class AttMeasureLog: public Att // AttMeasurement //---------------------------------------------------------------------------- +#define ATT_MEASUREMENT 132 + class AttMeasurement: public Att { public: @@ -2564,6 +2676,8 @@ class AttMeasurement: public Att // AttMediabounds //---------------------------------------------------------------------------- +#define ATT_MEDIABOUNDS 133 + class AttMediabounds: public Att { public: @@ -2629,6 +2743,8 @@ class AttMediabounds: public Att // AttMedium //---------------------------------------------------------------------------- +#define ATT_MEDIUM 134 + class AttMedium: public Att { public: @@ -2667,6 +2783,8 @@ class AttMedium: public Att // AttMeiversion //---------------------------------------------------------------------------- +#define ATT_MEIVERSION 135 + class AttMeiversion: public Att { public: @@ -2712,6 +2830,8 @@ class AttMeiversion: public Att // AttMensurLog //---------------------------------------------------------------------------- +#define ATT_MENSURLOG 136 + class AttMensurLog: public Att { public: @@ -2757,6 +2877,8 @@ class AttMensurLog: public Att // AttMeterSigLog //---------------------------------------------------------------------------- +#define ATT_METERSIGLOG 137 + class AttMeterSigLog: public Att { public: @@ -2817,6 +2939,8 @@ class AttMeterSigLog: public Att // AttMeterSigVis //---------------------------------------------------------------------------- +#define ATT_METERSIGVIS 138 + class AttMeterSigVis: public Att { public: @@ -2855,6 +2979,8 @@ class AttMeterSigVis: public Att // AttMeterSigDefaultLog //---------------------------------------------------------------------------- +#define ATT_METERSIGDEFAULTLOG 139 + class AttMeterSigDefaultLog: public Att { public: @@ -2908,6 +3034,8 @@ class AttMeterSigDefaultLog: public Att // AttMeterSigDefaultVis //---------------------------------------------------------------------------- +#define ATT_METERSIGDEFAULTVIS 140 + class AttMeterSigDefaultVis: public Att { public: @@ -2966,6 +3094,8 @@ class AttMeterSigDefaultVis: public Att // AttMeterconformance //---------------------------------------------------------------------------- +#define ATT_METERCONFORMANCE 141 + class AttMeterconformance: public Att { public: @@ -3007,6 +3137,8 @@ class AttMeterconformance: public Att // AttMeterconformanceBar //---------------------------------------------------------------------------- +#define ATT_METERCONFORMANCEBAR 142 + class AttMeterconformanceBar: public Att { public: @@ -3061,6 +3193,8 @@ class AttMeterconformanceBar: public Att // AttMmtempo //---------------------------------------------------------------------------- +#define ATT_MMTEMPO 143 + class AttMmtempo: public Att { public: @@ -3117,6 +3251,8 @@ class AttMmtempo: public Att // AttMultinummeasures //---------------------------------------------------------------------------- +#define ATT_MULTINUMMEASURES 144 + class AttMultinummeasures: public Att { public: @@ -3158,6 +3294,8 @@ class AttMultinummeasures: public Att // AttName //---------------------------------------------------------------------------- +#define ATT_NAME 145 + class AttName: public Att { public: @@ -3209,6 +3347,8 @@ class AttName: public Att // AttNoteGes //---------------------------------------------------------------------------- +#define ATT_NOTEGES 146 + class AttNoteGes: public Att { public: @@ -3261,6 +3401,8 @@ class AttNoteGes: public Att // AttNoteVis //---------------------------------------------------------------------------- +#define ATT_NOTEVIS 147 + class AttNoteVis: public Att { public: @@ -3299,6 +3441,8 @@ class AttNoteVis: public Att // AttOctave //---------------------------------------------------------------------------- +#define ATT_OCTAVE 148 + class AttOctave: public Att { public: @@ -3337,6 +3481,8 @@ class AttOctave: public Att // AttOctavedefault //---------------------------------------------------------------------------- +#define ATT_OCTAVEDEFAULT 149 + class AttOctavedefault: public Att { public: @@ -3379,6 +3525,8 @@ class AttOctavedefault: public Att // AttOctavedisplacement //---------------------------------------------------------------------------- +#define ATT_OCTAVEDISPLACEMENT 150 + class AttOctavedisplacement: public Att { public: @@ -3424,6 +3572,8 @@ class AttOctavedisplacement: public Att // AttOnelinestaff //---------------------------------------------------------------------------- +#define ATT_ONELINESTAFF 151 + class AttOnelinestaff: public Att { public: @@ -3466,6 +3616,8 @@ class AttOnelinestaff: public Att // AttPadLog //---------------------------------------------------------------------------- +#define ATT_PADLOG 152 + class AttPadLog: public Att { public: @@ -3507,6 +3659,8 @@ class AttPadLog: public Att // AttPbVis //---------------------------------------------------------------------------- +#define ATT_PBVIS 153 + class AttPbVis: public Att { public: @@ -3545,6 +3699,8 @@ class AttPbVis: public Att // AttPitch //---------------------------------------------------------------------------- +#define ATT_PITCH 154 + class AttPitch: public Att { public: @@ -3583,6 +3739,8 @@ class AttPitch: public Att // AttPlacement //---------------------------------------------------------------------------- +#define ATT_PLACEMENT 155 + class AttPlacement: public Att { public: @@ -3624,6 +3782,8 @@ class AttPlacement: public Att // AttPlist //---------------------------------------------------------------------------- +#define ATT_PLIST 156 + class AttPlist: public Att { public: @@ -3672,6 +3832,8 @@ class AttPlist: public Att // AttPointing //---------------------------------------------------------------------------- +#define ATT_POINTING 157 + class AttPointing: public Att { public: @@ -3754,6 +3916,8 @@ class AttPointing: public Att // AttRelativesize //---------------------------------------------------------------------------- +#define ATT_RELATIVESIZE 158 + class AttRelativesize: public Att { public: @@ -3792,6 +3956,8 @@ class AttRelativesize: public Att // AttResponsibility //---------------------------------------------------------------------------- +#define ATT_RESPONSIBILITY 159 + class AttResponsibility: public Att { public: @@ -3834,6 +4000,8 @@ class AttResponsibility: public Att // AttSbVis //---------------------------------------------------------------------------- +#define ATT_SBVIS 160 + class AttSbVis: public Att { public: @@ -3872,6 +4040,8 @@ class AttSbVis: public Att // AttScalable //---------------------------------------------------------------------------- +#define ATT_SCALABLE 161 + class AttScalable: public Att { public: @@ -3910,6 +4080,8 @@ class AttScalable: public Att // AttScoreDefGes //---------------------------------------------------------------------------- +#define ATT_SCOREDEFGES 162 + class AttScoreDefGes: public Att { public: @@ -3962,6 +4134,8 @@ class AttScoreDefGes: public Att // AttScoreDefVis //---------------------------------------------------------------------------- +#define ATT_SCOREDEFVIS 163 + class AttScoreDefVis: public Att { public: @@ -4171,6 +4345,8 @@ class AttScoreDefVis: public Att // AttSectionVis //---------------------------------------------------------------------------- +#define ATT_SECTIONVIS 164 + class AttSectionVis: public Att { public: @@ -4209,6 +4385,8 @@ class AttSectionVis: public Att // AttSequence //---------------------------------------------------------------------------- +#define ATT_SEQUENCE 165 + class AttSequence: public Att { public: @@ -4250,6 +4428,8 @@ class AttSequence: public Att // AttSlashcount //---------------------------------------------------------------------------- +#define ATT_SLASHCOUNT 166 + class AttSlashcount: public Att { public: @@ -4288,6 +4468,8 @@ class AttSlashcount: public Att // AttSlurpresent //---------------------------------------------------------------------------- +#define ATT_SLURPRESENT 167 + class AttSlurpresent: public Att { public: @@ -4330,6 +4512,8 @@ class AttSlurpresent: public Att // AttSpaceVis //---------------------------------------------------------------------------- +#define ATT_SPACEVIS 168 + class AttSpaceVis: public Att { public: @@ -4371,6 +4555,8 @@ class AttSpaceVis: public Att // AttStaffLog //---------------------------------------------------------------------------- +#define ATT_STAFFLOG 169 + class AttStaffLog: public Att { public: @@ -4409,6 +4595,8 @@ class AttStaffLog: public Att // AttStaffDefVis //---------------------------------------------------------------------------- +#define ATT_STAFFDEFVIS 170 + class AttStaffDefVis: public Att { public: @@ -4494,6 +4682,8 @@ class AttStaffDefVis: public Att // AttStaffGrpVis //---------------------------------------------------------------------------- +#define ATT_STAFFGRPVIS 171 + class AttStaffGrpVis: public Att { public: @@ -4535,6 +4725,8 @@ class AttStaffGrpVis: public Att // AttStaffgroupingsym //---------------------------------------------------------------------------- +#define ATT_STAFFGROUPINGSYM 172 + class AttStaffgroupingsym: public Att { public: @@ -4573,6 +4765,8 @@ class AttStaffgroupingsym: public Att // AttStaffident //---------------------------------------------------------------------------- +#define ATT_STAFFIDENT 173 + class AttStaffident: public Att { public: @@ -4615,6 +4809,8 @@ class AttStaffident: public Att // AttStaffloc //---------------------------------------------------------------------------- +#define ATT_STAFFLOC 174 + class AttStaffloc: public Att { public: @@ -4653,6 +4849,8 @@ class AttStaffloc: public Att // AttStafflocPitched //---------------------------------------------------------------------------- +#define ATT_STAFFLOCPITCHED 175 + class AttStafflocPitched: public Att { public: @@ -4698,6 +4896,8 @@ class AttStafflocPitched: public Att // AttStartendid //---------------------------------------------------------------------------- +#define ATT_STARTENDID 176 + class AttStartendid: public Att { public: @@ -4739,6 +4939,8 @@ class AttStartendid: public Att // AttStartid //---------------------------------------------------------------------------- +#define ATT_STARTID 177 + class AttStartid: public Att { public: @@ -4780,6 +4982,8 @@ class AttStartid: public Att // AttStemmed //---------------------------------------------------------------------------- +#define ATT_STEMMED 178 + class AttStemmed: public Att { public: @@ -4846,6 +5050,8 @@ class AttStemmed: public Att // AttSylLog //---------------------------------------------------------------------------- +#define ATT_SYLLOG 179 + class AttSylLog: public Att { public: @@ -4894,6 +5100,8 @@ class AttSylLog: public Att // AttSyltext //---------------------------------------------------------------------------- +#define ATT_SYLTEXT 180 + class AttSyltext: public Att { public: @@ -4932,6 +5140,8 @@ class AttSyltext: public Att // AttTextstyle //---------------------------------------------------------------------------- +#define ATT_TEXTSTYLE 181 + class AttTextstyle: public Att { public: @@ -5013,6 +5223,8 @@ class AttTextstyle: public Att // AttTiepresent //---------------------------------------------------------------------------- +#define ATT_TIEPRESENT 182 + class AttTiepresent: public Att { public: @@ -5055,6 +5267,8 @@ class AttTiepresent: public Att // AttTimestampMusical //---------------------------------------------------------------------------- +#define ATT_TIMESTAMPMUSICAL 183 + class AttTimestampMusical: public Att { public: @@ -5096,6 +5310,8 @@ class AttTimestampMusical: public Att // AttTimestampPerformed //---------------------------------------------------------------------------- +#define ATT_TIMESTAMPPERFORMED 184 + class AttTimestampPerformed: public Att { public: @@ -5144,6 +5360,8 @@ class AttTimestampPerformed: public Att // AttTimestamp2Musical //---------------------------------------------------------------------------- +#define ATT_TIMESTAMP2MUSICAL 185 + class AttTimestamp2Musical: public Att { public: @@ -5185,6 +5403,8 @@ class AttTimestamp2Musical: public Att // AttTransposition //---------------------------------------------------------------------------- +#define ATT_TRANSPOSITION 186 + class AttTransposition: public Att { public: @@ -5236,6 +5456,8 @@ class AttTransposition: public Att // AttTupletpresent //---------------------------------------------------------------------------- +#define ATT_TUPLETPRESENT 187 + class AttTupletpresent: public Att { public: @@ -5278,6 +5500,8 @@ class AttTupletpresent: public Att // AttTyped //---------------------------------------------------------------------------- +#define ATT_TYPED 188 + class AttTyped: public Att { public: @@ -5329,6 +5553,8 @@ class AttTyped: public Att // AttTypography //---------------------------------------------------------------------------- +#define ATT_TYPOGRAPHY 189 + class AttTypography: public Att { public: @@ -5395,6 +5621,8 @@ class AttTypography: public Att // AttVisibility //---------------------------------------------------------------------------- +#define ATT_VISIBILITY 190 + class AttVisibility: public Att { public: @@ -5436,6 +5664,8 @@ class AttVisibility: public Att // AttVisualoffsetHo //---------------------------------------------------------------------------- +#define ATT_VISUALOFFSETHO 191 + class AttVisualoffsetHo: public Att { public: @@ -5478,6 +5708,8 @@ class AttVisualoffsetHo: public Att // AttVisualoffsetTo //---------------------------------------------------------------------------- +#define ATT_VISUALOFFSETTO 192 + class AttVisualoffsetTo: public Att { public: @@ -5519,6 +5751,8 @@ class AttVisualoffsetTo: public Att // AttVisualoffsetVo //---------------------------------------------------------------------------- +#define ATT_VISUALOFFSETVO 193 + class AttVisualoffsetVo: public Att { public: @@ -5561,6 +5795,8 @@ class AttVisualoffsetVo: public Att // AttVisualoffset2Ho //---------------------------------------------------------------------------- +#define ATT_VISUALOFFSET2HO 194 + class AttVisualoffset2Ho: public Att { public: @@ -5612,6 +5848,8 @@ class AttVisualoffset2Ho: public Att // AttVisualoffset2To //---------------------------------------------------------------------------- +#define ATT_VISUALOFFSET2TO 195 + class AttVisualoffset2To: public Att { public: @@ -5663,6 +5901,8 @@ class AttVisualoffset2To: public Att // AttVisualoffset2Vo //---------------------------------------------------------------------------- +#define ATT_VISUALOFFSET2VO 196 + class AttVisualoffset2Vo: public Att { public: @@ -5714,6 +5954,8 @@ class AttVisualoffset2Vo: public Att // AttWhitespace //---------------------------------------------------------------------------- +#define ATT_WHITESPACE 197 + class AttWhitespace: public Att { public: @@ -5752,6 +5994,8 @@ class AttWhitespace: public Att // AttWidth //---------------------------------------------------------------------------- +#define ATT_WIDTH 198 + class AttWidth: public Att { public: @@ -5795,6 +6039,8 @@ class AttWidth: public Att // AttXy //---------------------------------------------------------------------------- +#define ATT_XY 199 + class AttXy: public Att { public: @@ -5848,6 +6094,8 @@ class AttXy: public Att // AttXy2 //---------------------------------------------------------------------------- +#define ATT_XY2 200 + class AttXy2: public Att { public: diff --git a/libmei/atts_tablature.cpp b/libmei/atts_tablature.cpp index b41b51beac5..204ea2cc7f8 100644 --- a/libmei/atts_tablature.cpp +++ b/libmei/atts_tablature.cpp @@ -124,8 +124,8 @@ bool AttStaffDefGesTablature::HasTabStrings( ) /* include */ bool Att::SetTablature( Object *element, std::string attrType, std::string attrValue ) { - if (dynamic_cast(element) ) { - AttNoteGesTablature *att = dynamic_cast(element); + if (element->HasAttClass( ATT_NOTEGESTABLATURE ) ) { + AttNoteGesTablature *att = reinterpret_cast(element); if (attrType == "tabFret") { att->SetTabFret(att->StrToStr(attrValue)); return true; @@ -135,8 +135,8 @@ bool Att::SetTablature( Object *element, std::string attrType, std::string attrV return true; } } - if (dynamic_cast(element) ) { - AttStaffDefGesTablature *att = dynamic_cast(element); + if (element->HasAttClass( ATT_STAFFDEFGESTABLATURE ) ) { + AttStaffDefGesTablature *att = reinterpret_cast(element); if (attrType == "tabStrings") { att->SetTabStrings(att->StrToStr(attrValue)); return true; @@ -147,8 +147,8 @@ bool Att::SetTablature( Object *element, std::string attrType, std::string attrV } void Att::GetTablature( Object *element, ArrayOfStrAttr *attributes ) { - if (dynamic_cast(element) ) { - AttNoteGesTablature *att = dynamic_cast(element); + if (element->HasAttClass( ATT_NOTEGESTABLATURE ) ) { + AttNoteGesTablature *att = reinterpret_cast(element); if (att->HasTabFret()) { attributes->push_back(std::make_pair("tabFret", att->StrToStr(att->GetTabFret()))); } @@ -156,8 +156,8 @@ void Att::GetTablature( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("tabString", att->StrToStr(att->GetTabString()))); } } - if (dynamic_cast(element) ) { - AttStaffDefGesTablature *att = dynamic_cast(element); + if (element->HasAttClass( ATT_STAFFDEFGESTABLATURE ) ) { + AttStaffDefGesTablature *att = reinterpret_cast(element); if (att->HasTabStrings()) { attributes->push_back(std::make_pair("tabStrings", att->StrToStr(att->GetTabStrings()))); } diff --git a/libmei/atts_tablature.h b/libmei/atts_tablature.h index 8e792d822e8..63ebbfea4f8 100644 --- a/libmei/atts_tablature.h +++ b/libmei/atts_tablature.h @@ -28,6 +28,8 @@ namespace vrv { // AttNoteGesTablature //---------------------------------------------------------------------------- +#define ATT_NOTEGESTABLATURE 201 + class AttNoteGesTablature: public Att { public: @@ -73,6 +75,8 @@ class AttNoteGesTablature: public Att // AttStaffDefGesTablature //---------------------------------------------------------------------------- +#define ATT_STAFFDEFGESTABLATURE 202 + class AttStaffDefGesTablature: public Att { public: diff --git a/src/accid.cpp b/src/accid.cpp index d7186d58e45..e58a344997f 100644 --- a/src/accid.cpp +++ b/src/accid.cpp @@ -23,8 +23,11 @@ namespace vrv { Accid::Accid(): LayerElement("accid-"), PositionInterface(), - AttAccidental() + AttAccidental(), + AttAccidLog() { + RegisterAttClass(ATT_ACCIDENTAL); + RegisterAttClass(ATT_ACCIDLOG); Reset(); } @@ -45,12 +48,12 @@ void Accid::Reset() // Functors methods //---------------------------------------------------------------------------- -int Accid::PreparePointersByLayer( ArrayPtrVoid params ) +int Accid::PreparePointersByLayer( ArrayPtrVoid *params ) { // param 0: the current Note (not used) - //Note **currentNote = static_cast(params[0]); + //Note **currentNote = static_cast((*params)[0]); - Note *note = dynamic_cast( this->GetFirstParent( &typeid(Note), MAX_ACCID_DEPTH ) ); + Note *note = reinterpret_cast( this->GetFirstParent( NOTE, MAX_ACCID_DEPTH ) ); if ( !note ) { return FUNCTOR_CONTINUE; } diff --git a/src/aligner.cpp b/src/aligner.cpp index cfaf57cb989..29568ae4a3b 100644 --- a/src/aligner.cpp +++ b/src/aligner.cpp @@ -54,7 +54,7 @@ StaffAlignment* SystemAligner::GetStaffAlignment( int idx ) if (idx < GetStaffAlignmentCount()) { this->m_children.push_back( m_bottomAlignment ); - return dynamic_cast(m_children[idx]); + return reinterpret_cast(m_children[idx]); } // check that we are searching for the next one (not gap) assert( idx == GetStaffAlignmentCount() ); @@ -163,7 +163,7 @@ Alignment* MeasureAligner::GetAlignmentAtTime( double time, AlignmentType type, // First try to see if we already have something at the time position for (i = 0; i < GetAlignmentCount(); i++) { - alignment = dynamic_cast(m_children[i]); + alignment = reinterpret_cast(m_children[i]); assert( alignment ); double alignment_time = alignment->GetTime(); @@ -226,7 +226,7 @@ void GraceAligner::AlignStack( ) int i; double time = 0.0; for (i = (int)m_noteStack.size(); i > 0; i--) { - Note *note = dynamic_cast( m_noteStack[i-1] ); + Note *note = reinterpret_cast( m_noteStack[i-1] ); // get the duration of the event double duration = note->LayerElement::GetAlignmentDuration( NULL, NULL, false ); // Time goes backward with grace notes @@ -302,15 +302,15 @@ GraceAligner *Alignment::GetGraceAligner( ) // Functors methods //---------------------------------------------------------------------------- -int StaffAlignment::SetAligmentYPos( ArrayPtrVoid params ) +int StaffAlignment::SetAligmentYPos( ArrayPtrVoid *params ) { // param 0: the previous staff height // param 1: the staff margin // param 2: the staff interline sizes (int[2]) // param 3: the functor to be redirected to SystemAligner (unused) - int *previousStaffHeight = static_cast(params[0]); - int *staffMargin = static_cast(params[1]); - int **interlineSizes = static_cast(params[2]); + int *previousStaffHeight = static_cast((*params)[0]); + int *staffMargin = static_cast((*params)[1]); + int **interlineSizes = static_cast((*params)[2]); // take into account the number of lyrics if (this->GetVerseCount() > 0) { @@ -330,11 +330,11 @@ int StaffAlignment::SetAligmentYPos( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } -int StaffAlignment::IntegrateBoundingBoxYShift( ArrayPtrVoid params ) +int StaffAlignment::IntegrateBoundingBoxYShift( ArrayPtrVoid *params ) { // param 0: the cumulated shift // param 1: the functor to be redirected to the SystemAligner (unused) - int *shift = static_cast(params[0]); + int *shift = static_cast((*params)[0]); // integrates the m_yShift into the m_yRel m_yRel += m_yShift + (*shift); @@ -346,13 +346,13 @@ int StaffAlignment::IntegrateBoundingBoxYShift( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } -int MeasureAligner::IntegrateBoundingBoxXShift( ArrayPtrVoid params ) +int MeasureAligner::IntegrateBoundingBoxXShift( ArrayPtrVoid *params ) { // param 0: the cumulated shift // param 1: the cumulated justifiable shift // param 2: the functor to be redirected to the MeasureAligner (unused) - int *shift = static_cast(params[0]); - int *justifiable_shift = static_cast(params[1]); + int *shift = static_cast((*params)[0]); + int *justifiable_shift = static_cast((*params)[1]); // We start a new MeasureAligner // Reset the cumulated shift to 0; @@ -362,7 +362,7 @@ int MeasureAligner::IntegrateBoundingBoxXShift( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } -int Alignment::IntegrateBoundingBoxGraceXShift( ArrayPtrVoid params ) +int Alignment::IntegrateBoundingBoxGraceXShift( ArrayPtrVoid *params ) { if (!m_graceAligner) { return FUNCTOR_CONTINUE; @@ -371,7 +371,7 @@ int Alignment::IntegrateBoundingBoxGraceXShift( ArrayPtrVoid params ) int i; int shift = 0; for (i = 0; i < (int)m_graceAligner->m_children.size(); i++) { - Alignment *alignment = dynamic_cast(m_graceAligner->m_children[i]); + Alignment *alignment = reinterpret_cast(m_graceAligner->m_children[i]); alignment->SetXRel( alignment->GetXShift() + shift ); shift += alignment->GetXShift(); } @@ -380,19 +380,19 @@ int Alignment::IntegrateBoundingBoxGraceXShift( ArrayPtrVoid params ) if ( m_graceAligner->m_children.empty() ) { return FUNCTOR_CONTINUE; } - Alignment *alignment = dynamic_cast(m_graceAligner->m_children.back()); + Alignment *alignment = reinterpret_cast(m_graceAligner->m_children.back()); m_graceAligner->SetWidth( alignment->GetXRel() + alignment->GetMaxWidth() ); return FUNCTOR_CONTINUE; } -int Alignment::IntegrateBoundingBoxXShift( ArrayPtrVoid params ) +int Alignment::IntegrateBoundingBoxXShift( ArrayPtrVoid *params ) { // param 0: the cumulated shift // param 1: the cumulated justifiable shift // param 2: the functor to be redirected to the MeasureAligner (unused) - int *shift = static_cast(params[0]); - int *justifiable_shift = static_cast(params[1]); + int *shift = static_cast((*params)[0]); + int *justifiable_shift = static_cast((*params)[1]); // integrates the m_xShift into the m_xRel m_xRel += m_xShift + (*shift); @@ -400,7 +400,7 @@ int Alignment::IntegrateBoundingBoxXShift( ArrayPtrVoid params ) (*shift) += m_xShift; if ((GetType() > ALIGNMENT_METERSIG_ATTR) && ((*justifiable_shift) < 0)) { - dynamic_cast(m_parent)->SetNonJustifiableMargin(m_xRel); + reinterpret_cast(m_parent)->SetNonJustifiableMargin(m_xRel); (*justifiable_shift) = m_xRel; } @@ -410,14 +410,14 @@ int Alignment::IntegrateBoundingBoxXShift( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } -int MeasureAligner::SetAligmentXPos( ArrayPtrVoid params ) +int MeasureAligner::SetAligmentXPos( ArrayPtrVoid *params ) { // param 0: the previous time position // param 1: the previous x rel position // param 2: the minimum measure width (unused) // param 3: the functor to be redirected to the MeasureAligner (unused) - double *previousTime = static_cast(params[0]); - int *previousXRel = static_cast(params[1]); + double *previousTime = static_cast((*params)[0]); + int *previousXRel = static_cast((*params)[1]); // We start a new MeasureAligner // Reset the previous time position and x_rel to 0; @@ -427,15 +427,15 @@ int MeasureAligner::SetAligmentXPos( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } -int Alignment::SetAligmentXPos( ArrayPtrVoid params ) +int Alignment::SetAligmentXPos( ArrayPtrVoid *params ) { // param 0: the previous time position // param 1: the previous x rel position // param 2: the minimum measure width // param 3: the functor to be redirected to the MeasureAligner (unused) - double *previousTime = static_cast(params[0]); - int *previousXRel = static_cast(params[1]); - int *minMeasureWidth = static_cast(params[2]); + double *previousTime = static_cast((*params)[0]); + int *previousXRel = static_cast((*params)[1]); + int *minMeasureWidth = static_cast((*params)[2]); int intervalXRel = 0; double intervalTime = (m_time - (*previousTime)); @@ -454,16 +454,16 @@ int Alignment::SetAligmentXPos( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } -int MeasureAligner::JustifyX( ArrayPtrVoid params ) +int MeasureAligner::JustifyX( ArrayPtrVoid *params ) { // param 0: the justification ratio // param 1: the justification ratio for the measure (depends on the margin) // param 2: the non justifiable margin // param 3: the system full width (without system margins) (unused) // param 4: the functor to be redirected to the MeasureAligner (unused) - double *ratio =static_cast(params[0]); - double *measureRatio =static_cast(params[1]); - int *margin =static_cast(params[2]); + double *ratio =static_cast((*params)[0]); + double *measureRatio =static_cast((*params)[1]); + int *margin =static_cast((*params)[2]); int width = GetRightAlignment()->GetXRel() + GetRightAlignment()->GetMaxWidth(); @@ -480,16 +480,16 @@ int MeasureAligner::JustifyX( ArrayPtrVoid params ) } -int Alignment::JustifyX( ArrayPtrVoid params ) +int Alignment::JustifyX( ArrayPtrVoid *params ) { // param 0: the justification ratio // param 1: the justification ratio for the measure (depends on the margin) // param 2: the non justifiable margin // param 3: the system full width (without system margins) (unused) // param 4: the functor to be redirected to the MeasureAligner (unused) - double *ratio =static_cast(params[0]); - double *measureRatio =static_cast(params[1]); - int *margin =static_cast(params[2]); + double *ratio =static_cast((*params)[0]); + double *measureRatio =static_cast((*params)[1]); + int *margin =static_cast((*params)[2]); if (GetType() == ALIGNMENT_MEASURE_START) { return FUNCTOR_CONTINUE; diff --git a/src/att.cpp b/src/att.cpp index 16b3c9d09b5..26b60fc3127 100644 --- a/src/att.cpp +++ b/src/att.cpp @@ -1032,7 +1032,7 @@ data_WORDPOS Att::StrToWordPos(std::string value) bool AttComparison::operator()(Object *object) { - if (typeid(*object) == *m_elementType) { + if ( object->Is() == m_classId ) { return true; } return false; @@ -1040,7 +1040,7 @@ bool AttComparison::operator()(Object *object) bool AttComparison::MatchesType(Object *object) { - if (typeid(*object) == *m_elementType) { + if ( object->Is() == m_classId ) { return true; } return false; diff --git a/src/barline.cpp b/src/barline.cpp index e633cf18c31..85f133b2d69 100644 --- a/src/barline.cpp +++ b/src/barline.cpp @@ -18,6 +18,7 @@ Barline::Barline(): LayerElement("bline-"), AttBarLineLog() { + RegisterAttClass(ATT_BARLINELOG); Reset(); m_partialBarline = false; // this was used unitialized m_onStaffOnly = false; // is this good? diff --git a/src/chord.cpp b/src/chord.cpp index db22fb71cc7..2e79b539225 100644 --- a/src/chord.cpp +++ b/src/chord.cpp @@ -23,16 +23,18 @@ namespace vrv { //---------------------------------------------------------------------------- Chord::Chord( ): -LayerElement("chord-"), ObjectListInterface(), DurationInterface(), + LayerElement("chord-"), ObjectListInterface(), DurationInterface(), AttCommon(), AttStemmed(), AttTiepresent() { + RegisterAttClass(ATT_COMMON); + RegisterAttClass(ATT_STEMMED); + RegisterAttClass(ATT_TIEPRESENT); Reset(); + m_drawingStemDir = STEMDIRECTION_NONE; m_drawingLedgerLines.clear(); - - //test[NULL][0][0] = 0; } Chord::~Chord() @@ -55,12 +57,10 @@ void Chord::ClearClusters() std::list::iterator iter; for (iter = m_clusters.begin(); iter != m_clusters.end(); ++iter) { - ChordCluster *cluster = dynamic_cast(*iter); - for (std::vector::iterator clIter = cluster->begin(); clIter != cluster->end(); ++clIter) + for (std::vector::iterator clIter = (*iter)->begin(); clIter != (*iter)->end(); ++clIter) { - Note *note = dynamic_cast(*clIter); - note->m_cluster = NULL; - note->m_clusterPosition = 0; + (*clIter)->m_cluster = NULL; + (*clIter)->m_clusterPosition = 0; } delete *iter; } @@ -237,11 +237,11 @@ void Chord::GetYExtremes(int *yMax, int *yMin) // Functors methods //---------------------------------------------------------------------------- -int Chord::PrepareTieAttr( ArrayPtrVoid params ) +int Chord::PrepareTieAttr( ArrayPtrVoid *params ) { // param 0: std::vector* that holds the current notes with open ties (unused) // param 1: Chord** currentChord for the current chord if in a chord - Chord **currentChord = static_cast(params[1]); + Chord **currentChord = static_cast((*params)[1]); assert(!(*currentChord)); (*currentChord) = this; @@ -249,11 +249,11 @@ int Chord::PrepareTieAttr( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } -int Chord::PrepareTieAttrEnd( ArrayPtrVoid params ) +int Chord::PrepareTieAttrEnd( ArrayPtrVoid *params ) { // param 0: std::vector* that holds the current notes with open ties (unused) // param 1: Chord** currentChord for the current chord if in a chord - Chord **currentChord = static_cast(params[1]); + Chord **currentChord = static_cast((*params)[1]); assert((*currentChord)); (*currentChord) = NULL; diff --git a/src/clef.cpp b/src/clef.cpp index 3290542938d..90c7eab3d89 100644 --- a/src/clef.cpp +++ b/src/clef.cpp @@ -20,18 +20,27 @@ Clef::Clef(): AttLineloc(), AttOctavedisplacement() { - Reset(); + Init(); } Clef::Clef( ClefAttr *clefAttr ): LayerElement("clef-") { - Clef(); + Init(); + this->SetShape(clefAttr->GetClefShape()); this->SetLine(clefAttr->GetClefLine()); this->SetDis(clefAttr->GetClefDis()); this->SetDisPlace(clefAttr->GetClefDisPlace()); } + +void Clef::Init() +{ + RegisterAttClass(ATT_CLEFSHAPE); + RegisterAttClass(ATT_LINELOC); + RegisterAttClass(ATT_OCTAVEDISPLACEMENT); + Reset(); +} Clef::~Clef() { @@ -82,10 +91,10 @@ ClefAttr::ClefAttr(): Object(), AttCleffingLog() { + RegisterAttClass(ATT_CLEFFINGLOG); Reset(); } - ClefAttr::~ClefAttr() { } diff --git a/src/doc.cpp b/src/doc.cpp index 2707fac6a46..58e532ce01b 100644 --- a/src/doc.cpp +++ b/src/doc.cpp @@ -97,7 +97,7 @@ void Doc::PrepareDrawing() if (m_drawingPreparationDone) { Functor resetDrawing( &Object::ResetDarwing ); - this->Process( &resetDrawing, params ); + this->Process( &resetDrawing, ¶ms ); } // Try to match all spanning elements (slur, tie, etc) by processing backward @@ -106,7 +106,7 @@ void Doc::PrepareDrawing() params.push_back( &timeSpanningElements ); params.push_back( &fillList ); Functor prepareTimeSpanning( &Object::PrepareTimeSpanning ); - this->Process( &prepareTimeSpanning, params, NULL, NULL, UNLIMITED_DEPTH, BACKWARD ); + this->Process( &prepareTimeSpanning, ¶ms, NULL, NULL, UNLIMITED_DEPTH, BACKWARD ); // First we tried backward because nomrally the spanning elements are at the end of // the measure. However, in some case, one (or both) end points will appear afterwards @@ -115,7 +115,7 @@ void Doc::PrepareDrawing() // but this time without filling the list (that is only will the remaining elements) if ( !timeSpanningElements.empty() ) { fillList = false; - this->Process( &prepareTimeSpanning, params ); + this->Process( &prepareTimeSpanning, ¶ms ); } // If some are still there, then it is probably an issue in the encoding @@ -137,7 +137,7 @@ void Doc::PrepareDrawing() // We first fill a tree of int with [staff/layer] and [staff/layer/verse] numbers (@n) to be process //LogElapsedTimeStart( ); Functor prepareProcessingLists( &Object::PrepareProcessingLists ); - this->Process( &prepareProcessingLists, params ); + this->Process( &prepareProcessingLists, ¶ms ); // The tree is used to process each staff/layer/verse separatly // For this, we use a array of AttCommmonNComparison that looks for each object if it is of the type @@ -156,8 +156,8 @@ void Doc::PrepareDrawing() for (layers = staves->second.child.begin(); layers != staves->second.child.end(); ++layers) { filters.clear(); // Create ad comparison object for each type / @n - AttCommonNComparison matchStaff( &typeid(Staff), staves->first ); - AttCommonNComparison matchLayer( &typeid(Layer), layers->first ); + AttCommonNComparison matchStaff( STAFF, staves->first ); + AttCommonNComparison matchLayer( LAYER, layers->first ); filters.push_back( &matchStaff ); filters.push_back( &matchLayer ); @@ -170,7 +170,7 @@ void Doc::PrepareDrawing() paramsTieAttr.push_back( ¤tChord ); Functor prepareTieAttr( &Object::PrepareTieAttr ); Functor prepareTieAttrEnd( &Object::PrepareTieAttrEnd ); - this->Process( &prepareTieAttr, paramsTieAttr, &prepareTieAttrEnd, &filters ); + this->Process( &prepareTieAttr, ¶msTieAttr, &prepareTieAttrEnd, &filters ); // After having processed one layer, we check if we have open ties - if yes, we // must reset them and they will be ignored. @@ -189,15 +189,15 @@ void Doc::PrepareDrawing() for (layers = staves->second.child.begin(); layers != staves->second.child.end(); ++layers) { filters.clear(); // Create ad comparison object for each type / @n - AttCommonNComparison matchStaff( &typeid(Staff), staves->first ); - AttCommonNComparison matchLayer( &typeid(Layer), layers->first ); + AttCommonNComparison matchStaff( STAFF, staves->first ); + AttCommonNComparison matchLayer( LAYER, layers->first ); filters.push_back( &matchStaff ); filters.push_back( &matchLayer ); ArrayPtrVoid paramsPointers; paramsPointers.push_back( ¤tNote ); Functor preparePointersByLayer( &Object::PreparePointersByLayer ); - this->Process( &preparePointersByLayer, paramsPointers, NULL, &filters ); + this->Process( &preparePointersByLayer, ¶msPointers, NULL, &filters ); } } @@ -211,9 +211,9 @@ void Doc::PrepareDrawing() //std::cout << staves->first << " => " << layers->first << " => " << verses->first << '\n'; filters.clear(); // Create ad comparison object for each type / @n - AttCommonNComparison matchStaff( &typeid(Staff), staves->first ); - AttCommonNComparison matchLayer( &typeid(Layer), layers->first ); - AttCommonNComparison matchVerse( &typeid(Verse), verses->first ); + AttCommonNComparison matchStaff( STAFF, staves->first ); + AttCommonNComparison matchLayer( LAYER, layers->first ); + AttCommonNComparison matchVerse( VERSE, verses->first ); filters.push_back( &matchStaff ); filters.push_back( &matchLayer ); filters.push_back( &matchVerse ); @@ -229,7 +229,7 @@ void Doc::PrepareDrawing() paramsLyrics.push_back( &lastButOneNote ); Functor prepareLyrics( &Object::PrepareLyrics ); Functor prepareLyricsEnd( &Object::PrepareLyricsEnd ); - this->Process( &prepareLyrics, paramsLyrics, &prepareLyricsEnd, &filters ); + this->Process( &prepareLyrics, ¶msLyrics, &prepareLyricsEnd, &filters ); } } } @@ -241,7 +241,7 @@ void Doc::PrepareDrawing() timeSpanningElements.clear(); params.push_back( &timeSpanningElements ); Functor fillStaffCurrentTimeSpanning( &Object::FillStaffCurrentTimeSpanning ); - this->Process( &fillStaffCurrentTimeSpanning, params ); + this->Process( &fillStaffCurrentTimeSpanning, ¶ms ); // Something must be wrong in the encoding because a TimeSpanningInterface was left open if ( !timeSpanningElements.empty() ) { @@ -294,7 +294,7 @@ void Doc::SetCurrentScoreDef( bool force ) Functor setCurrentScoreDef( &Object::SetCurrentScoreDef ); //LogElapsedTimeStart( ); - this->Process( &setCurrentScoreDef, params ); + this->Process( &setCurrentScoreDef, ¶ms ); //LogElapsedTimeEnd ( "Setting scoreDefs" ); m_currentScoreDefDone = true; @@ -323,7 +323,7 @@ void Doc::CastOff( ) params.push_back( &shift ); params.push_back( &systemFullWidth ); Functor castOffSystems( &Object::CastOffSystems ); - contentSystem->Process( &castOffSystems, params ); + contentSystem->Process( &castOffSystems, ¶ms ); delete contentSystem; //LogDebug("Layout: %d systems", contentPage->GetSystemCount()); @@ -347,7 +347,7 @@ void Doc::CastOff( ) params.push_back( &shift ); params.push_back( &pageFullHeight ); Functor castOffPages( &Object::CastOffPages ); - contentPage->Process( &castOffPages, params ); + contentPage->Process( &castOffPages, ¶ms ); delete contentPage; //LogDebug("Layout: %d pages", this->GetChildCount()); @@ -368,7 +368,7 @@ void Doc::UnCastOff( ) params.push_back( contentSystem ); Functor unCastOff( &Object::UnCastOff ); - this->Process( &unCastOff, params ); + this->Process( &unCastOff, ¶ms ); this->ClearChildren(); @@ -629,12 +629,12 @@ int Doc::GetAdjustedDrawingPageWidth() // Doc functors methods //---------------------------------------------------------------------------- -int Doc::PrepareLyricsEnd( ArrayPtrVoid params ) +int Doc::PrepareLyricsEnd( ArrayPtrVoid *params ) { // param 0: the current Syl // param 1: the last Note - Syl **currentSyl = static_cast(params[0]); - Note **lastNote = static_cast(params[1]); + Syl **currentSyl = static_cast((*params)[0]); + Note **lastNote = static_cast((*params)[1]); if ( (*currentSyl) && (*lastNote) ) { (*currentSyl)->SetEnd(*lastNote); diff --git a/src/dot.cpp b/src/dot.cpp index ca6bab286fa..65673b97bfb 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -42,17 +42,17 @@ void Dot::Reset() // Functors methods //---------------------------------------------------------------------------- -int Dot::PreparePointersByLayer( ArrayPtrVoid params ) +int Dot::PreparePointersByLayer( ArrayPtrVoid *params ) { // param 0: the current Note - Note **currentNote = static_cast(params[0]); + Note **currentNote = static_cast((*params)[0]); m_drawingNote = (*currentNote); return FUNCTOR_CONTINUE; } -int Dot::ResetDarwing( ArrayPtrVoid params ) +int Dot::ResetDarwing( ArrayPtrVoid *params ) { this->m_drawingNote = NULL; return FUNCTOR_CONTINUE; diff --git a/src/durationinterface.cpp b/src/durationinterface.cpp index 5abe3cf4736..a5df06aa905 100644 --- a/src/durationinterface.cpp +++ b/src/durationinterface.cpp @@ -27,7 +27,7 @@ namespace vrv { // DurationInterface //---------------------------------------------------------------------------- -DurationInterface::DurationInterface(): +DurationInterface::DurationInterface(): AttInterface(), AttAugmentdots(), AttBeamsecondary(), AttDurationMusical(), @@ -36,6 +36,13 @@ DurationInterface::DurationInterface(): AttFermatapresent(), AttStaffident() { + RegisterInterfaceAttClass(ATT_AUGMENTDOTS); + RegisterInterfaceAttClass(ATT_BEAMSECONDARY); + RegisterInterfaceAttClass(ATT_DURATIONMUSICAL); + RegisterInterfaceAttClass(ATT_DURATIONPERFORMED); + RegisterInterfaceAttClass(ATT_DURATIONRATIO); + RegisterInterfaceAttClass(ATT_FERMATAPRESENT); + RegisterInterfaceAttClass(ATT_STAFFIDENT); Reset(); } @@ -104,7 +111,7 @@ double DurationInterface::GetAlignmentMensuralDuration( int num, int numbase, Me bool DurationInterface::IsInBeam( Object *noteOrRest ) { - Beam *beam = dynamic_cast( noteOrRest->GetFirstParent( &typeid(Beam), MAX_BEAM_DEPTH ) ); + Beam *beam = reinterpret_cast( noteOrRest->GetFirstParent( BEAM, MAX_BEAM_DEPTH ) ); if ( !beam ) { return false; } @@ -113,7 +120,7 @@ bool DurationInterface::IsInBeam( Object *noteOrRest ) bool DurationInterface::IsFirstInBeam( Object *noteOrRest ) { - Beam *beam = dynamic_cast( noteOrRest->GetFirstParent( &typeid(Beam), MAX_BEAM_DEPTH ) ); + Beam *beam = reinterpret_cast( noteOrRest->GetFirstParent( BEAM, MAX_BEAM_DEPTH ) ); if ( !beam ) { return false; } @@ -127,7 +134,7 @@ bool DurationInterface::IsFirstInBeam( Object *noteOrRest ) bool DurationInterface::IsLastInBeam( Object *noteOrRest ) { - Beam *beam = dynamic_cast( noteOrRest->GetFirstParent( &typeid(Beam), MAX_BEAM_DEPTH ) ); + Beam *beam = reinterpret_cast( noteOrRest->GetFirstParent( BEAM, MAX_BEAM_DEPTH ) ); if ( !beam ) { return false; } diff --git a/src/editorial.cpp b/src/editorial.cpp index a15033b04ca..2d763080179 100644 --- a/src/editorial.cpp +++ b/src/editorial.cpp @@ -27,20 +27,24 @@ namespace vrv { //---------------------------------------------------------------------------- EditorialElement::EditorialElement(): - DocObject("ee-") + DocObject("ee-"), + AttCommon() { + RegisterAttClass(ATT_COMMON); Reset(); } EditorialElement::EditorialElement(std::string classid): - DocObject(classid) + DocObject(classid), + AttCommon() { + RegisterAttClass(ATT_COMMON); Reset(); } void EditorialElement::Reset() { - Object::Reset(); + DocObject::Reset(); ResetCommon(); m_visibility = Visible; } @@ -126,8 +130,7 @@ App::App( EditorialLevel level ): void App::Reset() { - Object::Reset(); - ResetCommon(); + EditorialElement::Reset(); } App::~App() @@ -151,6 +154,7 @@ Lem::Lem( ): EditorialElement("lem-"), AttSource() { + RegisterAttClass(ATT_SOURCE); Reset(); } @@ -172,6 +176,7 @@ Rdg::Rdg( ): EditorialElement("rdg-"), AttSource() { + RegisterAttClass(ATT_SOURCE); Reset(); } @@ -193,6 +198,7 @@ Supplied::Supplied( ): EditorialElement("supplied-"), AttSource() { + RegisterAttClass(ATT_SOURCE); Reset(); } @@ -215,6 +221,8 @@ Annot::Annot( ): AttPlist(), AttSource() { + RegisterAttClass( ATT_PLIST ); + RegisterAttClass( ATT_SOURCE ); Reset(); } @@ -233,15 +241,15 @@ void Annot::Reset() // EditorialElement functor methods //---------------------------------------------------------------------------- -int EditorialElement::CastOffSystems( ArrayPtrVoid params ) +int EditorialElement::CastOffSystems( ArrayPtrVoid *params ) { // param 0: a pointer to the system we are taking the content from // param 1: a pointer the page we are adding system to (unused) // param 2: a pointer to the current system // param 3: the cummulated shift (m_drawingXRel of the first measure of the current system) (unused) // param 4: the system width (unused) - System *contentSystem = static_cast(params[0]); - System **currentSystem = static_cast(params[2]); + System *contentSystem = static_cast((*params)[0]); + System **currentSystem = static_cast((*params)[2]); // Since the functor returns FUNCTOR_SIBLINGS we should never go lower than the system children assert( dynamic_cast(this->m_parent)); diff --git a/src/iomei.cpp b/src/iomei.cpp index 5b06bead4b7..c5a635a8272 100644 --- a/src/iomei.cpp +++ b/src/iomei.cpp @@ -1716,7 +1716,7 @@ bool MeiInput::ReadMeiMRest( Object *parent, pugi::xml_node mRest ) bool MeiInput::ReadMeiMultiRest( Object *parent, pugi::xml_node multiRest ) { - MultiRest *vrvMultiRest = new MultiRest( 1 ); + MultiRest *vrvMultiRest = new MultiRest( ); ReadLayerElement(multiRest, vrvMultiRest); vrvMultiRest->ReadNumbered(multiRest); @@ -2262,8 +2262,8 @@ bool MeiInput::ReadTupletSpanAsTuplet( Measure *measure, pugi::xml_node tupletSp return false; } - LayerElement *startChild = dynamic_cast( start->GetLastParentNot( &typeid(Layer) ) ); - LayerElement *endChild = dynamic_cast( end->GetLastParentNot( &typeid(Layer) ) ); + LayerElement *startChild = reinterpret_cast( start->GetLastParentNot( LAYER ) ); + LayerElement *endChild = reinterpret_cast( end->GetLastParentNot( LAYER ) ); if ( !startChild || !endChild || (startChild->m_parent != endChild->m_parent) ) { LogWarning( "Start and end elements for '%s' not in the same layer", tuplet->GetUuid().c_str() ); diff --git a/src/keysig.cpp b/src/keysig.cpp index 93c0767867a..8d495d37f16 100644 --- a/src/keysig.cpp +++ b/src/keysig.cpp @@ -50,9 +50,11 @@ int KeySig::octave_map[2][9][7] = { }; KeySig::KeySig(): - LayerElement("ksig-") + LayerElement("ksig-"), + AttAccidental(), + AttPitch() { - Reset(); + Init(); } KeySig::KeySig(int num_alter, char alter): @@ -60,7 +62,8 @@ KeySig::KeySig(int num_alter, char alter): AttAccidental(), AttPitch() { - Reset(); + Init(); + m_num_alter = num_alter; m_alteration = alter; } @@ -70,7 +73,8 @@ KeySig::KeySig( KeySigAttr *keySigAttr ): AttAccidental(), AttPitch() { - Reset(); + Init(); + char key = keySigAttr->GetKeySig() - KEYSIGNATURE_0; /* see data_KEYSIGNATURE order; key will be: 0 for KEYSIGNATURE_0 @@ -92,6 +96,13 @@ KeySig::KeySig( KeySigAttr *keySigAttr ): } m_num_alter = abs(key); } + +void KeySig::Init() +{ + RegisterAttClass(ATT_ACCIDENTAL); + RegisterAttClass(ATT_PITCH); + Reset(); +} KeySig::~KeySig() { @@ -199,10 +210,10 @@ KeySigAttr::KeySigAttr(): Object(), AttKeySigDefaultLog() { + RegisterAttClass(ATT_KEYSIGDEFAULTLOG); Reset(); } - KeySigAttr::~KeySigAttr() { } diff --git a/src/layer.cpp b/src/layer.cpp index ad0913addcb..628e8d4f9f8 100644 --- a/src/layer.cpp +++ b/src/layer.cpp @@ -34,6 +34,7 @@ Layer::Layer( ): DocObject("layer-"), DrawingListInterface(), ObjectListInterface(), AttCommon() { + RegisterAttClass(ATT_COMMON); // own pointers need to be initialized before Reset() m_currentClef = NULL; m_currentKeySig = NULL; @@ -369,15 +370,15 @@ void Layer::RemoveClefAndCustos() // Layer functor methods //---------------------------------------------------------------------------- -int Layer::AlignHorizontally( ArrayPtrVoid params ) +int Layer::AlignHorizontally( ArrayPtrVoid *params ) { // param 0: the measureAligner (unused) // param 1: the time // param 2: the current Mensur // param 3: the current MeterSig - double *time = static_cast(params[1]); - Mensur **currentMensur = static_cast(params[2]); - MeterSig **currentMeterSig = static_cast(params[3]); + double *time = static_cast((*params)[1]); + Mensur **currentMensur = static_cast((*params)[2]); + MeterSig **currentMeterSig = static_cast((*params)[3]); // we need to call it because we are overriding Object::AlignHorizontally this->ResetHorizontalAlignment(); @@ -404,13 +405,13 @@ int Layer::AlignHorizontally( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } -int Layer::AlignHorizontallyEnd( ArrayPtrVoid params ) +int Layer::AlignHorizontallyEnd( ArrayPtrVoid *params ) { // param 0: the measureAligner // param 1: the time (unused) // param 2: the current Mensur (unused) // param 3: the current MeterSig (unused) - MeasureAligner **measureAligner = static_cast(params[0]); + MeasureAligner **measureAligner = static_cast((*params)[0]); int i; for(i = 0; i < (int)(*measureAligner)->m_children.size(); i++) { @@ -423,22 +424,22 @@ int Layer::AlignHorizontallyEnd( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } -int Layer::PrepareProcessingLists( ArrayPtrVoid params ) +int Layer::PrepareProcessingLists( ArrayPtrVoid *params ) { // param 0: the IntTree* for staff/layer/verse (unused) // param 1: the IntTree* for staff/layer - IntTree *tree = static_cast(params[1]); + IntTree *tree = static_cast((*params)[1]); // Alternate solution with StaffN_LayerN_VerseN_t - //StaffN_LayerN_VerseN_t *tree = static_cast(params[0]); + //StaffN_LayerN_VerseN_t *tree = static_cast((*params)[0]); - Staff *staff = dynamic_cast( this->GetFirstParent( &typeid( Staff ) ) ); + Staff *staff = reinterpret_cast( this->GetFirstParent( STAFF ) ); assert( staff ); tree->child[ staff->GetN() ].child[ this->GetN() ]; return FUNCTOR_CONTINUE; } -int Layer::SetDrawingXY( ArrayPtrVoid params ) +int Layer::SetDrawingXY( ArrayPtrVoid *params ) { // param 0: a pointer doc (unused) // param 1: a pointer to the current system (unused) @@ -447,9 +448,9 @@ int Layer::SetDrawingXY( ArrayPtrVoid params ) // param 4: a pointer to the current layer // param 5: a pointer to the view (unused) // param 6: a bool indicating if we are processing layer elements or not - Measure **currentMeasure = static_cast(params[2]); - Layer **currentLayer = static_cast(params[4]); - bool *processLayerElements = static_cast(params[6]); + Measure **currentMeasure = static_cast((*params)[2]); + Layer **currentLayer = static_cast((*params)[4]); + bool *processLayerElements = static_cast((*params)[6]); (*currentLayer) = this; diff --git a/src/layerelement.cpp b/src/layerelement.cpp index c4a22ac92b1..e67f64f19a6 100644 --- a/src/layerelement.cpp +++ b/src/layerelement.cpp @@ -143,37 +143,37 @@ void LayerElement::ResetHorizontalAlignment() bool LayerElement::IsAccid( ) { - return (dynamic_cast(this)); + return (this->Is() == ACCID); } bool LayerElement::IsBarline() { - return (dynamic_cast(this)); + return (this->Is() == BAR_LINE); } bool LayerElement::IsBeam() { - return (dynamic_cast(this)); + return (this->Is() == BEAM); } bool LayerElement::IsChord() { - return (dynamic_cast(this)); + return (this->Is() == CHORD); } bool LayerElement::IsClef() { - return (dynamic_cast(this)); + return (this->Is() == CLEF); } bool LayerElement::IsCustos( ) { - return (dynamic_cast(this)); + return (this->Is() == CUSTOS); } bool LayerElement::IsDot( ) { - return (dynamic_cast(this)); + return (this->Is() == DOT); } bool LayerElement::HasDurationInterface() @@ -183,33 +183,33 @@ bool LayerElement::HasDurationInterface() bool LayerElement::IsKeySig() { - return (dynamic_cast(this)); + return (this->Is() == KEY_SIG); } bool LayerElement::IsMRest() { - return (dynamic_cast(this)); + return (this->Is() == MREST); } bool LayerElement::IsMultiRest() { - return (dynamic_cast(this)); + return (this->Is() == MULTI_REST); } -bool LayerElement::IsMensur() -{ - return (dynamic_cast(this)); +bool LayerElement::IsMensur() +{ + return (this->Is() == MENSUR); } bool LayerElement::IsMeterSig() { - return (dynamic_cast(this)); + return (this->Is() == METER_SIG); } bool LayerElement::IsNote() { - return (dynamic_cast(this)); + return (this->Is() == NOTE); } bool LayerElement::IsGraceNote() @@ -261,7 +261,7 @@ bool LayerElement::IsVerse() bool LayerElement::IsCueSize() { if (this->IsNote()) return dynamic_cast(this)->HasGrace(); - Note *note = dynamic_cast(this->GetFirstParent(&typeid(Note), MAX_ACCID_DEPTH ) ); + Note *note = reinterpret_cast(this->GetFirstParent( NOTE, MAX_ACCID_DEPTH ) ); return ( note && ( note->HasGrace() ) ); } @@ -289,7 +289,7 @@ double LayerElement::GetAlignmentDuration( Mensur *mensur, MeterSig *meterSig, b } if ( HasDurationInterface() ) { - Tuplet *tuplet = dynamic_cast( this->GetFirstParent( &typeid(Tuplet), MAX_TUPLET_DEPTH ) ); + Tuplet *tuplet = reinterpret_cast( this->GetFirstParent( TUPLET, MAX_TUPLET_DEPTH ) ); int num = 1; int numbase = 1; if ( tuplet ) { @@ -317,22 +317,22 @@ int LayerElement::GetXRel() // LayerElement functors methods //---------------------------------------------------------------------------- -int LayerElement::AlignHorizontally( ArrayPtrVoid params ) +int LayerElement::AlignHorizontally( ArrayPtrVoid *params ) { // param 0: the measureAligner // param 1: the time // param 2: the current Mensur // param 3: the current MeterSig (unused) - MeasureAligner **measureAligner = static_cast(params[0]); - double *time = static_cast(params[1]); - Mensur **currentMensur = static_cast(params[2]); - MeterSig **currentMeterSig = static_cast(params[3]); + MeasureAligner **measureAligner = static_cast((*params)[0]); + double *time = static_cast((*params)[1]); + Mensur **currentMensur = static_cast((*params)[2]); + MeterSig **currentMeterSig = static_cast((*params)[3]); // we need to call it because we are overriding Object::AlignHorizontally this->ResetHorizontalAlignment(); - Chord* chordParent = dynamic_cast(this->GetFirstParent( &typeid( Chord ), MAX_CHORD_DEPTH)); + Chord* chordParent = reinterpret_cast(this->GetFirstParent( CHORD, MAX_CHORD_DEPTH)); if( chordParent ) { m_alignment = chordParent->GetAlignment(); @@ -413,11 +413,11 @@ int LayerElement::AlignHorizontally( ArrayPtrVoid params ) } -int LayerElement::PrepareTimeSpanning( ArrayPtrVoid params ) +int LayerElement::PrepareTimeSpanning( ArrayPtrVoid *params ) { // param 0: std::vector* that holds the current elements to match // param 1: bool* fillList for indicating whether the elements have to be stack or not (unused) - std::vector *elements = static_cast*>(params[0]); + std::vector *elements = static_cast*>((*params)[0]); std::vector::iterator iter = elements->begin(); while ( iter != elements->end()) { @@ -434,7 +434,7 @@ int LayerElement::PrepareTimeSpanning( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } -int LayerElement::SetDrawingXY( ArrayPtrVoid params ) +int LayerElement::SetDrawingXY( ArrayPtrVoid *params ) { // param 0: a pointer doc // param 1: a pointer to the current system (unused) @@ -443,12 +443,12 @@ int LayerElement::SetDrawingXY( ArrayPtrVoid params ) // param 4: a pointer to the current layer // param 5: a pointer to the view // param 6: a bool indicating if we are processing layer elements or not - Doc *doc = static_cast(params[0]); - Measure **currentMeasure = static_cast(params[2]); - Staff **currentStaff = static_cast(params[3]); - Layer **currentLayer = static_cast(params[4]); - View *view = static_cast(params[5]); - bool *processLayerElements = static_cast(params[6]); + Doc *doc = static_cast((*params)[0]); + Measure **currentMeasure = static_cast((*params)[2]); + Staff **currentStaff = static_cast((*params)[3]); + Layer **currentLayer = static_cast((*params)[4]); + View *view = static_cast((*params)[5]); + bool *processLayerElements = static_cast((*params)[6]); // First pass, only set the X position if ((*processLayerElements)==false) { @@ -479,7 +479,7 @@ int LayerElement::SetDrawingXY( ArrayPtrVoid params ) // If we have one, make is available in m_crossStaff DurationInterface *durElement = dynamic_cast(this); if ( durElement && durElement->HasStaff()) { - AttCommonNComparison comparisonFirst( &typeid(Staff), durElement->GetStaff() ); + AttCommonNComparison comparisonFirst( STAFF, durElement->GetStaff() ); m_crossStaff = dynamic_cast((*currentMeasure)->FindChildByAttComparison(&comparisonFirst, 1)); if (m_crossStaff) { if (m_crossStaff == (*currentStaff)) LogWarning("The cross staff reference '%d' for element '%s' seems to be identical to the parent staff", durElement->GetStaff(), this->GetUuid().c_str()); @@ -487,7 +487,7 @@ int LayerElement::SetDrawingXY( ArrayPtrVoid params ) int layerN = (*currentLayer)->GetN(); // When we will have allowed @layer in , we will have to do: // int layerN = durElement->HasLayer() ? durElement->GetLayer() : (*currentLayer)->GetN(); - AttCommonNComparison comparisonFirstLayer( &typeid(Layer), layerN ); + AttCommonNComparison comparisonFirstLayer( LAYER, layerN ); m_crossLayer = dynamic_cast(m_crossStaff->FindChildByAttComparison(&comparisonFirstLayer, 1)); if (m_crossLayer) { // Now we need to yet the element at the same position in the cross-staff layer of getting the right clef diff --git a/src/measure.cpp b/src/measure.cpp index ac77c64fe10..aaad543dcce 100644 --- a/src/measure.cpp +++ b/src/measure.cpp @@ -31,7 +31,9 @@ Measure::Measure( bool measureMusic, int logMeasureNb ): DocObject("measure-"), AttCommon(), AttMeasureLog() -{ +{ + RegisterAttClass(ATT_COMMON); + RegisterAttClass(ATT_MEASURELOG); m_measuredMusic = measureMusic; // We set parent to it because we want to access the parent doc from the aligners // See Object::SetParentDoc() @@ -118,13 +120,13 @@ int Measure::GetWidth() // Measure functor methods //---------------------------------------------------------------------------- -int Measure::AlignHorizontally( ArrayPtrVoid params ) +int Measure::AlignHorizontally( ArrayPtrVoid *params ) { // param 0: the measureAligner // param 1: the time (unused) // param 2: the current Mensur (unused) // param 3: the current MeterSig (unused) - MeasureAligner **measureAligner = static_cast(params[0]); + MeasureAligner **measureAligner = static_cast((*params)[0]); // we need to call it because we are overriding Object::AlignHorizontally this->ResetHorizontalAlignment(); @@ -151,11 +153,11 @@ int Measure::AlignHorizontally( ArrayPtrVoid params ) } -int Measure::AlignVertically( ArrayPtrVoid params ) +int Measure::AlignVertically( ArrayPtrVoid *params ) { // param 0: the systemAligner (unused) // param 1: the staffNb - int *staffNb = static_cast(params[1]); + int *staffNb = static_cast((*params)[1]); // we need to call it because we are overriding Object::AlignVertically this->ResetVerticalAlignment(); @@ -166,50 +168,50 @@ int Measure::AlignVertically( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } -int Measure::IntegrateBoundingBoxGraceXShift( ArrayPtrVoid params ) +int Measure::IntegrateBoundingBoxGraceXShift( ArrayPtrVoid *params ) { // param 0: the functor to be redirected to Aligner - Functor *integrateBoundingBoxGraceXShift = static_cast(params[0]); + Functor *integrateBoundingBoxGraceXShift = static_cast((*params)[0]); m_measureAligner.Process( integrateBoundingBoxGraceXShift, params ); return FUNCTOR_SIBLINGS; } -int Measure::IntegrateBoundingBoxXShift( ArrayPtrVoid params ) +int Measure::IntegrateBoundingBoxXShift( ArrayPtrVoid *params ) { // param 0: the cumulated shift (unused) // param 1: the cumulated justifiable shift (unused) // param 2: the functor to be redirected to Aligner - Functor *integrateBoundingBoxShift = static_cast(params[2]); + Functor *integrateBoundingBoxShift = static_cast((*params)[2]); m_measureAligner.Process( integrateBoundingBoxShift, params ); return FUNCTOR_SIBLINGS; } -int Measure::SetAligmentXPos( ArrayPtrVoid params ) +int Measure::SetAligmentXPos( ArrayPtrVoid *params ) { // param 0: the previous time position (unused) // param 1: the previous x rel position (unused) // param 2: the minimum measure width (unused) // param 3: the functor to be redirected to Aligner - Functor *setAligmnentPosX = static_cast(params[3]); + Functor *setAligmnentPosX = static_cast((*params)[3]); m_measureAligner.Process( setAligmnentPosX, params); return FUNCTOR_SIBLINGS; } -int Measure::JustifyX( ArrayPtrVoid params ) +int Measure::JustifyX( ArrayPtrVoid *params ) { // param 0: the justification ratio // param 1: the justification ratio for the measure (depends on the margin) (unused) // param 2: the non justifiable margin (unused) // param 3: the system full width (without system margins) (unused) // param 4: the functor to be redirected to the MeasureAligner - double *ratio = static_cast(params[0]); - Functor *justifyX = static_cast(params[4]); + double *ratio = static_cast((*params)[0]); + Functor *justifyX = static_cast((*params)[4]); this->m_drawingXRel = ceil((*ratio) * (double)this->m_drawingXRel); @@ -219,10 +221,10 @@ int Measure::JustifyX( ArrayPtrVoid params ) } -int Measure::AlignMeasures( ArrayPtrVoid params ) +int Measure::AlignMeasures( ArrayPtrVoid *params ) { // param 0: the cumulated shift - int *shift = static_cast(params[0]); + int *shift = static_cast((*params)[0]); this->m_drawingXRel = (*shift); @@ -239,18 +241,18 @@ int Measure::AlignMeasures( ArrayPtrVoid params ) return FUNCTOR_SIBLINGS; } -int Measure::CastOffSystems( ArrayPtrVoid params ) +int Measure::CastOffSystems( ArrayPtrVoid *params ) { // param 0: a pointer to the system we are taking the content from // param 1: a pointer the page we are adding system to // param 2: a pointer to the current system // param 3: the cummulated shift (m_drawingXRel of the first measure of the current system) // param 4: the system width - System *contentSystem = static_cast(params[0]); - Page *page = static_cast(params[1]); - System **currentSystem = static_cast(params[2]); - int *shift = static_cast(params[3]); - int *systemWidth = static_cast(params[4]); + System *contentSystem = static_cast((*params)[0]); + Page *page = static_cast((*params)[1]); + System **currentSystem = static_cast((*params)[2]); + int *shift = static_cast((*params)[3]); + int *systemWidth = static_cast((*params)[4]); if ( ( (*currentSystem)->GetChildCount() > 0 ) && ( this->m_drawingXRel + this->GetWidth() - (*shift) > (*systemWidth) ) ) { (*currentSystem) = new System(); @@ -268,7 +270,7 @@ int Measure::CastOffSystems( ArrayPtrVoid params ) return FUNCTOR_SIBLINGS; } -int Measure::SetDrawingXY( ArrayPtrVoid params ) +int Measure::SetDrawingXY( ArrayPtrVoid *params ) { // param 0: a pointer doc // param 1: a pointer to the current system @@ -277,10 +279,10 @@ int Measure::SetDrawingXY( ArrayPtrVoid params ) // param 4: a pointer to the current layer (unused) // param 5: a pointer to the view (unused) // param 6: a bool indicating if we are processing layer elements or not - Doc *doc = static_cast(params[0]); - System **currentSystem = static_cast(params[1]); - Measure **currentMeasure = static_cast(params[2]); - bool *processLayerElements = static_cast(params[6]); + Doc *doc = static_cast((*params)[0]); + System **currentSystem = static_cast((*params)[1]); + Measure **currentMeasure = static_cast((*params)[2]); + bool *processLayerElements = static_cast((*params)[6]); (*currentMeasure) = this; diff --git a/src/mensur.cpp b/src/mensur.cpp index 596e0dff45c..66744a6b687 100644 --- a/src/mensur.cpp +++ b/src/mensur.cpp @@ -25,13 +25,14 @@ Mensur::Mensur(): AttMensurVis(), AttSlashcount() { - Reset(); + Init(); } Mensur::Mensur( MensurAttr *mensurAttr ): LayerElement("mensur-") { - Mensur(); + Init(); + this->SetDot(mensurAttr->GetMensurDot()); this->SetSign(mensurAttr->GetMensurSign()); this->SetSlash(mensurAttr->GetMensurSlash()); @@ -46,6 +47,16 @@ Mensur::Mensur( MensurAttr *mensurAttr ): // It is unclear why we don't have mensur.num and mensur.numbase attributes // in att.mensura.default.log - ask Perry... } + +void Mensur::Init() +{ + RegisterAttClass(ATT_DURATIONRATIO); + RegisterAttClass(ATT_MENSURALSHARED); + RegisterAttClass(ATT_MENSURLOG); + RegisterAttClass(ATT_METERSIGVIS); + RegisterAttClass(ATT_SLASHCOUNT); + Reset(); +} Mensur::~Mensur() { diff --git a/src/metersig.cpp b/src/metersig.cpp index f07aa7c4209..d009fc3970b 100644 --- a/src/metersig.cpp +++ b/src/metersig.cpp @@ -18,19 +18,25 @@ MeterSig::MeterSig(): LayerElement("msig-"), AttMeterSigLog() { - Reset(); + Init(); } MeterSig::MeterSig( MeterSigAttr *meterSigAttr ): LayerElement("msig-"), AttMeterSigLog() { - Reset(); + Init(); + this->SetCount(meterSigAttr->GetMeterCount()); this->SetSym(meterSigAttr->GetMeterSym()); this->SetUnit(meterSigAttr->GetMeterUnit()); } - + +void MeterSig::Init() +{ + RegisterAttClass(ATT_METERSIGLOG); + Reset(); +} MeterSig::~MeterSig() { @@ -51,6 +57,8 @@ MeterSigAttr::MeterSigAttr(): AttMeterSigDefaultLog(), AttMeterSigDefaultVis() { + RegisterAttClass(ATT_METERSIGDEFAULTLOG); + RegisterAttClass(ATT_METERSIGDEFAULTVIS); Reset(); } diff --git a/src/multirest.cpp b/src/multirest.cpp index 04c834388ac..d4742ae4cfc 100644 --- a/src/multirest.cpp +++ b/src/multirest.cpp @@ -18,16 +18,10 @@ MultiRest::MultiRest(): LayerElement("multirest-"), AttNumbered() { + RegisterAttClass(ATT_NUMBERED); Reset(); } -MultiRest::MultiRest(int number): - LayerElement("multirest-") -{ - Reset(); -} - - MultiRest::~MultiRest() { } diff --git a/src/note.cpp b/src/note.cpp index bb759aaed31..5d6b55db1a0 100644 --- a/src/note.cpp +++ b/src/note.cpp @@ -34,9 +34,18 @@ Note::Note(): AttStemmed(), AttTiepresent() { + RegisterAttClass(ATT_COLORATION); + RegisterAttClass(ATT_GRACED); + RegisterAttClass(ATT_NOTELOGMENSURAL); + RegisterAttClass(ATT_STEMMED); + RegisterAttClass(ATT_TIEPRESENT); + + RegisterInterface( DurationInterface::GetAttClasses(), DurationInterface::InterfaceId() ); + m_drawingTieAttr = NULL; m_drawingAccid = NULL; m_isDrawingAccidAttr = false; + Reset(); } @@ -132,12 +141,12 @@ void Note::ResetDrawingAccid( ) Chord* Note::IsChordTone() { - return dynamic_cast(this->GetFirstParent( &typeid( Chord ), MAX_CHORD_DEPTH)); + return reinterpret_cast(this->GetFirstParent( CHORD, MAX_CHORD_DEPTH)); } int Note::GetDrawingDur( ) { - Chord* chordParent = dynamic_cast(this->GetFirstParent( &typeid( Chord ), MAX_CHORD_DEPTH)); + Chord* chordParent = reinterpret_cast(this->GetFirstParent( CHORD, MAX_CHORD_DEPTH)); if( chordParent ) { return chordParent->GetActualDur(); } @@ -161,8 +170,8 @@ bool Note::HasDrawingStemDir() data_STEMDIRECTION Note::GetDrawingStemDir() { - Chord* chordParent = dynamic_cast(this->GetFirstParent( &typeid( Chord ), MAX_CHORD_DEPTH)); - Beam* beamParent = dynamic_cast(this->GetFirstParent( &typeid( Beam ), MAX_BEAM_DEPTH)); + Chord* chordParent = reinterpret_cast(this->GetFirstParent( CHORD, MAX_CHORD_DEPTH)); + Beam* beamParent = reinterpret_cast(this->GetFirstParent( BEAM, MAX_BEAM_DEPTH)); if( chordParent ) { return chordParent->GetDrawingStemDir(); } @@ -178,12 +187,12 @@ data_STEMDIRECTION Note::GetDrawingStemDir() // Functors methods //---------------------------------------------------------------------------- -int Note::PrepareTieAttr( ArrayPtrVoid params ) +int Note::PrepareTieAttr( ArrayPtrVoid *params ) { // param 0: std::vector* that holds the current notes with open ties // param 1: Chord** currentChord for the current chord if in a chord - std::vector *currentNotes = static_cast*>(params[0]); - Chord **currentChord = static_cast(params[1]); + std::vector *currentNotes = static_cast*>((*params)[0]); + Chord **currentChord = static_cast((*params)[1]); AttTiepresent *check = this; if ((*currentChord)) { @@ -220,7 +229,7 @@ int Note::PrepareTieAttr( ArrayPtrVoid params ) } -int Note::FillStaffCurrentTimeSpanning( ArrayPtrVoid params ) +int Note::FillStaffCurrentTimeSpanning( ArrayPtrVoid *params ) { // Pass it to the pseudo functor of the interface if (this->m_drawingTieAttr) { @@ -229,13 +238,13 @@ int Note::FillStaffCurrentTimeSpanning( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } -int Note::PrepareLyrics( ArrayPtrVoid params ) +int Note::PrepareLyrics( ArrayPtrVoid *params ) { // param 0: the current Syl (unused) // param 1: the last Note // param 2: the last but one Note - Note **lastNote = static_cast(params[1]); - Note **lastButOneNote = static_cast(params[2]); + Note **lastNote = static_cast((*params)[1]); + Note **lastButOneNote = static_cast((*params)[2]); (*lastButOneNote) = (*lastNote); (*lastNote) = this; @@ -243,10 +252,10 @@ int Note::PrepareLyrics( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } -int Note::PreparePointersByLayer( ArrayPtrVoid params ) +int Note::PreparePointersByLayer( ArrayPtrVoid *params ) { // param 0: the current Note - Note **currentNote = static_cast(params[0]); + Note **currentNote = static_cast((*params)[0]); this->ResetDrawingAccid(); if (this->GetAccid() != ACCIDENTAL_EXPLICIT_NONE) { @@ -264,7 +273,7 @@ int Note::PreparePointersByLayer( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } -int Note::ResetDarwing( ArrayPtrVoid params ) +int Note::ResetDarwing( ArrayPtrVoid *params ) { this->ResetDrawingTieAttr(); return FUNCTOR_CONTINUE; diff --git a/src/object.cpp b/src/object.cpp index d21aa0d27f9..a9172fdbb9c 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -107,6 +107,18 @@ void Object::Init(std::string classid) m_classid = classid; this->GenerateUuid(); } + +int Object::Is() +{ + // we should always have the method overwritten + assert( false ); + return OBJECT; +}; + +void Object::RegisterInterface( std::vector *attClasses, int interfaceId ) +{ + +} void Object::MoveChildren( Object *object ) { @@ -241,13 +253,13 @@ Object *Object::FindChildByUuid( std::string uuid, int deepness, bool direction ArrayPtrVoid params; params.push_back( &uuid ); params.push_back( &element ); - this->Process( &findByUuid, params, NULL, NULL, deepness, direction ); + this->Process( &findByUuid, ¶ms, NULL, NULL, deepness, direction ); return element; } -Object *Object::FindChildByType(const std::type_info *elementType, int deepness, bool direction ) +Object *Object::FindChildByType( int classId, int deepness, bool direction ) { - AttComparison attComparison( elementType ); + AttComparison attComparison( classId ); return FindChildByAttComparison( &attComparison, deepness, direction ); } @@ -258,7 +270,7 @@ Object *Object::FindChildByAttComparison( AttComparison *attComparison, int deep ArrayPtrVoid params; params.push_back( attComparison ); params.push_back( &element ); - this->Process( &findByAttComparison, params, NULL, NULL, deepness, direction ); + this->Process( &findByAttComparison, ¶ms, NULL, NULL, deepness, direction ); return element; } @@ -355,7 +367,7 @@ void Object::FillFlatList( ListOfObjects *flatList ) Functor addToFlatList( &Object::AddLayerElementToFlatList ); ArrayPtrVoid params; params.push_back ( &flatList ); - this->Process( &addToFlatList, params ); + this->Process( &addToFlatList, ¶ms ); /* // For debuging ListOfObjects::iterator iter; @@ -381,13 +393,13 @@ void Object::AddSameAs( std::string id, std::string filename ) m_sameAs += sameAs; } -Object *Object::GetFirstParent( const std::type_info *elementType, int maxSteps ) +Object *Object::GetFirstParent( const int elementType, int maxSteps ) { if ( (maxSteps == 0) || !m_parent ) { return NULL; } - if ( typeid(*m_parent) == *elementType ) { + if ( m_parent->Is() == elementType ) { return m_parent; } else { @@ -396,13 +408,13 @@ Object *Object::GetFirstParent( const std::type_info *elementType, int maxSteps } -Object *Object::GetLastParentNot( const std::type_info *elementType, int maxSteps ) +Object *Object::GetLastParentNot( const int elementType, int maxSteps ) { if ( (maxSteps == 0) || !m_parent ) { return NULL; } - if ( typeid(*m_parent) == *elementType ) { + if ( m_parent->Is() == elementType ) { return this; } else { @@ -514,16 +526,18 @@ bool Object::GetSameAs( std::string *id, std::string *filename, int idx ) return false; } -void Object::Process(Functor *functor, ArrayPtrVoid params, Functor *endFunctor, ArrayOfAttComparisons *filters, int deepness, bool direction ) +void Object::Process(Functor *functor, ArrayPtrVoid *params, Functor *endFunctor, ArrayOfAttComparisons *filters, int deepness, bool direction ) { if (functor->m_returnCode == FUNCTOR_STOP) { return; } + /* EditorialElement *editorialElement = dynamic_cast(this); if (functor->m_visibleOnly && editorialElement && ( editorialElement->m_visibility == Hidden ) ) { return; } + */ functor->Call( this, params ); @@ -533,10 +547,10 @@ void Object::Process(Functor *functor, ArrayPtrVoid params, Functor *endFunctor, return; } - else if (dynamic_cast(this)) { + //else if (dynamic_cast(this)) { // since editorial object do not count, we re-increase the deepness limit - deepness++; - } + // deepness++; + //} if (deepness == 0) { // any need to change the functor m_returnCode? return; @@ -564,7 +578,7 @@ void Object::Process(Functor *functor, ArrayPtrVoid params, Functor *endFunctor, // if yes, we will use it (*attComparisonIter) for evaluating if the object matches // the attribute (see below) Object *o = *iter; - if ((*attComparisonIter)->GetType() == &typeid(*o)) { + if (o->Is() == (*attComparisonIter)->GetType() ) { hasAttComparison = true; break; } @@ -601,7 +615,7 @@ int Object::Save( FileOutputStream *output ) // Special case where we want to process all objects save.m_visibleOnly = false; Functor saveEnd( &Object::SaveEnd ); - this->Process( &save, params, &saveEnd ); + this->Process( &save, ¶ms, &saveEnd ); return true; } @@ -836,14 +850,14 @@ Functor::Functor( ) obj_fpt = NULL; } -Functor::Functor( int(Object::*_obj_fpt)( ArrayPtrVoid )) +Functor::Functor( int(Object::*_obj_fpt)( ArrayPtrVoid* )) { m_returnCode = FUNCTOR_CONTINUE; m_visibleOnly = true; obj_fpt = _obj_fpt; } -void Functor::Call( Object *ptr, ArrayPtrVoid params ) +void Functor::Call( Object *ptr, ArrayPtrVoid *params ) { // we should have return codes (not just bool) for avoiding to go further down the tree in some cases m_returnCode = (*ptr.*obj_fpt)( params ); @@ -853,22 +867,22 @@ void Functor::Call( Object *ptr, ArrayPtrVoid params ) // Object functor methods //---------------------------------------------------------------------------- -int Object::AddLayerElementToFlatList( ArrayPtrVoid params ) +int Object::AddLayerElementToFlatList( ArrayPtrVoid *params ) { // param 0: the ListOfObjects - ListOfObjects **list = static_cast(params[0]); + ListOfObjects **list = static_cast((*params)[0]); //if ( dynamic_cast(this ) ) { (*list)->push_back( this ); //} return FUNCTOR_CONTINUE; } -int Object::FindByUuid( ArrayPtrVoid params ) +int Object::FindByUuid( ArrayPtrVoid *params ) { // param 0: the uuid we are looking for // param 1: the pointer to pointer to the Object - std::string *uuid = static_cast(params[0]); - Object **element = static_cast(params[1]); + std::string *uuid = static_cast((*params)[0]); + Object **element = static_cast((*params)[1]); if ( (*element) ) { // this should not happen, but just in case @@ -884,12 +898,12 @@ int Object::FindByUuid( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } -int Object::FindByAttComparison( ArrayPtrVoid params ) +int Object::FindByAttComparison( ArrayPtrVoid *params ) { // param 0: the type we are looking for // param 1: the pointer to pointer to the Object - AttComparison *test = static_cast(params[0]); - Object **element = static_cast(params[1]); + AttComparison *test = static_cast((*params)[0]); + Object **element = static_cast((*params)[1]); if ( (*element) ) { // this should not happen, but just in case @@ -907,12 +921,12 @@ int Object::FindByAttComparison( ArrayPtrVoid params ) } -int Object::SetCurrentScoreDef( ArrayPtrVoid params ) +int Object::SetCurrentScoreDef( ArrayPtrVoid *params ) { // param 0: the current scoreDef - ScoreDef *currentScoreDef = static_cast(params[0]); - StaffDef **currentStaffDef = static_cast(params[1]); + ScoreDef *currentScoreDef = static_cast((*params)[0]); + StaffDef **currentStaffDef = static_cast((*params)[1]); assert( currentScoreDef ); @@ -1032,7 +1046,7 @@ int Object::SetCurrentScoreDef( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } -int Object::AlignHorizontally( ArrayPtrVoid params ) +int Object::AlignHorizontally( ArrayPtrVoid *params ) { // param 0: the measureAligner (unused) // param 1: the time (unused) @@ -1046,7 +1060,7 @@ int Object::AlignHorizontally( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } -int Object::AlignVertically( ArrayPtrVoid params ) +int Object::AlignVertically( ArrayPtrVoid *params ) { // param 0: the systemAligner (unused) // param 1: the staffNb (unused @@ -1058,12 +1072,12 @@ int Object::AlignVertically( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } -int Object::SetBoundingBoxGraceXShift( ArrayPtrVoid params ) +int Object::SetBoundingBoxGraceXShift( ArrayPtrVoid *params ) { // param 0: the minimu position (i.e., the width of the previous element) // param 1: the Doc - int *min_pos = static_cast(params[0]); - Doc *doc = static_cast(params[1]); + int *min_pos = static_cast((*params)[0]); + Doc *doc = static_cast((*params)[1]); // starting an new layer Layer *current_layer = dynamic_cast(this); @@ -1114,14 +1128,14 @@ int Object::SetBoundingBoxGraceXShift( ArrayPtrVoid params ) } -int Object::SetBoundingBoxXShift( ArrayPtrVoid params ) +int Object::SetBoundingBoxXShift( ArrayPtrVoid *params ) { // param 0: the minimu position (i.e., the width of the previous element) // param 1: the maximum width in the current measure // param 2: the Doc - int *min_pos = static_cast(params[0]); - int *measure_width = static_cast(params[1]); - Doc *doc = static_cast(params[2]); + int *min_pos = static_cast((*params)[0]); + int *measure_width = static_cast((*params)[1]); + Doc *doc = static_cast((*params)[2]); // starting a new measure Measure *current_measure = dynamic_cast(this); @@ -1173,7 +1187,7 @@ int Object::SetBoundingBoxXShift( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } - if ( current->IsNote() && dynamic_cast(current->GetFirstParent( &typeid( Chord ), MAX_CHORD_DEPTH ) ) ) { + if ( current->IsNote() && reinterpret_cast(current->GetFirstParent( CHORD, MAX_CHORD_DEPTH ) ) ) { return FUNCTOR_CONTINUE; } @@ -1189,7 +1203,7 @@ int Object::SetBoundingBoxXShift( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } - if ( current->IsAccid() && dynamic_cast(current->GetFirstParent( &typeid( Note ), MAX_ACCID_DEPTH ) ) ) { + if ( current->IsAccid() && reinterpret_cast(current->GetFirstParent( NOTE, MAX_ACCID_DEPTH ) ) ) { return FUNCTOR_CONTINUE; } @@ -1245,12 +1259,12 @@ int Object::SetBoundingBoxXShift( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } -int Object::SetBoundingBoxXShiftEnd( ArrayPtrVoid params ) +int Object::SetBoundingBoxXShiftEnd( ArrayPtrVoid *params ) { // param 0: the minimu position (i.e., the width of the previous element) // param 1: the maximum width in the current measure - int *min_pos = static_cast(params[0]); - int *measure_width = static_cast(params[1]); + int *min_pos = static_cast((*params)[0]); + int *measure_width = static_cast((*params)[1]); // ending a measure Measure *current_measure = dynamic_cast(this); @@ -1276,12 +1290,12 @@ int Object::SetBoundingBoxXShiftEnd( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } -int Object::SetBoundingBoxYShift( ArrayPtrVoid params ) +int Object::SetBoundingBoxYShift( ArrayPtrVoid *params ) { // param 0: the position of the previous staff // param 1: the maximum height in the current system - int *min_pos = static_cast(params[0]); - int *system_height = static_cast(params[1]); + int *min_pos = static_cast((*params)[0]); + int *system_height = static_cast((*params)[1]); // starting a new system System *current_system = dynamic_cast(this); @@ -1333,12 +1347,12 @@ int Object::SetBoundingBoxYShift( ArrayPtrVoid params ) return FUNCTOR_SIBLINGS; } -int Object::SetBoundingBoxYShiftEnd( ArrayPtrVoid params ) +int Object::SetBoundingBoxYShiftEnd( ArrayPtrVoid *params ) { // param 0: the position of the previous staff // param 1: the maximum height in the current system - int *min_pos = static_cast(params[0]); - int *system_height = static_cast(params[1]); + int *min_pos = static_cast((*params)[0]); + int *system_height = static_cast((*params)[1]); // ending a measure Measure *current_measure = dynamic_cast(this); @@ -1354,10 +1368,10 @@ int Object::SetBoundingBoxYShiftEnd( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } -int Object::Save( ArrayPtrVoid params ) +int Object::Save( ArrayPtrVoid *params ) { // param 0: output stream - FileOutputStream *output = static_cast(params[0]); + FileOutputStream *output = static_cast((*params)[0]); if (!output->WriteObject( this )) { return FUNCTOR_STOP; } @@ -1365,10 +1379,10 @@ int Object::Save( ArrayPtrVoid params ) } -int Object::SaveEnd( ArrayPtrVoid params ) +int Object::SaveEnd( ArrayPtrVoid *params ) { // param 0: output stream - FileOutputStream *output = static_cast(params[0]); + FileOutputStream *output = static_cast((*params)[0]); if (!output->WriteObjectEnd( this )) { return FUNCTOR_STOP; } diff --git a/src/page.cpp b/src/page.cpp index 0b453a92b78..4efa976c435 100644 --- a/src/page.cpp +++ b/src/page.cpp @@ -134,7 +134,7 @@ void Page::LayOutHorizontally( ) params.push_back( ¤tMeterSig ); Functor alignHorizontally( &Object::AlignHorizontally ); Functor alignHorizontallyEnd( &Object::AlignHorizontallyEnd ); - this->Process( &alignHorizontally, params, &alignHorizontallyEnd ); + this->Process( &alignHorizontally, ¶ms, &alignHorizontallyEnd ); // Set the X position of each Alignment // Does a duration-based non linear spacing looking at the duration space between two Alignment objects @@ -148,7 +148,7 @@ void Page::LayOutHorizontally( ) Functor setAlignmentX( &Object::SetAligmentXPos ); // Special case: because we redirect the functor, pass is a parameter to itself (!) params.push_back( &setAlignmentX ); - this->Process( &setAlignmentX, params ); + this->Process( &setAlignmentX, ¶ms ); // Render it for filling the bounding boxing View view; @@ -165,7 +165,7 @@ void Page::LayOutHorizontally( ) params.push_back( &grace_min_pos ); params.push_back( doc ); Functor setBoundingBoxGraceXShift( &Object::SetBoundingBoxGraceXShift ); - this->Process( &setBoundingBoxGraceXShift, params ); + this->Process( &setBoundingBoxGraceXShift, ¶ms ); // Integrate the X bounding box shift of the elements // Once the m_xShift have been calculated, move all positions accordingly @@ -173,7 +173,7 @@ void Page::LayOutHorizontally( ) Functor integrateBoundingBoxGraceXShift( &Object::IntegrateBoundingBoxGraceXShift ); // special case: because we redirect the functor, pass is a parameter to itself (!) params.push_back( &integrateBoundingBoxGraceXShift ); - this->Process( &integrateBoundingBoxGraceXShift, params ); + this->Process( &integrateBoundingBoxGraceXShift, ¶ms ); // Adjust the X shift of the Alignment looking at the bounding boxes // Look at each LayerElement and changes the m_xShift if the bouding box is overlapping @@ -185,7 +185,7 @@ void Page::LayOutHorizontally( ) params.push_back( doc ); Functor setBoundingBoxXShift( &Object::SetBoundingBoxXShift ); Functor setBoundingBoxXShiftEnd( &Object::SetBoundingBoxXShiftEnd ); - this->Process( &setBoundingBoxXShift, params, &setBoundingBoxXShiftEnd ); + this->Process( &setBoundingBoxXShift, ¶ms, &setBoundingBoxXShiftEnd ); // Integrate the X bounding box shift of the elements // Once the m_xShift have been calculated, move all positions accordingly @@ -197,7 +197,7 @@ void Page::LayOutHorizontally( ) Functor integrateBoundingBoxXShift( &Object::IntegrateBoundingBoxXShift ); // special case: because we redirect the functor, pass is a parameter to itself (!) params.push_back( &integrateBoundingBoxXShift ); - this->Process( &integrateBoundingBoxXShift, params ); + this->Process( &integrateBoundingBoxXShift, ¶ms ); // Adjust measure X position params.clear(); @@ -205,7 +205,7 @@ void Page::LayOutHorizontally( ) params.push_back( &shift ); Functor alignMeasures( &Object::AlignMeasures ); Functor alignMeasuresEnd( &Object::AlignMeasuresEnd ); - this->Process( &alignMeasures, params, &alignMeasuresEnd ); + this->Process( &alignMeasures, ¶ms, &alignMeasuresEnd ); } void Page::LayOutVertically( ) @@ -230,7 +230,7 @@ void Page::LayOutVertically( ) params.push_back( &systemAlignerPtr ); params.push_back( &staffNb ); Functor alignVertically( &Object::AlignVertically ); - this->Process( &alignVertically, params ); + this->Process( &alignVertically, ¶ms ); // Render it for filling the bounding boxing View view; @@ -249,7 +249,7 @@ void Page::LayOutVertically( ) params.push_back( &system_height ); Functor setBoundingBoxYShift( &Object::SetBoundingBoxYShift ); Functor setBoundingBoxYShiftEnd( &Object::SetBoundingBoxYShiftEnd ); - this->Process( &setBoundingBoxYShift, params, &setBoundingBoxYShiftEnd ); + this->Process( &setBoundingBoxYShift, ¶ms, &setBoundingBoxYShiftEnd ); // Set the Y position of each StaffAlignment // Adjusts the Y shift for making sure there is a minimal space (staffMargin) between each staff @@ -263,7 +263,7 @@ void Page::LayOutVertically( ) Functor setAlignmentY( &Object::SetAligmentYPos ); // special case: because we redirect the functor, pass is a parameter to itself (!) params.push_back( &setAlignmentY ); - this->Process( &setAlignmentY, params ); + this->Process( &setAlignmentY, ¶ms ); // Integrate the Y shift of the staves // Once the m_yShift have been calculated, move all positions accordingly @@ -273,7 +273,7 @@ void Page::LayOutVertically( ) Functor integrateBoundingBoxYShift( &Object::IntegrateBoundingBoxYShift ); // special case: because we redirect the functor, pass is a parameter to itself (!) params.push_back( &integrateBoundingBoxYShift ); - this->Process( &integrateBoundingBoxYShift, params ); + this->Process( &integrateBoundingBoxYShift, ¶ms ); // Adjust system Y position params.clear(); @@ -283,7 +283,7 @@ void Page::LayOutVertically( ) params.push_back( &systemMargin ); Functor alignSystems( &Object::AlignSystems ); Functor alignSystemsEnd( &Object::AlignSystemsEnd ); - this->Process( &alignSystems, params, &alignSystemsEnd ); + this->Process( &alignSystems, ¶ms, &alignSystemsEnd ); } void Page::JustifyHorizontally( ) @@ -317,7 +317,7 @@ void Page::JustifyHorizontally( ) Functor justifyX( &Object::JustifyX ); // special case: because we redirect the functor, pass is a parameter to itself (!) params.push_back( &justifyX ); - this->Process( &justifyX, params ); + this->Process( &justifyX, ¶ms ); } int Page::GetContentHeight( ) diff --git a/src/pitchinterface.cpp b/src/pitchinterface.cpp index a614b3da7c4..0ba691ebea8 100644 --- a/src/pitchinterface.cpp +++ b/src/pitchinterface.cpp @@ -22,12 +22,15 @@ namespace vrv { // PitchInterface //---------------------------------------------------------------------------- -PitchInterface::PitchInterface(): +PitchInterface::PitchInterface(): AttInterface(), AttAccidental(), AttOctave(), AttPitch() { + RegisterInterfaceAttClass(ATT_ACCIDENTAL); + RegisterInterfaceAttClass(ATT_OCTAVE); + RegisterInterfaceAttClass(ATT_PITCH); Reset(); } diff --git a/src/positioninterface.cpp b/src/positioninterface.cpp index 0ea791fd76d..21f14680111 100644 --- a/src/positioninterface.cpp +++ b/src/positioninterface.cpp @@ -17,9 +17,10 @@ namespace vrv { // PositionInterface //---------------------------------------------------------------------------- -PositionInterface::PositionInterface(): +PositionInterface::PositionInterface(): AttInterface(), AttStafflocPitched() { + RegisterInterfaceAttClass(ATT_STAFFLOCPITCHED); Reset(); } diff --git a/src/scoredef.cpp b/src/scoredef.cpp index 2b67fac0365..181473b14a5 100644 --- a/src/scoredef.cpp +++ b/src/scoredef.cpp @@ -308,7 +308,7 @@ void ScoreDef::Replace( ScoreDef *newScoreDef ) ArrayPtrVoid params; params.push_back( this ); Functor replaceStaffDefsInScoreDef( &Object::ReplaceStaffDefsInScoreDef ); - newScoreDef->Process( &replaceStaffDefsInScoreDef, params ); + newScoreDef->Process( &replaceStaffDefsInScoreDef, ¶ms ); } void ScoreDef::Replace( StaffDef *newStaffDef ) @@ -373,7 +373,7 @@ void ScoreDef::SetRedrawFlags( bool clef, bool keysig, bool mensur, bool meterSi params.push_back( &mensur ); params.push_back( &meterSig ); Functor setStaffDefDraw( &Object::SetStaffDefRedrawFlags ); - this->Process( &setStaffDefDraw, params ); + this->Process( &setStaffDefDraw, ¶ms ); } //---------------------------------------------------------------------------- @@ -437,6 +437,9 @@ StaffDef::StaffDef() : AttLabelsAddl(), AttStaffDefVis() { + RegisterAttClass(ATT_COMMON); + RegisterAttClass(ATT_LABELSADDL); + RegisterAttClass(ATT_STAFFDEFVIS); Reset(); } @@ -462,15 +465,15 @@ void StaffDef::Reset() // ScoreDef functor methods //---------------------------------------------------------------------------- -int ScoreDef::CastOffSystems( ArrayPtrVoid params ) +int ScoreDef::CastOffSystems( ArrayPtrVoid *params ) { // param 0: a pointer to the system we are taking the content from // param 1: a pointer the page we are adding system to (unused) // param 2: a pointer to the current system // param 3: the cummulated shift (m_drawingXRel of the first measure of the current system) (unused) // param 4: the system width (unused) - System *contentSystem = static_cast(params[0]); - System **currentSystem = static_cast(params[2]); + System *contentSystem = static_cast((*params)[0]); + System **currentSystem = static_cast((*params)[2]); // Since the functor returns FUNCTOR_SIBLINGS we should never go lower than the system children assert( dynamic_cast(this->m_parent)); @@ -489,26 +492,26 @@ int ScoreDef::CastOffSystems( ArrayPtrVoid params ) // StaffDef functor methods //---------------------------------------------------------------------------- -int StaffDef::ReplaceStaffDefsInScoreDef( ArrayPtrVoid params ) +int StaffDef::ReplaceStaffDefsInScoreDef( ArrayPtrVoid *params ) { // param 0: the scoreDef - ScoreDef *scoreDef = static_cast(params[0]); + ScoreDef *scoreDef = static_cast((*params)[0]); scoreDef->Replace( this ); return FUNCTOR_CONTINUE; } -int StaffDef::SetStaffDefRedrawFlags( ArrayPtrVoid params ) +int StaffDef::SetStaffDefRedrawFlags( ArrayPtrVoid *params ) { // param 0: bool clef flag // param 1: bool keysig flag // param 2: bool mensur flag // param 3: bool meterSig flag - bool *clef = static_cast(params[0]); - bool *keysig = static_cast(params[1]); - bool *mensur = static_cast(params[2]); - bool *meterSig = static_cast(params[3]); + bool *clef = static_cast((*params)[0]); + bool *keysig = static_cast((*params)[1]); + bool *mensur = static_cast((*params)[2]); + bool *meterSig = static_cast((*params)[3]); if ( (*clef) ) { this->SetDrawClef( true ); diff --git a/src/slur.cpp b/src/slur.cpp index e09b47b88a5..bedd0993bcb 100644 --- a/src/slur.cpp +++ b/src/slur.cpp @@ -41,19 +41,19 @@ void Slur::Reset() // Slur functor methods //---------------------------------------------------------------------------- -int Slur::PrepareTimeSpanning( ArrayPtrVoid params ) +int Slur::PrepareTimeSpanning( ArrayPtrVoid *params ) { // Pass it to the pseudo functor of the interface return TimeSpanningInterface::PrepareTimeSpanning(params, this); } -int Slur::FillStaffCurrentTimeSpanning( ArrayPtrVoid params ) +int Slur::FillStaffCurrentTimeSpanning( ArrayPtrVoid *params ) { // Pass it to the pseudo functor of the interface return TimeSpanningInterface::FillStaffCurrentTimeSpanning(params, this); } -int Slur::ResetDarwing( ArrayPtrVoid params ) +int Slur::ResetDarwing( ArrayPtrVoid *params ) { // Pass it to the pseudo functor of the interface return TimeSpanningInterface::ResetDrawing(params, this); diff --git a/src/staff.cpp b/src/staff.cpp index f0f899efd3f..72696efb159 100644 --- a/src/staff.cpp +++ b/src/staff.cpp @@ -31,6 +31,7 @@ Staff::Staff( int n ): MeasureElement("staff-"), AttCommon() { + RegisterAttClass(ATT_COMMON); Reset(); SetN(n); } @@ -75,14 +76,14 @@ void Staff::ResetVerticalAlignment() m_drawingY = 0; } -bool Staff::GetPosOnPage( ArrayPtrVoid params ) +bool Staff::GetPosOnPage( ArrayPtrVoid *params ) { // param 0: the Staff we are looking for // param 1: the position on the page (int) // param 2; the success flag (bool) - Staff *staff = static_cast(params[0]); - int *position = static_cast(params[1]); - bool *success = static_cast(params[2]); + Staff *staff = static_cast((*params)[0]); + int *position = static_cast((*params)[1]); + bool *success = static_cast((*params)[2]); if ( (*success) ) { return true; @@ -110,12 +111,12 @@ int Staff::GetYRel() //---------------------------------------------------------------------------- -int Staff::AlignVertically( ArrayPtrVoid params ) +int Staff::AlignVertically( ArrayPtrVoid *params ) { // param 0: the systemAligner // param 1: the staffNb - SystemAligner **systemAligner = static_cast(params[0]); - int *staffNb = static_cast(params[1]); + SystemAligner **systemAligner = static_cast((*params)[0]); + int *staffNb = static_cast((*params)[1]); // we need to call it because we are overriding Object::AlignVertically this->ResetVerticalAlignment(); @@ -134,16 +135,16 @@ int Staff::AlignVertically( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } -int Staff::FillStaffCurrentTimeSpanning( ArrayPtrVoid params ) +int Staff::FillStaffCurrentTimeSpanning( ArrayPtrVoid *params ) { // param 0: the current Syl - std::vector *elements = static_cast*>(params[0]); + std::vector *elements = static_cast*>((*params)[0]); std::vector::iterator iter = elements->begin(); while ( iter != elements->end()) { TimeSpanningInterface *interface = dynamic_cast(*iter); assert(interface); - Staff *endParent = dynamic_cast(interface->GetEnd()->GetFirstParent( &typeid(Staff) ) ); + Staff *endParent = reinterpret_cast(interface->GetEnd()->GetFirstParent( STAFF ) ); assert( endParent ); // Because we are not processing following staff @n, we need to check it here. // this might cause problem with cross-staves slurs if the end is on a lower staff than the start: @@ -163,18 +164,18 @@ int Staff::FillStaffCurrentTimeSpanning( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } -int Staff::FillStaffCurrentLyrics( ArrayPtrVoid params ) +int Staff::FillStaffCurrentLyrics( ArrayPtrVoid *params ) { // param 0: the current Syl // param 1: the last Note - Syl **currentSyl = static_cast(params[0]); + Syl **currentSyl = static_cast((*params)[0]); if ((*currentSyl)) { // We have a running syl started in a previous measure this->m_timeSpanningElements.push_back((*currentSyl)); if ((*currentSyl)->GetEnd()) { // Look if the syl ends in this measure - if not, add it - if ((*currentSyl)->GetEnd()->GetFirstParent( &typeid(Staff) ) == this ) { + if ((*currentSyl)->GetEnd()->GetFirstParent( STAFF ) == this ) { (*currentSyl) = NULL; } } @@ -183,7 +184,7 @@ int Staff::FillStaffCurrentLyrics( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } -int Staff::ResetDarwing( ArrayPtrVoid params ) +int Staff::ResetDarwing( ArrayPtrVoid *params ) { // Pass it to the pseudo functor of the interface this->m_timeSpanningElements.clear(); @@ -191,7 +192,7 @@ int Staff::ResetDarwing( ArrayPtrVoid params ) }; -int Staff::SetDrawingXY( ArrayPtrVoid params ) +int Staff::SetDrawingXY( ArrayPtrVoid *params ) { // param 0: a pointer doc // param 1: a pointer to the current system @@ -200,10 +201,10 @@ int Staff::SetDrawingXY( ArrayPtrVoid params ) // param 4: a pointer to the current layer (unused) // param 5: a pointer to the view (unused) // param 6: a bool indicating if we are processing layer elements or not - Doc *doc = static_cast(params[0]); - System **currentSystem = static_cast(params[1]); - Staff **currentStaff = static_cast(params[3]); - bool *processLayerElements = static_cast(params[6]); + Doc *doc = static_cast((*params)[0]); + System **currentSystem = static_cast((*params)[1]); + Staff **currentStaff = static_cast((*params)[3]); + bool *processLayerElements = static_cast((*params)[6]); (*currentStaff) = this; diff --git a/src/syl.cpp b/src/syl.cpp index a9dc1123501..36809208220 100644 --- a/src/syl.cpp +++ b/src/syl.cpp @@ -28,6 +28,8 @@ Syl::Syl(): AttTypography(), AttSylLog() { + RegisterAttClass(ATT_TYPOGRAPHY); + RegisterAttClass(ATT_SYLLOG); Reset(); } @@ -49,21 +51,21 @@ void Syl::Reset() // Functors methods //---------------------------------------------------------------------------- -int Syl::PrepareLyrics( ArrayPtrVoid params ) +int Syl::PrepareLyrics( ArrayPtrVoid *params ) { // param 0: the current Syl // param 1: the last Note // param 2: the last but one Note - Syl **currentSyl = static_cast(params[0]); - Note **lastNote = static_cast(params[1]); - Note **lastButOneNote = static_cast(params[2]); + Syl **currentSyl = static_cast((*params)[0]); + Note **lastNote = static_cast((*params)[1]); + Note **lastButOneNote = static_cast((*params)[2]); - Verse *verse = dynamic_cast( this->GetFirstParent( &typeid(Verse), MAX_NOTE_DEPTH ) ); + Verse *verse = reinterpret_cast( this->GetFirstParent( VERSE, MAX_NOTE_DEPTH ) ); if ( verse ) { m_drawingVerse = std::max(verse->GetN(), 1); } - this->SetStart( dynamic_cast( this->GetFirstParent( &typeid(Note), MAX_NOTE_DEPTH ) ) ); + this->SetStart( reinterpret_cast( this->GetFirstParent( NOTE, MAX_NOTE_DEPTH ) ) ); // At this stage currentSyl is actually the previous one that is ending here if ((*currentSyl)) { @@ -93,13 +95,13 @@ int Syl::PrepareLyrics( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } -int Syl::FillStaffCurrentTimeSpanning( ArrayPtrVoid params ) +int Syl::FillStaffCurrentTimeSpanning( ArrayPtrVoid *params ) { // Pass it to the pseudo functor of the interface return TimeSpanningInterface::FillStaffCurrentTimeSpanning(params, this); } -int Syl::ResetDarwing( ArrayPtrVoid params ) +int Syl::ResetDarwing( ArrayPtrVoid *params ) { // Pass it to the pseudo functor of the interface return TimeSpanningInterface::ResetDrawing(params, this); diff --git a/src/system.cpp b/src/system.cpp index 7c4de215319..66f62998e4c 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -125,11 +125,11 @@ void System::SetDrawingLabelsWidth( int width ) // System functor methods //---------------------------------------------------------------------------- -int System::AlignVertically( ArrayPtrVoid params ) +int System::AlignVertically( ArrayPtrVoid *params ) { // param 0: the systemAligner // param 1: the staffNb (unused) - SystemAligner **systemAligner = static_cast(params[0]); + SystemAligner **systemAligner = static_cast((*params)[0]); // we need to call it because we are overriding Object::AlignVertically this->ResetVerticalAlignment(); @@ -143,14 +143,14 @@ int System::AlignVertically( ArrayPtrVoid params ) } -int System::SetAligmentYPos( ArrayPtrVoid params ) +int System::SetAligmentYPos( ArrayPtrVoid *params ) { // param 0: the previous staff height // param 1: the staff margin (unused) // param 2: the staff interline sizes (int[2]) (unused) // param 2: the functor to be redirected to SystemAligner - int *previousStaffHeight = static_cast(params[0]); - Functor *setAligmnentPosY = static_cast(params[3]); + int *previousStaffHeight = static_cast((*params)[0]); + Functor *setAligmnentPosY = static_cast((*params)[3]); (*previousStaffHeight) = 0; @@ -160,12 +160,12 @@ int System::SetAligmentYPos( ArrayPtrVoid params ) } -int System::IntegrateBoundingBoxYShift( ArrayPtrVoid params ) +int System::IntegrateBoundingBoxYShift( ArrayPtrVoid *params ) { // param 0: the cumulated shift // param 1: the functor to be redirected to SystemAligner - int *shift = static_cast(params[0]); - Functor *integrateBoundingBoxYShift = static_cast(params[1]); + int *shift = static_cast((*params)[0]); + Functor *integrateBoundingBoxYShift = static_cast((*params)[1]); (*shift) = 0; m_systemAligner.Process( integrateBoundingBoxYShift, params); @@ -173,10 +173,10 @@ int System::IntegrateBoundingBoxYShift( ArrayPtrVoid params ) return FUNCTOR_SIBLINGS; } -int System::AlignMeasures( ArrayPtrVoid params ) +int System::AlignMeasures( ArrayPtrVoid *params ) { // param 0: the cumulated shift - int *shift = static_cast(params[0]); + int *shift = static_cast((*params)[0]); m_drawingXRel = this->m_systemLeftMar + this->GetDrawingLabelsWidth(); (*shift) = 0; @@ -184,22 +184,22 @@ int System::AlignMeasures( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } -int System::AlignMeasuresEnd( ArrayPtrVoid params ) +int System::AlignMeasuresEnd( ArrayPtrVoid *params ) { // param 0: the cumulated shift - int *shift = static_cast(params[0]); + int *shift = static_cast((*params)[0]); m_drawingTotalWidth = (*shift) + this->GetDrawingLabelsWidth(); return FUNCTOR_CONTINUE; } -int System::AlignSystems( ArrayPtrVoid params ) +int System::AlignSystems( ArrayPtrVoid *params ) { // param 0: the cumulated shift // param 1: the system margin - int *shift = static_cast(params[0]); - int *systemMargin = static_cast(params[1]); + int *shift = static_cast((*params)[0]); + int *systemMargin = static_cast((*params)[1]); this->m_drawingYRel = (*shift); @@ -211,15 +211,15 @@ int System::AlignSystems( ArrayPtrVoid params ) } -int System::JustifyX( ArrayPtrVoid params ) +int System::JustifyX( ArrayPtrVoid *params ) { // param 0: the justification ratio // param 1: the justification ratio for the measure (depends on the margin) (unused) // param 2: the non justifiable margin (unused) // param 3: the system full width (without system margins) // param 4: the functor to be redirected to the MeasureAligner - double *ratio = static_cast(params[0]); - int *systemFullWidth = static_cast(params[3]); + double *ratio = static_cast((*params)[0]); + int *systemFullWidth = static_cast((*params)[3]); assert( m_parent ); assert( m_parent->m_parent ); @@ -243,10 +243,10 @@ int System::JustifyX( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } -int System::SetBoundingBoxYShiftEnd( ArrayPtrVoid params ) +int System::SetBoundingBoxYShiftEnd( ArrayPtrVoid *params ) { // param 0: the height of the previous staff - int *system_height = static_cast(params[1]); + int *system_height = static_cast((*params)[1]); m_systemAligner.GetBottomAlignment()->SetYShift( (*system_height) ); @@ -254,18 +254,18 @@ int System::SetBoundingBoxYShiftEnd( ArrayPtrVoid params ) } -int System::CastOffPages( ArrayPtrVoid params ) +int System::CastOffPages( ArrayPtrVoid *params ) { // param 0: a pointer to the page we are taking the content from // param 1: a pointer the document we are adding pages to // param 2: a pointer to the current page // param 3: the cummulated shift (m_drawingYRel of the first system of the current page) // param 4: the page height - Page *contentPage = static_cast(params[0]); - Doc *doc = static_cast(params[1]); - Page **currentPage = static_cast(params[2]); - int *shift = static_cast(params[3]); - int *pageHeight = static_cast(params[4]); + Page *contentPage = static_cast((*params)[0]); + Doc *doc = static_cast((*params)[1]); + Page **currentPage = static_cast((*params)[2]); + int *shift = static_cast((*params)[3]); + int *pageHeight = static_cast((*params)[4]); if ( ( (*currentPage)->GetChildCount() > 0 ) && ( this->m_drawingYRel - this->GetHeight() - (*shift) < 0 )) { //(*pageHeight) ) ) { (*currentPage) = new Page(); @@ -283,10 +283,10 @@ int System::CastOffPages( ArrayPtrVoid params ) return FUNCTOR_SIBLINGS; } -int System::UnCastOff( ArrayPtrVoid params ) +int System::UnCastOff( ArrayPtrVoid *params ) { // param 0: a pointer to the system we are adding system to - System *currentSystem = static_cast(params[0]); + System *currentSystem = static_cast((*params)[0]); // Just move all the content of the system to the continous one (parameter) // Use the MoveChildren method that move the and relinquishes them @@ -297,7 +297,7 @@ int System::UnCastOff( ArrayPtrVoid params ) return FUNCTOR_SIBLINGS; } -int System::SetDrawingXY( ArrayPtrVoid params ) +int System::SetDrawingXY( ArrayPtrVoid *params ) { // param 0: a pointer doc // param 1: a pointer to the current system @@ -306,9 +306,9 @@ int System::SetDrawingXY( ArrayPtrVoid params ) // param 4: a pointer to the current layer // param 5: a pointer to the view (unused) // param 6: a bool indicating if we are processing layer elements or not - Doc *doc = static_cast(params[0]); - System **currentSystem = static_cast(params[1]); - bool *processLayerElements = static_cast(params[6]); + Doc *doc = static_cast((*params)[0]); + System **currentSystem = static_cast((*params)[1]); + bool *processLayerElements = static_cast((*params)[6]); (*currentSystem) = this; diff --git a/src/tie.cpp b/src/tie.cpp index 6c3b3114dc6..48400ac15da 100644 --- a/src/tie.cpp +++ b/src/tie.cpp @@ -41,20 +41,20 @@ void Tie::Reset() // Tie functor methods //---------------------------------------------------------------------------- -int Tie::PrepareTimeSpanning( ArrayPtrVoid params ) +int Tie::PrepareTimeSpanning( ArrayPtrVoid *params ) { // Pass it to the pseudo functor of the interface return TimeSpanningInterface::PrepareTimeSpanning(params, this); } -int Tie::FillStaffCurrentTimeSpanning( ArrayPtrVoid params ) +int Tie::FillStaffCurrentTimeSpanning( ArrayPtrVoid *params ) { // Pass it to the pseudo functor of the interface return TimeSpanningInterface::FillStaffCurrentTimeSpanning(params, this); } -int Tie::ResetDarwing( ArrayPtrVoid params ) +int Tie::ResetDarwing( ArrayPtrVoid *params ) { // Pass it to the pseudo functor of the interface return TimeSpanningInterface::ResetDrawing(params, this); diff --git a/src/timeinterface.cpp b/src/timeinterface.cpp index ed7384eb812..f8ca5ab3198 100644 --- a/src/timeinterface.cpp +++ b/src/timeinterface.cpp @@ -25,12 +25,16 @@ namespace vrv { // TimeSpanningInterface //---------------------------------------------------------------------------- -TimeSpanningInterface::TimeSpanningInterface(): +TimeSpanningInterface::TimeSpanningInterface(): AttInterface(), AttStartendid(), AttStartid(), AttTimestampMusical(), AttTimestamp2Musical() { + RegisterInterfaceAttClass(ATT_STARTENDID); + RegisterInterfaceAttClass(ATT_STARTID); + RegisterInterfaceAttClass(ATT_TIMESTAMPMUSICAL); + RegisterInterfaceAttClass(ATT_TIMESTAMP2MUSICAL); Reset(); } @@ -95,12 +99,12 @@ std::string TimeSpanningInterface::ExtractUuidFragment(std::string refUuid) return refUuid; } -int TimeSpanningInterface::PrepareTimeSpanning( ArrayPtrVoid params, DocObject *object ) +int TimeSpanningInterface::PrepareTimeSpanning( ArrayPtrVoid *params, DocObject *object ) { // param 0: std::vector* that holds the current elements to match // param 1: bool* fillList for indicating whether the elements have to be stack or not - std::vector *elements = static_cast*>(params[0]); - bool *fillList = static_cast(params[1]); + std::vector *elements = static_cast*>((*params)[0]); + bool *fillList = static_cast((*params)[1]); if ((*fillList)==false) { return FUNCTOR_CONTINUE; @@ -112,13 +116,13 @@ int TimeSpanningInterface::PrepareTimeSpanning( ArrayPtrVoid params, DocObject * return FUNCTOR_CONTINUE; } -int TimeSpanningInterface::FillStaffCurrentTimeSpanning( ArrayPtrVoid params, DocObject *object ) +int TimeSpanningInterface::FillStaffCurrentTimeSpanning( ArrayPtrVoid *params, DocObject *object ) { // param 0: std::vector* of the current running TimeSpanningInterface elements - std::vector *elements = static_cast*>(params[0]); + std::vector *elements = static_cast*>((*params)[0]); if (this->HasStartAndEnd()) { - if ( GetStart()->GetFirstParent( &typeid(Staff) ) != GetEnd()->GetFirstParent( &typeid(Staff) ) ) { + if ( GetStart()->GetFirstParent( STAFF ) != GetEnd()->GetFirstParent( STAFF ) ) { // We have a running syl started in a previous measure elements->push_back(object); } @@ -126,7 +130,7 @@ int TimeSpanningInterface::FillStaffCurrentTimeSpanning( ArrayPtrVoid params, Do return FUNCTOR_CONTINUE; } -int TimeSpanningInterface::ResetDrawing( ArrayPtrVoid params, DocObject *object ) +int TimeSpanningInterface::ResetDrawing( ArrayPtrVoid *params, DocObject *object ) { m_start = NULL; m_end = NULL; diff --git a/src/toolkit.cpp b/src/toolkit.cpp index 4ba66c13ff1..ef86afc4654 100644 --- a/src/toolkit.cpp +++ b/src/toolkit.cpp @@ -574,7 +574,7 @@ int Toolkit::GetPageWithElement( const std::string &xmlId ) { if (!element) { return 0; } - Page *page = dynamic_cast( element->GetFirstParent( &typeid(Page) ) ); + Page *page = reinterpret_cast( element->GetFirstParent( PAGE ) ); if (!page) { return 0; } @@ -611,9 +611,9 @@ bool Toolkit::Drag( std::string elementId, int x, int y ) { if ( !m_doc.GetDrawingPage() ) return false; Object *element = m_doc.GetDrawingPage()->FindChildByUuid(elementId); - if ( dynamic_cast(element) ) { - Note *note = dynamic_cast(element); - Layer *layer = dynamic_cast(note->GetFirstParent(&typeid(Layer))); + if ( element->Is() == NOTE ) { + Note *note = reinterpret_cast(element); + Layer *layer = reinterpret_cast(note->GetFirstParent( LAYER ) ); if ( !layer ) return false; int oct; data_PITCHNAME pname = (data_PITCHNAME)m_view.CalculatePitchCode( layer, m_view.ToLogicalY(y), note->GetDrawingX(), &oct ); @@ -645,7 +645,7 @@ bool Toolkit::Insert( std::string elementType, std::string startid, std::string return false; } - Measure *measure = dynamic_cast(start->GetFirstParent(&typeid(Measure))); + Measure *measure = reinterpret_cast(start->GetFirstParent( MEASURE ) ); assert( measure ); if (elementType == "slur" ) { Slur *slur = new Slur(); diff --git a/src/tuplet.cpp b/src/tuplet.cpp index fa08b587674..0027f856467 100644 --- a/src/tuplet.cpp +++ b/src/tuplet.cpp @@ -15,8 +15,10 @@ namespace vrv { //---------------------------------------------------------------------------- Tuplet::Tuplet(): - LayerElement("tuplet-"), ObjectListInterface() + LayerElement("tuplet-"), ObjectListInterface(), + AttDurationRatio() { + RegisterAttClass(ATT_DURATIONRATIO); Reset(); } @@ -28,6 +30,7 @@ Tuplet::~Tuplet() void Tuplet::Reset() { LayerElement::Reset(); + ResetDurationRatio(); } void Tuplet::AddLayerElement(LayerElement *element) { diff --git a/src/verse.cpp b/src/verse.cpp index 3dd9bb74603..5d44401be82 100644 --- a/src/verse.cpp +++ b/src/verse.cpp @@ -30,6 +30,7 @@ Verse::Verse(): LayerElement("verse-"), AttCommon() { + RegisterAttClass(ATT_COMMON); Reset(); } @@ -55,12 +56,12 @@ void Verse::AddLayerElement(vrv::LayerElement *element) // Verse functor methods //---------------------------------------------------------------------------- -int Verse::AlignVertically( ArrayPtrVoid params ) +int Verse::AlignVertically( ArrayPtrVoid *params ) { // param 0: the systemAligner // param 1: the staffNb - SystemAligner **systemAligner = static_cast(params[0]); - int *staffNb = static_cast(params[1]); + SystemAligner **systemAligner = static_cast((*params)[0]); + int *staffNb = static_cast((*params)[1]); // we need to call it because we are overriding Object::AlignVertically this->ResetVerticalAlignment(); @@ -76,16 +77,16 @@ int Verse::AlignVertically( ArrayPtrVoid params ) return FUNCTOR_CONTINUE; } -int Verse::PrepareProcessingLists( ArrayPtrVoid params ) +int Verse::PrepareProcessingLists( ArrayPtrVoid *params ) { // param 0: the IntTree* for staff/layer/verse // param 1: the IntTree* for staff/layer (unused) - IntTree *tree = static_cast(params[0]); + IntTree *tree = static_cast((*params)[0]); // Alternate solution with StaffN_LayerN_VerseN_t - //StaffN_LayerN_VerseN_t *tree = static_cast(params[0]); + //StaffN_LayerN_VerseN_t *tree = static_cast((*params)[0]); - Staff *staff = dynamic_cast( this->GetFirstParent( &typeid( Staff ) ) ); - Layer *layer = dynamic_cast( this->GetFirstParent( &typeid( Layer ) ) ); + Staff *staff = reinterpret_cast( this->GetFirstParent( STAFF ) ); + Layer *layer = reinterpret_cast( this->GetFirstParent( LAYER ) ); assert( staff && layer ); tree->child[ staff->GetN() ].child[ layer->GetN() ].child[ this->GetN() ]; diff --git a/src/view_element.cpp b/src/view_element.cpp index b08024527bd..8644fe3eec5 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -196,7 +196,7 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St // Get the immediate parent of the note // to see if beamed or not - Beam *beam_parent = dynamic_cast(note->GetFirstParent(&typeid(Beam))); + Beam *beam_parent = reinterpret_cast(note->GetFirstParent( BEAM )); // This note is beamed and cue sized if (beam_parent != NULL) { @@ -397,7 +397,7 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St } if (note->GetDrawingTieAttr()) { - System *system = dynamic_cast(measure->GetFirstParent(&typeid(System))); + System *system = reinterpret_cast(measure->GetFirstParent( SYSTEM ) ); // create a placeholder for the tie attribute that will be drawn from the system dc->StartGraphic(note->GetDrawingTieAttr(), "", note->GetDrawingTieAttr()->GetUuid().c_str()); dc->EndGraphic(note->GetDrawingTieAttr(), this); @@ -886,7 +886,7 @@ void View::DrawChord( DeviceContext *dc, LayerElement *element, Layer *layer, St bool inBeam = false; // Get the immadiate parent of the note // to see if beamed or not - Beam *beam_parent = dynamic_cast(chord->GetFirstParent(&typeid(Beam))); + Beam *beam_parent = reinterpret_cast(chord->GetFirstParent( BEAM )); // This note is beamed and cue sized if (beam_parent != NULL) { @@ -1153,7 +1153,7 @@ void View::DrawClef( DeviceContext *dc, LayerElement *element, Layer *layer, Sta bool cueSize = false; // force cue size for intermediate clefs - if (clef->GetFirstParent(&typeid(Layer))) cueSize = true; + if (clef->GetFirstParent( LAYER )) cueSize = true; if (!cueSize) a -= m_doc->m_drawingUnit[staff->staffSize] * 2; @@ -1427,7 +1427,7 @@ void View::DrawAccid( DeviceContext *dc, LayerElement *element, Layer *layer, St // position is currently only above the staff int y = staff->GetDrawingY(); // look at the note position and adjust it if necessary - Note *note = dynamic_cast( accid->GetFirstParent( &typeid(Note), MAX_ACCID_DEPTH ) ); + Note *note = reinterpret_cast( accid->GetFirstParent( NOTE, MAX_ACCID_DEPTH ) ); if ( note ) { if ( note->GetDrawingY() > y ) { y = note->GetDrawingY() + m_doc->m_drawingUnit[staff->staffSize]; @@ -1592,7 +1592,7 @@ void View::DrawSyl( DeviceContext *dc, LayerElement *element, Layer *layer, Staf dc->ResetBrush(); if (syl->GetStart() && syl->GetEnd()) { - System *currentSystem = dynamic_cast( measure->GetFirstParent( &typeid(System) ) ); + System *currentSystem = reinterpret_cast( measure->GetFirstParent( SYSTEM ) ); // Postpone the drawing of the syl to the end of the system; this will call DrawSylConnector // that will look if the last note is in the same system (or not) and draw the connectors accordingly if (currentSystem) { @@ -1748,7 +1748,7 @@ void View::DrawAcciaccaturaSlash(DeviceContext *dc, LayerElement *element) { Note *note = dynamic_cast(element); assert( note ); - Staff *staff = dynamic_cast( note->GetFirstParent( &typeid( Staff ) ) ); + Staff *staff = reinterpret_cast( note->GetFirstParent( STAFF ) ); assert( staff ); if (note->GetActualDur() < DUR_8) diff --git a/src/view_page.cpp b/src/view_page.cpp index c99f22343d2..8b646273bb6 100644 --- a/src/view_page.cpp +++ b/src/view_page.cpp @@ -67,10 +67,10 @@ void View::DrawCurrentPage( DeviceContext *dc, bool background ) Functor setDrawingXY( &Object::SetDrawingXY ); // First pass without processing the LayerElements - we need this for cross-staff going down because // the elements will need the position of the staff below to have been set before - m_currentPage->Process( &setDrawingXY, params ); + m_currentPage->Process( &setDrawingXY, ¶ms ); // Second pass that process the LayerElements (only) processLayerElement = true; - m_currentPage->Process( &setDrawingXY, params ); + m_currentPage->Process( &setDrawingXY, ¶ms ); // Set the current score def to the page one // The page one has previously been set by Object::SetCurrentScoreDef @@ -111,7 +111,7 @@ void View::DrawSystem( DeviceContext *dc, System *system ) system->ResetDrawingList(); // First get the first measure of the system - Measure *measure = dynamic_cast(system->FindChildByType( &typeid(Measure) ) ); + Measure *measure = reinterpret_cast(system->FindChildByType( MEASURE ) ); if ( measure ) { // NULL for the Barline parameters indicates that we are drawing the scoreDef DrawScoreDef( dc, &m_drawingScoreDef, measure, system->GetDrawingX(), NULL ); @@ -169,7 +169,7 @@ void View::DrawScoreDef( DeviceContext *dc, ScoreDef *scoreDef, Measure *measure // we need at least one measure to be able to draw the groups - we need access to the staff elements, assert( measure ); - StaffGrp *staffGrp = dynamic_cast(scoreDef->FindChildByType( &typeid(StaffGrp) ) ); + StaffGrp *staffGrp = reinterpret_cast(scoreDef->FindChildByType( STAFF_GRP ) ); if ( !staffGrp ) { return; } @@ -212,9 +212,9 @@ void View::DrawStaffGrp( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp } // Get the corresponding staff looking at the previous (or first) measure - AttCommonNComparison comparisonFirst( &typeid(Staff), firstDef->GetN() ); + AttCommonNComparison comparisonFirst( STAFF, firstDef->GetN() ); Staff *first = dynamic_cast(measure->FindChildByAttComparison(&comparisonFirst, 1)); - AttCommonNComparison comparisonLast( &typeid(Staff), lastDef->GetN() ); + AttCommonNComparison comparisonLast( STAFF, lastDef->GetN() ); Staff *last = dynamic_cast(measure->FindChildByAttComparison(&comparisonLast, 1)); if (!first || !last ) { @@ -276,9 +276,9 @@ void View::DrawStaffDefLabels( DeviceContext *dc, Measure *measure, ScoreDef *sc continue; } - AttCommonNComparison comparison( &typeid(Staff), staffDef->GetN() ); + AttCommonNComparison comparison( STAFF, staffDef->GetN() ); Staff *staff = dynamic_cast(measure->FindChildByAttComparison(&comparison, 1 )); - System *system = dynamic_cast(measure->GetFirstParent( &typeid(System) ) ); + System *system = reinterpret_cast(measure->GetFirstParent( SYSTEM ) ); if (!staff || !system) { LogDebug("Staff or System missing in View::DrawStaffDefLabels"); @@ -445,8 +445,8 @@ void View::DrawBarlines( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp DrawBarlines( dc, measure, childStaffGrp, barLine ); } else if ( childStaffDef ) { - AttCommonNComparison comparison( &typeid(Staff), childStaffDef->GetN() ); - Staff *staff = dynamic_cast(measure->FindChildByAttComparison(&comparison, 1 ) ); + AttCommonNComparison comparison( STAFF, childStaffDef->GetN() ); + Staff *staff = reinterpret_cast(measure->FindChildByAttComparison(&comparison, 1 ) ); if (!staff ) { LogDebug("Could not get staff (%d) while drawing staffGrp - Vrv::DrawBarlines", childStaffDef->GetN() ); continue; @@ -478,9 +478,9 @@ void View::DrawBarlines( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp } // Get the corresponding staff looking at the previous (or first) measure - AttCommonNComparison comparisonFirst( &typeid(Staff), firstDef->GetN() ); + AttCommonNComparison comparisonFirst( STAFF, firstDef->GetN() ); Staff *first = dynamic_cast(measure->FindChildByAttComparison(&comparisonFirst, 1)); - AttCommonNComparison comparisonLast( &typeid(Staff), lastDef->GetN() ); + AttCommonNComparison comparisonLast( STAFF, lastDef->GetN() ); Staff *last = dynamic_cast(measure->FindChildByAttComparison(&comparisonLast, 1)); if (!first || !last ) { @@ -501,7 +501,7 @@ void View::DrawBarlines( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp for (i = 0; i < staffGrp->GetChildCount(); i++) { childStaffDef = dynamic_cast(staffGrp->GetChild( i )); if ( childStaffDef ) { - AttCommonNComparison comparison( &typeid(Staff), childStaffDef->GetN() ); + AttCommonNComparison comparison( STAFF, childStaffDef->GetN() ); Staff *staff = dynamic_cast(measure->FindChildByAttComparison(&comparison, 1)); if (!staff ) { LogDebug("Could not get staff (%d) while drawing staffGrp - Vrv::DrawBarlines", childStaffDef->GetN() ); @@ -781,8 +781,8 @@ void View::DrawTimeSpanningElement( DeviceContext *dc, DocObject *element, Syste if ( !interface->HasStartAndEnd() ) return; // Get the parent system of the first and last note - System *parentSystem1 = dynamic_cast( interface->GetStart()->GetFirstParent( &typeid(System) ) ); - System *parentSystem2 = dynamic_cast( interface->GetEnd()->GetFirstParent( &typeid(System) ) ); + System *parentSystem1 = reinterpret_cast( interface->GetStart()->GetFirstParent( SYSTEM ) ); + System *parentSystem2 = reinterpret_cast( interface->GetEnd()->GetFirstParent( SYSTEM ) ); int x1, x2; Staff *staff = NULL; @@ -792,7 +792,7 @@ void View::DrawTimeSpanningElement( DeviceContext *dc, DocObject *element, Syste // The both correspond to the current system, which means no system break in-between (simple case) if (( system == parentSystem1 ) && ( system == parentSystem2 )) { // Get the parent staff for calculating the y position - staff = dynamic_cast( interface->GetStart()->GetFirstParent( &typeid(Staff) ) ); + staff = reinterpret_cast( interface->GetStart()->GetFirstParent( STAFF ) ); if ( !Check( staff ) ) return; x1 = interface->GetStart()->GetDrawingX(); @@ -802,9 +802,9 @@ void View::DrawTimeSpanningElement( DeviceContext *dc, DocObject *element, Syste // Only the first parent is the same, this means that the element is "open" at the end of the system else if ( system == parentSystem1 ) { // We need the last measure of the system for x2 - Measure *last = dynamic_cast( system->FindChildByType( &typeid(Measure), 1, BACKWARD ) ); + Measure *last = reinterpret_cast( system->FindChildByType( MEASURE, 1, BACKWARD ) ); if ( !Check( last ) ) return; - staff = dynamic_cast( interface->GetStart()->GetFirstParent( &typeid(Staff) ) ); + staff = reinterpret_cast( interface->GetStart()->GetFirstParent( STAFF ) ); if ( !Check( staff ) ) return; x1 = interface->GetStart()->GetDrawingX(); @@ -815,13 +815,13 @@ void View::DrawTimeSpanningElement( DeviceContext *dc, DocObject *element, Syste // We are in the system of the last note - draw the element from the beginning of the system else if ( system == parentSystem2 ) { // We need the first measure of the system for x1 - Measure *first = dynamic_cast( system->FindChildByType( &typeid(Measure), 1, FORWARD ) ); + Measure *first = reinterpret_cast( system->FindChildByType( MEASURE, 1, FORWARD ) ); if ( !Check( first ) ) return; // Get the staff of the first note - however, not the staff we need - Staff *lastStaff = dynamic_cast( interface->GetEnd()->GetFirstParent( &typeid(Staff) ) ); + Staff *lastStaff = reinterpret_cast( interface->GetEnd()->GetFirstParent( STAFF ) ); if ( !Check( lastStaff ) ) return; // We need the first staff from the current system, i.e., the first measure. - AttCommonNComparison comparison( &typeid(Staff), lastStaff->GetN() ); + AttCommonNComparison comparison( STAFF, lastStaff->GetN() ); staff = dynamic_cast(system->FindChildByAttComparison(&comparison, 2)); if (!staff ) { LogDebug("Could not get staff (%d) while drawing staffGrp - View::DrawSylConnector", lastStaff->GetN() ); @@ -829,7 +829,7 @@ void View::DrawTimeSpanningElement( DeviceContext *dc, DocObject *element, Syste } // Also try to get a first note - we should change this once we have a x position in measure that // takes into account the scoreDef - Note *firstNote = dynamic_cast( staff->FindChildByType( &typeid(Note) ) ); + Note *firstNote = reinterpret_cast( staff->FindChildByType( NOTE ) ); x1 = firstNote ? firstNote->GetDrawingX() - 2 * m_doc->m_drawingDoubleUnit[staff->staffSize] : first->GetDrawingX(); x2 = interface->GetEnd()->GetDrawingX(); @@ -838,20 +838,20 @@ void View::DrawTimeSpanningElement( DeviceContext *dc, DocObject *element, Syste // Rare case where neither the first note and the last note are in the current system - draw the connector throughout the system else { // We need the first measure of the system for x1 - Measure *first = dynamic_cast( system->FindChildByType( &typeid(Measure), 1, FORWARD ) ); + Measure *first = reinterpret_cast( system->FindChildByType( MEASURE, 1, FORWARD ) ); if ( !Check( first ) ) return; // Also try to get a first note - we should change this once we have a x position in measure that // takes into account the scoreDef - Note *firstNote = dynamic_cast( first->FindChildByType( &typeid(Note) ) ); + Note *firstNote = reinterpret_cast( first->FindChildByType( NOTE ) ); // We need the last measure of the system for x2 - Measure *last = dynamic_cast( system->FindChildByType( &typeid(Measure), 1, BACKWARD ) ); + Measure *last = reinterpret_cast( system->FindChildByType( MEASURE, 1, BACKWARD ) ); if ( !Check( last ) ) return; // Get the staff of the first note - however, not the staff we need - Staff *firstStaff = dynamic_cast( interface->GetStart()->GetFirstParent( &typeid(Staff) ) ); + Staff *firstStaff = reinterpret_cast( interface->GetStart()->GetFirstParent( STAFF ) ); if ( !Check( firstStaff ) ) return; // We need the staff from the current system, i.e., the first measure. - AttCommonNComparison comparison( &typeid(Staff), firstStaff->GetN() ); + AttCommonNComparison comparison( STAFF, firstStaff->GetN() ); staff = dynamic_cast(first->FindChildByAttComparison(&comparison, 1)); if (!staff ) { LogDebug("Could not get staff (%d) while drawing staffGrp - View::DrawSylConnector", firstStaff->GetN() ); @@ -896,8 +896,8 @@ void View::DrawTieOrSlur( DeviceContext *dc, MeasureElement *element, int x1, in return; } - Layer* layer1 = dynamic_cast(note1->GetFirstParent(&typeid(Layer))); - Layer* layer2 = dynamic_cast(note2->GetFirstParent(&typeid(Layer))); + Layer* layer1 = reinterpret_cast(note1->GetFirstParent( LAYER ) ); + Layer* layer2 = reinterpret_cast(note2->GetFirstParent( LAYER ) ); if ( layer1->GetN() != layer2->GetN() ) { LogWarning("Ties between different layers may not be fully supported."); diff --git a/src/view_tuplet.cpp b/src/view_tuplet.cpp index 3a7afd0d408..98c395b2813 100644 --- a/src/view_tuplet.cpp +++ b/src/view_tuplet.cpp @@ -35,7 +35,7 @@ bool View::OneBeamInTuplet(Tuplet* tuplet) { ArrayOfObjects elems; // Are we contained in a beam? - if (dynamic_cast(tuplet->GetFirstParent(&typeid(Beam), MAX_BEAM_DEPTH)) && !tuplet->m_children.empty()) + if (reinterpret_cast(tuplet->GetFirstParent( BEAM, MAX_BEAM_DEPTH )) && !tuplet->m_children.empty()) return true; // No we contain a beam? Go on and search for it in the children From 5c393ed5d82c3561a0f03e9453c8d855d8a0c3cd Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Fri, 14 Aug 2015 12:48:16 +0200 Subject: [PATCH 048/114] Major code refactoring for removing use of std_info and reducing the use of dynamic cast. --- Verovio.xcodeproj/project.pbxproj | 2 + emscripten/build.sh | 1 - include/vrv/accid.h | 2 +- include/vrv/aligner.h | 10 +- include/vrv/att.h | 25 +- include/vrv/att_comparison.h | 10 +- include/vrv/attdef.h | 3 +- include/vrv/barline.h | 8 +- include/vrv/beam.h | 2 +- include/vrv/chord.h | 6 +- include/vrv/clef.h | 4 +- include/vrv/custos.h | 2 +- include/vrv/doc.h | 6 +- include/vrv/dot.h | 2 +- include/vrv/durationinterface.h | 3 +- include/vrv/editorial.h | 10 +- include/vrv/keysig.h | 4 +- include/vrv/layer.h | 23 +- include/vrv/layerelement.h | 27 +- include/vrv/measure.h | 2 +- include/vrv/measureelement.h | 2 +- include/vrv/mensur.h | 4 +- include/vrv/metersig.h | 4 +- include/vrv/mrest.h | 2 +- include/vrv/multirest.h | 2 +- include/vrv/note.h | 2 +- include/vrv/object.h | 60 +-- include/vrv/page.h | 4 +- include/vrv/pitchinterface.h | 3 +- include/vrv/positioninterface.h | 3 +- include/vrv/rest.h | 2 +- include/vrv/scoredef.h | 6 +- include/vrv/slur.h | 2 +- include/vrv/space.h | 2 +- include/vrv/staff.h | 2 +- include/vrv/syl.h | 2 +- include/vrv/system.h | 4 +- include/vrv/tie.h | 2 +- include/vrv/timeinterface.h | 3 +- include/vrv/tuplet.h | 2 +- include/vrv/verse.h | 2 +- include/vrv/view.h | 9 +- include/vrv/vrvdef.h | 130 +++--- libmei/att_classes.h | 232 +++++++++ libmei/atts_analysis.cpp | 46 +- libmei/atts_analysis.h | 15 +- libmei/atts_cmn.cpp | 214 ++++++--- libmei/atts_cmn.h | 71 +-- libmei/atts_cmnornaments.cpp | 28 +- libmei/atts_cmnornaments.h | 9 +- libmei/atts_critapp.cpp | 16 +- libmei/atts_critapp.h | 5 +- libmei/atts_edittrans.cpp | 28 +- libmei/atts_edittrans.h | 9 +- libmei/atts_facsimile.cpp | 10 +- libmei/atts_facsimile.h | 3 +- libmei/atts_figtable.cpp | 10 +- libmei/atts_figtable.h | 3 +- libmei/atts_harmony.cpp | 22 +- libmei/atts_harmony.h | 7 +- libmei/atts_header.cpp | 10 +- libmei/atts_header.h | 3 +- libmei/atts_linkalign.cpp | 10 +- libmei/atts_linkalign.h | 3 +- libmei/atts_lyrics.cpp | 10 +- libmei/atts_lyrics.h | 3 +- libmei/atts_mensural.cpp | 46 +- libmei/atts_mensural.h | 15 +- libmei/atts_midi.cpp | 40 +- libmei/atts_midi.h | 13 +- libmei/atts_neumes.cpp | 16 +- libmei/atts_neumes.h | 5 +- libmei/atts_pagebased.cpp | 10 +- libmei/atts_pagebased.h | 3 +- libmei/atts_shared.cpp | 748 ++++++++++++++++++++---------- libmei/atts_shared.h | 249 +--------- libmei/atts_tablature.cpp | 16 +- libmei/atts_tablature.h | 5 +- src/accid.cpp | 5 +- src/aligner.cpp | 17 +- src/barline.cpp | 2 - src/bboxdevicecontext.cpp | 3 +- src/beam.cpp | 11 +- src/chord.cpp | 29 +- src/custos.cpp | 2 + src/doc.cpp | 33 +- src/dot.cpp | 2 + src/durationinterface.cpp | 8 +- src/editorial.cpp | 8 +- src/io.cpp | 8 +- src/iomei.cpp | 314 +++++++++---- src/iopae.cpp | 19 +- src/layer.cpp | 149 +----- src/layerelement.cpp | 189 ++------ src/measure.cpp | 14 +- src/note.cpp | 11 +- src/object.cpp | 220 ++++----- src/page.cpp | 49 +- src/pitchinterface.cpp | 2 +- src/positioninterface.cpp | 2 +- src/rest.cpp | 3 + src/scoredef.cpp | 24 +- src/slur.cpp | 2 + src/space.cpp | 2 + src/staff.cpp | 2 +- src/syl.cpp | 7 +- src/system.cpp | 19 - src/tie.cpp | 2 + src/timeinterface.cpp | 2 +- src/toolkit.cpp | 12 +- src/tuplet.cpp | 3 +- src/verse.cpp | 4 +- src/view.cpp | 1 - src/view_beam.cpp | 26 +- src/view_element.cpp | 263 +++++++---- src/view_graph.cpp | 45 +- src/view_mensural.cpp | 53 ++- src/view_page.cpp | 331 +++++++------ src/view_tuplet.cpp | 24 +- 119 files changed, 2265 insertions(+), 1996 deletions(-) create mode 100644 libmei/att_classes.h diff --git a/Verovio.xcodeproj/project.pbxproj b/Verovio.xcodeproj/project.pbxproj index 8af31c11abf..c962f928621 100644 --- a/Verovio.xcodeproj/project.pbxproj +++ b/Verovio.xcodeproj/project.pbxproj @@ -225,6 +225,7 @@ 4D422100199805E400963292 /* attdef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = attdef.h; path = include/vrv/attdef.h; sourceTree = ""; }; 4D422103199805F700963292 /* att.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = att.cpp; path = src/att.cpp; sourceTree = ""; }; 4D43C30B1A9BB22A00EA28F3 /* view_mensural.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = view_mensural.cpp; path = src/view_mensural.cpp; sourceTree = ""; }; + 4D5B522F1B7DE3FE00179688 /* att_classes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = att_classes.h; path = libmei/att_classes.h; sourceTree = ""; }; 4D763EC51987D04D003FCAB5 /* metersig.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = metersig.cpp; path = src/metersig.cpp; sourceTree = ""; }; 4D763EC81987D067003FCAB5 /* metersig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = metersig.h; path = include/vrv/metersig.h; sourceTree = ""; }; 4D797B041A67C55F007637BD /* devicecontextbase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = devicecontextbase.h; path = include/vrv/devicecontextbase.h; sourceTree = ""; }; @@ -445,6 +446,7 @@ 4DEE28EC1940BCA100C76319 /* libmei */ = { isa = PBXGroup; children = ( + 4D5B522F1B7DE3FE00179688 /* att_classes.h */, 4DEE28ED1940BCC100C76319 /* atts_analysis.cpp */, 4DEE28EE1940BCC100C76319 /* atts_analysis.h */, 4DEE28EF1940BCC100C76319 /* atts_cmn.cpp */, diff --git a/emscripten/build.sh b/emscripten/build.sh index 10f797082d8..6a5845ddb1a 100755 --- a/emscripten/build.sh +++ b/emscripten/build.sh @@ -30,7 +30,6 @@ if [ ! -d data ]; then mkdir data; fi ASM="\ -O3 --memory-init-file 0 \ -s ASM_JS=1 \ - --profiling -g2 \ -s OUTLINING_LIMIT=10000 -s TOTAL_MEMORY=128*1024*1024 \ -s TOTAL_STACK=64*1024*1024" diff --git a/include/vrv/accid.h b/include/vrv/accid.h index d90a3e7989f..82d03e9b821 100644 --- a/include/vrv/accid.h +++ b/include/vrv/accid.h @@ -32,7 +32,7 @@ class Accid: public LayerElement, public PositionInterface, virtual ~Accid(); virtual void Reset(); virtual std::string GetClassName( ) { return "Accid"; }; - virtual int Is() { return ACCID; }; + virtual ClassId Is() { return ACCID; }; ///@} diff --git a/include/vrv/aligner.h b/include/vrv/aligner.h index ddbc8aec0c0..6510a283042 100644 --- a/include/vrv/aligner.h +++ b/include/vrv/aligner.h @@ -62,7 +62,7 @@ class SystemAligner: public Object // constructors and destructors SystemAligner(); virtual ~SystemAligner(); - virtual int Is() { return SYSTEM_ALIGNER; } + virtual ClassId Is() { return SYSTEM_ALIGNER; } int GetStaffAlignmentCount() const { return (int)m_children.size(); }; @@ -109,7 +109,7 @@ class StaffAlignment: public Object // constructors and destructors StaffAlignment(); virtual ~StaffAlignment(); - virtual int Is() { return STAFF_ALIGNMENT; } + virtual ClassId Is() { return STAFF_ALIGNMENT; } void SetYRel( int yRel ) { m_yRel = yRel; }; int GetYRel() { return m_yRel; }; @@ -176,7 +176,7 @@ class Alignment: public Object Alignment( ); Alignment( double time, AlignmentType type = ALIGNMENT_DEFAULT ); virtual ~Alignment(); - virtual int Is() { return ALIGNMENT; } + virtual ClassId Is() { return ALIGNMENT; } void SetXRel( int x_rel ); int GetXRel() { return m_xRel; }; @@ -297,7 +297,7 @@ class MeasureAligner: public Object // constructors and destructors MeasureAligner(); virtual ~MeasureAligner(); - virtual int Is() { return MEASURE_ALIGNER; } + virtual ClassId Is() { return MEASURE_ALIGNER; } int GetAlignmentCount() const { return (int)m_children.size(); }; @@ -392,7 +392,7 @@ class GraceAligner: public MeasureAligner // constructors and destructors GraceAligner( ); virtual ~GraceAligner(); - virtual int Is() { return GRACE_ALIGNER; } + virtual ClassId Is() { return GRACE_ALIGNER; } /** * Because the grace notes appear from left to right but need to be aligned diff --git a/include/vrv/att.h b/include/vrv/att.h index 01fc4007aa4..b979c98ceb0 100644 --- a/include/vrv/att.h +++ b/include/vrv/att.h @@ -8,12 +8,11 @@ #ifndef __VRV_ATT_H__ #define __VRV_ATT_H__ -#include #include //---------------------------------------------------------------------------- -#include "attdef.h" +#include "vrvdef.h" namespace vrv { @@ -200,30 +199,30 @@ class Att }; //---------------------------------------------------------------------------- -// AttInterface +// Interface //---------------------------------------------------------------------------- -class AttInterface +class Interface { public: - AttInterface() {}; - virtual ~AttInterface() {}; + Interface() {}; + virtual ~Interface() {}; /** * */ - void RegisterInterfaceAttClass( int attClassId ) { m_interfaceAttClasses.push_back( attClassId ); }; - std::vector *GetAttClasses() { return &m_interfaceAttClasses; }; + void RegisterInterfaceAttClass( AttClassId attClassId ) { m_interfaceAttClasses.push_back( attClassId ); }; + std::vector *GetAttClasses() { return &m_interfaceAttClasses; }; - virtual int InterfaceId() { return 0; }; + virtual InterfaceId IsInterface() { return INTERFACE; }; private: /** * */ - std::vector m_interfaceAttClasses; + std::vector m_interfaceAttClasses; }; //---------------------------------------------------------------------------- @@ -234,18 +233,18 @@ class AttComparison { public: - AttComparison( int classId ) { + AttComparison( ClassId classId ) { m_classId = classId; }; virtual bool operator() (Object *object); - int GetType() { return m_classId; }; + ClassId GetType() { return m_classId; }; bool MatchesType( Object *object ); protected: - int m_classId; + ClassId m_classId; }; } // namespace vrv diff --git a/include/vrv/att_comparison.h b/include/vrv/att_comparison.h index 68abc711ad8..300324dd2c2 100644 --- a/include/vrv/att_comparison.h +++ b/include/vrv/att_comparison.h @@ -20,7 +20,7 @@ class AttCommonNComparison: public AttComparison { public: - AttCommonNComparison( int AttClassId, const int n ): + AttCommonNComparison( ClassId AttClassId, const int n ): AttComparison( AttClassId ) { m_n = n; @@ -31,14 +31,10 @@ class AttCommonNComparison: public AttComparison virtual bool operator() (Object *object) { if (!MatchesType(object)) return false; - /* - AttCommon *element = dynamic_cast(object); - if (!element) return false; - return (element->GetN() == m_n); - */ - + // This should not happen but, but just in case if (!object->HasAttClass( ATT_COMMON )) return false; AttCommon *element = dynamic_cast(object); + assert( element ); return (element->GetN() == m_n); } diff --git a/include/vrv/attdef.h b/include/vrv/attdef.h index adc02f057da..0b24e0bf60d 100644 --- a/include/vrv/attdef.h +++ b/include/vrv/attdef.h @@ -20,8 +20,7 @@ namespace vrv { typedef std::vector > ArrayOfStrAttr; #define VRV_UNSET -0x7FFFFFFF - - + //---------------------------------------------------------------------------- // Durations //---------------------------------------------------------------------------- diff --git a/include/vrv/barline.h b/include/vrv/barline.h index f9557c82527..5295b73620a 100644 --- a/include/vrv/barline.h +++ b/include/vrv/barline.h @@ -35,7 +35,7 @@ class Barline: public LayerElement, virtual void Reset(); virtual Object* Clone() { return new Barline(*this); }; virtual std::string GetClassName( ) { return "Barline"; }; - virtual int Is() { return BAR_LINE; }; + virtual ClassId Is() { return BAR_LINE; }; ///@} /** @@ -52,10 +52,6 @@ class Barline: public LayerElement, private: public: - /** Indicates a partial barLine (inbetween the staves) - no MEI equivalent */ - bool m_partialBarline; - /** Indicates a barLine displayed only on the staff - no MEI equivalent */ - bool m_onStaffOnly; private: @@ -81,7 +77,7 @@ class BarlineAttr: public Barline virtual ~BarlineAttr(); virtual Object* Clone() { return new BarlineAttr(*this); }; virtual std::string GetClassName( ) { return "BarlineAttr"; }; - virtual int Is() { return BAR_LINE_ATTR; }; + virtual ClassId Is() { return BAR_LINE_ATTR; }; ///@} }; diff --git a/include/vrv/beam.h b/include/vrv/beam.h index 9c89ea1a6c0..f01a8099de9 100644 --- a/include/vrv/beam.h +++ b/include/vrv/beam.h @@ -40,7 +40,7 @@ class Beam: public LayerElement, public ObjectListInterface, public DrawingListI virtual ~Beam(); virtual void Reset(); virtual std::string GetClassName( ) { return "Beam"; }; - virtual int Is() { return BEAM; }; + virtual ClassId Is() { return BEAM; }; ///@} int GetNoteCount() const { return (int)m_children.size(); }; diff --git a/include/vrv/chord.h b/include/vrv/chord.h index 4aaabb4fa48..ff965da2b77 100644 --- a/include/vrv/chord.h +++ b/include/vrv/chord.h @@ -9,10 +9,6 @@ #ifndef __VRV_CHORD_H__ #define __VRV_CHORD_H__ -#include - -//---------------------------------------------------------------------------- - #include "atts_shared.h" #include "durationinterface.h" #include "layerelement.h" @@ -48,7 +44,7 @@ class Chord: public LayerElement, public ObjectListInterface, public DurationInt virtual ~Chord(); virtual void Reset(); virtual std::string GetClassName( ) { return "Chord"; }; - virtual int Is() { return CHORD; }; + virtual ClassId Is() { return CHORD; }; ///@} /** diff --git a/include/vrv/clef.h b/include/vrv/clef.h index fe160f5da24..07895ac2cae 100644 --- a/include/vrv/clef.h +++ b/include/vrv/clef.h @@ -41,7 +41,7 @@ class Clef: public LayerElement, virtual void Reset(); virtual Object* Clone() { return new Clef(*this); }; virtual std::string GetClassName( ) { return "Clef"; }; - virtual int Is() { return CLEF; }; + virtual ClassId Is() { return CLEF; }; ///@} /** @@ -83,7 +83,7 @@ class ClefAttr: public Object, virtual ~ClefAttr(); virtual void Reset(); virtual std::string GetClassName( ) { return "ClefAttr"; }; - virtual int Is() { return CLEF_ATTR; }; + virtual ClassId Is() { return CLEF_ATTR; }; virtual Object* Clone() { return new ClefAttr(*this); }; ///@} diff --git a/include/vrv/custos.h b/include/vrv/custos.h index b5254d04e09..fca15aaff87 100644 --- a/include/vrv/custos.h +++ b/include/vrv/custos.h @@ -30,7 +30,7 @@ class Custos: public LayerElement, public PositionInterface virtual ~Custos(); virtual void Reset(); virtual std::string GetClassName( ) { return "Custos"; }; - virtual int Is() { return CUSTOS; }; + virtual ClassId Is() { return CUSTOS; }; ///@} protected: diff --git a/include/vrv/doc.h b/include/vrv/doc.h index 7890e39472d..d27c4a2d850 100644 --- a/include/vrv/doc.h +++ b/include/vrv/doc.h @@ -39,7 +39,7 @@ class Doc: public Object // constructors and destructors Doc(); virtual ~Doc(); - virtual int Is() { return DOC; } + virtual ClassId Is() { return DOC; } void AddPage( Page *page ); @@ -97,8 +97,8 @@ class Doc: public Object * These should eventually be set at parameters. */ ///@{ - char GetLeftMargin( const std::type_info *elementType ); - char GetRightMargin( const std::type_info *elementType ); + char GetLeftMargin( const ClassId classId ); + char GetRightMargin( const ClassId classId ); ///@} /* diff --git a/include/vrv/dot.h b/include/vrv/dot.h index aedbef1c86a..10d4f6f9e47 100644 --- a/include/vrv/dot.h +++ b/include/vrv/dot.h @@ -32,7 +32,7 @@ class Dot: public LayerElement, public PositionInterface virtual ~Dot(); virtual void Reset(); virtual std::string GetClassName( ) { return "Dot"; }; - virtual int Is() { return DOT; }; + virtual ClassId Is() { return DOT; }; ///@} diff --git a/include/vrv/durationinterface.h b/include/vrv/durationinterface.h index 1baef6b6b25..2d178e8bd55 100644 --- a/include/vrv/durationinterface.h +++ b/include/vrv/durationinterface.h @@ -25,7 +25,7 @@ class Object; * This class is an interface for elements with duration, such as notes and rests. * It is not an abstract class but should not be instanciate directly. */ -class DurationInterface: public AttInterface, +class DurationInterface: public Interface, public AttAugmentdots, public AttBeamsecondary, public AttDurationMusical, @@ -43,6 +43,7 @@ class DurationInterface: public AttInterface, DurationInterface(); virtual ~DurationInterface(); virtual void Reset(); + virtual InterfaceId IsInterface() { return INTERFACE_DURATION; }; ///@}SetDurationGes /** diff --git a/include/vrv/editorial.h b/include/vrv/editorial.h index ea0ab7e22a9..b5cbda370c4 100644 --- a/include/vrv/editorial.h +++ b/include/vrv/editorial.h @@ -52,7 +52,7 @@ class EditorialElement: public DocObject, EditorialElement(std::string classid); virtual ~EditorialElement(); virtual void Reset(); - virtual int Is() { return EDITORIAL_ELEMENT; }; + virtual ClassId Is() { return EDITORIAL_ELEMENT; }; ///@} /** @@ -108,7 +108,7 @@ class App: public EditorialElement virtual ~App(); virtual void Reset(); virtual std::string GetClassName( ) { return "App"; }; - virtual int Is() { return APP; }; + virtual ClassId Is() { return APP; }; ///@} /** Getter for level **/ @@ -149,7 +149,7 @@ class Lem: public EditorialElement, virtual ~Lem(); virtual void Reset(); virtual std::string GetClassName( ) { return "Lem"; }; - virtual int Is() { return LEM; }; + virtual ClassId Is() { return LEM; }; ///@} protected: @@ -179,7 +179,7 @@ class Rdg: public EditorialElement, virtual ~Rdg(); virtual void Reset(); virtual std::string GetClassName( ) { return "Rdg"; }; - virtual int Is() { return RDG; }; + virtual ClassId Is() { return RDG; }; ///@} protected: @@ -209,7 +209,7 @@ class Supplied: public EditorialElement, virtual ~Supplied(); virtual void Reset(); virtual std::string GetClassName( ) { return "Supplied"; }; - virtual int Is() { return SUPPLIED; }; + virtual ClassId Is() { return SUPPLIED; }; ///@} protected: diff --git a/include/vrv/keysig.h b/include/vrv/keysig.h index ba2a4e5b163..fe142128bdd 100644 --- a/include/vrv/keysig.h +++ b/include/vrv/keysig.h @@ -50,7 +50,7 @@ class KeySig: public LayerElement, virtual void Reset(); virtual Object* Clone() { return new KeySig(*this); }; virtual std::string GetClassName( ) { return "KeySig"; }; - virtual int Is() { return KEY_SIG; }; + virtual ClassId Is() { return KEY_SIG; }; unsigned char GetAlterationAt(int pos); int GetOctave(unsigned char pitch, int clefId); @@ -102,7 +102,7 @@ class KeySigAttr: public Object, virtual ~KeySigAttr(); virtual void Reset(); virtual std::string GetClassName( ) { return "KeySigAttr"; }; - virtual int Is() { return KEY_SIG_ATTR; }; + virtual ClassId Is() { return KEY_SIG_ATTR; }; virtual Object* Clone() { return new KeySigAttr(*this); }; ///@} diff --git a/include/vrv/layer.h b/include/vrv/layer.h index 4f6d7fd325d..0f1d71ff24b 100644 --- a/include/vrv/layer.h +++ b/include/vrv/layer.h @@ -9,10 +9,6 @@ #ifndef __VRV_LAYER_H__ #define __VRV_LAYER_H__ -#include - -//---------------------------------------------------------------------------- - #include "atts_shared.h" #include "clef.h" #include "drawinglistinterface.h" @@ -51,7 +47,7 @@ class Layer: public DocObject, public DrawingListInterface, public ObjectListInt virtual ~Layer(); virtual void Reset(); virtual std::string GetClassName( ) { return "Layer"; }; - virtual int Is() { return LAYER; }; + virtual ClassId Is() { return LAYER; }; ///@} void AddLayerElement( LayerElement *element, int idx = -1 ); @@ -68,17 +64,6 @@ class Layer: public DocObject, public DrawingListInterface, public ObjectListInt LayerElement *GetAtPos( int x ); LayerElement *Insert( LayerElement *element, int x ); // return a pointer on the inserted element - void Insert( LayerElement *element, LayerElement *before ); - - void Delete( LayerElement *element ); - - /** - * Looks for the first LayerElement of type elementType. - * Looks FORWARD of BACKWARD depending on the direction parameter. - * Returns the retrieved element if *succ == true or the original element if not. - */ - LayerElement *GetFirstOld( LayerElement *element, bool direction, const std::type_info *elementType, bool *succ ); - /** * Get the current clef for the test element. * Goes back on the layer until a clef is found. @@ -93,12 +78,6 @@ class Layer: public DocObject, public DrawingListInterface, public ObjectListInt */ int GetClefOffset( LayerElement *test ); - /** - * Basic method that remove intermediate clefs and custos. - * Used for building collations (See CmpFile::Collate). - */ - void RemoveClefAndCustos( ); - /** * Set drawing clef, keysig and mensur if necessary and if available. * Also set the current clef. diff --git a/include/vrv/layerelement.h b/include/vrv/layerelement.h index b010a799a96..be808186475 100644 --- a/include/vrv/layerelement.h +++ b/include/vrv/layerelement.h @@ -41,17 +41,11 @@ class LayerElement: public DocObject LayerElement(std::string classid); virtual ~LayerElement(); virtual void Reset(); - virtual int Is() { return LAYER_ELEMENT; }; + virtual ClassId Is() { return LAYER_ELEMENT; }; ///@} LayerElement& operator=( const LayerElement& element ); // copy assignement - this need to be changed to the Object::Clone way; - /** - * Return a copy of the LayerElement (child class). - * By default, a new uuid is generated - */ - LayerElement *GetChildCopy( bool newUuid = true ); - /** * Reset the alignment values (m_drawingX, m_drawingXRel, etc.) * Called by AlignHorizontally @@ -77,28 +71,9 @@ class LayerElement: public DocObject * @name Child type checkers. */ ///@{ - bool IsAccid(); - bool IsBarline(); - bool IsBeam(); - bool IsChord(); - bool IsClef(); - bool IsCustos(); - bool IsDot(); bool HasDurationInterface(); - bool IsKeySig(); - bool IsMensur(); - bool IsMeterSig(); - bool IsMultiRest(); - bool IsMRest(); - bool IsNote(); bool HasPitchInterface(); bool HasPositionInterface(); - bool IsRest(); - bool IsTie(); - bool IsTuplet(); - bool IsSpace(); - bool IsSyl(); - bool IsVerse(); bool IsGraceNote(); ///@} diff --git a/include/vrv/measure.h b/include/vrv/measure.h index 279f102ed83..13b629ac9b1 100644 --- a/include/vrv/measure.h +++ b/include/vrv/measure.h @@ -43,7 +43,7 @@ class Measure: public DocObject, virtual ~Measure(); virtual void Reset(); virtual std::string GetClassName( ) { return "Measure"; }; - virtual int Is() { return MEASURE; }; + virtual ClassId Is() { return MEASURE; }; ///@} /** diff --git a/include/vrv/measureelement.h b/include/vrv/measureelement.h index 5171ef6251a..0734b5da48e 100644 --- a/include/vrv/measureelement.h +++ b/include/vrv/measureelement.h @@ -33,7 +33,7 @@ class MeasureElement: public DocObject MeasureElement(std::string classid); virtual ~MeasureElement(); virtual void Reset(); - virtual int Is() { return MEASURE_ELEMENT; }; + virtual ClassId Is() { return MEASURE_ELEMENT; }; ///@} private: diff --git a/include/vrv/mensur.h b/include/vrv/mensur.h index dbe7f3aaac6..b8e6e50a23f 100644 --- a/include/vrv/mensur.h +++ b/include/vrv/mensur.h @@ -43,7 +43,7 @@ class Mensur: public LayerElement, virtual ~Mensur(); virtual void Reset(); virtual std::string GetClassName( ) { return "Mensur"; }; - virtual int Is() { return MENSUR; }; + virtual ClassId Is() { return MENSUR; }; virtual Object* Clone() { return new Mensur(*this); }; ///@} @@ -87,7 +87,7 @@ class MensurAttr: public Object, virtual ~MensurAttr(); virtual void Reset(); virtual std::string GetClassName( ) { return "MensurAttr"; }; - virtual int Is() { return MENSUR_ATTR; }; + virtual ClassId Is() { return MENSUR_ATTR; }; virtual Object* Clone() { return new MensurAttr(*this); }; ///@} diff --git a/include/vrv/metersig.h b/include/vrv/metersig.h index 72279670504..1c478a14fd1 100644 --- a/include/vrv/metersig.h +++ b/include/vrv/metersig.h @@ -38,7 +38,7 @@ class MeterSig: public LayerElement, virtual ~MeterSig(); virtual void Reset(); virtual std::string GetClassName( ) { return "MeterSig"; }; - virtual int Is() { return METER_SIG; }; + virtual ClassId Is() { return METER_SIG; }; virtual Object* Clone() { return new MeterSig(*this); }; ///@} @@ -72,7 +72,7 @@ class MeterSigAttr: public Object, virtual ~MeterSigAttr(); virtual void Reset(); virtual std::string GetClassName( ) { return "MeterSigAttr"; }; - virtual int Is() { return METER_SIG_ATTR; }; + virtual ClassId Is() { return METER_SIG_ATTR; }; virtual Object* Clone() { return new MeterSigAttr(*this); }; ///@} diff --git a/include/vrv/mrest.h b/include/vrv/mrest.h index 4ef519d4378..f8f26b5f291 100644 --- a/include/vrv/mrest.h +++ b/include/vrv/mrest.h @@ -32,7 +32,7 @@ class MRest: public LayerElement virtual ~MRest(); virtual void Reset(); virtual std::string GetClassName( ){ return "MRest"; }; ; - virtual int Is() { return MREST; }; + virtual ClassId Is() { return MREST; }; ///@} private: diff --git a/include/vrv/multirest.h b/include/vrv/multirest.h index ca3db626cf0..e81c6d58c34 100644 --- a/include/vrv/multirest.h +++ b/include/vrv/multirest.h @@ -35,7 +35,7 @@ class MultiRest: public LayerElement, virtual ~MultiRest(); virtual void Reset(); virtual std::string GetClassName( ) { return "MultiRest"; }; - virtual int Is() { return MULTI_REST; }; + virtual ClassId Is() { return MULTI_REST; }; ///@} private: diff --git a/include/vrv/note.h b/include/vrv/note.h index 177fb2b943a..790b1c5f70b 100644 --- a/include/vrv/note.h +++ b/include/vrv/note.h @@ -59,7 +59,7 @@ class Note: public LayerElement, public DurationInterface, public PitchInterface virtual ~Note(); virtual void Reset(); virtual std::string GetClassName( ) { return "Note"; }; - virtual int Is() { return NOTE; }; + virtual ClassId Is() { return NOTE; }; ///@} /** diff --git a/include/vrv/object.h b/include/vrv/object.h index 1cb2dc619cc..7e9151130ca 100644 --- a/include/vrv/object.h +++ b/include/vrv/object.h @@ -12,10 +12,10 @@ #include #include #include -#include //---------------------------------------------------------------------------- +#include "att_classes.h" #include "vrvdef.h" namespace vrv { @@ -68,15 +68,18 @@ class Object Object(); Object(std::string classid); virtual ~Object(); - virtual int Is(); + virtual ClassId Is(); + bool IsEditorialElement() { return (this->Is() > EDITORIAL_ELEMENT && this->Is() < EDITORIAL_ELEMENT_max); }; + bool IsLayerElement() { return (this->Is() > LAYER_ELEMENT && this->Is() < LAYER_ELEMENT_max); }; + bool IsMeasureElement() { return (this->Is() > MEASURE_ELEMENT && this->Is() < MEASURE_ELEMENT_max); }; /** * */ - void RegisterAttClass( int attClassId ) { m_attClasses.push_back( attClassId ); }; - bool HasAttClass( int attClassId ) { return std::find(m_attClasses.begin(), m_attClasses.end(), attClassId) != m_attClasses.end(); }; - void RegisterInterface( std::vector *attClasses, int interfaceId ); - bool HasInterface( int interfaceId ); + void RegisterAttClass( AttClassId attClassId ) { m_attClasses.push_back( attClassId ); }; + bool HasAttClass( AttClassId attClassId ) { return std::find(m_attClasses.begin(), m_attClasses.end(), attClassId) != m_attClasses.end(); }; + void RegisterInterface( std::vector *attClasses, InterfaceId interfaceId ); + bool HasInterface( InterfaceId interfaceId ) { return std::find(m_interfaces.begin(), m_interfaces.end(), interfaceId) != m_interfaces.end(); }; /** * Reset the object, that is 1) removing all childs and 2) resetting all attributes. @@ -122,7 +125,7 @@ class Object * Used for classes with several types of children */ int GetChildCount() { return (int)m_children.size(); }; - int GetChildCount( const std::type_info *elementType ); + int GetChildCount( const ClassId classId ); /** * Child access (generic) @@ -148,7 +151,7 @@ class Object * Always call GetFirst before calling GetNext */ ///@{ - Object *GetFirst( const std::type_info *elementType = NULL ); + Object *GetFirst( const ClassId classId = UNSPECIFIED ); Object *GetNext( ); ///@} @@ -207,7 +210,7 @@ class Object * Look for a child with the specified type (returns NULL if not found) * This method is a wrapper to a Object::FindByType functor. */ - Object *FindChildByType( int classId, + Object *FindChildByType( ClassId classId, int deepness = UNLIMITED_DEPTH, bool direction = FORWARD ); /** @@ -237,32 +240,32 @@ class Object * Return the first parent of the specified type. * The maxSteps parameter limit the search to a certain number of level if not -1. */ - Object *GetFirstParent( const int elementType, int maxSteps = -1 ); + Object *GetFirstParent( const ClassId classId, int maxSteps = -1 ); /** * Return the last parent that is NOT of the specified type. * The maxSteps parameter limit the search to a certain number of level if not -1. */ - Object *GetLastParentNot( const int elementType, int maxSteps = -1 ); + Object *GetLastParentNot( const ClassId classId, int maxSteps = -1 ); /** * Return the first of the specified type. */ - Object *GetFirstChild( const std::type_info *elementType ); + Object *GetFirstChild( const ClassId classId ); /** * Return the previous sibling object of the specified type. * If no type is specified, returns the previous object. * Returns NULL if not found in both cases. */ - Object *GetPreviousSibling( const std::type_info *elementType = NULL ); + Object *GetPreviousSibling( const ClassId classId = UNSPECIFIED ); /** * Return the next sibling object of the specified type. * If no type is specified, returns the next object. * Returns NULL if not found in both cases. */ - Object *GetNextSibling( const std::type_info *elementType = NULL ); + Object *GetNextSibling( const ClassId classId = UNSPECIFIED ); /** * Fill the list of all the children LayerElement. @@ -658,12 +661,17 @@ class Object * Values are set when GetFirst is called (which is mandatory) */ ArrayOfObjects::iterator m_iteratorEnd, m_iteratorCurrent; - const std::type_info *m_iteratorElementType; + ClassId m_iteratorElementType; /** * */ - std::vector m_attClasses; + std::vector m_attClasses; + + /** + * + */ + std::vector m_interfaces; }; //---------------------------------------------------------------------------- @@ -680,13 +688,7 @@ class DocObject: public Object DocObject(); DocObject(std::string classid); virtual ~DocObject(); - virtual int Is() { return DOC_OBJECT; } - - /** - * Refreshes the views from Doc. - * From other DocObject, simply pass it to its parent until Doc is reached. - */ - virtual void Refresh(); + virtual ClassId Is() { return DOC_OBJECT; } void UpdateContentBB( int x1, int y1, int x2, int y2); void UpdateSelfBB( int x1, int y1, int x2, int y2 ); @@ -758,8 +760,8 @@ class ObjectListInterface /** * Gets the first item of type elementType starting at startFrom */ - Object *GetListFirst(const Object *startFrom, const std::type_info *elementType = NULL ); - Object *GetListFirstBackward(Object *startFrom, const std::type_info *elementType = NULL ); + Object *GetListFirst(const Object *startFrom, const ClassId classId = UNSPECIFIED ); + Object *GetListFirstBackward(Object *startFrom, const ClassId classId = UNSPECIFIED ); /** * Returns the previous object in the list (NULL if not found) @@ -856,14 +858,14 @@ class ObjectComparison { public: - ObjectComparison( const std::type_info *elementType ) { m_elementType = elementType; }; + ObjectComparison( const ClassId classId ) { m_classId = classId; }; bool operator() (Object *object) { - if (!m_elementType) { + if (m_classId == UNSPECIFIED) { return true; } - return (typeid(*object) == *m_elementType); + return (object->Is() == m_classId); } private: @@ -871,7 +873,7 @@ class ObjectComparison public: private: - const std::type_info *m_elementType; + ClassId m_classId; }; diff --git a/include/vrv/page.h b/include/vrv/page.h index ecf042d77dc..7fb01661cdd 100644 --- a/include/vrv/page.h +++ b/include/vrv/page.h @@ -40,12 +40,10 @@ class Page: public DocObject virtual ~Page(); virtual void Reset(); virtual std::string GetClassName( ) { return "Page"; }; - virtual int Is() { return PAGE; }; + virtual ClassId Is() { return PAGE; }; ///@} void AddSystem( System *system ); - - System *GetAtPos( int y ); int GetSystemCount() const { return (int)m_children.size(); }; diff --git a/include/vrv/pitchinterface.h b/include/vrv/pitchinterface.h index 703be22b681..7c2bc71a583 100644 --- a/include/vrv/pitchinterface.h +++ b/include/vrv/pitchinterface.h @@ -21,7 +21,7 @@ namespace vrv { * This class is an interface for elements with pitch, such as notes and neumes. * It is not an abstract class but should not be instanciate directly. */ -class PitchInterface: public AttInterface, +class PitchInterface: public Interface, public AttAccidental, public AttOctave, public AttPitch @@ -35,6 +35,7 @@ class PitchInterface: public AttInterface, PitchInterface(); virtual ~PitchInterface(); virtual void Reset(); + virtual InterfaceId IsInterface() { return INTERFACE_PITCH; }; ///@} /** diff --git a/include/vrv/positioninterface.h b/include/vrv/positioninterface.h index 5383eb1acbc..d42c1e4132d 100644 --- a/include/vrv/positioninterface.h +++ b/include/vrv/positioninterface.h @@ -22,7 +22,7 @@ namespace vrv { * It is not an abstract class but should not be instanciate directly. * For now, the position is handled in a similar way that for PitchInterface, that is with a pitch and octave. */ -class PositionInterface: public AttInterface, +class PositionInterface: public Interface, public AttStafflocPitched { public: @@ -34,6 +34,7 @@ class PositionInterface: public AttInterface, PositionInterface(); virtual ~PositionInterface(); virtual void Reset(); + virtual InterfaceId IsInterface() { return INTERFACE_POSITION; }; ///@} /** diff --git a/include/vrv/rest.h b/include/vrv/rest.h index 217fac23936..2210fd6e79e 100644 --- a/include/vrv/rest.h +++ b/include/vrv/rest.h @@ -34,7 +34,7 @@ class Rest: public LayerElement, public DurationInterface, public PositionInterf virtual ~Rest(); virtual void Reset(); virtual std::string GetClassName( ) { return "Rest"; }; - virtual int Is() { return REST; }; + virtual ClassId Is() { return REST; }; ///@} private: diff --git a/include/vrv/scoredef.h b/include/vrv/scoredef.h index 00ca1d5fe65..5be8b9d519c 100644 --- a/include/vrv/scoredef.h +++ b/include/vrv/scoredef.h @@ -155,7 +155,7 @@ class ScoreDef: public Object, public ScoreOrStaffDefAttrInterface, public Objec virtual ~ScoreDef(); virtual void Reset(); virtual std::string GetClassName( ) { return "ScoreDef"; }; - virtual int Is() { return SCORE_DEF; }; + virtual ClassId Is() { return SCORE_DEF; }; ///@} void AddStaffGrp( StaffGrp *staffGrp ); @@ -241,7 +241,7 @@ class StaffGrp: public Object, public ObjectListInterface virtual Object* Clone() { return new StaffGrp(*this); }; virtual void Reset(); virtual std::string GetClassName( ) { return "StaffGrp"; }; - virtual int Is() { return STAFF_GRP; }; + virtual ClassId Is() { return STAFF_GRP; }; ///@} void AddStaffDef( StaffDef *staffDef ); @@ -309,7 +309,7 @@ class StaffDef: public Object, public ScoreOrStaffDefAttrInterface, virtual Object* Clone() { return new StaffDef(*this); }; virtual void Reset(); virtual std::string GetClassName( ) { return "StaffDef"; }; - virtual int Is() { return STAFF_DEF; }; + virtual ClassId Is() { return STAFF_DEF; }; ///@} /** diff --git a/include/vrv/slur.h b/include/vrv/slur.h index 472b9d523ba..e8017d02970 100644 --- a/include/vrv/slur.h +++ b/include/vrv/slur.h @@ -30,7 +30,7 @@ class Slur: public MeasureElement, public TimeSpanningInterface virtual ~Slur(); virtual void Reset(); virtual std::string GetClassName( ) { return "Slur"; }; - virtual int Is() { return SLUR; }; + virtual ClassId Is() { return SLUR; }; ///@} //----------// diff --git a/include/vrv/space.h b/include/vrv/space.h index 517f6db6267..911cdf149d7 100644 --- a/include/vrv/space.h +++ b/include/vrv/space.h @@ -33,7 +33,7 @@ class Space: public LayerElement, public DurationInterface virtual ~Space(); virtual void Reset(); virtual std::string GetClassName( ){ return "Space"; }; ; - virtual int Is() { return SPACE; }; + virtual ClassId Is() { return SPACE; }; ///@} private: diff --git a/include/vrv/staff.h b/include/vrv/staff.h index 329f39c217b..9426bcc251a 100644 --- a/include/vrv/staff.h +++ b/include/vrv/staff.h @@ -44,7 +44,7 @@ class Staff: public MeasureElement, virtual ~Staff(); virtual void Reset(); virtual std::string GetClassName( ) { return "Staff"; }; - virtual int Is() { return STAFF; }; + virtual ClassId Is() { return STAFF; }; ///@} void AddLayer( Layer *layer ); diff --git a/include/vrv/syl.h b/include/vrv/syl.h index ea464e5bca6..a7f4c392ff7 100644 --- a/include/vrv/syl.h +++ b/include/vrv/syl.h @@ -41,7 +41,7 @@ class Syl: public LayerElement, public TimeSpanningInterface, virtual ~Syl(); virtual void Reset(); virtual std::string GetClassName( ) { return "Syl"; }; - virtual int Is() { return SYL; }; + virtual ClassId Is() { return SYL; }; ///@} //----------// diff --git a/include/vrv/system.h b/include/vrv/system.h index 1c0f71fde20..2eed7da34f2 100644 --- a/include/vrv/system.h +++ b/include/vrv/system.h @@ -40,14 +40,12 @@ class System: public DocObject, public DrawingListInterface virtual ~System(); virtual void Reset(); virtual std::string GetClassName( ) { return "System"; }; - virtual int Is() { return SYSTEM; }; + virtual ClassId Is() { return SYSTEM; }; ///@} void AddMeasure( Measure *measure ); void AddScoreDef( ScoreDef *scoreDef ); - - Measure *GetAtPos( int x ); /** * @name Reset the alignment values (m_drawingX, m_drawingXRel, etc.) diff --git a/include/vrv/tie.h b/include/vrv/tie.h index 34262947856..9d62d0e971c 100644 --- a/include/vrv/tie.h +++ b/include/vrv/tie.h @@ -32,7 +32,7 @@ class Tie: public MeasureElement, public TimeSpanningInterface virtual ~Tie(); virtual void Reset(); virtual std::string GetClassName( ) { return "Tie"; }; - virtual int Is() { return TIE; }; + virtual ClassId Is() { return TIE; }; ///@} ///@} diff --git a/include/vrv/timeinterface.h b/include/vrv/timeinterface.h index c1236b69032..6274360d275 100644 --- a/include/vrv/timeinterface.h +++ b/include/vrv/timeinterface.h @@ -25,7 +25,7 @@ class LayerElement; * This class is an interface for elements with duration, such as notes and rests. * It is not an abstract class but should not be instanciate directly. */ -class TimeSpanningInterface: public AttInterface, +class TimeSpanningInterface: public Interface, public AttStartendid, public AttStartid, public AttTimestampMusical, @@ -40,6 +40,7 @@ class TimeSpanningInterface: public AttInterface, TimeSpanningInterface(); virtual ~TimeSpanningInterface(); virtual void Reset(); + virtual InterfaceId IsInterface() { return INTERFACE_TIME_SPANNING; }; ///@} /** diff --git a/include/vrv/tuplet.h b/include/vrv/tuplet.h index 0af4847256f..ef0849df706 100644 --- a/include/vrv/tuplet.h +++ b/include/vrv/tuplet.h @@ -33,7 +33,7 @@ class Tuplet: public LayerElement, public ObjectListInterface, virtual ~Tuplet(); virtual void Reset(); virtual std::string GetClassName( ) { return "Tuplet"; }; - virtual int Is() { return TUPLET; }; + virtual ClassId Is() { return TUPLET; }; ///@} int GetNoteCount() const { return (int)m_children.size(); }; diff --git a/include/vrv/verse.h b/include/vrv/verse.h index 1cbca87443b..1b0d08271d8 100644 --- a/include/vrv/verse.h +++ b/include/vrv/verse.h @@ -33,7 +33,7 @@ class Verse: public LayerElement, virtual ~Verse(); virtual void Reset(); virtual std::string GetClassName( ) { return "Verse"; }; - virtual int Is() { return VERSE; }; + virtual ClassId Is() { return VERSE; }; ///@} /** diff --git a/include/vrv/view.h b/include/vrv/view.h index e1d1b3883c1..47802e8c1a3 100644 --- a/include/vrv/view.h +++ b/include/vrv/view.h @@ -9,10 +9,6 @@ #ifndef __VRV_RENDERER_H__ #define __VRV_RENDERER_H__ -#include - -//---------------------------------------------------------------------------- - #include "devicecontextbase.h" #include "scoredef.h" #include "vrvdef.h" @@ -147,7 +143,7 @@ class View */ ///@{ void DrawSystem( DeviceContext *dc, System *system ); - void DrawSystemList( DeviceContext *dc, System *system, const std::type_info *elementType ); + void DrawSystemList( DeviceContext *dc, System *system, const ClassId classId ); void DrawScoreDef( DeviceContext *dc, ScoreDef *scoreDef, Measure *measure, int x, Barline *barLine = NULL ); void DrawStaffGrp( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp, int x, bool topStaffGrp = false ); void DrawStaffDefLabels( DeviceContext *dc, Measure *measure, ScoreDef *scoreDef, bool abbreviations = false ); @@ -156,12 +152,11 @@ class View void DrawBarlines( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp, Barline *barLine ); void DrawBarline( DeviceContext *dc, int y_top, int y_bottom, Barline *barLine ); void DrawBarlineDots ( DeviceContext *dc, StaffDef *staffDef, Staff *staff, Barline *barLine ); - void DrawPartialBarline ( DeviceContext *dc, System *system, int x, Staff *pportee); void DrawMeasure( DeviceContext *dc, Measure *measure, System *system ); void DrawStaff( DeviceContext *dc, Staff *staff, Measure *measure, System *system ); void DrawStaffLines( DeviceContext *dc, Staff *staff, Measure *measure, System *system ); void DrawLayer( DeviceContext *dc, Layer *layer, Staff *staff, Measure *measure ); - void DrawLayerList( DeviceContext *dc, Layer *layer, Staff *staff, Measure *measure, const std::type_info *elementType ); + void DrawLayerList( DeviceContext *dc, Layer *layer, Staff *staff, Measure *measure, const ClassId classId ); void DrawSlur( DeviceContext *dc, Layer *layer, int x1, int y1, int x2, int y2, bool up, int height = -1); ///@} diff --git a/include/vrv/vrvdef.h b/include/vrv/vrvdef.h index a9507e47211..ee77847c32e 100644 --- a/include/vrv/vrvdef.h +++ b/include/vrv/vrvdef.h @@ -16,6 +16,7 @@ //---------------------------------------------------------------------------- +#include "att_classes.h" #include "attdef.h" namespace vrv { @@ -40,63 +41,82 @@ typedef std::vector ArrayOfBeamElementCoords; typedef std::map > MapOfLedgerLineFlags; -//---------------------------------------------------------------------------- -// Object defines -//---------------------------------------------------------------------------- -enum { - OBJECT = 0, - ACCID, - ALIGNMENT, - APP, - ANNOT, - BAR_LINE, - BAR_LINE_ATTR, - BEAM, - CHORD, - CLEF, - CLEF_ATTR, - CUSTOS, - DOC, - DOC_OBJECT, - DOT, - EDITORIAL_ELEMENT, - GRACE_ALIGNER, - KEY_SIG, - KEY_SIG_ATTR, - LAYER, - LAYER_ELEMENT, - LEM, - MEASURE, - MEASURE_ELEMENT, - MEASURE_ALIGNER, - MENSUR, - MENSUR_ATTR, - METER_SIG, - METER_SIG_ATTR, - MREST, - MULTI_REST, - NOTE, - PAGE, - RDG, - REST, - SCORE_DEF, - SLUR, - SPACE, - STAFF, - STAFF_ALIGNMENT, - STAFF_DEF, - STAFF_GRP, - SUPPLIED, - SYL, - SYSTEM, - SYSTEM_ALIGNER, - SYSTEM_ALIGNMENT, - TIE, - TUPLET, - VERSE -}; + //---------------------------------------------------------------------------- + // Object defines + //---------------------------------------------------------------------------- + enum ClassId { + OBJECT = 0, + ALIGNMENT, + CLEF_ATTR, + DOC, + DOC_OBJECT, + GRACE_ALIGNER, + KEY_SIG_ATTR, + LAYER, + MEASURE, + MEASURE_ALIGNER, + MENSUR_ATTR, + METER_SIG_ATTR, + PAGE, + SCORE_DEF, + STAFF_ALIGNMENT, + STAFF_DEF, + STAFF_GRP, + SYSTEM, + SYSTEM_ALIGNER, + SYSTEM_ALIGNMENT, + // + EDITORIAL_ELEMENT, + ANNOT, + APP, + LEM, + RDG, + SUPPLIED, + EDITORIAL_ELEMENT_max, + // + LAYER_ELEMENT, + ACCID, + BAR_LINE, + BAR_LINE_ATTR, + BEAM, + CHORD, + CLEF, + CUSTOS, + DOT, + KEY_SIG, + MENSUR, + METER_SIG, + MREST, + MULTI_REST, + NOTE, + REST, + SPACE, + SYL, + TUPLET, + VERSE, + LAYER_ELEMENT_max, + // + MEASURE_ELEMENT, + SLUR, + STAFF, + TEMPO, + TIE, + MEASURE_ELEMENT_max, + // + UNSPECIFIED + }; + + enum InterfaceId { + INTERFACE, + INTERFACE_DURATION, + INTERFACE_PITCH, + INTERFACE_POSITION, + INTERFACE_TEXT, + INTERFACE_TIME_SPANNING + }; + //---------------------------------------------------------------------------- // Global defines //---------------------------------------------------------------------------- diff --git a/libmei/att_classes.h b/libmei/att_classes.h new file mode 100644 index 00000000000..d8f7a8a37cc --- /dev/null +++ b/libmei/att_classes.h @@ -0,0 +1,232 @@ +///////////////////////////////////////////////////////////////////////////// +// Authors: Laurent Pugin and Rodolfo Zitellini +// Created: 2014 +// Copyright (c) Authors and others. All rights reserved. +// +// Code generated using a modified version of libmei +// by Andrew Hankinson, Alastair Porter, and Others +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// NOTE: this file was generated with the Verovio libmei version and +// should not be edited because changes will be lost. +///////////////////////////////////////////////////////////////////////////// + +#ifndef __VRV_ATT_CLASSES_H__ +#define __VRV_ATT_CLASSES_H__ + +//---------------------------------------------------------------------------- + +namespace vrv { + +enum AttClassId { + ATT_CLASS_min = 0, + ATT_COMMONANL, + ATT_HARMONICFUNCTION, + ATT_INTERVALHARMONIC, + ATT_INTERVALLICDESC, + ATT_MELODICFUNCTION, + ATT_PITCHCLASS, + ATT_SOLFA, + ATT_ARPEGLOG, + ATT_ARPEGVIS, + ATT_BTREMLOG, + ATT_BEAMED, + ATT_BEAMEDWITH, + ATT_BEAMINGLOG, + ATT_BEAMREND, + ATT_BEAMSECONDARY, + ATT_BEATRPTVIS, + ATT_BENDGES, + ATT_CUTOUT, + ATT_EXPANDABLE, + ATT_FTREMLOG, + ATT_FERMATAVIS, + ATT_GLISSVIS, + ATT_GRACED, + ATT_HAIRPINLOG, + ATT_HAIRPINVIS, + ATT_HARPPEDALLOG, + ATT_LVPRESENT, + ATT_MULTIRESTVIS, + ATT_NOTEGESCMN, + ATT_NUMBERED, + ATT_NUMBERPLACEMENT, + ATT_OCTAVELOG, + ATT_PEDALLOG, + ATT_PEDALVIS, + ATT_PIANOPEDALS, + ATT_REHEARSAL, + ATT_SCOREDEFVISCMN, + ATT_SLURREND, + ATT_STEMMEDCMN, + ATT_TIEREND, + ATT_TREMMEASURED, + ATT_TUPLETVIS, + ATT_MORDENTLOG, + ATT_ORNAM, + ATT_ORNAMENTACCID, + ATT_TURNLOG, + ATT_CRIT, + ATT_SOURCE, + ATT_AGENTIDENT, + ATT_EDIT, + ATT_EXTENT, + ATT_REASONIDENT, + ATT_FACSIMILE, + ATT_TABULAR, + ATT_FRETLOCATION, + ATT_HARMLOG, + ATT_HARMVIS, + ATT_REGULARMETHOD, + ATT_ALIGNMENT, + ATT_VERSELOG, + ATT_LIGATURELOG, + ATT_MENSURVIS, + ATT_MENSURALLOG, + ATT_MENSURALSHARED, + ATT_MENSURALVIS, + ATT_NOTELOGMENSURAL, + ATT_RESTVISMENSURAL, + ATT_CHANNELIZED, + ATT_MIDIINSTRUMENT, + ATT_MIDINUMBER, + ATT_MIDITEMPO, + ATT_MIDIVALUE, + ATT_TIMEBASE, + ATT_INEUMELOG, + ATT_UNEUMELOG, + ATT_SURFACE, + ATT_ACCIDLOG, + ATT_ACCIDENTAL, + ATT_ACCIDENTALPERFORMED, + ATT_ALTSYM, + ATT_ARTICULATION, + ATT_ARTICULATIONPERFORMED, + ATT_AUGMENTDOTS, + ATT_AUTHORIZED, + ATT_BARLINELOG, + ATT_BARPLACEMENT, + ATT_BEAMINGVIS, + ATT_BIBL, + ATT_CALENDARED, + ATT_CANONICAL, + ATT_CHORDVIS, + ATT_CLEFLOG, + ATT_CLEFFINGLOG, + ATT_CLEFFINGVIS, + ATT_CLEFSHAPE, + ATT_CODED, + ATT_COLOR, + ATT_COLORATION, + ATT_COMMON, + ATT_COORDINATED, + ATT_CURVATURE, + ATT_CURVEREND, + ATT_CUSTOSLOG, + ATT_DATABLE, + ATT_DATAPOINTING, + ATT_DECLARING, + ATT_DISTANCES, + ATT_DOTLOG, + ATT_DURATIONADDITIVE, + ATT_DURATIONDEFAULT, + ATT_DURATIONMUSICAL, + ATT_DURATIONPERFORMED, + ATT_DURATIONRATIO, + ATT_ENCLOSINGCHARS, + ATT_FERMATAPRESENT, + ATT_HANDIDENT, + ATT_HORIZONTALALIGN, + ATT_INSTRUMENTIDENT, + ATT_INTERNETMEDIA, + ATT_JOINED, + ATT_KEYSIGLOG, + ATT_KEYSIGDEFAULTLOG, + ATT_KEYSIGDEFAULTVIS, + ATT_LABELSADDL, + ATT_LANG, + ATT_LAYERLOG, + ATT_LAYERIDENT, + ATT_LINELOC, + ATT_LINEREND, + ATT_LYRICSTYLE, + ATT_MEASURELOG, + ATT_MEASUREMENT, + ATT_MEDIABOUNDS, + ATT_MEDIUM, + ATT_MEIVERSION, + ATT_MENSURLOG, + ATT_METERSIGLOG, + ATT_METERSIGVIS, + ATT_METERSIGDEFAULTLOG, + ATT_METERSIGDEFAULTVIS, + ATT_METERCONFORMANCE, + ATT_METERCONFORMANCEBAR, + ATT_MMTEMPO, + ATT_MULTINUMMEASURES, + ATT_NAME, + ATT_NOTEGES, + ATT_NOTEVIS, + ATT_OCTAVE, + ATT_OCTAVEDEFAULT, + ATT_OCTAVEDISPLACEMENT, + ATT_ONELINESTAFF, + ATT_PADLOG, + ATT_PBVIS, + ATT_PITCH, + ATT_PLACEMENT, + ATT_PLIST, + ATT_POINTING, + ATT_RELATIVESIZE, + ATT_RESPONSIBILITY, + ATT_SBVIS, + ATT_SCALABLE, + ATT_SCOREDEFGES, + ATT_SCOREDEFVIS, + ATT_SECTIONVIS, + ATT_SEQUENCE, + ATT_SLASHCOUNT, + ATT_SLURPRESENT, + ATT_SPACEVIS, + ATT_STAFFLOG, + ATT_STAFFDEFVIS, + ATT_STAFFGRPVIS, + ATT_STAFFGROUPINGSYM, + ATT_STAFFIDENT, + ATT_STAFFLOC, + ATT_STAFFLOCPITCHED, + ATT_STARTENDID, + ATT_STARTID, + ATT_STEMMED, + ATT_SYLLOG, + ATT_SYLTEXT, + ATT_TEXTSTYLE, + ATT_TIEPRESENT, + ATT_TIMESTAMPMUSICAL, + ATT_TIMESTAMPPERFORMED, + ATT_TIMESTAMP2MUSICAL, + ATT_TRANSPOSITION, + ATT_TUPLETPRESENT, + ATT_TYPED, + ATT_TYPOGRAPHY, + ATT_VISIBILITY, + ATT_VISUALOFFSETHO, + ATT_VISUALOFFSETTO, + ATT_VISUALOFFSETVO, + ATT_VISUALOFFSET2HO, + ATT_VISUALOFFSET2TO, + ATT_VISUALOFFSET2VO, + ATT_WHITESPACE, + ATT_WIDTH, + ATT_XY, + ATT_XY2, + ATT_NOTEGESTABLATURE, + ATT_STAFFDEFGESTABLATURE, + ATT_CLASS_max +}; + +} // vrv namespace + +#endif // __VRV_ATT_CLASSES_H__ + diff --git a/libmei/atts_analysis.cpp b/libmei/atts_analysis.cpp index 1c7d2efa306..146a8c18e16 100644 --- a/libmei/atts_analysis.cpp +++ b/libmei/atts_analysis.cpp @@ -16,6 +16,10 @@ //---------------------------------------------------------------------------- +#include + +//---------------------------------------------------------------------------- + #include "object.h" /* #include_block */ @@ -400,7 +404,8 @@ bool AttSolfa::HasPsolfa( ) bool Att::SetAnalysis( Object *element, std::string attrType, std::string attrValue ) { if (element->HasAttClass( ATT_COMMONANL ) ) { - AttCommonAnl *att = reinterpret_cast(element); + AttCommonAnl *att = dynamic_cast(element); + assert( att ); if (attrType == "copyof") { att->SetCopyof(att->StrToStr(attrValue)); return true; @@ -427,42 +432,48 @@ bool Att::SetAnalysis( Object *element, std::string attrType, std::string attrVa } } if (element->HasAttClass( ATT_HARMONICFUNCTION ) ) { - AttHarmonicfunction *att = reinterpret_cast(element); + AttHarmonicfunction *att = dynamic_cast(element); + assert( att ); if (attrType == "deg") { att->SetDeg(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_INTERVALHARMONIC ) ) { - AttIntervalharmonic *att = reinterpret_cast(element); + AttIntervalharmonic *att = dynamic_cast(element); + assert( att ); if (attrType == "inth") { att->SetInth(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_INTERVALLICDESC ) ) { - AttIntervallicdesc *att = reinterpret_cast(element); + AttIntervallicdesc *att = dynamic_cast(element); + assert( att ); if (attrType == "intm") { att->SetIntm(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_MELODICFUNCTION ) ) { - AttMelodicfunction *att = reinterpret_cast(element); + AttMelodicfunction *att = dynamic_cast(element); + assert( att ); if (attrType == "mfunc") { att->SetMfunc(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_PITCHCLASS ) ) { - AttPitchclass *att = reinterpret_cast(element); + AttPitchclass *att = dynamic_cast(element); + assert( att ); if (attrType == "pclass") { att->SetPclass(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_SOLFA ) ) { - AttSolfa *att = reinterpret_cast(element); + AttSolfa *att = dynamic_cast(element); + assert( att ); if (attrType == "psolfa") { att->SetPsolfa(att->StrToStr(attrValue)); return true; @@ -474,7 +485,8 @@ bool Att::SetAnalysis( Object *element, std::string attrType, std::string attrVa void Att::GetAnalysis( Object *element, ArrayOfStrAttr *attributes ) { if (element->HasAttClass( ATT_COMMONANL ) ) { - AttCommonAnl *att = reinterpret_cast(element); + AttCommonAnl *att = dynamic_cast(element); + assert( att ); if (att->HasCopyof()) { attributes->push_back(std::make_pair("copyof", att->StrToStr(att->GetCopyof()))); } @@ -495,37 +507,43 @@ void Att::GetAnalysis( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_HARMONICFUNCTION ) ) { - AttHarmonicfunction *att = reinterpret_cast(element); + AttHarmonicfunction *att = dynamic_cast(element); + assert( att ); if (att->HasDeg()) { attributes->push_back(std::make_pair("deg", att->StrToStr(att->GetDeg()))); } } if (element->HasAttClass( ATT_INTERVALHARMONIC ) ) { - AttIntervalharmonic *att = reinterpret_cast(element); + AttIntervalharmonic *att = dynamic_cast(element); + assert( att ); if (att->HasInth()) { attributes->push_back(std::make_pair("inth", att->StrToStr(att->GetInth()))); } } if (element->HasAttClass( ATT_INTERVALLICDESC ) ) { - AttIntervallicdesc *att = reinterpret_cast(element); + AttIntervallicdesc *att = dynamic_cast(element); + assert( att ); if (att->HasIntm()) { attributes->push_back(std::make_pair("intm", att->StrToStr(att->GetIntm()))); } } if (element->HasAttClass( ATT_MELODICFUNCTION ) ) { - AttMelodicfunction *att = reinterpret_cast(element); + AttMelodicfunction *att = dynamic_cast(element); + assert( att ); if (att->HasMfunc()) { attributes->push_back(std::make_pair("mfunc", att->StrToStr(att->GetMfunc()))); } } if (element->HasAttClass( ATT_PITCHCLASS ) ) { - AttPitchclass *att = reinterpret_cast(element); + AttPitchclass *att = dynamic_cast(element); + assert( att ); if (att->HasPclass()) { attributes->push_back(std::make_pair("pclass", att->StrToStr(att->GetPclass()))); } } if (element->HasAttClass( ATT_SOLFA ) ) { - AttSolfa *att = reinterpret_cast(element); + AttSolfa *att = dynamic_cast(element); + assert( att ); if (att->HasPsolfa()) { attributes->push_back(std::make_pair("psolfa", att->StrToStr(att->GetPsolfa()))); } diff --git a/libmei/atts_analysis.h b/libmei/atts_analysis.h index 0bbddbf34af..cbefc6b340e 100644 --- a/libmei/atts_analysis.h +++ b/libmei/atts_analysis.h @@ -16,6 +16,7 @@ #define __VRV_ATTS_ANALYSIS_H__ #include "att.h" +#include "att_classes.h" #include "pugixml.hpp" //---------------------------------------------------------------------------- @@ -28,8 +29,6 @@ namespace vrv { // AttCommonAnl //---------------------------------------------------------------------------- -#define ATT_COMMONANL 1 - class AttCommonAnl: public Att { public: @@ -109,8 +108,6 @@ class AttCommonAnl: public Att // AttHarmonicfunction //---------------------------------------------------------------------------- -#define ATT_HARMONICFUNCTION 2 - class AttHarmonicfunction: public Att { public: @@ -155,8 +152,6 @@ class AttHarmonicfunction: public Att // AttIntervalharmonic //---------------------------------------------------------------------------- -#define ATT_INTERVALHARMONIC 3 - class AttIntervalharmonic: public Att { public: @@ -198,8 +193,6 @@ class AttIntervalharmonic: public Att // AttIntervallicdesc //---------------------------------------------------------------------------- -#define ATT_INTERVALLICDESC 4 - class AttIntervallicdesc: public Att { public: @@ -243,8 +236,6 @@ class AttIntervallicdesc: public Att // AttMelodicfunction //---------------------------------------------------------------------------- -#define ATT_MELODICFUNCTION 5 - class AttMelodicfunction: public Att { public: @@ -283,8 +274,6 @@ class AttMelodicfunction: public Att // AttPitchclass //---------------------------------------------------------------------------- -#define ATT_PITCHCLASS 6 - class AttPitchclass: public Att { public: @@ -323,8 +312,6 @@ class AttPitchclass: public Att // AttSolfa //---------------------------------------------------------------------------- -#define ATT_SOLFA 7 - class AttSolfa: public Att { public: diff --git a/libmei/atts_cmn.cpp b/libmei/atts_cmn.cpp index 9559f511ad5..f89bb7495b7 100644 --- a/libmei/atts_cmn.cpp +++ b/libmei/atts_cmn.cpp @@ -16,6 +16,10 @@ //---------------------------------------------------------------------------- +#include + +//---------------------------------------------------------------------------- + #include "object.h" /* #include_block */ @@ -1754,42 +1758,48 @@ bool AttTupletVis::HasNumFormat( ) bool Att::SetCmn( Object *element, std::string attrType, std::string attrValue ) { if (element->HasAttClass( ATT_ARPEGLOG ) ) { - AttArpegLog *att = reinterpret_cast(element); + AttArpegLog *att = dynamic_cast(element); + assert( att ); if (attrType == "order") { att->SetOrder(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_ARPEGVIS ) ) { - AttArpegVis *att = reinterpret_cast(element); + AttArpegVis *att = dynamic_cast(element); + assert( att ); if (attrType == "arrow") { att->SetArrow(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_BTREMLOG ) ) { - AttBTremLog *att = reinterpret_cast(element); + AttBTremLog *att = dynamic_cast(element); + assert( att ); if (attrType == "form") { att->SetForm(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_BEAMED ) ) { - AttBeamed *att = reinterpret_cast(element); + AttBeamed *att = dynamic_cast(element); + assert( att ); if (attrType == "beam") { att->SetBeam(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_BEAMEDWITH ) ) { - AttBeamedwith *att = reinterpret_cast(element); + AttBeamedwith *att = dynamic_cast(element); + assert( att ); if (attrType == "beamWith") { att->SetBeamWith(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_BEAMINGLOG ) ) { - AttBeamingLog *att = reinterpret_cast(element); + AttBeamingLog *att = dynamic_cast(element); + assert( att ); if (attrType == "beamGroup") { att->SetBeamGroup(att->StrToStr(attrValue)); return true; @@ -1800,7 +1810,8 @@ bool Att::SetCmn( Object *element, std::string attrType, std::string attrValue ) } } if (element->HasAttClass( ATT_BEAMREND ) ) { - AttBeamrend *att = reinterpret_cast(element); + AttBeamrend *att = dynamic_cast(element); + assert( att ); if (attrType == "rend") { att->SetRend(att->StrToStr(attrValue)); return true; @@ -1811,49 +1822,56 @@ bool Att::SetCmn( Object *element, std::string attrType, std::string attrValue ) } } if (element->HasAttClass( ATT_BEAMSECONDARY ) ) { - AttBeamsecondary *att = reinterpret_cast(element); + AttBeamsecondary *att = dynamic_cast(element); + assert( att ); if (attrType == "breaksecInt") { att->SetBreaksec(att->StrToInt(attrValue)); return true; } } if (element->HasAttClass( ATT_BEATRPTVIS ) ) { - AttBeatRptVis *att = reinterpret_cast(element); + AttBeatRptVis *att = dynamic_cast(element); + assert( att ); if (attrType == "rend") { att->SetRend(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_BENDGES ) ) { - AttBendGes *att = reinterpret_cast(element); + AttBendGes *att = dynamic_cast(element); + assert( att ); if (attrType == "amount") { att->SetAmount(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_CUTOUT ) ) { - AttCutout *att = reinterpret_cast(element); + AttCutout *att = dynamic_cast(element); + assert( att ); if (attrType == "cutout") { att->SetCutout(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_EXPANDABLE ) ) { - AttExpandable *att = reinterpret_cast(element); + AttExpandable *att = dynamic_cast(element); + assert( att ); if (attrType == "expand") { att->SetExpand(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_FTREMLOG ) ) { - AttFTremLog *att = reinterpret_cast(element); + AttFTremLog *att = dynamic_cast(element); + assert( att ); if (attrType == "form") { att->SetForm(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_FERMATAVIS ) ) { - AttFermataVis *att = reinterpret_cast(element); + AttFermataVis *att = dynamic_cast(element); + assert( att ); if (attrType == "form") { att->SetForm(att->StrToStr(attrValue)); return true; @@ -1864,14 +1882,16 @@ bool Att::SetCmn( Object *element, std::string attrType, std::string attrValue ) } } if (element->HasAttClass( ATT_GLISSVIS ) ) { - AttGlissVis *att = reinterpret_cast(element); + AttGlissVis *att = dynamic_cast(element); + assert( att ); if (attrType == "text") { att->SetText(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_GRACED ) ) { - AttGraced *att = reinterpret_cast(element); + AttGraced *att = dynamic_cast(element); + assert( att ); if (attrType == "grace") { att->SetGrace(att->StrToGrace(attrValue)); return true; @@ -1882,21 +1902,24 @@ bool Att::SetCmn( Object *element, std::string attrType, std::string attrValue ) } } if (element->HasAttClass( ATT_HAIRPINLOG ) ) { - AttHairpinLog *att = reinterpret_cast(element); + AttHairpinLog *att = dynamic_cast(element); + assert( att ); if (attrType == "form") { att->SetForm(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_HAIRPINVIS ) ) { - AttHairpinVis *att = reinterpret_cast(element); + AttHairpinVis *att = dynamic_cast(element); + assert( att ); if (attrType == "opening") { att->SetOpening(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_HARPPEDALLOG ) ) { - AttHarpPedalLog *att = reinterpret_cast(element); + AttHarpPedalLog *att = dynamic_cast(element); + assert( att ); if (attrType == "c") { att->SetC(att->StrToStr(attrValue)); return true; @@ -1927,35 +1950,40 @@ bool Att::SetCmn( Object *element, std::string attrType, std::string attrValue ) } } if (element->HasAttClass( ATT_LVPRESENT ) ) { - AttLvpresent *att = reinterpret_cast(element); + AttLvpresent *att = dynamic_cast(element); + assert( att ); if (attrType == "lv") { att->SetLv(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_MULTIRESTVIS ) ) { - AttMultiRestVis *att = reinterpret_cast(element); + AttMultiRestVis *att = dynamic_cast(element); + assert( att ); if (attrType == "block") { att->SetBlock(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_NOTEGESCMN ) ) { - AttNoteGesCmn *att = reinterpret_cast(element); + AttNoteGesCmn *att = dynamic_cast(element); + assert( att ); if (attrType == "gliss") { att->SetGliss(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_NUMBERED ) ) { - AttNumbered *att = reinterpret_cast(element); + AttNumbered *att = dynamic_cast(element); + assert( att ); if (attrType == "numInt") { att->SetNum(att->StrToInt(attrValue)); return true; } } if (element->HasAttClass( ATT_NUMBERPLACEMENT ) ) { - AttNumberplacement *att = reinterpret_cast(element); + AttNumberplacement *att = dynamic_cast(element); + assert( att ); if (attrType == "numPlace") { att->SetNumPlace(att->StrToStr(attrValue)); return true; @@ -1966,56 +1994,64 @@ bool Att::SetCmn( Object *element, std::string attrType, std::string attrValue ) } } if (element->HasAttClass( ATT_OCTAVELOG ) ) { - AttOctaveLog *att = reinterpret_cast(element); + AttOctaveLog *att = dynamic_cast(element); + assert( att ); if (attrType == "coll") { att->SetColl(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_PEDALLOG ) ) { - AttPedalLog *att = reinterpret_cast(element); + AttPedalLog *att = dynamic_cast(element); + assert( att ); if (attrType == "dir") { att->SetDir(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_PEDALVIS ) ) { - AttPedalVis *att = reinterpret_cast(element); + AttPedalVis *att = dynamic_cast(element); + assert( att ); if (attrType == "style") { att->SetStyle(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_PIANOPEDALS ) ) { - AttPianopedals *att = reinterpret_cast(element); + AttPianopedals *att = dynamic_cast(element); + assert( att ); if (attrType == "pedalStyle") { att->SetPedalStyle(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_REHEARSAL ) ) { - AttRehearsal *att = reinterpret_cast(element); + AttRehearsal *att = dynamic_cast(element); + assert( att ); if (attrType == "rehEnclose") { att->SetRehEnclose(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_SCOREDEFVISCMN ) ) { - AttScoreDefVisCmn *att = reinterpret_cast(element); + AttScoreDefVisCmn *att = dynamic_cast(element); + assert( att ); if (attrType == "gridShow") { att->SetGridShow(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_SLURREND ) ) { - AttSlurrend *att = reinterpret_cast(element); + AttSlurrend *att = dynamic_cast(element); + assert( att ); if (attrType == "slurRend") { att->SetSlurRend(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_STEMMEDCMN ) ) { - AttStemmedCmn *att = reinterpret_cast(element); + AttStemmedCmn *att = dynamic_cast(element); + assert( att ); if (attrType == "stemMod") { att->SetStemMod(att->StrToStr(attrValue)); return true; @@ -2026,21 +2062,24 @@ bool Att::SetCmn( Object *element, std::string attrType, std::string attrValue ) } } if (element->HasAttClass( ATT_TIEREND ) ) { - AttTierend *att = reinterpret_cast(element); + AttTierend *att = dynamic_cast(element); + assert( att ); if (attrType == "tieRend") { att->SetTieRend(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_TREMMEASURED ) ) { - AttTremmeasured *att = reinterpret_cast(element); + AttTremmeasured *att = dynamic_cast(element); + assert( att ); if (attrType == "measperf") { att->SetMeasperf(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_TUPLETVIS ) ) { - AttTupletVis *att = reinterpret_cast(element); + AttTupletVis *att = dynamic_cast(element); + assert( att ); if (attrType == "bracketPlace") { att->SetBracketPlace(att->StrToStr(attrValue)); return true; @@ -2064,37 +2103,43 @@ bool Att::SetCmn( Object *element, std::string attrType, std::string attrValue ) void Att::GetCmn( Object *element, ArrayOfStrAttr *attributes ) { if (element->HasAttClass( ATT_ARPEGLOG ) ) { - AttArpegLog *att = reinterpret_cast(element); + AttArpegLog *att = dynamic_cast(element); + assert( att ); if (att->HasOrder()) { attributes->push_back(std::make_pair("order", att->StrToStr(att->GetOrder()))); } } if (element->HasAttClass( ATT_ARPEGVIS ) ) { - AttArpegVis *att = reinterpret_cast(element); + AttArpegVis *att = dynamic_cast(element); + assert( att ); if (att->HasArrow()) { attributes->push_back(std::make_pair("arrow", att->StrToStr(att->GetArrow()))); } } if (element->HasAttClass( ATT_BTREMLOG ) ) { - AttBTremLog *att = reinterpret_cast(element); + AttBTremLog *att = dynamic_cast(element); + assert( att ); if (att->HasForm()) { attributes->push_back(std::make_pair("form", att->StrToStr(att->GetForm()))); } } if (element->HasAttClass( ATT_BEAMED ) ) { - AttBeamed *att = reinterpret_cast(element); + AttBeamed *att = dynamic_cast(element); + assert( att ); if (att->HasBeam()) { attributes->push_back(std::make_pair("beam", att->StrToStr(att->GetBeam()))); } } if (element->HasAttClass( ATT_BEAMEDWITH ) ) { - AttBeamedwith *att = reinterpret_cast(element); + AttBeamedwith *att = dynamic_cast(element); + assert( att ); if (att->HasBeamWith()) { attributes->push_back(std::make_pair("beamWith", att->StrToStr(att->GetBeamWith()))); } } if (element->HasAttClass( ATT_BEAMINGLOG ) ) { - AttBeamingLog *att = reinterpret_cast(element); + AttBeamingLog *att = dynamic_cast(element); + assert( att ); if (att->HasBeamGroup()) { attributes->push_back(std::make_pair("beamGroup", att->StrToStr(att->GetBeamGroup()))); } @@ -2103,7 +2148,8 @@ void Att::GetCmn( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_BEAMREND ) ) { - AttBeamrend *att = reinterpret_cast(element); + AttBeamrend *att = dynamic_cast(element); + assert( att ); if (att->HasRend()) { attributes->push_back(std::make_pair("rend", att->StrToStr(att->GetRend()))); } @@ -2112,43 +2158,50 @@ void Att::GetCmn( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_BEAMSECONDARY ) ) { - AttBeamsecondary *att = reinterpret_cast(element); + AttBeamsecondary *att = dynamic_cast(element); + assert( att ); if (att->HasBreaksec()) { attributes->push_back(std::make_pair("breaksecInt", att->IntToStr(att->GetBreaksec()))); } } if (element->HasAttClass( ATT_BEATRPTVIS ) ) { - AttBeatRptVis *att = reinterpret_cast(element); + AttBeatRptVis *att = dynamic_cast(element); + assert( att ); if (att->HasRend()) { attributes->push_back(std::make_pair("rend", att->StrToStr(att->GetRend()))); } } if (element->HasAttClass( ATT_BENDGES ) ) { - AttBendGes *att = reinterpret_cast(element); + AttBendGes *att = dynamic_cast(element); + assert( att ); if (att->HasAmount()) { attributes->push_back(std::make_pair("amount", att->StrToStr(att->GetAmount()))); } } if (element->HasAttClass( ATT_CUTOUT ) ) { - AttCutout *att = reinterpret_cast(element); + AttCutout *att = dynamic_cast(element); + assert( att ); if (att->HasCutout()) { attributes->push_back(std::make_pair("cutout", att->StrToStr(att->GetCutout()))); } } if (element->HasAttClass( ATT_EXPANDABLE ) ) { - AttExpandable *att = reinterpret_cast(element); + AttExpandable *att = dynamic_cast(element); + assert( att ); if (att->HasExpand()) { attributes->push_back(std::make_pair("expand", att->StrToStr(att->GetExpand()))); } } if (element->HasAttClass( ATT_FTREMLOG ) ) { - AttFTremLog *att = reinterpret_cast(element); + AttFTremLog *att = dynamic_cast(element); + assert( att ); if (att->HasForm()) { attributes->push_back(std::make_pair("form", att->StrToStr(att->GetForm()))); } } if (element->HasAttClass( ATT_FERMATAVIS ) ) { - AttFermataVis *att = reinterpret_cast(element); + AttFermataVis *att = dynamic_cast(element); + assert( att ); if (att->HasForm()) { attributes->push_back(std::make_pair("form", att->StrToStr(att->GetForm()))); } @@ -2157,13 +2210,15 @@ void Att::GetCmn( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_GLISSVIS ) ) { - AttGlissVis *att = reinterpret_cast(element); + AttGlissVis *att = dynamic_cast(element); + assert( att ); if (att->HasText()) { attributes->push_back(std::make_pair("text", att->StrToStr(att->GetText()))); } } if (element->HasAttClass( ATT_GRACED ) ) { - AttGraced *att = reinterpret_cast(element); + AttGraced *att = dynamic_cast(element); + assert( att ); if (att->HasGrace()) { attributes->push_back(std::make_pair("grace", att->GraceToStr(att->GetGrace()))); } @@ -2172,19 +2227,22 @@ void Att::GetCmn( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_HAIRPINLOG ) ) { - AttHairpinLog *att = reinterpret_cast(element); + AttHairpinLog *att = dynamic_cast(element); + assert( att ); if (att->HasForm()) { attributes->push_back(std::make_pair("form", att->StrToStr(att->GetForm()))); } } if (element->HasAttClass( ATT_HAIRPINVIS ) ) { - AttHairpinVis *att = reinterpret_cast(element); + AttHairpinVis *att = dynamic_cast(element); + assert( att ); if (att->HasOpening()) { attributes->push_back(std::make_pair("opening", att->StrToStr(att->GetOpening()))); } } if (element->HasAttClass( ATT_HARPPEDALLOG ) ) { - AttHarpPedalLog *att = reinterpret_cast(element); + AttHarpPedalLog *att = dynamic_cast(element); + assert( att ); if (att->HasC()) { attributes->push_back(std::make_pair("c", att->StrToStr(att->GetC()))); } @@ -2208,31 +2266,36 @@ void Att::GetCmn( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_LVPRESENT ) ) { - AttLvpresent *att = reinterpret_cast(element); + AttLvpresent *att = dynamic_cast(element); + assert( att ); if (att->HasLv()) { attributes->push_back(std::make_pair("lv", att->StrToStr(att->GetLv()))); } } if (element->HasAttClass( ATT_MULTIRESTVIS ) ) { - AttMultiRestVis *att = reinterpret_cast(element); + AttMultiRestVis *att = dynamic_cast(element); + assert( att ); if (att->HasBlock()) { attributes->push_back(std::make_pair("block", att->StrToStr(att->GetBlock()))); } } if (element->HasAttClass( ATT_NOTEGESCMN ) ) { - AttNoteGesCmn *att = reinterpret_cast(element); + AttNoteGesCmn *att = dynamic_cast(element); + assert( att ); if (att->HasGliss()) { attributes->push_back(std::make_pair("gliss", att->StrToStr(att->GetGliss()))); } } if (element->HasAttClass( ATT_NUMBERED ) ) { - AttNumbered *att = reinterpret_cast(element); + AttNumbered *att = dynamic_cast(element); + assert( att ); if (att->HasNum()) { attributes->push_back(std::make_pair("numInt", att->IntToStr(att->GetNum()))); } } if (element->HasAttClass( ATT_NUMBERPLACEMENT ) ) { - AttNumberplacement *att = reinterpret_cast(element); + AttNumberplacement *att = dynamic_cast(element); + assert( att ); if (att->HasNumPlace()) { attributes->push_back(std::make_pair("numPlace", att->StrToStr(att->GetNumPlace()))); } @@ -2241,49 +2304,57 @@ void Att::GetCmn( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_OCTAVELOG ) ) { - AttOctaveLog *att = reinterpret_cast(element); + AttOctaveLog *att = dynamic_cast(element); + assert( att ); if (att->HasColl()) { attributes->push_back(std::make_pair("coll", att->StrToStr(att->GetColl()))); } } if (element->HasAttClass( ATT_PEDALLOG ) ) { - AttPedalLog *att = reinterpret_cast(element); + AttPedalLog *att = dynamic_cast(element); + assert( att ); if (att->HasDir()) { attributes->push_back(std::make_pair("dir", att->StrToStr(att->GetDir()))); } } if (element->HasAttClass( ATT_PEDALVIS ) ) { - AttPedalVis *att = reinterpret_cast(element); + AttPedalVis *att = dynamic_cast(element); + assert( att ); if (att->HasStyle()) { attributes->push_back(std::make_pair("style", att->StrToStr(att->GetStyle()))); } } if (element->HasAttClass( ATT_PIANOPEDALS ) ) { - AttPianopedals *att = reinterpret_cast(element); + AttPianopedals *att = dynamic_cast(element); + assert( att ); if (att->HasPedalStyle()) { attributes->push_back(std::make_pair("pedalStyle", att->StrToStr(att->GetPedalStyle()))); } } if (element->HasAttClass( ATT_REHEARSAL ) ) { - AttRehearsal *att = reinterpret_cast(element); + AttRehearsal *att = dynamic_cast(element); + assert( att ); if (att->HasRehEnclose()) { attributes->push_back(std::make_pair("rehEnclose", att->StrToStr(att->GetRehEnclose()))); } } if (element->HasAttClass( ATT_SCOREDEFVISCMN ) ) { - AttScoreDefVisCmn *att = reinterpret_cast(element); + AttScoreDefVisCmn *att = dynamic_cast(element); + assert( att ); if (att->HasGridShow()) { attributes->push_back(std::make_pair("gridShow", att->StrToStr(att->GetGridShow()))); } } if (element->HasAttClass( ATT_SLURREND ) ) { - AttSlurrend *att = reinterpret_cast(element); + AttSlurrend *att = dynamic_cast(element); + assert( att ); if (att->HasSlurRend()) { attributes->push_back(std::make_pair("slurRend", att->StrToStr(att->GetSlurRend()))); } } if (element->HasAttClass( ATT_STEMMEDCMN ) ) { - AttStemmedCmn *att = reinterpret_cast(element); + AttStemmedCmn *att = dynamic_cast(element); + assert( att ); if (att->HasStemMod()) { attributes->push_back(std::make_pair("stemMod", att->StrToStr(att->GetStemMod()))); } @@ -2292,19 +2363,22 @@ void Att::GetCmn( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_TIEREND ) ) { - AttTierend *att = reinterpret_cast(element); + AttTierend *att = dynamic_cast(element); + assert( att ); if (att->HasTieRend()) { attributes->push_back(std::make_pair("tieRend", att->StrToStr(att->GetTieRend()))); } } if (element->HasAttClass( ATT_TREMMEASURED ) ) { - AttTremmeasured *att = reinterpret_cast(element); + AttTremmeasured *att = dynamic_cast(element); + assert( att ); if (att->HasMeasperf()) { attributes->push_back(std::make_pair("measperf", att->StrToStr(att->GetMeasperf()))); } } if (element->HasAttClass( ATT_TUPLETVIS ) ) { - AttTupletVis *att = reinterpret_cast(element); + AttTupletVis *att = dynamic_cast(element); + assert( att ); if (att->HasBracketPlace()) { attributes->push_back(std::make_pair("bracketPlace", att->StrToStr(att->GetBracketPlace()))); } diff --git a/libmei/atts_cmn.h b/libmei/atts_cmn.h index 42ab2580d68..77982e3a3fb 100644 --- a/libmei/atts_cmn.h +++ b/libmei/atts_cmn.h @@ -16,6 +16,7 @@ #define __VRV_ATTS_CMN_H__ #include "att.h" +#include "att_classes.h" #include "pugixml.hpp" //---------------------------------------------------------------------------- @@ -28,8 +29,6 @@ namespace vrv { // AttArpegLog //---------------------------------------------------------------------------- -#define ATT_ARPEGLOG 8 - class AttArpegLog: public Att { public: @@ -68,8 +67,6 @@ class AttArpegLog: public Att // AttArpegVis //---------------------------------------------------------------------------- -#define ATT_ARPEGVIS 9 - class AttArpegVis: public Att { public: @@ -108,8 +105,6 @@ class AttArpegVis: public Att // AttBTremLog //---------------------------------------------------------------------------- -#define ATT_BTREMLOG 10 - class AttBTremLog: public Att { public: @@ -148,8 +143,6 @@ class AttBTremLog: public Att // AttBeamed //---------------------------------------------------------------------------- -#define ATT_BEAMED 11 - class AttBeamed: public Att { public: @@ -188,8 +181,6 @@ class AttBeamed: public Att // AttBeamedwith //---------------------------------------------------------------------------- -#define ATT_BEAMEDWITH 12 - class AttBeamedwith: public Att { public: @@ -232,8 +223,6 @@ class AttBeamedwith: public Att // AttBeamingLog //---------------------------------------------------------------------------- -#define ATT_BEAMINGLOG 13 - class AttBeamingLog: public Att { public: @@ -285,8 +274,6 @@ class AttBeamingLog: public Att // AttBeamrend //---------------------------------------------------------------------------- -#define ATT_BEAMREND 14 - class AttBeamrend: public Att { public: @@ -332,8 +319,6 @@ class AttBeamrend: public Att // AttBeamsecondary //---------------------------------------------------------------------------- -#define ATT_BEAMSECONDARY 15 - class AttBeamsecondary: public Att { public: @@ -377,8 +362,6 @@ class AttBeamsecondary: public Att // AttBeatRptVis //---------------------------------------------------------------------------- -#define ATT_BEATRPTVIS 16 - class AttBeatRptVis: public Att { public: @@ -417,8 +400,6 @@ class AttBeatRptVis: public Att // AttBendGes //---------------------------------------------------------------------------- -#define ATT_BENDGES 17 - class AttBendGes: public Att { public: @@ -461,8 +442,6 @@ class AttBendGes: public Att // AttCutout //---------------------------------------------------------------------------- -#define ATT_CUTOUT 18 - class AttCutout: public Att { public: @@ -501,8 +480,6 @@ class AttCutout: public Att // AttExpandable //---------------------------------------------------------------------------- -#define ATT_EXPANDABLE 19 - class AttExpandable: public Att { public: @@ -546,8 +523,6 @@ class AttExpandable: public Att // AttFTremLog //---------------------------------------------------------------------------- -#define ATT_FTREMLOG 20 - class AttFTremLog: public Att { public: @@ -586,8 +561,6 @@ class AttFTremLog: public Att // AttFermataVis //---------------------------------------------------------------------------- -#define ATT_FERMATAVIS 21 - class AttFermataVis: public Att { public: @@ -633,8 +606,6 @@ class AttFermataVis: public Att // AttGlissVis //---------------------------------------------------------------------------- -#define ATT_GLISSVIS 22 - class AttGlissVis: public Att { public: @@ -673,8 +644,6 @@ class AttGlissVis: public Att // AttGraced //---------------------------------------------------------------------------- -#define ATT_GRACED 23 - class AttGraced: public Att { public: @@ -723,8 +692,6 @@ class AttGraced: public Att // AttHairpinLog //---------------------------------------------------------------------------- -#define ATT_HAIRPINLOG 24 - class AttHairpinLog: public Att { public: @@ -763,8 +730,6 @@ class AttHairpinLog: public Att // AttHairpinVis //---------------------------------------------------------------------------- -#define ATT_HAIRPINVIS 25 - class AttHairpinVis: public Att { public: @@ -806,8 +771,6 @@ class AttHairpinVis: public Att // AttHarpPedalLog //---------------------------------------------------------------------------- -#define ATT_HARPPEDALLOG 26 - class AttHarpPedalLog: public Att { public: @@ -888,8 +851,6 @@ class AttHarpPedalLog: public Att // AttLvpresent //---------------------------------------------------------------------------- -#define ATT_LVPRESENT 27 - class AttLvpresent: public Att { public: @@ -931,8 +892,6 @@ class AttLvpresent: public Att // AttMultiRestVis //---------------------------------------------------------------------------- -#define ATT_MULTIRESTVIS 28 - class AttMultiRestVis: public Att { public: @@ -975,8 +934,6 @@ class AttMultiRestVis: public Att // AttNoteGesCmn //---------------------------------------------------------------------------- -#define ATT_NOTEGESCMN 29 - class AttNoteGesCmn: public Att { public: @@ -1015,8 +972,6 @@ class AttNoteGesCmn: public Att // AttNumbered //---------------------------------------------------------------------------- -#define ATT_NUMBERED 30 - class AttNumbered: public Att { public: @@ -1058,8 +1013,6 @@ class AttNumbered: public Att // AttNumberplacement //---------------------------------------------------------------------------- -#define ATT_NUMBERPLACEMENT 31 - class AttNumberplacement: public Att { public: @@ -1105,8 +1058,6 @@ class AttNumberplacement: public Att // AttOctaveLog //---------------------------------------------------------------------------- -#define ATT_OCTAVELOG 32 - class AttOctaveLog: public Att { public: @@ -1151,8 +1102,6 @@ class AttOctaveLog: public Att // AttPedalLog //---------------------------------------------------------------------------- -#define ATT_PEDALLOG 33 - class AttPedalLog: public Att { public: @@ -1191,8 +1140,6 @@ class AttPedalLog: public Att // AttPedalVis //---------------------------------------------------------------------------- -#define ATT_PEDALVIS 34 - class AttPedalVis: public Att { public: @@ -1231,8 +1178,6 @@ class AttPedalVis: public Att // AttPianopedals //---------------------------------------------------------------------------- -#define ATT_PIANOPEDALS 35 - class AttPianopedals: public Att { public: @@ -1271,8 +1216,6 @@ class AttPianopedals: public Att // AttRehearsal //---------------------------------------------------------------------------- -#define ATT_REHEARSAL 36 - class AttRehearsal: public Att { public: @@ -1311,8 +1254,6 @@ class AttRehearsal: public Att // AttScoreDefVisCmn //---------------------------------------------------------------------------- -#define ATT_SCOREDEFVISCMN 37 - class AttScoreDefVisCmn: public Att { public: @@ -1351,8 +1292,6 @@ class AttScoreDefVisCmn: public Att // AttSlurrend //---------------------------------------------------------------------------- -#define ATT_SLURREND 38 - class AttSlurrend: public Att { public: @@ -1391,8 +1330,6 @@ class AttSlurrend: public Att // AttStemmedCmn //---------------------------------------------------------------------------- -#define ATT_STEMMEDCMN 39 - class AttStemmedCmn: public Att { public: @@ -1445,8 +1382,6 @@ class AttStemmedCmn: public Att // AttTierend //---------------------------------------------------------------------------- -#define ATT_TIEREND 40 - class AttTierend: public Att { public: @@ -1485,8 +1420,6 @@ class AttTierend: public Att // AttTremmeasured //---------------------------------------------------------------------------- -#define ATT_TREMMEASURED 41 - class AttTremmeasured: public Att { public: @@ -1525,8 +1458,6 @@ class AttTremmeasured: public Att // AttTupletVis //---------------------------------------------------------------------------- -#define ATT_TUPLETVIS 42 - class AttTupletVis: public Att { public: diff --git a/libmei/atts_cmnornaments.cpp b/libmei/atts_cmnornaments.cpp index d27c0e6fbed..3296cf5892c 100644 --- a/libmei/atts_cmnornaments.cpp +++ b/libmei/atts_cmnornaments.cpp @@ -16,6 +16,10 @@ //---------------------------------------------------------------------------- +#include + +//---------------------------------------------------------------------------- + #include "object.h" /* #include_block */ @@ -241,7 +245,8 @@ bool AttTurnLog::HasForm( ) bool Att::SetCmnornaments( Object *element, std::string attrType, std::string attrValue ) { if (element->HasAttClass( ATT_MORDENTLOG ) ) { - AttMordentLog *att = reinterpret_cast(element); + AttMordentLog *att = dynamic_cast(element); + assert( att ); if (attrType == "form") { att->SetForm(att->StrToStr(attrValue)); return true; @@ -252,14 +257,16 @@ bool Att::SetCmnornaments( Object *element, std::string attrType, std::string at } } if (element->HasAttClass( ATT_ORNAM ) ) { - AttOrnam *att = reinterpret_cast(element); + AttOrnam *att = dynamic_cast(element); + assert( att ); if (attrType == "ornam") { att->SetOrnam(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_ORNAMENTACCID ) ) { - AttOrnamentaccid *att = reinterpret_cast(element); + AttOrnamentaccid *att = dynamic_cast(element); + assert( att ); if (attrType == "accidupper") { att->SetAccidupper(att->StrToStr(attrValue)); return true; @@ -270,7 +277,8 @@ bool Att::SetCmnornaments( Object *element, std::string attrType, std::string at } } if (element->HasAttClass( ATT_TURNLOG ) ) { - AttTurnLog *att = reinterpret_cast(element); + AttTurnLog *att = dynamic_cast(element); + assert( att ); if (attrType == "delayed") { att->SetDelayed(att->StrToStr(attrValue)); return true; @@ -286,7 +294,8 @@ bool Att::SetCmnornaments( Object *element, std::string attrType, std::string at void Att::GetCmnornaments( Object *element, ArrayOfStrAttr *attributes ) { if (element->HasAttClass( ATT_MORDENTLOG ) ) { - AttMordentLog *att = reinterpret_cast(element); + AttMordentLog *att = dynamic_cast(element); + assert( att ); if (att->HasForm()) { attributes->push_back(std::make_pair("form", att->StrToStr(att->GetForm()))); } @@ -295,13 +304,15 @@ void Att::GetCmnornaments( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_ORNAM ) ) { - AttOrnam *att = reinterpret_cast(element); + AttOrnam *att = dynamic_cast(element); + assert( att ); if (att->HasOrnam()) { attributes->push_back(std::make_pair("ornam", att->StrToStr(att->GetOrnam()))); } } if (element->HasAttClass( ATT_ORNAMENTACCID ) ) { - AttOrnamentaccid *att = reinterpret_cast(element); + AttOrnamentaccid *att = dynamic_cast(element); + assert( att ); if (att->HasAccidupper()) { attributes->push_back(std::make_pair("accidupper", att->StrToStr(att->GetAccidupper()))); } @@ -310,7 +321,8 @@ void Att::GetCmnornaments( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_TURNLOG ) ) { - AttTurnLog *att = reinterpret_cast(element); + AttTurnLog *att = dynamic_cast(element); + assert( att ); if (att->HasDelayed()) { attributes->push_back(std::make_pair("delayed", att->StrToStr(att->GetDelayed()))); } diff --git a/libmei/atts_cmnornaments.h b/libmei/atts_cmnornaments.h index 96ea60352ff..0d19b82ca28 100644 --- a/libmei/atts_cmnornaments.h +++ b/libmei/atts_cmnornaments.h @@ -16,6 +16,7 @@ #define __VRV_ATTS_CMNORNAMENTS_H__ #include "att.h" +#include "att_classes.h" #include "pugixml.hpp" //---------------------------------------------------------------------------- @@ -28,8 +29,6 @@ namespace vrv { // AttMordentLog //---------------------------------------------------------------------------- -#define ATT_MORDENTLOG 43 - class AttMordentLog: public Att { public: @@ -78,8 +77,6 @@ class AttMordentLog: public Att // AttOrnam //---------------------------------------------------------------------------- -#define ATT_ORNAM 44 - class AttOrnam: public Att { public: @@ -122,8 +119,6 @@ class AttOrnam: public Att // AttOrnamentaccid //---------------------------------------------------------------------------- -#define ATT_ORNAMENTACCID 45 - class AttOrnamentaccid: public Att { public: @@ -169,8 +164,6 @@ class AttOrnamentaccid: public Att // AttTurnLog //---------------------------------------------------------------------------- -#define ATT_TURNLOG 46 - class AttTurnLog: public Att { public: diff --git a/libmei/atts_critapp.cpp b/libmei/atts_critapp.cpp index b84e72d17b7..3a9afc8da86 100644 --- a/libmei/atts_critapp.cpp +++ b/libmei/atts_critapp.cpp @@ -16,6 +16,10 @@ //---------------------------------------------------------------------------- +#include + +//---------------------------------------------------------------------------- + #include "object.h" /* #include_block */ @@ -110,14 +114,16 @@ bool AttSource::HasSource( ) bool Att::SetCritapp( Object *element, std::string attrType, std::string attrValue ) { if (element->HasAttClass( ATT_CRIT ) ) { - AttCrit *att = reinterpret_cast(element); + AttCrit *att = dynamic_cast(element); + assert( att ); if (attrType == "cause") { att->SetCause(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_SOURCE ) ) { - AttSource *att = reinterpret_cast(element); + AttSource *att = dynamic_cast(element); + assert( att ); if (attrType == "source") { att->SetSource(att->StrToStr(attrValue)); return true; @@ -129,13 +135,15 @@ bool Att::SetCritapp( Object *element, std::string attrType, std::string attrVal void Att::GetCritapp( Object *element, ArrayOfStrAttr *attributes ) { if (element->HasAttClass( ATT_CRIT ) ) { - AttCrit *att = reinterpret_cast(element); + AttCrit *att = dynamic_cast(element); + assert( att ); if (att->HasCause()) { attributes->push_back(std::make_pair("cause", att->StrToStr(att->GetCause()))); } } if (element->HasAttClass( ATT_SOURCE ) ) { - AttSource *att = reinterpret_cast(element); + AttSource *att = dynamic_cast(element); + assert( att ); if (att->HasSource()) { attributes->push_back(std::make_pair("source", att->StrToStr(att->GetSource()))); } diff --git a/libmei/atts_critapp.h b/libmei/atts_critapp.h index a49e801f3f2..3b1d043e915 100644 --- a/libmei/atts_critapp.h +++ b/libmei/atts_critapp.h @@ -16,6 +16,7 @@ #define __VRV_ATTS_CRITAPP_H__ #include "att.h" +#include "att_classes.h" #include "pugixml.hpp" //---------------------------------------------------------------------------- @@ -28,8 +29,6 @@ namespace vrv { // AttCrit //---------------------------------------------------------------------------- -#define ATT_CRIT 47 - class AttCrit: public Att { public: @@ -71,8 +70,6 @@ class AttCrit: public Att // AttSource //---------------------------------------------------------------------------- -#define ATT_SOURCE 48 - class AttSource: public Att { public: diff --git a/libmei/atts_edittrans.cpp b/libmei/atts_edittrans.cpp index 65a97d490c8..309363dd850 100644 --- a/libmei/atts_edittrans.cpp +++ b/libmei/atts_edittrans.cpp @@ -16,6 +16,10 @@ //---------------------------------------------------------------------------- +#include + +//---------------------------------------------------------------------------- + #include "object.h" /* #include_block */ @@ -211,14 +215,16 @@ bool AttReasonident::HasReason( ) bool Att::SetEdittrans( Object *element, std::string attrType, std::string attrValue ) { if (element->HasAttClass( ATT_AGENTIDENT ) ) { - AttAgentident *att = reinterpret_cast(element); + AttAgentident *att = dynamic_cast(element); + assert( att ); if (attrType == "agent") { att->SetAgent(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_EDIT ) ) { - AttEdit *att = reinterpret_cast(element); + AttEdit *att = dynamic_cast(element); + assert( att ); if (attrType == "cert") { att->SetCert(att->StrToStr(attrValue)); return true; @@ -229,14 +235,16 @@ bool Att::SetEdittrans( Object *element, std::string attrType, std::string attrV } } if (element->HasAttClass( ATT_EXTENT ) ) { - AttExtent *att = reinterpret_cast(element); + AttExtent *att = dynamic_cast(element); + assert( att ); if (attrType == "extent") { att->SetExtent(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_REASONIDENT ) ) { - AttReasonident *att = reinterpret_cast(element); + AttReasonident *att = dynamic_cast(element); + assert( att ); if (attrType == "reason") { att->SetReason(att->StrToStr(attrValue)); return true; @@ -248,13 +256,15 @@ bool Att::SetEdittrans( Object *element, std::string attrType, std::string attrV void Att::GetEdittrans( Object *element, ArrayOfStrAttr *attributes ) { if (element->HasAttClass( ATT_AGENTIDENT ) ) { - AttAgentident *att = reinterpret_cast(element); + AttAgentident *att = dynamic_cast(element); + assert( att ); if (att->HasAgent()) { attributes->push_back(std::make_pair("agent", att->StrToStr(att->GetAgent()))); } } if (element->HasAttClass( ATT_EDIT ) ) { - AttEdit *att = reinterpret_cast(element); + AttEdit *att = dynamic_cast(element); + assert( att ); if (att->HasCert()) { attributes->push_back(std::make_pair("cert", att->StrToStr(att->GetCert()))); } @@ -263,13 +273,15 @@ void Att::GetEdittrans( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_EXTENT ) ) { - AttExtent *att = reinterpret_cast(element); + AttExtent *att = dynamic_cast(element); + assert( att ); if (att->HasExtent()) { attributes->push_back(std::make_pair("extent", att->StrToStr(att->GetExtent()))); } } if (element->HasAttClass( ATT_REASONIDENT ) ) { - AttReasonident *att = reinterpret_cast(element); + AttReasonident *att = dynamic_cast(element); + assert( att ); if (att->HasReason()) { attributes->push_back(std::make_pair("reason", att->StrToStr(att->GetReason()))); } diff --git a/libmei/atts_edittrans.h b/libmei/atts_edittrans.h index 9c6bf176ba6..483edee8dbe 100644 --- a/libmei/atts_edittrans.h +++ b/libmei/atts_edittrans.h @@ -16,6 +16,7 @@ #define __VRV_ATTS_EDITTRANS_H__ #include "att.h" +#include "att_classes.h" #include "pugixml.hpp" //---------------------------------------------------------------------------- @@ -28,8 +29,6 @@ namespace vrv { // AttAgentident //---------------------------------------------------------------------------- -#define ATT_AGENTIDENT 49 - class AttAgentident: public Att { public: @@ -71,8 +70,6 @@ class AttAgentident: public Att // AttEdit //---------------------------------------------------------------------------- -#define ATT_EDIT 50 - class AttEdit: public Att { public: @@ -122,8 +119,6 @@ class AttEdit: public Att // AttExtent //---------------------------------------------------------------------------- -#define ATT_EXTENT 51 - class AttExtent: public Att { public: @@ -162,8 +157,6 @@ class AttExtent: public Att // AttReasonident //---------------------------------------------------------------------------- -#define ATT_REASONIDENT 52 - class AttReasonident: public Att { public: diff --git a/libmei/atts_facsimile.cpp b/libmei/atts_facsimile.cpp index b4b53144957..f7147eba268 100644 --- a/libmei/atts_facsimile.cpp +++ b/libmei/atts_facsimile.cpp @@ -16,6 +16,10 @@ //---------------------------------------------------------------------------- +#include + +//---------------------------------------------------------------------------- + #include "object.h" /* #include_block */ @@ -69,7 +73,8 @@ void AttFacsimile::getCoords() { bool Att::SetFacsimile( Object *element, std::string attrType, std::string attrValue ) { if (element->HasAttClass( ATT_FACSIMILE ) ) { - AttFacsimile *att = reinterpret_cast(element); + AttFacsimile *att = dynamic_cast(element); + assert( att ); if (attrType == "facs") { att->SetFacs(att->StrToStr(attrValue)); return true; @@ -81,7 +86,8 @@ bool Att::SetFacsimile( Object *element, std::string attrType, std::string attrV void Att::GetFacsimile( Object *element, ArrayOfStrAttr *attributes ) { if (element->HasAttClass( ATT_FACSIMILE ) ) { - AttFacsimile *att = reinterpret_cast(element); + AttFacsimile *att = dynamic_cast(element); + assert( att ); if (att->HasFacs()) { attributes->push_back(std::make_pair("facs", att->StrToStr(att->GetFacs()))); } diff --git a/libmei/atts_facsimile.h b/libmei/atts_facsimile.h index 173106aa3f4..f8435d5ec91 100644 --- a/libmei/atts_facsimile.h +++ b/libmei/atts_facsimile.h @@ -16,6 +16,7 @@ #define __VRV_ATTS_FACSIMILE_H__ #include "att.h" +#include "att_classes.h" #include "pugixml.hpp" //---------------------------------------------------------------------------- @@ -28,8 +29,6 @@ namespace vrv { // AttFacsimile //---------------------------------------------------------------------------- -#define ATT_FACSIMILE 53 - class AttFacsimile: public Att { public: diff --git a/libmei/atts_figtable.cpp b/libmei/atts_figtable.cpp index 15357ebb863..301966496cb 100644 --- a/libmei/atts_figtable.cpp +++ b/libmei/atts_figtable.cpp @@ -16,6 +16,10 @@ //---------------------------------------------------------------------------- +#include + +//---------------------------------------------------------------------------- + #include "object.h" /* #include_block */ @@ -82,7 +86,8 @@ bool AttTabular::HasRowspan( ) bool Att::SetFigtable( Object *element, std::string attrType, std::string attrValue ) { if (element->HasAttClass( ATT_TABULAR ) ) { - AttTabular *att = reinterpret_cast(element); + AttTabular *att = dynamic_cast(element); + assert( att ); if (attrType == "colspanInt") { att->SetColspan(att->StrToInt(attrValue)); return true; @@ -98,7 +103,8 @@ bool Att::SetFigtable( Object *element, std::string attrType, std::string attrVa void Att::GetFigtable( Object *element, ArrayOfStrAttr *attributes ) { if (element->HasAttClass( ATT_TABULAR ) ) { - AttTabular *att = reinterpret_cast(element); + AttTabular *att = dynamic_cast(element); + assert( att ); if (att->HasColspan()) { attributes->push_back(std::make_pair("colspanInt", att->IntToStr(att->GetColspan()))); } diff --git a/libmei/atts_figtable.h b/libmei/atts_figtable.h index 44bcb38bcba..89dff3b3e74 100644 --- a/libmei/atts_figtable.h +++ b/libmei/atts_figtable.h @@ -16,6 +16,7 @@ #define __VRV_ATTS_FIGTABLE_H__ #include "att.h" +#include "att_classes.h" #include "pugixml.hpp" //---------------------------------------------------------------------------- @@ -28,8 +29,6 @@ namespace vrv { // AttTabular //---------------------------------------------------------------------------- -#define ATT_TABULAR 54 - class AttTabular: public Att { public: diff --git a/libmei/atts_harmony.cpp b/libmei/atts_harmony.cpp index 7f370f9f851..babe881857c 100644 --- a/libmei/atts_harmony.cpp +++ b/libmei/atts_harmony.cpp @@ -16,6 +16,10 @@ //---------------------------------------------------------------------------- +#include + +//---------------------------------------------------------------------------- + #include "object.h" /* #include_block */ @@ -168,21 +172,24 @@ bool AttHarmVis::HasRendgrid( ) bool Att::SetHarmony( Object *element, std::string attrType, std::string attrValue ) { if (element->HasAttClass( ATT_FRETLOCATION ) ) { - AttFretlocation *att = reinterpret_cast(element); + AttFretlocation *att = dynamic_cast(element); + assert( att ); if (attrType == "fret") { att->SetFret(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_HARMLOG ) ) { - AttHarmLog *att = reinterpret_cast(element); + AttHarmLog *att = dynamic_cast(element); + assert( att ); if (attrType == "chordref") { att->SetChordref(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_HARMVIS ) ) { - AttHarmVis *att = reinterpret_cast(element); + AttHarmVis *att = dynamic_cast(element); + assert( att ); if (attrType == "extender") { att->SetExtender(att->StrToStr(attrValue)); return true; @@ -198,19 +205,22 @@ bool Att::SetHarmony( Object *element, std::string attrType, std::string attrVal void Att::GetHarmony( Object *element, ArrayOfStrAttr *attributes ) { if (element->HasAttClass( ATT_FRETLOCATION ) ) { - AttFretlocation *att = reinterpret_cast(element); + AttFretlocation *att = dynamic_cast(element); + assert( att ); if (att->HasFret()) { attributes->push_back(std::make_pair("fret", att->StrToStr(att->GetFret()))); } } if (element->HasAttClass( ATT_HARMLOG ) ) { - AttHarmLog *att = reinterpret_cast(element); + AttHarmLog *att = dynamic_cast(element); + assert( att ); if (att->HasChordref()) { attributes->push_back(std::make_pair("chordref", att->StrToStr(att->GetChordref()))); } } if (element->HasAttClass( ATT_HARMVIS ) ) { - AttHarmVis *att = reinterpret_cast(element); + AttHarmVis *att = dynamic_cast(element); + assert( att ); if (att->HasExtender()) { attributes->push_back(std::make_pair("extender", att->StrToStr(att->GetExtender()))); } diff --git a/libmei/atts_harmony.h b/libmei/atts_harmony.h index fbbd4e2dc7a..cadb0c3e355 100644 --- a/libmei/atts_harmony.h +++ b/libmei/atts_harmony.h @@ -16,6 +16,7 @@ #define __VRV_ATTS_HARMONY_H__ #include "att.h" +#include "att_classes.h" #include "pugixml.hpp" //---------------------------------------------------------------------------- @@ -28,8 +29,6 @@ namespace vrv { // AttFretlocation //---------------------------------------------------------------------------- -#define ATT_FRETLOCATION 55 - class AttFretlocation: public Att { public: @@ -68,8 +67,6 @@ class AttFretlocation: public Att // AttHarmLog //---------------------------------------------------------------------------- -#define ATT_HARMLOG 56 - class AttHarmLog: public Att { public: @@ -108,8 +105,6 @@ class AttHarmLog: public Att // AttHarmVis //---------------------------------------------------------------------------- -#define ATT_HARMVIS 57 - class AttHarmVis: public Att { public: diff --git a/libmei/atts_header.cpp b/libmei/atts_header.cpp index 1835cc4d268..a710e453c4a 100644 --- a/libmei/atts_header.cpp +++ b/libmei/atts_header.cpp @@ -16,6 +16,10 @@ //---------------------------------------------------------------------------- +#include + +//---------------------------------------------------------------------------- + #include "object.h" /* #include_block */ @@ -67,7 +71,8 @@ bool AttRegularmethod::HasMethod( ) bool Att::SetHeader( Object *element, std::string attrType, std::string attrValue ) { if (element->HasAttClass( ATT_REGULARMETHOD ) ) { - AttRegularmethod *att = reinterpret_cast(element); + AttRegularmethod *att = dynamic_cast(element); + assert( att ); if (attrType == "method") { att->SetMethod(att->StrToStr(attrValue)); return true; @@ -79,7 +84,8 @@ bool Att::SetHeader( Object *element, std::string attrType, std::string attrValu void Att::GetHeader( Object *element, ArrayOfStrAttr *attributes ) { if (element->HasAttClass( ATT_REGULARMETHOD ) ) { - AttRegularmethod *att = reinterpret_cast(element); + AttRegularmethod *att = dynamic_cast(element); + assert( att ); if (att->HasMethod()) { attributes->push_back(std::make_pair("method", att->StrToStr(att->GetMethod()))); } diff --git a/libmei/atts_header.h b/libmei/atts_header.h index 0dd92d11cac..95ca2abdfac 100644 --- a/libmei/atts_header.h +++ b/libmei/atts_header.h @@ -16,6 +16,7 @@ #define __VRV_ATTS_HEADER_H__ #include "att.h" +#include "att_classes.h" #include "pugixml.hpp" //---------------------------------------------------------------------------- @@ -28,8 +29,6 @@ namespace vrv { // AttRegularmethod //---------------------------------------------------------------------------- -#define ATT_REGULARMETHOD 58 - class AttRegularmethod: public Att { public: diff --git a/libmei/atts_linkalign.cpp b/libmei/atts_linkalign.cpp index db52b27102c..012b8142b3c 100644 --- a/libmei/atts_linkalign.cpp +++ b/libmei/atts_linkalign.cpp @@ -16,6 +16,10 @@ //---------------------------------------------------------------------------- +#include + +//---------------------------------------------------------------------------- + #include "object.h" /* #include_block */ @@ -67,7 +71,8 @@ bool AttAlignment::HasWhen( ) bool Att::SetLinkalign( Object *element, std::string attrType, std::string attrValue ) { if (element->HasAttClass( ATT_ALIGNMENT ) ) { - AttAlignment *att = reinterpret_cast(element); + AttAlignment *att = dynamic_cast(element); + assert( att ); if (attrType == "when") { att->SetWhen(att->StrToStr(attrValue)); return true; @@ -79,7 +84,8 @@ bool Att::SetLinkalign( Object *element, std::string attrType, std::string attrV void Att::GetLinkalign( Object *element, ArrayOfStrAttr *attributes ) { if (element->HasAttClass( ATT_ALIGNMENT ) ) { - AttAlignment *att = reinterpret_cast(element); + AttAlignment *att = dynamic_cast(element); + assert( att ); if (att->HasWhen()) { attributes->push_back(std::make_pair("when", att->StrToStr(att->GetWhen()))); } diff --git a/libmei/atts_linkalign.h b/libmei/atts_linkalign.h index e2ff634f69e..ae7cd6dd6ec 100644 --- a/libmei/atts_linkalign.h +++ b/libmei/atts_linkalign.h @@ -16,6 +16,7 @@ #define __VRV_ATTS_LINKALIGN_H__ #include "att.h" +#include "att_classes.h" #include "pugixml.hpp" //---------------------------------------------------------------------------- @@ -28,8 +29,6 @@ namespace vrv { // AttAlignment //---------------------------------------------------------------------------- -#define ATT_ALIGNMENT 59 - class AttAlignment: public Att { public: diff --git a/libmei/atts_lyrics.cpp b/libmei/atts_lyrics.cpp index 59149f77b8d..62172baafaa 100644 --- a/libmei/atts_lyrics.cpp +++ b/libmei/atts_lyrics.cpp @@ -16,6 +16,10 @@ //---------------------------------------------------------------------------- +#include + +//---------------------------------------------------------------------------- + #include "object.h" /* #include_block */ @@ -82,7 +86,8 @@ bool AttVerseLog::HasRhythm( ) bool Att::SetLyrics( Object *element, std::string attrType, std::string attrValue ) { if (element->HasAttClass( ATT_VERSELOG ) ) { - AttVerseLog *att = reinterpret_cast(element); + AttVerseLog *att = dynamic_cast(element); + assert( att ); if (attrType == "refrain") { att->SetRefrain(att->StrToStr(attrValue)); return true; @@ -98,7 +103,8 @@ bool Att::SetLyrics( Object *element, std::string attrType, std::string attrValu void Att::GetLyrics( Object *element, ArrayOfStrAttr *attributes ) { if (element->HasAttClass( ATT_VERSELOG ) ) { - AttVerseLog *att = reinterpret_cast(element); + AttVerseLog *att = dynamic_cast(element); + assert( att ); if (att->HasRefrain()) { attributes->push_back(std::make_pair("refrain", att->StrToStr(att->GetRefrain()))); } diff --git a/libmei/atts_lyrics.h b/libmei/atts_lyrics.h index eebaf573b71..38fd739f1f8 100644 --- a/libmei/atts_lyrics.h +++ b/libmei/atts_lyrics.h @@ -16,6 +16,7 @@ #define __VRV_ATTS_LYRICS_H__ #include "att.h" +#include "att_classes.h" #include "pugixml.hpp" //---------------------------------------------------------------------------- @@ -28,8 +29,6 @@ namespace vrv { // AttVerseLog //---------------------------------------------------------------------------- -#define ATT_VERSELOG 60 - class AttVerseLog: public Att { public: diff --git a/libmei/atts_mensural.cpp b/libmei/atts_mensural.cpp index 779662ceab1..f5c6aa11609 100644 --- a/libmei/atts_mensural.cpp +++ b/libmei/atts_mensural.cpp @@ -16,6 +16,10 @@ //---------------------------------------------------------------------------- +#include + +//---------------------------------------------------------------------------- + #include "object.h" /* #include_block */ @@ -505,14 +509,16 @@ bool AttRestVisMensural::HasSpaces( ) bool Att::SetMensural( Object *element, std::string attrType, std::string attrValue ) { if (element->HasAttClass( ATT_LIGATURELOG ) ) { - AttLigatureLog *att = reinterpret_cast(element); + AttLigatureLog *att = dynamic_cast(element); + assert( att ); if (attrType == "form") { att->SetForm(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_MENSURVIS ) ) { - AttMensurVis *att = reinterpret_cast(element); + AttMensurVis *att = dynamic_cast(element); + assert( att ); if (attrType == "form") { att->SetForm(att->StrToStr(attrValue)); return true; @@ -523,7 +529,8 @@ bool Att::SetMensural( Object *element, std::string attrType, std::string attrVa } } if (element->HasAttClass( ATT_MENSURALLOG ) ) { - AttMensuralLog *att = reinterpret_cast(element); + AttMensuralLog *att = dynamic_cast(element); + assert( att ); if (attrType == "mensurDot") { att->SetMensurDot(att->StrToBool(attrValue)); return true; @@ -546,7 +553,8 @@ bool Att::SetMensural( Object *element, std::string attrType, std::string attrVa } } if (element->HasAttClass( ATT_MENSURALSHARED ) ) { - AttMensuralShared *att = reinterpret_cast(element); + AttMensuralShared *att = dynamic_cast(element); + assert( att ); if (attrType == "modusmaior") { att->SetModusmaior(att->StrToModusmaior(attrValue)); return true; @@ -565,7 +573,8 @@ bool Att::SetMensural( Object *element, std::string attrType, std::string attrVa } } if (element->HasAttClass( ATT_MENSURALVIS ) ) { - AttMensuralVis *att = reinterpret_cast(element); + AttMensuralVis *att = dynamic_cast(element); + assert( att ); if (attrType == "mensurColor") { att->SetMensurColor(att->StrToStr(attrValue)); return true; @@ -588,14 +597,16 @@ bool Att::SetMensural( Object *element, std::string attrType, std::string attrVa } } if (element->HasAttClass( ATT_NOTELOGMENSURAL ) ) { - AttNoteLogMensural *att = reinterpret_cast(element); + AttNoteLogMensural *att = dynamic_cast(element); + assert( att ); if (attrType == "lig") { att->SetLig(att->StrToLigature(attrValue)); return true; } } if (element->HasAttClass( ATT_RESTVISMENSURAL ) ) { - AttRestVisMensural *att = reinterpret_cast(element); + AttRestVisMensural *att = dynamic_cast(element); + assert( att ); if (attrType == "spacesInt") { att->SetSpaces(att->StrToInt(attrValue)); return true; @@ -607,13 +618,15 @@ bool Att::SetMensural( Object *element, std::string attrType, std::string attrVa void Att::GetMensural( Object *element, ArrayOfStrAttr *attributes ) { if (element->HasAttClass( ATT_LIGATURELOG ) ) { - AttLigatureLog *att = reinterpret_cast(element); + AttLigatureLog *att = dynamic_cast(element); + assert( att ); if (att->HasForm()) { attributes->push_back(std::make_pair("form", att->StrToStr(att->GetForm()))); } } if (element->HasAttClass( ATT_MENSURVIS ) ) { - AttMensurVis *att = reinterpret_cast(element); + AttMensurVis *att = dynamic_cast(element); + assert( att ); if (att->HasForm()) { attributes->push_back(std::make_pair("form", att->StrToStr(att->GetForm()))); } @@ -622,7 +635,8 @@ void Att::GetMensural( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_MENSURALLOG ) ) { - AttMensuralLog *att = reinterpret_cast(element); + AttMensuralLog *att = dynamic_cast(element); + assert( att ); if (att->HasMensurDot()) { attributes->push_back(std::make_pair("mensurDot", att->BoolToStr(att->GetMensurDot()))); } @@ -640,7 +654,8 @@ void Att::GetMensural( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_MENSURALSHARED ) ) { - AttMensuralShared *att = reinterpret_cast(element); + AttMensuralShared *att = dynamic_cast(element); + assert( att ); if (att->HasModusmaior()) { attributes->push_back(std::make_pair("modusmaior", att->ModusmaiorToStr(att->GetModusmaior()))); } @@ -655,7 +670,8 @@ void Att::GetMensural( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_MENSURALVIS ) ) { - AttMensuralVis *att = reinterpret_cast(element); + AttMensuralVis *att = dynamic_cast(element); + assert( att ); if (att->HasMensurColor()) { attributes->push_back(std::make_pair("mensurColor", att->StrToStr(att->GetMensurColor()))); } @@ -673,13 +689,15 @@ void Att::GetMensural( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_NOTELOGMENSURAL ) ) { - AttNoteLogMensural *att = reinterpret_cast(element); + AttNoteLogMensural *att = dynamic_cast(element); + assert( att ); if (att->HasLig()) { attributes->push_back(std::make_pair("lig", att->LigatureToStr(att->GetLig()))); } } if (element->HasAttClass( ATT_RESTVISMENSURAL ) ) { - AttRestVisMensural *att = reinterpret_cast(element); + AttRestVisMensural *att = dynamic_cast(element); + assert( att ); if (att->HasSpaces()) { attributes->push_back(std::make_pair("spacesInt", att->IntToStr(att->GetSpaces()))); } diff --git a/libmei/atts_mensural.h b/libmei/atts_mensural.h index db3e19bd41a..f121e5fe54b 100644 --- a/libmei/atts_mensural.h +++ b/libmei/atts_mensural.h @@ -16,6 +16,7 @@ #define __VRV_ATTS_MENSURAL_H__ #include "att.h" +#include "att_classes.h" #include "pugixml.hpp" //---------------------------------------------------------------------------- @@ -28,8 +29,6 @@ namespace vrv { // AttLigatureLog //---------------------------------------------------------------------------- -#define ATT_LIGATURELOG 61 - class AttLigatureLog: public Att { public: @@ -68,8 +67,6 @@ class AttLigatureLog: public Att // AttMensurVis //---------------------------------------------------------------------------- -#define ATT_MENSURVIS 62 - class AttMensurVis: public Att { public: @@ -115,8 +112,6 @@ class AttMensurVis: public Att // AttMensuralLog //---------------------------------------------------------------------------- -#define ATT_MENSURALLOG 63 - class AttMensuralLog: public Att { public: @@ -194,8 +189,6 @@ class AttMensuralLog: public Att // AttMensuralShared //---------------------------------------------------------------------------- -#define ATT_MENSURALSHARED 64 - class AttMensuralShared: public Att { public: @@ -255,8 +248,6 @@ class AttMensuralShared: public Att // AttMensuralVis //---------------------------------------------------------------------------- -#define ATT_MENSURALVIS 65 - class AttMensuralVis: public Att { public: @@ -326,8 +317,6 @@ class AttMensuralVis: public Att // AttNoteLogMensural //---------------------------------------------------------------------------- -#define ATT_NOTELOGMENSURAL 66 - class AttNoteLogMensural: public Att { public: @@ -366,8 +355,6 @@ class AttNoteLogMensural: public Att // AttRestVisMensural //---------------------------------------------------------------------------- -#define ATT_RESTVISMENSURAL 67 - class AttRestVisMensural: public Att { public: diff --git a/libmei/atts_midi.cpp b/libmei/atts_midi.cpp index 86749cc591e..04618f8382f 100644 --- a/libmei/atts_midi.cpp +++ b/libmei/atts_midi.cpp @@ -16,6 +16,10 @@ //---------------------------------------------------------------------------- +#include + +//---------------------------------------------------------------------------- + #include "object.h" /* #include_block */ @@ -372,7 +376,8 @@ bool AttTimebase::HasPpq( ) bool Att::SetMidi( Object *element, std::string attrType, std::string attrValue ) { if (element->HasAttClass( ATT_CHANNELIZED ) ) { - AttChannelized *att = reinterpret_cast(element); + AttChannelized *att = dynamic_cast(element); + assert( att ); if (attrType == "midiChannel") { att->SetMidiChannel(att->StrToStr(attrValue)); return true; @@ -391,7 +396,8 @@ bool Att::SetMidi( Object *element, std::string attrType, std::string attrValue } } if (element->HasAttClass( ATT_MIDIINSTRUMENT ) ) { - AttMidiinstrument *att = reinterpret_cast(element); + AttMidiinstrument *att = dynamic_cast(element); + assert( att ); if (attrType == "midiInstrnum") { att->SetMidiInstrnum(att->StrToStr(attrValue)); return true; @@ -410,28 +416,32 @@ bool Att::SetMidi( Object *element, std::string attrType, std::string attrValue } } if (element->HasAttClass( ATT_MIDINUMBER ) ) { - AttMidinumber *att = reinterpret_cast(element); + AttMidinumber *att = dynamic_cast(element); + assert( att ); if (attrType == "numInt") { att->SetNum(att->StrToInt(attrValue)); return true; } } if (element->HasAttClass( ATT_MIDITEMPO ) ) { - AttMiditempo *att = reinterpret_cast(element); + AttMiditempo *att = dynamic_cast(element); + assert( att ); if (attrType == "midiTempo") { att->SetMidiTempo(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_MIDIVALUE ) ) { - AttMidivalue *att = reinterpret_cast(element); + AttMidivalue *att = dynamic_cast(element); + assert( att ); if (attrType == "val") { att->SetVal(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_TIMEBASE ) ) { - AttTimebase *att = reinterpret_cast(element); + AttTimebase *att = dynamic_cast(element); + assert( att ); if (attrType == "ppqInt") { att->SetPpq(att->StrToInt(attrValue)); return true; @@ -443,7 +453,8 @@ bool Att::SetMidi( Object *element, std::string attrType, std::string attrValue void Att::GetMidi( Object *element, ArrayOfStrAttr *attributes ) { if (element->HasAttClass( ATT_CHANNELIZED ) ) { - AttChannelized *att = reinterpret_cast(element); + AttChannelized *att = dynamic_cast(element); + assert( att ); if (att->HasMidiChannel()) { attributes->push_back(std::make_pair("midiChannel", att->StrToStr(att->GetMidiChannel()))); } @@ -458,7 +469,8 @@ void Att::GetMidi( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_MIDIINSTRUMENT ) ) { - AttMidiinstrument *att = reinterpret_cast(element); + AttMidiinstrument *att = dynamic_cast(element); + assert( att ); if (att->HasMidiInstrnum()) { attributes->push_back(std::make_pair("midiInstrnum", att->StrToStr(att->GetMidiInstrnum()))); } @@ -473,25 +485,29 @@ void Att::GetMidi( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_MIDINUMBER ) ) { - AttMidinumber *att = reinterpret_cast(element); + AttMidinumber *att = dynamic_cast(element); + assert( att ); if (att->HasNum()) { attributes->push_back(std::make_pair("numInt", att->IntToStr(att->GetNum()))); } } if (element->HasAttClass( ATT_MIDITEMPO ) ) { - AttMiditempo *att = reinterpret_cast(element); + AttMiditempo *att = dynamic_cast(element); + assert( att ); if (att->HasMidiTempo()) { attributes->push_back(std::make_pair("midiTempo", att->StrToStr(att->GetMidiTempo()))); } } if (element->HasAttClass( ATT_MIDIVALUE ) ) { - AttMidivalue *att = reinterpret_cast(element); + AttMidivalue *att = dynamic_cast(element); + assert( att ); if (att->HasVal()) { attributes->push_back(std::make_pair("val", att->StrToStr(att->GetVal()))); } } if (element->HasAttClass( ATT_TIMEBASE ) ) { - AttTimebase *att = reinterpret_cast(element); + AttTimebase *att = dynamic_cast(element); + assert( att ); if (att->HasPpq()) { attributes->push_back(std::make_pair("ppqInt", att->IntToStr(att->GetPpq()))); } diff --git a/libmei/atts_midi.h b/libmei/atts_midi.h index fa1f7ac77e6..d03c26c1479 100644 --- a/libmei/atts_midi.h +++ b/libmei/atts_midi.h @@ -16,6 +16,7 @@ #define __VRV_ATTS_MIDI_H__ #include "att.h" +#include "att_classes.h" #include "pugixml.hpp" //---------------------------------------------------------------------------- @@ -28,8 +29,6 @@ namespace vrv { // AttChannelized //---------------------------------------------------------------------------- -#define ATT_CHANNELIZED 68 - class AttChannelized: public Att { public: @@ -89,8 +88,6 @@ class AttChannelized: public Att // AttMidiinstrument //---------------------------------------------------------------------------- -#define ATT_MIDIINSTRUMENT 69 - class AttMidiinstrument: public Att { public: @@ -153,8 +150,6 @@ class AttMidiinstrument: public Att // AttMidinumber //---------------------------------------------------------------------------- -#define ATT_MIDINUMBER 70 - class AttMidinumber: public Att { public: @@ -196,8 +191,6 @@ class AttMidinumber: public Att // AttMiditempo //---------------------------------------------------------------------------- -#define ATT_MIDITEMPO 71 - class AttMiditempo: public Att { public: @@ -239,8 +232,6 @@ class AttMiditempo: public Att // AttMidivalue //---------------------------------------------------------------------------- -#define ATT_MIDIVALUE 72 - class AttMidivalue: public Att { public: @@ -279,8 +270,6 @@ class AttMidivalue: public Att // AttTimebase //---------------------------------------------------------------------------- -#define ATT_TIMEBASE 73 - class AttTimebase: public Att { public: diff --git a/libmei/atts_neumes.cpp b/libmei/atts_neumes.cpp index 6459232f178..d62a40e76a9 100644 --- a/libmei/atts_neumes.cpp +++ b/libmei/atts_neumes.cpp @@ -16,6 +16,10 @@ //---------------------------------------------------------------------------- +#include + +//---------------------------------------------------------------------------- + #include "object.h" /* #include_block */ @@ -140,7 +144,8 @@ bool AttUneumeLog::HasName( ) bool Att::SetNeumes( Object *element, std::string attrType, std::string attrValue ) { if (element->HasAttClass( ATT_INEUMELOG ) ) { - AttIneumeLog *att = reinterpret_cast(element); + AttIneumeLog *att = dynamic_cast(element); + assert( att ); if (attrType == "form") { att->SetForm(att->StrToStr(attrValue)); return true; @@ -151,7 +156,8 @@ bool Att::SetNeumes( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_UNEUMELOG ) ) { - AttUneumeLog *att = reinterpret_cast(element); + AttUneumeLog *att = dynamic_cast(element); + assert( att ); if (attrType == "form") { att->SetForm(att->StrToStr(attrValue)); return true; @@ -167,7 +173,8 @@ bool Att::SetNeumes( Object *element, std::string attrType, std::string attrValu void Att::GetNeumes( Object *element, ArrayOfStrAttr *attributes ) { if (element->HasAttClass( ATT_INEUMELOG ) ) { - AttIneumeLog *att = reinterpret_cast(element); + AttIneumeLog *att = dynamic_cast(element); + assert( att ); if (att->HasForm()) { attributes->push_back(std::make_pair("form", att->StrToStr(att->GetForm()))); } @@ -176,7 +183,8 @@ void Att::GetNeumes( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_UNEUMELOG ) ) { - AttUneumeLog *att = reinterpret_cast(element); + AttUneumeLog *att = dynamic_cast(element); + assert( att ); if (att->HasForm()) { attributes->push_back(std::make_pair("form", att->StrToStr(att->GetForm()))); } diff --git a/libmei/atts_neumes.h b/libmei/atts_neumes.h index 99e7fb80aaa..1aeb642aa21 100644 --- a/libmei/atts_neumes.h +++ b/libmei/atts_neumes.h @@ -16,6 +16,7 @@ #define __VRV_ATTS_NEUMES_H__ #include "att.h" +#include "att_classes.h" #include "pugixml.hpp" //---------------------------------------------------------------------------- @@ -28,8 +29,6 @@ namespace vrv { // AttIneumeLog //---------------------------------------------------------------------------- -#define ATT_INEUMELOG 74 - class AttIneumeLog: public Att { public: @@ -75,8 +74,6 @@ class AttIneumeLog: public Att // AttUneumeLog //---------------------------------------------------------------------------- -#define ATT_UNEUMELOG 75 - class AttUneumeLog: public Att { public: diff --git a/libmei/atts_pagebased.cpp b/libmei/atts_pagebased.cpp index 7cf17e72d4b..c98d37bb061 100644 --- a/libmei/atts_pagebased.cpp +++ b/libmei/atts_pagebased.cpp @@ -16,6 +16,10 @@ //---------------------------------------------------------------------------- +#include + +//---------------------------------------------------------------------------- + #include "object.h" /* #include_block */ @@ -67,7 +71,8 @@ bool AttSurface::HasSurface( ) bool Att::SetPagebased( Object *element, std::string attrType, std::string attrValue ) { if (element->HasAttClass( ATT_SURFACE ) ) { - AttSurface *att = reinterpret_cast(element); + AttSurface *att = dynamic_cast(element); + assert( att ); if (attrType == "surface") { att->SetSurface(att->StrToStr(attrValue)); return true; @@ -79,7 +84,8 @@ bool Att::SetPagebased( Object *element, std::string attrType, std::string attrV void Att::GetPagebased( Object *element, ArrayOfStrAttr *attributes ) { if (element->HasAttClass( ATT_SURFACE ) ) { - AttSurface *att = reinterpret_cast(element); + AttSurface *att = dynamic_cast(element); + assert( att ); if (att->HasSurface()) { attributes->push_back(std::make_pair("surface", att->StrToStr(att->GetSurface()))); } diff --git a/libmei/atts_pagebased.h b/libmei/atts_pagebased.h index 07999270a6c..df3b74eb5c1 100644 --- a/libmei/atts_pagebased.h +++ b/libmei/atts_pagebased.h @@ -16,6 +16,7 @@ #define __VRV_ATTS_PAGEBASED_H__ #include "att.h" +#include "att_classes.h" #include "pugixml.hpp" //---------------------------------------------------------------------------- @@ -28,8 +29,6 @@ namespace vrv { // AttSurface //---------------------------------------------------------------------------- -#define ATT_SURFACE 76 - class AttSurface: public Att { public: diff --git a/libmei/atts_shared.cpp b/libmei/atts_shared.cpp index f35179eb29a..6be97a940a7 100644 --- a/libmei/atts_shared.cpp +++ b/libmei/atts_shared.cpp @@ -16,6 +16,10 @@ //---------------------------------------------------------------------------- +#include + +//---------------------------------------------------------------------------- + #include "object.h" /* #include_block */ @@ -6946,56 +6950,64 @@ bool AttXy2::HasY2( ) bool Att::SetShared( Object *element, std::string attrType, std::string attrValue ) { if (element->HasAttClass( ATT_ACCIDLOG ) ) { - AttAccidLog *att = reinterpret_cast(element); + AttAccidLog *att = dynamic_cast(element); + assert( att ); if (attrType == "func") { att->SetFunc(att->StrToFunc(attrValue)); return true; } } if (element->HasAttClass( ATT_ACCIDENTAL ) ) { - AttAccidental *att = reinterpret_cast(element); + AttAccidental *att = dynamic_cast(element); + assert( att ); if (attrType == "accid") { att->SetAccid(att->StrToAccidentalExplicit(attrValue)); return true; } } if (element->HasAttClass( ATT_ACCIDENTALPERFORMED ) ) { - AttAccidentalPerformed *att = reinterpret_cast(element); + AttAccidentalPerformed *att = dynamic_cast(element); + assert( att ); if (attrType == "accidGes") { att->SetAccidGes(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_ALTSYM ) ) { - AttAltsym *att = reinterpret_cast(element); + AttAltsym *att = dynamic_cast(element); + assert( att ); if (attrType == "altsym") { att->SetAltsym(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_ARTICULATION ) ) { - AttArticulation *att = reinterpret_cast(element); + AttArticulation *att = dynamic_cast(element); + assert( att ); if (attrType == "artic") { att->SetArtic(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_ARTICULATIONPERFORMED ) ) { - AttArticulationPerformed *att = reinterpret_cast(element); + AttArticulationPerformed *att = dynamic_cast(element); + assert( att ); if (attrType == "articGes") { att->SetArticGes(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_AUGMENTDOTS ) ) { - AttAugmentdots *att = reinterpret_cast(element); + AttAugmentdots *att = dynamic_cast(element); + assert( att ); if (attrType == "dots") { att->SetDots(att->StrToInt(attrValue)); return true; } } if (element->HasAttClass( ATT_AUTHORIZED ) ) { - AttAuthorized *att = reinterpret_cast(element); + AttAuthorized *att = dynamic_cast(element); + assert( att ); if (attrType == "authority") { att->SetAuthority(att->StrToStr(attrValue)); return true; @@ -7006,14 +7018,16 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_BARLINELOG ) ) { - AttBarLineLog *att = reinterpret_cast(element); + AttBarLineLog *att = dynamic_cast(element); + assert( att ); if (attrType == "rend") { att->SetRend(att->StrToBarRendition(attrValue)); return true; } } if (element->HasAttClass( ATT_BARPLACEMENT ) ) { - AttBarplacement *att = reinterpret_cast(element); + AttBarplacement *att = dynamic_cast(element); + assert( att ); if (attrType == "barplace") { att->SetBarplace(att->StrToStr(attrValue)); return true; @@ -7024,7 +7038,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_BEAMINGVIS ) ) { - AttBeamingVis *att = reinterpret_cast(element); + AttBeamingVis *att = dynamic_cast(element); + assert( att ); if (attrType == "beamColor") { att->SetBeamColor(att->StrToStr(attrValue)); return true; @@ -7039,42 +7054,48 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_BIBL ) ) { - AttBibl *att = reinterpret_cast(element); + AttBibl *att = dynamic_cast(element); + assert( att ); if (attrType == "analog") { att->SetAnalog(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_CALENDARED ) ) { - AttCalendared *att = reinterpret_cast(element); + AttCalendared *att = dynamic_cast(element); + assert( att ); if (attrType == "calendar") { att->SetCalendar(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_CANONICAL ) ) { - AttCanonical *att = reinterpret_cast(element); + AttCanonical *att = dynamic_cast(element); + assert( att ); if (attrType == "dbkey") { att->SetDbkey(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_CHORDVIS ) ) { - AttChordVis *att = reinterpret_cast(element); + AttChordVis *att = dynamic_cast(element); + assert( att ); if (attrType == "cluster") { att->SetCluster(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_CLEFLOG ) ) { - AttClefLog *att = reinterpret_cast(element); + AttClefLog *att = dynamic_cast(element); + assert( att ); if (attrType == "cautionary") { att->SetCautionary(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_CLEFFINGLOG ) ) { - AttCleffingLog *att = reinterpret_cast(element); + AttCleffingLog *att = dynamic_cast(element); + assert( att ); if (attrType == "clefShape") { att->SetClefShape(att->StrToClefShape(attrValue)); return true; @@ -7093,7 +7114,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_CLEFFINGVIS ) ) { - AttCleffingVis *att = reinterpret_cast(element); + AttCleffingVis *att = dynamic_cast(element); + assert( att ); if (attrType == "clefColor") { att->SetClefColor(att->StrToStr(attrValue)); return true; @@ -7104,35 +7126,40 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_CLEFSHAPE ) ) { - AttClefshape *att = reinterpret_cast(element); + AttClefshape *att = dynamic_cast(element); + assert( att ); if (attrType == "shape") { att->SetShape(att->StrToClefShape(attrValue)); return true; } } if (element->HasAttClass( ATT_CODED ) ) { - AttCoded *att = reinterpret_cast(element); + AttCoded *att = dynamic_cast(element); + assert( att ); if (attrType == "code") { att->SetCode(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_COLOR ) ) { - AttColor *att = reinterpret_cast(element); + AttColor *att = dynamic_cast(element); + assert( att ); if (attrType == "color") { att->SetColor(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_COLORATION ) ) { - AttColoration *att = reinterpret_cast(element); + AttColoration *att = dynamic_cast(element); + assert( att ); if (attrType == "colored") { att->SetColored(att->StrToBool(attrValue)); return true; } } if (element->HasAttClass( ATT_COMMON ) ) { - AttCommon *att = reinterpret_cast(element); + AttCommon *att = dynamic_cast(element); + assert( att ); if (attrType == "label") { att->SetLabel(att->StrToStr(attrValue)); return true; @@ -7147,7 +7174,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_COORDINATED ) ) { - AttCoordinated *att = reinterpret_cast(element); + AttCoordinated *att = dynamic_cast(element); + assert( att ); if (attrType == "ulxInt") { att->SetUlx(att->StrToInt(attrValue)); return true; @@ -7166,7 +7194,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_CURVATURE ) ) { - AttCurvature *att = reinterpret_cast(element); + AttCurvature *att = dynamic_cast(element); + assert( att ); if (attrType == "bezier") { att->SetBezier(att->StrToStr(attrValue)); return true; @@ -7181,21 +7210,24 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_CURVEREND ) ) { - AttCurverend *att = reinterpret_cast(element); + AttCurverend *att = dynamic_cast(element); + assert( att ); if (attrType == "rend") { att->SetRend(att->StrToBarRendition(attrValue)); return true; } } if (element->HasAttClass( ATT_CUSTOSLOG ) ) { - AttCustosLog *att = reinterpret_cast(element); + AttCustosLog *att = dynamic_cast(element); + assert( att ); if (attrType == "target") { att->SetTarget(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_DATABLE ) ) { - AttDatable *att = reinterpret_cast(element); + AttDatable *att = dynamic_cast(element); + assert( att ); if (attrType == "enddate") { att->SetEnddate(att->StrToStr(attrValue)); return true; @@ -7218,21 +7250,24 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_DATAPOINTING ) ) { - AttDatapointing *att = reinterpret_cast(element); + AttDatapointing *att = dynamic_cast(element); + assert( att ); if (attrType == "data") { att->SetData(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_DECLARING ) ) { - AttDeclaring *att = reinterpret_cast(element); + AttDeclaring *att = dynamic_cast(element); + assert( att ); if (attrType == "decls") { att->SetDecls(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_DISTANCES ) ) { - AttDistances *att = reinterpret_cast(element); + AttDistances *att = dynamic_cast(element); + assert( att ); if (attrType == "dynamDist") { att->SetDynamDist(att->StrToStr(attrValue)); return true; @@ -7247,21 +7282,24 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_DOTLOG ) ) { - AttDotLog *att = reinterpret_cast(element); + AttDotLog *att = dynamic_cast(element); + assert( att ); if (attrType == "form") { att->SetForm(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_DURATIONADDITIVE ) ) { - AttDurationAdditive *att = reinterpret_cast(element); + AttDurationAdditive *att = dynamic_cast(element); + assert( att ); if (attrType == "dur") { att->SetDur(att->StrToDur(attrValue)); return true; } } if (element->HasAttClass( ATT_DURATIONDEFAULT ) ) { - AttDurationDefault *att = reinterpret_cast(element); + AttDurationDefault *att = dynamic_cast(element); + assert( att ); if (attrType == "durDefault") { att->SetDurDefault(att->StrToStr(attrValue)); return true; @@ -7276,21 +7314,24 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_DURATIONMUSICAL ) ) { - AttDurationMusical *att = reinterpret_cast(element); + AttDurationMusical *att = dynamic_cast(element); + assert( att ); if (attrType == "dur") { att->SetDur(att->StrToDur(attrValue)); return true; } } if (element->HasAttClass( ATT_DURATIONPERFORMED ) ) { - AttDurationPerformed *att = reinterpret_cast(element); + AttDurationPerformed *att = dynamic_cast(element); + assert( att ); if (attrType == "durGes") { att->SetDurGes(att->StrToDur(attrValue)); return true; } } if (element->HasAttClass( ATT_DURATIONRATIO ) ) { - AttDurationRatio *att = reinterpret_cast(element); + AttDurationRatio *att = dynamic_cast(element); + assert( att ); if (attrType == "num") { att->SetNum(att->StrToInt(attrValue)); return true; @@ -7301,63 +7342,72 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_ENCLOSINGCHARS ) ) { - AttEnclosingchars *att = reinterpret_cast(element); + AttEnclosingchars *att = dynamic_cast(element); + assert( att ); if (attrType == "enclose") { att->SetEnclose(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_FERMATAPRESENT ) ) { - AttFermatapresent *att = reinterpret_cast(element); + AttFermatapresent *att = dynamic_cast(element); + assert( att ); if (attrType == "fermata") { att->SetFermata(att->StrToPlace(attrValue)); return true; } } if (element->HasAttClass( ATT_HANDIDENT ) ) { - AttHandident *att = reinterpret_cast(element); + AttHandident *att = dynamic_cast(element); + assert( att ); if (attrType == "hand") { att->SetHand(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_HORIZONTALALIGN ) ) { - AttHorizontalalign *att = reinterpret_cast(element); + AttHorizontalalign *att = dynamic_cast(element); + assert( att ); if (attrType == "halign") { att->SetHalign(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_INSTRUMENTIDENT ) ) { - AttInstrumentident *att = reinterpret_cast(element); + AttInstrumentident *att = dynamic_cast(element); + assert( att ); if (attrType == "instr") { att->SetInstr(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_INTERNETMEDIA ) ) { - AttInternetmedia *att = reinterpret_cast(element); + AttInternetmedia *att = dynamic_cast(element); + assert( att ); if (attrType == "mimetype") { att->SetMimetype(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_JOINED ) ) { - AttJoined *att = reinterpret_cast(element); + AttJoined *att = dynamic_cast(element); + assert( att ); if (attrType == "join") { att->SetJoin(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_KEYSIGLOG ) ) { - AttKeySigLog *att = reinterpret_cast(element); + AttKeySigLog *att = dynamic_cast(element); + assert( att ); if (attrType == "mode") { att->SetMode(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_KEYSIGDEFAULTLOG ) ) { - AttKeySigDefaultLog *att = reinterpret_cast(element); + AttKeySigDefaultLog *att = dynamic_cast(element); + assert( att ); if (attrType == "keyAccid") { att->SetKeyAccid(att->StrToAccidentalImplicit(attrValue)); return true; @@ -7380,7 +7430,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_KEYSIGDEFAULTVIS ) ) { - AttKeySigDefaultVis *att = reinterpret_cast(element); + AttKeySigDefaultVis *att = dynamic_cast(element); + assert( att ); if (attrType == "keySigShow") { att->SetKeySigShow(att->StrToStr(attrValue)); return true; @@ -7391,49 +7442,56 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_LABELSADDL ) ) { - AttLabelsAddl *att = reinterpret_cast(element); + AttLabelsAddl *att = dynamic_cast(element); + assert( att ); if (attrType == "labelAbbr") { att->SetLabelAbbr(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_LANG ) ) { - AttLang *att = reinterpret_cast(element); + AttLang *att = dynamic_cast(element); + assert( att ); if (attrType == "lang") { att->SetLang(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_LAYERLOG ) ) { - AttLayerLog *att = reinterpret_cast(element); + AttLayerLog *att = dynamic_cast(element); + assert( att ); if (attrType == "def") { att->SetDef(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_LAYERIDENT ) ) { - AttLayerident *att = reinterpret_cast(element); + AttLayerident *att = dynamic_cast(element); + assert( att ); if (attrType == "layer") { att->SetLayer(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_LINELOC ) ) { - AttLineloc *att = reinterpret_cast(element); + AttLineloc *att = dynamic_cast(element); + assert( att ); if (attrType == "line") { att->SetLine(att->StrToInt(attrValue)); return true; } } if (element->HasAttClass( ATT_LINEREND ) ) { - AttLinerend *att = reinterpret_cast(element); + AttLinerend *att = dynamic_cast(element); + assert( att ); if (attrType == "rend") { att->SetRend(att->StrToBarRendition(attrValue)); return true; } } if (element->HasAttClass( ATT_LYRICSTYLE ) ) { - AttLyricstyle *att = reinterpret_cast(element); + AttLyricstyle *att = dynamic_cast(element); + assert( att ); if (attrType == "lyricAlign") { att->SetLyricAlign(att->StrToStr(attrValue)); return true; @@ -7460,7 +7518,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_MEASURELOG ) ) { - AttMeasureLog *att = reinterpret_cast(element); + AttMeasureLog *att = dynamic_cast(element); + assert( att ); if (attrType == "left") { att->SetLeft(att->StrToBarRendition(attrValue)); return true; @@ -7471,14 +7530,16 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_MEASUREMENT ) ) { - AttMeasurement *att = reinterpret_cast(element); + AttMeasurement *att = dynamic_cast(element); + assert( att ); if (attrType == "unit") { att->SetUnit(att->StrToInt(attrValue)); return true; } } if (element->HasAttClass( ATT_MEDIABOUNDS ) ) { - AttMediabounds *att = reinterpret_cast(element); + AttMediabounds *att = dynamic_cast(element); + assert( att ); if (attrType == "begin") { att->SetBegin(att->StrToStr(attrValue)); return true; @@ -7493,14 +7554,16 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_MEDIUM ) ) { - AttMedium *att = reinterpret_cast(element); + AttMedium *att = dynamic_cast(element); + assert( att ); if (attrType == "medium") { att->SetMedium(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_MEIVERSION ) ) { - AttMeiversion *att = reinterpret_cast(element); + AttMeiversion *att = dynamic_cast(element); + assert( att ); if (attrType == "meiversion") { att->SetMeiversion(att->StrToStr(attrValue)); return true; @@ -7511,7 +7574,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_MENSURLOG ) ) { - AttMensurLog *att = reinterpret_cast(element); + AttMensurLog *att = dynamic_cast(element); + assert( att ); if (attrType == "dot") { att->SetDot(att->StrToBool(attrValue)); return true; @@ -7522,7 +7586,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_METERSIGLOG ) ) { - AttMeterSigLog *att = reinterpret_cast(element); + AttMeterSigLog *att = dynamic_cast(element); + assert( att ); if (attrType == "count") { att->SetCount(att->StrToInt(attrValue)); return true; @@ -7537,14 +7602,16 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_METERSIGVIS ) ) { - AttMeterSigVis *att = reinterpret_cast(element); + AttMeterSigVis *att = dynamic_cast(element); + assert( att ); if (attrType == "rend") { att->SetRend(att->StrToBarRendition(attrValue)); return true; } } if (element->HasAttClass( ATT_METERSIGDEFAULTLOG ) ) { - AttMeterSigDefaultLog *att = reinterpret_cast(element); + AttMeterSigDefaultLog *att = dynamic_cast(element); + assert( att ); if (attrType == "meterCount") { att->SetMeterCount(att->StrToInt(attrValue)); return true; @@ -7555,7 +7622,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_METERSIGDEFAULTVIS ) ) { - AttMeterSigDefaultVis *att = reinterpret_cast(element); + AttMeterSigDefaultVis *att = dynamic_cast(element); + assert( att ); if (attrType == "meterRend") { att->SetMeterRend(att->StrToStr(attrValue)); return true; @@ -7570,14 +7638,16 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_METERCONFORMANCE ) ) { - AttMeterconformance *att = reinterpret_cast(element); + AttMeterconformance *att = dynamic_cast(element); + assert( att ); if (attrType == "metcon") { att->SetMetcon(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_METERCONFORMANCEBAR ) ) { - AttMeterconformanceBar *att = reinterpret_cast(element); + AttMeterconformanceBar *att = dynamic_cast(element); + assert( att ); if (attrType == "metcon") { att->SetMetcon(att->StrToStr(attrValue)); return true; @@ -7588,7 +7658,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_MMTEMPO ) ) { - AttMmtempo *att = reinterpret_cast(element); + AttMmtempo *att = dynamic_cast(element); + assert( att ); if (attrType == "mm") { att->SetMm(att->StrToStr(attrValue)); return true; @@ -7603,14 +7674,16 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_MULTINUMMEASURES ) ) { - AttMultinummeasures *att = reinterpret_cast(element); + AttMultinummeasures *att = dynamic_cast(element); + assert( att ); if (attrType == "multiNumber") { att->SetMultiNumber(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_NAME ) ) { - AttName *att = reinterpret_cast(element); + AttName *att = dynamic_cast(element); + assert( att ); if (attrType == "nymref") { att->SetNymref(att->StrToStr(attrValue)); return true; @@ -7621,7 +7694,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_NOTEGES ) ) { - AttNoteGes *att = reinterpret_cast(element); + AttNoteGes *att = dynamic_cast(element); + assert( att ); if (attrType == "octGes") { att->SetOctGes(att->StrToStr(attrValue)); return true; @@ -7636,28 +7710,32 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_NOTEVIS ) ) { - AttNoteVis *att = reinterpret_cast(element); + AttNoteVis *att = dynamic_cast(element); + assert( att ); if (attrType == "headshape") { att->SetHeadshape(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_OCTAVE ) ) { - AttOctave *att = reinterpret_cast(element); + AttOctave *att = dynamic_cast(element); + assert( att ); if (attrType == "oct") { att->SetOct(att->StrToInt(attrValue)); return true; } } if (element->HasAttClass( ATT_OCTAVEDEFAULT ) ) { - AttOctavedefault *att = reinterpret_cast(element); + AttOctavedefault *att = dynamic_cast(element); + assert( att ); if (attrType == "octaveDefault") { att->SetOctaveDefault(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_OCTAVEDISPLACEMENT ) ) { - AttOctavedisplacement *att = reinterpret_cast(element); + AttOctavedisplacement *att = dynamic_cast(element); + assert( att ); if (attrType == "dis") { att->SetDis(att->StrToOctaveDis(attrValue)); return true; @@ -7668,42 +7746,48 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_ONELINESTAFF ) ) { - AttOnelinestaff *att = reinterpret_cast(element); + AttOnelinestaff *att = dynamic_cast(element); + assert( att ); if (attrType == "ontheline") { att->SetOntheline(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_PADLOG ) ) { - AttPadLog *att = reinterpret_cast(element); + AttPadLog *att = dynamic_cast(element); + assert( att ); if (attrType == "num") { att->SetNum(att->StrToInt(attrValue)); return true; } } if (element->HasAttClass( ATT_PBVIS ) ) { - AttPbVis *att = reinterpret_cast(element); + AttPbVis *att = dynamic_cast(element); + assert( att ); if (attrType == "func") { att->SetFunc(att->StrToFunc(attrValue)); return true; } } if (element->HasAttClass( ATT_PITCH ) ) { - AttPitch *att = reinterpret_cast(element); + AttPitch *att = dynamic_cast(element); + assert( att ); if (attrType == "pname") { att->SetPname(att->StrToPitchName(attrValue)); return true; } } if (element->HasAttClass( ATT_PLACEMENT ) ) { - AttPlacement *att = reinterpret_cast(element); + AttPlacement *att = dynamic_cast(element); + assert( att ); if (attrType == "place") { att->SetPlace(att->StrToStaffRel(attrValue)); return true; } } if (element->HasAttClass( ATT_PLIST ) ) { - AttPlist *att = reinterpret_cast(element); + AttPlist *att = dynamic_cast(element); + assert( att ); if (attrType == "plist") { att->SetPlist(att->StrToStr(attrValue)); return true; @@ -7714,7 +7798,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_POINTING ) ) { - AttPointing *att = reinterpret_cast(element); + AttPointing *att = dynamic_cast(element); + assert( att ); if (attrType == "actuate") { att->SetActuate(att->StrToStr(attrValue)); return true; @@ -7741,35 +7826,40 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_RELATIVESIZE ) ) { - AttRelativesize *att = reinterpret_cast(element); + AttRelativesize *att = dynamic_cast(element); + assert( att ); if (attrType == "size") { att->SetSize(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_RESPONSIBILITY ) ) { - AttResponsibility *att = reinterpret_cast(element); + AttResponsibility *att = dynamic_cast(element); + assert( att ); if (attrType == "resp") { att->SetResp(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_SBVIS ) ) { - AttSbVis *att = reinterpret_cast(element); + AttSbVis *att = dynamic_cast(element); + assert( att ); if (attrType == "rend") { att->SetRend(att->StrToBarRendition(attrValue)); return true; } } if (element->HasAttClass( ATT_SCALABLE ) ) { - AttScalable *att = reinterpret_cast(element); + AttScalable *att = dynamic_cast(element); + assert( att ); if (attrType == "scale") { att->SetScale(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_SCOREDEFGES ) ) { - AttScoreDefGes *att = reinterpret_cast(element); + AttScoreDefGes *att = dynamic_cast(element); + assert( att ); if (attrType == "tunePname") { att->SetTunePname(att->StrToStr(attrValue)); return true; @@ -7784,7 +7874,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_SCOREDEFVIS ) ) { - AttScoreDefVis *att = reinterpret_cast(element); + AttScoreDefVis *att = dynamic_cast(element); + assert( att ); if (attrType == "endingRend") { att->SetEndingRend(att->StrToStr(attrValue)); return true; @@ -7871,49 +7962,56 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_SECTIONVIS ) ) { - AttSectionVis *att = reinterpret_cast(element); + AttSectionVis *att = dynamic_cast(element); + assert( att ); if (attrType == "restart") { att->SetRestart(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_SEQUENCE ) ) { - AttSequence *att = reinterpret_cast(element); + AttSequence *att = dynamic_cast(element); + assert( att ); if (attrType == "seqInt") { att->SetSeq(att->StrToInt(attrValue)); return true; } } if (element->HasAttClass( ATT_SLASHCOUNT ) ) { - AttSlashcount *att = reinterpret_cast(element); + AttSlashcount *att = dynamic_cast(element); + assert( att ); if (attrType == "slash") { att->SetSlash(att->StrToInt(attrValue)); return true; } } if (element->HasAttClass( ATT_SLURPRESENT ) ) { - AttSlurpresent *att = reinterpret_cast(element); + AttSlurpresent *att = dynamic_cast(element); + assert( att ); if (attrType == "slur") { att->SetSlur(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_SPACEVIS ) ) { - AttSpaceVis *att = reinterpret_cast(element); + AttSpaceVis *att = dynamic_cast(element); + assert( att ); if (attrType == "compressable") { att->SetCompressable(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_STAFFLOG ) ) { - AttStaffLog *att = reinterpret_cast(element); + AttStaffLog *att = dynamic_cast(element); + assert( att ); if (attrType == "def") { att->SetDef(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_STAFFDEFVIS ) ) { - AttStaffDefVis *att = reinterpret_cast(element); + AttStaffDefVis *att = dynamic_cast(element); + assert( att ); if (attrType == "gridShow") { att->SetGridShow(att->StrToBool(attrValue)); return true; @@ -7940,35 +8038,40 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_STAFFGRPVIS ) ) { - AttStaffGrpVis *att = reinterpret_cast(element); + AttStaffGrpVis *att = dynamic_cast(element); + assert( att ); if (attrType == "barthru") { att->SetBarthru(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_STAFFGROUPINGSYM ) ) { - AttStaffgroupingsym *att = reinterpret_cast(element); + AttStaffgroupingsym *att = dynamic_cast(element); + assert( att ); if (attrType == "symbol") { att->SetSymbol(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_STAFFIDENT ) ) { - AttStaffident *att = reinterpret_cast(element); + AttStaffident *att = dynamic_cast(element); + assert( att ); if (attrType == "staff") { att->SetStaff(att->StrToInt(attrValue)); return true; } } if (element->HasAttClass( ATT_STAFFLOC ) ) { - AttStaffloc *att = reinterpret_cast(element); + AttStaffloc *att = dynamic_cast(element); + assert( att ); if (attrType == "loc") { att->SetLoc(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_STAFFLOCPITCHED ) ) { - AttStafflocPitched *att = reinterpret_cast(element); + AttStafflocPitched *att = dynamic_cast(element); + assert( att ); if (attrType == "ploc") { att->SetPloc(att->StrToPitchName(attrValue)); return true; @@ -7979,21 +8082,24 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_STARTENDID ) ) { - AttStartendid *att = reinterpret_cast(element); + AttStartendid *att = dynamic_cast(element); + assert( att ); if (attrType == "endid") { att->SetEndid(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_STARTID ) ) { - AttStartid *att = reinterpret_cast(element); + AttStartid *att = dynamic_cast(element); + assert( att ); if (attrType == "startid") { att->SetStartid(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_STEMMED ) ) { - AttStemmed *att = reinterpret_cast(element); + AttStemmed *att = dynamic_cast(element); + assert( att ); if (attrType == "stemDir") { att->SetStemDir(att->StrToStemDirection(attrValue)); return true; @@ -8016,7 +8122,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_SYLLOG ) ) { - AttSylLog *att = reinterpret_cast(element); + AttSylLog *att = dynamic_cast(element); + assert( att ); if (attrType == "con") { att->SetCon(att->StrToCon(attrValue)); return true; @@ -8027,14 +8134,16 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_SYLTEXT ) ) { - AttSyltext *att = reinterpret_cast(element); + AttSyltext *att = dynamic_cast(element); + assert( att ); if (attrType == "syl") { att->SetSyl(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_TEXTSTYLE ) ) { - AttTextstyle *att = reinterpret_cast(element); + AttTextstyle *att = dynamic_cast(element); + assert( att ); if (attrType == "textFam") { att->SetTextFam(att->StrToStr(attrValue)); return true; @@ -8057,21 +8166,24 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_TIEPRESENT ) ) { - AttTiepresent *att = reinterpret_cast(element); + AttTiepresent *att = dynamic_cast(element); + assert( att ); if (attrType == "tie") { att->SetTie(att->StrToTie(attrValue)); return true; } } if (element->HasAttClass( ATT_TIMESTAMPMUSICAL ) ) { - AttTimestampMusical *att = reinterpret_cast(element); + AttTimestampMusical *att = dynamic_cast(element); + assert( att ); if (attrType == "tstamp") { att->SetTstamp(att->StrToDbl(attrValue)); return true; } } if (element->HasAttClass( ATT_TIMESTAMPPERFORMED ) ) { - AttTimestampPerformed *att = reinterpret_cast(element); + AttTimestampPerformed *att = dynamic_cast(element); + assert( att ); if (attrType == "tstampGesInt") { att->SetTstampGes(att->StrToInt(attrValue)); return true; @@ -8082,14 +8194,16 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_TIMESTAMP2MUSICAL ) ) { - AttTimestamp2Musical *att = reinterpret_cast(element); + AttTimestamp2Musical *att = dynamic_cast(element); + assert( att ); if (attrType == "tstamp2") { att->SetTstamp2(att->StrToTstamp2(attrValue)); return true; } } if (element->HasAttClass( ATT_TRANSPOSITION ) ) { - AttTransposition *att = reinterpret_cast(element); + AttTransposition *att = dynamic_cast(element); + assert( att ); if (attrType == "transDiatDbl") { att->SetTransDiat(att->StrToDbl(attrValue)); return true; @@ -8100,14 +8214,16 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_TUPLETPRESENT ) ) { - AttTupletpresent *att = reinterpret_cast(element); + AttTupletpresent *att = dynamic_cast(element); + assert( att ); if (attrType == "tuplet") { att->SetTuplet(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_TYPED ) ) { - AttTyped *att = reinterpret_cast(element); + AttTyped *att = dynamic_cast(element); + assert( att ); if (attrType == "type") { att->SetType(att->StrToStr(attrValue)); return true; @@ -8118,7 +8234,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_TYPOGRAPHY ) ) { - AttTypography *att = reinterpret_cast(element); + AttTypography *att = dynamic_cast(element); + assert( att ); if (attrType == "fontfam") { att->SetFontfam(att->StrToStr(attrValue)); return true; @@ -8141,35 +8258,40 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_VISIBILITY ) ) { - AttVisibility *att = reinterpret_cast(element); + AttVisibility *att = dynamic_cast(element); + assert( att ); if (attrType == "visible") { att->SetVisible(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_VISUALOFFSETHO ) ) { - AttVisualoffsetHo *att = reinterpret_cast(element); + AttVisualoffsetHo *att = dynamic_cast(element); + assert( att ); if (attrType == "ho") { att->SetHo(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_VISUALOFFSETTO ) ) { - AttVisualoffsetTo *att = reinterpret_cast(element); + AttVisualoffsetTo *att = dynamic_cast(element); + assert( att ); if (attrType == "to") { att->SetTo(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_VISUALOFFSETVO ) ) { - AttVisualoffsetVo *att = reinterpret_cast(element); + AttVisualoffsetVo *att = dynamic_cast(element); + assert( att ); if (attrType == "vo") { att->SetVo(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_VISUALOFFSET2HO ) ) { - AttVisualoffset2Ho *att = reinterpret_cast(element); + AttVisualoffset2Ho *att = dynamic_cast(element); + assert( att ); if (attrType == "startho") { att->SetStartho(att->StrToStr(attrValue)); return true; @@ -8180,7 +8302,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_VISUALOFFSET2TO ) ) { - AttVisualoffset2To *att = reinterpret_cast(element); + AttVisualoffset2To *att = dynamic_cast(element); + assert( att ); if (attrType == "startto") { att->SetStartto(att->StrToStr(attrValue)); return true; @@ -8191,7 +8314,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_VISUALOFFSET2VO ) ) { - AttVisualoffset2Vo *att = reinterpret_cast(element); + AttVisualoffset2Vo *att = dynamic_cast(element); + assert( att ); if (attrType == "startvo") { att->SetStartvo(att->StrToStr(attrValue)); return true; @@ -8202,21 +8326,24 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_WHITESPACE ) ) { - AttWhitespace *att = reinterpret_cast(element); + AttWhitespace *att = dynamic_cast(element); + assert( att ); if (attrType == "space") { att->SetSpace(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_WIDTH ) ) { - AttWidth *att = reinterpret_cast(element); + AttWidth *att = dynamic_cast(element); + assert( att ); if (attrType == "width") { att->SetWidth(att->StrToStr(attrValue)); return true; } } if (element->HasAttClass( ATT_XY ) ) { - AttXy *att = reinterpret_cast(element); + AttXy *att = dynamic_cast(element); + assert( att ); if (attrType == "xDbl") { att->SetX(att->StrToDbl(attrValue)); return true; @@ -8227,7 +8354,8 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu } } if (element->HasAttClass( ATT_XY2 ) ) { - AttXy2 *att = reinterpret_cast(element); + AttXy2 *att = dynamic_cast(element); + assert( att ); if (attrType == "x2Dbl") { att->SetX2(att->StrToDbl(attrValue)); return true; @@ -8243,49 +8371,57 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { if (element->HasAttClass( ATT_ACCIDLOG ) ) { - AttAccidLog *att = reinterpret_cast(element); + AttAccidLog *att = dynamic_cast(element); + assert( att ); if (att->HasFunc()) { attributes->push_back(std::make_pair("func", att->FuncToStr(att->GetFunc()))); } } if (element->HasAttClass( ATT_ACCIDENTAL ) ) { - AttAccidental *att = reinterpret_cast(element); + AttAccidental *att = dynamic_cast(element); + assert( att ); if (att->HasAccid()) { attributes->push_back(std::make_pair("accid", att->AccidentalExplicitToStr(att->GetAccid()))); } } if (element->HasAttClass( ATT_ACCIDENTALPERFORMED ) ) { - AttAccidentalPerformed *att = reinterpret_cast(element); + AttAccidentalPerformed *att = dynamic_cast(element); + assert( att ); if (att->HasAccidGes()) { attributes->push_back(std::make_pair("accidGes", att->StrToStr(att->GetAccidGes()))); } } if (element->HasAttClass( ATT_ALTSYM ) ) { - AttAltsym *att = reinterpret_cast(element); + AttAltsym *att = dynamic_cast(element); + assert( att ); if (att->HasAltsym()) { attributes->push_back(std::make_pair("altsym", att->StrToStr(att->GetAltsym()))); } } if (element->HasAttClass( ATT_ARTICULATION ) ) { - AttArticulation *att = reinterpret_cast(element); + AttArticulation *att = dynamic_cast(element); + assert( att ); if (att->HasArtic()) { attributes->push_back(std::make_pair("artic", att->StrToStr(att->GetArtic()))); } } if (element->HasAttClass( ATT_ARTICULATIONPERFORMED ) ) { - AttArticulationPerformed *att = reinterpret_cast(element); + AttArticulationPerformed *att = dynamic_cast(element); + assert( att ); if (att->HasArticGes()) { attributes->push_back(std::make_pair("articGes", att->StrToStr(att->GetArticGes()))); } } if (element->HasAttClass( ATT_AUGMENTDOTS ) ) { - AttAugmentdots *att = reinterpret_cast(element); + AttAugmentdots *att = dynamic_cast(element); + assert( att ); if (att->HasDots()) { attributes->push_back(std::make_pair("dots", att->IntToStr(att->GetDots()))); } } if (element->HasAttClass( ATT_AUTHORIZED ) ) { - AttAuthorized *att = reinterpret_cast(element); + AttAuthorized *att = dynamic_cast(element); + assert( att ); if (att->HasAuthority()) { attributes->push_back(std::make_pair("authority", att->StrToStr(att->GetAuthority()))); } @@ -8294,13 +8430,15 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_BARLINELOG ) ) { - AttBarLineLog *att = reinterpret_cast(element); + AttBarLineLog *att = dynamic_cast(element); + assert( att ); if (att->HasRend()) { attributes->push_back(std::make_pair("rend", att->BarRenditionToStr(att->GetRend()))); } } if (element->HasAttClass( ATT_BARPLACEMENT ) ) { - AttBarplacement *att = reinterpret_cast(element); + AttBarplacement *att = dynamic_cast(element); + assert( att ); if (att->HasBarplace()) { attributes->push_back(std::make_pair("barplace", att->StrToStr(att->GetBarplace()))); } @@ -8309,7 +8447,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_BEAMINGVIS ) ) { - AttBeamingVis *att = reinterpret_cast(element); + AttBeamingVis *att = dynamic_cast(element); + assert( att ); if (att->HasBeamColor()) { attributes->push_back(std::make_pair("beamColor", att->StrToStr(att->GetBeamColor()))); } @@ -8321,37 +8460,43 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_BIBL ) ) { - AttBibl *att = reinterpret_cast(element); + AttBibl *att = dynamic_cast(element); + assert( att ); if (att->HasAnalog()) { attributes->push_back(std::make_pair("analog", att->StrToStr(att->GetAnalog()))); } } if (element->HasAttClass( ATT_CALENDARED ) ) { - AttCalendared *att = reinterpret_cast(element); + AttCalendared *att = dynamic_cast(element); + assert( att ); if (att->HasCalendar()) { attributes->push_back(std::make_pair("calendar", att->StrToStr(att->GetCalendar()))); } } if (element->HasAttClass( ATT_CANONICAL ) ) { - AttCanonical *att = reinterpret_cast(element); + AttCanonical *att = dynamic_cast(element); + assert( att ); if (att->HasDbkey()) { attributes->push_back(std::make_pair("dbkey", att->StrToStr(att->GetDbkey()))); } } if (element->HasAttClass( ATT_CHORDVIS ) ) { - AttChordVis *att = reinterpret_cast(element); + AttChordVis *att = dynamic_cast(element); + assert( att ); if (att->HasCluster()) { attributes->push_back(std::make_pair("cluster", att->StrToStr(att->GetCluster()))); } } if (element->HasAttClass( ATT_CLEFLOG ) ) { - AttClefLog *att = reinterpret_cast(element); + AttClefLog *att = dynamic_cast(element); + assert( att ); if (att->HasCautionary()) { attributes->push_back(std::make_pair("cautionary", att->StrToStr(att->GetCautionary()))); } } if (element->HasAttClass( ATT_CLEFFINGLOG ) ) { - AttCleffingLog *att = reinterpret_cast(element); + AttCleffingLog *att = dynamic_cast(element); + assert( att ); if (att->HasClefShape()) { attributes->push_back(std::make_pair("clefShape", att->ClefShapeToStr(att->GetClefShape()))); } @@ -8366,7 +8511,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_CLEFFINGVIS ) ) { - AttCleffingVis *att = reinterpret_cast(element); + AttCleffingVis *att = dynamic_cast(element); + assert( att ); if (att->HasClefColor()) { attributes->push_back(std::make_pair("clefColor", att->StrToStr(att->GetClefColor()))); } @@ -8375,31 +8521,36 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_CLEFSHAPE ) ) { - AttClefshape *att = reinterpret_cast(element); + AttClefshape *att = dynamic_cast(element); + assert( att ); if (att->HasShape()) { attributes->push_back(std::make_pair("shape", att->ClefShapeToStr(att->GetShape()))); } } if (element->HasAttClass( ATT_CODED ) ) { - AttCoded *att = reinterpret_cast(element); + AttCoded *att = dynamic_cast(element); + assert( att ); if (att->HasCode()) { attributes->push_back(std::make_pair("code", att->StrToStr(att->GetCode()))); } } if (element->HasAttClass( ATT_COLOR ) ) { - AttColor *att = reinterpret_cast(element); + AttColor *att = dynamic_cast(element); + assert( att ); if (att->HasColor()) { attributes->push_back(std::make_pair("color", att->StrToStr(att->GetColor()))); } } if (element->HasAttClass( ATT_COLORATION ) ) { - AttColoration *att = reinterpret_cast(element); + AttColoration *att = dynamic_cast(element); + assert( att ); if (att->HasColored()) { attributes->push_back(std::make_pair("colored", att->BoolToStr(att->GetColored()))); } } if (element->HasAttClass( ATT_COMMON ) ) { - AttCommon *att = reinterpret_cast(element); + AttCommon *att = dynamic_cast(element); + assert( att ); if (att->HasLabel()) { attributes->push_back(std::make_pair("label", att->StrToStr(att->GetLabel()))); } @@ -8411,7 +8562,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_COORDINATED ) ) { - AttCoordinated *att = reinterpret_cast(element); + AttCoordinated *att = dynamic_cast(element); + assert( att ); if (att->HasUlx()) { attributes->push_back(std::make_pair("ulxInt", att->IntToStr(att->GetUlx()))); } @@ -8426,7 +8578,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_CURVATURE ) ) { - AttCurvature *att = reinterpret_cast(element); + AttCurvature *att = dynamic_cast(element); + assert( att ); if (att->HasBezier()) { attributes->push_back(std::make_pair("bezier", att->StrToStr(att->GetBezier()))); } @@ -8438,19 +8591,22 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_CURVEREND ) ) { - AttCurverend *att = reinterpret_cast(element); + AttCurverend *att = dynamic_cast(element); + assert( att ); if (att->HasRend()) { attributes->push_back(std::make_pair("rend", att->BarRenditionToStr(att->GetRend()))); } } if (element->HasAttClass( ATT_CUSTOSLOG ) ) { - AttCustosLog *att = reinterpret_cast(element); + AttCustosLog *att = dynamic_cast(element); + assert( att ); if (att->HasTarget()) { attributes->push_back(std::make_pair("target", att->StrToStr(att->GetTarget()))); } } if (element->HasAttClass( ATT_DATABLE ) ) { - AttDatable *att = reinterpret_cast(element); + AttDatable *att = dynamic_cast(element); + assert( att ); if (att->HasEnddate()) { attributes->push_back(std::make_pair("enddate", att->StrToStr(att->GetEnddate()))); } @@ -8468,19 +8624,22 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_DATAPOINTING ) ) { - AttDatapointing *att = reinterpret_cast(element); + AttDatapointing *att = dynamic_cast(element); + assert( att ); if (att->HasData()) { attributes->push_back(std::make_pair("data", att->StrToStr(att->GetData()))); } } if (element->HasAttClass( ATT_DECLARING ) ) { - AttDeclaring *att = reinterpret_cast(element); + AttDeclaring *att = dynamic_cast(element); + assert( att ); if (att->HasDecls()) { attributes->push_back(std::make_pair("decls", att->StrToStr(att->GetDecls()))); } } if (element->HasAttClass( ATT_DISTANCES ) ) { - AttDistances *att = reinterpret_cast(element); + AttDistances *att = dynamic_cast(element); + assert( att ); if (att->HasDynamDist()) { attributes->push_back(std::make_pair("dynamDist", att->StrToStr(att->GetDynamDist()))); } @@ -8492,19 +8651,22 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_DOTLOG ) ) { - AttDotLog *att = reinterpret_cast(element); + AttDotLog *att = dynamic_cast(element); + assert( att ); if (att->HasForm()) { attributes->push_back(std::make_pair("form", att->StrToStr(att->GetForm()))); } } if (element->HasAttClass( ATT_DURATIONADDITIVE ) ) { - AttDurationAdditive *att = reinterpret_cast(element); + AttDurationAdditive *att = dynamic_cast(element); + assert( att ); if (att->HasDur()) { attributes->push_back(std::make_pair("dur", att->DurToStr(att->GetDur()))); } } if (element->HasAttClass( ATT_DURATIONDEFAULT ) ) { - AttDurationDefault *att = reinterpret_cast(element); + AttDurationDefault *att = dynamic_cast(element); + assert( att ); if (att->HasDurDefault()) { attributes->push_back(std::make_pair("durDefault", att->StrToStr(att->GetDurDefault()))); } @@ -8516,19 +8678,22 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_DURATIONMUSICAL ) ) { - AttDurationMusical *att = reinterpret_cast(element); + AttDurationMusical *att = dynamic_cast(element); + assert( att ); if (att->HasDur()) { attributes->push_back(std::make_pair("dur", att->DurToStr(att->GetDur()))); } } if (element->HasAttClass( ATT_DURATIONPERFORMED ) ) { - AttDurationPerformed *att = reinterpret_cast(element); + AttDurationPerformed *att = dynamic_cast(element); + assert( att ); if (att->HasDurGes()) { attributes->push_back(std::make_pair("durGes", att->DurToStr(att->GetDurGes()))); } } if (element->HasAttClass( ATT_DURATIONRATIO ) ) { - AttDurationRatio *att = reinterpret_cast(element); + AttDurationRatio *att = dynamic_cast(element); + assert( att ); if (att->HasNum()) { attributes->push_back(std::make_pair("num", att->IntToStr(att->GetNum()))); } @@ -8537,55 +8702,64 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_ENCLOSINGCHARS ) ) { - AttEnclosingchars *att = reinterpret_cast(element); + AttEnclosingchars *att = dynamic_cast(element); + assert( att ); if (att->HasEnclose()) { attributes->push_back(std::make_pair("enclose", att->StrToStr(att->GetEnclose()))); } } if (element->HasAttClass( ATT_FERMATAPRESENT ) ) { - AttFermatapresent *att = reinterpret_cast(element); + AttFermatapresent *att = dynamic_cast(element); + assert( att ); if (att->HasFermata()) { attributes->push_back(std::make_pair("fermata", att->PlaceToStr(att->GetFermata()))); } } if (element->HasAttClass( ATT_HANDIDENT ) ) { - AttHandident *att = reinterpret_cast(element); + AttHandident *att = dynamic_cast(element); + assert( att ); if (att->HasHand()) { attributes->push_back(std::make_pair("hand", att->StrToStr(att->GetHand()))); } } if (element->HasAttClass( ATT_HORIZONTALALIGN ) ) { - AttHorizontalalign *att = reinterpret_cast(element); + AttHorizontalalign *att = dynamic_cast(element); + assert( att ); if (att->HasHalign()) { attributes->push_back(std::make_pair("halign", att->StrToStr(att->GetHalign()))); } } if (element->HasAttClass( ATT_INSTRUMENTIDENT ) ) { - AttInstrumentident *att = reinterpret_cast(element); + AttInstrumentident *att = dynamic_cast(element); + assert( att ); if (att->HasInstr()) { attributes->push_back(std::make_pair("instr", att->StrToStr(att->GetInstr()))); } } if (element->HasAttClass( ATT_INTERNETMEDIA ) ) { - AttInternetmedia *att = reinterpret_cast(element); + AttInternetmedia *att = dynamic_cast(element); + assert( att ); if (att->HasMimetype()) { attributes->push_back(std::make_pair("mimetype", att->StrToStr(att->GetMimetype()))); } } if (element->HasAttClass( ATT_JOINED ) ) { - AttJoined *att = reinterpret_cast(element); + AttJoined *att = dynamic_cast(element); + assert( att ); if (att->HasJoin()) { attributes->push_back(std::make_pair("join", att->StrToStr(att->GetJoin()))); } } if (element->HasAttClass( ATT_KEYSIGLOG ) ) { - AttKeySigLog *att = reinterpret_cast(element); + AttKeySigLog *att = dynamic_cast(element); + assert( att ); if (att->HasMode()) { attributes->push_back(std::make_pair("mode", att->StrToStr(att->GetMode()))); } } if (element->HasAttClass( ATT_KEYSIGDEFAULTLOG ) ) { - AttKeySigDefaultLog *att = reinterpret_cast(element); + AttKeySigDefaultLog *att = dynamic_cast(element); + assert( att ); if (att->HasKeyAccid()) { attributes->push_back(std::make_pair("keyAccid", att->AccidentalImplicitToStr(att->GetKeyAccid()))); } @@ -8603,7 +8777,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_KEYSIGDEFAULTVIS ) ) { - AttKeySigDefaultVis *att = reinterpret_cast(element); + AttKeySigDefaultVis *att = dynamic_cast(element); + assert( att ); if (att->HasKeySigShow()) { attributes->push_back(std::make_pair("keySigShow", att->StrToStr(att->GetKeySigShow()))); } @@ -8612,43 +8787,50 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_LABELSADDL ) ) { - AttLabelsAddl *att = reinterpret_cast(element); + AttLabelsAddl *att = dynamic_cast(element); + assert( att ); if (att->HasLabelAbbr()) { attributes->push_back(std::make_pair("labelAbbr", att->StrToStr(att->GetLabelAbbr()))); } } if (element->HasAttClass( ATT_LANG ) ) { - AttLang *att = reinterpret_cast(element); + AttLang *att = dynamic_cast(element); + assert( att ); if (att->HasLang()) { attributes->push_back(std::make_pair("lang", att->StrToStr(att->GetLang()))); } } if (element->HasAttClass( ATT_LAYERLOG ) ) { - AttLayerLog *att = reinterpret_cast(element); + AttLayerLog *att = dynamic_cast(element); + assert( att ); if (att->HasDef()) { attributes->push_back(std::make_pair("def", att->StrToStr(att->GetDef()))); } } if (element->HasAttClass( ATT_LAYERIDENT ) ) { - AttLayerident *att = reinterpret_cast(element); + AttLayerident *att = dynamic_cast(element); + assert( att ); if (att->HasLayer()) { attributes->push_back(std::make_pair("layer", att->StrToStr(att->GetLayer()))); } } if (element->HasAttClass( ATT_LINELOC ) ) { - AttLineloc *att = reinterpret_cast(element); + AttLineloc *att = dynamic_cast(element); + assert( att ); if (att->HasLine()) { attributes->push_back(std::make_pair("line", att->IntToStr(att->GetLine()))); } } if (element->HasAttClass( ATT_LINEREND ) ) { - AttLinerend *att = reinterpret_cast(element); + AttLinerend *att = dynamic_cast(element); + assert( att ); if (att->HasRend()) { attributes->push_back(std::make_pair("rend", att->BarRenditionToStr(att->GetRend()))); } } if (element->HasAttClass( ATT_LYRICSTYLE ) ) { - AttLyricstyle *att = reinterpret_cast(element); + AttLyricstyle *att = dynamic_cast(element); + assert( att ); if (att->HasLyricAlign()) { attributes->push_back(std::make_pair("lyricAlign", att->StrToStr(att->GetLyricAlign()))); } @@ -8669,7 +8851,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_MEASURELOG ) ) { - AttMeasureLog *att = reinterpret_cast(element); + AttMeasureLog *att = dynamic_cast(element); + assert( att ); if (att->HasLeft()) { attributes->push_back(std::make_pair("left", att->BarRenditionToStr(att->GetLeft()))); } @@ -8678,13 +8861,15 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_MEASUREMENT ) ) { - AttMeasurement *att = reinterpret_cast(element); + AttMeasurement *att = dynamic_cast(element); + assert( att ); if (att->HasUnit()) { attributes->push_back(std::make_pair("unit", att->IntToStr(att->GetUnit()))); } } if (element->HasAttClass( ATT_MEDIABOUNDS ) ) { - AttMediabounds *att = reinterpret_cast(element); + AttMediabounds *att = dynamic_cast(element); + assert( att ); if (att->HasBegin()) { attributes->push_back(std::make_pair("begin", att->StrToStr(att->GetBegin()))); } @@ -8696,13 +8881,15 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_MEDIUM ) ) { - AttMedium *att = reinterpret_cast(element); + AttMedium *att = dynamic_cast(element); + assert( att ); if (att->HasMedium()) { attributes->push_back(std::make_pair("medium", att->StrToStr(att->GetMedium()))); } } if (element->HasAttClass( ATT_MEIVERSION ) ) { - AttMeiversion *att = reinterpret_cast(element); + AttMeiversion *att = dynamic_cast(element); + assert( att ); if (att->HasMeiversion()) { attributes->push_back(std::make_pair("meiversion", att->StrToStr(att->GetMeiversion()))); } @@ -8711,7 +8898,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_MENSURLOG ) ) { - AttMensurLog *att = reinterpret_cast(element); + AttMensurLog *att = dynamic_cast(element); + assert( att ); if (att->HasDot()) { attributes->push_back(std::make_pair("dot", att->BoolToStr(att->GetDot()))); } @@ -8720,7 +8908,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_METERSIGLOG ) ) { - AttMeterSigLog *att = reinterpret_cast(element); + AttMeterSigLog *att = dynamic_cast(element); + assert( att ); if (att->HasCount()) { attributes->push_back(std::make_pair("count", att->IntToStr(att->GetCount()))); } @@ -8732,13 +8921,15 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_METERSIGVIS ) ) { - AttMeterSigVis *att = reinterpret_cast(element); + AttMeterSigVis *att = dynamic_cast(element); + assert( att ); if (att->HasRend()) { attributes->push_back(std::make_pair("rend", att->BarRenditionToStr(att->GetRend()))); } } if (element->HasAttClass( ATT_METERSIGDEFAULTLOG ) ) { - AttMeterSigDefaultLog *att = reinterpret_cast(element); + AttMeterSigDefaultLog *att = dynamic_cast(element); + assert( att ); if (att->HasMeterCount()) { attributes->push_back(std::make_pair("meterCount", att->IntToStr(att->GetMeterCount()))); } @@ -8747,7 +8938,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_METERSIGDEFAULTVIS ) ) { - AttMeterSigDefaultVis *att = reinterpret_cast(element); + AttMeterSigDefaultVis *att = dynamic_cast(element); + assert( att ); if (att->HasMeterRend()) { attributes->push_back(std::make_pair("meterRend", att->StrToStr(att->GetMeterRend()))); } @@ -8759,13 +8951,15 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_METERCONFORMANCE ) ) { - AttMeterconformance *att = reinterpret_cast(element); + AttMeterconformance *att = dynamic_cast(element); + assert( att ); if (att->HasMetcon()) { attributes->push_back(std::make_pair("metcon", att->StrToStr(att->GetMetcon()))); } } if (element->HasAttClass( ATT_METERCONFORMANCEBAR ) ) { - AttMeterconformanceBar *att = reinterpret_cast(element); + AttMeterconformanceBar *att = dynamic_cast(element); + assert( att ); if (att->HasMetcon()) { attributes->push_back(std::make_pair("metcon", att->StrToStr(att->GetMetcon()))); } @@ -8774,7 +8968,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_MMTEMPO ) ) { - AttMmtempo *att = reinterpret_cast(element); + AttMmtempo *att = dynamic_cast(element); + assert( att ); if (att->HasMm()) { attributes->push_back(std::make_pair("mm", att->StrToStr(att->GetMm()))); } @@ -8786,13 +8981,15 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_MULTINUMMEASURES ) ) { - AttMultinummeasures *att = reinterpret_cast(element); + AttMultinummeasures *att = dynamic_cast(element); + assert( att ); if (att->HasMultiNumber()) { attributes->push_back(std::make_pair("multiNumber", att->StrToStr(att->GetMultiNumber()))); } } if (element->HasAttClass( ATT_NAME ) ) { - AttName *att = reinterpret_cast(element); + AttName *att = dynamic_cast(element); + assert( att ); if (att->HasNymref()) { attributes->push_back(std::make_pair("nymref", att->StrToStr(att->GetNymref()))); } @@ -8801,7 +8998,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_NOTEGES ) ) { - AttNoteGes *att = reinterpret_cast(element); + AttNoteGes *att = dynamic_cast(element); + assert( att ); if (att->HasOctGes()) { attributes->push_back(std::make_pair("octGes", att->StrToStr(att->GetOctGes()))); } @@ -8813,25 +9011,29 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_NOTEVIS ) ) { - AttNoteVis *att = reinterpret_cast(element); + AttNoteVis *att = dynamic_cast(element); + assert( att ); if (att->HasHeadshape()) { attributes->push_back(std::make_pair("headshape", att->StrToStr(att->GetHeadshape()))); } } if (element->HasAttClass( ATT_OCTAVE ) ) { - AttOctave *att = reinterpret_cast(element); + AttOctave *att = dynamic_cast(element); + assert( att ); if (att->HasOct()) { attributes->push_back(std::make_pair("oct", att->IntToStr(att->GetOct()))); } } if (element->HasAttClass( ATT_OCTAVEDEFAULT ) ) { - AttOctavedefault *att = reinterpret_cast(element); + AttOctavedefault *att = dynamic_cast(element); + assert( att ); if (att->HasOctaveDefault()) { attributes->push_back(std::make_pair("octaveDefault", att->StrToStr(att->GetOctaveDefault()))); } } if (element->HasAttClass( ATT_OCTAVEDISPLACEMENT ) ) { - AttOctavedisplacement *att = reinterpret_cast(element); + AttOctavedisplacement *att = dynamic_cast(element); + assert( att ); if (att->HasDis()) { attributes->push_back(std::make_pair("dis", att->OctaveDisToStr(att->GetDis()))); } @@ -8840,37 +9042,43 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_ONELINESTAFF ) ) { - AttOnelinestaff *att = reinterpret_cast(element); + AttOnelinestaff *att = dynamic_cast(element); + assert( att ); if (att->HasOntheline()) { attributes->push_back(std::make_pair("ontheline", att->StrToStr(att->GetOntheline()))); } } if (element->HasAttClass( ATT_PADLOG ) ) { - AttPadLog *att = reinterpret_cast(element); + AttPadLog *att = dynamic_cast(element); + assert( att ); if (att->HasNum()) { attributes->push_back(std::make_pair("num", att->IntToStr(att->GetNum()))); } } if (element->HasAttClass( ATT_PBVIS ) ) { - AttPbVis *att = reinterpret_cast(element); + AttPbVis *att = dynamic_cast(element); + assert( att ); if (att->HasFunc()) { attributes->push_back(std::make_pair("func", att->FuncToStr(att->GetFunc()))); } } if (element->HasAttClass( ATT_PITCH ) ) { - AttPitch *att = reinterpret_cast(element); + AttPitch *att = dynamic_cast(element); + assert( att ); if (att->HasPname()) { attributes->push_back(std::make_pair("pname", att->PitchNameToStr(att->GetPname()))); } } if (element->HasAttClass( ATT_PLACEMENT ) ) { - AttPlacement *att = reinterpret_cast(element); + AttPlacement *att = dynamic_cast(element); + assert( att ); if (att->HasPlace()) { attributes->push_back(std::make_pair("place", att->StaffRelToStr(att->GetPlace()))); } } if (element->HasAttClass( ATT_PLIST ) ) { - AttPlist *att = reinterpret_cast(element); + AttPlist *att = dynamic_cast(element); + assert( att ); if (att->HasPlist()) { attributes->push_back(std::make_pair("plist", att->StrToStr(att->GetPlist()))); } @@ -8879,7 +9087,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_POINTING ) ) { - AttPointing *att = reinterpret_cast(element); + AttPointing *att = dynamic_cast(element); + assert( att ); if (att->HasActuate()) { attributes->push_back(std::make_pair("actuate", att->StrToStr(att->GetActuate()))); } @@ -8900,31 +9109,36 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_RELATIVESIZE ) ) { - AttRelativesize *att = reinterpret_cast(element); + AttRelativesize *att = dynamic_cast(element); + assert( att ); if (att->HasSize()) { attributes->push_back(std::make_pair("size", att->StrToStr(att->GetSize()))); } } if (element->HasAttClass( ATT_RESPONSIBILITY ) ) { - AttResponsibility *att = reinterpret_cast(element); + AttResponsibility *att = dynamic_cast(element); + assert( att ); if (att->HasResp()) { attributes->push_back(std::make_pair("resp", att->StrToStr(att->GetResp()))); } } if (element->HasAttClass( ATT_SBVIS ) ) { - AttSbVis *att = reinterpret_cast(element); + AttSbVis *att = dynamic_cast(element); + assert( att ); if (att->HasRend()) { attributes->push_back(std::make_pair("rend", att->BarRenditionToStr(att->GetRend()))); } } if (element->HasAttClass( ATT_SCALABLE ) ) { - AttScalable *att = reinterpret_cast(element); + AttScalable *att = dynamic_cast(element); + assert( att ); if (att->HasScale()) { attributes->push_back(std::make_pair("scale", att->StrToStr(att->GetScale()))); } } if (element->HasAttClass( ATT_SCOREDEFGES ) ) { - AttScoreDefGes *att = reinterpret_cast(element); + AttScoreDefGes *att = dynamic_cast(element); + assert( att ); if (att->HasTunePname()) { attributes->push_back(std::make_pair("tunePname", att->StrToStr(att->GetTunePname()))); } @@ -8936,7 +9150,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_SCOREDEFVIS ) ) { - AttScoreDefVis *att = reinterpret_cast(element); + AttScoreDefVis *att = dynamic_cast(element); + assert( att ); if (att->HasEndingRend()) { attributes->push_back(std::make_pair("endingRend", att->StrToStr(att->GetEndingRend()))); } @@ -9002,43 +9217,50 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_SECTIONVIS ) ) { - AttSectionVis *att = reinterpret_cast(element); + AttSectionVis *att = dynamic_cast(element); + assert( att ); if (att->HasRestart()) { attributes->push_back(std::make_pair("restart", att->StrToStr(att->GetRestart()))); } } if (element->HasAttClass( ATT_SEQUENCE ) ) { - AttSequence *att = reinterpret_cast(element); + AttSequence *att = dynamic_cast(element); + assert( att ); if (att->HasSeq()) { attributes->push_back(std::make_pair("seqInt", att->IntToStr(att->GetSeq()))); } } if (element->HasAttClass( ATT_SLASHCOUNT ) ) { - AttSlashcount *att = reinterpret_cast(element); + AttSlashcount *att = dynamic_cast(element); + assert( att ); if (att->HasSlash()) { attributes->push_back(std::make_pair("slash", att->IntToStr(att->GetSlash()))); } } if (element->HasAttClass( ATT_SLURPRESENT ) ) { - AttSlurpresent *att = reinterpret_cast(element); + AttSlurpresent *att = dynamic_cast(element); + assert( att ); if (att->HasSlur()) { attributes->push_back(std::make_pair("slur", att->StrToStr(att->GetSlur()))); } } if (element->HasAttClass( ATT_SPACEVIS ) ) { - AttSpaceVis *att = reinterpret_cast(element); + AttSpaceVis *att = dynamic_cast(element); + assert( att ); if (att->HasCompressable()) { attributes->push_back(std::make_pair("compressable", att->StrToStr(att->GetCompressable()))); } } if (element->HasAttClass( ATT_STAFFLOG ) ) { - AttStaffLog *att = reinterpret_cast(element); + AttStaffLog *att = dynamic_cast(element); + assert( att ); if (att->HasDef()) { attributes->push_back(std::make_pair("def", att->StrToStr(att->GetDef()))); } } if (element->HasAttClass( ATT_STAFFDEFVIS ) ) { - AttStaffDefVis *att = reinterpret_cast(element); + AttStaffDefVis *att = dynamic_cast(element); + assert( att ); if (att->HasGridShow()) { attributes->push_back(std::make_pair("gridShow", att->BoolToStr(att->GetGridShow()))); } @@ -9059,31 +9281,36 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_STAFFGRPVIS ) ) { - AttStaffGrpVis *att = reinterpret_cast(element); + AttStaffGrpVis *att = dynamic_cast(element); + assert( att ); if (att->HasBarthru()) { attributes->push_back(std::make_pair("barthru", att->StrToStr(att->GetBarthru()))); } } if (element->HasAttClass( ATT_STAFFGROUPINGSYM ) ) { - AttStaffgroupingsym *att = reinterpret_cast(element); + AttStaffgroupingsym *att = dynamic_cast(element); + assert( att ); if (att->HasSymbol()) { attributes->push_back(std::make_pair("symbol", att->StrToStr(att->GetSymbol()))); } } if (element->HasAttClass( ATT_STAFFIDENT ) ) { - AttStaffident *att = reinterpret_cast(element); + AttStaffident *att = dynamic_cast(element); + assert( att ); if (att->HasStaff()) { attributes->push_back(std::make_pair("staff", att->IntToStr(att->GetStaff()))); } } if (element->HasAttClass( ATT_STAFFLOC ) ) { - AttStaffloc *att = reinterpret_cast(element); + AttStaffloc *att = dynamic_cast(element); + assert( att ); if (att->HasLoc()) { attributes->push_back(std::make_pair("loc", att->StrToStr(att->GetLoc()))); } } if (element->HasAttClass( ATT_STAFFLOCPITCHED ) ) { - AttStafflocPitched *att = reinterpret_cast(element); + AttStafflocPitched *att = dynamic_cast(element); + assert( att ); if (att->HasPloc()) { attributes->push_back(std::make_pair("ploc", att->PitchNameToStr(att->GetPloc()))); } @@ -9092,19 +9319,22 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_STARTENDID ) ) { - AttStartendid *att = reinterpret_cast(element); + AttStartendid *att = dynamic_cast(element); + assert( att ); if (att->HasEndid()) { attributes->push_back(std::make_pair("endid", att->StrToStr(att->GetEndid()))); } } if (element->HasAttClass( ATT_STARTID ) ) { - AttStartid *att = reinterpret_cast(element); + AttStartid *att = dynamic_cast(element); + assert( att ); if (att->HasStartid()) { attributes->push_back(std::make_pair("startid", att->StrToStr(att->GetStartid()))); } } if (element->HasAttClass( ATT_STEMMED ) ) { - AttStemmed *att = reinterpret_cast(element); + AttStemmed *att = dynamic_cast(element); + assert( att ); if (att->HasStemDir()) { attributes->push_back(std::make_pair("stemDir", att->StemDirectionToStr(att->GetStemDir()))); } @@ -9122,7 +9352,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_SYLLOG ) ) { - AttSylLog *att = reinterpret_cast(element); + AttSylLog *att = dynamic_cast(element); + assert( att ); if (att->HasCon()) { attributes->push_back(std::make_pair("con", att->ConToStr(att->GetCon()))); } @@ -9131,13 +9362,15 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_SYLTEXT ) ) { - AttSyltext *att = reinterpret_cast(element); + AttSyltext *att = dynamic_cast(element); + assert( att ); if (att->HasSyl()) { attributes->push_back(std::make_pair("syl", att->StrToStr(att->GetSyl()))); } } if (element->HasAttClass( ATT_TEXTSTYLE ) ) { - AttTextstyle *att = reinterpret_cast(element); + AttTextstyle *att = dynamic_cast(element); + assert( att ); if (att->HasTextFam()) { attributes->push_back(std::make_pair("textFam", att->StrToStr(att->GetTextFam()))); } @@ -9155,19 +9388,22 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_TIEPRESENT ) ) { - AttTiepresent *att = reinterpret_cast(element); + AttTiepresent *att = dynamic_cast(element); + assert( att ); if (att->HasTie()) { attributes->push_back(std::make_pair("tie", att->TieToStr(att->GetTie()))); } } if (element->HasAttClass( ATT_TIMESTAMPMUSICAL ) ) { - AttTimestampMusical *att = reinterpret_cast(element); + AttTimestampMusical *att = dynamic_cast(element); + assert( att ); if (att->HasTstamp()) { attributes->push_back(std::make_pair("tstamp", att->DblToStr(att->GetTstamp()))); } } if (element->HasAttClass( ATT_TIMESTAMPPERFORMED ) ) { - AttTimestampPerformed *att = reinterpret_cast(element); + AttTimestampPerformed *att = dynamic_cast(element); + assert( att ); if (att->HasTstampGes()) { attributes->push_back(std::make_pair("tstampGesInt", att->IntToStr(att->GetTstampGes()))); } @@ -9176,13 +9412,15 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_TIMESTAMP2MUSICAL ) ) { - AttTimestamp2Musical *att = reinterpret_cast(element); + AttTimestamp2Musical *att = dynamic_cast(element); + assert( att ); if (att->HasTstamp2()) { attributes->push_back(std::make_pair("tstamp2", att->Tstamp2ToStr(att->GetTstamp2()))); } } if (element->HasAttClass( ATT_TRANSPOSITION ) ) { - AttTransposition *att = reinterpret_cast(element); + AttTransposition *att = dynamic_cast(element); + assert( att ); if (att->HasTransDiat()) { attributes->push_back(std::make_pair("transDiatDbl", att->DblToStr(att->GetTransDiat()))); } @@ -9191,13 +9429,15 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_TUPLETPRESENT ) ) { - AttTupletpresent *att = reinterpret_cast(element); + AttTupletpresent *att = dynamic_cast(element); + assert( att ); if (att->HasTuplet()) { attributes->push_back(std::make_pair("tuplet", att->StrToStr(att->GetTuplet()))); } } if (element->HasAttClass( ATT_TYPED ) ) { - AttTyped *att = reinterpret_cast(element); + AttTyped *att = dynamic_cast(element); + assert( att ); if (att->HasType()) { attributes->push_back(std::make_pair("type", att->StrToStr(att->GetType()))); } @@ -9206,7 +9446,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_TYPOGRAPHY ) ) { - AttTypography *att = reinterpret_cast(element); + AttTypography *att = dynamic_cast(element); + assert( att ); if (att->HasFontfam()) { attributes->push_back(std::make_pair("fontfam", att->StrToStr(att->GetFontfam()))); } @@ -9224,31 +9465,36 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_VISIBILITY ) ) { - AttVisibility *att = reinterpret_cast(element); + AttVisibility *att = dynamic_cast(element); + assert( att ); if (att->HasVisible()) { attributes->push_back(std::make_pair("visible", att->StrToStr(att->GetVisible()))); } } if (element->HasAttClass( ATT_VISUALOFFSETHO ) ) { - AttVisualoffsetHo *att = reinterpret_cast(element); + AttVisualoffsetHo *att = dynamic_cast(element); + assert( att ); if (att->HasHo()) { attributes->push_back(std::make_pair("ho", att->StrToStr(att->GetHo()))); } } if (element->HasAttClass( ATT_VISUALOFFSETTO ) ) { - AttVisualoffsetTo *att = reinterpret_cast(element); + AttVisualoffsetTo *att = dynamic_cast(element); + assert( att ); if (att->HasTo()) { attributes->push_back(std::make_pair("to", att->StrToStr(att->GetTo()))); } } if (element->HasAttClass( ATT_VISUALOFFSETVO ) ) { - AttVisualoffsetVo *att = reinterpret_cast(element); + AttVisualoffsetVo *att = dynamic_cast(element); + assert( att ); if (att->HasVo()) { attributes->push_back(std::make_pair("vo", att->StrToStr(att->GetVo()))); } } if (element->HasAttClass( ATT_VISUALOFFSET2HO ) ) { - AttVisualoffset2Ho *att = reinterpret_cast(element); + AttVisualoffset2Ho *att = dynamic_cast(element); + assert( att ); if (att->HasStartho()) { attributes->push_back(std::make_pair("startho", att->StrToStr(att->GetStartho()))); } @@ -9257,7 +9503,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_VISUALOFFSET2TO ) ) { - AttVisualoffset2To *att = reinterpret_cast(element); + AttVisualoffset2To *att = dynamic_cast(element); + assert( att ); if (att->HasStartto()) { attributes->push_back(std::make_pair("startto", att->StrToStr(att->GetStartto()))); } @@ -9266,7 +9513,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_VISUALOFFSET2VO ) ) { - AttVisualoffset2Vo *att = reinterpret_cast(element); + AttVisualoffset2Vo *att = dynamic_cast(element); + assert( att ); if (att->HasStartvo()) { attributes->push_back(std::make_pair("startvo", att->StrToStr(att->GetStartvo()))); } @@ -9275,19 +9523,22 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_WHITESPACE ) ) { - AttWhitespace *att = reinterpret_cast(element); + AttWhitespace *att = dynamic_cast(element); + assert( att ); if (att->HasSpace()) { attributes->push_back(std::make_pair("space", att->StrToStr(att->GetSpace()))); } } if (element->HasAttClass( ATT_WIDTH ) ) { - AttWidth *att = reinterpret_cast(element); + AttWidth *att = dynamic_cast(element); + assert( att ); if (att->HasWidth()) { attributes->push_back(std::make_pair("width", att->StrToStr(att->GetWidth()))); } } if (element->HasAttClass( ATT_XY ) ) { - AttXy *att = reinterpret_cast(element); + AttXy *att = dynamic_cast(element); + assert( att ); if (att->HasX()) { attributes->push_back(std::make_pair("xDbl", att->DblToStr(att->GetX()))); } @@ -9296,7 +9547,8 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_XY2 ) ) { - AttXy2 *att = reinterpret_cast(element); + AttXy2 *att = dynamic_cast(element); + assert( att ); if (att->HasX2()) { attributes->push_back(std::make_pair("x2Dbl", att->DblToStr(att->GetX2()))); } diff --git a/libmei/atts_shared.h b/libmei/atts_shared.h index 2a14c5bfac2..7b37a79958c 100644 --- a/libmei/atts_shared.h +++ b/libmei/atts_shared.h @@ -16,6 +16,7 @@ #define __VRV_ATTS_SHARED_H__ #include "att.h" +#include "att_classes.h" #include "pugixml.hpp" //---------------------------------------------------------------------------- @@ -28,8 +29,6 @@ namespace vrv { // AttAccidLog //---------------------------------------------------------------------------- -#define ATT_ACCIDLOG 77 - class AttAccidLog: public Att { public: @@ -68,8 +67,6 @@ class AttAccidLog: public Att // AttAccidental //---------------------------------------------------------------------------- -#define ATT_ACCIDENTAL 78 - class AttAccidental: public Att { public: @@ -108,8 +105,6 @@ class AttAccidental: public Att // AttAccidentalPerformed //---------------------------------------------------------------------------- -#define ATT_ACCIDENTALPERFORMED 79 - class AttAccidentalPerformed: public Att { public: @@ -151,8 +146,6 @@ class AttAccidentalPerformed: public Att // AttAltsym //---------------------------------------------------------------------------- -#define ATT_ALTSYM 80 - class AttAltsym: public Att { public: @@ -194,8 +187,6 @@ class AttAltsym: public Att // AttArticulation //---------------------------------------------------------------------------- -#define ATT_ARTICULATION 81 - class AttArticulation: public Att { public: @@ -240,8 +231,6 @@ class AttArticulation: public Att // AttArticulationPerformed //---------------------------------------------------------------------------- -#define ATT_ARTICULATIONPERFORMED 82 - class AttArticulationPerformed: public Att { public: @@ -280,8 +269,6 @@ class AttArticulationPerformed: public Att // AttAugmentdots //---------------------------------------------------------------------------- -#define ATT_AUGMENTDOTS 83 - class AttAugmentdots: public Att { public: @@ -320,8 +307,6 @@ class AttAugmentdots: public Att // AttAuthorized //---------------------------------------------------------------------------- -#define ATT_AUTHORIZED 84 - class AttAuthorized: public Att { public: @@ -373,8 +358,6 @@ class AttAuthorized: public Att // AttBarLineLog //---------------------------------------------------------------------------- -#define ATT_BARLINELOG 85 - class AttBarLineLog: public Att { public: @@ -413,8 +396,6 @@ class AttBarLineLog: public Att // AttBarplacement //---------------------------------------------------------------------------- -#define ATT_BARPLACEMENT 86 - class AttBarplacement: public Att { public: @@ -469,8 +450,6 @@ class AttBarplacement: public Att // AttBeamingVis //---------------------------------------------------------------------------- -#define ATT_BEAMINGVIS 87 - class AttBeamingVis: public Att { public: @@ -523,8 +502,6 @@ class AttBeamingVis: public Att // AttBibl //---------------------------------------------------------------------------- -#define ATT_BIBL 88 - class AttBibl: public Att { public: @@ -566,8 +543,6 @@ class AttBibl: public Att // AttCalendared //---------------------------------------------------------------------------- -#define ATT_CALENDARED 89 - class AttCalendared: public Att { public: @@ -609,8 +584,6 @@ class AttCalendared: public Att // AttCanonical //---------------------------------------------------------------------------- -#define ATT_CANONICAL 90 - class AttCanonical: public Att { public: @@ -649,8 +622,6 @@ class AttCanonical: public Att // AttChordVis //---------------------------------------------------------------------------- -#define ATT_CHORDVIS 91 - class AttChordVis: public Att { public: @@ -693,8 +664,6 @@ class AttChordVis: public Att // AttClefLog //---------------------------------------------------------------------------- -#define ATT_CLEFLOG 92 - class AttClefLog: public Att { public: @@ -736,8 +705,6 @@ class AttClefLog: public Att // AttCleffingLog //---------------------------------------------------------------------------- -#define ATT_CLEFFINGLOG 93 - class AttCleffingLog: public Att { public: @@ -801,8 +768,6 @@ class AttCleffingLog: public Att // AttCleffingVis //---------------------------------------------------------------------------- -#define ATT_CLEFFINGVIS 94 - class AttCleffingVis: public Att { public: @@ -848,8 +813,6 @@ class AttCleffingVis: public Att // AttClefshape //---------------------------------------------------------------------------- -#define ATT_CLEFSHAPE 95 - class AttClefshape: public Att { public: @@ -888,8 +851,6 @@ class AttClefshape: public Att // AttCoded //---------------------------------------------------------------------------- -#define ATT_CODED 96 - class AttCoded: public Att { public: @@ -928,8 +889,6 @@ class AttCoded: public Att // AttColor //---------------------------------------------------------------------------- -#define ATT_COLOR 97 - class AttColor: public Att { public: @@ -971,8 +930,6 @@ class AttColor: public Att // AttColoration //---------------------------------------------------------------------------- -#define ATT_COLORATION 98 - class AttColoration: public Att { public: @@ -1018,8 +975,6 @@ class AttColoration: public Att // AttCommon //---------------------------------------------------------------------------- -#define ATT_COMMON 99 - class AttCommon: public Att { public: @@ -1078,8 +1033,6 @@ class AttCommon: public Att // AttCoordinated //---------------------------------------------------------------------------- -#define ATT_COORDINATED 100 - class AttCoordinated: public Att { public: @@ -1139,8 +1092,6 @@ class AttCoordinated: public Att // AttCurvature //---------------------------------------------------------------------------- -#define ATT_CURVATURE 101 - class AttCurvature: public Att { public: @@ -1201,8 +1152,6 @@ class AttCurvature: public Att // AttCurverend //---------------------------------------------------------------------------- -#define ATT_CURVEREND 102 - class AttCurverend: public Att { public: @@ -1241,8 +1190,6 @@ class AttCurverend: public Att // AttCustosLog //---------------------------------------------------------------------------- -#define ATT_CUSTOSLOG 103 - class AttCustosLog: public Att { public: @@ -1284,8 +1231,6 @@ class AttCustosLog: public Att // AttDatable //---------------------------------------------------------------------------- -#define ATT_DATABLE 104 - class AttDatable: public Att { public: @@ -1352,8 +1297,6 @@ class AttDatable: public Att // AttDatapointing //---------------------------------------------------------------------------- -#define ATT_DATAPOINTING 105 - class AttDatapointing: public Att { public: @@ -1392,8 +1335,6 @@ class AttDatapointing: public Att // AttDeclaring //---------------------------------------------------------------------------- -#define ATT_DECLARING 106 - class AttDeclaring: public Att { public: @@ -1435,8 +1376,6 @@ class AttDeclaring: public Att // AttDistances //---------------------------------------------------------------------------- -#define ATT_DISTANCES 107 - class AttDistances: public Att { public: @@ -1492,8 +1431,6 @@ class AttDistances: public Att // AttDotLog //---------------------------------------------------------------------------- -#define ATT_DOTLOG 108 - class AttDotLog: public Att { public: @@ -1532,8 +1469,6 @@ class AttDotLog: public Att // AttDurationAdditive //---------------------------------------------------------------------------- -#define ATT_DURATIONADDITIVE 109 - class AttDurationAdditive: public Att { public: @@ -1578,8 +1513,6 @@ class AttDurationAdditive: public Att // AttDurationDefault //---------------------------------------------------------------------------- -#define ATT_DURATIONDEFAULT 110 - class AttDurationDefault: public Att { public: @@ -1642,8 +1575,6 @@ class AttDurationDefault: public Att // AttDurationMusical //---------------------------------------------------------------------------- -#define ATT_DURATIONMUSICAL 111 - class AttDurationMusical: public Att { public: @@ -1688,8 +1619,6 @@ class AttDurationMusical: public Att // AttDurationPerformed //---------------------------------------------------------------------------- -#define ATT_DURATIONPERFORMED 112 - class AttDurationPerformed: public Att { public: @@ -1733,8 +1662,6 @@ class AttDurationPerformed: public Att // AttDurationRatio //---------------------------------------------------------------------------- -#define ATT_DURATIONRATIO 113 - class AttDurationRatio: public Att { public: @@ -1786,8 +1713,6 @@ class AttDurationRatio: public Att // AttEnclosingchars //---------------------------------------------------------------------------- -#define ATT_ENCLOSINGCHARS 114 - class AttEnclosingchars: public Att { public: @@ -1831,8 +1756,6 @@ class AttEnclosingchars: public Att // AttFermatapresent //---------------------------------------------------------------------------- -#define ATT_FERMATAPRESENT 115 - class AttFermatapresent: public Att { public: @@ -1875,8 +1798,6 @@ class AttFermatapresent: public Att // AttHandident //---------------------------------------------------------------------------- -#define ATT_HANDIDENT 116 - class AttHandident: public Att { public: @@ -1918,8 +1839,6 @@ class AttHandident: public Att // AttHorizontalalign //---------------------------------------------------------------------------- -#define ATT_HORIZONTALALIGN 117 - class AttHorizontalalign: public Att { public: @@ -1958,8 +1877,6 @@ class AttHorizontalalign: public Att // AttInstrumentident //---------------------------------------------------------------------------- -#define ATT_INSTRUMENTIDENT 118 - class AttInstrumentident: public Att { public: @@ -2001,8 +1918,6 @@ class AttInstrumentident: public Att // AttInternetmedia //---------------------------------------------------------------------------- -#define ATT_INTERNETMEDIA 119 - class AttInternetmedia: public Att { public: @@ -2045,8 +1960,6 @@ class AttInternetmedia: public Att // AttJoined //---------------------------------------------------------------------------- -#define ATT_JOINED 120 - class AttJoined: public Att { public: @@ -2092,8 +2005,6 @@ class AttJoined: public Att // AttKeySigLog //---------------------------------------------------------------------------- -#define ATT_KEYSIGLOG 121 - class AttKeySigLog: public Att { public: @@ -2132,8 +2043,6 @@ class AttKeySigLog: public Att // AttKeySigDefaultLog //---------------------------------------------------------------------------- -#define ATT_KEYSIGDEFAULTLOG 122 - class AttKeySigDefaultLog: public Att { public: @@ -2216,8 +2125,6 @@ class AttKeySigDefaultLog: public Att // AttKeySigDefaultVis //---------------------------------------------------------------------------- -#define ATT_KEYSIGDEFAULTVIS 123 - class AttKeySigDefaultVis: public Att { public: @@ -2263,8 +2170,6 @@ class AttKeySigDefaultVis: public Att // AttLabelsAddl //---------------------------------------------------------------------------- -#define ATT_LABELSADDL 124 - class AttLabelsAddl: public Att { public: @@ -2306,8 +2211,6 @@ class AttLabelsAddl: public Att // AttLang //---------------------------------------------------------------------------- -#define ATT_LANG 125 - class AttLang: public Att { public: @@ -2346,8 +2249,6 @@ class AttLang: public Att // AttLayerLog //---------------------------------------------------------------------------- -#define ATT_LAYERLOG 126 - class AttLayerLog: public Att { public: @@ -2386,8 +2287,6 @@ class AttLayerLog: public Att // AttLayerident //---------------------------------------------------------------------------- -#define ATT_LAYERIDENT 127 - class AttLayerident: public Att { public: @@ -2426,8 +2325,6 @@ class AttLayerident: public Att // AttLineloc //---------------------------------------------------------------------------- -#define ATT_LINELOC 128 - class AttLineloc: public Att { public: @@ -2470,8 +2367,6 @@ class AttLineloc: public Att // AttLinerend //---------------------------------------------------------------------------- -#define ATT_LINEREND 129 - class AttLinerend: public Att { public: @@ -2510,8 +2405,6 @@ class AttLinerend: public Att // AttLyricstyle //---------------------------------------------------------------------------- -#define ATT_LYRICSTYLE 130 - class AttLyricstyle: public Att { public: @@ -2585,8 +2478,6 @@ class AttLyricstyle: public Att // AttMeasureLog //---------------------------------------------------------------------------- -#define ATT_MEASURELOG 131 - class AttMeasureLog: public Att { public: @@ -2636,8 +2527,6 @@ class AttMeasureLog: public Att // AttMeasurement //---------------------------------------------------------------------------- -#define ATT_MEASUREMENT 132 - class AttMeasurement: public Att { public: @@ -2676,8 +2565,6 @@ class AttMeasurement: public Att // AttMediabounds //---------------------------------------------------------------------------- -#define ATT_MEDIABOUNDS 133 - class AttMediabounds: public Att { public: @@ -2743,8 +2630,6 @@ class AttMediabounds: public Att // AttMedium //---------------------------------------------------------------------------- -#define ATT_MEDIUM 134 - class AttMedium: public Att { public: @@ -2783,8 +2668,6 @@ class AttMedium: public Att // AttMeiversion //---------------------------------------------------------------------------- -#define ATT_MEIVERSION 135 - class AttMeiversion: public Att { public: @@ -2830,8 +2713,6 @@ class AttMeiversion: public Att // AttMensurLog //---------------------------------------------------------------------------- -#define ATT_MENSURLOG 136 - class AttMensurLog: public Att { public: @@ -2877,8 +2758,6 @@ class AttMensurLog: public Att // AttMeterSigLog //---------------------------------------------------------------------------- -#define ATT_METERSIGLOG 137 - class AttMeterSigLog: public Att { public: @@ -2939,8 +2818,6 @@ class AttMeterSigLog: public Att // AttMeterSigVis //---------------------------------------------------------------------------- -#define ATT_METERSIGVIS 138 - class AttMeterSigVis: public Att { public: @@ -2979,8 +2856,6 @@ class AttMeterSigVis: public Att // AttMeterSigDefaultLog //---------------------------------------------------------------------------- -#define ATT_METERSIGDEFAULTLOG 139 - class AttMeterSigDefaultLog: public Att { public: @@ -3034,8 +2909,6 @@ class AttMeterSigDefaultLog: public Att // AttMeterSigDefaultVis //---------------------------------------------------------------------------- -#define ATT_METERSIGDEFAULTVIS 140 - class AttMeterSigDefaultVis: public Att { public: @@ -3094,8 +2967,6 @@ class AttMeterSigDefaultVis: public Att // AttMeterconformance //---------------------------------------------------------------------------- -#define ATT_METERCONFORMANCE 141 - class AttMeterconformance: public Att { public: @@ -3137,8 +3008,6 @@ class AttMeterconformance: public Att // AttMeterconformanceBar //---------------------------------------------------------------------------- -#define ATT_METERCONFORMANCEBAR 142 - class AttMeterconformanceBar: public Att { public: @@ -3193,8 +3062,6 @@ class AttMeterconformanceBar: public Att // AttMmtempo //---------------------------------------------------------------------------- -#define ATT_MMTEMPO 143 - class AttMmtempo: public Att { public: @@ -3251,8 +3118,6 @@ class AttMmtempo: public Att // AttMultinummeasures //---------------------------------------------------------------------------- -#define ATT_MULTINUMMEASURES 144 - class AttMultinummeasures: public Att { public: @@ -3294,8 +3159,6 @@ class AttMultinummeasures: public Att // AttName //---------------------------------------------------------------------------- -#define ATT_NAME 145 - class AttName: public Att { public: @@ -3347,8 +3210,6 @@ class AttName: public Att // AttNoteGes //---------------------------------------------------------------------------- -#define ATT_NOTEGES 146 - class AttNoteGes: public Att { public: @@ -3401,8 +3262,6 @@ class AttNoteGes: public Att // AttNoteVis //---------------------------------------------------------------------------- -#define ATT_NOTEVIS 147 - class AttNoteVis: public Att { public: @@ -3441,8 +3300,6 @@ class AttNoteVis: public Att // AttOctave //---------------------------------------------------------------------------- -#define ATT_OCTAVE 148 - class AttOctave: public Att { public: @@ -3481,8 +3338,6 @@ class AttOctave: public Att // AttOctavedefault //---------------------------------------------------------------------------- -#define ATT_OCTAVEDEFAULT 149 - class AttOctavedefault: public Att { public: @@ -3525,8 +3380,6 @@ class AttOctavedefault: public Att // AttOctavedisplacement //---------------------------------------------------------------------------- -#define ATT_OCTAVEDISPLACEMENT 150 - class AttOctavedisplacement: public Att { public: @@ -3572,8 +3425,6 @@ class AttOctavedisplacement: public Att // AttOnelinestaff //---------------------------------------------------------------------------- -#define ATT_ONELINESTAFF 151 - class AttOnelinestaff: public Att { public: @@ -3616,8 +3467,6 @@ class AttOnelinestaff: public Att // AttPadLog //---------------------------------------------------------------------------- -#define ATT_PADLOG 152 - class AttPadLog: public Att { public: @@ -3659,8 +3508,6 @@ class AttPadLog: public Att // AttPbVis //---------------------------------------------------------------------------- -#define ATT_PBVIS 153 - class AttPbVis: public Att { public: @@ -3699,8 +3546,6 @@ class AttPbVis: public Att // AttPitch //---------------------------------------------------------------------------- -#define ATT_PITCH 154 - class AttPitch: public Att { public: @@ -3739,8 +3584,6 @@ class AttPitch: public Att // AttPlacement //---------------------------------------------------------------------------- -#define ATT_PLACEMENT 155 - class AttPlacement: public Att { public: @@ -3782,8 +3625,6 @@ class AttPlacement: public Att // AttPlist //---------------------------------------------------------------------------- -#define ATT_PLIST 156 - class AttPlist: public Att { public: @@ -3832,8 +3673,6 @@ class AttPlist: public Att // AttPointing //---------------------------------------------------------------------------- -#define ATT_POINTING 157 - class AttPointing: public Att { public: @@ -3916,8 +3755,6 @@ class AttPointing: public Att // AttRelativesize //---------------------------------------------------------------------------- -#define ATT_RELATIVESIZE 158 - class AttRelativesize: public Att { public: @@ -3956,8 +3793,6 @@ class AttRelativesize: public Att // AttResponsibility //---------------------------------------------------------------------------- -#define ATT_RESPONSIBILITY 159 - class AttResponsibility: public Att { public: @@ -4000,8 +3835,6 @@ class AttResponsibility: public Att // AttSbVis //---------------------------------------------------------------------------- -#define ATT_SBVIS 160 - class AttSbVis: public Att { public: @@ -4040,8 +3873,6 @@ class AttSbVis: public Att // AttScalable //---------------------------------------------------------------------------- -#define ATT_SCALABLE 161 - class AttScalable: public Att { public: @@ -4080,8 +3911,6 @@ class AttScalable: public Att // AttScoreDefGes //---------------------------------------------------------------------------- -#define ATT_SCOREDEFGES 162 - class AttScoreDefGes: public Att { public: @@ -4134,8 +3963,6 @@ class AttScoreDefGes: public Att // AttScoreDefVis //---------------------------------------------------------------------------- -#define ATT_SCOREDEFVIS 163 - class AttScoreDefVis: public Att { public: @@ -4345,8 +4172,6 @@ class AttScoreDefVis: public Att // AttSectionVis //---------------------------------------------------------------------------- -#define ATT_SECTIONVIS 164 - class AttSectionVis: public Att { public: @@ -4385,8 +4210,6 @@ class AttSectionVis: public Att // AttSequence //---------------------------------------------------------------------------- -#define ATT_SEQUENCE 165 - class AttSequence: public Att { public: @@ -4428,8 +4251,6 @@ class AttSequence: public Att // AttSlashcount //---------------------------------------------------------------------------- -#define ATT_SLASHCOUNT 166 - class AttSlashcount: public Att { public: @@ -4468,8 +4289,6 @@ class AttSlashcount: public Att // AttSlurpresent //---------------------------------------------------------------------------- -#define ATT_SLURPRESENT 167 - class AttSlurpresent: public Att { public: @@ -4512,8 +4331,6 @@ class AttSlurpresent: public Att // AttSpaceVis //---------------------------------------------------------------------------- -#define ATT_SPACEVIS 168 - class AttSpaceVis: public Att { public: @@ -4555,8 +4372,6 @@ class AttSpaceVis: public Att // AttStaffLog //---------------------------------------------------------------------------- -#define ATT_STAFFLOG 169 - class AttStaffLog: public Att { public: @@ -4595,8 +4410,6 @@ class AttStaffLog: public Att // AttStaffDefVis //---------------------------------------------------------------------------- -#define ATT_STAFFDEFVIS 170 - class AttStaffDefVis: public Att { public: @@ -4682,8 +4495,6 @@ class AttStaffDefVis: public Att // AttStaffGrpVis //---------------------------------------------------------------------------- -#define ATT_STAFFGRPVIS 171 - class AttStaffGrpVis: public Att { public: @@ -4725,8 +4536,6 @@ class AttStaffGrpVis: public Att // AttStaffgroupingsym //---------------------------------------------------------------------------- -#define ATT_STAFFGROUPINGSYM 172 - class AttStaffgroupingsym: public Att { public: @@ -4765,8 +4574,6 @@ class AttStaffgroupingsym: public Att // AttStaffident //---------------------------------------------------------------------------- -#define ATT_STAFFIDENT 173 - class AttStaffident: public Att { public: @@ -4809,8 +4616,6 @@ class AttStaffident: public Att // AttStaffloc //---------------------------------------------------------------------------- -#define ATT_STAFFLOC 174 - class AttStaffloc: public Att { public: @@ -4849,8 +4654,6 @@ class AttStaffloc: public Att // AttStafflocPitched //---------------------------------------------------------------------------- -#define ATT_STAFFLOCPITCHED 175 - class AttStafflocPitched: public Att { public: @@ -4896,8 +4699,6 @@ class AttStafflocPitched: public Att // AttStartendid //---------------------------------------------------------------------------- -#define ATT_STARTENDID 176 - class AttStartendid: public Att { public: @@ -4939,8 +4740,6 @@ class AttStartendid: public Att // AttStartid //---------------------------------------------------------------------------- -#define ATT_STARTID 177 - class AttStartid: public Att { public: @@ -4982,8 +4781,6 @@ class AttStartid: public Att // AttStemmed //---------------------------------------------------------------------------- -#define ATT_STEMMED 178 - class AttStemmed: public Att { public: @@ -5050,8 +4847,6 @@ class AttStemmed: public Att // AttSylLog //---------------------------------------------------------------------------- -#define ATT_SYLLOG 179 - class AttSylLog: public Att { public: @@ -5100,8 +4895,6 @@ class AttSylLog: public Att // AttSyltext //---------------------------------------------------------------------------- -#define ATT_SYLTEXT 180 - class AttSyltext: public Att { public: @@ -5140,8 +4933,6 @@ class AttSyltext: public Att // AttTextstyle //---------------------------------------------------------------------------- -#define ATT_TEXTSTYLE 181 - class AttTextstyle: public Att { public: @@ -5223,8 +5014,6 @@ class AttTextstyle: public Att // AttTiepresent //---------------------------------------------------------------------------- -#define ATT_TIEPRESENT 182 - class AttTiepresent: public Att { public: @@ -5267,8 +5056,6 @@ class AttTiepresent: public Att // AttTimestampMusical //---------------------------------------------------------------------------- -#define ATT_TIMESTAMPMUSICAL 183 - class AttTimestampMusical: public Att { public: @@ -5310,8 +5097,6 @@ class AttTimestampMusical: public Att // AttTimestampPerformed //---------------------------------------------------------------------------- -#define ATT_TIMESTAMPPERFORMED 184 - class AttTimestampPerformed: public Att { public: @@ -5360,8 +5145,6 @@ class AttTimestampPerformed: public Att // AttTimestamp2Musical //---------------------------------------------------------------------------- -#define ATT_TIMESTAMP2MUSICAL 185 - class AttTimestamp2Musical: public Att { public: @@ -5403,8 +5186,6 @@ class AttTimestamp2Musical: public Att // AttTransposition //---------------------------------------------------------------------------- -#define ATT_TRANSPOSITION 186 - class AttTransposition: public Att { public: @@ -5456,8 +5237,6 @@ class AttTransposition: public Att // AttTupletpresent //---------------------------------------------------------------------------- -#define ATT_TUPLETPRESENT 187 - class AttTupletpresent: public Att { public: @@ -5500,8 +5279,6 @@ class AttTupletpresent: public Att // AttTyped //---------------------------------------------------------------------------- -#define ATT_TYPED 188 - class AttTyped: public Att { public: @@ -5553,8 +5330,6 @@ class AttTyped: public Att // AttTypography //---------------------------------------------------------------------------- -#define ATT_TYPOGRAPHY 189 - class AttTypography: public Att { public: @@ -5621,8 +5396,6 @@ class AttTypography: public Att // AttVisibility //---------------------------------------------------------------------------- -#define ATT_VISIBILITY 190 - class AttVisibility: public Att { public: @@ -5664,8 +5437,6 @@ class AttVisibility: public Att // AttVisualoffsetHo //---------------------------------------------------------------------------- -#define ATT_VISUALOFFSETHO 191 - class AttVisualoffsetHo: public Att { public: @@ -5708,8 +5479,6 @@ class AttVisualoffsetHo: public Att // AttVisualoffsetTo //---------------------------------------------------------------------------- -#define ATT_VISUALOFFSETTO 192 - class AttVisualoffsetTo: public Att { public: @@ -5751,8 +5520,6 @@ class AttVisualoffsetTo: public Att // AttVisualoffsetVo //---------------------------------------------------------------------------- -#define ATT_VISUALOFFSETVO 193 - class AttVisualoffsetVo: public Att { public: @@ -5795,8 +5562,6 @@ class AttVisualoffsetVo: public Att // AttVisualoffset2Ho //---------------------------------------------------------------------------- -#define ATT_VISUALOFFSET2HO 194 - class AttVisualoffset2Ho: public Att { public: @@ -5848,8 +5613,6 @@ class AttVisualoffset2Ho: public Att // AttVisualoffset2To //---------------------------------------------------------------------------- -#define ATT_VISUALOFFSET2TO 195 - class AttVisualoffset2To: public Att { public: @@ -5901,8 +5664,6 @@ class AttVisualoffset2To: public Att // AttVisualoffset2Vo //---------------------------------------------------------------------------- -#define ATT_VISUALOFFSET2VO 196 - class AttVisualoffset2Vo: public Att { public: @@ -5954,8 +5715,6 @@ class AttVisualoffset2Vo: public Att // AttWhitespace //---------------------------------------------------------------------------- -#define ATT_WHITESPACE 197 - class AttWhitespace: public Att { public: @@ -5994,8 +5753,6 @@ class AttWhitespace: public Att // AttWidth //---------------------------------------------------------------------------- -#define ATT_WIDTH 198 - class AttWidth: public Att { public: @@ -6039,8 +5796,6 @@ class AttWidth: public Att // AttXy //---------------------------------------------------------------------------- -#define ATT_XY 199 - class AttXy: public Att { public: @@ -6094,8 +5849,6 @@ class AttXy: public Att // AttXy2 //---------------------------------------------------------------------------- -#define ATT_XY2 200 - class AttXy2: public Att { public: diff --git a/libmei/atts_tablature.cpp b/libmei/atts_tablature.cpp index 204ea2cc7f8..d53cbb0ea0d 100644 --- a/libmei/atts_tablature.cpp +++ b/libmei/atts_tablature.cpp @@ -16,6 +16,10 @@ //---------------------------------------------------------------------------- +#include + +//---------------------------------------------------------------------------- + #include "object.h" /* #include_block */ @@ -125,7 +129,8 @@ bool AttStaffDefGesTablature::HasTabStrings( ) bool Att::SetTablature( Object *element, std::string attrType, std::string attrValue ) { if (element->HasAttClass( ATT_NOTEGESTABLATURE ) ) { - AttNoteGesTablature *att = reinterpret_cast(element); + AttNoteGesTablature *att = dynamic_cast(element); + assert( att ); if (attrType == "tabFret") { att->SetTabFret(att->StrToStr(attrValue)); return true; @@ -136,7 +141,8 @@ bool Att::SetTablature( Object *element, std::string attrType, std::string attrV } } if (element->HasAttClass( ATT_STAFFDEFGESTABLATURE ) ) { - AttStaffDefGesTablature *att = reinterpret_cast(element); + AttStaffDefGesTablature *att = dynamic_cast(element); + assert( att ); if (attrType == "tabStrings") { att->SetTabStrings(att->StrToStr(attrValue)); return true; @@ -148,7 +154,8 @@ bool Att::SetTablature( Object *element, std::string attrType, std::string attrV void Att::GetTablature( Object *element, ArrayOfStrAttr *attributes ) { if (element->HasAttClass( ATT_NOTEGESTABLATURE ) ) { - AttNoteGesTablature *att = reinterpret_cast(element); + AttNoteGesTablature *att = dynamic_cast(element); + assert( att ); if (att->HasTabFret()) { attributes->push_back(std::make_pair("tabFret", att->StrToStr(att->GetTabFret()))); } @@ -157,7 +164,8 @@ void Att::GetTablature( Object *element, ArrayOfStrAttr *attributes ) { } } if (element->HasAttClass( ATT_STAFFDEFGESTABLATURE ) ) { - AttStaffDefGesTablature *att = reinterpret_cast(element); + AttStaffDefGesTablature *att = dynamic_cast(element); + assert( att ); if (att->HasTabStrings()) { attributes->push_back(std::make_pair("tabStrings", att->StrToStr(att->GetTabStrings()))); } diff --git a/libmei/atts_tablature.h b/libmei/atts_tablature.h index 63ebbfea4f8..591299c79fa 100644 --- a/libmei/atts_tablature.h +++ b/libmei/atts_tablature.h @@ -16,6 +16,7 @@ #define __VRV_ATTS_TABLATURE_H__ #include "att.h" +#include "att_classes.h" #include "pugixml.hpp" //---------------------------------------------------------------------------- @@ -28,8 +29,6 @@ namespace vrv { // AttNoteGesTablature //---------------------------------------------------------------------------- -#define ATT_NOTEGESTABLATURE 201 - class AttNoteGesTablature: public Att { public: @@ -75,8 +74,6 @@ class AttNoteGesTablature: public Att // AttStaffDefGesTablature //---------------------------------------------------------------------------- -#define ATT_STAFFDEFGESTABLATURE 202 - class AttStaffDefGesTablature: public Att { public: diff --git a/src/accid.cpp b/src/accid.cpp index e58a344997f..3ac481a50a4 100644 --- a/src/accid.cpp +++ b/src/accid.cpp @@ -28,6 +28,9 @@ Accid::Accid(): { RegisterAttClass(ATT_ACCIDENTAL); RegisterAttClass(ATT_ACCIDLOG); + + RegisterInterface( PositionInterface::GetAttClasses(), PositionInterface::IsInterface() ); + Reset(); } @@ -53,7 +56,7 @@ int Accid::PreparePointersByLayer( ArrayPtrVoid *params ) // param 0: the current Note (not used) //Note **currentNote = static_cast((*params)[0]); - Note *note = reinterpret_cast( this->GetFirstParent( NOTE, MAX_ACCID_DEPTH ) ); + Note *note = dynamic_cast( this->GetFirstParent( NOTE, MAX_ACCID_DEPTH ) ); if ( !note ) { return FUNCTOR_CONTINUE; } diff --git a/src/aligner.cpp b/src/aligner.cpp index 29568ae4a3b..77645806352 100644 --- a/src/aligner.cpp +++ b/src/aligner.cpp @@ -54,7 +54,7 @@ StaffAlignment* SystemAligner::GetStaffAlignment( int idx ) if (idx < GetStaffAlignmentCount()) { this->m_children.push_back( m_bottomAlignment ); - return reinterpret_cast(m_children[idx]); + return dynamic_cast(m_children.at(idx)); } // check that we are searching for the next one (not gap) assert( idx == GetStaffAlignmentCount() ); @@ -163,7 +163,7 @@ Alignment* MeasureAligner::GetAlignmentAtTime( double time, AlignmentType type, // First try to see if we already have something at the time position for (i = 0; i < GetAlignmentCount(); i++) { - alignment = reinterpret_cast(m_children[i]); + alignment = dynamic_cast(m_children.at(i)); assert( alignment ); double alignment_time = alignment->GetTime(); @@ -226,7 +226,8 @@ void GraceAligner::AlignStack( ) int i; double time = 0.0; for (i = (int)m_noteStack.size(); i > 0; i--) { - Note *note = reinterpret_cast( m_noteStack[i-1] ); + Note *note = dynamic_cast( m_noteStack[i-1] ); + assert( note ); // get the duration of the event double duration = note->LayerElement::GetAlignmentDuration( NULL, NULL, false ); // Time goes backward with grace notes @@ -371,7 +372,8 @@ int Alignment::IntegrateBoundingBoxGraceXShift( ArrayPtrVoid *params ) int i; int shift = 0; for (i = 0; i < (int)m_graceAligner->m_children.size(); i++) { - Alignment *alignment = reinterpret_cast(m_graceAligner->m_children[i]); + Alignment *alignment = dynamic_cast(m_graceAligner->m_children.at(i)); + assert( alignment ); alignment->SetXRel( alignment->GetXShift() + shift ); shift += alignment->GetXShift(); } @@ -380,7 +382,8 @@ int Alignment::IntegrateBoundingBoxGraceXShift( ArrayPtrVoid *params ) if ( m_graceAligner->m_children.empty() ) { return FUNCTOR_CONTINUE; } - Alignment *alignment = reinterpret_cast(m_graceAligner->m_children.back()); + Alignment *alignment = dynamic_cast(m_graceAligner->m_children.back()); + assert( alignment ); m_graceAligner->SetWidth( alignment->GetXRel() + alignment->GetMaxWidth() ); return FUNCTOR_CONTINUE; @@ -400,7 +403,9 @@ int Alignment::IntegrateBoundingBoxXShift( ArrayPtrVoid *params ) (*shift) += m_xShift; if ((GetType() > ALIGNMENT_METERSIG_ATTR) && ((*justifiable_shift) < 0)) { - reinterpret_cast(m_parent)->SetNonJustifiableMargin(m_xRel); + MeasureAligner *aligner = dynamic_cast(m_parent); + assert( aligner ); + aligner->SetNonJustifiableMargin(m_xRel); (*justifiable_shift) = m_xRel; } diff --git a/src/barline.cpp b/src/barline.cpp index 85f133b2d69..b7322cc1246 100644 --- a/src/barline.cpp +++ b/src/barline.cpp @@ -20,8 +20,6 @@ Barline::Barline(): { RegisterAttClass(ATT_BARLINELOG); Reset(); - m_partialBarline = false; // this was used unitialized - m_onStaffOnly = false; // is this good? } Barline::~Barline() diff --git a/src/bboxdevicecontext.cpp b/src/bboxdevicecontext.cpp index 9838ac1740f..959f33f573a 100644 --- a/src/bboxdevicecontext.cpp +++ b/src/bboxdevicecontext.cpp @@ -370,8 +370,7 @@ void BBoxDeviceContext::UpdateBB(int x1, int y1, int x2, int y2) } // the array should not be empty - assert( !m_objects.empty() ); // Array cannot be empty - + assert( !m_objects.empty() ); // we need to store logical coordinates in the objects, we need to convert them back (this is why we need a View object) (m_objects.back())->UpdateSelfBB( m_view->ToLogicalX(x1), m_view->ToLogicalY(y1), m_view->ToLogicalX(x2), m_view->ToLogicalY(y2) ); diff --git a/src/beam.cpp b/src/beam.cpp index e7bf32b33a5..cb646a8d123 100644 --- a/src/beam.cpp +++ b/src/beam.cpp @@ -10,6 +10,10 @@ //---------------------------------------------------------------------------- +#include "assert.h" + +//---------------------------------------------------------------------------- + #include "note.h" namespace vrv { @@ -52,12 +56,13 @@ void Beam::FilterList( ListOfObjects *childList ) ListOfObjects::iterator iter = childList->begin(); while ( iter != childList->end()) { - LayerElement *currentElement = dynamic_cast(*iter); - if ( !currentElement ) { + if ( !(*iter)->IsLayerElement() ) { // remove anything that is not an LayerElement (e.g. Verse, Syl, etc) iter = childList->erase( iter ); } - else if ( !currentElement->HasDurationInterface() ) + LayerElement *currentElement = dynamic_cast(*iter); + assert( currentElement ); + if ( !currentElement->HasDurationInterface() ) { // remove anything that has not a DurationInterface iter = childList->erase( iter ); diff --git a/src/chord.cpp b/src/chord.cpp index 2e79b539225..7792218abb2 100644 --- a/src/chord.cpp +++ b/src/chord.cpp @@ -31,6 +31,9 @@ Chord::Chord( ): RegisterAttClass(ATT_COMMON); RegisterAttClass(ATT_STEMMED); RegisterAttClass(ATT_TIEPRESENT); + + RegisterInterface( DurationInterface::GetAttClasses(), DurationInterface::IsInterface() ); + Reset(); m_drawingStemDir = STEMDIRECTION_NONE; @@ -67,7 +70,7 @@ void Chord::ClearClusters() m_clusters.clear(); } -void Chord::AddLayerElement(vrv::LayerElement *element) +void Chord::AddLayerElement(LayerElement *element) { assert( dynamic_cast(element) ); element->SetParent( this ); @@ -79,6 +82,7 @@ bool compare_pitch (Object *first, Object *second) { Note *n1 = dynamic_cast(first); Note *n2 = dynamic_cast(second); + assert( n1 && n2 ); return ( n1->GetDiatonicPitch() < n2->GetDiatonicPitch() ); } @@ -88,26 +92,18 @@ void Chord::FilterList( ListOfObjects *childList ) ListOfObjects::iterator iter = childList->begin(); while ( iter != childList->end()) { - LayerElement *currentElement = dynamic_cast(*iter); - if ( !currentElement ) { + if ( !(*iter)->IsLayerElement() ) { // remove anything that is not an LayerElement iter = childList->erase( iter ); } - else if ( !currentElement->HasDurationInterface() ) - { + LayerElement *currentElement = dynamic_cast(*iter); + assert( currentElement ); + if ( !currentElement->HasDurationInterface() ) { iter = childList->erase( iter ); } - else /*if ( dynamic_cast(currentElement)) - { - Object* object = currentElement->GetFirstChild(&typeid(Note)); - if (dynamic_cast(object)) - { - iter++; - } - } - else */{ + else { Note *n = dynamic_cast(currentElement); - + if (n) { iter++; } else { @@ -124,6 +120,7 @@ void Chord::FilterList( ListOfObjects *childList ) this->ClearClusters(); Note *curNote, *lastNote = dynamic_cast(*iter); + assert( lastNote ); int curPitch, lastPitch = lastNote->GetDiatonicPitch(); ChordCluster* curCluster = NULL; @@ -131,6 +128,7 @@ void Chord::FilterList( ListOfObjects *childList ) while ( iter != childList->end()) { curNote = dynamic_cast(*iter); + assert( curNote ); curPitch = curNote->GetDiatonicPitch(); if (curPitch - lastPitch == 1) { @@ -160,6 +158,7 @@ void Chord::ResetAccidList() ListOfObjects* childList = this->GetList(this); //make sure it's initialized for (ListOfObjects::reverse_iterator it = childList->rbegin(); it != childList->rend(); it++) { Note *note = dynamic_cast(*it); + assert( note ); if (note->m_drawingAccid != NULL) { m_accidList.push_back(note); } diff --git a/src/custos.cpp b/src/custos.cpp index 2863bfaf2ec..69a5bc36a99 100644 --- a/src/custos.cpp +++ b/src/custos.cpp @@ -18,6 +18,8 @@ namespace vrv { Custos::Custos(): LayerElement("custos-"), PositionInterface() { + RegisterInterface( PositionInterface::GetAttClasses(), PositionInterface::IsInterface() ); + Reset(); } diff --git a/src/doc.cpp b/src/doc.cpp index 58e532ce01b..fbba6aeb655 100644 --- a/src/doc.cpp +++ b/src/doc.cpp @@ -393,27 +393,27 @@ int Doc::GetPageCount( ) } -char Doc::GetLeftMargin( const std::type_info *elementType ) +char Doc::GetLeftMargin( const ClassId classId ) { - if (typeid(Barline) == *elementType) return m_style->m_leftMarginBarline; - else if (typeid(BarlineAttr) == *elementType) return m_style->m_leftMarginBarlineAttr; - else if (typeid(Chord) == *elementType) return m_style->m_leftMarginChord; - else if (typeid(Clef) == *elementType) return m_style->m_leftMarginClef; - else if (typeid(MRest) == *elementType) return m_style->m_leftMarginMRest; - else if (typeid(Note) == *elementType) return m_style->m_leftMarginNote; + if (classId == BAR_LINE) return m_style->m_leftMarginBarline; + else if (classId == BAR_LINE_ATTR) return m_style->m_leftMarginBarlineAttr; + else if (classId == CHORD) return m_style->m_leftMarginChord; + else if (classId == CLEF) return m_style->m_leftMarginClef; + else if (classId == MREST) return m_style->m_leftMarginMRest; + else if (classId == NOTE) return m_style->m_leftMarginNote; return m_style->m_leftMarginDefault; } -char Doc::GetRightMargin( const std::type_info *elementType ) +char Doc::GetRightMargin( const ClassId classId ) { - if (typeid(Barline) == *elementType) return m_style->m_rightMarginBarline; - else if (typeid(BarlineAttr) == *elementType) return m_style->m_rightMarginBarlineAttr; - else if (typeid(Clef) == *elementType) return m_style->m_rightMarginClef; - else if (typeid(KeySig) == *elementType) return m_style->m_rightMarginKeySig; - else if (typeid(Mensur) == *elementType) return m_style->m_rightMarginMensur; - else if (typeid(MeterSig) == *elementType) return m_style->m_rightMarginMeterSig; - else if (typeid(MRest) == *elementType) return m_style->m_rightMarginMRest; - else if (typeid(MultiRest) == *elementType) return m_style->m_rightMarginMultiRest; + if (classId == BAR_LINE) return m_style->m_rightMarginBarline; + else if (classId == BAR_LINE_ATTR) return m_style->m_rightMarginBarlineAttr; + else if (classId == CLEF) return m_style->m_rightMarginClef; + else if (classId == KEY_SIG) return m_style->m_rightMarginKeySig; + else if (classId == MENSUR) return m_style->m_rightMarginMensur; + else if (classId == METER_SIG) return m_style->m_rightMarginMeterSig; + else if (classId == MREST) return m_style->m_rightMarginMRest; + else if (classId == MULTI_REST) return m_style->m_rightMarginMultiRest; return m_style->m_rightMarginDefault; } @@ -465,7 +465,6 @@ Page *Doc::SetDrawingPage( int pageIdx ) return m_drawingPage; } m_drawingPage = dynamic_cast(this->GetChild( pageIdx ) ); - assert( m_drawingPage ); // we use the page members only if set (!= -1) diff --git a/src/dot.cpp b/src/dot.cpp index 65673b97bfb..b2277db0195 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -24,6 +24,8 @@ namespace vrv { Dot::Dot(): LayerElement("dot-"), PositionInterface() { + RegisterInterface( PositionInterface::GetAttClasses(), PositionInterface::IsInterface() ); + Reset(); } diff --git a/src/durationinterface.cpp b/src/durationinterface.cpp index a5df06aa905..7a7b6ab3ca4 100644 --- a/src/durationinterface.cpp +++ b/src/durationinterface.cpp @@ -27,7 +27,7 @@ namespace vrv { // DurationInterface //---------------------------------------------------------------------------- -DurationInterface::DurationInterface(): AttInterface(), +DurationInterface::DurationInterface(): Interface(), AttAugmentdots(), AttBeamsecondary(), AttDurationMusical(), @@ -111,7 +111,7 @@ double DurationInterface::GetAlignmentMensuralDuration( int num, int numbase, Me bool DurationInterface::IsInBeam( Object *noteOrRest ) { - Beam *beam = reinterpret_cast( noteOrRest->GetFirstParent( BEAM, MAX_BEAM_DEPTH ) ); + Object *beam = noteOrRest->GetFirstParent( BEAM, MAX_BEAM_DEPTH ); if ( !beam ) { return false; } @@ -120,7 +120,7 @@ bool DurationInterface::IsInBeam( Object *noteOrRest ) bool DurationInterface::IsFirstInBeam( Object *noteOrRest ) { - Beam *beam = reinterpret_cast( noteOrRest->GetFirstParent( BEAM, MAX_BEAM_DEPTH ) ); + Beam *beam = dynamic_cast( noteOrRest->GetFirstParent( BEAM, MAX_BEAM_DEPTH ) ); if ( !beam ) { return false; } @@ -134,7 +134,7 @@ bool DurationInterface::IsFirstInBeam( Object *noteOrRest ) bool DurationInterface::IsLastInBeam( Object *noteOrRest ) { - Beam *beam = reinterpret_cast( noteOrRest->GetFirstParent( BEAM, MAX_BEAM_DEPTH ) ); + Beam *beam = dynamic_cast( noteOrRest->GetFirstParent( BEAM, MAX_BEAM_DEPTH ) ); if ( !beam ) { return false; } diff --git a/src/editorial.cpp b/src/editorial.cpp index 2d763080179..da7f26c3453 100644 --- a/src/editorial.cpp +++ b/src/editorial.cpp @@ -90,8 +90,10 @@ void EditorialElement::AddMeasureElement( MeasureElement *child ) child->SetParent( this ); m_children.push_back( child ); Modify(); - if ( dynamic_cast(child) && dynamic_cast(child)->GetN() < 1 ) { - LogError("Staff without @n is not supported within editorial markup element"); + if ( child->Is() == STAFF ) { + Staff *staff = dynamic_cast(child); + assert( staff ); + if ( staff->GetN() < 1 ) LogError("Staff without @n is not supported within editorial markup element"); } } @@ -140,7 +142,6 @@ App::~App() void App::AddLemOrRdg(EditorialElement *child) { assert( dynamic_cast(child) || dynamic_cast(child) ); - child->SetParent( this ); m_children.push_back(child); Modify(); @@ -259,6 +260,7 @@ int EditorialElement::CastOffSystems( ArrayPtrVoid *params ) // from the content System because this screws up the iterator. Relinquish gives up // the ownership of the Measure - the contentSystem will be deleted afterwards. EditorialElement *editorialElement = dynamic_cast( contentSystem->Relinquish( this->GetIdx()) ); + assert( editorialElement ); (*currentSystem)->AddEditorialElement( editorialElement ); return FUNCTOR_SIBLINGS; diff --git a/src/io.cpp b/src/io.cpp index a73c04fd2b5..cdb7ba0f615 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -21,14 +21,14 @@ namespace vrv { FileOutputStream::FileOutputStream( Doc *doc, std::string filename ) : std::ofstream( filename.c_str() ) { - assert(doc); // Document cannot be NULL" + assert(doc); m_doc = doc; } FileOutputStream::FileOutputStream( Doc *doc ) : std::ofstream( ) { - assert(doc); // Document cannot be NULL" + assert(doc); m_doc = doc; } @@ -48,7 +48,7 @@ FileOutputStream::~FileOutputStream() FileInputStream::FileInputStream( Doc *doc, std::string filename ) : std::ifstream( filename.c_str() ) { - assert(doc); // Document cannot be NULL" + assert(doc); m_doc = doc; Init(); @@ -58,7 +58,7 @@ FileInputStream::FileInputStream( Doc *doc, std::string filename ) : FileInputStream::FileInputStream( Doc *doc ) : std::ifstream( ) { - assert(doc); // Document cannot be NULL" + assert(doc); m_doc = doc; Init(); } diff --git a/src/iomei.cpp b/src/iomei.cpp index c5a635a8272..e1821a47751 100644 --- a/src/iomei.cpp +++ b/src/iomei.cpp @@ -79,7 +79,7 @@ bool MeiOutput::ExportFile( ) LogError("Page %d does not exist", m_page ); return false; } - Page *page = dynamic_cast(m_doc->m_children[m_page]); + Page *page = dynamic_cast(m_doc->m_children.at(m_page)); assert( page ); if (m_scoreBasedMEI) { m_currentNode = meiDoc.append_child("score"); @@ -120,159 +120,159 @@ std::string MeiOutput::GetOutput( int page ) bool MeiOutput::WriteObject( Object *object ) { // Containers and scoreDef related - if (dynamic_cast(object)) { + if (object->Is() == DOC) { WriteMeiDoc( dynamic_cast(object) ); m_nodeStack.push_back(m_currentNode); return true; } - if (dynamic_cast(object)) { + if (object->Is() == PAGE) { if (!m_scoreBasedMEI) { m_currentNode = m_currentNode.append_child("page"); WriteMeiPage( m_currentNode, dynamic_cast(object) ); } // Here we could add a element } - else if (dynamic_cast(object)) { + else if (object->Is() == SYSTEM) { if (!m_scoreBasedMEI) { m_currentNode = m_currentNode.append_child("system"); WriteMeiSystem( m_currentNode, dynamic_cast(object) ); } // Here we could add a element (but not for the first system of the page?) } - else if (dynamic_cast(object)) { + else if (object->Is() == SCORE_DEF) { m_currentNode = m_currentNode.append_child("scoreDef"); WriteMeiScoreDef( m_currentNode, dynamic_cast(object) ); } - else if (dynamic_cast(object)) { + else if (object->Is() == STAFF_GRP) { m_currentNode = m_currentNode.append_child("staffGrp"); WriteMeiStaffGrp( m_currentNode, dynamic_cast(object) ); } - else if (dynamic_cast(object)) { + else if (object->Is() == STAFF_DEF) { m_currentNode = m_currentNode.append_child("staffDef"); WriteMeiStaffDef( m_currentNode, dynamic_cast(object) ); } - else if (dynamic_cast(object)) { + else if (object->Is() == MEASURE) { m_currentNode = m_currentNode.append_child("measure"); WriteMeiMeasure( m_currentNode, dynamic_cast(object) ); } - else if (dynamic_cast(object)) { + else if (object->Is() == STAFF) { m_currentNode = m_currentNode.append_child("staff"); WriteMeiStaff( m_currentNode, dynamic_cast(object) ); } - else if (dynamic_cast(object)) { + else if (object->Is() == LAYER) { m_currentNode = m_currentNode.append_child("layer"); WriteMeiLayer( m_currentNode, dynamic_cast(object) ); } // Measure elements - else if (dynamic_cast(object)) { + else if (object->Is() == SLUR) { m_currentNode = m_currentNode.append_child("slur"); WriteMeiSlur( m_currentNode, dynamic_cast(object) ); } - else if (dynamic_cast(object)) { + else if (object->Is() == TEMPO) { m_currentNode = m_currentNode.append_child("tempo"); WriteMeiTempo( m_currentNode, dynamic_cast(object) ); } - else if (dynamic_cast(object)) { + else if (object->Is() == TIE) { m_currentNode = m_currentNode.append_child("tie"); WriteMeiTie( m_currentNode, dynamic_cast(object) ); } // Layer elements - else if (dynamic_cast(object)) { + else if (object->Is() == ACCID) { m_currentNode = m_currentNode.append_child("accid"); WriteMeiAccid( m_currentNode, dynamic_cast(object) ); } - else if (dynamic_cast(object)) { + else if (object->Is() == BAR_LINE) { m_currentNode = m_currentNode.append_child( "barLine" ); WriteMeiBarline( m_currentNode, dynamic_cast(object) ); } - else if (dynamic_cast(object)) { + else if (object->Is() == BEAM) { m_currentNode = m_currentNode.append_child("beam"); WriteMeiBeam( m_currentNode, dynamic_cast(object) ); } - else if (dynamic_cast(object)) { + else if (object->Is() == CHORD) { m_currentNode = m_currentNode.append_child( "chord" ); WriteMeiChord( m_currentNode, dynamic_cast(object) ); } - else if (dynamic_cast(object)) { + else if (object->Is() == CLEF) { m_currentNode = m_currentNode.append_child("clef"); WriteMeiClef( m_currentNode, dynamic_cast(object) ); } - else if (dynamic_cast(object)) { + else if (object->Is() == CUSTOS) { m_currentNode = m_currentNode.append_child( "custos" ); WriteMeiCustos( m_currentNode, dynamic_cast(object) ); } - else if (dynamic_cast(object)) { + else if (object->Is() == DOT) { m_currentNode = m_currentNode.append_child( "dot" ); WriteMeiDot( m_currentNode, dynamic_cast(object) ); } - else if (dynamic_cast(object)) { + else if (object->Is() == KEY_SIG) { m_currentNode = m_currentNode.append_child("keySig"); WriteMeiKeySig( m_currentNode, dynamic_cast(object) ); } - else if (dynamic_cast(object)) { + else if (object->Is() == MENSUR) { m_currentNode = m_currentNode.append_child("mensur"); WriteMeiMensur( m_currentNode, dynamic_cast(object) ); } - else if (dynamic_cast(object)) { + else if (object->Is() == METER_SIG) { m_currentNode = m_currentNode.append_child("meterSig"); WriteMeiMeterSig( m_currentNode, dynamic_cast(object) ); } - else if (dynamic_cast(object)) { + else if (object->Is() == MREST) { m_currentNode = m_currentNode.append_child("mRest"); WriteMeiMRest( m_currentNode, dynamic_cast(object) ); } - else if (dynamic_cast(object)) { + else if (object->Is() == MULTI_REST) { m_currentNode = m_currentNode.append_child("multiRest"); WriteMeiMultiRest( m_currentNode, dynamic_cast(object) ); } - else if (dynamic_cast(object)) { + else if (object->Is() == NOTE) { m_currentNode = m_currentNode.append_child("note"); WriteMeiNote( m_currentNode, dynamic_cast(object) ); } - else if (dynamic_cast(object)) { + else if (object->Is() == REST) { m_currentNode = m_currentNode.append_child("rest"); WriteMeiRest( m_currentNode, dynamic_cast(object) ); } - else if (dynamic_cast(object)) { + else if (object->Is() == SPACE) { m_currentNode = m_currentNode.append_child("space"); WriteMeiSpace( m_currentNode, dynamic_cast(object) ); } - else if (dynamic_cast(object)) { + else if (object->Is() == TUPLET) { m_currentNode = m_currentNode.append_child("tuplet"); WriteMeiTuplet( m_currentNode, dynamic_cast(object) ); } // others - else if (dynamic_cast(object)) { + else if (object->Is() == VERSE) { m_currentNode = m_currentNode.append_child("verse"); WriteMeiVerse( m_currentNode, dynamic_cast(object) ); } - else if (dynamic_cast(object)) { + else if (object->Is() == SYL) { m_currentNode = m_currentNode.append_child("syl"); WriteMeiSyl( m_currentNode, dynamic_cast(object) ); } // Editorial markup - else if (dynamic_cast(object)) { + else if (object->Is() == APP) { m_currentNode = m_currentNode.append_child("app"); WriteMeiApp( m_currentNode, dynamic_cast(object) ); } - else if (dynamic_cast(object)) { + else if (object->Is() == LEM) { m_currentNode = m_currentNode.append_child("lem"); WriteMeiLem( m_currentNode, dynamic_cast(object) ); } - else if (dynamic_cast(object)) { + else if (object->Is() == RDG) { m_currentNode = m_currentNode.append_child("rdg"); WriteMeiRdg( m_currentNode, dynamic_cast(object) ); } - else if (dynamic_cast(object)) { + else if (object->Is() == SUPPLIED) { m_currentNode = m_currentNode.append_child("supplied"); WriteMeiSupplied( m_currentNode, dynamic_cast(object) ); } - else if (dynamic_cast(object)) { + else if (object->Is() == ANNOT) { m_currentNode = m_currentNode.append_child("annot"); WriteMeiAnnot( m_currentNode, dynamic_cast(object) ); } @@ -307,6 +307,7 @@ std::string MeiOutput::UuidToMeiStr( Object *element ) bool MeiOutput::WriteMeiDoc( Doc *doc ) { + assert( doc ); assert( !m_mei.empty() ); // ---- header ---- @@ -360,6 +361,8 @@ bool MeiOutput::WriteMeiDoc( Doc *doc ) bool MeiOutput::WriteMeiPage( pugi::xml_node currentNode, Page *page ) { + assert( page ); + currentNode.append_attribute( "xml:id" ) = UuidToMeiStr( page ).c_str(); // size and margins but only if any - we rely on page.height only to check this if ( page->m_pageHeight != -1 ) { @@ -377,6 +380,8 @@ bool MeiOutput::WriteMeiPage( pugi::xml_node currentNode, Page *page ) bool MeiOutput::WriteMeiSystem( pugi::xml_node currentNode, System *system ) { + assert( system ); + currentNode.append_attribute( "xml:id" ) = UuidToMeiStr( system ).c_str(); // margins currentNode.append_attribute( "system.leftmar" ) = StringFormat( "%d", system->m_systemLeftMar ).c_str(); @@ -391,6 +396,8 @@ bool MeiOutput::WriteMeiSystem( pugi::xml_node currentNode, System *system ) bool MeiOutput::WriteMeiScoreDef( pugi::xml_node currentNode, ScoreDef *scoreDef ) { + assert( scoreDef ); + currentNode.append_attribute( "xml:id" ) = UuidToMeiStr( scoreDef ).c_str(); if (scoreDef->GetClefAttr()) { scoreDef->GetClefAttr()->WriteCleffingLog(currentNode); @@ -413,6 +420,8 @@ bool MeiOutput::WriteMeiScoreDef( pugi::xml_node currentNode, ScoreDef *scoreDef bool MeiOutput::WriteMeiStaffGrp( pugi::xml_node currentNode, StaffGrp *staffGrp ) { + assert( staffGrp ); + currentNode.append_attribute( "xml:id" ) = UuidToMeiStr( staffGrp ).c_str(); if ( staffGrp->GetSymbol() != STAFFGRP_NONE ) { currentNode.append_attribute( "symbol" ) = StaffGrpSymbolToStr( staffGrp->GetSymbol() ).c_str(); @@ -426,6 +435,8 @@ bool MeiOutput::WriteMeiStaffGrp( pugi::xml_node currentNode, StaffGrp *staffGrp bool MeiOutput::WriteMeiStaffDef( pugi::xml_node currentNode, StaffDef *staffDef ) { + assert( staffDef ); + currentNode.append_attribute( "xml:id" ) = UuidToMeiStr( staffDef ).c_str(); staffDef->WriteCommon(currentNode); @@ -452,6 +463,8 @@ bool MeiOutput::WriteMeiStaffDef( pugi::xml_node currentNode, StaffDef *staffDef bool MeiOutput::WriteMeiMeasure( pugi::xml_node currentNode, Measure *measure ) { + assert( measure ); + currentNode.append_attribute( "xml:id" ) = UuidToMeiStr( measure ).c_str(); measure->WriteCommon(currentNode); @@ -466,6 +479,8 @@ bool MeiOutput::WriteMeiMeasure( pugi::xml_node currentNode, Measure *measure ) void MeiOutput::WriteMeiTie( pugi::xml_node currentNode, Tie *tie ) { + assert( tie ); + currentNode.append_attribute( "xml:id" ) = UuidToMeiStr( tie ).c_str(); WriteTimeSpanningInterface(currentNode, tie); @@ -475,6 +490,8 @@ void MeiOutput::WriteMeiTie( pugi::xml_node currentNode, Tie *tie ) void MeiOutput::WriteMeiSlur( pugi::xml_node currentNode, Slur *slur ) { + assert( slur ); + currentNode.append_attribute( "xml:id" ) = UuidToMeiStr( slur ).c_str(); WriteTimeSpanningInterface(currentNode, slur); @@ -484,6 +501,8 @@ void MeiOutput::WriteMeiSlur( pugi::xml_node currentNode, Slur *slur ) bool MeiOutput::WriteMeiStaff( pugi::xml_node currentNode, Staff *staff ) { + assert( staff ); + currentNode.append_attribute( "xml:id" ) = UuidToMeiStr( staff ).c_str(); staff->WriteCommon(currentNode); @@ -501,6 +520,8 @@ bool MeiOutput::WriteMeiStaff( pugi::xml_node currentNode, Staff *staff ) bool MeiOutput::WriteMeiLayer( pugi::xml_node currentNode, Layer *layer ) { + assert( layer ); + currentNode.append_attribute( "xml:id" ) = UuidToMeiStr( layer ).c_str(); layer->WriteCommon(currentNode); @@ -510,6 +531,8 @@ bool MeiOutput::WriteMeiLayer( pugi::xml_node currentNode, Layer *layer ) void MeiOutput::WriteLayerElement( pugi::xml_node currentNode, LayerElement *element ) { + assert( element ); + this->WriteSameAsAttr( currentNode, element ); currentNode.append_attribute( "xml:id" ) = UuidToMeiStr( element ).c_str(); @@ -521,6 +544,8 @@ void MeiOutput::WriteLayerElement( pugi::xml_node currentNode, LayerElement *ele void MeiOutput::WriteMeiAccid( pugi::xml_node currentNode, Accid *accid ) { + assert( accid ); + WriteLayerElement( currentNode, accid ); WritePositionInterface(currentNode, accid); accid->WriteAccidental(currentNode); @@ -529,6 +554,8 @@ void MeiOutput::WriteMeiAccid( pugi::xml_node currentNode, Accid *accid ) void MeiOutput::WriteMeiBarline( pugi::xml_node currentNode, Barline *barLine ) { + assert( barLine ); + WriteLayerElement( currentNode, barLine ); barLine->WriteBarLineLog(currentNode); return; @@ -537,12 +564,16 @@ void MeiOutput::WriteMeiBarline( pugi::xml_node currentNode, Barline *barLine ) void MeiOutput::WriteMeiBeam( pugi::xml_node currentNode, Beam *beam ) { + assert( beam ); + WriteLayerElement( currentNode, beam ); return; } void MeiOutput::WriteMeiChord( pugi::xml_node currentNode, Chord *chord ) { + assert( chord ); + WriteLayerElement( currentNode, chord ); WriteDurationInterface( currentNode, chord); chord->WriteCommon(currentNode); @@ -554,6 +585,8 @@ void MeiOutput::WriteMeiChord( pugi::xml_node currentNode, Chord *chord ) void MeiOutput::WriteMeiClef( pugi::xml_node currentNode, Clef *clef ) { + assert( clef ); + WriteLayerElement( currentNode, clef ); clef->WriteClefshape(currentNode); clef->WriteLineloc(currentNode); @@ -563,18 +596,24 @@ void MeiOutput::WriteMeiClef( pugi::xml_node currentNode, Clef *clef ) void MeiOutput::WriteMeiCustos( pugi::xml_node currentNode, Custos *custos ) { + assert( custos ); + WriteLayerElement( currentNode, custos ); WritePositionInterface(currentNode, custos); } void MeiOutput::WriteMeiDot( pugi::xml_node currentNode, Dot *dot ) { + assert( dot ); + WriteLayerElement( currentNode, dot ); WritePositionInterface(currentNode, dot); } void MeiOutput::WriteMeiKeySig( pugi::xml_node currentNode, KeySig *keySig ) { + assert( keySig ); + WriteLayerElement( currentNode, keySig ); keySig->WriteAccidental(currentNode); keySig->WritePitch(currentNode); @@ -583,6 +622,8 @@ void MeiOutput::WriteMeiKeySig( pugi::xml_node currentNode, KeySig *keySig ) void MeiOutput::WriteMeiMensur( pugi::xml_node currentNode, Mensur *mensur ) { + assert( mensur ); + WriteLayerElement( currentNode, mensur ); mensur->WriteDurationRatio(currentNode); mensur->WriteMensuralShared(currentNode); @@ -594,6 +635,8 @@ void MeiOutput::WriteMeiMensur( pugi::xml_node currentNode, Mensur *mensur ) void MeiOutput::WriteMeiMeterSig( pugi::xml_node currentNode, MeterSig *meterSig ) { + assert( meterSig ); + WriteLayerElement( currentNode, meterSig ); meterSig->WriteMeterSigLog(currentNode); return; @@ -602,12 +645,16 @@ void MeiOutput::WriteMeiMeterSig( pugi::xml_node currentNode, MeterSig *meterSig void MeiOutput::WriteMeiMRest( pugi::xml_node currentNode, MRest *mRest ) { + assert( mRest ); + WriteLayerElement( currentNode, mRest ); return; } void MeiOutput::WriteMeiMultiRest( pugi::xml_node currentNode, MultiRest *multiRest ) { + assert( multiRest ); + WriteLayerElement( currentNode, multiRest ); multiRest->WriteNumbered(currentNode); return; @@ -615,6 +662,8 @@ void MeiOutput::WriteMeiMultiRest( pugi::xml_node currentNode, MultiRest *multiR void MeiOutput::WriteMeiNote( pugi::xml_node currentNode, Note *note ) { + assert( note ); + WriteLayerElement( currentNode, note ); WriteDurationInterface(currentNode, note); WritePitchInterface(currentNode, note); @@ -629,6 +678,8 @@ void MeiOutput::WriteMeiNote( pugi::xml_node currentNode, Note *note ) void MeiOutput::WriteMeiRest( pugi::xml_node currentNode, Rest *rest ) { + assert( rest ); + WriteLayerElement( currentNode, rest ); WriteDurationInterface(currentNode, rest); WritePositionInterface(currentNode, rest); @@ -637,6 +688,8 @@ void MeiOutput::WriteMeiRest( pugi::xml_node currentNode, Rest *rest ) void MeiOutput::WriteMeiSpace( pugi::xml_node currentNode, Space *space ) { + assert( space ); + WriteLayerElement( currentNode, space ); WriteDurationInterface(currentNode, space); return; @@ -644,6 +697,8 @@ void MeiOutput::WriteMeiSpace( pugi::xml_node currentNode, Space *space ) void MeiOutput::WriteMeiTuplet( pugi::xml_node currentNode, Tuplet *tuplet ) { + assert( tuplet ); + WriteLayerElement( currentNode, tuplet ); tuplet->WriteDurationRatio( currentNode ); return; @@ -652,6 +707,8 @@ void MeiOutput::WriteMeiTuplet( pugi::xml_node currentNode, Tuplet *tuplet ) void MeiOutput::WriteMeiVerse( pugi::xml_node currentNode, Verse *verse ) { + assert( verse ); + currentNode.append_attribute( "xml:id" ) = UuidToMeiStr( verse ).c_str(); verse->WriteCommon( currentNode ); return; @@ -659,6 +716,8 @@ void MeiOutput::WriteMeiVerse( pugi::xml_node currentNode, Verse *verse ) void MeiOutput::WriteMeiSyl( pugi::xml_node currentNode, Syl *syl ) { + assert( syl ); + currentNode.append_attribute( "xml:id" ) = UuidToMeiStr( syl ).c_str(); syl->WriteTypography( currentNode ); syl->WriteSylLog( currentNode ); @@ -668,6 +727,8 @@ void MeiOutput::WriteMeiSyl( pugi::xml_node currentNode, Syl *syl ) void MeiOutput::WriteMeiTempo( pugi::xml_node currentNode, MeasureTempo *tempo ) { + assert( tempo ); + currentNode.append_attribute( "xml:id" ) = UuidToMeiStr( tempo ).c_str(); WriteTempoInterface(currentNode, tempo); WriteText( currentNode, tempo ); @@ -676,6 +737,8 @@ void MeiOutput::WriteMeiTempo( pugi::xml_node currentNode, MeasureTempo *tempo ) void MeiOutput::WriteDurationInterface(pugi::xml_node element, vrv::DurationInterface *interface) { + assert( interface ); + interface->WriteAugmentdots(element); interface->WriteBeamsecondary(element); interface->WriteDurationMusical(element); @@ -687,6 +750,8 @@ void MeiOutput::WriteDurationInterface(pugi::xml_node element, vrv::DurationInte void MeiOutput::WritePitchInterface(pugi::xml_node element, vrv::PitchInterface *interface) { + assert( interface ); + interface->WriteAccidental(element); interface->WriteOctave(element); interface->WritePitch(element); @@ -694,16 +759,22 @@ void MeiOutput::WritePitchInterface(pugi::xml_node element, vrv::PitchInterface void MeiOutput::WritePositionInterface(pugi::xml_node element, vrv::PositionInterface *interface) { + assert( interface ); + interface->WriteStafflocPitched(element); } void MeiOutput::WriteTempoInterface( pugi::xml_node element, vrv::TempoInterface *interface) { + assert( interface ); + WriteTextDirInterface(element, interface); } void MeiOutput::WriteTextDirInterface(pugi::xml_node element, vrv::TextDirInterface *interface) { + assert( interface ); + interface->WriteCommon(element); interface->WritePlacement(element); interface->WriteStaffident(element); @@ -711,6 +782,8 @@ void MeiOutput::WriteTextDirInterface(pugi::xml_node element, vrv::TextDirInterf void MeiOutput::WriteTimeSpanningInterface(pugi::xml_node element, vrv::TimeSpanningInterface *interface) { + assert( interface ); + interface->WriteStartendid(element); interface->WriteStartid(element); } @@ -740,6 +813,8 @@ void MeiOutput::WriteText( pugi::xml_node element, Object *object ) void MeiOutput::WriteEditorialElement( pugi::xml_node currentNode, EditorialElement *element ) { + assert( element ); + this->WriteSameAsAttr( currentNode, element ); currentNode.append_attribute( "xml:id" ) = UuidToMeiStr( element ).c_str(); element->WriteCommon( currentNode ); @@ -747,12 +822,16 @@ void MeiOutput::WriteEditorialElement( pugi::xml_node currentNode, EditorialElem bool MeiOutput::WriteMeiApp( pugi::xml_node currentNode, App *app ) { + assert( app ); + WriteEditorialElement(currentNode, app); return true; }; bool MeiOutput::WriteMeiLem( pugi::xml_node currentNode, Lem *lem ) { + assert( lem ); + WriteEditorialElement(currentNode, lem); lem->WriteSource( currentNode ); return true; @@ -760,6 +839,8 @@ bool MeiOutput::WriteMeiLem( pugi::xml_node currentNode, Lem *lem ) bool MeiOutput::WriteMeiRdg( pugi::xml_node currentNode, Rdg *rdg ) { + assert( rdg ); + WriteEditorialElement(currentNode, rdg); rdg->WriteSource( currentNode ); return true; @@ -767,6 +848,8 @@ bool MeiOutput::WriteMeiRdg( pugi::xml_node currentNode, Rdg *rdg ) bool MeiOutput::WriteMeiSupplied( pugi::xml_node currentNode, Supplied *supplied ) { + assert( supplied ); + WriteEditorialElement(currentNode, supplied); supplied->WriteSource( currentNode ); return true; @@ -774,6 +857,8 @@ bool MeiOutput::WriteMeiSupplied( pugi::xml_node currentNode, Supplied *supplied bool MeiOutput::WriteMeiAnnot( pugi::xml_node currentNode, Annot *annot ) { + assert( annot ); + WriteEditorialElement(currentNode, annot); annot->WritePlist(currentNode); annot->WriteSource(currentNode); @@ -876,13 +961,12 @@ bool MeiInput::ImportString( const std::string mei ) } } -bool MeiInput::IsAllowed(std::string element, vrv::Object *filterParent) +bool MeiInput::IsAllowed(std::string element, Object *filterParent) { if (!filterParent) { return true; } - const std::type_info *elementType = &typeid(*filterParent); // editorial if ( element == "app" ) { return true; @@ -894,7 +978,7 @@ bool MeiInput::IsAllowed(std::string element, vrv::Object *filterParent) return true; } // filter for notes - else if (*elementType == typeid(Note)) + else if (filterParent->Is() == NOTE) { if ( element == "accid" ) return true; else if ( element == "syl" ) return true; @@ -902,7 +986,7 @@ bool MeiInput::IsAllowed(std::string element, vrv::Object *filterParent) else return false; } // filter for Verse - else if (*elementType == typeid(Verse)) + else if (filterParent->Is() == VERSE) { if ( element == "syl" ) return true; else return false; @@ -1068,8 +1152,10 @@ bool MeiInput::ReadMeiSystem( Object *parent, pugi::xml_node system ) } // This could me moved to an AddSystem method for consistency with AddLayerElement - if ( dynamic_cast( parent ) ) { - dynamic_cast( parent )->AddSystem( vrvSystem ); + if ( parent->Is() == PAGE ) { + Page *page = dynamic_cast( parent ); + assert( page ); + page->AddSystem( vrvSystem ); } ReadMeiSystemChildren(vrvSystem, system); @@ -1105,9 +1191,11 @@ bool MeiInput::ReadMeiSystemChildren( Object *parent, pugi::xml_node parentNode // unmeasured music else if ( parentNode.child( "staff" ) ) { if (!unmeasured) { - if ( dynamic_cast( parent ) ) { + if ( parent->Is() == SYSTEM ) { + System *system = dynamic_cast( parent ); + assert( system ); unmeasured = new Measure( false ); - dynamic_cast( parent )->AddMeasure(unmeasured); + system->AddMeasure(unmeasured); } else { LogError( "Unmeasured music within editorial markup is currently not supported" ); @@ -1119,7 +1207,7 @@ bool MeiInput::ReadMeiSystemChildren( Object *parent, pugi::xml_node parentNode else if ( parentNode.child( "measure" ) ) { // we should not mix measured and unmeasured within a system... assert(!unmeasured); - if ( dynamic_cast( parent ) ) { + if ( parent->IsEditorialElement() ) { if ( !m_ignoreLayoutInformation ) { LogError( "Cannot have within editorial markup unless layout information \ is ignored and continous layout is chosen (try with --no-layout)" ); @@ -1294,11 +1382,15 @@ bool MeiInput::ReadMeiStaffDef( Object *parent, pugi::xml_node staffDef ) } // This could me moved to an AddMeasure method for consistency with AddLayerElement - if ( dynamic_cast( parent ) ) { - dynamic_cast( parent )->AddStaffDef(vrvStaffDef); + if ( parent->Is() == STAFF_GRP ) { + StaffGrp *staffGrp = dynamic_cast( parent ); + assert( staffGrp ); + staffGrp->AddStaffDef(vrvStaffDef); } - else if ( dynamic_cast( parent ) ) { - dynamic_cast( parent )->AddStaffDef(vrvStaffDef); + else if ( parent->IsEditorialElement() ) { + EditorialElement *element = dynamic_cast( parent ); + assert( element ); + element->AddStaffDef(vrvStaffDef); } return true; @@ -1317,11 +1409,15 @@ bool MeiInput::ReadMeiMeasure( Object *parent, pugi::xml_node measure ) vrvMeasure->SetRightBarlineType( vrvMeasure->GetRight() ); // This could me moved to an AddMeasure method for consistency with AddLayerElement - if ( dynamic_cast( parent ) ) { - dynamic_cast( parent )->AddMeasure(vrvMeasure); + if ( parent->Is() == SYSTEM ) { + System *system = dynamic_cast( parent ); + assert( system ); + system->AddMeasure(vrvMeasure); } - else if ( dynamic_cast( parent ) ) { - dynamic_cast( parent )->AddMeasure(vrvMeasure); + else if ( parent->IsEditorialElement() ) { + EditorialElement *element = dynamic_cast( parent ); + assert( element ); + element->AddMeasure(vrvMeasure); } return ReadMeiMeasureChildren(vrvMeasure, measure); @@ -1462,11 +1558,15 @@ bool MeiInput::ReadMeiLayer( Object *parent, pugi::xml_node layer ) } // This could me moved to an AddLayer method for consistency with AddLayerElement - if ( dynamic_cast( parent ) ) { - dynamic_cast( parent )->AddLayer( vrvLayer ); + if ( parent->Is() == STAFF ) { + Staff *staff = dynamic_cast( parent ); + assert( staff ); + staff->AddLayer( vrvLayer ); } - else if ( dynamic_cast( parent ) ) { - dynamic_cast( parent )->AddLayer( vrvLayer ); + else if ( parent->IsEditorialElement() ) { + EditorialElement *element = dynamic_cast( parent ); + assert( element ); + element->AddLayer( vrvLayer ); } return ReadMeiLayerChildren( vrvLayer, layer ); @@ -2081,11 +2181,15 @@ void MeiInput::AddScoreDef(Object *parent, ScoreDef *scoreDef) if (!m_hasScoreDef) { m_hasScoreDef = true; } - else if ( dynamic_cast( parent ) ) { - dynamic_cast( parent )->AddScoreDef( scoreDef ); + else if ( parent->IsEditorialElement() ) { + EditorialElement *element = dynamic_cast( parent ); + assert( element ); + element->AddScoreDef( scoreDef ); } - else if ( dynamic_cast( parent ) ) { - dynamic_cast( parent )->AddScoreDef( scoreDef ); + else if ( parent->Is() == SYSTEM ) { + System *system = dynamic_cast( parent ); + assert( system ); + system->AddScoreDef( scoreDef ); } else { LogWarning("'%s' not supported within '%s'", scoreDef->GetClassName().c_str(), parent->GetClassName().c_str() ); @@ -2093,15 +2197,17 @@ void MeiInput::AddScoreDef(Object *parent, ScoreDef *scoreDef) } } -void MeiInput::AddStaffGrp(Object *parent, StaffGrp *staffGrp) +void MeiInput::AddStaffGrp(Object *parent, StaffGrp *staffGrp ) { - if ( dynamic_cast( parent ) ) { - dynamic_cast( parent )->AddStaffGrp( staffGrp ); + if ( parent->IsEditorialElement() ) { + EditorialElement *element = dynamic_cast( parent ); + assert( element ); + element->AddStaffGrp( staffGrp ); } - else if ( dynamic_cast( parent ) ) { + else if ( parent->Is() == SCORE_DEF ) { dynamic_cast( parent )->AddStaffGrp( staffGrp ); } - else if ( dynamic_cast( parent ) ) { + else if ( parent->Is() == STAFF_GRP ) { dynamic_cast( parent )->AddStaffGrp( staffGrp ); } else { @@ -2112,26 +2218,40 @@ void MeiInput::AddStaffGrp(Object *parent, StaffGrp *staffGrp) void MeiInput::AddLayerElement( Object *parent, LayerElement *element ) { - if ( dynamic_cast( parent ) ) { - dynamic_cast( parent )->AddLayerElement( element ); - } - else if ( dynamic_cast( parent ) ) { - dynamic_cast( parent )->AddLayerElement( element ); - } - else if ( dynamic_cast( parent ) ) { - dynamic_cast( parent )->AddLayerElement( element ); - } - else if ( dynamic_cast( parent ) ) { - dynamic_cast( parent )->AddLayerElement( element ); - } - else if ( dynamic_cast( parent ) ) { - dynamic_cast( parent )->AddLayerElement( element ); - } - else if ( dynamic_cast( parent ) ) { - dynamic_cast( parent )->AddLayerElement( element ); - } - else if ( dynamic_cast( parent ) ) { - dynamic_cast( parent )->AddLayerElement( element ); + if ( parent->IsEditorialElement() ) { + EditorialElement *editorialElement = dynamic_cast( parent ); + assert( editorialElement ); + editorialElement->AddLayerElement( element ); + } + else if ( parent->Is() == LAYER ) { + Layer *layer = dynamic_cast( parent ); + assert( layer ); + layer->AddLayerElement( element ); + } + else if ( parent->Is() == CHORD ) { + Chord *chord = dynamic_cast( parent ); + assert( chord ); + chord->AddLayerElement( element ); + } + else if ( parent->Is() == NOTE ) { + Note *note = dynamic_cast( parent ); + assert( note ); + note->AddLayerElement( element ); + } + else if ( parent->Is() == BEAM ) { + Beam * beam = dynamic_cast( parent ); + assert( beam ); + beam->AddLayerElement( element ); + } + else if ( parent->Is() == TUPLET ) { + Tuplet *tuplet = dynamic_cast( parent ); + assert( tuplet ); + tuplet->AddLayerElement( element ); + } + else if ( parent->Is() == VERSE ) { + Verse *verse = dynamic_cast( parent ); + assert( verse ); + verse->AddLayerElement( element ); } else { LogWarning("'%s' not supported within '%s'", element->GetClassName().c_str(), parent->GetClassName().c_str() ); @@ -2141,11 +2261,15 @@ void MeiInput::AddLayerElement( Object *parent, LayerElement *element ) void MeiInput::AddMeasureElement(Object *parent, MeasureElement *element) { - if ( dynamic_cast( parent ) ) { - dynamic_cast( parent )->AddMeasureElement( element ); + if ( parent->IsEditorialElement() ) { + EditorialElement *editorialElement = dynamic_cast( parent ); + assert( editorialElement ); + editorialElement->AddMeasureElement( element ); } - else if ( dynamic_cast( parent ) ) { - dynamic_cast( parent )->AddMeasureElement( element ); + else if ( parent->Is() == MEASURE ) { + Measure *measure = dynamic_cast( parent ); + assert( measure ); + measure->AddMeasureElement( element ); } else { LogWarning("'%s' not supported within '%s'", element->GetClassName().c_str(), parent->GetClassName().c_str() ); @@ -2243,7 +2367,6 @@ bool MeiInput::ReadTupletSpanAsTuplet( Measure *measure, pugi::xml_node tupletSp if ( tupletSpan.attribute( "startid" ) ) { std::string refId = ExtractUuidFragment( tupletSpan.attribute( "startid" ).value() ); start = dynamic_cast( measure->FindChildByUuid( refId ) ); - if (!start) { LogWarning( "Element with @startid '%s' not found when trying to read the ", refId.c_str() ); } @@ -2252,7 +2375,6 @@ bool MeiInput::ReadTupletSpanAsTuplet( Measure *measure, pugi::xml_node tupletSp if ( tupletSpan.attribute( "endid" ) ) { std::string refId = ExtractUuidFragment( tupletSpan.attribute( "endid" ).value() ); end = dynamic_cast( measure->FindChildByUuid( refId ) ); - if (!end) { LogWarning( "Element with @endid '%s' not found when trying to read the ", refId.c_str() ); } @@ -2262,8 +2384,8 @@ bool MeiInput::ReadTupletSpanAsTuplet( Measure *measure, pugi::xml_node tupletSp return false; } - LayerElement *startChild = reinterpret_cast( start->GetLastParentNot( LAYER ) ); - LayerElement *endChild = reinterpret_cast( end->GetLastParentNot( LAYER ) ); + LayerElement *startChild = dynamic_cast( start->GetLastParentNot( LAYER ) ); + LayerElement *endChild = dynamic_cast( end->GetLastParentNot( LAYER ) ); if ( !startChild || !endChild || (startChild->m_parent != endChild->m_parent) ) { LogWarning( "Start and end elements for '%s' not in the same layer", tuplet->GetUuid().c_str() ); @@ -2272,13 +2394,15 @@ bool MeiInput::ReadTupletSpanAsTuplet( Measure *measure, pugi::xml_node tupletSp } Layer *parentLayer = dynamic_cast( startChild->m_parent ); + assert( parentLayer ); int startIdx = startChild->GetIdx(); int endIdx = endChild->GetIdx(); //LogDebug("%d %d %s!", startIdx, endIdx, start->GetUuid().c_str()); int i; for (i = endIdx; i >= startIdx; i--) { - tuplet->AddLayerElement( dynamic_cast( parentLayer->DetachChild(i) ) ); + LayerElement *element = dynamic_cast( parentLayer->DetachChild(i) ); + if (element) tuplet->AddLayerElement( element ); } tuplet->SetParent( parentLayer ); parentLayer->InsertChild( tuplet, startIdx ); diff --git a/src/iopae.cpp b/src/iopae.cpp index 6c795274305..20f80a73899 100644 --- a/src/iopae.cpp +++ b/src/iopae.cpp @@ -10,6 +10,7 @@ //---------------------------------------------------------------------------- +#include #include //---------------------------------------------------------------------------- @@ -1184,15 +1185,17 @@ void PaeInput::parseNote(NoteObject note) { // Acciaccaturas are similar but do not get beamed (do they) // this case is simpler. NOTE a note can not be acciacctura AND appoggiatura // Acciaccatura rests do not exist - if (note.acciaccatura && dynamic_cast(element)) { + if (note.acciaccatura && (element->Is() == NOTE) ) { Note *note = dynamic_cast(element); + assert( note ); note->SetDur(DURATION_8); note->SetGrace(GRACE_acc); note->SetStemDir(STEMDIRECTION_up); } - if (note.appoggiatura > 0) { + if ( (note.appoggiatura > 0) && (element->Is() == NOTE) ) { Note *note = dynamic_cast(element); + assert( note ); note->SetGrace(GRACE_unacc); note->SetStemDir(STEMDIRECTION_up); } @@ -1242,11 +1245,15 @@ void PaeInput::addLayerElement(LayerElement *element) { if (m_nested_objects.size() > 0) { LayerElement *bottom = m_nested_objects.back(); - if ( dynamic_cast( bottom ) ) { - ((Beam*)bottom)->AddLayerElement( element ); + if ( bottom->Is() == BEAM ) { + Beam *beam = dynamic_cast( bottom ); + assert( beam ); + beam->AddLayerElement( element ); } - else if ( dynamic_cast( bottom ) ) { - ((Tuplet*)bottom)->AddLayerElement( element ); + else if ( bottom->Is() == TUPLET ) { + Tuplet *tuplet = dynamic_cast( bottom ); + assert( tuplet ); + tuplet->AddLayerElement( element ); } } else { diff --git a/src/layer.cpp b/src/layer.cpp index 628e8d4f9f8..93992883ac5 100644 --- a/src/layer.cpp +++ b/src/layer.cpp @@ -155,48 +155,6 @@ void Layer::SetCurrentMeterSig( MeterSig *meterSig ) } } -LayerElement *Layer::Insert( LayerElement *element, int x ) -{ - if ( !element ) { - return NULL; - } - - LayerElement *insertElement = element->GetChildCopy(); - - // First we find the element after which we are inserting the element - // If not, it will be NULL - // We are also updating the section and measure ( TODO, not necessary for now ) - int idx = 0; - LayerElement *next = dynamic_cast( this->GetFirst() ); - while ( next && (next->GetDrawingX() < x) ) - { - idx++; - // update section and measure if necessary (no section breaks and measure breaks for now) - next = dynamic_cast( this->GetNext( ) ); - if ( !next ) { - break; - } - } - - // Insert in the logical tree - this works only for facsimile (transcription) encoding - insertElement->m_xAbs = x; - AddLayerElement( insertElement, idx ); - - Refresh(); - // - return insertElement; -} - - -void Layer::Insert( LayerElement *layerElement, LayerElement *before ) -{ - int idx = 0; - if ( before ) { - idx = this->GetChildIndex( before ); - } - AddLayerElement( layerElement , idx ); -} - void Layer::SetDrawingAndCurrentValues( ScoreDef *currentScoreDef, StaffDef *currentStaffDef ) { if (!currentStaffDef || !currentScoreDef) { @@ -243,34 +201,6 @@ void Layer::SetDrawingAndCurrentValues( ScoreDef *currentScoreDef, StaffDef *cur } } - -void Layer::Delete( LayerElement *element ) -{ - if ( !element ) { - return; - } - - bool is_clef = false; - - if ( element->IsClef() ) { - is_clef = true; - //m_r->OnBeginEditionClef(); - } - - - int pos = GetChildIndex( element ); - RemoveChildAt( pos ); - Modify(); - - if ( is_clef ) - { - //m_r->OnEndEditionClef(); - } - - Refresh(); -} - - Clef* Layer::GetClef( LayerElement *test ) { Object *testObject = test; @@ -281,13 +211,15 @@ Clef* Layer::GetClef( LayerElement *test ) //make sure list is set ResetList(this); - if ( !test->IsClef() ) + if ( test->Is() != CLEF ) { - testObject = GetListFirstBackward(testObject, &typeid(Clef)); + testObject = GetListFirstBackward(testObject, CLEF ); } - if ( dynamic_cast(testObject) ) { - return dynamic_cast(testObject); + if ( testObject && testObject->Is() == CLEF ) { + Clef *clef = dynamic_cast(testObject); + assert( clef ); + return clef; } return m_currentClef; @@ -300,71 +232,6 @@ int Layer::GetClefOffset( LayerElement *test ) return clef->GetClefOffset(); } - -void Layer::RemoveClefAndCustos() -{ - Clef *currentClef = NULL; - - int i; - int elementCount = this->GetElementCount(); - for (i = 0; i < elementCount; i++) - { - LayerElement *element = dynamic_cast( m_children[i] ); - if ( element && element->IsClef() ) { - Clef *clef = dynamic_cast( m_children[i] ); - // we remove the clef because it is the same as the previous one - if ( currentClef && ((*currentClef) == (*clef)) ) { - // check if it is a F clef with a Longa before - LayerElement *previous = dynamic_cast(m_children[i - 1]); - if ( (i > 0) && previous && previous->IsNote() ) - { - Note *note = dynamic_cast(m_children[i - 1]); - if ( note && (note->GetActualDur() == DUR_LG) ) - { - bool removeLonga = false; - // we check only for the pitch, not the octave, but should be enough - if ( (clef->GetClefId() == F3) && ( note->GetPname() == PITCHNAME_g ) ) - removeLonga = true; - else if ( (clef->GetClefId() == F4) && ( note->GetPname() == PITCHNAME_b ) ) - removeLonga = true; - else if ( (clef->GetClefId() == F5) && ( note->GetPname() == PITCHNAME_d ) ) - removeLonga = true; - if ( removeLonga ) { - this->Delete( note ); - elementCount--; - i--; - } - } - } - this->Delete( clef ); - elementCount--; - // now remove alterations (keys) - for (; i < elementCount; i++) { - Accid *accid = dynamic_cast(m_children[i]); - if ( accid ) { - this->Delete( accid ); - elementCount--; - i--; - } - else - break; - } - i--; - - } - else { - currentClef = clef; - } - } - else if ( element && element->IsCustos( ) ) { - Custos *custos = dynamic_cast( m_children[i] ); - this->Delete( custos ); - elementCount--; - i--; - } - } -} - //---------------------------------------------------------------------------- // Layer functor methods @@ -415,7 +282,7 @@ int Layer::AlignHorizontallyEnd( ArrayPtrVoid *params ) int i; for(i = 0; i < (int)(*measureAligner)->m_children.size(); i++) { - Alignment *alignment = dynamic_cast((*measureAligner)->m_children[i]); + Alignment *alignment = dynamic_cast((*measureAligner)->m_children.at(i)); if (alignment && alignment->HasGraceAligner()) { alignment->GetGraceAligner()->AlignStack(); } @@ -432,7 +299,7 @@ int Layer::PrepareProcessingLists( ArrayPtrVoid *params ) // Alternate solution with StaffN_LayerN_VerseN_t //StaffN_LayerN_VerseN_t *tree = static_cast((*params)[0]); - Staff *staff = reinterpret_cast( this->GetFirstParent( STAFF ) ); + Staff *staff = dynamic_cast( this->GetFirstParent( STAFF ) ); assert( staff ); tree->child[ staff->GetN() ].child[ this->GetN() ]; diff --git a/src/layerelement.cpp b/src/layerelement.cpp index e67f64f19a6..68e177ea2a0 100644 --- a/src/layerelement.cpp +++ b/src/layerelement.cpp @@ -89,129 +89,24 @@ LayerElement& LayerElement::operator=( const LayerElement& element ) } return *this; } - - -LayerElement *LayerElement::GetChildCopy( bool newUuid ) -{ - - // Is there another way to do this in C++ ? - // Yes, change this to the Object::Clone method - however, newUuid will not be possible in this way - LayerElement *element = NULL; - - if ( this->IsAccid() ) - element = new Accid( *(Accid*)this ); - else if ( this->IsBarline() ) - element = new Barline( *(Barline*)this ); - else if (this->IsClef() ) - element = new Clef( *(Clef*)this ); - else if (this->IsCustos() ) - element = new Custos( *(Custos*)this ); - else if (this->IsDot() ) - element = new Dot( *(Dot*)this ); - else if (this->IsMensur() ) - element = new Mensur( *(Mensur*)this ); - else if (this->IsNote() ) - element = new Note( *(Note*)this ); - else if (this->IsRest() ) - element = new Rest( *(Rest*)this ); - else { - LogDebug( "Missing %s", this->GetClassName().c_str() ); - assert( false ); // Copy of this type unimplemented - return NULL; - } - - element->m_parent = NULL; - - if ( !newUuid ) { - element->SetUuid( this->GetUuid() ); - } - else { - element->ResetUuid( ); - } - - return element; -} void LayerElement::ResetHorizontalAlignment() { m_drawingX = 0; m_alignment = NULL; - if ( this->IsNote() ) { - dynamic_cast(this)->ResetGraceAlignment(); + if (this->Is() == NOTE) { + Note *note = dynamic_cast(this); + assert( note ); + note->ResetGraceAlignment(); } } - -bool LayerElement::IsAccid( ) -{ - return (this->Is() == ACCID); -} - -bool LayerElement::IsBarline() -{ - return (this->Is() == BAR_LINE); -} - -bool LayerElement::IsBeam() -{ - return (this->Is() == BEAM); -} - -bool LayerElement::IsChord() -{ - return (this->Is() == CHORD); -} - -bool LayerElement::IsClef() -{ - return (this->Is() == CLEF); -} -bool LayerElement::IsCustos( ) -{ - return (this->Is() == CUSTOS); -} - -bool LayerElement::IsDot( ) -{ - return (this->Is() == DOT); -} - bool LayerElement::HasDurationInterface() { + return (this->HasInterface(INTERFACE_DURATION)); return (dynamic_cast(this)); } -bool LayerElement::IsKeySig() -{ - return (this->Is() == KEY_SIG); -} - - -bool LayerElement::IsMRest() -{ - return (this->Is() == MREST); -} - -bool LayerElement::IsMultiRest() -{ - return (this->Is() == MULTI_REST); -} - -bool LayerElement::IsMensur() -{ - return (this->Is() == MENSUR); -} - -bool LayerElement::IsMeterSig() -{ - return (this->Is() == METER_SIG); -} - -bool LayerElement::IsNote() -{ - return (this->Is() == NOTE); -} - bool LayerElement::IsGraceNote() { Note *note = dynamic_cast(this); @@ -219,49 +114,25 @@ bool LayerElement::IsGraceNote() } bool LayerElement::HasPitchInterface() -{ +{ + return (this->HasInterface(INTERFACE_PITCH)); return (dynamic_cast(this)); } bool LayerElement::HasPositionInterface() -{ - return (dynamic_cast(this)); -} - -bool LayerElement::IsRest() -{ - return (dynamic_cast(this)); -} - -bool LayerElement::IsSyl() -{ - return (dynamic_cast(this)); -} - -bool LayerElement::IsTie() -{ - return (dynamic_cast(this)); -} - -bool LayerElement::IsTuplet() { - return (dynamic_cast(this)); -} - -bool LayerElement::IsSpace() -{ - return (dynamic_cast(this)); -} - -bool LayerElement::IsVerse() -{ - return (dynamic_cast(this)); + return (this->HasInterface(INTERFACE_POSITION)); + return (dynamic_cast(this)); } bool LayerElement::IsCueSize() { - if (this->IsNote()) return dynamic_cast(this)->HasGrace(); - Note *note = reinterpret_cast(this->GetFirstParent( NOTE, MAX_ACCID_DEPTH ) ); + if ( this->Is() == NOTE ) { + Note *note = dynamic_cast(this); + assert( note ); + return ( note->HasGrace() ); + } + Note *note = dynamic_cast(this->GetFirstParent( NOTE, MAX_ACCID_DEPTH ) ); return ( note && ( note->HasGrace() ) ); } @@ -289,14 +160,15 @@ double LayerElement::GetAlignmentDuration( Mensur *mensur, MeterSig *meterSig, b } if ( HasDurationInterface() ) { - Tuplet *tuplet = reinterpret_cast( this->GetFirstParent( TUPLET, MAX_TUPLET_DEPTH ) ); int num = 1; int numbase = 1; + Tuplet *tuplet = dynamic_cast( this->GetFirstParent( TUPLET, MAX_TUPLET_DEPTH ) ); if ( tuplet ) { num = tuplet->GetNum(); numbase = tuplet->GetNumbase(); } DurationInterface *duration = dynamic_cast(this); + assert( duration ); if (duration->IsMensural()) return duration->GetAlignmentMensuralDuration( num, numbase, mensur ); else return duration->GetAlignmentDuration( num, numbase ); } @@ -332,7 +204,7 @@ int LayerElement::AlignHorizontally( ArrayPtrVoid *params ) this->ResetHorizontalAlignment(); - Chord* chordParent = reinterpret_cast(this->GetFirstParent( CHORD, MAX_CHORD_DEPTH)); + Chord* chordParent = dynamic_cast(this->GetFirstParent( CHORD, MAX_CHORD_DEPTH)); if( chordParent ) { m_alignment = chordParent->GetAlignment(); @@ -340,10 +212,10 @@ int LayerElement::AlignHorizontally( ArrayPtrVoid *params ) } AlignmentType type = ALIGNMENT_DEFAULT; - if ( this->IsBarline() ) { + if (this->Is() == BAR_LINE) { type = ALIGNMENT_BARLINE; } - else if ( this->IsClef() ) { + else if ( this->Is() == CLEF ) { if ( this->GetScoreOrStaffDefAttr() ) { type = ALIGNMENT_CLEF_ATTR; } @@ -351,7 +223,7 @@ int LayerElement::AlignHorizontally( ArrayPtrVoid *params ) type = ALIGNMENT_CLEF; } } - else if ( this->IsKeySig() ) { + else if (this->Is() == KEY_SIG) { if ( this->GetScoreOrStaffDefAttr() ) { type = ALIGNMENT_KEYSIG_ATTR; } @@ -359,36 +231,38 @@ int LayerElement::AlignHorizontally( ArrayPtrVoid *params ) type = ALIGNMENT_KEYSIG; } } - else if ( this->IsMensur() ) { + else if (this->Is() == MENSUR) { if ( this->GetScoreOrStaffDefAttr() ) { type = ALIGNMENT_MENSUR_ATTR; } else { // replace the current mensur (*currentMensur) = dynamic_cast(this); + assert( *currentMensur ); type = ALIGNMENT_MENSUR; } } - else if ( this->IsMeterSig() ) { + else if (this->Is() == METER_SIG) { if ( this->GetScoreOrStaffDefAttr() ) { type = ALIGNMENT_METERSIG_ATTR; } else { // replace the current meter signature (*currentMeterSig) = dynamic_cast(this); + assert( *currentMeterSig ); type = ALIGNMENT_METERSIG; } } - else if ( this->IsMultiRest() || this->IsMRest() ) { + else if ( (this->Is() == MULTI_REST) || (this->Is() == MREST) ) { type = ALIGNMENT_MULTIREST; } else if ( this->IsGraceNote() ) { type = ALIGNMENT_GRACENOTE; } - else if ( this->IsBeam() || this->IsTuplet() || this->IsVerse() || this->IsSyl() ) { + else if ((this->Is() == BEAM)|| (this->Is() == TUPLET) || (this->Is() == VERSE) || (this->Is() == SYL) ) { type = ALIGNMENT_CONTAINER; } - else if ( this->IsDot() ) { + else if (this->Is() == DOT) { type = ALIGNMENT_DOT; } @@ -520,14 +394,15 @@ int LayerElement::SetDrawingXY( ArrayPtrVoid *params ) } // Finally, adjust Y for notes and rests - if (dynamic_cast(this)) + if (this->Is() == NOTE) { Note *note = dynamic_cast(this); + assert( note ); this->SetDrawingY( this->GetDrawingY() + view->CalculatePitchPosY( staffY, note->GetPname(), layerY->GetClefOffset( layerElementY ), note->GetOct() ) ); } - else if (dynamic_cast(this)) { + else if (this->Is() == REST) { Rest *rest = dynamic_cast(this); - + assert( rest ); // Automatically calculate rest position, if so requested if (rest->GetPloc() == PITCHNAME_NONE) { this->SetDrawingY( this->GetDrawingY() + view->CalculateRestPosY( staffY, rest->GetActualDur()) ); diff --git a/src/measure.cpp b/src/measure.cpp index aaad543dcce..0179e5658fb 100644 --- a/src/measure.cpp +++ b/src/measure.cpp @@ -71,11 +71,14 @@ void Measure::AddMeasureElement( MeasureElement *element ) element->SetParent( this ); m_children.push_back( element ); - Staff *staff = dynamic_cast(element); - if ( staff && (staff->GetN() < 1) ) { - // This is not 100% safe if we have a and with more than - // one staff as a previous child. - staff->SetN( this->GetChildCount() ); + if (element->Is() == STAFF) { + Staff *staff = dynamic_cast(element); + assert( staff ); + if ( staff->GetN() < 1) { + // This is not 100% safe if we have a and with more than + // one staff as a previous child. + staff->SetN( this->GetChildCount() ); + } } } @@ -265,6 +268,7 @@ int Measure::CastOffSystems( ArrayPtrVoid *params ) // from the content System because this screws up the iterator. Relinquish gives up // the ownership of the Measure - the contentSystem will be deleted afterwards. Measure *measure = dynamic_cast( contentSystem->Relinquish( this->GetIdx()) ); + assert( measure ); (*currentSystem)->AddMeasure( measure ); return FUNCTOR_SIBLINGS; diff --git a/src/note.cpp b/src/note.cpp index 5d6b55db1a0..f98c7013fbc 100644 --- a/src/note.cpp +++ b/src/note.cpp @@ -40,7 +40,8 @@ Note::Note(): RegisterAttClass(ATT_STEMMED); RegisterAttClass(ATT_TIEPRESENT); - RegisterInterface( DurationInterface::GetAttClasses(), DurationInterface::InterfaceId() ); + RegisterInterface( DurationInterface::GetAttClasses(), DurationInterface::IsInterface() ); + RegisterInterface( PitchInterface::GetAttClasses(), PitchInterface::IsInterface() ); m_drawingTieAttr = NULL; m_drawingAccid = NULL; @@ -141,12 +142,12 @@ void Note::ResetDrawingAccid( ) Chord* Note::IsChordTone() { - return reinterpret_cast(this->GetFirstParent( CHORD, MAX_CHORD_DEPTH)); + return dynamic_cast(this->GetFirstParent( CHORD, MAX_CHORD_DEPTH) ); } int Note::GetDrawingDur( ) { - Chord* chordParent = reinterpret_cast(this->GetFirstParent( CHORD, MAX_CHORD_DEPTH)); + Chord* chordParent = dynamic_cast(this->GetFirstParent( CHORD, MAX_CHORD_DEPTH)); if( chordParent ) { return chordParent->GetActualDur(); } @@ -170,8 +171,8 @@ bool Note::HasDrawingStemDir() data_STEMDIRECTION Note::GetDrawingStemDir() { - Chord* chordParent = reinterpret_cast(this->GetFirstParent( CHORD, MAX_CHORD_DEPTH)); - Beam* beamParent = reinterpret_cast(this->GetFirstParent( BEAM, MAX_BEAM_DEPTH)); + Chord* chordParent = dynamic_cast(this->GetFirstParent( CHORD, MAX_CHORD_DEPTH)); + Beam* beamParent = dynamic_cast(this->GetFirstParent( BEAM, MAX_BEAM_DEPTH)); if( chordParent ) { return chordParent->GetDrawingStemDir(); } diff --git a/src/object.cpp b/src/object.cpp index a9172fdbb9c..db78615110e 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -63,7 +63,7 @@ Object::Object( const Object& object ) int i; for (i = 0; i < (int)object.m_children.size(); i++) { - Object *current = object.m_children[i]; + Object *current = object.m_children.at(i); Object* copy = current->Clone(); copy->Modify(); copy->SetParent( this ); @@ -84,7 +84,7 @@ Object& Object::operator=( const Object& object ) int i; for (i = 0; i < (int)object.m_children.size(); i++) { - Object *current = object.m_children[i]; + Object *current = object.m_children.at(i); Object* copy = current->Clone(); copy->Modify(); copy->SetParent( this ); @@ -108,16 +108,17 @@ void Object::Init(std::string classid) this->GenerateUuid(); } -int Object::Is() +ClassId Object::Is() { // we should always have the method overwritten assert( false ); return OBJECT; }; -void Object::RegisterInterface( std::vector *attClasses, int interfaceId ) +void Object::RegisterInterface( std::vector *attClasses, InterfaceId interfaceId ) { - + m_attClasses.insert(m_attClasses.end(), attClasses->begin(), attClasses->end()); + m_interfaces.push_back(interfaceId); } void Object::MoveChildren( Object *object ) @@ -133,7 +134,7 @@ void Object::MoveChildren( Object *object ) for (i = 0; i < (int)object->m_children.size(); i++) { this->m_children.push_back( object->Relinquish(i) ); - object->m_children[i]->m_parent = this; + object->m_children.at(i)->m_parent = this; } } @@ -157,9 +158,9 @@ void Object::ClearChildren() } -int Object::GetChildCount( const std::type_info *elementType ) +int Object::GetChildCount( const ClassId classId ) { - return (int)count_if (m_children.begin(), m_children.end(), ObjectComparison( elementType )); + return (int)count_if (m_children.begin(), m_children.end(), ObjectComparison( classId )); } int Object::GetAttributes(ArrayOfStrAttr *attributes) @@ -187,9 +188,9 @@ bool Object::HasAttribute( std::string attribute, std::string value ) } -Object* Object::GetFirst( const std::type_info *elementType ) +Object* Object::GetFirst( const ClassId classId ) { - m_iteratorElementType = elementType; + m_iteratorElementType = classId; m_iteratorEnd = m_children.end(); m_iteratorCurrent = std::find_if(m_children.begin(), m_iteratorEnd, ObjectComparison( m_iteratorElementType ) ); return (m_iteratorCurrent == m_iteratorEnd) ? NULL : *m_iteratorCurrent; @@ -228,7 +229,7 @@ Object *Object::DetachChild( int idx ) if ( idx >= (int)m_children.size() ) { return NULL; } - Object *child = m_children[idx]; + Object *child = m_children.at(idx); child->m_parent = NULL; ArrayOfObjects::iterator iter = m_children.begin(); m_children.erase( iter+(idx) ); @@ -241,7 +242,7 @@ Object *Object::Relinquish( int idx ) if ( idx >= (int)m_children.size() ) { return NULL; } - Object *child = m_children[idx]; + Object *child = m_children.at(idx); child->m_parent = NULL; return child; } @@ -257,7 +258,7 @@ Object *Object::FindChildByUuid( std::string uuid, int deepness, bool direction return element; } -Object *Object::FindChildByType( int classId, int deepness, bool direction ) +Object *Object::FindChildByType( ClassId classId, int deepness, bool direction ) { AttComparison attComparison( classId ); return FindChildByAttComparison( &attComparison, deepness, direction ); @@ -279,7 +280,7 @@ Object* Object::GetChild( int idx ) if ( (idx < 0) || (idx >= (int)m_children.size()) ) { return NULL; } - return m_children[idx]; + return m_children.at(idx); } void Object::RemoveChildAt( int idx ) @@ -287,12 +288,13 @@ void Object::RemoveChildAt( int idx ) if ( idx >= (int)m_children.size() ) { return; } - delete m_children[idx]; + delete m_children.at(idx); ArrayOfObjects::iterator iter = m_children.begin(); m_children.erase( iter+(idx) ); } -void Object::GenerateUuid() { +void Object::GenerateUuid() +{ int nr = std::rand(); char str[17]; // I do not want to use a stream to do this! @@ -393,44 +395,44 @@ void Object::AddSameAs( std::string id, std::string filename ) m_sameAs += sameAs; } -Object *Object::GetFirstParent( const int elementType, int maxSteps ) +Object *Object::GetFirstParent( const ClassId classId, int maxSteps ) { if ( (maxSteps == 0) || !m_parent ) { return NULL; } - if ( m_parent->Is() == elementType ) { + if ( m_parent->Is() == classId ) { return m_parent; } else { - return ( m_parent->GetFirstParent( elementType, maxSteps - 1 ) ); + return ( m_parent->GetFirstParent( classId, maxSteps - 1 ) ); } } -Object *Object::GetLastParentNot( const int elementType, int maxSteps ) +Object *Object::GetLastParentNot( const ClassId classId, int maxSteps ) { if ( (maxSteps == 0) || !m_parent ) { return NULL; } - if ( m_parent->Is() == elementType ) { + if ( m_parent->Is() == classId ) { return this; } else { - return ( m_parent->GetLastParentNot( elementType, maxSteps - 1 ) ); + return ( m_parent->GetLastParentNot( classId, maxSteps - 1 ) ); } } -Object *Object::GetFirstChild( const std::type_info *elementType ) +Object *Object::GetFirstChild( const ClassId classId ) { ArrayOfObjects::iterator iter; int i; for (iter = m_children.begin(), i = 0; iter != m_children.end(); ++iter, i++) { Object *o = *iter; - if ( typeid(*o) == *elementType ) + if ( o->Is() == classId ) { return *iter; } @@ -438,7 +440,7 @@ Object *Object::GetFirstChild( const std::type_info *elementType ) return NULL; } -Object *Object::GetNextSibling( const std::type_info *elementType ) +Object *Object::GetNextSibling( const ClassId classId ) { if (!m_parent) { return NULL; @@ -457,11 +459,10 @@ Object *Object::GetNextSibling( const std::type_info *elementType ) else if (!foundCurrent) { continue; } - if ( !elementType ) { + if ( classId == UNSPECIFIED ) { return *iter; } - Object *o = *iter; - if ( typeid(*o) == *elementType ) + if ( (*iter)->Is() == classId ) { return *iter; } @@ -469,7 +470,7 @@ Object *Object::GetNextSibling( const std::type_info *elementType ) return NULL; } -Object *Object::GetPreviousSibling( const std::type_info *elementType ) +Object *Object::GetPreviousSibling( const ClassId classId ) { if (!m_parent) { return NULL; @@ -488,11 +489,10 @@ Object *Object::GetPreviousSibling( const std::type_info *elementType ) else if (!foundCurrent) { continue; } - if ( !elementType ) { + if ( classId == UNSPECIFIED ) { return *iter; } - Object *o = *iter; - if ( typeid(*o) == *elementType ) + if ( (*iter)->Is() == classId ) { return *iter; } @@ -532,12 +532,13 @@ void Object::Process(Functor *functor, ArrayPtrVoid *params, Functor *endFunctor return; } - /* - EditorialElement *editorialElement = dynamic_cast(this); - if (functor->m_visibleOnly && editorialElement && ( editorialElement->m_visibility == Hidden ) ) { - return; + if (functor->m_visibleOnly && this->IsEditorialElement()) { + EditorialElement *editorialElement = dynamic_cast(this); + assert( editorialElement ); + if ( editorialElement->m_visibility == Hidden ) { + return; + } } - */ functor->Call( this, params ); @@ -546,11 +547,10 @@ void Object::Process(Functor *functor, ArrayPtrVoid *params, Functor *endFunctor functor->m_returnCode = FUNCTOR_CONTINUE; return; } - - //else if (dynamic_cast(this)) { + else if (this->IsEditorialElement()) { // since editorial object do not count, we re-increase the deepness limit - // deepness++; - //} + deepness++; + } if (deepness == 0) { // any need to change the functor m_returnCode? return; @@ -645,15 +645,6 @@ DocObject::~DocObject() { } -void DocObject::Refresh() -{ - // if we have a parent DocObject, propagate it - if ( dynamic_cast(m_parent) ) { - ((DocObject*)m_parent)->Refresh(); - } -} - - void DocObject::UpdateContentBB( int x1, int y1, int x2, int y2) { //LogDebug("CB Was: %i %i %i %i", m_contentBB_x1, m_contentBB_y1, m_contentBB_x2 ,m_contentBB_y2); @@ -784,20 +775,20 @@ int ObjectListInterface::GetListIndex( const Object *listElement ) } -Object* ObjectListInterface::GetListFirst(const Object *startFrom, const std::type_info *elementType) +Object* ObjectListInterface::GetListFirst(const Object *startFrom, const ClassId classId) { ListOfObjects::iterator it = m_list.begin(); std::advance(it, GetListIndex(startFrom)); - it = std::find_if(it, m_list.end(), ObjectComparison( elementType ) ); + it = std::find_if(it, m_list.end(), ObjectComparison( classId ) ); return (it == m_list.end()) ? NULL : *it; } -Object* ObjectListInterface::GetListFirstBackward(Object *startFrom, const std::type_info *elementType) +Object* ObjectListInterface::GetListFirstBackward(Object *startFrom, const ClassId classId) { ListOfObjects::iterator it = m_list.begin(); std::advance(it, GetListIndex(startFrom)); ListOfObjects::reverse_iterator rit(it); - rit = std::find_if(rit, m_list.rend(), ObjectComparison( elementType ) ); + rit = std::find_if(rit, m_list.rend(), ObjectComparison( classId ) ); return (rit == m_list.rend()) ? NULL : *rit; } @@ -931,8 +922,9 @@ int Object::SetCurrentScoreDef( ArrayPtrVoid *params ) assert( currentScoreDef ); // starting a new page - Page *page = dynamic_cast(this); - if ( page ) { + if (this->Is() == PAGE) { + Page *page = dynamic_cast(this); + assert( page ); if ( page->m_parent->GetChildIndex( page ) == 0 ) { currentScoreDef->SetRedrawFlags( true, true, true, true ); currentScoreDef->SetDrawLabels( true ); @@ -946,15 +938,18 @@ int Object::SetCurrentScoreDef( ArrayPtrVoid *params ) } // starting a new system - System *system = dynamic_cast(this); - if ( system ) { + if (this->Is() == SYSTEM) { + System *system = dynamic_cast(this); + assert( system ); currentScoreDef->SetRedrawFlags( true, true, false, false ); return FUNCTOR_CONTINUE; } // starting a new scoreDef - ScoreDef *scoreDef= dynamic_cast(this); - if ( scoreDef ) { + + if (this->Is() == SCORE_DEF) { + ScoreDef *scoreDef= dynamic_cast(this); + assert( scoreDef ); bool drawClef = false; bool drawKeySig = false; bool drawMensur = false; @@ -985,9 +980,12 @@ int Object::SetCurrentScoreDef( ArrayPtrVoid *params ) // starting a new staffDef // Because staffDef have to be included in a scoreDef, a new staffDef was already // replaced by the new scoreDef (see above). Here we only need to reset the drawing flags - StaffDef *staffDef= dynamic_cast(this); - if ( staffDef ) { + + if (this->Is() == STAFF_DEF) { + StaffDef *staffDef= dynamic_cast(this); + assert( staffDef ); StaffDef *tmpStaffDef = currentScoreDef->GetStaffDef( staffDef->GetN() ); + assert( tmpStaffDef ); if (staffDef->GetClef()) { tmpStaffDef->SetDrawClef( true ); } @@ -1003,15 +1001,17 @@ int Object::SetCurrentScoreDef( ArrayPtrVoid *params ) } // starting a new staff - Staff *staff = dynamic_cast(this); - if ( staff ) { + if (this->Is() == STAFF) { + Staff *staff = dynamic_cast(this); + assert( staff ); (*currentStaffDef) = currentScoreDef->GetStaffDef( staff->GetN() ); return FUNCTOR_CONTINUE; } // starting a new layer - Layer *layer = dynamic_cast(this); - if ( layer ) { + if (this->Is() == LAYER) { + Layer *layer = dynamic_cast(this); + assert( layer ); // setting the layer stem direction. Alternatively, this could be done in // View::DrawLayer. If this (and other things) is kept here, renaming the method to something more // generic (PrepareDrawing?) might be a good idea... @@ -1028,16 +1028,18 @@ int Object::SetCurrentScoreDef( ArrayPtrVoid *params ) } // starting a new clef - Clef *clef = dynamic_cast(this); - if ( clef ) { + if (this->Is() == CLEF) { + Clef *clef = dynamic_cast(this); + assert( clef ); assert( *currentStaffDef ); (*currentStaffDef)->ReplaceClef( clef ); return FUNCTOR_CONTINUE; } // starting a new keysig - KeySig *keysig = dynamic_cast(this); - if ( keysig ) { + if (this->Is() == KEY_SIG) { + KeySig *keysig = dynamic_cast(this); + assert( keysig ); assert( *currentStaffDef ); (*currentStaffDef)->ReplaceKeySig( keysig ); return FUNCTOR_CONTINUE; @@ -1080,17 +1082,18 @@ int Object::SetBoundingBoxGraceXShift( ArrayPtrVoid *params ) Doc *doc = static_cast((*params)[1]); // starting an new layer - Layer *current_layer = dynamic_cast(this); - if ( current_layer ) { + if (this->Is() == LAYER) { (*min_pos) = 0; return FUNCTOR_CONTINUE; } - Note *note = dynamic_cast(this); - if ( !note ) { + if (this->Is() != NOTE) { return FUNCTOR_CONTINUE; } + Note *note = dynamic_cast(this); + assert( note ); + if (!note->IsGraceNote()) { (*min_pos) = 0; return FUNCTOR_CONTINUE; @@ -1119,7 +1122,7 @@ int Object::SetBoundingBoxGraceXShift( ArrayPtrVoid *params ) } // the next minimal position if given by the right side of the bounding box + the spacing of the element - (*min_pos) = note->GetGraceAlignment()->GetXRel() + note->m_contentBB_x2 + doc->GetRightMargin(&typeid(*note)) * doc->m_drawingUnit[0] / PARAM_DENOMINATOR; + (*min_pos) = note->GetGraceAlignment()->GetXRel() + note->m_contentBB_x2 + doc->GetRightMargin( NOTE ) * doc->m_drawingUnit[0] / PARAM_DENOMINATOR; //(*min_pos) = note->GetGraceAlignment()->GetXRel() + note->m_contentBB_x2; //note->GetGraceAlignment()->SetMaxWidth( note->m_contentBB_x2 + doc->GetRightMargin(&typeid(*note)) * doc->m_drawingUnit[0] / PARAM_DENOMINATOR ); note->GetGraceAlignment()->SetMaxWidth( note->m_contentBB_x2 ); @@ -1138,8 +1141,9 @@ int Object::SetBoundingBoxXShift( ArrayPtrVoid *params ) Doc *doc = static_cast((*params)[2]); // starting a new measure - Measure *current_measure = dynamic_cast(this); - if ( current_measure ) { + if (this->Is() == MEASURE) { + Measure *current_measure = dynamic_cast(this); + assert( current_measure ); // we reset the measure width and the minimum position (*measure_width) = 0; (*min_pos) = 0; @@ -1150,8 +1154,9 @@ int Object::SetBoundingBoxXShift( ArrayPtrVoid *params ) } // starting an new layer - Layer *current_layer = dynamic_cast(this); - if ( current_layer ) { + if (this->Is() == LAYER) { + Layer *current_layer = dynamic_cast(this); + assert( current_layer ); // reset it as the minimum position to the step (HARDCODED) (*min_pos) = 30 * doc->m_drawingUnit[0] / 10; // set scoreDef attr @@ -1170,11 +1175,13 @@ int Object::SetBoundingBoxXShift( ArrayPtrVoid *params ) return FUNCTOR_CONTINUE; } - LayerElement *current = dynamic_cast(this); - if ( !current ) { + if (!this->IsLayerElement()) { return FUNCTOR_CONTINUE; } + LayerElement *current = dynamic_cast(this); + assert( current ); + // we should have processed aligned before assert( current->GetAlignment() ); @@ -1183,27 +1190,27 @@ int Object::SetBoundingBoxXShift( ArrayPtrVoid *params ) return FUNCTOR_CONTINUE; } - if ( current->IsBeam() ) { + if (current->Is() == BEAM) { return FUNCTOR_CONTINUE; } - if ( current->IsNote() && reinterpret_cast(current->GetFirstParent( CHORD, MAX_CHORD_DEPTH ) ) ) { + if ( (current->Is() == NOTE) && current->GetFirstParent( CHORD, MAX_CHORD_DEPTH ) ) { return FUNCTOR_CONTINUE; } - if ( current->IsTie() ) { + if (current->Is() == TIE) { return FUNCTOR_CONTINUE; } - if ( current->IsTuplet() ) { + if (current->Is() == TUPLET) { return FUNCTOR_CONTINUE; } - if ( current->IsVerse() || current->IsSyl() ) { + if ( (current->Is() == VERSE) || (current->Is() == SYL) ) { return FUNCTOR_CONTINUE; } - if ( current->IsAccid() && reinterpret_cast(current->GetFirstParent( NOTE, MAX_ACCID_DEPTH ) ) ) { + if ( (current->Is() == ACCID) && current->GetFirstParent( NOTE, MAX_ACCID_DEPTH ) ) { return FUNCTOR_CONTINUE; } @@ -1211,14 +1218,14 @@ int Object::SetBoundingBoxXShift( ArrayPtrVoid *params ) // |____x_____| // ---- = negative offset int negative_offset = - (current->m_contentBB_x1); - if (!current->IsGraceNote()) negative_offset += (doc->GetLeftMargin(&typeid(*current)) * doc->m_drawingUnit[0] / PARAM_DENOMINATOR); + if (!current->IsGraceNote()) negative_offset += (doc->GetLeftMargin( current->Is() ) * doc->m_drawingUnit[0] / PARAM_DENOMINATOR); // this should never happen (but can with glyphs not exactly registered at position x=0 in the SMuFL font used if ( negative_offset < 0 ) negative_offset = 0; - if ( current->IsMRest() ) { + if (current->Is() == MREST) { // With MRest, the only thing we want to do it keep their with as possible measure with (if only MRest in all staves/layers) - int width = current->m_contentBB_x2 + doc->GetRightMargin(&typeid(*current)) * doc->m_drawingUnit[0] / PARAM_DENOMINATOR + negative_offset ; + int width = current->m_contentBB_x2 + doc->GetRightMargin( current->Is() ) * doc->m_drawingUnit[0] / PARAM_DENOMINATOR + negative_offset ; // Keep it if more than the current measure width (*measure_width) = std::max( (*measure_width), width ); (*min_pos) = 0; @@ -1253,8 +1260,8 @@ int Object::SetBoundingBoxXShift( ArrayPtrVoid *params ) } // the next minimal position if given by the right side of the bounding box + the spacing of the element - (*min_pos) = current->GetAlignment()->GetXRel() + current->m_contentBB_x2 + doc->GetRightMargin(&typeid(*current)) * doc->m_drawingUnit[0] / PARAM_DENOMINATOR; - current->GetAlignment()->SetMaxWidth( current->m_contentBB_x2 + doc->GetRightMargin(&typeid(*current)) * doc->m_drawingUnit[0] / PARAM_DENOMINATOR ); + (*min_pos) = current->GetAlignment()->GetXRel() + current->m_contentBB_x2 + doc->GetRightMargin( current->Is() ) * doc->m_drawingUnit[0] / PARAM_DENOMINATOR; + current->GetAlignment()->SetMaxWidth( current->m_contentBB_x2 + doc->GetRightMargin( current->Is() ) * doc->m_drawingUnit[0] / PARAM_DENOMINATOR ); return FUNCTOR_CONTINUE; } @@ -1267,8 +1274,9 @@ int Object::SetBoundingBoxXShiftEnd( ArrayPtrVoid *params ) int *measure_width = static_cast((*params)[1]); // ending a measure - Measure *current_measure = dynamic_cast(this); - if ( current_measure ) { + if (this->Is() == MEASURE) { + Measure *current_measure = dynamic_cast(this); + assert( current_measure ); // as minimum position of the barLine use the measure width (*min_pos) = (*measure_width); if (current_measure->GetRightBarlineType() != BARRENDITION_NONE) { @@ -1278,8 +1286,9 @@ int Object::SetBoundingBoxXShiftEnd( ArrayPtrVoid *params ) } // ending a layer - Layer *current_layer = dynamic_cast(this); - if ( current_layer ) { + if (this->Is() == LAYER) { + Layer *current_layer = dynamic_cast(this); + assert( current_layer ); // mininimum position is the with the layer // we keep it if is higher than what we had so far // this will be used for shifting the right barLine @@ -1298,8 +1307,9 @@ int Object::SetBoundingBoxYShift( ArrayPtrVoid *params ) int *system_height = static_cast((*params)[1]); // starting a new system - System *current_system = dynamic_cast(this); - if ( current_system ) { + if (this->Is() == SYSTEM) { + System *current_system = dynamic_cast(this); + assert( current_system ); // we reset the system height (*system_height) = 0; (*min_pos) = 0; @@ -1307,18 +1317,19 @@ int Object::SetBoundingBoxYShift( ArrayPtrVoid *params ) } // starting a new measure - Measure *current_measure = dynamic_cast(this); - if ( current_measure ) { + if (this->Is() == MEASURE) { (*min_pos) = 0; return FUNCTOR_CONTINUE; } // starting a new staff - Staff *current = dynamic_cast(this); - if ( !current ) { + if (this->Is() != STAFF) { return FUNCTOR_CONTINUE; } + Staff *current = dynamic_cast(this); + assert( current ); + // at this stage we assume we have instanciated the alignment pointer assert( current->GetAlignment() ); @@ -1355,8 +1366,9 @@ int Object::SetBoundingBoxYShiftEnd( ArrayPtrVoid *params ) int *system_height = static_cast((*params)[1]); // ending a measure - Measure *current_measure = dynamic_cast(this); - if ( current_measure ) { + if (this->Is() == MEASURE) { + Measure *current_measure = dynamic_cast(this); + assert( current_measure ); // mininimum position is the height for the last (previous) staff // we keep it if it is higher than what we had so far (*system_height) = std::min( (*system_height), (*min_pos) ); diff --git a/src/page.cpp b/src/page.cpp index 4efa976c435..6ff4d6c8cce 100644 --- a/src/page.cpp +++ b/src/page.cpp @@ -73,27 +73,6 @@ int Page::GetStaffPosOnPage( Staff *staff ) return 0; } -System *Page::GetAtPos( int y ) -{ - - //y -= ( SYSTEM_OFFSET / 2 ); // SYSTEM_OFFSET used to be 190 - System *system = dynamic_cast( this->GetFirst( &typeid(System) ) ); - if ( !system ) - return NULL; - - System *next = NULL; - while ( (next = dynamic_cast( this->GetNext() ) ) ) - { - if ( (int)next->m_yAbs < y ) - { - return system; - } - system = next; - } - - return system; -} - void Page::LayOut( bool force ) { if ( m_layoutDone && !force ) { @@ -109,11 +88,8 @@ void Page::LayOut( bool force ) void Page::LayOutHorizontally( ) { - if (!dynamic_cast(m_parent)) { - assert( false ); - return; - } Doc *doc = dynamic_cast(m_parent); + assert( doc ); // Doc::SetDrawingPage should have been called before // Make sure we have the correct page @@ -210,11 +186,8 @@ void Page::LayOutHorizontally( ) void Page::LayOutVertically( ) { - if (!dynamic_cast(m_parent)) { - assert( false ); - return; - } Doc *doc = dynamic_cast(m_parent); + assert( doc ); // Doc::SetDrawingPage should have been called before // Make sure we have the correct page @@ -288,11 +261,8 @@ void Page::LayOutVertically( ) void Page::JustifyHorizontally( ) { - if (!dynamic_cast(m_parent)) { - assert( false ); - return; - } Doc *doc = dynamic_cast(m_parent); + assert( doc ); if (!doc->GetJustificationX()) { return; @@ -322,11 +292,8 @@ void Page::JustifyHorizontally( ) int Page::GetContentHeight( ) { - if (!dynamic_cast(m_parent)) { - assert( false ); - return 0; - } Doc *doc = dynamic_cast(m_parent); + assert( doc ); // Doc::SetDrawingPage should have been called before // Make sure we have the correct page @@ -342,12 +309,8 @@ int Page::GetContentHeight( ) int Page::GetContentWidth( ) { - if (!dynamic_cast(m_parent)) { - assert( false ); - return 0; - } - Doc *doc = NULL; - doc = dynamic_cast(m_parent); + Doc *doc = dynamic_cast(m_parent); + assert( doc ); // Doc::SetDrawingPage should have been called before // Make sure we have the correct page diff --git a/src/pitchinterface.cpp b/src/pitchinterface.cpp index 0ba691ebea8..8008c1aa1a6 100644 --- a/src/pitchinterface.cpp +++ b/src/pitchinterface.cpp @@ -22,7 +22,7 @@ namespace vrv { // PitchInterface //---------------------------------------------------------------------------- -PitchInterface::PitchInterface(): AttInterface(), +PitchInterface::PitchInterface(): Interface(), AttAccidental(), AttOctave(), AttPitch() diff --git a/src/positioninterface.cpp b/src/positioninterface.cpp index 21f14680111..61fb342e9f8 100644 --- a/src/positioninterface.cpp +++ b/src/positioninterface.cpp @@ -17,7 +17,7 @@ namespace vrv { // PositionInterface //---------------------------------------------------------------------------- -PositionInterface::PositionInterface(): AttInterface(), +PositionInterface::PositionInterface(): Interface(), AttStafflocPitched() { RegisterInterfaceAttClass(ATT_STAFFLOCPITCHED); diff --git a/src/rest.cpp b/src/rest.cpp index e028891467f..6dbffc8fde5 100644 --- a/src/rest.cpp +++ b/src/rest.cpp @@ -17,6 +17,9 @@ namespace vrv { Rest::Rest(): LayerElement("rest-"), DurationInterface(), PositionInterface() { + RegisterInterface( DurationInterface::GetAttClasses(), DurationInterface::IsInterface() ); + RegisterInterface( PositionInterface::GetAttClasses(), PositionInterface::IsInterface() ); + Reset(); } diff --git a/src/scoredef.cpp b/src/scoredef.cpp index 181473b14a5..4bf828acf4a 100644 --- a/src/scoredef.cpp +++ b/src/scoredef.cpp @@ -161,12 +161,14 @@ Clef *ScoreOrStaffDefAttrInterface::GetClefCopy() const // we should not call it without having checked if a clef is set if (!m_clef) return NULL; Clef *copy = NULL; - Clef *current_clef = dynamic_cast(m_clef); - if (current_clef) { + if (m_clef->Is() == CLEF) { + Clef *current_clef = dynamic_cast(m_clef); + assert( current_clef ); copy = new Clef(*current_clef); } else { ClefAttr *current_attr = dynamic_cast(m_clef); + assert( current_attr ); copy = new Clef(current_attr); } assert(copy); @@ -179,12 +181,14 @@ KeySig *ScoreOrStaffDefAttrInterface::GetKeySigCopy() const // we should not call it without having checked if a keysig is set if (!m_keySig) return NULL; KeySig *copy = NULL; - KeySig *current_keySig = dynamic_cast(m_keySig); - if (current_keySig) { + if (m_keySig->Is() == KEY_SIG) { + KeySig *current_keySig = dynamic_cast(m_keySig); + assert( current_keySig ); copy = new KeySig(*current_keySig); } else { KeySigAttr *current_attr = dynamic_cast(m_keySig); + assert( current_attr ); copy = new KeySig(current_attr); } assert(copy); @@ -197,12 +201,14 @@ Mensur *ScoreOrStaffDefAttrInterface::GetMensurCopy() const // we should not call it without having checked if a mensur is set if (!m_mensur) return NULL; Mensur *copy = NULL; - Mensur *current_mensur = dynamic_cast(m_mensur); - if (current_mensur) { + if (m_mensur->Is() == MENSUR) { + Mensur *current_mensur = dynamic_cast(m_mensur); + assert( current_mensur ); copy = new Mensur(*current_mensur); } else { MensurAttr *current_attr = dynamic_cast(m_mensur); + assert( current_attr ); copy = new Mensur(current_attr); } assert(copy); @@ -215,12 +221,14 @@ MeterSig *ScoreOrStaffDefAttrInterface::GetMeterSigCopy() const // we should not call it without having checked if a meterSig is set if (!m_meterSig) return NULL; MeterSig *copy = NULL; - MeterSig *current_meterSig = dynamic_cast(m_meterSig); - if (current_meterSig) { + if (m_meterSig->Is() == METER_SIG) { + MeterSig *current_meterSig = dynamic_cast(m_meterSig); + assert( current_meterSig ); copy = new MeterSig(*current_meterSig); } else { MeterSigAttr *current_attr = dynamic_cast(m_meterSig); + assert( current_attr ); copy = new MeterSig(current_attr); } assert(copy); diff --git a/src/slur.cpp b/src/slur.cpp index bedd0993bcb..122395f1d03 100644 --- a/src/slur.cpp +++ b/src/slur.cpp @@ -23,6 +23,8 @@ namespace vrv { Slur::Slur(): MeasureElement("slur-"), TimeSpanningInterface() { + RegisterInterface( TimeSpanningInterface::GetAttClasses(), TimeSpanningInterface::IsInterface() ); + Reset(); } diff --git a/src/space.cpp b/src/space.cpp index dcb0241dc26..d7d7a635cb3 100644 --- a/src/space.cpp +++ b/src/space.cpp @@ -17,6 +17,8 @@ namespace vrv { Space::Space( ): LayerElement("space-"), DurationInterface() { + RegisterInterface( DurationInterface::GetAttClasses(), DurationInterface::IsInterface() ); + Reset(); } diff --git a/src/staff.cpp b/src/staff.cpp index 72696efb159..d67bccdba25 100644 --- a/src/staff.cpp +++ b/src/staff.cpp @@ -144,7 +144,7 @@ int Staff::FillStaffCurrentTimeSpanning( ArrayPtrVoid *params ) while ( iter != elements->end()) { TimeSpanningInterface *interface = dynamic_cast(*iter); assert(interface); - Staff *endParent = reinterpret_cast(interface->GetEnd()->GetFirstParent( STAFF ) ); + Staff *endParent = dynamic_cast(interface->GetEnd()->GetFirstParent( STAFF ) ); assert( endParent ); // Because we are not processing following staff @n, we need to check it here. // this might cause problem with cross-staves slurs if the end is on a lower staff than the start: diff --git a/src/syl.cpp b/src/syl.cpp index 36809208220..d87e74cf486 100644 --- a/src/syl.cpp +++ b/src/syl.cpp @@ -30,6 +30,9 @@ Syl::Syl(): { RegisterAttClass(ATT_TYPOGRAPHY); RegisterAttClass(ATT_SYLLOG); + + RegisterInterface( TimeSpanningInterface::GetAttClasses(), TimeSpanningInterface::IsInterface() ); + Reset(); } @@ -60,12 +63,12 @@ int Syl::PrepareLyrics( ArrayPtrVoid *params ) Note **lastNote = static_cast((*params)[1]); Note **lastButOneNote = static_cast((*params)[2]); - Verse *verse = reinterpret_cast( this->GetFirstParent( VERSE, MAX_NOTE_DEPTH ) ); + Verse *verse = dynamic_cast( this->GetFirstParent( VERSE, MAX_NOTE_DEPTH ) ); if ( verse ) { m_drawingVerse = std::max(verse->GetN(), 1); } - this->SetStart( reinterpret_cast( this->GetFirstParent( NOTE, MAX_NOTE_DEPTH ) ) ); + this->SetStart( dynamic_cast( this->GetFirstParent( NOTE, MAX_NOTE_DEPTH ) ) ); // At this stage currentSyl is actually the previous one that is ending here if ((*currentSyl)) { diff --git a/src/system.cpp b/src/system.cpp index 66f62998e4c..11bcddb587f 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -86,25 +86,6 @@ void System::ResetVerticalAlignment() m_drawingYRel = 0; m_drawingY = 0; } - -Measure *System::GetAtPos( int x ) -{ - Measure *measure = dynamic_cast( this->GetFirst( &typeid(Measure) ) ); - if ( !measure ) - return NULL; - - Measure *next = NULL; - while ( (next = dynamic_cast( this->GetNext() ) ) ) - { - if ( (int)measure->GetDrawingX() < x ) - { - return measure; - } - measure = next; - } - - return measure; -} int System::GetHeight() { diff --git a/src/tie.cpp b/src/tie.cpp index 48400ac15da..f898d98310b 100644 --- a/src/tie.cpp +++ b/src/tie.cpp @@ -23,6 +23,8 @@ namespace vrv { Tie::Tie(): MeasureElement("tie-"), TimeSpanningInterface() { + RegisterInterface( TimeSpanningInterface::GetAttClasses(), TimeSpanningInterface::IsInterface() ); + Reset(); } diff --git a/src/timeinterface.cpp b/src/timeinterface.cpp index f8ca5ab3198..989cada0a05 100644 --- a/src/timeinterface.cpp +++ b/src/timeinterface.cpp @@ -25,7 +25,7 @@ namespace vrv { // TimeSpanningInterface //---------------------------------------------------------------------------- -TimeSpanningInterface::TimeSpanningInterface(): AttInterface(), +TimeSpanningInterface::TimeSpanningInterface(): Interface(), AttStartendid(), AttStartid(), AttTimestampMusical(), diff --git a/src/toolkit.cpp b/src/toolkit.cpp index ef86afc4654..9bb6a81c966 100644 --- a/src/toolkit.cpp +++ b/src/toolkit.cpp @@ -569,12 +569,13 @@ int Toolkit::GetPageCount() { return m_doc.GetPageCount(); } -int Toolkit::GetPageWithElement( const std::string &xmlId ) { +int Toolkit::GetPageWithElement( const std::string &xmlId ) +{ Object *element = m_doc.FindChildByUuid(xmlId); if (!element) { return 0; } - Page *page = reinterpret_cast( element->GetFirstParent( PAGE ) ); + Page *page = dynamic_cast( element->GetFirstParent( PAGE ) ); if (!page) { return 0; } @@ -612,8 +613,9 @@ bool Toolkit::Drag( std::string elementId, int x, int y ) if ( !m_doc.GetDrawingPage() ) return false; Object *element = m_doc.GetDrawingPage()->FindChildByUuid(elementId); if ( element->Is() == NOTE ) { - Note *note = reinterpret_cast(element); - Layer *layer = reinterpret_cast(note->GetFirstParent( LAYER ) ); + Note *note = dynamic_cast(element); + assert( note ); + Layer *layer = dynamic_cast( note->GetFirstParent( LAYER ) ); if ( !layer ) return false; int oct; data_PITCHNAME pname = (data_PITCHNAME)m_view.CalculatePitchCode( layer, m_view.ToLogicalY(y), note->GetDrawingX(), &oct ); @@ -645,7 +647,7 @@ bool Toolkit::Insert( std::string elementType, std::string startid, std::string return false; } - Measure *measure = reinterpret_cast(start->GetFirstParent( MEASURE ) ); + Measure *measure = dynamic_cast(start->GetFirstParent( MEASURE ) ); assert( measure ); if (elementType == "slur" ) { Slur *slur = new Slur(); diff --git a/src/tuplet.cpp b/src/tuplet.cpp index 0027f856467..55548ee7a96 100644 --- a/src/tuplet.cpp +++ b/src/tuplet.cpp @@ -51,8 +51,7 @@ void Tuplet::FilterList( ListOfObjects *childList ) ListOfObjects::iterator iter = childList->begin(); while ( iter != childList->end()) { - LayerElement *currentElement = dynamic_cast(*iter); - if ( !currentElement || !currentElement->HasDurationInterface() ) + if ( !(*iter)->IsLayerElement() || !(*iter)->HasInterface(INTERFACE_DURATION) ) { iter = childList->erase( iter ); } else { diff --git a/src/verse.cpp b/src/verse.cpp index 5d44401be82..e1f2045becd 100644 --- a/src/verse.cpp +++ b/src/verse.cpp @@ -85,8 +85,8 @@ int Verse::PrepareProcessingLists( ArrayPtrVoid *params ) // Alternate solution with StaffN_LayerN_VerseN_t //StaffN_LayerN_VerseN_t *tree = static_cast((*params)[0]); - Staff *staff = reinterpret_cast( this->GetFirstParent( STAFF ) ); - Layer *layer = reinterpret_cast( this->GetFirstParent( LAYER ) ); + Staff *staff = dynamic_cast( this->GetFirstParent( STAFF ) ); + Layer *layer = dynamic_cast( this->GetFirstParent( LAYER ) ); assert( staff && layer ); tree->child[ staff->GetN() ].child[ layer->GetN() ].child[ this->GetN() ]; diff --git a/src/view.cpp b/src/view.cpp index ff4944a2f5b..ee1d3dcab43 100644 --- a/src/view.cpp +++ b/src/view.cpp @@ -64,7 +64,6 @@ void View::SetDoc( Doc *doc ) void View::SetPage( int pageIdx, bool doLayout ) { - assert( m_doc ); // Page cannot be NULL assert( m_doc->HasPage( pageIdx ) ); diff --git a/src/view_beam.cpp b/src/view_beam.cpp index d80fa28debc..1537fe184cb 100644 --- a/src/view_beam.cpp +++ b/src/view_beam.cpp @@ -31,10 +31,13 @@ namespace vrv { void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ) { - assert(layer); // Pointer to layer cannot be NULL" - assert(staff); // Pointer to staff cannot be NULL" + assert( dc ); + assert( layer ); + assert( staff ); + assert( measure ); Beam *beam = dynamic_cast(element); + assert( beam ); LayerElement *current; @@ -122,10 +125,9 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta do { // Beam list should contain only DurationInterface objects assert( dynamic_cast(current) ); - currentDur = dynamic_cast(current)->GetActualDur(); - if ( current->IsChord() ) { + if (current->Is() == CHORD) { beamHasChord = true; } @@ -145,9 +147,10 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta } // Skip rests - if (current->IsNote() || current->IsChord()) { + if ( (current->Is() == NOTE) || (current->Is() == CHORD) ) { // look at the stemDir to see if we have multiple stem Dir if (!hasMultipleStemDir) { + assert( dynamic_cast(current) ); currentStemDir = dynamic_cast(current)->GetStemDir(); if (currentStemDir != STEMDIRECTION_NONE) { if ((stemDir != STEMDIRECTION_NONE) && (stemDir != currentStemDir)) { @@ -193,8 +196,11 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta // elementCount holds the last one for (i = 0; i < elementCount; i++) { - if (dynamic_cast((*beamElementCoords)[i]->m_element)) { - dynamic_cast((*beamElementCoords)[i]->m_element)->GetYExtremes(&yMax, &yMin); + + if ((*beamElementCoords)[i]->m_element->Is() == CHORD) { + Chord *chord = dynamic_cast((*beamElementCoords)[i]->m_element); + assert( chord ); + chord->GetYExtremes(&yMax, &yMin); (*beamElementCoords)[i]->m_yTop = yMax; (*beamElementCoords)[i]->m_yBottom = yMin; @@ -285,10 +291,10 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta for (i=0; im_element->IsNote() ) { + if ( (*beamElementCoords)[i]->m_element->Is() == NOTE ) { ((Note*)(*beamElementCoords)[i]->m_element)->m_drawingStemDir = stemDir; } - else if ( (*beamElementCoords)[i]->m_element->IsChord() ) { + else if ( (*beamElementCoords)[i]->m_element->Is() == CHORD ) { ((Chord*)(*beamElementCoords)[i]->m_element)->SetDrawingStemDir(stemDir); } @@ -376,7 +382,7 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta for (i=0; im_element; - if((el->IsNote() && !dynamic_cast(el)->IsChordTone()) || el->IsChord()) { + if( ( (el->Is() == NOTE) && !dynamic_cast(el)->IsChordTone()) || (el->Is() == CHORD) ) { DrawVerticalLine (dc, el->m_drawingStemStart.y, el->m_drawingStemEnd.y, el->m_drawingStemStart.x, m_doc->m_style->m_stemWidth); } } diff --git a/src/view_element.cpp b/src/view_element.cpp index 8644fe3eec5..ede4ae1f039 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -51,8 +51,11 @@ namespace vrv { void View::DrawLayerElement( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure) { - assert(layer); // Pointer to layer cannot be NULL" - assert(staff); // Pointer to staff cannot be NULL" + assert( dc ); + assert( element ); + assert( layer ); + assert( staff ); + assert( measure ); int previousColor = m_currentColour; @@ -63,58 +66,58 @@ void View::DrawLayerElement( DeviceContext *dc, LayerElement *element, Layer *la m_currentColour = AxBLACK; } - if (dynamic_cast(element)) { + if (element->Is() == ACCID) { DrawAccid(dc, element, layer, staff, measure); } - else if (dynamic_cast(element)) { + else if (element->Is() == BAR_LINE) { DrawBarline(dc, element, layer, staff, measure); } - else if (dynamic_cast(element)) { + else if (element->Is() == BEAM) { DrawBeam(dc, element, layer, staff, measure); } - else if (dynamic_cast(element)) { + else if (element->Is() == CHORD) { DrawDurationElement(dc, element, layer, staff, measure); } - else if (dynamic_cast(element)) { + else if (element->Is() == CLEF) { DrawClef(dc, element, layer, staff, measure); } - else if (dynamic_cast(element)) { + else if (element->Is() == CUSTOS) { DrawCustos(dc, element, layer, staff, measure); } - else if (dynamic_cast(element)) { + else if (element->Is() == DOT) { DrawDot(dc, element, layer, staff, measure); } - else if (dynamic_cast(element)) { + else if (element->Is() == KEY_SIG) { DrawKeySig(dc, element, layer, staff, measure); } - else if (dynamic_cast(element)) { + else if (element->Is() == MENSUR) { DrawMensur(dc, element, layer, staff, measure); } - else if (dynamic_cast(element)) { + else if (element->Is() == METER_SIG) { DrawMeterSig(dc, element, layer, staff, measure); } - else if (dynamic_cast(element)) { + else if (element->Is() == MREST) { DrawMRest(dc, element, layer, staff, measure); } - else if (dynamic_cast(element)) { + else if (element->Is() == MULTI_REST) { DrawMultiRest(dc, element, layer, staff, measure); } - else if (dynamic_cast(element)) { + else if (element->Is() == NOTE) { DrawDurationElement(dc, element, layer, staff, measure); } - else if (dynamic_cast(element)) { + else if (element->Is() == REST) { DrawDurationElement(dc, element, layer, staff, measure); } - else if (dynamic_cast(element)) { + else if (element->Is() == SPACE) { DrawSpace(dc, element, layer, staff, measure); } - else if (dynamic_cast(element)) { + else if (element->Is() == SYL) { DrawSyl(dc, element, layer, staff, measure); } - else if (dynamic_cast(element)) { + else if (element->Is() == TUPLET) { DrawTuplet(dc, element, layer, staff, measure); } - else if (dynamic_cast(element)) { + else if (element->Is() == VERSE) { DrawVerse(dc, element, layer, staff, measure); } else { @@ -127,8 +130,11 @@ void View::DrawLayerElement( DeviceContext *dc, LayerElement *element, Layer *la void View::DrawDurationElement( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ) { - assert(layer); // Pointer to layer cannot be NULL" - assert(staff); // Pointer to staff cannot be NULL" + assert( dc ); + assert( element ); + assert( layer ); + assert( staff ); + assert( measure ); if (dynamic_cast(element)) { dc->StartGraphic( element, "", element->GetUuid() ); @@ -149,12 +155,16 @@ void View::DrawDurationElement( DeviceContext *dc, LayerElement *element, Layer return; } -void View::DrawTuplet(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure) { - - assert(layer); // Pointer to layer cannot be NULL" - assert(staff); // Pointer to staff cannot be NULL" +void View::DrawTuplet(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure) +{ + assert( dc ); + assert( element ); + assert( layer ); + assert( staff ); + assert( measure ); Tuplet *tuplet = dynamic_cast(element); + assert( tuplet ); dc->StartGraphic( element, "", element->GetUuid() ); @@ -175,11 +185,14 @@ void View::DrawTuplet(DeviceContext *dc, LayerElement *element, Layer *layer, St void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ) { - assert(layer); // Pointer to layer cannot be NULL" - assert(staff); // Pointer to staff cannot be NULL" - assert(dynamic_cast(element)); // Element must be a Note" + assert( dc ); + assert( element ); + assert( layer ); + assert( staff ); + assert( measure ); Note *note = dynamic_cast(element); + assert( note ); if (note->IsMensural()){ DrawMensuralNote(dc, element, layer, staff, measure); @@ -196,7 +209,7 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St // Get the immediate parent of the note // to see if beamed or not - Beam *beam_parent = reinterpret_cast(note->GetFirstParent( BEAM )); + Beam *beam_parent = dynamic_cast(note->GetFirstParent( BEAM )); // This note is beamed and cue sized if (beam_parent != NULL) { @@ -397,7 +410,7 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St } if (note->GetDrawingTieAttr()) { - System *system = reinterpret_cast(measure->GetFirstParent( SYSTEM ) ); + System *system = dynamic_cast(measure->GetFirstParent( SYSTEM ) ); // create a placeholder for the tie attribute that will be drawn from the system dc->StartGraphic(note->GetDrawingTieAttr(), "", note->GetDrawingTieAttr()->GetUuid().c_str()); dc->EndGraphic(note->GetDrawingTieAttr(), this); @@ -420,6 +433,8 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St void View::DrawStem( DeviceContext *dc, LayerElement *object, Staff *staff, data_STEMDIRECTION dir, int radius, int xn, int originY, int heightY) { + assert(dynamic_cast(object)); + int staffSize = staff->staffSize; int staffY = staff->GetDrawingY(); int baseStem, totalFlagStemHeight, flagStemHeight, nbFlags; @@ -497,6 +512,8 @@ void View::DrawStem( DeviceContext *dc, LayerElement *object, Staff *staff, data DrawSmuflCode( dc, x2, y2 + (i + 1) * flagStemHeight, SMUFL_E241_flag8thDown, staff->staffSize, drawingCueSize ); } } + + // cast to note is check when setting drawingCueSize value if ( drawingCueSize && ( dynamic_cast(object)->GetGrace() == GRACE_acc ) ) { DrawAcciaccaturaSlash(dc, object); } @@ -518,7 +535,9 @@ void View::DrawLedgerLines ( DeviceContext *dc, LayerElement *element, Staff *st //prep start and end positions of ledger line depending on stem direction and doubleLength int xLedgerStart, xLedgerEnd; if (doubleLength) { - if (dynamic_cast(element)->GetDrawingStemDir() == STEMDIRECTION_down) { + Chord *chord = dynamic_cast(element); + assert( chord ); + if (chord->GetDrawingStemDir() == STEMDIRECTION_down) { xLedgerStart = element->GetDrawingX() - ledge - noteDiameter; xLedgerEnd = element->GetDrawingX() + ledge; } @@ -560,11 +579,14 @@ void View::DrawLedgerLines ( DeviceContext *dc, LayerElement *element, Staff *st void View::DrawRest ( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ) { - assert(layer); // Pointer to layer cannot be NULL - assert(staff); // Pointer to staff cannot be NULL - assert(dynamic_cast(element)); // Element must be a Rest + assert( dc ); + assert( element ); + assert( layer ); + assert( staff ); + assert( measure ); Rest *rest = dynamic_cast(element); + assert( rest ); bool drawingCueSize = rest->IsCueSize(); int drawingDur = rest->GetActualDur(); @@ -599,11 +621,13 @@ void View::DrawRest ( DeviceContext *dc, LayerElement *element, Layer *layer, St void View::DrawMRest(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure) { - assert(layer); // Pointer to layer cannot be NULL" - assert(staff); // Pointer to staff cannot be NULL" - assert(dynamic_cast(element)); // Element must be a MultiRest" + assert( dc ); + assert( element ); + assert( layer ); + assert( staff ); + assert( measure ); - //MRest *mrest = dynamic_cast(element); + assert( dynamic_cast(element) ); // Element must be a MultiRest" dc->StartGraphic( element, "", element->GetUuid() ); @@ -626,15 +650,18 @@ void View::DrawMRest(DeviceContext *dc, LayerElement *element, Layer *layer, Sta /** This function draws multi-measure rests **/ void View::DrawMultiRest(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure) -{ - int x1, x2, y1, y2, length; - - assert(layer); // Pointer to layer cannot be NULL" - assert(staff); // Pointer to staff cannot be NULL" - assert(dynamic_cast(element)); // Element must be a Symbol" +{ + assert( dc ); + assert( element ); + assert( layer ); + assert( staff ); + assert( measure ); MultiRest *multirest = dynamic_cast(element); + assert( multirest ); + int x1, x2, y1, y2, length; + dc->StartGraphic( element, "", element->GetUuid() ); int x = element->GetDrawingX(); @@ -849,32 +876,33 @@ void View::DrawDots ( DeviceContext *dc, int x, int y, unsigned char dots, Staff void View::DrawBarline( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ) { - assert(layer); // Pointer to layer cannot be NULL" - assert(staff); // Pointer to staff cannot be NULL" - assert(staff->m_parent); // Pointer to system cannot be NULL" - assert(dynamic_cast(element)); // Element must be a Barline" + assert( dc ); + assert( element ); + assert( layer ); + assert( staff ); + assert( measure ); Barline *barLine = dynamic_cast(element); - int x = element->GetDrawingX(); + assert( barLine ); dc->StartGraphic( element, "", element->GetUuid() ); - if (barLine->m_partialBarline) - { - DrawPartialBarline ( dc, dynamic_cast( staff->m_parent ), x, staff); - } - else - { - int y = staff->GetDrawingY(); - DrawBarline( dc, y, y - m_doc->m_drawingStaffSize[staff->staffSize], barLine ); - } + int y = staff->GetDrawingY(); + DrawBarline( dc, y, y - m_doc->m_drawingStaffSize[staff->staffSize], barLine ); dc->EndGraphic(element, this ); } void View::DrawChord( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ) { + assert( dc ); + assert( element ); + assert( layer ); + assert( staff ); + assert( measure ); + Chord* chord = dynamic_cast(element); + assert( chord ); int staffSize = staff->staffSize; int staffY = staff->GetDrawingY(); @@ -886,7 +914,7 @@ void View::DrawChord( DeviceContext *dc, LayerElement *element, Layer *layer, St bool inBeam = false; // Get the immadiate parent of the note // to see if beamed or not - Beam *beam_parent = reinterpret_cast(chord->GetFirstParent( BEAM )); + Beam *beam_parent = dynamic_cast(chord->GetFirstParent( BEAM )); // This note is beamed and cue sized if (beam_parent != NULL) { @@ -1080,11 +1108,14 @@ void View::DrawChord( DeviceContext *dc, LayerElement *element, Layer *layer, St void View::DrawClef( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ) { - assert(layer); // Pointer to layer cannot be NULL" - assert(staff); // Pointer to staff cannot be NULL" - assert(dynamic_cast(element)); // Element must be a Clef" + assert( dc ); + assert( element ); + assert( layer ); + assert( staff ); + assert( measure ); Clef *clef = dynamic_cast(element); + assert( clef ); dc->StartGraphic( element, "", element->GetUuid() ); @@ -1165,7 +1196,8 @@ void View::DrawClef( DeviceContext *dc, LayerElement *element, Layer *layer, Sta void View::DrawMeterSigFigures( DeviceContext *dc, int x, int y, int num, int numBase, Staff *staff) { - assert( dc ); // DC cannot be NULL + assert( dc ); + assert( staff ); int ynum, yden; std::wstring wtext; @@ -1200,11 +1232,14 @@ void View::DrawMeterSigFigures( DeviceContext *dc, int x, int y, int num, int nu void View::DrawMeterSig( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ) { - assert(layer); // Pointer to layer cannot be NULL" - assert(staff); // Pointer to staff cannot be NULL" - assert(dynamic_cast(element)); // Element must be a Mensur" + assert( dc ); + assert( element ); + assert( layer ); + assert( staff ); + assert( measure ); MeterSig *meterSig = dynamic_cast(element); + assert( meterSig ); dc->StartGraphic( element, "", element->GetUuid() ); @@ -1408,11 +1443,15 @@ bool View::CalculateAccidX(Staff *staff, Accid *accid, Chord *chord, bool adjust void View::DrawAccid( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure, Accid *prevAccid ) { - assert(layer); // Pointer to layer cannot be NULL" - assert(staff); // Pointer to staff cannot be NULL" - assert(dynamic_cast(element)); // Element must be a Symbol" + assert( dc ); + assert( element ); + assert( layer ); + assert( staff ); + assert( measure ); Accid *accid = dynamic_cast(element); + assert( accid ); + dc->StartGraphic( element, "", element->GetUuid() ); // Parent will be NULL if we are drawing a note @accid (see DrawNote) - the y value is already set @@ -1427,7 +1466,7 @@ void View::DrawAccid( DeviceContext *dc, LayerElement *element, Layer *layer, St // position is currently only above the staff int y = staff->GetDrawingY(); // look at the note position and adjust it if necessary - Note *note = reinterpret_cast( accid->GetFirstParent( NOTE, MAX_ACCID_DEPTH ) ); + Note *note = dynamic_cast( accid->GetFirstParent( NOTE, MAX_ACCID_DEPTH ) ); if ( note ) { if ( note->GetDrawingY() > y ) { y = note->GetDrawingY() + m_doc->m_drawingUnit[staff->staffSize]; @@ -1488,10 +1527,13 @@ void View::DrawAccid( DeviceContext *dc, LayerElement *element, Layer *layer, St dc->EndGraphic(element, this ); } -void View::DrawSpace(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure) { - - assert(layer); // Pointer to layer cannot be NULL" - assert(staff); // Pointer to staff cannot be NULL" +void View::DrawSpace(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure) +{ + assert( dc ); + assert( element ); + assert( layer ); + assert( staff ); + assert( measure ); dc->StartGraphic( element, "", element->GetUuid() ); dc->DrawPlaceholder( ToDeviceContextX( element->GetDrawingX() ), ToDeviceContextY( element->GetDrawingY() ) ); @@ -1500,11 +1542,15 @@ void View::DrawSpace(DeviceContext *dc, LayerElement *element, Layer *layer, Sta void View::DrawCustos( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ) { - assert(layer); // Pointer to layer cannot be NULL" - assert(staff); // Pointer to staff cannot be NULL" - assert(dynamic_cast(element)); // Element must be a Symbol" + assert( dc ); + assert( element ); + assert( layer ); + assert( staff ); + assert( measure ); Custos *custos = dynamic_cast(element); + assert( custos ); + dc->StartGraphic( element, "", element->GetUuid() ); element->SetDrawingY( element->GetDrawingY() + CalculatePitchPosY( staff, custos->GetPloc(), layer->GetClefOffset( element ), custos->GetOloc()) ); @@ -1523,11 +1569,15 @@ void View::DrawCustos( DeviceContext *dc, LayerElement *element, Layer *layer, S void View::DrawDot( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ) { - assert(layer); // Pointer to layer cannot be NULL" - assert(staff); // Pointer to staff cannot be NULL" - assert(dynamic_cast(element)); // Element must be a Symbol" + assert( dc ); + assert( element ); + assert( layer ); + assert( staff ); + assert( measure ); Dot *dot = dynamic_cast(element); + assert( dot ); + dc->StartGraphic( element, "", element->GetUuid() ); element->SetDrawingY( element->GetDrawingY() + CalculatePitchPosY( staff, dot->GetPloc(), layer->GetClefOffset( element ), dot->GetOloc()) ); @@ -1562,6 +1612,7 @@ int View::GetSylY( Syl *syl, Staff *staff ) void View::DrawSyl( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ) { Syl *syl = dynamic_cast(element); + assert( syl ); if ( !syl->GetStart() ) { LogDebug("Syl parent note was not found"); @@ -1592,7 +1643,7 @@ void View::DrawSyl( DeviceContext *dc, LayerElement *element, Layer *layer, Staf dc->ResetBrush(); if (syl->GetStart() && syl->GetEnd()) { - System *currentSystem = reinterpret_cast( measure->GetFirstParent( SYSTEM ) ); + System *currentSystem = dynamic_cast( measure->GetFirstParent( SYSTEM ) ); // Postpone the drawing of the syl to the end of the system; this will call DrawSylConnector // that will look if the last note is in the same system (or not) and draw the connectors accordingly if (currentSystem) { @@ -1606,8 +1657,9 @@ void View::DrawSyl( DeviceContext *dc, LayerElement *element, Layer *layer, Staf void View::DrawSylConnector( DeviceContext *dc, Syl *syl, int x1, int x2, Staff *staff, char spanningType, DocObject *graphic ) { - assert( syl->GetStart() && syl->GetEnd()); - if ( !syl->GetStart() || !syl->GetEnd()) return; + assert( syl ); + assert( syl->GetStart() && syl->GetEnd() ); + if ( !syl->GetStart() || !syl->GetEnd() ) return; int y = GetSylY(syl, staff); int w, h; @@ -1694,7 +1746,14 @@ void View::DrawSylConnectorLines( DeviceContext *dc, int x1, int x2, int y, Syl void View::DrawVerse( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ) { + assert( dc ); + assert( element ); + assert( layer ); + assert( staff ); + assert( measure ); + Verse *verse = dynamic_cast(element); + assert( verse ); dc->StartGraphic( verse, "", verse->GetUuid() ); @@ -1706,12 +1765,16 @@ void View::DrawVerse( DeviceContext *dc, LayerElement *element, Layer *layer, St void View::DrawKeySig( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ) { - assert(layer); // Pointer to layer cannot be NULL" - assert(staff); // Pointer to staff cannot be NULL" + assert( dc ); + assert( element ); + assert( layer ); + assert( staff ); + assert( measure ); - KeySig *ks = dynamic_cast(element); + KeySig *keySig = dynamic_cast(element); + assert( keySig ); - if (ks->GetAlterationNumber()==0) { + if (keySig->GetAlterationNumber()==0) { return; } @@ -1725,13 +1788,14 @@ void View::DrawKeySig( DeviceContext *dc, LayerElement *element, Layer *layer, S dc->StartGraphic( element, "", element->GetUuid() ); - for (int i = 0; i < ks->GetAlterationNumber(); i++) { + for (int i = 0; i < keySig->GetAlterationNumber(); i++) { // HARDCODED x = element->GetDrawingX() + (m_doc->m_drawingAccidWidth[staff->staffSize][0] * 1.2) * i; - y = staff->GetDrawingY() + CalculatePitchPosY( staff, ks->GetAlterationAt(i), layer->GetClefOffset( element ), ks->GetOctave(ks->GetAlterationAt(i), c->GetClefId()));; + y = staff->GetDrawingY() + CalculatePitchPosY( staff, keySig->GetAlterationAt(i), layer->GetClefOffset( element ), + keySig->GetOctave(keySig->GetAlterationAt(i), c->GetClefId()));; - if (ks->GetAlteration() == ACCID_FLAT) + if (keySig->GetAlteration() == ACCID_FLAT) symb = SMUFL_E260_accidentalFlat; else symb = SMUFL_E262_accidentalSharp; @@ -1743,12 +1807,12 @@ void View::DrawKeySig( DeviceContext *dc, LayerElement *element, Layer *layer, S } -void View::DrawAcciaccaturaSlash(DeviceContext *dc, LayerElement *element) { - +void View::DrawAcciaccaturaSlash(DeviceContext *dc, LayerElement *element) +{ Note *note = dynamic_cast(element); assert( note ); - Staff *staff = reinterpret_cast( note->GetFirstParent( STAFF ) ); + Staff *staff = dynamic_cast( note->GetFirstParent( STAFF ) ); assert( staff ); if (note->GetActualDur() < DUR_8) @@ -1786,7 +1850,8 @@ void View::DrawAcciaccaturaSlash(DeviceContext *dc, LayerElement *element) { note - for breves and semibreves, only above the staff - for flagged notes, the fermata is on the side of the notehead */ -void View::DrawFermata(DeviceContext *dc, LayerElement *element, Staff *staff) { +void View::DrawFermata(DeviceContext *dc, LayerElement *element, Staff *staff) +{ int x, y; int emb_offset = 0; // if there is and embellishment, offset the note up @@ -1795,8 +1860,9 @@ void View::DrawFermata(DeviceContext *dc, LayerElement *element, Staff *staff) { x = element->GetDrawingX() - m_doc->m_drawingDoubleUnit[staff->staffSize]; // First case, notes - if (dynamic_cast(element)) { + if (element->Is() == NOTE) { Note *note = dynamic_cast(element); + assert( note ); /* // stem down or semibreve/longa, fermata up! @@ -1831,7 +1897,7 @@ void View::DrawFermata(DeviceContext *dc, LayerElement *element, Staff *staff) { DrawSmuflCode ( dc, x, y, LEIPZIG_FERMATA_DOWN, staff, false ); } */ - } else if (dynamic_cast(element)) { + } else if (element->Is() == REST) { // this is a rest // rests for the moment are always in the staff // so just place the fermata above the staff @@ -1843,7 +1909,8 @@ void View::DrawFermata(DeviceContext *dc, LayerElement *element, Staff *staff) { // Draw a trill above the notehead // This function works as the up-fermata portion of DrawFermata // if there are many symbols to draw we could make a generalized function -void View::DrawTrill(DeviceContext *dc, LayerElement *element, Staff *staff) { +void View::DrawTrill(DeviceContext *dc, LayerElement *element, Staff *staff) +{ int x, y; // It shoud be moved according to half of the trill size diff --git a/src/view_graph.cpp b/src/view_graph.cpp index bdc7148fbb2..5092b72f316 100644 --- a/src/view_graph.cpp +++ b/src/view_graph.cpp @@ -24,7 +24,7 @@ namespace vrv { void View::DrawVerticalLine ( DeviceContext *dc, int y1, int y2, int x1, int nbr) { - assert( dc ); // DC cannot be NULL + assert( dc ); dc->SetPen( m_currentColour, std::max( 1, ToDeviceContextX(nbr) ), AxSOLID ); dc->SetBrush( m_currentColour, AxSOLID ); @@ -38,7 +38,7 @@ void View::DrawVerticalLine ( DeviceContext *dc, int y1, int y2, int x1, int nbr void View::DrawHorizontalLine ( DeviceContext *dc, int x1, int x2, int y1, int nbr) { - assert( dc ); // DC cannot be NULL + assert( dc ); dc->SetPen( m_currentColour, std::max( 1, ToDeviceContextX(nbr) ), AxSOLID ); dc->SetBrush( m_currentColour, AxSOLID ); @@ -52,7 +52,7 @@ void View::DrawHorizontalLine ( DeviceContext *dc, int x1, int x2, int y1, int n void View::DrawFullRectangle( DeviceContext *dc, int x1, int y1, int x2, int y2 ) /* dessine rectangle plein */ { - assert( dc ); // DC cannot be NULL + assert( dc ); SwapY( &y1, &y2 ); @@ -107,40 +107,35 @@ void View::DrawDot ( DeviceContext *dc, int x, int y ) void View::DrawSmuflCode ( DeviceContext *dc, int x, int y, wchar_t code, int staffSize, bool dimin ) -{ +{ + assert( dc ); + int fontCorr = 0; if (dc->CorrectMusicAscent()) { fontCorr = m_doc->m_drawingFontHeightAscent[staffSize][dimin]; } - - assert( dc ); // DC cannot be NULL + + dc->SetBackground( AxBLUE ); + dc->SetBackgroundMode( AxTRANSPARENT ); + std::wstring str; + str.push_back(code); + + dc->SetBrush( m_currentColour, AxSOLID ); + dc->SetFont( &m_doc->m_drawingSmuflFonts[staffSize][dimin] ); - if ( dc) - { - dc->SetBackground( AxBLUE ); - dc->SetBackgroundMode( AxTRANSPARENT ); - - std::wstring str; - str.push_back(code); - - dc->SetBrush( m_currentColour, AxSOLID ); - dc->SetFont( &m_doc->m_drawingSmuflFonts[staffSize][dimin] ); - - dc->DrawMusicText( str, ToDeviceContextX(x), ToDeviceContextY(y + fontCorr) ); - - dc->ResetFont(); - dc->ResetBrush(); + dc->DrawMusicText( str, ToDeviceContextX(x), ToDeviceContextY(y + fontCorr) ); - } + dc->ResetFont(); + dc->ResetBrush(); return; } void View::DrawSmuflString ( DeviceContext *dc, int x, int y, std::wstring s, int centrer, int staffSize) { - assert( dc ); // DC cannot be NULL + assert( dc ); int fontCorr = 0; @@ -169,7 +164,7 @@ void View::DrawSmuflString ( DeviceContext *dc, int x, int y, std::wstring s, in void View::DrawLyricString ( DeviceContext *dc, int x, int y, std::wstring s, int staffSize) { - assert( dc ); // DC cannot be NULL + assert( dc ); dc->StartText( ToDeviceContextX( x ), ToDeviceContextY( y ) ); @@ -200,6 +195,8 @@ void View::DrawLyricString ( DeviceContext *dc, int x, int y, std::wstring s, in void View::DrawTieOrSlurBezier(DeviceContext *dc, int x, int y, int x1, int y1, bool direction) { + assert( dc ); + int height = std::max( MIN_TIE_HEIGHT * DEFINITON_FACTOR, std::min( 5 * m_doc->m_drawingDoubleUnit[0] / 3, abs( x1 - x ) / 4 ) ); int thickness = std::max( m_doc->m_drawingDoubleUnit[0] / 3, MIN_TIE_THICKNESS * DEFINITON_FACTOR ); diff --git a/src/view_mensural.cpp b/src/view_mensural.cpp index d6e68063827..55da4a7c000 100644 --- a/src/view_mensural.cpp +++ b/src/view_mensural.cpp @@ -34,11 +34,14 @@ bool View::s_drawingLigObliqua = false; // marque le 1e passage pour une oblique void View::DrawMensuralNote ( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ) { - assert(layer); // Pointer to layer cannot be NULL" - assert(staff); // Pointer to staff cannot be NULL" - assert(dynamic_cast(element)); // Element must be a Note" + assert( dc ); + assert( element ); + assert( layer ); + assert( staff ); + assert( measure ); Note *note = dynamic_cast(element); + assert( note ); int staffSize = staff->staffSize; int noteY = element->GetDrawingY(); @@ -150,11 +153,14 @@ void View::DrawMensuralNote ( DeviceContext *dc, LayerElement *element, Layer *l void View::DrawMensur( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ) { - assert(layer); // Pointer to layer cannot be NULL" - assert(staff); // Pointer to staff cannot be NULL" - assert(dynamic_cast(element)); // Element must be a Mensur" + assert( dc ); + assert( element ); + assert( layer ); + assert( staff ); + assert( measure ); Mensur *mensur = dynamic_cast(element); + assert( mensur ); dc->StartGraphic( element, "", element->GetUuid() ); @@ -200,7 +206,8 @@ void View::DrawMensur( DeviceContext *dc, LayerElement *element, Layer *layer, S void View::DrawMensurCircle( DeviceContext *dc, int x, int yy, Staff *staff ) { - assert( dc ); // DC cannot be NULL + assert( dc ); + assert( staff ); int y = ToDeviceContextY (yy - m_doc->m_drawingDoubleUnit[ staff->staffSize ] * 2); int r = ToDeviceContextX( m_doc->m_drawingDoubleUnit[ staff->staffSize ]); @@ -216,7 +223,8 @@ void View::DrawMensurCircle( DeviceContext *dc, int x, int yy, Staff *staff ) void View::DrawMensurHalfCircle( DeviceContext *dc, int x, int yy, Staff *staff ) { - assert( dc ); // DC cannot be NULL + assert( dc ); + assert( staff ); dc->SetPen( m_currentColour, m_doc->m_style->m_staffLineWidth, AxSOLID ); dc->SetBrush( m_currentColour, AxTRANSPARENT ); @@ -237,7 +245,8 @@ void View::DrawMensurHalfCircle( DeviceContext *dc, int x, int yy, Staff *staff void View::DrawMensurReversedHalfCircle( DeviceContext *dc, int x, int yy, Staff *staff ) { - assert( dc ); // DC cannot be NULL + assert( dc ); + assert (staff ); dc->SetPen( m_currentColour, m_doc->m_style->m_staffLineWidth, AxSOLID ); dc->SetBrush( m_currentColour, AxTRANSPARENT ); @@ -259,7 +268,8 @@ void View::DrawMensurReversedHalfCircle( DeviceContext *dc, int x, int yy, Staff void View::DrawMensurDot ( DeviceContext *dc, int x, int yy, Staff *staff ) { - assert( dc ); // DC cannot be NULL + assert( dc ); + assert( staff ); int y = ToDeviceContextY (yy - m_doc->m_drawingDoubleUnit[ staff->staffSize ] * 2); int r = m_doc->m_drawingUnit[staff->staffSize] * 2 / 3; @@ -278,7 +288,8 @@ void View::DrawMensurDot ( DeviceContext *dc, int x, int yy, Staff *staff ) void View::DrawMensurSlash ( DeviceContext *dc, int a, int yy, Staff *staff ) { - assert( dc ); // DC cannot be NULL + assert( dc ); + assert( staff ); int y1 = yy; int y2 = y1 - m_doc->m_drawingStaffSize[ staff->staffSize ]; @@ -314,12 +325,13 @@ void View::CalculateLigaturePosX ( LayerElement *element, Layer *layer, Staff *s void View::DrawMaximaToBrevis( DeviceContext *dc, int y, LayerElement *element, Layer *layer, Staff *staff ) { - assert(layer); // Pointer to layer cannot be NULL" - assert(staff); // Pointer to staff cannot be NULL" - assert(dynamic_cast(element)); // Element must be a Note" - + assert( dc ); + assert( element ); + assert( layer ); + assert( staff ); Note *note = dynamic_cast(element); + assert( note ); int xn, x1, x2, y1, y2, y3, y4; // int yy2, y5; // unused @@ -382,12 +394,13 @@ void View::DrawMaximaToBrevis( DeviceContext *dc, int y, LayerElement *element, void View::DrawLigature ( DeviceContext *dc, int y, LayerElement *element, Layer *layer, Staff *staff ) { - assert(layer); // Pointer to layer cannot be NULL" - assert(staff); // Pointer to staff cannot be NULL" - assert(dynamic_cast(element)); // Element must be a Note" - - + assert( dc ); + assert( element ); + assert( layer ); + assert( staff ); + Note *note = dynamic_cast(element); + assert( note ); int xn, x1, x2, y1, y2, y3, y4; // int yy2, y5; // unused diff --git a/src/view_page.cpp b/src/view_page.cpp index 8b646273bb6..86ee8a5e92c 100644 --- a/src/view_page.cpp +++ b/src/view_page.cpp @@ -45,7 +45,7 @@ namespace vrv { void View::DrawCurrentPage( DeviceContext *dc, bool background ) { - assert( dc ); // DC cannot be NULL + assert( dc ); assert( m_doc ); m_currentPage = m_doc->SetDrawingPage( m_pageIdx ); @@ -87,7 +87,8 @@ void View::DrawCurrentPage( DeviceContext *dc, bool background ) for (i = 0; i < m_currentPage->GetSystemCount(); i++) { - system = dynamic_cast(m_currentPage->m_children[i]); + // cast to System check in DrawSystem + system = dynamic_cast(m_currentPage->m_children.at(i)); DrawSystem( dc, system ); } @@ -103,7 +104,8 @@ void View::DrawCurrentPage( DeviceContext *dc, bool background ) void View::DrawSystem( DeviceContext *dc, System *system ) { - assert( system ); // other asserted before + assert( dc ); + assert( system ); dc->StartGraphic( system, "", system->GetUuid() ); @@ -111,7 +113,7 @@ void View::DrawSystem( DeviceContext *dc, System *system ) system->ResetDrawingList(); // First get the first measure of the system - Measure *measure = reinterpret_cast(system->FindChildByType( MEASURE ) ); + Measure *measure = dynamic_cast(system->FindChildByType( MEASURE ) ); if ( measure ) { // NULL for the Barline parameters indicates that we are drawing the scoreDef DrawScoreDef( dc, &m_drawingScoreDef, measure, system->GetDrawingX(), NULL ); @@ -128,17 +130,18 @@ void View::DrawSystem( DeviceContext *dc, System *system ) DrawSystemChildren(dc, system, system); // first draw the beams - DrawSystemList(dc, system, &typeid(Syl) ); - DrawSystemList(dc, system, &typeid(Tie) ); - DrawSystemList(dc, system, &typeid(Slur) ); + DrawSystemList(dc, system, SYL ); + DrawSystemList(dc, system, TIE ); + DrawSystemList(dc, system, SLUR ); dc->EndGraphic(system, this ); } -void View::DrawSystemList( DeviceContext *dc, System *system, const std::type_info *elementType ) +void View::DrawSystemList( DeviceContext *dc, System *system, const ClassId classId ) { - assert( dc ); // DC cannot be NULL + assert( dc ); + assert( system ); ListOfObjects *drawingList = system->GetDrawingList(); DocObject *element = NULL; @@ -147,16 +150,17 @@ void View::DrawSystemList( DeviceContext *dc, System *system, const std::type_in for (iter = drawingList->begin(); iter != drawingList->end(); ++iter) { + // We need to cast to DocObject for calling DrawTimeSpanningElement element = dynamic_cast(*iter); if (!element) continue; - if ( (typeid(*element) == *elementType) && (*elementType == typeid(Syl) ) ) { + if ( (element->Is() == classId) && (classId == SYL) ) { DrawTimeSpanningElement( dc, element, system ); } - if ( (typeid(*element) == *elementType) && (*elementType == typeid(Tie) ) ) { + if ( (element->Is() == classId) && (classId == TIE) ) { DrawTimeSpanningElement(dc, element, system ); } - if ( (typeid(*element) == *elementType) && (*elementType == typeid(Slur) ) ) { + if ( (element->Is() == classId) && (classId == SLUR) ) { DrawTimeSpanningElement(dc, element, system ); } } @@ -164,12 +168,12 @@ void View::DrawSystemList( DeviceContext *dc, System *system, const std::type_in void View::DrawScoreDef( DeviceContext *dc, ScoreDef *scoreDef, Measure *measure, int x, Barline *barLine ) { - assert( scoreDef ); // other asserted before - + assert( dc ); + assert( scoreDef ); // we need at least one measure to be able to draw the groups - we need access to the staff elements, assert( measure ); - StaffGrp *staffGrp = reinterpret_cast(scoreDef->FindChildByType( STAFF_GRP ) ); + StaffGrp *staffGrp = dynamic_cast(scoreDef->FindChildByType( STAFF_GRP ) ); if ( !staffGrp ) { return; } @@ -194,6 +198,7 @@ void View::DrawScoreDef( DeviceContext *dc, ScoreDef *scoreDef, Measure *measure void View::DrawStaffGrp( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp, int x, bool topStaffGrp ) { + assert( dc ); assert( measure ); assert( staffGrp ); @@ -260,6 +265,7 @@ void View::DrawStaffGrp( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp void View::DrawStaffDefLabels( DeviceContext *dc, Measure *measure, ScoreDef *scoreDef, bool abbreviations ) { + assert( dc ); assert( measure ); assert( scoreDef ); @@ -278,7 +284,7 @@ void View::DrawStaffDefLabels( DeviceContext *dc, Measure *measure, ScoreDef *sc AttCommonNComparison comparison( STAFF, staffDef->GetN() ); Staff *staff = dynamic_cast(measure->FindChildByAttComparison(&comparison, 1 )); - System *system = reinterpret_cast(measure->GetFirstParent( SYSTEM ) ); + System *system = dynamic_cast(measure->GetFirstParent( SYSTEM ) ); if (!staff || !system) { LogDebug("Staff or System missing in View::DrawStaffDefLabels"); @@ -320,6 +326,8 @@ void View::DrawStaffDefLabels( DeviceContext *dc, Measure *measure, ScoreDef *sc void View::DrawBracket ( DeviceContext *dc, int x, int y1, int y2, int staffSize) { + assert( dc ); + int x1, x2; x2 = x - m_doc->m_drawingBeamWidth[0]; @@ -339,11 +347,11 @@ void View::DrawBracket ( DeviceContext *dc, int x, int y1, int y2, int staffSize void View::DrawBrace ( DeviceContext *dc, int x, int y1, int y2, int staffSize) -{ +{ + assert( dc ); + int new_coords[2][6]; Point points[4]; - - assert( dc ); // DC cannot be NULL int penWidth = m_doc->m_style->m_stemWidth; y1 -= penWidth; @@ -430,8 +438,10 @@ void View::DrawBrace ( DeviceContext *dc, int x, int y1, int y2, int staffSize) void View::DrawBarlines( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp, Barline *barLine ) { + assert( dc ); assert( measure ); assert( staffGrp ); + assert( barLine ); if ( !staffGrp->GetBarthru() ) { // recursively draw the children (staffDef or staffGrp) @@ -446,7 +456,7 @@ void View::DrawBarlines( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp } else if ( childStaffDef ) { AttCommonNComparison comparison( STAFF, childStaffDef->GetN() ); - Staff *staff = reinterpret_cast(measure->FindChildByAttComparison(&comparison, 1 ) ); + Staff *staff = dynamic_cast(measure->FindChildByAttComparison(&comparison, 1 ) ); if (!staff ) { LogDebug("Could not get staff (%d) while drawing staffGrp - Vrv::DrawBarlines", childStaffDef->GetN() ); continue; @@ -517,6 +527,7 @@ void View::DrawBarlines( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp void View::DrawBarline( DeviceContext *dc, int y_top, int y_bottom, Barline *barLine ) { assert( dc ); + assert( barLine ); // adjust the top and bottom y_top += m_doc->m_style->m_staffLineWidth / 2; @@ -563,7 +574,10 @@ void View::DrawBarline( DeviceContext *dc, int y_top, int y_bottom, Barline *bar void View::DrawBarlineDots ( DeviceContext *dc, StaffDef *staffDef, Staff *staff, Barline *barLine ) { - assert( dc ); // DC cannot be NULL + assert( dc ); + assert( staffDef ); + assert( staff ); + assert( barLine ); int x = barLine->GetDrawingX(); int x1 = x - 2 * m_doc->m_drawingBeamWidth[0] - m_doc->m_style->m_barlineWidth; @@ -587,40 +601,15 @@ void View::DrawBarlineDots ( DeviceContext *dc, StaffDef *staffDef, Staff *staff return; } - -void View::DrawPartialBarline ( DeviceContext *dc, System *system, int x, Staff *pportee) -{ - assert( dc ); // DC cannot be NULL - - if ( !system ) { - return; - } - - /* ax3 - int b, bb; - - Staff *next = system->GetNext( NULL ); - if ( next ) - { - b = pportee->m_drawingY - m_doc->m_drawingStaffSize[ pportee->staffSize ]*2; - bb = next->m_drawingY - m_doc->m_drawingStaffSize[ next->staffSize]; - - DrawVerticalLine ( dc, b, bb, x, m_doc->m_style->m_barlineWidth); - - } - */ - -} - - - //---------------------------------------------------------------------------- // View - Measure //---------------------------------------------------------------------------- void View::DrawMeasure( DeviceContext *dc, Measure *measure, System *system ) { - assert( dc ); // DC cannot be NULL + assert( dc ); + assert( measure ); + assert( system ); // This is a special case where we do not draw (SVG, Bounding boxes, etc.) the measure if un-measured music if ( measure->IsMeasuredMusic()) { @@ -643,15 +632,19 @@ void View::DrawMeasure( DeviceContext *dc, Measure *measure, System *system ) void View::DrawMeasureElement( DeviceContext *dc, MeasureElement *element, Measure *measure, System *system) { - assert(system); // Pointer to layer cannot be NULL" - assert(measure); // Pointer to staff cannot be NULL" + assert( dc ); + assert( system ); + assert( measure ); + assert( element ); - if (dynamic_cast(element)) { + if (element->HasInterface(INTERFACE_TIME_SPANNING)) { + // creating placeholder dc->StartGraphic( element, "", element->GetUuid() ); dc->EndGraphic( element, this); system->AddToDrawingList(element); } - else if (dynamic_cast(element)) { + else if (element->Is() == STAFF) { + // cast to Staff check in DrawStaff DrawStaff(dc, dynamic_cast(element), measure, system); } } @@ -715,7 +708,10 @@ int View::CalculateRestPosY ( Staff *staff, char duration) void View::DrawStaff( DeviceContext *dc, Staff *staff, Measure *measure, System *system ) { - assert( dc ); // DC cannot be NULL + assert( dc ); + assert( staff ); + assert( measure ); + assert( system ); dc->StartGraphic( staff, "", staff->GetUuid()); @@ -739,7 +735,10 @@ void View::DrawStaff( DeviceContext *dc, Staff *staff, Measure *measure, System void View::DrawStaffLines( DeviceContext *dc, Staff *staff, Measure *measure, System *system ) { - assert( dc ); // DC cannot be NULL + assert( dc ); + assert( staff ); + assert( measure ); + assert( system ); if (staff->invisible) return; @@ -775,14 +774,18 @@ void View::DrawStaffLines( DeviceContext *dc, Staff *staff, Measure *measure, Sy void View::DrawTimeSpanningElement( DeviceContext *dc, DocObject *element, System *system ) { - assert(dynamic_cast(element)); // Element must be a TimeSpanningInterface + assert( dc ); + assert( element ); + assert( system ); + TimeSpanningInterface *interface = dynamic_cast(element); + assert( interface ); if ( !interface->HasStartAndEnd() ) return; // Get the parent system of the first and last note - System *parentSystem1 = reinterpret_cast( interface->GetStart()->GetFirstParent( SYSTEM ) ); - System *parentSystem2 = reinterpret_cast( interface->GetEnd()->GetFirstParent( SYSTEM ) ); + System *parentSystem1 = dynamic_cast( interface->GetStart()->GetFirstParent( SYSTEM ) ); + System *parentSystem2 = dynamic_cast( interface->GetEnd()->GetFirstParent( SYSTEM ) ); int x1, x2; Staff *staff = NULL; @@ -792,7 +795,7 @@ void View::DrawTimeSpanningElement( DeviceContext *dc, DocObject *element, Syste // The both correspond to the current system, which means no system break in-between (simple case) if (( system == parentSystem1 ) && ( system == parentSystem2 )) { // Get the parent staff for calculating the y position - staff = reinterpret_cast( interface->GetStart()->GetFirstParent( STAFF ) ); + staff = dynamic_cast( interface->GetStart()->GetFirstParent( STAFF ) ); if ( !Check( staff ) ) return; x1 = interface->GetStart()->GetDrawingX(); @@ -802,9 +805,9 @@ void View::DrawTimeSpanningElement( DeviceContext *dc, DocObject *element, Syste // Only the first parent is the same, this means that the element is "open" at the end of the system else if ( system == parentSystem1 ) { // We need the last measure of the system for x2 - Measure *last = reinterpret_cast( system->FindChildByType( MEASURE, 1, BACKWARD ) ); + Measure *last = dynamic_cast( system->FindChildByType( MEASURE, 1, BACKWARD ) ); if ( !Check( last ) ) return; - staff = reinterpret_cast( interface->GetStart()->GetFirstParent( STAFF ) ); + staff = dynamic_cast( interface->GetStart()->GetFirstParent( STAFF ) ); if ( !Check( staff ) ) return; x1 = interface->GetStart()->GetDrawingX(); @@ -815,10 +818,10 @@ void View::DrawTimeSpanningElement( DeviceContext *dc, DocObject *element, Syste // We are in the system of the last note - draw the element from the beginning of the system else if ( system == parentSystem2 ) { // We need the first measure of the system for x1 - Measure *first = reinterpret_cast( system->FindChildByType( MEASURE, 1, FORWARD ) ); + Measure *first = dynamic_cast( system->FindChildByType( MEASURE, 1, FORWARD ) ); if ( !Check( first ) ) return; // Get the staff of the first note - however, not the staff we need - Staff *lastStaff = reinterpret_cast( interface->GetEnd()->GetFirstParent( STAFF ) ); + Staff *lastStaff = dynamic_cast( interface->GetEnd()->GetFirstParent( STAFF ) ); if ( !Check( lastStaff ) ) return; // We need the first staff from the current system, i.e., the first measure. AttCommonNComparison comparison( STAFF, lastStaff->GetN() ); @@ -829,7 +832,7 @@ void View::DrawTimeSpanningElement( DeviceContext *dc, DocObject *element, Syste } // Also try to get a first note - we should change this once we have a x position in measure that // takes into account the scoreDef - Note *firstNote = reinterpret_cast( staff->FindChildByType( NOTE ) ); + Note *firstNote = dynamic_cast( staff->FindChildByType( NOTE ) ); x1 = firstNote ? firstNote->GetDrawingX() - 2 * m_doc->m_drawingDoubleUnit[staff->staffSize] : first->GetDrawingX(); x2 = interface->GetEnd()->GetDrawingX(); @@ -838,16 +841,16 @@ void View::DrawTimeSpanningElement( DeviceContext *dc, DocObject *element, Syste // Rare case where neither the first note and the last note are in the current system - draw the connector throughout the system else { // We need the first measure of the system for x1 - Measure *first = reinterpret_cast( system->FindChildByType( MEASURE, 1, FORWARD ) ); + Measure *first = dynamic_cast( system->FindChildByType( MEASURE, 1, FORWARD ) ); if ( !Check( first ) ) return; // Also try to get a first note - we should change this once we have a x position in measure that // takes into account the scoreDef - Note *firstNote = reinterpret_cast( first->FindChildByType( NOTE ) ); + Note *firstNote = dynamic_cast( first->FindChildByType( NOTE ) ); // We need the last measure of the system for x2 - Measure *last = reinterpret_cast( system->FindChildByType( MEASURE, 1, BACKWARD ) ); + Measure *last = dynamic_cast( system->FindChildByType( MEASURE, 1, BACKWARD ) ); if ( !Check( last ) ) return; // Get the staff of the first note - however, not the staff we need - Staff *firstStaff = reinterpret_cast( interface->GetStart()->GetFirstParent( STAFF ) ); + Staff *firstStaff = dynamic_cast( interface->GetStart()->GetFirstParent( STAFF ) ); if ( !Check( firstStaff ) ) return; // We need the staff from the current system, i.e., the first measure. @@ -863,13 +866,16 @@ void View::DrawTimeSpanningElement( DeviceContext *dc, DocObject *element, Syste spanningType = SPANNING_MIDDLE; } - if (dynamic_cast(element)) { + if (element->Is() == SLUR) { + // cast to Slur check in DrawTieOrSlur DrawTieOrSlur(dc, dynamic_cast(element), x1, x2, staff, spanningType, graphic); } - else if (dynamic_cast(element)) { + else if (element->Is() == SYL) { + // cast to Syl check in DrawSylConnector DrawSylConnector(dc, dynamic_cast(element), x1, x2, staff, spanningType, graphic); } - else if (dynamic_cast(element)) { + else if (element->Is() == TIE) { + // cast to Slur check in DrawTieOrSlur DrawTieOrSlur(dc, dynamic_cast(element), x1, x2, staff, spanningType, graphic); } @@ -878,26 +884,44 @@ void View::DrawTimeSpanningElement( DeviceContext *dc, DocObject *element, Syste void View::DrawTieOrSlur( DeviceContext *dc, MeasureElement *element, int x1, int x2, Staff *staff, char spanningType, DocObject *graphic ) { + assert( dc ); + assert( element ); + assert( staff ); + assert(dynamic_cast(element) || dynamic_cast(element)); // Element must be a Tie or a Slur + TimeSpanningInterface *interface = dynamic_cast(element); + assert( interface ); - LayerElement *note1 = NULL; - LayerElement *note2 = NULL; + LayerElement *element1 = NULL; + LayerElement *element2 = NULL; bool up = true; data_STEMDIRECTION noteStemDir = STEMDIRECTION_NONE; int y1, y2; - note1 = interface->GetStart(); - note2 = interface->GetEnd(); + element1 = interface->GetStart(); + element2 = interface->GetEnd(); - if ( !note1 && !note2 ) { + if ( !element1 || !element2 ) { // no note, obviously nothing to do... return; } - Layer* layer1 = reinterpret_cast(note1->GetFirstParent( LAYER ) ); - Layer* layer2 = reinterpret_cast(note2->GetFirstParent( LAYER ) ); + Note *note1 = NULL; + Note *note2 = NULL; + Chord *chord1 = NULL; + Chord *chord2 = NULL; + if (element1->Is() == NOTE ) note1 = dynamic_cast(element1); + else chord1 = dynamic_cast(element1); + assert( note1 || chord1 ); + if (element2->Is() == NOTE ) note2 = dynamic_cast(element2); + else chord2 = dynamic_cast(element2); + assert( note2 || chord2 ); + + Layer* layer1 = dynamic_cast(element1->GetFirstParent( LAYER ) ); + Layer* layer2 = dynamic_cast(element2->GetFirstParent( LAYER ) ); + assert( layer1 && layer2 ); if ( layer1->GetN() != layer2->GetN() ) { LogWarning("Ties between different layers may not be fully supported."); @@ -905,36 +929,32 @@ void View::DrawTieOrSlur( DeviceContext *dc, MeasureElement *element, int x1, in //the normal case if ( spanningType == SPANNING_START_END ) { - assert( note1 && note2 ); // Copied from DrawNote // We could use the stamDir information // but then we have to take in account (1) beams (2) stemmed and non stemmed notes tied together - y1 = note1->GetDrawingY(); - y2 = note2->GetDrawingY(); + y1 = element1->GetDrawingY(); + y2 = element2->GetDrawingY(); // for now we only look at the first note - needs to be improved // m_drawingStemDir it not set properly in beam - needs to be fixed. - if (dynamic_cast(note1)) noteStemDir = dynamic_cast(note1)->m_drawingStemDir; - else if (dynamic_cast(note1)) noteStemDir = dynamic_cast(note1)->GetDrawingStemDir(); - else assert(false); + if (note1) noteStemDir = note1->m_drawingStemDir; + else noteStemDir = chord1->GetDrawingStemDir(); } // This is the case when the tie is split over two system of two pages. // In this case, we are now drawing its beginning to the end of the measure (i.e., the last aligner) else if ( spanningType == SPANNING_START ) { - y1 = note1->GetDrawingY(); + y1 = element1->GetDrawingY(); y2 = y1; // m_drawingStemDir it not set properly in beam - needs to be fixed. - if (dynamic_cast(note1)) noteStemDir = dynamic_cast(note1)->m_drawingStemDir; - else if (dynamic_cast(note1)) noteStemDir = dynamic_cast(note1)->GetDrawingStemDir(); - else assert(false); + if (note1) noteStemDir = note1->m_drawingStemDir; + else noteStemDir = chord1->GetDrawingStemDir(); } // Now this is the case when the tie is split but we are drawing the end of it else if ( spanningType == SPANNING_END ) { - y1 = note2->GetDrawingY(); + y1 = element2->GetDrawingY(); y2 = y1; - x2 = note2->GetDrawingX(); - if (dynamic_cast(note2)) noteStemDir = dynamic_cast(note2)->m_drawingStemDir; - else if (dynamic_cast(note2)) noteStemDir = dynamic_cast(note2)->GetDrawingStemDir(); - else assert(false); + x2 = element2->GetDrawingX(); + if (note2) noteStemDir = note2->m_drawingStemDir; + else noteStemDir = chord2->GetDrawingStemDir(); } // Finally else { @@ -942,7 +962,6 @@ void View::DrawTieOrSlur( DeviceContext *dc, MeasureElement *element, int x1, in return; } - assert( dynamic_cast(note1) || dynamic_cast(note1)); //layer direction trumps note direction if (layer1 && layer1->GetDrawingStemDir() != STEMDIRECTION_NONE){ up = layer1->GetDrawingStemDir() == STEMDIRECTION_up ? true : false; @@ -988,16 +1007,17 @@ void View::DrawTieOrSlur( DeviceContext *dc, MeasureElement *element, int x1, in int View::CalculatePitchCode ( Layer *layer, int y_n, int x_pos, int *octave ) { - assert(layer); // Pointer to layer cannot be NULL" - assert(layer->m_parent); // Pointer to staff cannot be NULL" - assert(dynamic_cast(layer->m_parent)); // Pointer to parent has to be a staff + assert( layer ); + assert( octave ); + + Staff *parentStaff = dynamic_cast(layer->GetFirstParent( STAFF ) ); + assert( parentStaff ); // Pointer to parent has to be a staff static int touches[] = {PITCHNAME_c,PITCHNAME_d,PITCHNAME_e,PITCHNAME_f,PITCHNAME_g,PITCHNAME_a,PITCHNAME_b}; int y_dec, yb, plafond; int degres, octaves, position, code; char clefId=0; - Staff *parentStaff = dynamic_cast(layer->m_parent); int staffSize = parentStaff->staffSize; // calculer position du do central en fonction clef //y_n += (int) m_doc->m_drawingUnit[staffSize]/4; @@ -1059,7 +1079,10 @@ Point CalcPositionAfterRotation( Point point , float rot_alpha, Point center) void View::DrawLayer( DeviceContext *dc, Layer *layer, Staff *staff, Measure *measure) { - assert( dc ); // DC cannot be NULL + assert( dc ); + assert( layer ); + assert( staff ); + assert( measure ); dc->StartGraphic( layer, "", layer->GetUuid()); @@ -1083,35 +1106,34 @@ void View::DrawLayer( DeviceContext *dc, Layer *layer, Staff *staff, Measure *me DrawLayerChildren(dc, layer, layer, staff, measure); // first draw the postponed tuplets - DrawLayerList(dc, layer, staff, measure, &typeid(Tuplet) ); + DrawLayerList(dc, layer, staff, measure, TUPLET ); dc->EndGraphic( layer, this ); } -void View::DrawLayerList( DeviceContext *dc, Layer *layer, Staff *staff, Measure *measure, const std::type_info *elementType ) +void View::DrawLayerList( DeviceContext *dc, Layer *layer, Staff *staff, Measure *measure, const ClassId classId ) { - assert( dc ); // DC cannot be NULL + assert( dc ); + assert( layer ); + assert( staff ); + assert( measure ); ListOfObjects *drawingList = layer->GetDrawingList(); - LayerElement *element = NULL; - ListOfObjects::iterator iter; for (iter = drawingList->begin(); iter != drawingList->end(); ++iter) { - element = dynamic_cast(*iter); - if (!element) continue; - - if ( (typeid(*element) == *elementType) && (*elementType == typeid(Tuplet) ) ) { - Tuplet *tuplet = dynamic_cast(element); + if ( ((*iter)->Is() == classId) && (classId == TUPLET) ) { + Tuplet *tuplet = dynamic_cast((*iter)); + assert( tuplet ); dc->ResumeGraphic(tuplet, tuplet->GetUuid()); DrawTupletPostponed( dc, tuplet, layer, staff ); dc->EndResumedGraphic(tuplet, this); } else { // This should never happen - LogError("Element '%s' in the layer list cannot be drawn", element->GetClassName().c_str()); + LogError("Element '%s' in the layer list cannot be drawn", (*iter)->GetClassName().c_str()); } } } @@ -1122,24 +1144,25 @@ void View::DrawLayerList( DeviceContext *dc, Layer *layer, Staff *staff, Measure void View::DrawSystemChildren( DeviceContext *dc, Object *parent, System *system ) { - Measure *measure = NULL; - ScoreDef *scoreDef = NULL; - EditorialElement *editorialElement = NULL; + assert( dc ); + assert( parent ); + assert( system ); Object* current; for (current = parent->GetFirst( ); current; current = parent->GetNext( ) ) { - measure = dynamic_cast(current); - scoreDef = dynamic_cast(current); - editorialElement = dynamic_cast(current); - if (measure) { - DrawMeasure( dc , measure, system ); + if (current->Is() == MEASURE) { + // cast to Measure check in DrawMeasure + DrawMeasure( dc , dynamic_cast(current), system ); } - else if (editorialElement) { - DrawSystemEditorialElement( dc , editorialElement, system ); + else if (current->IsEditorialElement()) { + // cast to EditorialElement check in DrawSystemEditorial element + DrawSystemEditorialElement( dc , dynamic_cast(current), system ); } // scoreDef are not drawn directly, but anything else should not be possible - else if (scoreDef) { + else if (current->Is() == SCORE_DEF) { + ScoreDef *scoreDef = dynamic_cast(current); + assert( scoreDef ); m_drawingScoreDef.Replace( scoreDef ); } else { @@ -1150,19 +1173,21 @@ void View::DrawSystemChildren( DeviceContext *dc, Object *parent, System *system void View::DrawMeasureChildren( DeviceContext *dc, Object *parent, Measure *measure, System *system ) { - MeasureElement *measureElement = NULL; - EditorialElement *editorialElement = NULL; + assert( dc ); + assert( parent ); + assert( measure ); + assert( system ); Object* current; for (current = parent->GetFirst( ); current; current = parent->GetNext( ) ) { - measureElement = dynamic_cast(current); - editorialElement = dynamic_cast(current); - if (measureElement) { - DrawMeasureElement( dc , measureElement, measure, system ); + if (current->IsMeasureElement()) { + // cast to MeasureElement check in DrawMeasureElement + DrawMeasureElement( dc , dynamic_cast(current), measure, system ); } - else if (editorialElement) { - DrawMeasureEditorialElement( dc , editorialElement, measure, system ); + else if (current->IsEditorialElement()) { + // cast to EditorialElement check in DrawMeasureEditorialElement + DrawMeasureEditorialElement( dc , dynamic_cast(current), measure, system ); } else { assert(false); @@ -1172,19 +1197,21 @@ void View::DrawMeasureChildren( DeviceContext *dc, Object *parent, Measure *meas void View::DrawStaffChildren( DeviceContext *dc, Object *parent, Staff *staff, Measure *measure ) { - Layer *layer = NULL; - EditorialElement *editorialElement = NULL; + assert( dc ); + assert( parent ); + assert( staff ); + assert( measure ); Object* current; for (current = parent->GetFirst( ); current; current = parent->GetNext( ) ) { - layer = dynamic_cast(current); - editorialElement = dynamic_cast(current); - if (layer) { - DrawLayer( dc , layer, staff, measure ); + if (current->Is() == LAYER) { + // cast to Layer check in DrawLayer + DrawLayer( dc , dynamic_cast(current), staff, measure ); } - else if (editorialElement) { - DrawStaffEditorialElement( dc , editorialElement, staff, measure ); + else if (current->IsEditorialElement()) { + // cast to EditorialElement check in DrawStaffEditorialElement + DrawStaffEditorialElement( dc , dynamic_cast(current), staff, measure ); } else { assert(false); @@ -1194,19 +1221,21 @@ void View::DrawStaffChildren( DeviceContext *dc, Object *parent, Staff *staff, void View::DrawLayerChildren( DeviceContext *dc, Object *parent, Layer *layer, Staff *staff, Measure *measure ) { - LayerElement *layerElement = NULL; - EditorialElement *editorialElement = NULL; + assert( dc ); + assert( parent ); + assert( layer ); + assert( staff ); + assert( measure ); Object* current; for (current = parent->GetFirst( ); current; current = parent->GetNext( ) ) { - layerElement = dynamic_cast(current); - editorialElement = dynamic_cast(current); - if (layerElement) { - DrawLayerElement( dc, layerElement, layer, staff, measure ); + if (current->IsLayerElement()) { + DrawLayerElement( dc, dynamic_cast(current), layer, staff, measure ); } - else if (editorialElement) { - DrawLayerEditorialElement( dc , editorialElement, layer, staff, measure ); + else if (current->IsEditorialElement()) { + // cast to EditorialElement check in DrawLayerEditorialElement + DrawLayerEditorialElement( dc , dynamic_cast(current), layer, staff, measure ); } else { assert(false); @@ -1221,7 +1250,8 @@ void View::DrawLayerChildren( DeviceContext *dc, Object *parent, Layer *layer, S void View::DrawSystemEditorialElement( DeviceContext *dc, EditorialElement *element, System *system ) { - if ( dynamic_cast(element) ) { + assert( element ); + if ( element->Is() == APP ) { assert( dynamic_cast(element)->GetLevel() == EDITORIAL_SYSTEM ); } @@ -1234,7 +1264,8 @@ void View::DrawSystemEditorialElement( DeviceContext *dc, EditorialElement *elem void View::DrawMeasureEditorialElement( DeviceContext *dc, EditorialElement *element, Measure *measure, System *system ) { - if ( dynamic_cast(element) ) { + assert( element ); + if ( element->Object::Is() == APP ) { assert( dynamic_cast(element)->GetLevel() == EDITORIAL_MEASURE ); } @@ -1247,7 +1278,8 @@ void View::DrawMeasureEditorialElement( DeviceContext *dc, EditorialElement *ele void View::DrawStaffEditorialElement( DeviceContext *dc, EditorialElement *element, Staff *staff, Measure *measure ) { - if ( dynamic_cast(element) ) { + assert( element ); + if ( element->Is() == APP ) { assert( dynamic_cast(element)->GetLevel() == EDITORIAL_STAFF ); } @@ -1260,7 +1292,8 @@ void View::DrawStaffEditorialElement( DeviceContext *dc, EditorialElement *eleme void View::DrawLayerEditorialElement( DeviceContext *dc, EditorialElement *element, Layer *layer, Staff *staff, Measure *measure ) { - if ( dynamic_cast(element) ) { + assert( element ); + if ( element->Is() == APP ) { assert( dynamic_cast(element)->GetLevel() == EDITORIAL_LAYER ); } diff --git a/src/view_tuplet.cpp b/src/view_tuplet.cpp index 98c395b2813..b88b43ffa2b 100644 --- a/src/view_tuplet.cpp +++ b/src/view_tuplet.cpp @@ -29,18 +29,19 @@ namespace vrv { * Analyze a tuplet object and figure out if all the notes are in the same beam * or not */ -bool View::OneBeamInTuplet(Tuplet* tuplet) { +bool View::OneBeamInTuplet(Tuplet* tuplet) +{ + assert( tuplet ); Beam *currentBeam = NULL; ArrayOfObjects elems; // Are we contained in a beam? - if (reinterpret_cast(tuplet->GetFirstParent( BEAM, MAX_BEAM_DEPTH )) && !tuplet->m_children.empty()) - return true; + if (tuplet->GetFirstParent( BEAM, MAX_BEAM_DEPTH ) && !tuplet->m_children.empty()) return true; // No we contain a beam? Go on and search for it in the children for (unsigned int i = 0; i < tuplet->m_children.size(); i++) { - currentBeam = dynamic_cast(tuplet->m_children[i]); + currentBeam = dynamic_cast(tuplet->m_children.at(i)); // first child is not a beam, or it is a beam but we have more than one child if (!currentBeam || tuplet->GetChildCount() > 1) { @@ -78,7 +79,14 @@ bool View::OneBeamInTuplet(Tuplet* tuplet) { */ -bool View::GetTupletCoordinates(Tuplet* tuplet, Layer *layer, Point* start, Point* end, Point *center) { +bool View::GetTupletCoordinates(Tuplet* tuplet, Layer *layer, Point* start, Point* end, Point *center) +{ + assert( tuplet ); + assert( layer ); + assert( start ); + assert( end ); + assert( center ); + Point first, last; int x, y; bool direction = true; //true = up, false = down @@ -225,8 +233,10 @@ bool View::GetTupletCoordinates(Tuplet* tuplet, Layer *layer, Point* start, Poin void View::DrawTupletPostponed( DeviceContext *dc, Tuplet *tuplet, Layer *layer, Staff *staff) { - assert(layer); // Pointer to layer cannot be NULL" - assert(staff); // Pointer to staff cannot be NULL" + assert( dc ); + assert( tuplet ); + assert( layer ); + assert( staff ); tuplet->ResetList(tuplet); From 851680475001a3a9fa92f6f8ef21448df713fe0b Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sat, 15 Aug 2015 08:41:47 +0200 Subject: [PATCH 049/114] Removing HasXXXInterface methods --- include/vrv/layerelement.h | 3 --- src/beam.cpp | 2 +- src/chord.cpp | 2 +- src/layerelement.cpp | 20 +------------------- src/tuplet.cpp | 2 +- 5 files changed, 4 insertions(+), 25 deletions(-) diff --git a/include/vrv/layerelement.h b/include/vrv/layerelement.h index be808186475..102e76804d8 100644 --- a/include/vrv/layerelement.h +++ b/include/vrv/layerelement.h @@ -71,9 +71,6 @@ class LayerElement: public DocObject * @name Child type checkers. */ ///@{ - bool HasDurationInterface(); - bool HasPitchInterface(); - bool HasPositionInterface(); bool IsGraceNote(); ///@} diff --git a/src/beam.cpp b/src/beam.cpp index cb646a8d123..973408e92d5 100644 --- a/src/beam.cpp +++ b/src/beam.cpp @@ -62,7 +62,7 @@ void Beam::FilterList( ListOfObjects *childList ) } LayerElement *currentElement = dynamic_cast(*iter); assert( currentElement ); - if ( !currentElement->HasDurationInterface() ) + if ( !currentElement->HasInterface(INTERFACE_DURATION) ) { // remove anything that has not a DurationInterface iter = childList->erase( iter ); diff --git a/src/chord.cpp b/src/chord.cpp index 7792218abb2..443b1bdbe7a 100644 --- a/src/chord.cpp +++ b/src/chord.cpp @@ -98,7 +98,7 @@ void Chord::FilterList( ListOfObjects *childList ) } LayerElement *currentElement = dynamic_cast(*iter); assert( currentElement ); - if ( !currentElement->HasDurationInterface() ) { + if ( !currentElement->HasInterface(INTERFACE_DURATION) ) { iter = childList->erase( iter ); } else { diff --git a/src/layerelement.cpp b/src/layerelement.cpp index 68e177ea2a0..fbaeb762e96 100644 --- a/src/layerelement.cpp +++ b/src/layerelement.cpp @@ -101,29 +101,11 @@ void LayerElement::ResetHorizontalAlignment() } } -bool LayerElement::HasDurationInterface() -{ - return (this->HasInterface(INTERFACE_DURATION)); - return (dynamic_cast(this)); -} - bool LayerElement::IsGraceNote() { Note *note = dynamic_cast(this); return (note && note->HasGrace()); } - -bool LayerElement::HasPitchInterface() -{ - return (this->HasInterface(INTERFACE_PITCH)); - return (dynamic_cast(this)); -} - -bool LayerElement::HasPositionInterface() -{ - return (this->HasInterface(INTERFACE_POSITION)); - return (dynamic_cast(this)); -} bool LayerElement::IsCueSize() { @@ -159,7 +141,7 @@ double LayerElement::GetAlignmentDuration( Mensur *mensur, MeterSig *meterSig, b return 0.0; } - if ( HasDurationInterface() ) { + if ( this->HasInterface(INTERFACE_DURATION) ) { int num = 1; int numbase = 1; Tuplet *tuplet = dynamic_cast( this->GetFirstParent( TUPLET, MAX_TUPLET_DEPTH ) ); diff --git a/src/tuplet.cpp b/src/tuplet.cpp index 55548ee7a96..c55c1f8dfed 100644 --- a/src/tuplet.cpp +++ b/src/tuplet.cpp @@ -35,7 +35,7 @@ void Tuplet::Reset() void Tuplet::AddLayerElement(LayerElement *element) { - //if (!element->HasDurationInterface()) { + //if (!element->HasInterface(INTERFACE_DURATION)()) { // return; //} From ef3d947297de23af2f63a9dbdf8f1a84837152e3 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sat, 15 Aug 2015 08:42:07 +0200 Subject: [PATCH 050/114] Tidying up --- include/vrv/barline.h | 2 +- src/barline.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/vrv/barline.h b/include/vrv/barline.h index 5295b73620a..7767a24cf9e 100644 --- a/include/vrv/barline.h +++ b/include/vrv/barline.h @@ -62,7 +62,7 @@ class Barline: public LayerElement, //---------------------------------------------------------------------------- /** - * This class models the barLine reltaed attributes of a MEI measure + * This class models the barLine related attributes of a MEI measure. */ class BarlineAttr: public Barline { diff --git a/src/barline.cpp b/src/barline.cpp index b7322cc1246..e283c984472 100644 --- a/src/barline.cpp +++ b/src/barline.cpp @@ -41,13 +41,12 @@ bool Barline::HasRepetitionDots() } //---------------------------------------------------------------------------- -// Barline +// BarlineAttr //---------------------------------------------------------------------------- BarlineAttr::BarlineAttr(): Barline() { - } BarlineAttr::~BarlineAttr() From 7e7ed742a1e46146986a837beecf60e57e87188a Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sat, 15 Aug 2015 09:34:31 +0200 Subject: [PATCH 051/114] Correcting change (flag has to be true for all cases in scoreDef) --- src/scoredef.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/scoredef.cpp b/src/scoredef.cpp index 631475a4e61..4bf828acf4a 100644 --- a/src/scoredef.cpp +++ b/src/scoredef.cpp @@ -170,9 +170,9 @@ Clef *ScoreOrStaffDefAttrInterface::GetClefCopy() const ClefAttr *current_attr = dynamic_cast(m_clef); assert( current_attr ); copy = new Clef(current_attr); - copy->SetScoreOrStaffDefAttr(true); } assert(copy); + copy->SetScoreOrStaffDefAttr(true); return copy; } @@ -190,9 +190,9 @@ KeySig *ScoreOrStaffDefAttrInterface::GetKeySigCopy() const KeySigAttr *current_attr = dynamic_cast(m_keySig); assert( current_attr ); copy = new KeySig(current_attr); - copy->SetScoreOrStaffDefAttr(true); } assert(copy); + copy->SetScoreOrStaffDefAttr(true); return copy; } @@ -210,9 +210,9 @@ Mensur *ScoreOrStaffDefAttrInterface::GetMensurCopy() const MensurAttr *current_attr = dynamic_cast(m_mensur); assert( current_attr ); copy = new Mensur(current_attr); - copy->SetScoreOrStaffDefAttr(true); } assert(copy); + copy->SetScoreOrStaffDefAttr(true); return copy; } @@ -230,9 +230,9 @@ MeterSig *ScoreOrStaffDefAttrInterface::GetMeterSigCopy() const MeterSigAttr *current_attr = dynamic_cast(m_meterSig); assert( current_attr ); copy = new MeterSig(current_attr); - copy->SetScoreOrStaffDefAttr(true); } assert(copy); + copy->SetScoreOrStaffDefAttr(true); return copy; } From 21bc261339aad83c52be7cff17a3dfb28a84e9fe Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sat, 15 Aug 2015 12:04:23 +0200 Subject: [PATCH 052/114] Adding KeySigDrawingInterface for key sig cancellation, removing old Wolfgang key sig defines and adding key sig cancellation flagging --- include/vrv/drawinglistinterface.h | 35 +++++++++++++++++++ include/vrv/keysig.h | 22 ++++++------ include/vrv/layer.h | 7 +++- include/vrv/object.h | 1 + include/vrv/scoredef.h | 5 ++- include/vrv/vrvdef.h | 50 +++++++------------------- src/drawinglistinterface.cpp | 18 ++++++++++ src/iomusxml.cpp | 10 +++--- src/iopae.cpp | 4 +-- src/keysig.cpp | 56 ++++++++++++++---------------- src/layer.cpp | 2 ++ src/object.cpp | 13 ++++--- src/scoredef.cpp | 18 ++++++++-- src/view_element.cpp | 6 ++-- src/view_page.cpp | 2 -- 15 files changed, 149 insertions(+), 100 deletions(-) diff --git a/include/vrv/drawinglistinterface.h b/include/vrv/drawinglistinterface.h index 22f198f199e..c939ba9f5a2 100644 --- a/include/vrv/drawinglistinterface.h +++ b/include/vrv/drawinglistinterface.h @@ -65,6 +65,41 @@ class DrawingListInterface ListOfObjects m_drawingList; }; +//---------------------------------------------------------------------------- +// KeySigDrawingInterface +//---------------------------------------------------------------------------- + +/** + * This class is an interface for drawing variables for KeySig and KeySigAttr. + * It is not an abstract class but should not be instanciate directly. + */ +class KeySigDrawingInterface +{ +public: + /** + * @name Constructors, destructors, reset and class name methods + * Reset method reset all attribute classes + */ + ///@{ + KeySigDrawingInterface(); + virtual ~KeySigDrawingInterface(); + virtual void Reset(); + ///@} + +private: + +public: + /** + * Variables for storing cancellation introduced by the key sig. + * The values are ScoreOrStaffDefAttrInterface::ReplaceKeySig + */ + data_ACCIDENTAL_EXPLICIT m_drawingCancelAccidType; + char m_drawingCancelAccidCount; + +private: + +}; + } // namespace vrv #endif diff --git a/include/vrv/keysig.h b/include/vrv/keysig.h index af9039c5e32..59bad662295 100644 --- a/include/vrv/keysig.h +++ b/include/vrv/keysig.h @@ -11,6 +11,7 @@ #define __VRV_KEYSIG_H__ #include "atts_shared.h" +#include "drawinglistinterface.h" #include "layerelement.h" namespace vrv { @@ -32,7 +33,7 @@ class KeySigAttr; * are available for converting from and to the MEI representation to the * internal (and reverse) */ -class KeySig: public LayerElement, +class KeySig: public LayerElement, public KeySigDrawingInterface, public AttAccidental, public AttPitch { @@ -43,7 +44,7 @@ class KeySig: public LayerElement, */ ///@{ KeySig(); - KeySig(int num_alter, char alter); + KeySig(int alterationNumber, data_ACCIDENTAL_EXPLICIT alterationType); KeySig( KeySigAttr *keySigAttr ); void Init(); virtual ~KeySig(); @@ -56,12 +57,12 @@ class KeySig: public LayerElement, int GetOctave(unsigned char pitch, int clefId); /* Alteration number getter/setter */ - int GetAlterationNumber() { return m_num_alter; }; - void SetAlterationNumber(int n) { m_num_alter = n; }; + int GetAlterationNumber() { return m_alterationNumber; }; + void SetAlterationNumber(int alterationNumber) { m_alterationNumber = alterationNumber; }; /* Alteration number getter/setter */ - unsigned char GetAlteration() { return m_alteration; }; - void SetAlteration(int n) { m_alteration = n; }; + data_ACCIDENTAL_EXPLICIT GetAlterationType() { return m_alterationType; }; + void SetAlterationType( data_ACCIDENTAL_EXPLICIT alterationType ) { m_alterationType = m_alterationType; }; /* Temporary methods for turning @accid and @pitch into num_alter and alter */ void ConvertToMei( ); @@ -77,8 +78,8 @@ class KeySig: public LayerElement, static int octave_map[2][9][7]; // This is temporary - it needs to be changed to libMEI atts - int m_num_alter; - unsigned char m_alteration; + int m_alterationNumber; + data_ACCIDENTAL_EXPLICIT m_alterationType; }; @@ -89,7 +90,7 @@ class KeySig: public LayerElement, /** * This class models the MEI @key attributes in scoreDef or staffDef elements. */ -class KeySigAttr: public Object, +class KeySigAttr: public Object, public KeySigDrawingInterface, public AttKeySigDefaultLog { public: @@ -109,9 +110,6 @@ class KeySigAttr: public Object, private: public: - /** */ - data_ACCIDENTAL_EXPLICIT m_drawingCancelAccid; - char m_drawingCancelAccidCount; private: diff --git a/include/vrv/layer.h b/include/vrv/layer.h index 0f1d71ff24b..0a786b6fb6e 100644 --- a/include/vrv/layer.h +++ b/include/vrv/layer.h @@ -90,6 +90,7 @@ class Layer: public DocObject, public DrawingListInterface, public ObjectListInt ///@{ void SetDrawClef( bool draw ) { m_drawClef = draw; }; void SetDrawKeySig( bool draw ) { m_drawKeySig = draw; }; + void SetDrawKeySigCancellation( bool draw ) { m_drawKeySigCancellation = draw; }; void SetDrawMensur( bool draw ) { m_drawMensur = draw; }; void SetDrawMeterSig( bool draw ) { m_drawMeterSig = draw; }; ///@} @@ -160,8 +161,12 @@ class Layer: public DocObject, public DrawingListInterface, public ObjectListInt ///@{ /** The clef attribute */ bool m_drawClef; - /** The key signature */ + /** + * The key signature and key signature cancellation + * We need two because flags are reset at the beginning of a as system + */ bool m_drawKeySig; + bool m_drawKeySigCancellation; /** The mensur */ bool m_drawMensur; /** The meter signature (time signature) */ diff --git a/include/vrv/object.h b/include/vrv/object.h index 7e9151130ca..ad331a86f4b 100644 --- a/include/vrv/object.h +++ b/include/vrv/object.h @@ -501,6 +501,7 @@ class Object * param 1: bool keysig flag. * param 2: bool the mensur flag. * param 3: bool the metersig flag. + * param 4: bool the keysig cancellation flag; */ virtual int SetStaffDefRedrawFlags( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; diff --git a/include/vrv/scoredef.h b/include/vrv/scoredef.h index 5be8b9d519c..9a49955bf9c 100644 --- a/include/vrv/scoredef.h +++ b/include/vrv/scoredef.h @@ -181,7 +181,7 @@ class ScoreDef: public Object, public ScoreOrStaffDefAttrInterface, public Objec * Set the redraw flag to all staffDefs. * This is necessary at the beginning or when a scoreDef occurs. */ - void SetRedrawFlags( bool clef, bool keysig, bool mensur, bool meterSig ); + void SetRedrawFlags( bool clef, bool keySig, bool mensur, bool meterSig, bool keySigCancellation ); /** * @name Set and get the scoreDef drawing flags for clef, keysig and mensur. @@ -322,6 +322,8 @@ class StaffDef: public Object, public ScoreOrStaffDefAttrInterface, void SetDrawClef( bool drawClef ) { m_drawClef = drawClef; }; bool DrawKeySig() const { return m_drawKeySig; }; void SetDrawKeySig( bool drawKeySig ) { m_drawKeySig = drawKeySig; }; + bool DrawKeySigCancellation() const { return m_drawKeySigCancellation; }; + void SetDrawKeySigCancellation( bool drawKeySigCancellation ) { m_drawKeySigCancellation = drawKeySigCancellation; }; bool DrawMensur() const { return m_drawMensur; }; void SetDrawMensur( bool drawMensur ) { m_drawMensur = drawMensur; }; bool DrawMeterSig() const { return m_drawMeterSig; }; @@ -360,6 +362,7 @@ class StaffDef: public Object, public ScoreOrStaffDefAttrInterface, ///@{ bool m_drawClef; bool m_drawKeySig; + bool m_drawKeySigCancellation; bool m_drawMensur; bool m_drawMeterSig; ///@} diff --git a/include/vrv/vrvdef.h b/include/vrv/vrvdef.h index ee77847c32e..357dac7a965 100644 --- a/include/vrv/vrvdef.h +++ b/include/vrv/vrvdef.h @@ -181,57 +181,31 @@ enum FunctorCode { #define VRV_TEXT_E550 0xE550 #define VRV_TEXT_E551 0xE551 #define VRV_TEXT_E552 0xE552 - + //---------------------------------------------------------------------------- -// Legacy Wolfgang defines +// Types for editorial element //---------------------------------------------------------------------------- - -#define OCTAVE_OFFSET 4 - -// ACCID -#define ACCID_SHARP 1 -#define ACCID_FLAT 2 -#define ACCID_NATURAL 3 -#define ACCID_DOUBLE_SHARP 4 -#define ACCID_DOUBLE_FLAT 5 -#define ACCID_QUARTER_SHARP 6 -#define ACCID_QUARTER_FLAT 7 - -#define ON 1 -#define OFF 0 - -// TODO // ax2 - -// RESTS -#define VALSilSpec 15 /* val indiquant silence sp‚cial avec chiffre */ // ??? - -// pour le flag tetenote -#define LOSANGEVIDE 1 -#define OPTIONLIBRE 6 -#define SANSQUEUE 7 -/* valeurs des attributs de staccato in menu (getcode2()) */ -#define STACC 0 -#define LOURE 1 -#define ACCENT_OBL 2 -#define ACCENT_VERT 3 -#define BEBUNG 4 -#define STAC_AIGU 5 -#define ACCENT_OBL_PNT 6 -#define ACCENT_VERT_PNT 7 - - // the maximum is 255 (unsigned char) enum EditorialLevel { EDITORIAL_UNDEFINED = 0, EDITORIAL_SYSTEM, EDITORIAL_SCOREDEF, - EDITORIAL_STAFFGRP, + EDITORIAL_STAFFGRP, EDITORIAL_MEASURE, EDITORIAL_STAFF, EDITORIAL_LAYER, EDITORIAL_NOTE }; + +//---------------------------------------------------------------------------- +// Legacy Wolfgang defines +//---------------------------------------------------------------------------- + +#define OCTAVE_OFFSET 4 + +#define ON 1 +#define OFF 0 // the maximum is 255 (unsigned char) enum StaffGrpSymbol { diff --git a/src/drawinglistinterface.cpp b/src/drawinglistinterface.cpp index 0cdfeb806ee..70fc2c74745 100644 --- a/src/drawinglistinterface.cpp +++ b/src/drawinglistinterface.cpp @@ -53,7 +53,25 @@ void DrawingListInterface::ResetDrawingList( ) m_drawingList.clear(); } +//---------------------------------------------------------------------------- +// KeySigDrawingInterface +//---------------------------------------------------------------------------- + +KeySigDrawingInterface::KeySigDrawingInterface() +{ + Reset(); +} +KeySigDrawingInterface::~KeySigDrawingInterface() +{ +} + + +void KeySigDrawingInterface::Reset() +{ + m_drawingCancelAccidType = ACCIDENTAL_EXPLICIT_n; + m_drawingCancelAccidCount = 0; +} } // namespace vrv diff --git a/src/iomusxml.cpp b/src/iomusxml.cpp index d1d948121bb..f7b3d79f172 100644 --- a/src/iomusxml.cpp +++ b/src/iomusxml.cpp @@ -292,7 +292,7 @@ void XMLOutput::WriteKey(LayerElement *element) { // Convert the number of alterations to string std::stringstream n_alter; - if (key->GetAlteration() == ACCID_FLAT) + if (key->GetAlterationType() == ACCIDENTAL_EXPLICIT_f) // flats are negative numbers n_alter << -key->GetAlterationNumber(); else @@ -536,10 +536,10 @@ void XMLOutput::WriteNoteOrRest(LayerElement *element) { // handle multi measure rest // break from the generation of this element - if (r->GetActualDur() == VALSilSpec) { - WriteMultiMeasureRest(r); - return; - } + //if (r->GetActualDur() == VALSilSpec) { + // WriteMultiMeasureRest(r); + // return; + //} } // put the duration diff --git a/src/iopae.cpp b/src/iopae.cpp index 20f80a73899..e1256044b59 100644 --- a/src/iopae.cpp +++ b/src/iopae.cpp @@ -966,8 +966,8 @@ int PaeInput::getKeyInfo(const char *incipit, KeySig *key, int index ) { bool end_of_keysig = false; while ((i < length) && (!end_of_keysig)) { switch (incipit[i]) { - case 'b': key->SetAlteration(ACCID_FLAT); break; - case 'x': key->SetAlteration(ACCID_SHARP); break; + case 'b': key->SetAlterationType(ACCIDENTAL_EXPLICIT_f); break; + case 'x': key->SetAlterationType(ACCIDENTAL_EXPLICIT_s); break; case 'F': case 'C': case 'G': diff --git a/src/keysig.cpp b/src/keysig.cpp index 8d495d37f16..ccc89444635 100644 --- a/src/keysig.cpp +++ b/src/keysig.cpp @@ -50,26 +50,26 @@ int KeySig::octave_map[2][9][7] = { }; KeySig::KeySig(): - LayerElement("ksig-"), + LayerElement("ksig-"), KeySigDrawingInterface(), AttAccidental(), AttPitch() { Init(); } -KeySig::KeySig(int num_alter, char alter): - LayerElement("ksig-"), +KeySig::KeySig(int alterationNumber, data_ACCIDENTAL_EXPLICIT alterationType): + LayerElement("ksig-"), KeySigDrawingInterface(), AttAccidental(), AttPitch() { Init(); - m_num_alter = num_alter; - m_alteration = alter; + m_alterationNumber = alterationNumber; + m_alterationType = alterationType; } KeySig::KeySig( KeySigAttr *keySigAttr ): - LayerElement("ksig-"), + LayerElement("ksig-"), KeySigDrawingInterface(), AttAccidental(), AttPitch() { @@ -89,12 +89,12 @@ KeySig::KeySig( KeySigAttr *keySigAttr ): return; } if (key > 0) { - m_alteration = ACCID_SHARP; + m_alterationType = ACCIDENTAL_EXPLICIT_s; } else if (key < 0) { - m_alteration = ACCID_FLAT; + m_alterationType = ACCIDENTAL_EXPLICIT_f; } - m_num_alter = abs(key); + m_alterationNumber = abs(key); } void KeySig::Init() @@ -111,10 +111,11 @@ KeySig::~KeySig() void KeySig::Reset() { LayerElement::Reset(); + KeySigDrawingInterface::Reset(); ResetAccidental(); ResetPitch(); - m_num_alter = 0; - m_alteration = ACCID_NATURAL; + m_alterationNumber = 0; + m_alterationType = ACCIDENTAL_EXPLICIT_n; } @@ -122,20 +123,20 @@ void KeySig::ConvertToInternal( ) { int i; if (this->GetAccid() == ACCIDENTAL_EXPLICIT_s) { - m_alteration = ACCID_SHARP; + m_alterationType = ACCIDENTAL_EXPLICIT_s; for (i = 0;i < 7; i++) { if (KeySig::sharps[i] == this->GetPname()) { - m_num_alter = i + 1; + m_alterationNumber = i + 1; break; } } } else if (this->GetAccid() == ACCIDENTAL_EXPLICIT_f) { - m_alteration = ACCID_FLAT; + m_alterationType = ACCIDENTAL_EXPLICIT_f; for (i = 0;i < 7; i++) { if (KeySig::flats[i] == this->GetPname()) { - m_num_alter = i + 1; + m_alterationNumber = i + 1; break; } } @@ -145,15 +146,15 @@ void KeySig::ConvertToInternal( ) void KeySig::ConvertToMei() { - if ((m_num_alter < 1) || (m_num_alter > 7)) return; + if ((m_alterationNumber < 1) || (m_alterationNumber > 7)) return; - if (m_alteration == ACCID_SHARP) { + if (m_alterationType == ACCIDENTAL_EXPLICIT_s) { this->SetAccid( ACCIDENTAL_EXPLICIT_s); - this->SetPname(KeySig::sharps[m_num_alter - 1]); + this->SetPname(KeySig::sharps[m_alterationNumber - 1]); } - else if (m_alteration == ACCID_FLAT) { + else if (m_alterationType == ACCIDENTAL_EXPLICIT_f) { this->SetAccid( ACCIDENTAL_EXPLICIT_f); - this->SetPname(KeySig::flats[m_num_alter - 1]); + this->SetPname(KeySig::flats[m_alterationNumber - 1]); } else return; } @@ -162,13 +163,10 @@ unsigned char KeySig::GetAlterationAt(int pos) { data_PITCHNAME *alteration_set; - if (pos > 6) - return 0; + if (pos > 6) return 0; - if (m_alteration == ACCID_FLAT) - alteration_set = flats; - else - alteration_set = sharps; + if (m_alterationType == ACCIDENTAL_EXPLICIT_f) alteration_set = flats; + else alteration_set = sharps; return alteration_set[pos]; } @@ -178,8 +176,7 @@ int KeySig::GetOctave(unsigned char pitch, int clefId) int alter_set = 0; // flats int key_set = 0; - if (m_alteration == ACCID_SHARP) - alter_set = 1; + if (m_alterationType == ACCIDENTAL_EXPLICIT_f) alter_set = 1; switch (clefId) { case G2: key_set = 0; break; @@ -207,7 +204,7 @@ int KeySig::GetOctave(unsigned char pitch, int clefId) //---------------------------------------------------------------------------- KeySigAttr::KeySigAttr(): - Object(), + Object(), KeySigDrawingInterface(), AttKeySigDefaultLog() { RegisterAttClass(ATT_KEYSIGDEFAULTLOG); @@ -221,6 +218,7 @@ KeySigAttr::~KeySigAttr() void KeySigAttr::Reset() { Object::Reset(); + KeySigDrawingInterface::Reset(); ResetKeySigDefaultLog(); } diff --git a/src/layer.cpp b/src/layer.cpp index 93992883ac5..a8aec975bbd 100644 --- a/src/layer.cpp +++ b/src/layer.cpp @@ -166,11 +166,13 @@ void Layer::SetDrawingAndCurrentValues( ScoreDef *currentScoreDef, StaffDef *cur this->SetDrawKeySig( currentStaffDef->DrawKeySig() ); this->SetDrawMensur( currentStaffDef->DrawMensur() ); this->SetDrawMeterSig( currentStaffDef->DrawMeterSig() ); + this->SetDrawKeySigCancellation( currentStaffDef->DrawKeySigCancellation() ); // Don't draw on the next one currentStaffDef->SetDrawClef( false ); currentStaffDef->SetDrawKeySig( false ); currentStaffDef->SetDrawMensur( false ); currentStaffDef->SetDrawMeterSig( false ); + currentStaffDef->SetDrawKeySigCancellation( false ); if ( currentStaffDef->GetClef() ) { this->SetCurrentClef( currentStaffDef->GetClefCopy() ); diff --git a/src/object.cpp b/src/object.cpp index db78615110e..691e07bbd7d 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -923,14 +923,16 @@ int Object::SetCurrentScoreDef( ArrayPtrVoid *params ) // starting a new page if (this->Is() == PAGE) { + // The keySig cancellation is set to false, which means that a scoreDef change has to occur + // after a page break if right at the begining. This is the same for systems below Page *page = dynamic_cast(this); assert( page ); if ( page->m_parent->GetChildIndex( page ) == 0 ) { - currentScoreDef->SetRedrawFlags( true, true, true, true ); + currentScoreDef->SetRedrawFlags( true, true, true, true, false ); currentScoreDef->SetDrawLabels( true ); } else { - currentScoreDef->SetRedrawFlags( true, true, false, false ); + currentScoreDef->SetRedrawFlags( true, true, false, false, false ); currentScoreDef->SetDrawLabels( false ); } page->m_drawingScoreDef = *currentScoreDef; @@ -941,7 +943,8 @@ int Object::SetCurrentScoreDef( ArrayPtrVoid *params ) if (this->Is() == SYSTEM) { System *system = dynamic_cast(this); assert( system ); - currentScoreDef->SetRedrawFlags( true, true, false, false ); + + currentScoreDef->SetRedrawFlags( true, true, false, false, false ); return FUNCTOR_CONTINUE; } @@ -972,7 +975,8 @@ int Object::SetCurrentScoreDef( ArrayPtrVoid *params ) } // Replace the current scoreDef with the new one, including its content (staffDef) currentScoreDef->Replace(scoreDef); - currentScoreDef->SetRedrawFlags( drawClef, drawKeySig, drawMensur, drawMeterSig ); + // The keySig cancellation flag is the same as keySig because we draw cancellation with new key sig + currentScoreDef->SetRedrawFlags( drawClef, drawKeySig, drawMensur, drawMeterSig, drawKeySig ); return FUNCTOR_CONTINUE; } @@ -991,6 +995,7 @@ int Object::SetCurrentScoreDef( ArrayPtrVoid *params ) } if (staffDef->GetKeySig()) { tmpStaffDef->SetDrawKeySig( true ); + tmpStaffDef->SetDrawKeySigCancellation( true ); } if (staffDef->GetMensur()) { tmpStaffDef->SetDrawMensur( true ); diff --git a/src/scoredef.cpp b/src/scoredef.cpp index 4bf828acf4a..994c69e5451 100644 --- a/src/scoredef.cpp +++ b/src/scoredef.cpp @@ -128,7 +128,15 @@ void ScoreOrStaffDefAttrInterface::ReplaceKeySig( Object *newKeySig ) if ( newKeySig ) { assert( dynamic_cast(newKeySig) || dynamic_cast(newKeySig) ); if (m_keySig) { + // Set the KeySigDrawingInterface values the key sig cancellation. + KeySig *oldKeySig = this->GetKeySigCopy(); + assert( oldKeySig ); + KeySigDrawingInterface *interface = dynamic_cast(newKeySig); + assert( interface ); + interface->m_drawingCancelAccidCount = oldKeySig->GetAlterationNumber(); + interface->m_drawingCancelAccidType = oldKeySig->GetAlterationType(); delete m_keySig; + delete oldKeySig; } m_keySig = newKeySig->Clone(); } @@ -373,13 +381,14 @@ StaffDef *ScoreDef::GetStaffDef( int n ) } -void ScoreDef::SetRedrawFlags( bool clef, bool keysig, bool mensur, bool meterSig ) +void ScoreDef::SetRedrawFlags( bool clef, bool keySig, bool mensur, bool meterSig, bool keySigCancellation ) { ArrayPtrVoid params; params.push_back( &clef ); - params.push_back( &keysig ); + params.push_back( &keySig ); params.push_back( &mensur ); params.push_back( &meterSig ); + params.push_back( &keySigCancellation ); Functor setStaffDefDraw( &Object::SetStaffDefRedrawFlags ); this->Process( &setStaffDefDraw, ¶ms ); } @@ -516,10 +525,12 @@ int StaffDef::SetStaffDefRedrawFlags( ArrayPtrVoid *params ) // param 1: bool keysig flag // param 2: bool mensur flag // param 3: bool meterSig flag + // param 4: bool keySig cancellation flag bool *clef = static_cast((*params)[0]); bool *keysig = static_cast((*params)[1]); bool *mensur = static_cast((*params)[2]); bool *meterSig = static_cast((*params)[3]); + bool *keySigCancellation = static_cast((*params)[4]); if ( (*clef) ) { this->SetDrawClef( true ); @@ -533,6 +544,9 @@ int StaffDef::SetStaffDefRedrawFlags( ArrayPtrVoid *params ) if ( (*meterSig) ) { this->SetDrawMeterSig( true ); } + if ( (*keySigCancellation) ) { + this->SetDrawKeySigCancellation( true ); + } return FUNCTOR_CONTINUE; } diff --git a/src/view_element.cpp b/src/view_element.cpp index ede4ae1f039..767b2fc8666 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -1795,10 +1795,8 @@ void View::DrawKeySig( DeviceContext *dc, LayerElement *element, Layer *layer, S y = staff->GetDrawingY() + CalculatePitchPosY( staff, keySig->GetAlterationAt(i), layer->GetClefOffset( element ), keySig->GetOctave(keySig->GetAlterationAt(i), c->GetClefId()));; - if (keySig->GetAlteration() == ACCID_FLAT) - symb = SMUFL_E260_accidentalFlat; - else - symb = SMUFL_E262_accidentalSharp; + if (keySig->GetAlterationType() == ACCIDENTAL_EXPLICIT_f) symb = SMUFL_E260_accidentalFlat; + else symb = SMUFL_E262_accidentalSharp; DrawSmuflCode ( dc, x, y, symb, staff->staffSize, false ); } diff --git a/src/view_page.cpp b/src/view_page.cpp index 86ee8a5e92c..e0b7f936640 100644 --- a/src/view_page.cpp +++ b/src/view_page.cpp @@ -698,8 +698,6 @@ int View::CalculateRestPosY ( Staff *staff, char duration) case DUR_64: offset = 10; break; case DUR_128: offset = 10; break; case DUR_256: offset = 9; break; - case VALSilSpec: offset = 15; break; // MM rests have same height as wholes - default: offset = 12; break; // Signal an error, put the clef up high } return base + staff_space * offset; From 2cebe7ca39ab7c12bee931e5b1e4edc958ec462f Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sat, 15 Aug 2015 15:01:28 +0200 Subject: [PATCH 053/114] Fixing emscripten makefile --- emscripten/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emscripten/build.sh b/emscripten/build.sh index 6a5845ddb1a..f0707c625a5 100755 --- a/emscripten/build.sh +++ b/emscripten/build.sh @@ -30,7 +30,7 @@ if [ ! -d data ]; then mkdir data; fi ASM="\ -O3 --memory-init-file 0 \ -s ASM_JS=1 \ - -s OUTLINING_LIMIT=10000 + -s OUTLINING_LIMIT=10000 \ -s TOTAL_MEMORY=128*1024*1024 \ -s TOTAL_STACK=64*1024*1024" ASM_NAME="" From 53a6f55a137bef377f46dec33b25debd721ada4e Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sat, 15 Aug 2015 15:02:34 +0200 Subject: [PATCH 054/114] keySig cancellation (WIP) --- include/vrv/keysig.h | 12 ++++++++---- include/vrv/layer.h | 5 +++++ include/vrv/textdirective.h | 1 + include/vrv/view.h | 2 +- src/iomusxml.cpp | 2 +- src/keysig.cpp | 29 ++++++++++++++++++++--------- src/object.cpp | 4 ---- src/view_element.cpp | 32 +++++++++++++++++++++++--------- src/view_mensural.cpp | 2 +- src/view_page.cpp | 3 ++- 10 files changed, 62 insertions(+), 30 deletions(-) diff --git a/include/vrv/keysig.h b/include/vrv/keysig.h index 59bad662295..1547fb4b453 100644 --- a/include/vrv/keysig.h +++ b/include/vrv/keysig.h @@ -53,9 +53,6 @@ class KeySig: public LayerElement, public KeySigDrawingInterface, virtual std::string GetClassName( ) { return "KeySig"; }; virtual ClassId Is() { return KEY_SIG; }; - unsigned char GetAlterationAt(int pos); - int GetOctave(unsigned char pitch, int clefId); - /* Alteration number getter/setter */ int GetAlterationNumber() { return m_alterationNumber; }; void SetAlterationNumber(int alterationNumber) { m_alterationNumber = alterationNumber; }; @@ -68,6 +65,12 @@ class KeySig: public LayerElement, public KeySigDrawingInterface, void ConvertToMei( ); void ConvertToInternal( ); + /** + * Static methods for calculating position; + */ + static data_PITCHNAME GetAlterationAt( data_ACCIDENTAL_EXPLICIT alterationType, int pos ); + static int GetOctave( data_ACCIDENTAL_EXPLICIT alterationType, data_PITCHNAME pitch, int clefId); + private: public: @@ -91,7 +94,8 @@ class KeySig: public LayerElement, public KeySigDrawingInterface, * This class models the MEI @key attributes in scoreDef or staffDef elements. */ class KeySigAttr: public Object, public KeySigDrawingInterface, - public AttKeySigDefaultLog + public AttKeySigDefaultLog, + public AttKeySigDefaultVis { public: /** diff --git a/include/vrv/layer.h b/include/vrv/layer.h index 0a786b6fb6e..4f2b4290113 100644 --- a/include/vrv/layer.h +++ b/include/vrv/layer.h @@ -105,6 +105,11 @@ class Layer: public DocObject, public DrawingListInterface, public ObjectListInt MeterSig *GetDrawingMeterSig( ) { if (m_drawMeterSig) return m_currentMeterSig; return NULL; }; ///@} + /** + * Getter for seeing if the key signature cancellation applies + */ + bool DrawKeySigCancellation() { return m_drawKeySigCancellation; }; + /** * @name Set the current clef, keySig, mensur and meterSig. */ diff --git a/include/vrv/textdirective.h b/include/vrv/textdirective.h index 0e617974657..ad6987392ae 100644 --- a/include/vrv/textdirective.h +++ b/include/vrv/textdirective.h @@ -33,6 +33,7 @@ class MeasureTempo: public MeasureElement, public TempoInterface virtual ~MeasureTempo(); virtual void Reset(); virtual std::string GetClassName( ) { return "Tempo"; }; + virtual ClassId Is() { return TEMPO; }; ///@} protected: diff --git a/include/vrv/view.h b/include/vrv/view.h index 47802e8c1a3..5afc5ec9f1e 100644 --- a/include/vrv/view.h +++ b/include/vrv/view.h @@ -130,7 +130,7 @@ class View * Defined in view_element.cpp */ ///@{ - int CalculatePitchPosY ( Staff *staff, char pname, int dec_clef, int oct); + int CalculatePitchPosY ( Staff *staff, data_PITCHNAME pname, int dec_clef, int oct); int CalculateRestPosY ( Staff *staff, char duration); int CalculatePitchCode ( Layer *layer, int y_n, int x_pos, int *octave ); ///@} diff --git a/src/iomusxml.cpp b/src/iomusxml.cpp index f7b3d79f172..436ac0096f0 100644 --- a/src/iomusxml.cpp +++ b/src/iomusxml.cpp @@ -528,7 +528,7 @@ void XMLOutput::WriteNoteOrRest(LayerElement *element) { } else if (dynamic_cast(element)) { - Rest *r = dynamic_cast(element); + //Rest *r = dynamic_cast(element); // rests just link a item //pugi::xml_node rest = note.append_child("rest"); diff --git a/src/keysig.cpp b/src/keysig.cpp index ccc89444635..90f365659d1 100644 --- a/src/keysig.cpp +++ b/src/keysig.cpp @@ -16,9 +16,9 @@ namespace vrv { //---------------------------------------------------------------------------- -// KeySig +// Static members with some default values //---------------------------------------------------------------------------- - + data_PITCHNAME KeySig::flats[] = {PITCHNAME_b, PITCHNAME_e, PITCHNAME_a, PITCHNAME_d, PITCHNAME_g, PITCHNAME_c, PITCHNAME_f}; data_PITCHNAME KeySig::sharps[] = {PITCHNAME_f, PITCHNAME_c, PITCHNAME_g, PITCHNAME_d, PITCHNAME_a, PITCHNAME_e, PITCHNAME_b}; @@ -49,12 +49,17 @@ int KeySig::octave_map[2][9][7] = { }, }; +//---------------------------------------------------------------------------- +// KeySig +//---------------------------------------------------------------------------- + KeySig::KeySig(): LayerElement("ksig-"), KeySigDrawingInterface(), AttAccidental(), AttPitch() { Init(); + Reset(); } KeySig::KeySig(int alterationNumber, data_ACCIDENTAL_EXPLICIT alterationType): @@ -63,17 +68,19 @@ KeySig::KeySig(int alterationNumber, data_ACCIDENTAL_EXPLICIT alterationType): AttPitch() { Init(); + Reset(); m_alterationNumber = alterationNumber; m_alterationType = alterationType; } KeySig::KeySig( KeySigAttr *keySigAttr ): - LayerElement("ksig-"), KeySigDrawingInterface(), + LayerElement("ksig-"), KeySigDrawingInterface( *keySigAttr ), AttAccidental(), AttPitch() { Init(); + // Do not call reset because we key values passed by the keySigAttr arg char key = keySigAttr->GetKeySig() - KEYSIGNATURE_0; /* see data_KEYSIGNATURE order; key will be: @@ -101,7 +108,6 @@ void KeySig::Init() { RegisterAttClass(ATT_ACCIDENTAL); RegisterAttClass(ATT_PITCH); - Reset(); } KeySig::~KeySig() @@ -158,25 +164,30 @@ void KeySig::ConvertToMei() } else return; } + +//---------------------------------------------------------------------------- +// Static methods +//---------------------------------------------------------------------------- + -unsigned char KeySig::GetAlterationAt(int pos) +data_PITCHNAME KeySig::GetAlterationAt(data_ACCIDENTAL_EXPLICIT alterationType, int pos) { data_PITCHNAME *alteration_set; - if (pos > 6) return 0; + if (pos > 6) return PITCHNAME_c; - if (m_alterationType == ACCIDENTAL_EXPLICIT_f) alteration_set = flats; + if (alterationType == ACCIDENTAL_EXPLICIT_f) alteration_set = flats; else alteration_set = sharps; return alteration_set[pos]; } -int KeySig::GetOctave(unsigned char pitch, int clefId) +int KeySig::GetOctave(data_ACCIDENTAL_EXPLICIT alterationType, data_PITCHNAME pitch, int clefId) { int alter_set = 0; // flats int key_set = 0; - if (m_alterationType == ACCIDENTAL_EXPLICIT_f) alter_set = 1; + if (alterationType == ACCIDENTAL_EXPLICIT_s) alter_set = 1; switch (clefId) { case G2: key_set = 0; break; diff --git a/src/object.cpp b/src/object.cpp index 691e07bbd7d..d334413f922 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -958,19 +958,15 @@ int Object::SetCurrentScoreDef( ArrayPtrVoid *params ) bool drawMensur = false; bool drawMeterSig = false; if (scoreDef->GetClef()) { - currentScoreDef->ReplaceClef(scoreDef->GetClef()); drawClef = true; } if (scoreDef->GetKeySig()) { - currentScoreDef->ReplaceKeySig(scoreDef->GetKeySig()); drawKeySig = true; } if (scoreDef->GetMensur()) { - currentScoreDef->ReplaceMensur(scoreDef->GetMensur()); drawMensur = true; } if (scoreDef->GetMeterSig()) { - currentScoreDef->ReplaceMeterSig(scoreDef->GetMeterSig()); drawMeterSig = true; } // Replace the current scoreDef with the new one, including its content (staffDef) diff --git a/src/view_element.cpp b/src/view_element.cpp index 767b2fc8666..079cd6a9343 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -1563,7 +1563,7 @@ void View::DrawCustos( DeviceContext *dc, LayerElement *element, Layer *layer, S // HARDCODED (smufl code wrong) DrawSmuflCode( dc, x, y, 35, staff->staffSize, false ); - dc->EndGraphic(element, this ); //RZ + dc->EndGraphic(element, this ); } @@ -1779,7 +1779,7 @@ void View::DrawKeySig( DeviceContext *dc, LayerElement *element, Layer *layer, S } int symb; - int x, y; + int x, y, i; Clef *c = layer->GetClef(element); if (!c) { @@ -1788,20 +1788,34 @@ void View::DrawKeySig( DeviceContext *dc, LayerElement *element, Layer *layer, S dc->StartGraphic( element, "", element->GetUuid() ); - for (int i = 0; i < keySig->GetAlterationNumber(); i++) { - - // HARDCODED - x = element->GetDrawingX() + (m_doc->m_drawingAccidWidth[staff->staffSize][0] * 1.2) * i; - y = staff->GetDrawingY() + CalculatePitchPosY( staff, keySig->GetAlterationAt(i), layer->GetClefOffset( element ), - keySig->GetOctave(keySig->GetAlterationAt(i), c->GetClefId()));; + x = element->GetDrawingX(); + // HARDCODED + int step = m_doc->m_drawingAccidWidth[staff->staffSize][0] * 1.3; + + if (layer->DrawKeySigCancellation()) { + for (i = 0; i < keySig->m_drawingCancelAccidCount; i++) { + data_PITCHNAME pitch = KeySig::GetAlterationAt( keySig->m_drawingCancelAccidType, i); + y = staff->GetDrawingY() + CalculatePitchPosY( staff, pitch, layer->GetClefOffset( element ), + KeySig::GetOctave( keySig->m_drawingCancelAccidType, pitch, c->GetClefId()));; + + DrawSmuflCode ( dc, x, y, SMUFL_E261_accidentalNatural, staff->staffSize, false ); + x += step; + } + } + + for (i = 0; i < keySig->GetAlterationNumber(); i++) { + data_PITCHNAME pitch = KeySig::GetAlterationAt( keySig->GetAlterationType(), i); + y = staff->GetDrawingY() + CalculatePitchPosY( staff, pitch, layer->GetClefOffset( element ), + KeySig::GetOctave( keySig->GetAlterationType(), pitch, c->GetClefId()));; if (keySig->GetAlterationType() == ACCIDENTAL_EXPLICIT_f) symb = SMUFL_E260_accidentalFlat; else symb = SMUFL_E262_accidentalSharp; DrawSmuflCode ( dc, x, y, symb, staff->staffSize, false ); + x += step; } - dc->EndGraphic(element, this ); //RZ + dc->EndGraphic(element, this ); } diff --git a/src/view_mensural.cpp b/src/view_mensural.cpp index 55da4a7c000..0912b2670b0 100644 --- a/src/view_mensural.cpp +++ b/src/view_mensural.cpp @@ -199,7 +199,7 @@ void View::DrawMensur( DeviceContext *dc, LayerElement *element, Layer *layer, S DrawMeterSigFigures ( dc, x, staff->GetDrawingY(), mensur->GetNum(), numbase, staff); } - dc->EndGraphic(element, this ); //RZ + dc->EndGraphic(element, this ); } diff --git a/src/view_page.cpp b/src/view_page.cpp index e0b7f936640..cdc85d40931 100644 --- a/src/view_page.cpp +++ b/src/view_page.cpp @@ -653,7 +653,7 @@ void View::DrawMeasureElement( DeviceContext *dc, MeasureElement *element, Measu // View - MeasureElement //---------------------------------------------------------------------------- -int View::CalculatePitchPosY ( Staff *staff, char pname, int dec_clef, int oct) +int View::CalculatePitchPosY ( Staff *staff, data_PITCHNAME pname, int dec_clef, int oct) { assert(staff); // Pointer to staff cannot be NULL" @@ -1188,6 +1188,7 @@ void View::DrawMeasureChildren( DeviceContext *dc, Object *parent, Measure *meas DrawMeasureEditorialElement( dc , dynamic_cast(current), measure, system ); } else { + LogDebug("Current is %s", current->GetClassName().c_str() ); assert(false); } } From 7d8e3f6a7081a219cd98cf286e564c71e97b9cb2 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sat, 15 Aug 2015 20:28:47 +0200 Subject: [PATCH 055/114] key.sig.showchange, key.sig.show and C-major / A-minor key change implemented - needs testing and documentation --- include/vrv/drawinglistinterface.h | 7 +++++++ libmei/atts_shared.cpp | 24 ++++++++++++------------ libmei/atts_shared.h | 12 ++++++------ src/drawinglistinterface.cpp | 2 ++ src/iomei.cpp | 16 ++++++++++------ src/keysig.cpp | 12 +++++++++++- src/view_element.cpp | 12 +++++++----- 7 files changed, 55 insertions(+), 30 deletions(-) diff --git a/include/vrv/drawinglistinterface.h b/include/vrv/drawinglistinterface.h index c939ba9f5a2..40069279618 100644 --- a/include/vrv/drawinglistinterface.h +++ b/include/vrv/drawinglistinterface.h @@ -95,6 +95,13 @@ class KeySigDrawingInterface */ data_ACCIDENTAL_EXPLICIT m_drawingCancelAccidType; char m_drawingCancelAccidCount; + /** + * Equivalent to @key.sig.show and @showchange, but set for drawing + * KeySig has no equivalent in MEI and will be true and false by default + * See KeySig::KeySig( KeySigAttr *keySigAttr ) for initialisation + */ + bool m_drawingShow; + bool m_drawingShowchange; private: diff --git a/libmei/atts_shared.cpp b/libmei/atts_shared.cpp index 6be97a940a7..06383c46c1f 100644 --- a/libmei/atts_shared.cpp +++ b/libmei/atts_shared.cpp @@ -2437,19 +2437,19 @@ AttKeySigDefaultVis::~AttKeySigDefaultVis() { } void AttKeySigDefaultVis::ResetKeySigDefaultVis() { - m_keySigShow = ""; - m_keySigShowchange = ""; + m_keySigShow = BOOLEAN_NONE; + m_keySigShowchange = BOOLEAN_NONE; } bool AttKeySigDefaultVis::ReadKeySigDefaultVis( pugi::xml_node element ) { bool hasAttribute = false; if (element.attribute("key.sig.show")) { - this->SetKeySigShow(StrToStr(element.attribute("key.sig.show").value())); + this->SetKeySigShow(StrToBool(element.attribute("key.sig.show").value())); element.remove_attribute("key.sig.show"); hasAttribute = true; } if (element.attribute("key.sig.showchange")) { - this->SetKeySigShowchange(StrToStr(element.attribute("key.sig.showchange").value())); + this->SetKeySigShowchange(StrToBool(element.attribute("key.sig.showchange").value())); element.remove_attribute("key.sig.showchange"); hasAttribute = true; } @@ -2459,11 +2459,11 @@ bool AttKeySigDefaultVis::ReadKeySigDefaultVis( pugi::xml_node element ) { bool AttKeySigDefaultVis::WriteKeySigDefaultVis( pugi::xml_node element ) { bool wroteAttribute = false; if (this->HasKeySigShow()) { - element.append_attribute("key.sig.show") = StrToStr(this->GetKeySigShow()).c_str(); + element.append_attribute("key.sig.show") = BoolToStr(this->GetKeySigShow()).c_str(); wroteAttribute = true; } if (this->HasKeySigShowchange()) { - element.append_attribute("key.sig.showchange") = StrToStr(this->GetKeySigShowchange()).c_str(); + element.append_attribute("key.sig.showchange") = BoolToStr(this->GetKeySigShowchange()).c_str(); wroteAttribute = true; } return wroteAttribute; @@ -2471,12 +2471,12 @@ bool AttKeySigDefaultVis::WriteKeySigDefaultVis( pugi::xml_node element ) { bool AttKeySigDefaultVis::HasKeySigShow( ) { - return (m_keySigShow != ""); + return (m_keySigShow != BOOLEAN_NONE); } bool AttKeySigDefaultVis::HasKeySigShowchange( ) { - return (m_keySigShowchange != ""); + return (m_keySigShowchange != BOOLEAN_NONE); } @@ -7433,11 +7433,11 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu AttKeySigDefaultVis *att = dynamic_cast(element); assert( att ); if (attrType == "keySigShow") { - att->SetKeySigShow(att->StrToStr(attrValue)); + att->SetKeySigShow(att->StrToBool(attrValue)); return true; } if (attrType == "keySigShowchange") { - att->SetKeySigShowchange(att->StrToStr(attrValue)); + att->SetKeySigShowchange(att->StrToBool(attrValue)); return true; } } @@ -8780,10 +8780,10 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { AttKeySigDefaultVis *att = dynamic_cast(element); assert( att ); if (att->HasKeySigShow()) { - attributes->push_back(std::make_pair("keySigShow", att->StrToStr(att->GetKeySigShow()))); + attributes->push_back(std::make_pair("keySigShow", att->BoolToStr(att->GetKeySigShow()))); } if (att->HasKeySigShowchange()) { - attributes->push_back(std::make_pair("keySigShowchange", att->StrToStr(att->GetKeySigShowchange()))); + attributes->push_back(std::make_pair("keySigShowchange", att->BoolToStr(att->GetKeySigShowchange()))); } } if (element->HasAttClass( ATT_LABELSADDL ) ) { diff --git a/libmei/atts_shared.h b/libmei/atts_shared.h index 7b37a79958c..38f5bd7e06c 100644 --- a/libmei/atts_shared.h +++ b/libmei/atts_shared.h @@ -2146,22 +2146,22 @@ class AttKeySigDefaultVis: public Att * to the default value) **/ ///@{ - void SetKeySigShow(std::string keySigShow_) { m_keySigShow = keySigShow_; }; - std::string GetKeySigShow() const { return m_keySigShow; }; + void SetKeySigShow(data_BOOLEAN keySigShow_) { m_keySigShow = keySigShow_; }; + data_BOOLEAN GetKeySigShow() const { return m_keySigShow; }; bool HasKeySigShow( ); // - void SetKeySigShowchange(std::string keySigShowchange_) { m_keySigShowchange = keySigShowchange_; }; - std::string GetKeySigShowchange() const { return m_keySigShowchange; }; + void SetKeySigShowchange(data_BOOLEAN keySigShowchange_) { m_keySigShowchange = keySigShowchange_; }; + data_BOOLEAN GetKeySigShowchange() const { return m_keySigShowchange; }; bool HasKeySigShowchange( ); ///@} private: /** Indicates whether the key signature should be displayed. **/ - std::string m_keySigShow; + data_BOOLEAN m_keySigShow; /** Determines whether cautionary accidentals should be displayed at a key change. **/ - std::string m_keySigShowchange; + data_BOOLEAN m_keySigShowchange; /* include */ }; diff --git a/src/drawinglistinterface.cpp b/src/drawinglistinterface.cpp index 70fc2c74745..8bfec4aba7a 100644 --- a/src/drawinglistinterface.cpp +++ b/src/drawinglistinterface.cpp @@ -72,6 +72,8 @@ void KeySigDrawingInterface::Reset() { m_drawingCancelAccidType = ACCIDENTAL_EXPLICIT_n; m_drawingCancelAccidCount = 0; + m_drawingShow = true; + m_drawingShowchange = false; } } // namespace vrv diff --git a/src/iomei.cpp b/src/iomei.cpp index e1821a47751..b85e32e3750 100644 --- a/src/iomei.cpp +++ b/src/iomei.cpp @@ -404,6 +404,7 @@ bool MeiOutput::WriteMeiScoreDef( pugi::xml_node currentNode, ScoreDef *scoreDef } if (scoreDef->GetKeySigAttr()) { scoreDef->GetKeySigAttr()->WriteKeySigDefaultLog(currentNode); + scoreDef->GetKeySigAttr()->WriteKeySigDefaultVis(currentNode); } if ( scoreDef->GetMensurAttr() ) { scoreDef->GetMensurAttr()->WriteMensuralLog(currentNode); @@ -448,6 +449,7 @@ bool MeiOutput::WriteMeiStaffDef( pugi::xml_node currentNode, StaffDef *staffDef } if (staffDef->GetKeySigAttr()) { staffDef->GetKeySigAttr()->WriteKeySigDefaultLog(currentNode); + staffDef->GetKeySigAttr()->WriteKeySigDefaultVis(currentNode); } if ( staffDef->GetMensurAttr() ) { staffDef->GetMensurAttr()->WriteMensuralLog(currentNode); @@ -1246,17 +1248,18 @@ bool MeiInput::ReadMeiScoreDef( Object *parent, pugi::xml_node scoreDef ) vrvScoreDef->ReplaceClef( &clefAttr ); } KeySigAttr keySigAttr; - if ( keySigAttr.ReadKeySigDefaultLog( scoreDef ) ) { + if ( keySigAttr.ReadKeySigDefaultLog( scoreDef ) || keySigAttr.ReadKeySigDefaultVis( scoreDef ) ) { + keySigAttr.ReadKeySigDefaultVis( scoreDef ); // not great, but we need to do it in case we have both and the first one succeeded vrvScoreDef->ReplaceKeySig( &keySigAttr ); } MeterSigAttr meterSig; if ( meterSig.ReadMeterSigDefaultLog( scoreDef ) || meterSig.ReadMeterSigDefaultVis( scoreDef ) ) { - meterSig.ReadMeterSigDefaultVis( scoreDef ); // not great, but we need to do it in case we have both and the first one succeeded + meterSig.ReadMeterSigDefaultVis( scoreDef ); // same as above, needs refactoring vrvScoreDef->ReplaceMeterSig( &meterSig ); } MensurAttr mensur; if ( mensur.ReadMensuralLog( scoreDef ) || mensur.ReadMensuralShared( scoreDef ) ) { - mensur.ReadMensuralShared( scoreDef ); // not great, but we need to do it in case we have both and the first one succeeded + mensur.ReadMensuralShared( scoreDef ); // same as above, needs refactoring vrvScoreDef->ReplaceMensur( &mensur ); } @@ -1367,17 +1370,18 @@ bool MeiInput::ReadMeiStaffDef( Object *parent, pugi::xml_node staffDef ) vrvStaffDef->ReplaceClef( &clefAttr ); } KeySigAttr keySigAttr; - if ( keySigAttr.ReadKeySigDefaultLog( staffDef ) ) { + if ( keySigAttr.ReadKeySigDefaultLog( staffDef ) || keySigAttr.ReadKeySigDefaultVis( staffDef ) ) { + keySigAttr.ReadKeySigDefaultVis( staffDef ); // not great, but we need to do it in case we have both and the first one succeeded vrvStaffDef->ReplaceKeySig( &keySigAttr ); } MeterSigAttr meterSig; if ( meterSig.ReadMeterSigDefaultLog( staffDef ) || meterSig.ReadMeterSigDefaultVis( staffDef ) ) { - meterSig.ReadMeterSigDefaultVis( staffDef ); // not great, but we need to do it in case we have both and the first one succeeded + meterSig.ReadMeterSigDefaultVis( staffDef ); // same as above, needs refactoring vrvStaffDef->ReplaceMeterSig( &meterSig ); } MensurAttr mensur; if ( mensur.ReadMensuralLog( staffDef ) || mensur.ReadMensuralShared( staffDef ) ) { - mensur.ReadMensuralShared( staffDef ); // not great, but we need to do it in case we have both and the first one succeeded + mensur.ReadMensuralShared( staffDef ); // same as above, needs refactoring vrvStaffDef->ReplaceMensur( &mensur ); } diff --git a/src/keysig.cpp b/src/keysig.cpp index 90f365659d1..cd02ec7c8e0 100644 --- a/src/keysig.cpp +++ b/src/keysig.cpp @@ -102,6 +102,13 @@ KeySig::KeySig( KeySigAttr *keySigAttr ): m_alterationType = ACCIDENTAL_EXPLICIT_f; } m_alterationNumber = abs(key); + + if ( keySigAttr->GetKeySigShow() == BOOLEAN_false ) { + m_drawingShow = false; + } + if ( keySigAttr->GetKeySigShowchange() == BOOLEAN_true ) { + m_drawingShowchange = true; + } } void KeySig::Init() @@ -216,9 +223,11 @@ int KeySig::GetOctave(data_ACCIDENTAL_EXPLICIT alterationType, data_PITCHNAME pi KeySigAttr::KeySigAttr(): Object(), KeySigDrawingInterface(), - AttKeySigDefaultLog() + AttKeySigDefaultLog(), + AttKeySigDefaultVis() { RegisterAttClass(ATT_KEYSIGDEFAULTLOG); + RegisterAttClass(ATT_KEYSIGDEFAULTVIS); Reset(); } @@ -231,6 +240,7 @@ void KeySigAttr::Reset() Object::Reset(); KeySigDrawingInterface::Reset(); ResetKeySigDefaultLog(); + ResetKeySigDefaultVis(); } } // namespace vrv \ No newline at end of file diff --git a/src/view_element.cpp b/src/view_element.cpp index 079cd6a9343..1a88dcfaa65 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -1774,10 +1774,6 @@ void View::DrawKeySig( DeviceContext *dc, LayerElement *element, Layer *layer, S KeySig *keySig = dynamic_cast(element); assert( keySig ); - if (keySig->GetAlterationNumber()==0) { - return; - } - int symb; int x, y, i; @@ -1786,13 +1782,19 @@ void View::DrawKeySig( DeviceContext *dc, LayerElement *element, Layer *layer, S return; } + // hidden key signature + if (!keySig->m_drawingShow) { + return; + } + dc->StartGraphic( element, "", element->GetUuid() ); x = element->GetDrawingX(); // HARDCODED int step = m_doc->m_drawingAccidWidth[staff->staffSize][0] * 1.3; - if (layer->DrawKeySigCancellation()) { + // Show cancellation if any and if C major (0) or show cancellation (showchange) is true (false by default) + if (layer->DrawKeySigCancellation() && ( (keySig->GetAlterationNumber() == 0) || keySig->m_drawingShowchange) ) { for (i = 0; i < keySig->m_drawingCancelAccidCount; i++) { data_PITCHNAME pitch = KeySig::GetAlterationAt( keySig->m_drawingCancelAccidType, i); y = staff->GetDrawingY() + CalculatePitchPosY( staff, pitch, layer->GetClefOffset( element ), From 747638a7df7ac63ab886cedc7b571d2a122d70a2 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sat, 15 Aug 2015 21:52:50 +0200 Subject: [PATCH 056/114] Fixing PAE key sig issues --- include/vrv/keysig.h | 2 +- src/iopae.cpp | 6 +++++- src/view_element.cpp | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/vrv/keysig.h b/include/vrv/keysig.h index 1547fb4b453..64529e36f7d 100644 --- a/include/vrv/keysig.h +++ b/include/vrv/keysig.h @@ -59,7 +59,7 @@ class KeySig: public LayerElement, public KeySigDrawingInterface, /* Alteration number getter/setter */ data_ACCIDENTAL_EXPLICIT GetAlterationType() { return m_alterationType; }; - void SetAlterationType( data_ACCIDENTAL_EXPLICIT alterationType ) { m_alterationType = m_alterationType; }; + void SetAlterationType( data_ACCIDENTAL_EXPLICIT alterationType ) { m_alterationType = alterationType; }; /* Temporary methods for turning @accid and @pitch into num_alter and alter */ void ConvertToMei( ); diff --git a/src/iopae.cpp b/src/iopae.cpp index e1256044b59..113391fa057 100644 --- a/src/iopae.cpp +++ b/src/iopae.cpp @@ -968,6 +968,8 @@ int PaeInput::getKeyInfo(const char *incipit, KeySig *key, int index ) { switch (incipit[i]) { case 'b': key->SetAlterationType(ACCIDENTAL_EXPLICIT_f); break; case 'x': key->SetAlterationType(ACCIDENTAL_EXPLICIT_s); break; + case 'n': key->SetAlterationType(ACCIDENTAL_EXPLICIT_n); break; + case '[': break; case 'F': case 'C': case 'G': @@ -983,7 +985,9 @@ int PaeInput::getKeyInfo(const char *incipit, KeySig *key, int index ) { i++; } - key->SetAlterationNumber(alt_nr); + if (key->GetAlterationType() != ACCIDENTAL_EXPLICIT_n) { + key->SetAlterationNumber(alt_nr); + } key->ConvertToMei(); diff --git a/src/view_element.cpp b/src/view_element.cpp index 1a88dcfaa65..135f3732c63 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -1793,8 +1793,8 @@ void View::DrawKeySig( DeviceContext *dc, LayerElement *element, Layer *layer, S // HARDCODED int step = m_doc->m_drawingAccidWidth[staff->staffSize][0] * 1.3; - // Show cancellation if any and if C major (0) or show cancellation (showchange) is true (false by default) - if (layer->DrawKeySigCancellation() && ( (keySig->GetAlterationNumber() == 0) || keySig->m_drawingShowchange) ) { + // Show cancellation if C major (0) or if any cancellation and show cancellation (showchange) is true (false by default) + if ( (keySig->GetAlterationNumber() == 0) || (layer->DrawKeySigCancellation() && keySig->m_drawingShowchange) ) { for (i = 0; i < keySig->m_drawingCancelAccidCount; i++) { data_PITCHNAME pitch = KeySig::GetAlterationAt( keySig->m_drawingCancelAccidType, i); y = staff->GetDrawingY() + CalculatePitchPosY( staff, pitch, layer->GetClefOffset( element ), From 4649bbcd2a17355a4b7affb216a49d52ea2908dd Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sat, 15 Aug 2015 23:53:01 +0200 Subject: [PATCH 057/114] Changing MeasureElement to FloatingElement (WIP) --- Verovio.xcodeproj/project.pbxproj | 30 +++++----- emscripten/build.sh | 2 +- include/vrv/editorial.h | 6 +- .../{measureelement.h => floatingelement.h} | 18 +++--- include/vrv/iomei.h | 31 +++-------- include/vrv/layer.h | 9 ++- include/vrv/measure.h | 14 +++-- include/vrv/object.h | 2 +- include/vrv/page.h | 5 ++ include/vrv/scoredef.h | 6 +- include/vrv/slur.h | 4 +- include/vrv/staff.h | 9 ++- include/vrv/system.h | 6 +- include/vrv/textdirective.h | 8 +-- include/vrv/textdirinterface.h | 35 +----------- include/vrv/tie.h | 4 +- include/vrv/view.h | 12 ++-- include/vrv/vrvdef.h | 6 +- java/build.sh | 2 +- python/setup.py | 2 +- src/doc.cpp | 2 - src/editorial.cpp | 17 ++++-- ...measureelement.cpp => floatingelement.cpp} | 14 ++--- src/iodarms.cpp | 2 +- src/iomei.cpp | 55 +++++++++---------- src/iopae.cpp | 2 +- src/measure.cpp | 17 +++++- src/slur.cpp | 4 +- src/staff.cpp | 4 +- src/textdirective.cpp | 18 +++--- src/textdirinterface.cpp | 25 ++------- src/tie.cpp | 4 +- src/toolkit.cpp | 2 +- src/view_page.cpp | 20 +++---- tools/CMakeLists.txt | 2 +- 35 files changed, 189 insertions(+), 210 deletions(-) rename include/vrv/{measureelement.h => floatingelement.h} (73%) rename src/{measureelement.cpp => floatingelement.cpp} (76%) diff --git a/Verovio.xcodeproj/project.pbxproj b/Verovio.xcodeproj/project.pbxproj index c962f928621..86f1c9b2a05 100644 --- a/Verovio.xcodeproj/project.pbxproj +++ b/Verovio.xcodeproj/project.pbxproj @@ -71,9 +71,9 @@ 4DF289FD1A7545CC00BA9F7D /* timeinterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DF289FC1A7545CC00BA9F7D /* timeinterface.h */; }; 4DF289FF1A7545E500BA9F7D /* timeinterface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DF289FE1A7545E500BA9F7D /* timeinterface.cpp */; }; 4DF28A001A7545E500BA9F7D /* timeinterface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DF289FE1A7545E500BA9F7D /* timeinterface.cpp */; }; - 4DF28A031A754DE400BA9F7D /* measureelement.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DF28A021A754DE400BA9F7D /* measureelement.h */; }; - 4DF28A051A754DF000BA9F7D /* measureelement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DF28A041A754DF000BA9F7D /* measureelement.cpp */; }; - 4DF28A061A754DF000BA9F7D /* measureelement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DF28A041A754DF000BA9F7D /* measureelement.cpp */; }; + 4DF28A031A754DE400BA9F7D /* floatingelement.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DF28A021A754DE400BA9F7D /* floatingelement.h */; }; + 4DF28A051A754DF000BA9F7D /* floatingelement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DF28A041A754DF000BA9F7D /* floatingelement.cpp */; }; + 4DF28A061A754DF000BA9F7D /* floatingelement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DF28A041A754DF000BA9F7D /* floatingelement.cpp */; }; 4DF2AF7E1A62F6A50016F869 /* drawinglistinterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DF2AF7D1A62F6A50016F869 /* drawinglistinterface.h */; }; 4DF2AF801A62FC4A0016F869 /* drawinglistinterface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DF2AF7F1A62FC4A0016F869 /* drawinglistinterface.cpp */; }; 4DF2AF811A62FC4A0016F869 /* drawinglistinterface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DF2AF7F1A62FC4A0016F869 /* drawinglistinterface.cpp */; }; @@ -290,8 +290,8 @@ 4DEE290C1940BCC100C76319 /* atts_tablature.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = atts_tablature.h; path = libmei/atts_tablature.h; sourceTree = ""; }; 4DF289FC1A7545CC00BA9F7D /* timeinterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = timeinterface.h; path = include/vrv/timeinterface.h; sourceTree = ""; }; 4DF289FE1A7545E500BA9F7D /* timeinterface.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = timeinterface.cpp; path = src/timeinterface.cpp; sourceTree = ""; }; - 4DF28A021A754DE400BA9F7D /* measureelement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = measureelement.h; path = include/vrv/measureelement.h; sourceTree = ""; }; - 4DF28A041A754DF000BA9F7D /* measureelement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = measureelement.cpp; path = src/measureelement.cpp; sourceTree = ""; }; + 4DF28A021A754DE400BA9F7D /* floatingelement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = floatingelement.h; path = include/vrv/floatingelement.h; sourceTree = ""; }; + 4DF28A041A754DF000BA9F7D /* floatingelement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = floatingelement.cpp; path = src/floatingelement.cpp; sourceTree = ""; }; 4DF2AF7D1A62F6A50016F869 /* drawinglistinterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = drawinglistinterface.h; path = include/vrv/drawinglistinterface.h; sourceTree = ""; }; 4DF2AF7F1A62FC4A0016F869 /* drawinglistinterface.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = drawinglistinterface.cpp; path = src/drawinglistinterface.cpp; sourceTree = ""; }; 8F086EA9188534680037FD8E /* Verovio */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Verovio; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -485,17 +485,19 @@ name = libmei; sourceTree = ""; }; - 4DF28A011A754DAA00BA9F7D /* measureelements */ = { + 4DF28A011A754DAA00BA9F7D /* floatingelements */ = { isa = PBXGroup; children = ( - 4DF28A041A754DF000BA9F7D /* measureelement.cpp */, - 4DF28A021A754DE400BA9F7D /* measureelement.h */, + 4DF28A041A754DF000BA9F7D /* floatingelement.cpp */, + 4DF28A021A754DE400BA9F7D /* floatingelement.h */, 8F086ED3188539540037FD8E /* slur.cpp */, 8F59292A18854BF800FE51AD /* slur.h */, + 4DA60EE21B6307B9006E2DFC /* textdirective.cpp */, + 4DA60EDE1B6307A8006E2DFC /* textdirective.h */, 8F086ED8188539540037FD8E /* tie.cpp */, 8F59292F18854BF800FE51AD /* tie.h */, ); - name = measureelements; + name = floatingelements; sourceTree = ""; }; 8F086E9E188534680037FD8E = { @@ -526,7 +528,7 @@ 8F086F37188539C50037FD8E /* io */, 8F086F38188539F00037FD8E /* containers */, 8F086F3A18853A540037FD8E /* elements */, - 4DF28A011A754DAA00BA9F7D /* measureelements */, + 4DF28A011A754DAA00BA9F7D /* floatingelements */, 4DC34B9E19BC33A0006175CD /* interfaces */, 8F086F3918853A190037FD8E /* view */, 8F086EB6188539540037FD8E /* aligner.cpp */, @@ -545,8 +547,6 @@ 4D1D733B1A1D0390001E08F6 /* smufl.h */, 4DA80D951A6ACF5D0089802D /* style.cpp */, 4DA80D941A6940120089802D /* style.h */, - 4DA60EE21B6307B9006E2DFC /* textdirective.cpp */, - 4DA60EDE1B6307A8006E2DFC /* textdirective.h */, 8F086EBF188539540037FD8E /* toolkit.cpp */, 8F59291618854BF800FE51AD /* toolkit.h */, ); @@ -703,7 +703,7 @@ 8F59294B18854BF800FE51AD /* object.h in Headers */, 8F59294C18854BF800FE51AD /* page.h in Headers */, 4D9C53131B52E4AE0003C6EC /* unchecked.h in Headers */, - 4DF28A031A754DE400BA9F7D /* measureelement.h in Headers */, + 4DF28A031A754DE400BA9F7D /* floatingelement.h in Headers */, 8F59294D18854BF800FE51AD /* pitchinterface.h in Headers */, 8F59294E18854BF800FE51AD /* positioninterface.h in Headers */, 8F59294F18854BF800FE51AD /* rest.h in Headers */, @@ -882,7 +882,7 @@ 4D1D73401A1D08DC001E08F6 /* glyph.cpp in Sources */, 4D9A9C1E19A1DE2000028D93 /* syl.cpp in Sources */, 4DA3FCD319B61DB300CBDFE6 /* atts_cmn.cpp in Sources */, - 4DF28A051A754DF000BA9F7D /* measureelement.cpp in Sources */, + 4DF28A051A754DF000BA9F7D /* floatingelement.cpp in Sources */, 4D3FF8DB19BADD7A00B105B5 /* atts_pagebased.cpp in Sources */, 4DC34BA819BC4A83006175CD /* accid.cpp in Sources */, 4DC34BAA19BC4A83006175CD /* custos.cpp in Sources */, @@ -950,7 +950,7 @@ 4D4221071998A8CE00963292 /* atts_mensural.cpp in Sources */, 4D9A9C1A199F561200028D93 /* verse.cpp in Sources */, 4D9A9C1F19A1DE2000028D93 /* syl.cpp in Sources */, - 4DF28A061A754DF000BA9F7D /* measureelement.cpp in Sources */, + 4DF28A061A754DF000BA9F7D /* floatingelement.cpp in Sources */, 4DA3FCD419B61DB400CBDFE6 /* atts_cmn.cpp in Sources */, 4DC34BA919BC4A83006175CD /* accid.cpp in Sources */, 4DC34BAB19BC4A83006175CD /* custos.cpp in Sources */, diff --git a/emscripten/build.sh b/emscripten/build.sh index f0707c625a5..1ccc420ff3c 100755 --- a/emscripten/build.sh +++ b/emscripten/build.sh @@ -110,6 +110,7 @@ python $EMCC $CHATTY \ $VEROVIO_ROOT/src/drawinglistinterface.cpp \ $VEROVIO_ROOT/src/durationinterface.cpp \ $VEROVIO_ROOT/src/editorial.cpp \ + $VEROVIO_ROOT/src/floatingelement.cpp \ $VEROVIO_ROOT/src/glyph.cpp \ $VEROVIO_ROOT/src/io.cpp \ $VEROVIO_ROOT/src/iodarms.cpp \ @@ -120,7 +121,6 @@ python $EMCC $CHATTY \ $VEROVIO_ROOT/src/layer.cpp \ $VEROVIO_ROOT/src/layerelement.cpp \ $VEROVIO_ROOT/src/measure.cpp \ - $VEROVIO_ROOT/src/measureelement.cpp \ $VEROVIO_ROOT/src/mensur.cpp \ $VEROVIO_ROOT/src/metersig.cpp \ $VEROVIO_ROOT/src/mrest.cpp \ diff --git a/include/vrv/editorial.h b/include/vrv/editorial.h index b5cbda370c4..585a7132e7a 100644 --- a/include/vrv/editorial.h +++ b/include/vrv/editorial.h @@ -15,13 +15,14 @@ namespace vrv { +class FloatingElement; class Layer; class LayerElement; class Lem; class Measure; -class MeasureElement; class Rdg; class ScoreDef; +class Staff; class StaffDef; class StaffGrp; @@ -59,11 +60,12 @@ class EditorialElement: public DocObject, * @name Add children to an editorial element. */ ///@{ + void AddFloatingElement( FloatingElement *child ); void AddLayerElement( LayerElement *child ); void AddLayer( Layer *child ); void AddMeasure( Measure *child ); - void AddMeasureElement( MeasureElement *child ); void AddScoreDef( ScoreDef *child ); + void AddStaff( Staff *child ); void AddStaffDef( StaffDef *child ); void AddStaffGrp( StaffGrp *child ); ///@} diff --git a/include/vrv/measureelement.h b/include/vrv/floatingelement.h similarity index 73% rename from include/vrv/measureelement.h rename to include/vrv/floatingelement.h index 0734b5da48e..0b6555988cd 100644 --- a/include/vrv/measureelement.h +++ b/include/vrv/floatingelement.h @@ -1,27 +1,27 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: measureelement.h +// Name: floatingelement.h // Author: Laurent Pugin // Created: 2015 // Copyright (c) Authors and others. All rights reserved. ///////////////////////////////////////////////////////////////////////////// -#ifndef __VRV_MEASURE_ELEMENT_H__ -#define __VRV_MEASURE_ELEMENT_H__ +#ifndef __VRV_FLOATING_ELEMENT_H__ +#define __VRV_FLOATING_ELEMENT_H__ #include "object.h" namespace vrv { //---------------------------------------------------------------------------- -// MeasureElement +// FloatingElement //---------------------------------------------------------------------------- /** * This class is an interface for elements with duration, such as notes and rests. * It is not an abstract class but should not be instanciate directly. */ -class MeasureElement: public DocObject +class FloatingElement: public DocObject { public: /** @@ -29,11 +29,11 @@ class MeasureElement: public DocObject * Reset method reset all attribute classes */ ///@{ - MeasureElement(); - MeasureElement(std::string classid); - virtual ~MeasureElement(); + FloatingElement(); + FloatingElement(std::string classid); + virtual ~FloatingElement(); virtual void Reset(); - virtual ClassId Is() { return MEASURE_ELEMENT; }; + virtual ClassId Is() { return FLOATING_ELEMENT; }; ///@} private: diff --git a/include/vrv/iomei.h b/include/vrv/iomei.h index 548ed78ef6a..c70d2c6cdf4 100644 --- a/include/vrv/iomei.h +++ b/include/vrv/iomei.h @@ -28,12 +28,11 @@ class Clef; class Custos; class Dot; class DurationInterface; +class FloatingElement; class Layer; class LayerElement; class Lem; class Measure; -class MeasureElement; -class MeasureTempo; class Mensur; class MeterSig; class MRest; @@ -50,7 +49,7 @@ class Staff; class Supplied; class Syl; class System; -class TempoInterface; +class Tempo; class TextDirInterface; class Tie; class TimeSpanningInterface; @@ -143,11 +142,12 @@ class MeiOutput: public FileOutputStream ///@} /** - * @name Methods for wrinting MeasureElement children (other the staff). + * @name Methods for wrining FloatingElement */ ///@{ - void WriteMeiTie( pugi::xml_node currentNode, Tie *tie ); void WriteMeiSlur( pugi::xml_node currentNode, Slur *slur ); + void WriteMeiTempo( pugi::xml_node currentNode, Tempo *tempo ); + void WriteMeiTie( pugi::xml_node currentNode, Tie *tie ); ///@} /** @@ -161,13 +161,6 @@ class MeiOutput: public FileOutputStream bool WriteMeiAnnot( pugi::xml_node currentNode, Annot *annot ); ///@} - /** - * @name Methods for wrinting text directive elements. - */ - ///@{ - void WriteMeiTempo( pugi::xml_node currentNode, MeasureTempo *tempo ); - ///@} - /** * @name Methods for wrinting other mei elements */ @@ -198,7 +191,6 @@ class MeiOutput: public FileOutputStream void WriteDurationInterface( pugi::xml_node currentNode, DurationInterface *interface ); void WritePitchInterface( pugi::xml_node currentNode, PitchInterface *interface ); void WritePositionInterface( pugi::xml_node currentNode, PositionInterface *interface ); - void WriteTempoInterface( pugi::xml_node currentNode, TempoInterface *interface ); void WriteTextDirInterface( pugi::xml_node currentNode, TextDirInterface *interface ); void WriteTimeSpanningInterface( pugi::xml_node currentNode, TimeSpanningInterface *interface ); ///@} @@ -315,19 +307,13 @@ class MeiInput: public FileInputStream ///@} /** - * @name Methods for reading MEI measure elements + * @name Methods for reading MEI floating elements */ ///@{ bool ReadMeiSlur( Object *parent, pugi::xml_node slur ); + bool ReadMeiTempo( Object *parent, pugi::xml_node tempo ); bool ReadMeiTie( Object *parent, pugi::xml_node tie ); ///@} - - /** - * @name Methods for reading MEI text directives - */ - ///@{ - bool ReadMeiMeasureTempo( Object *parent, pugi::xml_node tempo ); - ///@} /** * @name Methods for reading critical apparatus, other editorial markup and . @@ -353,7 +339,6 @@ class MeiInput: public FileInputStream bool ReadDurationInterface( pugi::xml_node element, DurationInterface *interface ); bool ReadPitchInterface( pugi::xml_node element, PitchInterface *interface ); bool ReadPositionInterface( pugi::xml_node element, PositionInterface *interface ); - bool ReadTempoInterface( pugi::xml_node element, TempoInterface *interface ); bool ReadTextDirInterface( pugi::xml_node element, TextDirInterface *interface ); bool ReadTimeSpanningInterface( pugi::xml_node element, TimeSpanningInterface *interface ); ///@} @@ -391,7 +376,7 @@ class MeiInput: public FileInputStream */ ///@{ void AddLayerElement( Object *parent, LayerElement *element ); - void AddMeasureElement( Object *parent, MeasureElement *element ); + void AddFloatingElement( Object *parent, FloatingElement *element ); void AddScoreDef( Object *parent, ScoreDef *element ); void AddStaffGrp( Object *parent, StaffGrp *element ); ///@} diff --git a/include/vrv/layer.h b/include/vrv/layer.h index 4f2b4290113..6b838b3c7ac 100644 --- a/include/vrv/layer.h +++ b/include/vrv/layer.h @@ -50,10 +50,13 @@ class Layer: public DocObject, public DrawingListInterface, public ObjectListInt virtual ClassId Is() { return LAYER; }; ///@} + /** + * @name Methods for adding allowed content + */ + ///@{ void AddLayerElement( LayerElement *element, int idx = -1 ); - - int GetElementCount() const { return (int)m_children.size(); }; - + ///@} + /** * Return the index position of the layer in its staff parent. * The index position is 0-based. diff --git a/include/vrv/measure.h b/include/vrv/measure.h index 13b629ac9b1..8ff0ea5b7ff 100644 --- a/include/vrv/measure.h +++ b/include/vrv/measure.h @@ -16,7 +16,7 @@ namespace vrv { -class MeasureElement; +class FloatingElement; //---------------------------------------------------------------------------- // Measure @@ -51,10 +51,14 @@ class Measure: public DocObject, */ bool IsMeasuredMusic() { return m_measuredMusic; }; - void AddMeasureElement( MeasureElement *element ); - - int GetStaffCount() const { return (int)m_children.size(); }; - + /** + * @name Methods for adding allowed content + */ + ///@{ + void AddStaff( Staff *staff ); + void AddFloatingElement( FloatingElement *element ); + ///@} + /** * Return the index position of the measure in its system parent */ diff --git a/include/vrv/object.h b/include/vrv/object.h index ad331a86f4b..5f2b3c42f18 100644 --- a/include/vrv/object.h +++ b/include/vrv/object.h @@ -71,7 +71,7 @@ class Object virtual ClassId Is(); bool IsEditorialElement() { return (this->Is() > EDITORIAL_ELEMENT && this->Is() < EDITORIAL_ELEMENT_max); }; bool IsLayerElement() { return (this->Is() > LAYER_ELEMENT && this->Is() < LAYER_ELEMENT_max); }; - bool IsMeasureElement() { return (this->Is() > MEASURE_ELEMENT && this->Is() < MEASURE_ELEMENT_max); }; + bool IsFloatingElement() { return (this->Is() > FLOATING_ELEMENT && this->Is() < FLOATING_ELEMENT_max); }; /** * diff --git a/include/vrv/page.h b/include/vrv/page.h index 7fb01661cdd..a0dd3d6cb39 100644 --- a/include/vrv/page.h +++ b/include/vrv/page.h @@ -43,7 +43,12 @@ class Page: public DocObject virtual ClassId Is() { return PAGE; }; ///@} + /** + * @name Methods for adding allowed content + */ + ///@{ void AddSystem( System *system ); + ///@} int GetSystemCount() const { return (int)m_children.size(); }; diff --git a/include/vrv/scoredef.h b/include/vrv/scoredef.h index 9a49955bf9c..f1f4da423ff 100644 --- a/include/vrv/scoredef.h +++ b/include/vrv/scoredef.h @@ -244,9 +244,13 @@ class StaffGrp: public Object, public ObjectListInterface virtual ClassId Is() { return STAFF_GRP; }; ///@} + /** + * @name Methods for adding allowed content + */ + ///@{ void AddStaffDef( StaffDef *staffDef ); - void AddStaffGrp( StaffGrp *staffGrp ); + ///@} /** * @name Set and get the staffGrp @symbol diff --git a/include/vrv/slur.h b/include/vrv/slur.h index e8017d02970..22dd786913d 100644 --- a/include/vrv/slur.h +++ b/include/vrv/slur.h @@ -9,7 +9,7 @@ #ifndef __VRV_SLUR_H__ #define __VRV_SLUR_H__ -#include "measureelement.h" +#include "floatingelement.h" #include "timeinterface.h" namespace vrv { @@ -18,7 +18,7 @@ namespace vrv { // Slur //---------------------------------------------------------------------------- -class Slur: public MeasureElement, public TimeSpanningInterface +class Slur: public FloatingElement, public TimeSpanningInterface { public: /** diff --git a/include/vrv/staff.h b/include/vrv/staff.h index 9426bcc251a..43fbfae99db 100644 --- a/include/vrv/staff.h +++ b/include/vrv/staff.h @@ -10,7 +10,7 @@ #define __VRV_STAFF_H__ #include "atts_shared.h" -#include "measureelement.h" +#include "object.h" namespace vrv { @@ -30,7 +30,7 @@ class TimeSpanningInterface; * It contains Measure objects. * For unmeasured music, on single Measure is added for simplifying internal processing */ -class Staff: public MeasureElement, +class Staff: public DocObject, public AttCommon { @@ -47,7 +47,12 @@ class Staff: public MeasureElement, virtual ClassId Is() { return STAFF; }; ///@} + /** + * @name Methods for adding allowed content + */ + ///@{ void AddLayer( Layer *layer ); + ///@} int GetLayerCount() const { return (int)m_children.size(); }; diff --git a/include/vrv/system.h b/include/vrv/system.h index 2eed7da34f2..69801417f03 100644 --- a/include/vrv/system.h +++ b/include/vrv/system.h @@ -43,9 +43,13 @@ class System: public DocObject, public DrawingListInterface virtual ClassId Is() { return SYSTEM; }; ///@} + /** + * @name Methods for adding allowed content + */ + ///@{ void AddMeasure( Measure *measure ); - void AddScoreDef( ScoreDef *scoreDef ); + ///@} /** * @name Reset the alignment values (m_drawingX, m_drawingXRel, etc.) diff --git a/include/vrv/textdirective.h b/include/vrv/textdirective.h index ad6987392ae..12f5d2a5631 100644 --- a/include/vrv/textdirective.h +++ b/include/vrv/textdirective.h @@ -9,7 +9,7 @@ #ifndef __VRV_TEXT_DIRECTIVE_H__ #define __VRV_TEXT_DIRECTIVE_H__ -#include "measureelement.h" +#include "floatingelement.h" #include "textdirinterface.h" namespace vrv { @@ -21,7 +21,7 @@ namespace vrv { /** * This class is an interface for elements at the measure level */ -class MeasureTempo: public MeasureElement, public TempoInterface +class Tempo: public FloatingElement, public TextDirInterface { public: /** @@ -29,8 +29,8 @@ class MeasureTempo: public MeasureElement, public TempoInterface * Reset method reset all attribute classes */ ///@{ - MeasureTempo(); - virtual ~MeasureTempo(); + Tempo(); + virtual ~Tempo(); virtual void Reset(); virtual std::string GetClassName( ) { return "Tempo"; }; virtual ClassId Is() { return TEMPO; }; diff --git a/include/vrv/textdirinterface.h b/include/vrv/textdirinterface.h index d7cecd413f9..ee3eea8af3c 100644 --- a/include/vrv/textdirinterface.h +++ b/include/vrv/textdirinterface.h @@ -23,7 +23,7 @@ namespace vrv { * as , , or * It is not an abstract class but should not be instanciate directly. */ -class TextDirInterface: +class TextDirInterface: public Interface, public AttCommon, public AttPlacement, public AttStaffident @@ -49,39 +49,6 @@ class TextDirInterface: }; -//---------------------------------------------------------------------------- -// Tempo -//---------------------------------------------------------------------------- - -/** - * This class is an interface for elements. - * It is defined as an interface because it can be attached to - * MeasureElement or LayerElement in MeasureTempo and LayerTempo respectively - * It is not an abstract class but should not be instanciate directly. - */ -class TempoInterface: public TextDirInterface -{ -public: - /** - * @name Constructors, destructors, reset methods - * Reset method reset all attribute classes - */ - ///@{ - TempoInterface(); - virtual ~TempoInterface(); - virtual void Reset(); - ///@} - -protected: - -private: - -public: - -private: - -}; - } // namespace vrv #endif diff --git a/include/vrv/tie.h b/include/vrv/tie.h index 9d62d0e971c..ff4aed64784 100644 --- a/include/vrv/tie.h +++ b/include/vrv/tie.h @@ -9,7 +9,7 @@ #ifndef __VRV_TIE_H__ #define __VRV_TIE_H__ -#include "measureelement.h" +#include "floatingelement.h" #include "timeinterface.h" namespace vrv { @@ -20,7 +20,7 @@ namespace vrv { // NOTE tie NOTE tie etc //---------------------------------------------------------------------------- -class Tie: public MeasureElement, public TimeSpanningInterface +class Tie: public FloatingElement, public TimeSpanningInterface { public: /** diff --git a/include/vrv/view.h b/include/vrv/view.h index 5afc5ec9f1e..9cb6e8af0e3 100644 --- a/include/vrv/view.h +++ b/include/vrv/view.h @@ -22,10 +22,10 @@ class Chord; class DeviceContext; class Doc; class EditorialElement; +class FloatingElement; class Layer; class LayerElement; class Measure; -class MeasureElement; class Page; class Slur; class Staff; @@ -187,22 +187,22 @@ class View ///@} /** - * @name Top level method for drawing MeasureElement. - * Call appropriate method of child classes (Staff, Slur, etc). + * @name Top level method for drawing FloatingElement. + * Call appropriate method of child classes (Slur, Tempo, Tie, etc). * Defined in page_element.cpp */ ///@{ - void DrawMeasureElement( DeviceContext *dc, MeasureElement *element, Measure *measure, System *system ); + void DrawFloatingElement( DeviceContext *dc, FloatingElement *element, Measure *measure, System *system ); ///@} /** - * @name Methods for drawing MeasureElement child classes. + * @name Methods for drawing FloatingElement classes. * They are base drawing methods that are called directly from DrawMeasureElement * Defined in view_page.cpp */ ///@{ void DrawTimeSpanningElement( DeviceContext *dc, DocObject *object, System *system ); - void DrawTieOrSlur( DeviceContext *dc, MeasureElement *element, int x1, int x2, + void DrawTieOrSlur( DeviceContext *dc, FloatingElement *element, int x1, int x2, Staff *staff, char spanningType, DocObject *graphic = NULL ); void DrawSylConnector( DeviceContext *dc, Syl *syl, int x1, int x2, Staff *staff, char spanningType, DocObject *graphic = NULL ); diff --git a/include/vrv/vrvdef.h b/include/vrv/vrvdef.h index 357dac7a965..d8ac13f1712 100644 --- a/include/vrv/vrvdef.h +++ b/include/vrv/vrvdef.h @@ -61,6 +61,7 @@ typedef std::map > MapOfLedgerLineFlags; METER_SIG_ATTR, PAGE, SCORE_DEF, + STAFF, STAFF_ALIGNMENT, STAFF_DEF, STAFF_GRP, @@ -98,12 +99,11 @@ typedef std::map > MapOfLedgerLineFlags; VERSE, LAYER_ELEMENT_max, // - MEASURE_ELEMENT, + FLOATING_ELEMENT, SLUR, - STAFF, TEMPO, TIE, - MEASURE_ELEMENT_max, + FLOATING_ELEMENT_max, // UNSPECIFIED }; diff --git a/java/build.sh b/java/build.sh index ef3752e640c..726e2194327 100755 --- a/java/build.sh +++ b/java/build.sh @@ -24,6 +24,7 @@ FILES="../src/accid.cpp \ ../src/drawinglistinterface.cpp \ ../src/durationinterface.cpp \ ../src/editorial.cpp \ + ../src/floatingelement.cpp \ ../src/glyph.cpp \ ../src/io.cpp \ ../src/iodarms.cpp \ @@ -36,7 +37,6 @@ FILES="../src/accid.cpp \ ../src/mensur.cpp \ ../src/metersig.cpp \ ../src/measure.cpp \ - ../src/measureelement.cpp \ ../src/mrest.cpp \ ../src/multirest.cpp \ ../src/note.cpp \ diff --git a/python/setup.py b/python/setup.py index f5529ff6aea..6b2c7212499 100755 --- a/python/setup.py +++ b/python/setup.py @@ -28,6 +28,7 @@ '../src/drawinglistinterface.cpp', '../src/durationinterface.cpp', '../src/editorial.cpp', + '../src/floatingelement.cpp', '../src/glyph.cpp', '../src/io.cpp', '../src/iodarms.cpp', @@ -40,7 +41,6 @@ '../src/mensur.cpp', '../src/metersig.cpp', '../src/measure.cpp', - '../src/measureelement.cpp', '../src/mrest.cpp', '../src/multirest.cpp', '../src/note.cpp', diff --git a/src/doc.cpp b/src/doc.cpp index fbba6aeb655..18a445021b0 100644 --- a/src/doc.cpp +++ b/src/doc.cpp @@ -326,8 +326,6 @@ void Doc::CastOff( ) contentSystem->Process( &castOffSystems, ¶ms ); delete contentSystem; - //LogDebug("Layout: %d systems", contentPage->GetSystemCount()); - // Reset the scoreDef at the beginning of each system this->SetCurrentScoreDef( true ); contentPage->LayOutVertically( ); diff --git a/src/editorial.cpp b/src/editorial.cpp index da7f26c3453..e40062771d7 100644 --- a/src/editorial.cpp +++ b/src/editorial.cpp @@ -13,6 +13,7 @@ //---------------------------------------------------------------------------- +#include "floatingelement.h" #include "layer.h" #include "measure.h" #include "scoredef.h" @@ -53,6 +54,14 @@ EditorialElement::~EditorialElement() { } + +void EditorialElement::AddFloatingElement( FloatingElement *child ) +{ + child->SetParent( this ); + m_children.push_back( child ); + Modify(); + +} void EditorialElement::AddLayer( Layer *child ) { @@ -85,15 +94,13 @@ void EditorialElement::AddScoreDef( ScoreDef *child ) Modify(); } -void EditorialElement::AddMeasureElement( MeasureElement *child ) +void EditorialElement::AddStaff( Staff *child ) { child->SetParent( this ); m_children.push_back( child ); Modify(); - if ( child->Is() == STAFF ) { - Staff *staff = dynamic_cast(child); - assert( staff ); - if ( staff->GetN() < 1 ) LogError("Staff without @n is not supported within editorial markup element"); + if ( child->GetN() < 1 ) { + LogError("Staff without @n is not supported within editorial markup element"); } } diff --git a/src/measureelement.cpp b/src/floatingelement.cpp similarity index 76% rename from src/measureelement.cpp rename to src/floatingelement.cpp index ff5aff03687..6cda8fd16ae 100644 --- a/src/measureelement.cpp +++ b/src/floatingelement.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: measureelement.cpp +// Name: floatingelement.cpp // Author: Laurent Pugin // Created: 2015 // Copyright (c) Authors and others. All rights reserved. ///////////////////////////////////////////////////////////////////////////// -#include "measureelement.h" +#include "floatingelement.h" //---------------------------------------------------------------------------- @@ -18,27 +18,27 @@ namespace vrv { //---------------------------------------------------------------------------- -// MeasureElement +// FloatingElement //---------------------------------------------------------------------------- -MeasureElement::MeasureElement(): +FloatingElement::FloatingElement(): DocObject("me") { Reset(); } -MeasureElement::MeasureElement(std::string classid): +FloatingElement::FloatingElement(std::string classid): DocObject(classid) { Reset(); } -MeasureElement::~MeasureElement() +FloatingElement::~FloatingElement() { } -void MeasureElement::Reset() +void FloatingElement::Reset() { DocObject::Reset(); } diff --git a/src/iodarms.cpp b/src/iodarms.cpp index ea1c6f709b8..b61603149ca 100644 --- a/src/iodarms.cpp +++ b/src/iodarms.cpp @@ -409,7 +409,7 @@ bool DarmsInput::ImportString(std::string data_str) { m_current_tie = NULL; m_staff->AddLayer(m_layer); - m_measure->AddMeasureElement( m_staff ); + m_measure->AddStaff( m_staff ); system->AddMeasure( m_measure ); // do this the C style, char by char diff --git a/src/iomei.cpp b/src/iomei.cpp index b85e32e3750..640043f902f 100644 --- a/src/iomei.cpp +++ b/src/iomei.cpp @@ -172,7 +172,7 @@ bool MeiOutput::WriteObject( Object *object ) } else if (object->Is() == TEMPO) { m_currentNode = m_currentNode.append_child("tempo"); - WriteMeiTempo( m_currentNode, dynamic_cast(object) ); + WriteMeiTempo( m_currentNode, dynamic_cast(object) ); } else if (object->Is() == TIE) { m_currentNode = m_currentNode.append_child("tie"); @@ -727,12 +727,12 @@ void MeiOutput::WriteMeiSyl( pugi::xml_node currentNode, Syl *syl ) return; } -void MeiOutput::WriteMeiTempo( pugi::xml_node currentNode, MeasureTempo *tempo ) +void MeiOutput::WriteMeiTempo( pugi::xml_node currentNode, Tempo *tempo ) { assert( tempo ); currentNode.append_attribute( "xml:id" ) = UuidToMeiStr( tempo ).c_str(); - WriteTempoInterface(currentNode, tempo); + WriteTextDirInterface( currentNode, tempo); WriteText( currentNode, tempo ); return; } @@ -765,13 +765,6 @@ void MeiOutput::WritePositionInterface(pugi::xml_node element, vrv::PositionInte interface->WriteStafflocPitched(element); } - -void MeiOutput::WriteTempoInterface( pugi::xml_node element, vrv::TempoInterface *interface) -{ - assert( interface ); - - WriteTextDirInterface(element, interface); -} void MeiOutput::WriteTextDirInterface(pugi::xml_node element, vrv::TextDirInterface *interface) { @@ -1453,7 +1446,7 @@ bool MeiInput::ReadMeiMeasureChildren( Object *parent, pugi::xml_node parentNode success = ReadMeiSlur( parent, current ); } else if ( std::string( current.name() ) == "tempo" ) { - success = ReadMeiMeasureTempo( parent, current ); + success = ReadMeiTempo( parent, current ); } else if ( std::string( current.name() ) == "tie" ) { success = ReadMeiTie( parent, current ); @@ -1478,7 +1471,7 @@ bool MeiInput::ReadMeiTie( Object *parent, pugi::xml_node tie ) ReadTimeSpanningInterface(tie, vrvTie); - AddMeasureElement(parent, vrvTie); + AddFloatingElement(parent, vrvTie); return true; } @@ -1490,7 +1483,7 @@ bool MeiInput::ReadMeiSlur( Object *parent, pugi::xml_node slur ) ReadTimeSpanningInterface(slur, vrvSlur); - AddMeasureElement(parent, vrvSlur); + AddFloatingElement(parent, vrvSlur); return true; } @@ -1514,7 +1507,17 @@ bool MeiInput::ReadMeiStaff( Object *parent, pugi::xml_node staff ) LogWarning("No @n on might yield unpredictable results"); } - AddMeasureElement(parent, vrvStaff); + // This could me moved to an AddLayer method for consistency with AddLayerElement + if ( parent->Is() == MEASURE ) { + Measure *measure = dynamic_cast( parent ); + assert( measure ); + measure->AddStaff( vrvStaff ); + } + else if ( parent->IsEditorialElement() ) { + EditorialElement *element = dynamic_cast( parent ); + assert( element ); + element->AddStaff( vrvStaff ); + } return ReadMeiStaffChildren( vrvStaff, staff ); } @@ -1922,15 +1925,15 @@ bool MeiInput::ReadMeiVerse(Object *parent, pugi::xml_node verse) return ReadMeiLayerChildren(vrvVerse, verse, vrvVerse); } -bool MeiInput::ReadMeiMeasureTempo(Object *parent, pugi::xml_node tempo) +bool MeiInput::ReadMeiTempo(Object *parent, pugi::xml_node tempo) { - MeasureTempo *vrvMeasureTempo = new MeasureTempo(); - SetMeiUuid(tempo, vrvMeasureTempo); + Tempo *vrvTempo = new Tempo(); + SetMeiUuid(tempo, vrvTempo); - ReadTempoInterface(tempo, vrvMeasureTempo); - ReadText( tempo, vrvMeasureTempo ); + ReadTextDirInterface(tempo, vrvTempo); + ReadText( tempo, vrvTempo ); - AddMeasureElement(parent, vrvMeasureTempo); + AddFloatingElement(parent, vrvTempo); return true; } @@ -1961,12 +1964,6 @@ bool MeiInput::ReadPositionInterface(pugi::xml_node element, PositionInterface * return true; } -bool MeiInput::ReadTempoInterface(pugi::xml_node element, TempoInterface *interface) -{ - ReadTextDirInterface(element, interface); - return true; -} - bool MeiInput::ReadTextDirInterface(pugi::xml_node element, TextDirInterface *interface) { interface->ReadCommon(element); @@ -2263,17 +2260,17 @@ void MeiInput::AddLayerElement( Object *parent, LayerElement *element ) } } -void MeiInput::AddMeasureElement(Object *parent, MeasureElement *element) +void MeiInput::AddFloatingElement(Object *parent, FloatingElement *element) { if ( parent->IsEditorialElement() ) { EditorialElement *editorialElement = dynamic_cast( parent ); assert( editorialElement ); - editorialElement->AddMeasureElement( element ); + editorialElement->AddFloatingElement( element ); } else if ( parent->Is() == MEASURE ) { Measure *measure = dynamic_cast( parent ); assert( measure ); - measure->AddMeasureElement( element ); + measure->AddFloatingElement( element ); } else { LogWarning("'%s' not supported within '%s'", element->GetClassName().c_str(), parent->GetClassName().c_str() ); diff --git a/src/iopae.cpp b/src/iopae.cpp index 113391fa057..420974a9fa1 100644 --- a/src/iopae.cpp +++ b/src/iopae.cpp @@ -370,7 +370,7 @@ void PaeInput::parsePlainAndEasy(std::istream &infile) { m_layer->SetN( 1 ); m_staff->AddLayer(m_layer); - m_measure->AddMeasureElement( m_staff ); + m_measure->AddStaff( m_staff ); system->AddMeasure( m_measure ); MeasureObject obj = *it; diff --git a/src/measure.cpp b/src/measure.cpp index 0179e5658fb..973f4f8f35c 100644 --- a/src/measure.cpp +++ b/src/measure.cpp @@ -16,6 +16,7 @@ //---------------------------------------------------------------------------- #include "doc.h" +#include "floatingelement.h" #include "page.h" #include "staff.h" #include "system.h" @@ -66,7 +67,7 @@ void Measure::Reset() } } -void Measure::AddMeasureElement( MeasureElement *element ) +void Measure::AddFloatingElement( FloatingElement *element ) { element->SetParent( this ); m_children.push_back( element ); @@ -81,7 +82,19 @@ void Measure::AddMeasureElement( MeasureElement *element ) } } } - + +void Measure::AddStaff( Staff *staff ) +{ + staff->SetParent( this ); + m_children.push_back( staff ); + + if ( staff->GetN() < 1) { + // This is not 100% safe if we have a and with more than + // one staff as a previous child. + staff->SetN( this->GetChildCount() ); + } +} + void Measure::ResetHorizontalAlignment() { m_drawingXRel = 0; diff --git a/src/slur.cpp b/src/slur.cpp index 122395f1d03..f2bda91b1d5 100644 --- a/src/slur.cpp +++ b/src/slur.cpp @@ -21,7 +21,7 @@ namespace vrv { //---------------------------------------------------------------------------- Slur::Slur(): - MeasureElement("slur-"), TimeSpanningInterface() + FloatingElement("slur-"), TimeSpanningInterface() { RegisterInterface( TimeSpanningInterface::GetAttClasses(), TimeSpanningInterface::IsInterface() ); @@ -35,7 +35,7 @@ Slur::~Slur() void Slur::Reset() { - MeasureElement::Reset(); + FloatingElement::Reset(); TimeSpanningInterface::Reset(); } diff --git a/src/staff.cpp b/src/staff.cpp index d67bccdba25..578c43f107d 100644 --- a/src/staff.cpp +++ b/src/staff.cpp @@ -28,7 +28,7 @@ namespace vrv { //---------------------------------------------------------------------------- Staff::Staff( int n ): - MeasureElement("staff-"), + DocObject("staff-"), AttCommon() { RegisterAttClass(ATT_COMMON); @@ -43,7 +43,7 @@ Staff::~Staff() void Staff::Reset() { - MeasureElement::Reset(); + DocObject::Reset(); ResetCommon(); notAnc = false; // LP we want modern notation :)) grise = false; diff --git a/src/textdirective.cpp b/src/textdirective.cpp index 0fd250fe330..66509c23137 100644 --- a/src/textdirective.cpp +++ b/src/textdirective.cpp @@ -14,29 +14,31 @@ //---------------------------------------------------------------------------- -#include "measureelement.h" +#include "floatingelement.h" namespace vrv { //---------------------------------------------------------------------------- -// MeasureTempo +// Tempo //---------------------------------------------------------------------------- -MeasureTempo::MeasureTempo(): - MeasureElement("tempo-"), TempoInterface() +Tempo::Tempo(): + FloatingElement("tempo-"), TextDirInterface() { + RegisterInterface( TextDirInterface::GetAttClasses(), TextDirInterface::IsInterface() ); + Reset(); } -MeasureTempo::~MeasureTempo() +Tempo::~Tempo() { } -void MeasureTempo::Reset() +void Tempo::Reset() { - MeasureElement::Reset(); - TempoInterface::Reset(); + FloatingElement::Reset(); + TextDirInterface::Reset(); } } // namespace vrv diff --git a/src/textdirinterface.cpp b/src/textdirinterface.cpp index 47be1771409..8f1c4fa024c 100644 --- a/src/textdirinterface.cpp +++ b/src/textdirinterface.cpp @@ -21,11 +21,14 @@ namespace vrv { // TextDirInterface //---------------------------------------------------------------------------- -TextDirInterface::TextDirInterface(): +TextDirInterface::TextDirInterface(): Interface(), AttCommon(), AttPlacement(), AttStaffident() { + RegisterInterfaceAttClass(ATT_COMMON); + RegisterInterfaceAttClass(ATT_PLACEMENT); + RegisterInterfaceAttClass(ATT_STAFFIDENT); Reset(); } @@ -40,25 +43,5 @@ void TextDirInterface::Reset() ResetPlacement(); ResetStaffident(); } - -//---------------------------------------------------------------------------- -// TempoInterface -//---------------------------------------------------------------------------- - -TempoInterface::TempoInterface(): - TextDirInterface() -{ - Reset(); -} - - -TempoInterface::~TempoInterface() -{ -} - -void TempoInterface::Reset() -{ - TextDirInterface::Reset(); -} } // namespace vrv diff --git a/src/tie.cpp b/src/tie.cpp index f898d98310b..b250b01d176 100644 --- a/src/tie.cpp +++ b/src/tie.cpp @@ -21,7 +21,7 @@ namespace vrv { //---------------------------------------------------------------------------- Tie::Tie(): - MeasureElement("tie-"), TimeSpanningInterface() + FloatingElement("tie-"), TimeSpanningInterface() { RegisterInterface( TimeSpanningInterface::GetAttClasses(), TimeSpanningInterface::IsInterface() ); @@ -35,7 +35,7 @@ Tie::~Tie() void Tie::Reset() { - MeasureElement::Reset(); + FloatingElement::Reset(); TimeSpanningInterface::Reset(); } diff --git a/src/toolkit.cpp b/src/toolkit.cpp index 9bb6a81c966..50a398abec7 100644 --- a/src/toolkit.cpp +++ b/src/toolkit.cpp @@ -653,7 +653,7 @@ bool Toolkit::Insert( std::string elementType, std::string startid, std::string Slur *slur = new Slur(); slur->SetStartid( startid ); slur->SetEndid( endid ); - measure->AddMeasureElement(slur); + measure->AddFloatingElement(slur); m_doc.PrepareDrawing(); return true; } diff --git a/src/view_page.cpp b/src/view_page.cpp index cdc85d40931..c13bf6c34dd 100644 --- a/src/view_page.cpp +++ b/src/view_page.cpp @@ -630,7 +630,7 @@ void View::DrawMeasure( DeviceContext *dc, Measure *measure, System *system ) } } -void View::DrawMeasureElement( DeviceContext *dc, MeasureElement *element, Measure *measure, System *system) +void View::DrawFloatingElement( DeviceContext *dc, FloatingElement *element, Measure *measure, System *system) { assert( dc ); assert( system ); @@ -643,14 +643,10 @@ void View::DrawMeasureElement( DeviceContext *dc, MeasureElement *element, Measu dc->EndGraphic( element, this); system->AddToDrawingList(element); } - else if (element->Is() == STAFF) { - // cast to Staff check in DrawStaff - DrawStaff(dc, dynamic_cast(element), measure, system); - } } //---------------------------------------------------------------------------- -// View - MeasureElement +// View - FloatingElement //---------------------------------------------------------------------------- int View::CalculatePitchPosY ( Staff *staff, data_PITCHNAME pname, int dec_clef, int oct) @@ -879,7 +875,7 @@ void View::DrawTimeSpanningElement( DeviceContext *dc, DocObject *element, Syste } -void View::DrawTieOrSlur( DeviceContext *dc, MeasureElement *element, int x1, int x2, Staff *staff, +void View::DrawTieOrSlur( DeviceContext *dc, FloatingElement *element, int x1, int x2, Staff *staff, char spanningType, DocObject *graphic ) { assert( dc ); @@ -1179,9 +1175,13 @@ void View::DrawMeasureChildren( DeviceContext *dc, Object *parent, Measure *meas Object* current; for (current = parent->GetFirst( ); current; current = parent->GetNext( ) ) { - if (current->IsMeasureElement()) { - // cast to MeasureElement check in DrawMeasureElement - DrawMeasureElement( dc , dynamic_cast(current), measure, system ); + if (current->Is() == STAFF) { + // cast to Staff check in DrawStaff + DrawStaff(dc, dynamic_cast(current), measure, system); + } + else if (current->IsFloatingElement()) { + // cast to FloatingElement check in DrawFloatingElement + DrawFloatingElement( dc , dynamic_cast(current), measure, system ); } else if (current->IsEditorialElement()) { // cast to EditorialElement check in DrawMeasureEditorialElement diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 4a7db282dd6..b4ff1060c59 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -33,6 +33,7 @@ add_executable (verovio ../src/drawinglistinterface.cpp ../src/durationinterface.cpp ../src/editorial.cpp + ../src/floatingelement.cpp ../src/glyph.cpp ../src/io.cpp ../src/iodarms.cpp @@ -45,7 +46,6 @@ add_executable (verovio ../src/mensur.cpp ../src/metersig.cpp ../src/measure.cpp - ../src/measureelement.cpp ../src/mrest.cpp ../src/multirest.cpp ../src/note.cpp From 5780402d04e1178685d16a57f46125f24ae267e3 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sun, 16 Aug 2015 08:52:21 +0200 Subject: [PATCH 058/114] Moving time spanning interface to FloatingElement --- Verovio.xcodeproj/project.pbxproj | 4 +- include/vrv/floatingelement.h | 20 ++++ include/vrv/slur.h | 19 ---- include/vrv/textdirinterface.h | 1 + include/vrv/tie.h | 20 ---- include/vrv/timeinterface.h | 9 +- include/vrv/vrvdef.h | 151 +++++++++++++++--------------- src/floatingelement.cpp | 38 ++++++++ src/slur.cpp | 22 ----- src/syl.cpp | 4 +- src/tie.cpp | 23 ----- src/timeinterface.cpp | 10 +- 12 files changed, 148 insertions(+), 173 deletions(-) diff --git a/Verovio.xcodeproj/project.pbxproj b/Verovio.xcodeproj/project.pbxproj index 86f1c9b2a05..689968444ab 100644 --- a/Verovio.xcodeproj/project.pbxproj +++ b/Verovio.xcodeproj/project.pbxproj @@ -435,10 +435,10 @@ 8F59292618854BF800FE51AD /* pitchinterface.h */, 8F086ED0188539540037FD8E /* positioninterface.cpp */, 8F59292718854BF800FE51AD /* positioninterface.h */, - 4DF289FE1A7545E500BA9F7D /* timeinterface.cpp */, - 4DF289FC1A7545CC00BA9F7D /* timeinterface.h */, 4DA60EE31B6307B9006E2DFC /* textdirinterface.cpp */, 4DA60EDF1B6307A8006E2DFC /* textdirinterface.h */, + 4DF289FE1A7545E500BA9F7D /* timeinterface.cpp */, + 4DF289FC1A7545CC00BA9F7D /* timeinterface.h */, ); name = interfaces; sourceTree = ""; diff --git a/include/vrv/floatingelement.h b/include/vrv/floatingelement.h index 0b6555988cd..f8ee26d4f10 100644 --- a/include/vrv/floatingelement.h +++ b/include/vrv/floatingelement.h @@ -36,6 +36,26 @@ class FloatingElement: public DocObject virtual ClassId Is() { return FLOATING_ELEMENT; }; ///@} + //----------// + // Functors // + //----------// + + /** + * See Object::FillStaffCurrentTimeSpanning + */ + virtual int FillStaffCurrentTimeSpanning( ArrayPtrVoid *params ); + + /** + * See Object::PrepareTimeSpanning + */ + virtual int PrepareTimeSpanning( ArrayPtrVoid *params ); + + /** + * Reset the drawing values before calling PrepareDrawing after changes. + */ + virtual int ResetDarwing( ArrayPtrVoid *params ); + ///@} + private: public: diff --git a/include/vrv/slur.h b/include/vrv/slur.h index 22dd786913d..16e13038799 100644 --- a/include/vrv/slur.h +++ b/include/vrv/slur.h @@ -33,25 +33,6 @@ class Slur: public FloatingElement, public TimeSpanningInterface virtual ClassId Is() { return SLUR; }; ///@} - //----------// - // Functors // - //----------// - - /** - * See Object::FillStaffCurrentTimeSpanning - */ - virtual int FillStaffCurrentTimeSpanning( ArrayPtrVoid *params ); - - /** - * See Object::PrepareTimeSpanning - */ - virtual int PrepareTimeSpanning( ArrayPtrVoid *params ); - - /** - * Reset the drawing values before calling PrepareDrawing after changes. - */ - virtual int ResetDarwing( ArrayPtrVoid *params ); - private: public: diff --git a/include/vrv/textdirinterface.h b/include/vrv/textdirinterface.h index ee3eea8af3c..69da31dd07a 100644 --- a/include/vrv/textdirinterface.h +++ b/include/vrv/textdirinterface.h @@ -37,6 +37,7 @@ class TextDirInterface: public Interface, TextDirInterface(); virtual ~TextDirInterface(); virtual void Reset(); + virtual InterfaceId IsInterface() { return INTERFACE_TEXT_DIR; }; ///@} protected: diff --git a/include/vrv/tie.h b/include/vrv/tie.h index ff4aed64784..5789e03f882 100644 --- a/include/vrv/tie.h +++ b/include/vrv/tie.h @@ -34,26 +34,6 @@ class Tie: public FloatingElement, public TimeSpanningInterface virtual std::string GetClassName( ) { return "Tie"; }; virtual ClassId Is() { return TIE; }; ///@} - ///@} - - //----------// - // Functors // - //----------// - - /** - * See Object::FillStaffCurrentTimeSpanning - */ - virtual int FillStaffCurrentTimeSpanning( ArrayPtrVoid *params ); - - /** - * See Object::PrepareTimeSpanning - */ - virtual int PrepareTimeSpanning( ArrayPtrVoid *params ); - - /** - * Reset the drawing values before calling PrepareDrawing after changes. - */ - virtual int ResetDarwing( ArrayPtrVoid *params ); private: diff --git a/include/vrv/timeinterface.h b/include/vrv/timeinterface.h index 6274360d275..fe3b2a90ea4 100644 --- a/include/vrv/timeinterface.h +++ b/include/vrv/timeinterface.h @@ -69,9 +69,6 @@ class TimeSpanningInterface: public Interface, */ void SetUuidStr(); - -protected: - //-----------------// // Pseudo functors // //-----------------// @@ -86,17 +83,17 @@ class TimeSpanningInterface: public Interface, /** * See Object::FillStaffCurrentTimeSpanning */ - virtual int FillStaffCurrentTimeSpanning( ArrayPtrVoid *params, DocObject *object ); + virtual int InterfaceFillStaffCurrentTimeSpanning( ArrayPtrVoid *params, DocObject *object ); /** * See Object::PrepareTimeSpanning */ - virtual int PrepareTimeSpanning( ArrayPtrVoid *params, DocObject *object ); + virtual int InterfacePrepareTimeSpanning( ArrayPtrVoid *params, DocObject *object ); /** * See Object::ResetDrawing */ - virtual int ResetDrawing( ArrayPtrVoid *params, DocObject *object ); + virtual int InterfaceResetDrawing( ArrayPtrVoid *params, DocObject *object ); private: /** diff --git a/include/vrv/vrvdef.h b/include/vrv/vrvdef.h index d8ac13f1712..a23d8e69dab 100644 --- a/include/vrv/vrvdef.h +++ b/include/vrv/vrvdef.h @@ -40,82 +40,81 @@ typedef std::vector ChordCluster; typedef std::vector ArrayOfBeamElementCoords; typedef std::map > MapOfLedgerLineFlags; - - - //---------------------------------------------------------------------------- - // Object defines - //---------------------------------------------------------------------------- - - enum ClassId { - OBJECT = 0, - ALIGNMENT, - CLEF_ATTR, - DOC, - DOC_OBJECT, - GRACE_ALIGNER, - KEY_SIG_ATTR, - LAYER, - MEASURE, - MEASURE_ALIGNER, - MENSUR_ATTR, - METER_SIG_ATTR, - PAGE, - SCORE_DEF, - STAFF, - STAFF_ALIGNMENT, - STAFF_DEF, - STAFF_GRP, - SYSTEM, - SYSTEM_ALIGNER, - SYSTEM_ALIGNMENT, - // - EDITORIAL_ELEMENT, - ANNOT, - APP, - LEM, - RDG, - SUPPLIED, - EDITORIAL_ELEMENT_max, - // - LAYER_ELEMENT, - ACCID, - BAR_LINE, - BAR_LINE_ATTR, - BEAM, - CHORD, - CLEF, - CUSTOS, - DOT, - KEY_SIG, - MENSUR, - METER_SIG, - MREST, - MULTI_REST, - NOTE, - REST, - SPACE, - SYL, - TUPLET, - VERSE, - LAYER_ELEMENT_max, - // - FLOATING_ELEMENT, - SLUR, - TEMPO, - TIE, - FLOATING_ELEMENT_max, - // - UNSPECIFIED - }; - - enum InterfaceId { - INTERFACE, - INTERFACE_DURATION, - INTERFACE_PITCH, - INTERFACE_POSITION, - INTERFACE_TEXT, - INTERFACE_TIME_SPANNING - }; + +//---------------------------------------------------------------------------- +// Object defines +//---------------------------------------------------------------------------- + +enum ClassId { + OBJECT = 0, + ALIGNMENT, + CLEF_ATTR, + DOC, + DOC_OBJECT, + GRACE_ALIGNER, + KEY_SIG_ATTR, + LAYER, + MEASURE, + MEASURE_ALIGNER, + MENSUR_ATTR, + METER_SIG_ATTR, + PAGE, + SCORE_DEF, + STAFF, + STAFF_ALIGNMENT, + STAFF_DEF, + STAFF_GRP, + SYSTEM, + SYSTEM_ALIGNER, + SYSTEM_ALIGNMENT, + // + EDITORIAL_ELEMENT, + ANNOT, + APP, + LEM, + RDG, + SUPPLIED, + EDITORIAL_ELEMENT_max, + // + LAYER_ELEMENT, + ACCID, + BAR_LINE, + BAR_LINE_ATTR, + BEAM, + CHORD, + CLEF, + CUSTOS, + DOT, + KEY_SIG, + MENSUR, + METER_SIG, + MREST, + MULTI_REST, + NOTE, + REST, + SPACE, + SYL, + TUPLET, + VERSE, + LAYER_ELEMENT_max, + // + FLOATING_ELEMENT, + SLUR, + TEMPO, + TIE, + FLOATING_ELEMENT_max, + // + UNSPECIFIED +}; + +enum InterfaceId { + INTERFACE, + INTERFACE_DURATION, + INTERFACE_PITCH, + INTERFACE_POSITION, + INTERFACE_TEXT_DIR, + INTERFACE_TIME_SPANNING +}; //---------------------------------------------------------------------------- // Global defines diff --git a/src/floatingelement.cpp b/src/floatingelement.cpp index 6cda8fd16ae..d017485241d 100644 --- a/src/floatingelement.cpp +++ b/src/floatingelement.cpp @@ -7,6 +7,7 @@ #include "floatingelement.h" +#include "timeinterface.h" //---------------------------------------------------------------------------- @@ -43,4 +44,41 @@ void FloatingElement::Reset() DocObject::Reset(); } +//---------------------------------------------------------------------------- +// FloatingElement functor methods +//---------------------------------------------------------------------------- + +int FloatingElement::PrepareTimeSpanning( ArrayPtrVoid *params ) +{ + // Pass it to the pseudo functor of the interface + if (this->HasInterface(INTERFACE_TIME_SPANNING)) { + TimeSpanningInterface *interface = dynamic_cast(this); + assert( interface ); + return interface->InterfacePrepareTimeSpanning(params, this); + } + return FUNCTOR_CONTINUE; +} + +int FloatingElement::FillStaffCurrentTimeSpanning( ArrayPtrVoid *params ) +{ + // Pass it to the pseudo functor of the interface + if (this->HasInterface(INTERFACE_TIME_SPANNING)) { + TimeSpanningInterface *interface = dynamic_cast(this); + assert( interface ); + return interface->InterfaceFillStaffCurrentTimeSpanning(params, this); + } + return FUNCTOR_CONTINUE; +} + +int FloatingElement::ResetDarwing( ArrayPtrVoid *params ) +{ + // Pass it to the pseudo functor of the interface + if (this->HasInterface(INTERFACE_TIME_SPANNING)) { + TimeSpanningInterface *interface = dynamic_cast(this); + assert( interface ); + return interface->InterfaceResetDrawing(params, this); + } + return FUNCTOR_CONTINUE; +}; + } // namespace vrv diff --git a/src/slur.cpp b/src/slur.cpp index f2bda91b1d5..ec06209cd7e 100644 --- a/src/slur.cpp +++ b/src/slur.cpp @@ -38,27 +38,5 @@ void Slur::Reset() FloatingElement::Reset(); TimeSpanningInterface::Reset(); } - -//---------------------------------------------------------------------------- -// Slur functor methods -//---------------------------------------------------------------------------- - -int Slur::PrepareTimeSpanning( ArrayPtrVoid *params ) -{ - // Pass it to the pseudo functor of the interface - return TimeSpanningInterface::PrepareTimeSpanning(params, this); -} - -int Slur::FillStaffCurrentTimeSpanning( ArrayPtrVoid *params ) -{ - // Pass it to the pseudo functor of the interface - return TimeSpanningInterface::FillStaffCurrentTimeSpanning(params, this); -} - -int Slur::ResetDarwing( ArrayPtrVoid *params ) -{ - // Pass it to the pseudo functor of the interface - return TimeSpanningInterface::ResetDrawing(params, this); -}; } // namespace vrv diff --git a/src/syl.cpp b/src/syl.cpp index d87e74cf486..9cf9cd23c1c 100644 --- a/src/syl.cpp +++ b/src/syl.cpp @@ -101,13 +101,13 @@ int Syl::PrepareLyrics( ArrayPtrVoid *params ) int Syl::FillStaffCurrentTimeSpanning( ArrayPtrVoid *params ) { // Pass it to the pseudo functor of the interface - return TimeSpanningInterface::FillStaffCurrentTimeSpanning(params, this); + return TimeSpanningInterface::InterfaceFillStaffCurrentTimeSpanning(params, this); } int Syl::ResetDarwing( ArrayPtrVoid *params ) { // Pass it to the pseudo functor of the interface - return TimeSpanningInterface::ResetDrawing(params, this); + return TimeSpanningInterface::InterfaceResetDrawing(params, this); }; } // namespace vrv diff --git a/src/tie.cpp b/src/tie.cpp index b250b01d176..cd167867345 100644 --- a/src/tie.cpp +++ b/src/tie.cpp @@ -39,27 +39,4 @@ void Tie::Reset() TimeSpanningInterface::Reset(); } -//---------------------------------------------------------------------------- -// Tie functor methods -//---------------------------------------------------------------------------- - -int Tie::PrepareTimeSpanning( ArrayPtrVoid *params ) -{ - // Pass it to the pseudo functor of the interface - return TimeSpanningInterface::PrepareTimeSpanning(params, this); -} - - -int Tie::FillStaffCurrentTimeSpanning( ArrayPtrVoid *params ) -{ - // Pass it to the pseudo functor of the interface - return TimeSpanningInterface::FillStaffCurrentTimeSpanning(params, this); -} - -int Tie::ResetDarwing( ArrayPtrVoid *params ) -{ - // Pass it to the pseudo functor of the interface - return TimeSpanningInterface::ResetDrawing(params, this); -}; - } // namespace vrv \ No newline at end of file diff --git a/src/timeinterface.cpp b/src/timeinterface.cpp index 989cada0a05..12c083b450a 100644 --- a/src/timeinterface.cpp +++ b/src/timeinterface.cpp @@ -99,7 +99,11 @@ std::string TimeSpanningInterface::ExtractUuidFragment(std::string refUuid) return refUuid; } -int TimeSpanningInterface::PrepareTimeSpanning( ArrayPtrVoid *params, DocObject *object ) +//---------------------------------------------------------------------------- +// Interface pseudo functor (redirected) +//---------------------------------------------------------------------------- + +int TimeSpanningInterface::InterfacePrepareTimeSpanning( ArrayPtrVoid *params, DocObject *object ) { // param 0: std::vector* that holds the current elements to match // param 1: bool* fillList for indicating whether the elements have to be stack or not @@ -116,7 +120,7 @@ int TimeSpanningInterface::PrepareTimeSpanning( ArrayPtrVoid *params, DocObject return FUNCTOR_CONTINUE; } -int TimeSpanningInterface::FillStaffCurrentTimeSpanning( ArrayPtrVoid *params, DocObject *object ) +int TimeSpanningInterface::InterfaceFillStaffCurrentTimeSpanning( ArrayPtrVoid *params, DocObject *object ) { // param 0: std::vector* of the current running TimeSpanningInterface elements std::vector *elements = static_cast*>((*params)[0]); @@ -130,7 +134,7 @@ int TimeSpanningInterface::FillStaffCurrentTimeSpanning( ArrayPtrVoid *params, D return FUNCTOR_CONTINUE; } -int TimeSpanningInterface::ResetDrawing( ArrayPtrVoid *params, DocObject *object ) +int TimeSpanningInterface::InterfaceResetDrawing( ArrayPtrVoid *params, DocObject *object ) { m_start = NULL; m_end = NULL; From d385b0294fa3e0ed95806845b833fa586c42cc0c Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sun, 16 Aug 2015 09:09:07 +0200 Subject: [PATCH 059/114] Fixing time signature with only one digit --- src/iopae.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/iopae.cpp b/src/iopae.cpp index 420974a9fa1..db6b9a20a8c 100644 --- a/src/iopae.cpp +++ b/src/iopae.cpp @@ -769,7 +769,6 @@ int PaeInput::getTimeInfo( const char* incipit, MeterSig *meter, int index) { } else if ( is_one_number == 0) { int beats = atoi(timesig_str); meter->SetCount(beats); - meter->SetUnit(1); } else if (strcmp(timesig_str, "c") == 0) { // C meter->SetSym(METERSIGN_common); From 1eac9e172c2fa650ebbf161fe7d7d74a215b6b26 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sun, 16 Aug 2015 10:44:55 +0200 Subject: [PATCH 060/114] Tuplet bracket not showing, fixes #94 --- include/vrv/view.h | 2 +- src/view_tuplet.cpp | 29 ++++++++++++----------------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/include/vrv/view.h b/include/vrv/view.h index 9cb6e8af0e3..537e6a05aa5 100644 --- a/include/vrv/view.h +++ b/include/vrv/view.h @@ -323,7 +323,7 @@ class View * @name Internal methods used for calculating tuplets */ ///@{ - bool GetTupletCoordinates(Tuplet* tuplet, Layer *layer, Point* start, Point* end, Point *center); + data_STEMDIRECTION GetTupletCoordinates(Tuplet* tuplet, Layer *layer, Point* start, Point* end, Point *center); std::wstring IntToTupletFigures(unsigned short number); std::wstring IntToTimeSigFigures(unsigned short number); std::wstring IntToSmuflFigures(unsigned short number, int offset); diff --git a/src/view_tuplet.cpp b/src/view_tuplet.cpp index b88b43ffa2b..d7f40f420b3 100644 --- a/src/view_tuplet.cpp +++ b/src/view_tuplet.cpp @@ -79,7 +79,7 @@ bool View::OneBeamInTuplet(Tuplet* tuplet) */ -bool View::GetTupletCoordinates(Tuplet* tuplet, Layer *layer, Point* start, Point* end, Point *center) +data_STEMDIRECTION View::GetTupletCoordinates(Tuplet* tuplet, Layer *layer, Point* start, Point* end, Point *center) { assert( tuplet ); assert( layer ); @@ -89,7 +89,7 @@ bool View::GetTupletCoordinates(Tuplet* tuplet, Layer *layer, Point* start, Poin Point first, last; int x, y; - bool direction = true; //true = up, false = down + data_STEMDIRECTION direction = STEMDIRECTION_up; ListOfObjects* tupletChildren = tuplet->GetList(tuplet); LayerElement *firstNote = dynamic_cast(tupletChildren->front()); @@ -134,23 +134,21 @@ bool View::GetTupletCoordinates(Tuplet* tuplet, Layer *layer, Point* start, Poin ListOfObjects::iterator iter = tupletChildren->begin(); while (iter != tupletChildren->end()) { LayerElement *currentNote = dynamic_cast(*iter); - - if (currentNote->m_drawingStemDir == true) - ups++; - else - downs++; - + assert( currentNote ); + if (currentNote->m_drawingStemDir == STEMDIRECTION_up) ups++; + else downs++; + ++iter; } // true means up - direction = ups > downs ? true : false; + direction = ups > downs ? STEMDIRECTION_up : STEMDIRECTION_down; // if ups or downs is 0, it means all the stems go in the same direction if (ups == 0 || downs == 0) { // Calculate the average between the first and last stem // set center, start and end too. - if (direction) { // up + if (direction == STEMDIRECTION_up) { // up y = lastNote->m_drawingStemEnd.y + (firstNote->m_drawingStemEnd.y - lastNote->m_drawingStemEnd.y) / 2 + TUPLET_OFFSET; start->y = firstNote->m_drawingStemEnd.y + TUPLET_OFFSET; end->y = lastNote->m_drawingStemEnd.y + TUPLET_OFFSET; @@ -168,7 +166,7 @@ bool View::GetTupletCoordinates(Tuplet* tuplet, Layer *layer, Point* start, Poin while (iter != tupletChildren->end()) { LayerElement *currentNote = dynamic_cast(*iter); - if (direction) { + if (direction == STEMDIRECTION_up) { // The note is more than the avg, adjust to y the difference // from this note to the avg if (currentNote->m_drawingStemEnd.y + TUPLET_OFFSET > y) { @@ -202,21 +200,18 @@ bool View::GetTupletCoordinates(Tuplet* tuplet, Layer *layer, Point* start, Poin LayerElement *currentNote = dynamic_cast(*iter); if (currentNote->m_drawingStemDir == direction) { - - if (direction) { + if (direction == STEMDIRECTION_up) { if (y == 0 || currentNote->m_drawingStemEnd.y + TUPLET_OFFSET >= y) y = currentNote->m_drawingStemEnd.y + TUPLET_OFFSET; } else { if (y == 0 || currentNote->m_drawingStemEnd.y - TUPLET_OFFSET <= y) y = currentNote->m_drawingStemEnd.y - TUPLET_OFFSET; } - } else { // do none for now // but if a notehead with a reversed stem is taller that the last // calculated y, we need to offset } - ++iter; } @@ -253,7 +248,7 @@ void View::DrawTupletPostponed( DeviceContext *dc, Tuplet *tuplet, Layer *layer, } Point start, end, center; - bool direction = GetTupletCoordinates(tuplet, layer, &start, &end, ¢er); + data_STEMDIRECTION direction = GetTupletCoordinates(tuplet, layer, &start, &end, ¢er); // Calculate position for number 0x82 // since the number is slanted, move the center left @@ -295,7 +290,7 @@ void View::DrawTupletPostponed( DeviceContext *dc, Tuplet *tuplet, Layer *layer, dc->DrawLine((int)xa, ToDeviceContextY((int)y2), end.x, ToDeviceContextY(end.y)); // vertical bracket lines - if (direction) { + if (direction == STEMDIRECTION_up) { dc->DrawLine(start.x, ToDeviceContextY(start.y), start.x, ToDeviceContextY(start.y - verticalLine)); dc->DrawLine(end.x, ToDeviceContextY(end.y), end.x, ToDeviceContextY(end.y - verticalLine)); } else { From 861c28535b7cfb2b7bd23a3d4184f2aaa124dba5 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sun, 16 Aug 2015 13:52:45 +0200 Subject: [PATCH 061/114] Adding view_floating.cpp implementation file --- Verovio.xcodeproj/project.pbxproj | 4 + emscripten/build.sh | 1 + include/vrv/view.h | 41 ++-- java/build.sh | 1 + python/setup.py | 3 +- src/view_element.cpp | 92 +------ src/view_floating.cpp | 386 ++++++++++++++++++++++++++++++ src/view_mensural.cpp | 2 +- src/view_page.cpp | 244 +------------------ tools/CMakeLists.txt | 1 + 10 files changed, 416 insertions(+), 359 deletions(-) create mode 100644 src/view_floating.cpp diff --git a/Verovio.xcodeproj/project.pbxproj b/Verovio.xcodeproj/project.pbxproj index 689968444ab..ba539d5ffdb 100644 --- a/Verovio.xcodeproj/project.pbxproj +++ b/Verovio.xcodeproj/project.pbxproj @@ -27,6 +27,7 @@ 4D4221061998A8CE00963292 /* atts_mensural.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DEE29031940BCC100C76319 /* atts_mensural.cpp */; }; 4D4221071998A8CE00963292 /* atts_mensural.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DEE29031940BCC100C76319 /* atts_mensural.cpp */; }; 4D43C30C1A9BB22A00EA28F3 /* view_mensural.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D43C30B1A9BB22A00EA28F3 /* view_mensural.cpp */; }; + 4D543E221B80AACF004B823C /* view_floating.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D543E211B80AACF004B823C /* view_floating.cpp */; }; 4D763EC61987D04E003FCAB5 /* metersig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D763EC51987D04D003FCAB5 /* metersig.cpp */; }; 4D763EC71987D04E003FCAB5 /* metersig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D763EC51987D04D003FCAB5 /* metersig.cpp */; }; 4D763EC91987D067003FCAB5 /* metersig.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D763EC81987D067003FCAB5 /* metersig.h */; }; @@ -225,6 +226,7 @@ 4D422100199805E400963292 /* attdef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = attdef.h; path = include/vrv/attdef.h; sourceTree = ""; }; 4D422103199805F700963292 /* att.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = att.cpp; path = src/att.cpp; sourceTree = ""; }; 4D43C30B1A9BB22A00EA28F3 /* view_mensural.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = view_mensural.cpp; path = src/view_mensural.cpp; sourceTree = ""; }; + 4D543E211B80AACF004B823C /* view_floating.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = view_floating.cpp; path = src/view_floating.cpp; sourceTree = ""; }; 4D5B522F1B7DE3FE00179688 /* att_classes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = att_classes.h; path = libmei/att_classes.h; sourceTree = ""; }; 4D763EC51987D04D003FCAB5 /* metersig.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = metersig.cpp; path = src/metersig.cpp; sourceTree = ""; }; 4D763EC81987D067003FCAB5 /* metersig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = metersig.h; path = include/vrv/metersig.h; sourceTree = ""; }; @@ -614,6 +616,7 @@ 8F59293118854BF800FE51AD /* view.h */, 8F086EDA188539540037FD8E /* view_beam.cpp */, 8F086EDC188539540037FD8E /* view_element.cpp */, + 4D543E211B80AACF004B823C /* view_floating.cpp */, 8F086EDD188539540037FD8E /* view_graph.cpp */, 4D43C30B1A9BB22A00EA28F3 /* view_mensural.cpp */, 8F086EDE188539540037FD8E /* view_page.cpp */, @@ -828,6 +831,7 @@ 8F086EE6188539540037FD8E /* beam.cpp in Sources */, 8F086EE7188539540037FD8E /* clef.cpp in Sources */, 8F086EE8188539540037FD8E /* devicecontext.cpp in Sources */, + 4D543E221B80AACF004B823C /* view_floating.cpp in Sources */, 8F086EE9188539540037FD8E /* doc.cpp in Sources */, 8F086EEA188539540037FD8E /* durationinterface.cpp in Sources */, 8F086EEB188539540037FD8E /* toolkit.cpp in Sources */, diff --git a/emscripten/build.sh b/emscripten/build.sh index 1ccc420ff3c..79159d1a7fa 100755 --- a/emscripten/build.sh +++ b/emscripten/build.sh @@ -133,6 +133,7 @@ python $EMCC $CHATTY \ $VEROVIO_ROOT/src/view.cpp \ $VEROVIO_ROOT/src/view_beam.cpp \ $VEROVIO_ROOT/src/view_element.cpp \ + $VEROVIO_ROOT/src/view_floating.cpp \ $VEROVIO_ROOT/src/view_graph.cpp \ $VEROVIO_ROOT/src/view_mensural.cpp \ $VEROVIO_ROOT/src/view_page.cpp \ diff --git a/include/vrv/view.h b/include/vrv/view.h index 537e6a05aa5..6b522e38944 100644 --- a/include/vrv/view.h +++ b/include/vrv/view.h @@ -186,28 +186,6 @@ class View void DrawLayerEditorialElement( DeviceContext *dc, EditorialElement *element, Layer *layer, Staff *staff, Measure *measure ); ///@} - /** - * @name Top level method for drawing FloatingElement. - * Call appropriate method of child classes (Slur, Tempo, Tie, etc). - * Defined in page_element.cpp - */ - ///@{ - void DrawFloatingElement( DeviceContext *dc, FloatingElement *element, Measure *measure, System *system ); - ///@} - - /** - * @name Methods for drawing FloatingElement classes. - * They are base drawing methods that are called directly from DrawMeasureElement - * Defined in view_page.cpp - */ - ///@{ - void DrawTimeSpanningElement( DeviceContext *dc, DocObject *object, System *system ); - void DrawTieOrSlur( DeviceContext *dc, FloatingElement *element, int x1, int x2, - Staff *staff, char spanningType, DocObject *graphic = NULL ); - void DrawSylConnector( DeviceContext *dc, Syl *syl, int x1, int x2, - Staff *staff, char spanningType, DocObject *graphic = NULL ); - ///@} - /** * @name Top level method for drawing LayerElement. * This can be called recursively for elements containing other elements. @@ -262,12 +240,27 @@ class View void DrawMeterSigFigures( DeviceContext *dc, int x, int y, int num, int numBase, Staff *staff); void DrawQuarterRest ( DeviceContext *dc, int x, int y, int valeur, unsigned char dots, unsigned int smaller, Staff *staff); void DrawStem( DeviceContext *dc, LayerElement *object, Staff *staff, data_STEMDIRECTION dir, int radius, int xn, int originY, int heightY = 0); - void DrawSylConnector( DeviceContext *dc, Syl *syl, System *system ); - void DrawSylConnectorLines( DeviceContext *dc, int x1, int x2, int y, Syl *syl, Staff *staff ); void DrawTrill(DeviceContext *dc, LayerElement *element, Staff *staff ); void DrawWholeRest ( DeviceContext *dc, int x, int y, int valeur, unsigned char dots, unsigned int smaller, Staff *staff); ///@} + /** + * @name Methods for drawing Floating child classes. + * They are base drawing methods that are called directly from DrawFloatingElement + * Call appropriate method of child classes (Slur, Tempo, Tie, etc). + * Defined in floating_element.cpp + */ + ///@{ + void DrawFloatingElement( DeviceContext *dc, FloatingElement *element, Measure *measure, System *system ); + void DrawSylConnector( DeviceContext *dc, Syl *syl, int x1, int x2, + Staff *staff, char spanningType, DocObject *graphic = NULL ); + void DrawSylConnectorLines( DeviceContext *dc, int x1, int x2, int y, Syl *syl, Staff *staff ); + void DrawTimeSpanningElement( DeviceContext *dc, DocObject *object, System *system ); + void DrawTieOrSlur( DeviceContext *dc, FloatingElement *element, int x1, int x2, + Staff *staff, char spanningType, DocObject *graphic = NULL ); + + ///@} + /** * @name Methods for drawing mensural LayerElement child classes. * They are base drawing methods that are called directly from DrawLayerElement diff --git a/java/build.sh b/java/build.sh index 726e2194327..44cef4a195f 100755 --- a/java/build.sh +++ b/java/build.sh @@ -47,6 +47,7 @@ FILES="../src/accid.cpp \ ../src/view.cpp \ ../src/view_beam.cpp \ ../src/view_element.cpp \ + ../src/view_floating.cpp \ ../src/view_graph.cpp \ ../src/view_mensural.cpp \ ../src/view_page.cpp \ diff --git a/python/setup.py b/python/setup.py index 6b2c7212499..90c18b1f48d 100755 --- a/python/setup.py +++ b/python/setup.py @@ -50,7 +50,8 @@ '../src/positioninterface.cpp', '../src/view.cpp', '../src/view_beam.cpp', - '../src/view_element.cpp', + '../src/view_element.cpp', + '../src/view_floating.cpp', '../src/view_graph.cpp', '../src/view_mensural.cpp', '../src/view_page.cpp', diff --git a/src/view_element.cpp b/src/view_element.cpp index 135f3732c63..d40210a3dad 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: musrc_element.cpp +// Name: view_element.cpp // Author: Laurent Pugin and Chris Niven // Created: 2011 // Copyright (c) Authors and others. All rights reserved. @@ -31,7 +31,6 @@ #include "multirest.h" #include "note.h" #include "rest.h" -#include "slur.h" #include "space.h" #include "smufl.h" #include "staff.h" @@ -1654,95 +1653,6 @@ void View::DrawSyl( DeviceContext *dc, LayerElement *element, Layer *layer, Staf dc->EndGraphic(syl, this ); } - -void View::DrawSylConnector( DeviceContext *dc, Syl *syl, int x1, int x2, Staff *staff, char spanningType, DocObject *graphic ) -{ - assert( syl ); - assert( syl->GetStart() && syl->GetEnd() ); - if ( !syl->GetStart() || !syl->GetEnd() ) return; - - int y = GetSylY(syl, staff); - int w, h; - - // The both correspond to the current system, which means no system break in-between (simple case) - if ( spanningType == SPANNING_START_END ) { - dc->SetFont( &m_doc->m_drawingLyricFonts[ staff->staffSize ] ); - dc->GetTextExtent(syl->GetText(), &w, &h); - dc->ResetFont(); - // x position of the syl is two units back - x1 += w - m_doc->m_drawingUnit[staff->staffSize] * 2; - } - // Only the first parent is the same, this means that the syl is "open" at the end of the system - else if ( spanningType == SPANNING_START) { - dc->SetFont( &m_doc->m_drawingLyricFonts[ staff->staffSize ] ); - dc->GetTextExtent(syl->GetText(), &w, &h); - dc->ResetFont(); - // idem - x1 += w - m_doc->m_drawingUnit[staff->staffSize] * 2; - - } - // We are in the system of the last note - draw the connector from the beginning of the system - else if ( spanningType == SPANNING_END ) { - // nothing to adjust - } - // Rare case where neither the first note and the last note are in the current system - draw the connector throughout the system - else { - // nothing to adjust - } - - if ( graphic ) dc->ResumeGraphic(graphic, graphic->GetUuid()); - else dc->StartGraphic(syl, "spanning-connector", ""); - dc->DeactivateGraphic(); - DrawSylConnectorLines( dc, x1, x2, y, syl, staff); - dc->ReactivateGraphic(); - if ( graphic ) dc->EndResumedGraphic(graphic, this); - else dc->EndGraphic(syl, this); - -} - -void View::DrawSylConnectorLines( DeviceContext *dc, int x1, int x2, int y, Syl *syl, Staff *staff ) -{ - if (syl->GetCon() == CON_d) { - - y += m_doc->m_drawingUnit[staff->staffSize] * 2 / 3; - // x position of the syl is two units back - x2 -= 2 * (int)m_doc->m_drawingUnit[staff->staffSize]; - - //if ( x1 > x2 ) { - // DrawFullRectangle(dc, x1, y + 2* m_doc->m_style->m_barlineWidth, x2, y + 3 * m_doc->m_style->m_barlineWidth); - // LogDebug("x1 > x2 (%d %d)", x1, x2 ); - //} - - // the length of the dash and the space between them - can be made a parameter - int dashLength = m_doc->m_drawingUnit[staff->staffSize] * 4 / 3; - int dashSpace = m_doc->m_drawingStaffSize[staff->staffSize] * 5 / 3; - int halfDashLength = dashLength / 2; - - int dist = x2 - x1; - int nbDashes = dist / dashSpace; - - int margin = dist / 2; - // at least one dash - if (nbDashes < 2) { - nbDashes = 1; - } - else { - margin = (dist - ((nbDashes - 1) * dashSpace)) / 2; - } - margin -= dashLength / 2; - int i, x; - for (i = 0; i < nbDashes; i++) { - x = x1 + margin + (i * dashSpace); - DrawFullRectangle(dc, x - halfDashLength, y, x + halfDashLength, y + m_doc->m_style->m_barlineWidth); - } - - } - else if (syl->GetCon() == CON_u) { - x1 += (int)m_doc->m_drawingUnit[staff->staffSize] / 2; - DrawFullRectangle(dc, x1, y, x2, y + m_doc->m_style->m_barlineWidth); - } - -} void View::DrawVerse( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ) { diff --git a/src/view_floating.cpp b/src/view_floating.cpp new file mode 100644 index 00000000000..054dabf4df6 --- /dev/null +++ b/src/view_floating.cpp @@ -0,0 +1,386 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: view_floating.cpp +// Author: Laurent Pugin +// Created: 2015 +// Copyright (c) Authors and others. All rights reserved. +///////////////////////////////////////////////////////////////////////////// + + +#include "view.h" + +//---------------------------------------------------------------------------- + +#include +#include + +//---------------------------------------------------------------------------- + +//#include "accid.h" +#include "att_comparison.h" +//#include "beam.h" +//#include "chord.h" +//#include "custos.h" +#include "devicecontext.h" +#include "doc.h" +//#include "dot.h" +#include "floatingelement.h" +//#include "keysig.h" +#include "layer.h" +#include "layerelement.h" +#include "measure.h" +//#include "mensur.h" +//#include "metersig.h" +//#include "mrest.h" +//#include "multirest.h" +#include "note.h" +//#include "rest.h" +#include "slur.h" +//#include "space.h" +//#include "smufl.h" +#include "staff.h" +#include "style.h" +#include "syl.h" +#include "system.h" +#include "tie.h" +#include "timeinterface.h" +//#include "tuplet.h" +//#include "verse.h" +#include "vrv.h" + +namespace vrv { + +//---------------------------------------------------------------------------- +// View - FloatingElement +//---------------------------------------------------------------------------- + +void View::DrawFloatingElement( DeviceContext *dc, FloatingElement *element, Measure *measure, System *system) +{ + assert( dc ); + assert( system ); + assert( measure ); + assert( element ); + + if (element->HasInterface(INTERFACE_TIME_SPANNING)) { + // creating placeholder + dc->StartGraphic( element, "", element->GetUuid() ); + dc->EndGraphic( element, this); + system->AddToDrawingList(element); + } +} + +void View::DrawTimeSpanningElement( DeviceContext *dc, DocObject *element, System *system ) +{ + assert( dc ); + assert( element ); + assert( system ); + + TimeSpanningInterface *interface = dynamic_cast(element); + assert( interface ); + + if ( !interface->HasStartAndEnd() ) return; + + // Get the parent system of the first and last note + System *parentSystem1 = dynamic_cast( interface->GetStart()->GetFirstParent( SYSTEM ) ); + System *parentSystem2 = dynamic_cast( interface->GetEnd()->GetFirstParent( SYSTEM ) ); + + int x1, x2; + Staff *staff = NULL; + DocObject *graphic = NULL; + char spanningType = SPANNING_START_END; + + // The both correspond to the current system, which means no system break in-between (simple case) + if (( system == parentSystem1 ) && ( system == parentSystem2 )) { + // Get the parent staff for calculating the y position + staff = dynamic_cast( interface->GetStart()->GetFirstParent( STAFF ) ); + if ( !Check( staff ) ) return; + + x1 = interface->GetStart()->GetDrawingX(); + x2 = interface->GetEnd()->GetDrawingX(); + graphic = element; + } + // Only the first parent is the same, this means that the element is "open" at the end of the system + else if ( system == parentSystem1 ) { + // We need the last measure of the system for x2 + Measure *last = dynamic_cast( system->FindChildByType( MEASURE, 1, BACKWARD ) ); + if ( !Check( last ) ) return; + staff = dynamic_cast( interface->GetStart()->GetFirstParent( STAFF ) ); + if ( !Check( staff ) ) return; + + x1 = interface->GetStart()->GetDrawingX(); + x2 = last->GetDrawingX() + last->GetRightBarlineX(); + graphic = element; + spanningType = SPANNING_START; + } + // We are in the system of the last note - draw the element from the beginning of the system + else if ( system == parentSystem2 ) { + // We need the first measure of the system for x1 + Measure *first = dynamic_cast( system->FindChildByType( MEASURE, 1, FORWARD ) ); + if ( !Check( first ) ) return; + // Get the staff of the first note - however, not the staff we need + Staff *lastStaff = dynamic_cast( interface->GetEnd()->GetFirstParent( STAFF ) ); + if ( !Check( lastStaff ) ) return; + // We need the first staff from the current system, i.e., the first measure. + AttCommonNComparison comparison( STAFF, lastStaff->GetN() ); + staff = dynamic_cast(system->FindChildByAttComparison(&comparison, 2)); + if (!staff ) { + LogDebug("Could not get staff (%d) while drawing staffGrp - View::DrawSylConnector", lastStaff->GetN() ); + return; + } + // Also try to get a first note - we should change this once we have a x position in measure that + // takes into account the scoreDef + Note *firstNote = dynamic_cast( staff->FindChildByType( NOTE ) ); + + x1 = firstNote ? firstNote->GetDrawingX() - 2 * m_doc->m_drawingDoubleUnit[staff->staffSize] : first->GetDrawingX(); + x2 = interface->GetEnd()->GetDrawingX(); + spanningType = SPANNING_END; + } + // Rare case where neither the first note and the last note are in the current system - draw the connector throughout the system + else { + // We need the first measure of the system for x1 + Measure *first = dynamic_cast( system->FindChildByType( MEASURE, 1, FORWARD ) ); + if ( !Check( first ) ) return; + // Also try to get a first note - we should change this once we have a x position in measure that + // takes into account the scoreDef + Note *firstNote = dynamic_cast( first->FindChildByType( NOTE ) ); + // We need the last measure of the system for x2 + Measure *last = dynamic_cast( system->FindChildByType( MEASURE, 1, BACKWARD ) ); + if ( !Check( last ) ) return; + // Get the staff of the first note - however, not the staff we need + Staff *firstStaff = dynamic_cast( interface->GetStart()->GetFirstParent( STAFF ) ); + if ( !Check( firstStaff ) ) return; + + // We need the staff from the current system, i.e., the first measure. + AttCommonNComparison comparison( STAFF, firstStaff->GetN() ); + staff = dynamic_cast(first->FindChildByAttComparison(&comparison, 1)); + if (!staff ) { + LogDebug("Could not get staff (%d) while drawing staffGrp - View::DrawSylConnector", firstStaff->GetN() ); + return; + } + + x1 = firstNote ? firstNote->GetDrawingX() - 2 * m_doc->m_drawingDoubleUnit[staff->staffSize] : first->GetDrawingX(); + x2 = last->GetDrawingX() + last->GetRightBarlineX(); + spanningType = SPANNING_MIDDLE; + } + + if (element->Is() == SLUR) { + // cast to Slur check in DrawTieOrSlur + DrawTieOrSlur(dc, dynamic_cast(element), x1, x2, staff, spanningType, graphic); + } + else if (element->Is() == SYL) { + // cast to Syl check in DrawSylConnector + DrawSylConnector(dc, dynamic_cast(element), x1, x2, staff, spanningType, graphic); + } + else if (element->Is() == TIE) { + // cast to Slur check in DrawTieOrSlur + DrawTieOrSlur(dc, dynamic_cast(element), x1, x2, staff, spanningType, graphic); + } + +} + +void View::DrawTieOrSlur( DeviceContext *dc, FloatingElement *element, int x1, int x2, Staff *staff, + char spanningType, DocObject *graphic ) +{ + assert( dc ); + assert( element ); + assert( staff ); + + assert(dynamic_cast(element) || dynamic_cast(element)); // Element must be a Tie or a Slur + + TimeSpanningInterface *interface = dynamic_cast(element); + assert( interface ); + + LayerElement *element1 = NULL; + LayerElement *element2 = NULL; + + bool up = true; + data_STEMDIRECTION noteStemDir = STEMDIRECTION_NONE; + int y1, y2; + + element1 = interface->GetStart(); + element2 = interface->GetEnd(); + + if ( !element1 || !element2 ) { + // no note, obviously nothing to do... + return; + } + + Note *note1 = NULL; + Note *note2 = NULL; + Chord *chord1 = NULL; + Chord *chord2 = NULL; + if (element1->Is() == NOTE ) note1 = dynamic_cast(element1); + else chord1 = dynamic_cast(element1); + assert( note1 || chord1 ); + if (element2->Is() == NOTE ) note2 = dynamic_cast(element2); + else chord2 = dynamic_cast(element2); + assert( note2 || chord2 ); + + Layer* layer1 = dynamic_cast(element1->GetFirstParent( LAYER ) ); + Layer* layer2 = dynamic_cast(element2->GetFirstParent( LAYER ) ); + assert( layer1 && layer2 ); + + if ( layer1->GetN() != layer2->GetN() ) { + LogWarning("Ties between different layers may not be fully supported."); + } + + //the normal case + if ( spanningType == SPANNING_START_END ) { + // Copied from DrawNote + // We could use the stamDir information + // but then we have to take in account (1) beams (2) stemmed and non stemmed notes tied together + y1 = element1->GetDrawingY(); + y2 = element2->GetDrawingY(); + // for now we only look at the first note - needs to be improved + // m_drawingStemDir it not set properly in beam - needs to be fixed. + if (note1) noteStemDir = note1->m_drawingStemDir; + else noteStemDir = chord1->GetDrawingStemDir(); + } + // This is the case when the tie is split over two system of two pages. + // In this case, we are now drawing its beginning to the end of the measure (i.e., the last aligner) + else if ( spanningType == SPANNING_START ) { + y1 = element1->GetDrawingY(); + y2 = y1; + // m_drawingStemDir it not set properly in beam - needs to be fixed. + if (note1) noteStemDir = note1->m_drawingStemDir; + else noteStemDir = chord1->GetDrawingStemDir(); + } + // Now this is the case when the tie is split but we are drawing the end of it + else if ( spanningType == SPANNING_END ) { + y1 = element2->GetDrawingY(); + y2 = y1; + x2 = element2->GetDrawingX(); + if (note2) noteStemDir = note2->m_drawingStemDir; + else noteStemDir = chord2->GetDrawingStemDir(); + } + // Finally + else { + LogDebug("Slur across an entire system is not supported"); + return; + } + + //layer direction trumps note direction + if (layer1 && layer1->GetDrawingStemDir() != STEMDIRECTION_NONE){ + up = layer1->GetDrawingStemDir() == STEMDIRECTION_up ? true : false; + } + else if (noteStemDir == STEMDIRECTION_up) { + up = false; + } + else if (noteStemDir == STEMDIRECTION_NONE) { + // no information from the note stem directions, look at the position in the notes + int center = staff->GetDrawingY() - m_doc->m_drawingDoubleUnit[staff->staffSize] * 2; + up = (y1 > center) ? true : false; + } + + // FIXME, take in account elements that can be netween notes, eg keys time etc + // 20 height nice with 70, not nice with 50 + // Also remove HARDCODED values! + if (up) { + y1 += m_doc->m_drawingUnit[staff->staffSize] * 1.6; + y2 += m_doc->m_drawingUnit[staff->staffSize] * 1.6; + } + else { + y1 -= m_doc->m_drawingUnit[staff->staffSize] * 1.6; + y2 -= m_doc->m_drawingUnit[staff->staffSize] * 1.6; + } + + if ( graphic ) dc->ResumeGraphic(graphic, graphic->GetUuid()); + else dc->StartGraphic(element, "spanning-tie-or-slur", ""); + dc->DeactivateGraphic(); + DrawTieOrSlurBezier(dc, x1, y1, x2, y2, !up); + dc->ReactivateGraphic(); + + if ( graphic ) dc->EndResumedGraphic(graphic, this); + else dc->EndGraphic(element, this); +} + +void View::DrawSylConnector( DeviceContext *dc, Syl *syl, int x1, int x2, Staff *staff, char spanningType, DocObject *graphic ) +{ + assert( syl ); + assert( syl->GetStart() && syl->GetEnd() ); + if ( !syl->GetStart() || !syl->GetEnd() ) return; + + int y = GetSylY(syl, staff); + int w, h; + + // The both correspond to the current system, which means no system break in-between (simple case) + if ( spanningType == SPANNING_START_END ) { + dc->SetFont( &m_doc->m_drawingLyricFonts[ staff->staffSize ] ); + dc->GetTextExtent(syl->GetText(), &w, &h); + dc->ResetFont(); + // x position of the syl is two units back + x1 += w - m_doc->m_drawingUnit[staff->staffSize] * 2; + } + // Only the first parent is the same, this means that the syl is "open" at the end of the system + else if ( spanningType == SPANNING_START) { + dc->SetFont( &m_doc->m_drawingLyricFonts[ staff->staffSize ] ); + dc->GetTextExtent(syl->GetText(), &w, &h); + dc->ResetFont(); + // idem + x1 += w - m_doc->m_drawingUnit[staff->staffSize] * 2; + + } + // We are in the system of the last note - draw the connector from the beginning of the system + else if ( spanningType == SPANNING_END ) { + // nothing to adjust + } + // Rare case where neither the first note and the last note are in the current system - draw the connector throughout the system + else { + // nothing to adjust + } + + if ( graphic ) dc->ResumeGraphic(graphic, graphic->GetUuid()); + else dc->StartGraphic(syl, "spanning-connector", ""); + dc->DeactivateGraphic(); + DrawSylConnectorLines( dc, x1, x2, y, syl, staff); + dc->ReactivateGraphic(); + if ( graphic ) dc->EndResumedGraphic(graphic, this); + else dc->EndGraphic(syl, this); + +} + +void View::DrawSylConnectorLines( DeviceContext *dc, int x1, int x2, int y, Syl *syl, Staff *staff ) +{ + if (syl->GetCon() == CON_d) { + + y += m_doc->m_drawingUnit[staff->staffSize] * 2 / 3; + // x position of the syl is two units back + x2 -= 2 * (int)m_doc->m_drawingUnit[staff->staffSize]; + + //if ( x1 > x2 ) { + // DrawFullRectangle(dc, x1, y + 2* m_doc->m_style->m_barlineWidth, x2, y + 3 * m_doc->m_style->m_barlineWidth); + // LogDebug("x1 > x2 (%d %d)", x1, x2 ); + //} + + // the length of the dash and the space between them - can be made a parameter + int dashLength = m_doc->m_drawingUnit[staff->staffSize] * 4 / 3; + int dashSpace = m_doc->m_drawingStaffSize[staff->staffSize] * 5 / 3; + int halfDashLength = dashLength / 2; + + int dist = x2 - x1; + int nbDashes = dist / dashSpace; + + int margin = dist / 2; + // at least one dash + if (nbDashes < 2) { + nbDashes = 1; + } + else { + margin = (dist - ((nbDashes - 1) * dashSpace)) / 2; + } + margin -= dashLength / 2; + int i, x; + for (i = 0; i < nbDashes; i++) { + x = x1 + margin + (i * dashSpace); + DrawFullRectangle(dc, x - halfDashLength, y, x + halfDashLength, y + m_doc->m_style->m_barlineWidth); + } + + } + else if (syl->GetCon() == CON_u) { + x1 += (int)m_doc->m_drawingUnit[staff->staffSize] / 2; + DrawFullRectangle(dc, x1, y, x2, y + m_doc->m_style->m_barlineWidth); + } + +} + +} // namespace vrv + diff --git a/src/view_mensural.cpp b/src/view_mensural.cpp index 0912b2670b0..9b234899fa7 100644 --- a/src/view_mensural.cpp +++ b/src/view_mensural.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: musrc_mensural.cpp +// Name: view_mensural.cpp // Author: Laurent Pugin // Created: 2015 // Copyright (c) Authors and others. All rights reserved. diff --git a/src/view_page.cpp b/src/view_page.cpp index c13bf6c34dd..8036d815611 100644 --- a/src/view_page.cpp +++ b/src/view_page.cpp @@ -20,6 +20,7 @@ #include "devicecontext.h" #include "doc.h" #include "editorial.h" +#include "floatingelement.h" #include "keysig.h" #include "layer.h" #include "measure.h" @@ -27,13 +28,11 @@ #include "metersig.h" #include "note.h" #include "page.h" -#include "slur.h" #include "smufl.h" #include "staff.h" #include "style.h" #include "system.h" #include "syl.h" -#include "tie.h" #include "tuplet.h" #include "vrv.h" @@ -630,23 +629,9 @@ void View::DrawMeasure( DeviceContext *dc, Measure *measure, System *system ) } } -void View::DrawFloatingElement( DeviceContext *dc, FloatingElement *element, Measure *measure, System *system) -{ - assert( dc ); - assert( system ); - assert( measure ); - assert( element ); - - if (element->HasInterface(INTERFACE_TIME_SPANNING)) { - // creating placeholder - dc->StartGraphic( element, "", element->GetUuid() ); - dc->EndGraphic( element, this); - system->AddToDrawingList(element); - } -} //---------------------------------------------------------------------------- -// View - FloatingElement +// View - Staff //---------------------------------------------------------------------------- int View::CalculatePitchPosY ( Staff *staff, data_PITCHNAME pname, int dec_clef, int oct) @@ -766,231 +751,6 @@ void View::DrawStaffLines( DeviceContext *dc, Staff *staff, Measure *measure, Sy return; } -void View::DrawTimeSpanningElement( DeviceContext *dc, DocObject *element, System *system ) -{ - assert( dc ); - assert( element ); - assert( system ); - - TimeSpanningInterface *interface = dynamic_cast(element); - assert( interface ); - - if ( !interface->HasStartAndEnd() ) return; - - // Get the parent system of the first and last note - System *parentSystem1 = dynamic_cast( interface->GetStart()->GetFirstParent( SYSTEM ) ); - System *parentSystem2 = dynamic_cast( interface->GetEnd()->GetFirstParent( SYSTEM ) ); - - int x1, x2; - Staff *staff = NULL; - DocObject *graphic = NULL; - char spanningType = SPANNING_START_END; - - // The both correspond to the current system, which means no system break in-between (simple case) - if (( system == parentSystem1 ) && ( system == parentSystem2 )) { - // Get the parent staff for calculating the y position - staff = dynamic_cast( interface->GetStart()->GetFirstParent( STAFF ) ); - if ( !Check( staff ) ) return; - - x1 = interface->GetStart()->GetDrawingX(); - x2 = interface->GetEnd()->GetDrawingX(); - graphic = element; - } - // Only the first parent is the same, this means that the element is "open" at the end of the system - else if ( system == parentSystem1 ) { - // We need the last measure of the system for x2 - Measure *last = dynamic_cast( system->FindChildByType( MEASURE, 1, BACKWARD ) ); - if ( !Check( last ) ) return; - staff = dynamic_cast( interface->GetStart()->GetFirstParent( STAFF ) ); - if ( !Check( staff ) ) return; - - x1 = interface->GetStart()->GetDrawingX(); - x2 = last->GetDrawingX() + last->GetRightBarlineX(); - graphic = element; - spanningType = SPANNING_START; - } - // We are in the system of the last note - draw the element from the beginning of the system - else if ( system == parentSystem2 ) { - // We need the first measure of the system for x1 - Measure *first = dynamic_cast( system->FindChildByType( MEASURE, 1, FORWARD ) ); - if ( !Check( first ) ) return; - // Get the staff of the first note - however, not the staff we need - Staff *lastStaff = dynamic_cast( interface->GetEnd()->GetFirstParent( STAFF ) ); - if ( !Check( lastStaff ) ) return; - // We need the first staff from the current system, i.e., the first measure. - AttCommonNComparison comparison( STAFF, lastStaff->GetN() ); - staff = dynamic_cast(system->FindChildByAttComparison(&comparison, 2)); - if (!staff ) { - LogDebug("Could not get staff (%d) while drawing staffGrp - View::DrawSylConnector", lastStaff->GetN() ); - return; - } - // Also try to get a first note - we should change this once we have a x position in measure that - // takes into account the scoreDef - Note *firstNote = dynamic_cast( staff->FindChildByType( NOTE ) ); - - x1 = firstNote ? firstNote->GetDrawingX() - 2 * m_doc->m_drawingDoubleUnit[staff->staffSize] : first->GetDrawingX(); - x2 = interface->GetEnd()->GetDrawingX(); - spanningType = SPANNING_END; - } - // Rare case where neither the first note and the last note are in the current system - draw the connector throughout the system - else { - // We need the first measure of the system for x1 - Measure *first = dynamic_cast( system->FindChildByType( MEASURE, 1, FORWARD ) ); - if ( !Check( first ) ) return; - // Also try to get a first note - we should change this once we have a x position in measure that - // takes into account the scoreDef - Note *firstNote = dynamic_cast( first->FindChildByType( NOTE ) ); - // We need the last measure of the system for x2 - Measure *last = dynamic_cast( system->FindChildByType( MEASURE, 1, BACKWARD ) ); - if ( !Check( last ) ) return; - // Get the staff of the first note - however, not the staff we need - Staff *firstStaff = dynamic_cast( interface->GetStart()->GetFirstParent( STAFF ) ); - if ( !Check( firstStaff ) ) return; - - // We need the staff from the current system, i.e., the first measure. - AttCommonNComparison comparison( STAFF, firstStaff->GetN() ); - staff = dynamic_cast(first->FindChildByAttComparison(&comparison, 1)); - if (!staff ) { - LogDebug("Could not get staff (%d) while drawing staffGrp - View::DrawSylConnector", firstStaff->GetN() ); - return; - } - - x1 = firstNote ? firstNote->GetDrawingX() - 2 * m_doc->m_drawingDoubleUnit[staff->staffSize] : first->GetDrawingX(); - x2 = last->GetDrawingX() + last->GetRightBarlineX(); - spanningType = SPANNING_MIDDLE; - } - - if (element->Is() == SLUR) { - // cast to Slur check in DrawTieOrSlur - DrawTieOrSlur(dc, dynamic_cast(element), x1, x2, staff, spanningType, graphic); - } - else if (element->Is() == SYL) { - // cast to Syl check in DrawSylConnector - DrawSylConnector(dc, dynamic_cast(element), x1, x2, staff, spanningType, graphic); - } - else if (element->Is() == TIE) { - // cast to Slur check in DrawTieOrSlur - DrawTieOrSlur(dc, dynamic_cast(element), x1, x2, staff, spanningType, graphic); - } - -} - -void View::DrawTieOrSlur( DeviceContext *dc, FloatingElement *element, int x1, int x2, Staff *staff, - char spanningType, DocObject *graphic ) -{ - assert( dc ); - assert( element ); - assert( staff ); - - assert(dynamic_cast(element) || dynamic_cast(element)); // Element must be a Tie or a Slur - - TimeSpanningInterface *interface = dynamic_cast(element); - assert( interface ); - - LayerElement *element1 = NULL; - LayerElement *element2 = NULL; - - bool up = true; - data_STEMDIRECTION noteStemDir = STEMDIRECTION_NONE; - int y1, y2; - - element1 = interface->GetStart(); - element2 = interface->GetEnd(); - - if ( !element1 || !element2 ) { - // no note, obviously nothing to do... - return; - } - - Note *note1 = NULL; - Note *note2 = NULL; - Chord *chord1 = NULL; - Chord *chord2 = NULL; - if (element1->Is() == NOTE ) note1 = dynamic_cast(element1); - else chord1 = dynamic_cast(element1); - assert( note1 || chord1 ); - if (element2->Is() == NOTE ) note2 = dynamic_cast(element2); - else chord2 = dynamic_cast(element2); - assert( note2 || chord2 ); - - Layer* layer1 = dynamic_cast(element1->GetFirstParent( LAYER ) ); - Layer* layer2 = dynamic_cast(element2->GetFirstParent( LAYER ) ); - assert( layer1 && layer2 ); - - if ( layer1->GetN() != layer2->GetN() ) { - LogWarning("Ties between different layers may not be fully supported."); - } - - //the normal case - if ( spanningType == SPANNING_START_END ) { - // Copied from DrawNote - // We could use the stamDir information - // but then we have to take in account (1) beams (2) stemmed and non stemmed notes tied together - y1 = element1->GetDrawingY(); - y2 = element2->GetDrawingY(); - // for now we only look at the first note - needs to be improved - // m_drawingStemDir it not set properly in beam - needs to be fixed. - if (note1) noteStemDir = note1->m_drawingStemDir; - else noteStemDir = chord1->GetDrawingStemDir(); - } - // This is the case when the tie is split over two system of two pages. - // In this case, we are now drawing its beginning to the end of the measure (i.e., the last aligner) - else if ( spanningType == SPANNING_START ) { - y1 = element1->GetDrawingY(); - y2 = y1; - // m_drawingStemDir it not set properly in beam - needs to be fixed. - if (note1) noteStemDir = note1->m_drawingStemDir; - else noteStemDir = chord1->GetDrawingStemDir(); - } - // Now this is the case when the tie is split but we are drawing the end of it - else if ( spanningType == SPANNING_END ) { - y1 = element2->GetDrawingY(); - y2 = y1; - x2 = element2->GetDrawingX(); - if (note2) noteStemDir = note2->m_drawingStemDir; - else noteStemDir = chord2->GetDrawingStemDir(); - } - // Finally - else { - LogDebug("Slur across an entire system is not supported"); - return; - } - - //layer direction trumps note direction - if (layer1 && layer1->GetDrawingStemDir() != STEMDIRECTION_NONE){ - up = layer1->GetDrawingStemDir() == STEMDIRECTION_up ? true : false; - } - else if (noteStemDir == STEMDIRECTION_up) { - up = false; - } - else if (noteStemDir == STEMDIRECTION_NONE) { - // no information from the note stem directions, look at the position in the notes - int center = staff->GetDrawingY() - m_doc->m_drawingDoubleUnit[staff->staffSize] * 2; - up = (y1 > center) ? true : false; - } - - // FIXME, take in account elements that can be netween notes, eg keys time etc - // 20 height nice with 70, not nice with 50 - // Also remove HARDCODED values! - if (up) { - y1 += m_doc->m_drawingUnit[staff->staffSize] * 1.6; - y2 += m_doc->m_drawingUnit[staff->staffSize] * 1.6; - } - else { - y1 -= m_doc->m_drawingUnit[staff->staffSize] * 1.6; - y2 -= m_doc->m_drawingUnit[staff->staffSize] * 1.6; - } - - if ( graphic ) dc->ResumeGraphic(graphic, graphic->GetUuid()); - else dc->StartGraphic(element, "spanning-tie-or-slur", ""); - dc->DeactivateGraphic(); - DrawTieOrSlurBezier(dc, x1, y1, x2, y2, !up); - dc->ReactivateGraphic(); - - if ( graphic ) dc->EndResumedGraphic(graphic, this); - else dc->EndGraphic(element, this); -} - //---------------------------------------------------------------------------- // View - Layer //---------------------------------------------------------------------------- diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index b4ff1060c59..f0054d008ea 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -56,6 +56,7 @@ add_executable (verovio ../src/view.cpp ../src/view_beam.cpp ../src/view_element.cpp + ../src/view_floating.cpp ../src/view_graph.cpp ../src/view_mensural.cpp ../src/view_page.cpp From ce98e743d4a7ce1708007c9963b77c0b79a0aa8c Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sun, 16 Aug 2015 22:43:53 +0200 Subject: [PATCH 062/114] Adding att.numberplacement and att.tuplet.vis to tuplet --- include/vrv/att.h | 3 +++ include/vrv/attdef.h | 9 +++++++++ include/vrv/tuplet.h | 5 ++++- libmei/atts_cmn.cpp | 48 ++++++++++++++++++++++---------------------- libmei/atts_cmn.h | 24 +++++++++++----------- src/att.cpp | 26 ++++++++++++++++++++++++ src/iomei.cpp | 4 ++++ src/tuplet.cpp | 8 +++++++- 8 files changed, 89 insertions(+), 38 deletions(-) diff --git a/include/vrv/att.h b/include/vrv/att.h index b979c98ceb0..e79f0ec0aa4 100644 --- a/include/vrv/att.h +++ b/include/vrv/att.h @@ -158,6 +158,9 @@ class Att std::string ModusminorToStr(data_MODUSMINOR data); data_MODUSMINOR StrToModusminor(std::string value); + std::string NumformatToStr(data_NUMFORMAT data); + data_NUMFORMAT StrToNumformat(std::string value); + std::string OctaveDisToStr(data_OCTAVE_DIS data); data_OCTAVE_DIS StrToOctaveDis(std::string value); diff --git a/include/vrv/attdef.h b/include/vrv/attdef.h index 0b24e0bf60d..e3050853e67 100644 --- a/include/vrv/attdef.h +++ b/include/vrv/attdef.h @@ -316,6 +316,15 @@ enum data_MODUSMINOR { MODUSMINOR_3 }; +/** + * MEI values for @num.format (no datatype in MEI) + */ +enum data_NUMFORMAT { + NUMFORMAT_NONE = 0, + NUMFORMAT_count, + NUMFORMAT_ratio, +}; + /** * MEI data.OCTAVE.DIS */ diff --git a/include/vrv/tuplet.h b/include/vrv/tuplet.h index ef0849df706..89e1930fe5b 100644 --- a/include/vrv/tuplet.h +++ b/include/vrv/tuplet.h @@ -10,6 +10,7 @@ #define __VRV_TUPLET_H__ #include "atts_shared.h" +#include "atts_cmn.h" #include "layerelement.h" namespace vrv { @@ -21,7 +22,9 @@ class Note; //---------------------------------------------------------------------------- class Tuplet: public LayerElement, public ObjectListInterface, - public AttDurationRatio + public AttDurationRatio, + public AttNumberplacement, + public AttTupletVis { public: /** diff --git a/libmei/atts_cmn.cpp b/libmei/atts_cmn.cpp index f89bb7495b7..50def276fe2 100644 --- a/libmei/atts_cmn.cpp +++ b/libmei/atts_cmn.cpp @@ -1681,31 +1681,31 @@ AttTupletVis::~AttTupletVis() { } void AttTupletVis::ResetTupletVis() { - m_bracketPlace = ""; - m_bracketVisible = ""; - m_durVisible = ""; - m_numFormat = ""; + m_bracketPlace = PLACE_NONE; + m_bracketVisible = BOOLEAN_NONE; + m_durVisible = BOOLEAN_NONE; + m_numFormat = NUMFORMAT_NONE; } bool AttTupletVis::ReadTupletVis( pugi::xml_node element ) { bool hasAttribute = false; if (element.attribute("bracket.place")) { - this->SetBracketPlace(StrToStr(element.attribute("bracket.place").value())); + this->SetBracketPlace(StrToPlace(element.attribute("bracket.place").value())); element.remove_attribute("bracket.place"); hasAttribute = true; } if (element.attribute("bracket.visible")) { - this->SetBracketVisible(StrToStr(element.attribute("bracket.visible").value())); + this->SetBracketVisible(StrToBool(element.attribute("bracket.visible").value())); element.remove_attribute("bracket.visible"); hasAttribute = true; } if (element.attribute("dur.visible")) { - this->SetDurVisible(StrToStr(element.attribute("dur.visible").value())); + this->SetDurVisible(StrToBool(element.attribute("dur.visible").value())); element.remove_attribute("dur.visible"); hasAttribute = true; } if (element.attribute("num.format")) { - this->SetNumFormat(StrToStr(element.attribute("num.format").value())); + this->SetNumFormat(StrToNumformat(element.attribute("num.format").value())); element.remove_attribute("num.format"); hasAttribute = true; } @@ -1715,19 +1715,19 @@ bool AttTupletVis::ReadTupletVis( pugi::xml_node element ) { bool AttTupletVis::WriteTupletVis( pugi::xml_node element ) { bool wroteAttribute = false; if (this->HasBracketPlace()) { - element.append_attribute("bracket.place") = StrToStr(this->GetBracketPlace()).c_str(); + element.append_attribute("bracket.place") = PlaceToStr(this->GetBracketPlace()).c_str(); wroteAttribute = true; } if (this->HasBracketVisible()) { - element.append_attribute("bracket.visible") = StrToStr(this->GetBracketVisible()).c_str(); + element.append_attribute("bracket.visible") = BoolToStr(this->GetBracketVisible()).c_str(); wroteAttribute = true; } if (this->HasDurVisible()) { - element.append_attribute("dur.visible") = StrToStr(this->GetDurVisible()).c_str(); + element.append_attribute("dur.visible") = BoolToStr(this->GetDurVisible()).c_str(); wroteAttribute = true; } if (this->HasNumFormat()) { - element.append_attribute("num.format") = StrToStr(this->GetNumFormat()).c_str(); + element.append_attribute("num.format") = NumformatToStr(this->GetNumFormat()).c_str(); wroteAttribute = true; } return wroteAttribute; @@ -1735,22 +1735,22 @@ bool AttTupletVis::WriteTupletVis( pugi::xml_node element ) { bool AttTupletVis::HasBracketPlace( ) { - return (m_bracketPlace != ""); + return (m_bracketPlace != PLACE_NONE); } bool AttTupletVis::HasBracketVisible( ) { - return (m_bracketVisible != ""); + return (m_bracketVisible != BOOLEAN_NONE); } bool AttTupletVis::HasDurVisible( ) { - return (m_durVisible != ""); + return (m_durVisible != BOOLEAN_NONE); } bool AttTupletVis::HasNumFormat( ) { - return (m_numFormat != ""); + return (m_numFormat != NUMFORMAT_NONE); } @@ -2081,19 +2081,19 @@ bool Att::SetCmn( Object *element, std::string attrType, std::string attrValue ) AttTupletVis *att = dynamic_cast(element); assert( att ); if (attrType == "bracketPlace") { - att->SetBracketPlace(att->StrToStr(attrValue)); + att->SetBracketPlace(att->StrToPlace(attrValue)); return true; } if (attrType == "bracketVisible") { - att->SetBracketVisible(att->StrToStr(attrValue)); + att->SetBracketVisible(att->StrToBool(attrValue)); return true; } if (attrType == "durVisible") { - att->SetDurVisible(att->StrToStr(attrValue)); + att->SetDurVisible(att->StrToBool(attrValue)); return true; } if (attrType == "numFormat") { - att->SetNumFormat(att->StrToStr(attrValue)); + att->SetNumFormat(att->StrToNumformat(attrValue)); return true; } } @@ -2380,16 +2380,16 @@ void Att::GetCmn( Object *element, ArrayOfStrAttr *attributes ) { AttTupletVis *att = dynamic_cast(element); assert( att ); if (att->HasBracketPlace()) { - attributes->push_back(std::make_pair("bracketPlace", att->StrToStr(att->GetBracketPlace()))); + attributes->push_back(std::make_pair("bracketPlace", att->PlaceToStr(att->GetBracketPlace()))); } if (att->HasBracketVisible()) { - attributes->push_back(std::make_pair("bracketVisible", att->StrToStr(att->GetBracketVisible()))); + attributes->push_back(std::make_pair("bracketVisible", att->BoolToStr(att->GetBracketVisible()))); } if (att->HasDurVisible()) { - attributes->push_back(std::make_pair("durVisible", att->StrToStr(att->GetDurVisible()))); + attributes->push_back(std::make_pair("durVisible", att->BoolToStr(att->GetDurVisible()))); } if (att->HasNumFormat()) { - attributes->push_back(std::make_pair("numFormat", att->StrToStr(att->GetNumFormat()))); + attributes->push_back(std::make_pair("numFormat", att->NumformatToStr(att->GetNumFormat()))); } } diff --git a/libmei/atts_cmn.h b/libmei/atts_cmn.h index 77982e3a3fb..f6fc3944977 100644 --- a/libmei/atts_cmn.h +++ b/libmei/atts_cmn.h @@ -1479,23 +1479,23 @@ class AttTupletVis: public Att * to the default value) **/ ///@{ - void SetBracketPlace(std::string bracketPlace_) { m_bracketPlace = bracketPlace_; }; - std::string GetBracketPlace() const { return m_bracketPlace; }; + void SetBracketPlace(data_PLACE bracketPlace_) { m_bracketPlace = bracketPlace_; }; + data_PLACE GetBracketPlace() const { return m_bracketPlace; }; bool HasBracketPlace( ); // - void SetBracketVisible(std::string bracketVisible_) { m_bracketVisible = bracketVisible_; }; - std::string GetBracketVisible() const { return m_bracketVisible; }; + void SetBracketVisible(data_BOOLEAN bracketVisible_) { m_bracketVisible = bracketVisible_; }; + data_BOOLEAN GetBracketVisible() const { return m_bracketVisible; }; bool HasBracketVisible( ); // - void SetDurVisible(std::string durVisible_) { m_durVisible = durVisible_; }; - std::string GetDurVisible() const { return m_durVisible; }; + void SetDurVisible(data_BOOLEAN durVisible_) { m_durVisible = durVisible_; }; + data_BOOLEAN GetDurVisible() const { return m_durVisible; }; bool HasDurVisible( ); // - void SetNumFormat(std::string numFormat_) { m_numFormat = numFormat_; }; - std::string GetNumFormat() const { return m_numFormat; }; + void SetNumFormat(data_NUMFORMAT numFormat_) { m_numFormat = numFormat_; }; + data_NUMFORMAT GetNumFormat() const { return m_numFormat; }; bool HasNumFormat( ); ///@} @@ -1505,13 +1505,13 @@ class AttTupletVis: public Att * Used to state where a tuplet bracket will be placed in relation to the note * heads. **/ - std::string m_bracketPlace; + data_PLACE m_bracketPlace; /** States whether a bracket should be rendered with a tuplet. **/ - std::string m_bracketVisible; + data_BOOLEAN m_bracketVisible; /** Determines if the tuplet duration is visible. **/ - std::string m_durVisible; + data_BOOLEAN m_durVisible; /** Controls how the num:numbase ratio is to be displayed. **/ - std::string m_numFormat; + data_NUMFORMAT m_numFormat; /* include */ }; diff --git a/src/att.cpp b/src/att.cpp index 26b60fc3127..8c0b79059de 100644 --- a/src/att.cpp +++ b/src/att.cpp @@ -712,6 +712,32 @@ data_MODUSMINOR Att::StrToModusminor(std::string value) return MODUSMINOR_NONE; } +std::string Att::NumformatToStr(data_NUMFORMAT data) +{ + std::string value; + switch(data) + { + case NUMFORMAT_count : value = "count"; break; + case NUMFORMAT_ratio : value = "ratio"; break; + default: + LogWarning("Unknown numformat '%d'", data); + value = ""; + break; + } + return value; +} + +data_NUMFORMAT Att::StrToNumformat(std::string value) +{ + if (value == "count") return NUMFORMAT_count; + else if (value == "ratio") return NUMFORMAT_ratio; + else { + LogWarning("Unsupported numformat '%s'", value.c_str() ); + } + // default + return NUMFORMAT_NONE; +} + std::string Att::OctaveDisToStr( data_OCTAVE_DIS data ) { std::string value; diff --git a/src/iomei.cpp b/src/iomei.cpp index 640043f902f..639889ce952 100644 --- a/src/iomei.cpp +++ b/src/iomei.cpp @@ -703,6 +703,8 @@ void MeiOutput::WriteMeiTuplet( pugi::xml_node currentNode, Tuplet *tuplet ) WriteLayerElement( currentNode, tuplet ); tuplet->WriteDurationRatio( currentNode ); + tuplet->WriteNumberplacement( currentNode ); + tuplet->WriteTupletVis( currentNode ); return; } @@ -1901,6 +1903,8 @@ bool MeiInput::ReadMeiTuplet( Object *parent, pugi::xml_node tuplet ) // Read in the numerator and denominator properties vrvTuplet->ReadDurationRatio(tuplet); + vrvTuplet->ReadNumberplacement(tuplet); + vrvTuplet->ReadTupletVis(tuplet); AddLayerElement(parent, vrvTuplet); diff --git a/src/tuplet.cpp b/src/tuplet.cpp index c55c1f8dfed..f3bf351c9a4 100644 --- a/src/tuplet.cpp +++ b/src/tuplet.cpp @@ -16,9 +16,13 @@ namespace vrv { Tuplet::Tuplet(): LayerElement("tuplet-"), ObjectListInterface(), - AttDurationRatio() + AttDurationRatio(), + AttNumberplacement(), + AttTupletVis() { RegisterAttClass(ATT_DURATIONRATIO); + RegisterAttClass(ATT_NUMBERPLACEMENT); + RegisterAttClass(ATT_TUPLETVIS); Reset(); } @@ -31,6 +35,8 @@ void Tuplet::Reset() { LayerElement::Reset(); ResetDurationRatio(); + ResetNumberplacement(); + ResetTupletVis(); } void Tuplet::AddLayerElement(LayerElement *element) { From 5d207184228a7016c67b7a2760e853bf7cd1767e Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sun, 16 Aug 2015 22:44:12 +0200 Subject: [PATCH 063/114] Adding SMuFL glyphs --- data/Bravura.xml | 35 + data/Bravura/E045-dalSegno.xml | 5 + data/Bravura/E046-daCapo.xml | 5 + data/Bravura/E047-segno.xml | 5 + data/Bravura/E048-coda.xml | 5 + data/Bravura/E04B-segnoSerpent2.xml | 5 + data/Bravura/E220-tremolo1.xml | 5 + data/Bravura/E221-tremolo2.xml | 5 + data/Bravura/E222-tremolo3.xml | 5 + data/Bravura/E223-tremolo4.xml | 5 + data/Bravura/E224-tremolo5.xml | 5 + data/Bravura/E4A0-articAccentAbove.xml | 5 + data/Bravura/E4A1-articAccentBelow.xml | 5 + .../E4A8-articStaccatissimoWedgeAbove.xml | 5 + .../E4A9-articStaccatissimoWedgeBelow.xml | 5 + data/Bravura/E4AC-articMarcatoAbove.xml | 5 + data/Bravura/E4AD-articMarcatoBelow.xml | 5 + data/Bravura/E500-repeat1Bar.xml | 5 + data/Bravura/E520-dynamicPiano.xml | 5 + data/Bravura/E521-dynamicMezzo.xml | 5 + data/Bravura/E522-dynamicForte.xml | 5 + data/Bravura/E523-dynamicRinforzando.xml | 5 + data/Bravura/E524-dynamicSforzando.xml | 5 + data/Bravura/E525-dynamicZ.xml | 5 + data/Bravura/E52F-dynamicFF.xml | 5 + data/Bravura/E530-dynamicFFF.xml | 5 + data/Bravura/E531-dynamicFFFF.xml | 5 + data/Bravura/E532-dynamicFFFFF.xml | 5 + data/Bravura/E567-ornamentTurn.xml | 5 + data/Bravura/E568-ornamentTurnInverted.xml | 5 + data/Bravura/E56A-ornamentTurnUp.xml | 5 + data/Bravura/E56B-ornamentTurnUpS.xml | 5 + data/Bravura/E56E-ornamentTremblement.xml | 5 + data/Bravura/E650-keyboardPedalPed.xml | 5 + data/Bravura/E655-keyboardPedalUp.xml | 5 + data/Bravura/E88A-tupletColon.xml | 5 + data/Gootville.xml | 35 + data/Gootville/E045-dalSegno.xml | 5 + data/Gootville/E046-daCapo.xml | 5 + data/Gootville/E047-segno.xml | 5 + data/Gootville/E048-coda.xml | 5 + data/Gootville/E04B-segnoSerpent2.xml | 5 + data/Gootville/E220-tremolo1.xml | 5 + data/Gootville/E221-tremolo2.xml | 5 + data/Gootville/E222-tremolo3.xml | 5 + data/Gootville/E223-tremolo4.xml | 5 + data/Gootville/E224-tremolo5.xml | 5 + data/Gootville/E4A0-articAccentAbove.xml | 5 + data/Gootville/E4A1-articAccentBelow.xml | 5 + .../E4A8-articStaccatissimoWedgeAbove.xml | 5 + .../E4A9-articStaccatissimoWedgeBelow.xml | 5 + data/Gootville/E4AC-articMarcatoAbove.xml | 5 + data/Gootville/E4AD-articMarcatoBelow.xml | 5 + data/Gootville/E500-repeat1Bar.xml | 5 + data/Gootville/E520-dynamicPiano.xml | 5 + data/Gootville/E521-dynamicMezzo.xml | 5 + data/Gootville/E522-dynamicForte.xml | 5 + data/Gootville/E523-dynamicRinforzando.xml | 5 + data/Gootville/E524-dynamicSforzando.xml | 5 + data/Gootville/E525-dynamicZ.xml | 5 + data/Gootville/E52F-dynamicFF.xml | 5 + data/Gootville/E530-dynamicFFF.xml | 5 + data/Gootville/E531-dynamicFFFF.xml | 5 + data/Gootville/E532-dynamicFFFFF.xml | 5 + data/Gootville/E567-ornamentTurn.xml | 5 + data/Gootville/E568-ornamentTurnInverted.xml | 5 + data/Gootville/E56A-ornamentTurnUp.xml | 5 + data/Gootville/E56B-ornamentTurnUpS.xml | 5 + data/Gootville/E56E-ornamentTremblement.xml | 5 + data/Gootville/E650-keyboardPedalPed.xml | 5 + data/Gootville/E655-keyboardPedalUp.xml | 5 + data/Gootville/E88A-tupletColon.xml | 5 + data/Leipzig.xml | 35 + data/Leipzig/E045-dalSegno.xml | 5 + data/Leipzig/E046-daCapo.xml | 5 + data/Leipzig/E047-segno.xml | 5 + data/Leipzig/E048-coda.xml | 5 + data/Leipzig/E04B-segnoSerpent2.xml | 5 + data/Leipzig/E220-tremolo1.xml | 5 + data/Leipzig/E221-tremolo2.xml | 5 + data/Leipzig/E222-tremolo3.xml | 5 + data/Leipzig/E223-tremolo4.xml | 5 + data/Leipzig/E224-tremolo5.xml | 5 + data/Leipzig/E4A0-articAccentAbove.xml | 5 + data/Leipzig/E4A1-articAccentBelow.xml | 5 + .../E4A8-articStaccatissimoWedgeAbove.xml | 5 + .../E4A9-articStaccatissimoWedgeBelow.xml | 5 + data/Leipzig/E4AC-articMarcatoAbove.xml | 5 + data/Leipzig/E4AD-articMarcatoBelow.xml | 5 + data/Leipzig/E500-repeat1Bar.xml | 5 + data/Leipzig/E520-dynamicPiano.xml | 5 + data/Leipzig/E521-dynamicMezzo.xml | 5 + data/Leipzig/E522-dynamicForte.xml | 5 + data/Leipzig/E523-dynamicRinforzando.xml | 5 + data/Leipzig/E524-dynamicSforzando.xml | 5 + data/Leipzig/E525-dynamicZ.xml | 5 + data/Leipzig/E52F-dynamicFF.xml | 5 + data/Leipzig/E530-dynamicFFF.xml | 5 + data/Leipzig/E531-dynamicFFFF.xml | 5 + data/Leipzig/E532-dynamicFFFFF.xml | 5 + data/Leipzig/E567-ornamentTurn.xml | 5 + data/Leipzig/E568-ornamentTurnInverted.xml | 5 + data/Leipzig/E56A-ornamentTurnUp.xml | 5 + data/Leipzig/E56B-ornamentTurnUpS.xml | 5 + data/Leipzig/E56E-ornamentTremblement.xml | 5 + data/Leipzig/E650-keyboardPedalPed.xml | 5 + data/Leipzig/E655-keyboardPedalUp.xml | 5 + data/Leipzig/E88A-tupletColon.xml | 5 + fonts/{Leipzig-5.0.sfd => Leipzig-5.1.sfd} | 2246 ++++++++++++++++- fonts/Leipzig.svg | 217 +- fonts/supported.xsl | 70 +- include/vrv/smufl.h | 37 +- 112 files changed, 3065 insertions(+), 135 deletions(-) create mode 100644 data/Bravura/E045-dalSegno.xml create mode 100644 data/Bravura/E046-daCapo.xml create mode 100644 data/Bravura/E047-segno.xml create mode 100644 data/Bravura/E048-coda.xml create mode 100644 data/Bravura/E04B-segnoSerpent2.xml create mode 100644 data/Bravura/E220-tremolo1.xml create mode 100644 data/Bravura/E221-tremolo2.xml create mode 100644 data/Bravura/E222-tremolo3.xml create mode 100644 data/Bravura/E223-tremolo4.xml create mode 100644 data/Bravura/E224-tremolo5.xml create mode 100644 data/Bravura/E4A0-articAccentAbove.xml create mode 100644 data/Bravura/E4A1-articAccentBelow.xml create mode 100644 data/Bravura/E4A8-articStaccatissimoWedgeAbove.xml create mode 100644 data/Bravura/E4A9-articStaccatissimoWedgeBelow.xml create mode 100644 data/Bravura/E4AC-articMarcatoAbove.xml create mode 100644 data/Bravura/E4AD-articMarcatoBelow.xml create mode 100644 data/Bravura/E500-repeat1Bar.xml create mode 100644 data/Bravura/E520-dynamicPiano.xml create mode 100644 data/Bravura/E521-dynamicMezzo.xml create mode 100644 data/Bravura/E522-dynamicForte.xml create mode 100644 data/Bravura/E523-dynamicRinforzando.xml create mode 100644 data/Bravura/E524-dynamicSforzando.xml create mode 100644 data/Bravura/E525-dynamicZ.xml create mode 100644 data/Bravura/E52F-dynamicFF.xml create mode 100644 data/Bravura/E530-dynamicFFF.xml create mode 100644 data/Bravura/E531-dynamicFFFF.xml create mode 100644 data/Bravura/E532-dynamicFFFFF.xml create mode 100644 data/Bravura/E567-ornamentTurn.xml create mode 100644 data/Bravura/E568-ornamentTurnInverted.xml create mode 100644 data/Bravura/E56A-ornamentTurnUp.xml create mode 100644 data/Bravura/E56B-ornamentTurnUpS.xml create mode 100644 data/Bravura/E56E-ornamentTremblement.xml create mode 100644 data/Bravura/E650-keyboardPedalPed.xml create mode 100644 data/Bravura/E655-keyboardPedalUp.xml create mode 100644 data/Bravura/E88A-tupletColon.xml create mode 100644 data/Gootville/E045-dalSegno.xml create mode 100644 data/Gootville/E046-daCapo.xml create mode 100644 data/Gootville/E047-segno.xml create mode 100644 data/Gootville/E048-coda.xml create mode 100644 data/Gootville/E04B-segnoSerpent2.xml create mode 100644 data/Gootville/E220-tremolo1.xml create mode 100644 data/Gootville/E221-tremolo2.xml create mode 100644 data/Gootville/E222-tremolo3.xml create mode 100644 data/Gootville/E223-tremolo4.xml create mode 100644 data/Gootville/E224-tremolo5.xml create mode 100644 data/Gootville/E4A0-articAccentAbove.xml create mode 100644 data/Gootville/E4A1-articAccentBelow.xml create mode 100644 data/Gootville/E4A8-articStaccatissimoWedgeAbove.xml create mode 100644 data/Gootville/E4A9-articStaccatissimoWedgeBelow.xml create mode 100644 data/Gootville/E4AC-articMarcatoAbove.xml create mode 100644 data/Gootville/E4AD-articMarcatoBelow.xml create mode 100644 data/Gootville/E500-repeat1Bar.xml create mode 100644 data/Gootville/E520-dynamicPiano.xml create mode 100644 data/Gootville/E521-dynamicMezzo.xml create mode 100644 data/Gootville/E522-dynamicForte.xml create mode 100644 data/Gootville/E523-dynamicRinforzando.xml create mode 100644 data/Gootville/E524-dynamicSforzando.xml create mode 100644 data/Gootville/E525-dynamicZ.xml create mode 100644 data/Gootville/E52F-dynamicFF.xml create mode 100644 data/Gootville/E530-dynamicFFF.xml create mode 100644 data/Gootville/E531-dynamicFFFF.xml create mode 100644 data/Gootville/E532-dynamicFFFFF.xml create mode 100644 data/Gootville/E567-ornamentTurn.xml create mode 100644 data/Gootville/E568-ornamentTurnInverted.xml create mode 100644 data/Gootville/E56A-ornamentTurnUp.xml create mode 100644 data/Gootville/E56B-ornamentTurnUpS.xml create mode 100644 data/Gootville/E56E-ornamentTremblement.xml create mode 100644 data/Gootville/E650-keyboardPedalPed.xml create mode 100644 data/Gootville/E655-keyboardPedalUp.xml create mode 100644 data/Gootville/E88A-tupletColon.xml create mode 100644 data/Leipzig/E045-dalSegno.xml create mode 100644 data/Leipzig/E046-daCapo.xml create mode 100644 data/Leipzig/E047-segno.xml create mode 100644 data/Leipzig/E048-coda.xml create mode 100644 data/Leipzig/E04B-segnoSerpent2.xml create mode 100644 data/Leipzig/E220-tremolo1.xml create mode 100644 data/Leipzig/E221-tremolo2.xml create mode 100644 data/Leipzig/E222-tremolo3.xml create mode 100644 data/Leipzig/E223-tremolo4.xml create mode 100644 data/Leipzig/E224-tremolo5.xml create mode 100644 data/Leipzig/E4A0-articAccentAbove.xml create mode 100644 data/Leipzig/E4A1-articAccentBelow.xml create mode 100644 data/Leipzig/E4A8-articStaccatissimoWedgeAbove.xml create mode 100644 data/Leipzig/E4A9-articStaccatissimoWedgeBelow.xml create mode 100644 data/Leipzig/E4AC-articMarcatoAbove.xml create mode 100644 data/Leipzig/E4AD-articMarcatoBelow.xml create mode 100644 data/Leipzig/E500-repeat1Bar.xml create mode 100644 data/Leipzig/E520-dynamicPiano.xml create mode 100644 data/Leipzig/E521-dynamicMezzo.xml create mode 100644 data/Leipzig/E522-dynamicForte.xml create mode 100644 data/Leipzig/E523-dynamicRinforzando.xml create mode 100644 data/Leipzig/E524-dynamicSforzando.xml create mode 100644 data/Leipzig/E525-dynamicZ.xml create mode 100644 data/Leipzig/E52F-dynamicFF.xml create mode 100644 data/Leipzig/E530-dynamicFFF.xml create mode 100644 data/Leipzig/E531-dynamicFFFF.xml create mode 100644 data/Leipzig/E532-dynamicFFFFF.xml create mode 100644 data/Leipzig/E567-ornamentTurn.xml create mode 100644 data/Leipzig/E568-ornamentTurnInverted.xml create mode 100644 data/Leipzig/E56A-ornamentTurnUp.xml create mode 100644 data/Leipzig/E56B-ornamentTurnUpS.xml create mode 100644 data/Leipzig/E56E-ornamentTremblement.xml create mode 100644 data/Leipzig/E650-keyboardPedalPed.xml create mode 100644 data/Leipzig/E655-keyboardPedalUp.xml create mode 100644 data/Leipzig/E88A-tupletColon.xml rename fonts/{Leipzig-5.0.sfd => Leipzig-5.1.sfd} (57%) diff --git a/data/Bravura.xml b/data/Bravura.xml index ff2028fcf79..b45cd67fbeb 100644 --- a/data/Bravura.xml +++ b/data/Bravura.xml @@ -1,7 +1,16 @@ + + + + + + + + + @@ -30,6 +39,11 @@ + + + + + @@ -44,6 +58,12 @@ + + + + + + @@ -52,9 +72,23 @@ + + + + + + + + + + + + + + @@ -65,4 +99,5 @@ + diff --git a/data/Bravura/E045-dalSegno.xml b/data/Bravura/E045-dalSegno.xml new file mode 100644 index 00000000000..9c35229c236 --- /dev/null +++ b/data/Bravura/E045-dalSegno.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E046-daCapo.xml b/data/Bravura/E046-daCapo.xml new file mode 100644 index 00000000000..6f18f5d64b7 --- /dev/null +++ b/data/Bravura/E046-daCapo.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E047-segno.xml b/data/Bravura/E047-segno.xml new file mode 100644 index 00000000000..bc3f16138a9 --- /dev/null +++ b/data/Bravura/E047-segno.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E048-coda.xml b/data/Bravura/E048-coda.xml new file mode 100644 index 00000000000..1bee2e57bb8 --- /dev/null +++ b/data/Bravura/E048-coda.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E04B-segnoSerpent2.xml b/data/Bravura/E04B-segnoSerpent2.xml new file mode 100644 index 00000000000..c0502978f41 --- /dev/null +++ b/data/Bravura/E04B-segnoSerpent2.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E220-tremolo1.xml b/data/Bravura/E220-tremolo1.xml new file mode 100644 index 00000000000..e72e6af77d3 --- /dev/null +++ b/data/Bravura/E220-tremolo1.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E221-tremolo2.xml b/data/Bravura/E221-tremolo2.xml new file mode 100644 index 00000000000..5f84165499a --- /dev/null +++ b/data/Bravura/E221-tremolo2.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E222-tremolo3.xml b/data/Bravura/E222-tremolo3.xml new file mode 100644 index 00000000000..734b6c4130f --- /dev/null +++ b/data/Bravura/E222-tremolo3.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E223-tremolo4.xml b/data/Bravura/E223-tremolo4.xml new file mode 100644 index 00000000000..8fa5e93d6e5 --- /dev/null +++ b/data/Bravura/E223-tremolo4.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E224-tremolo5.xml b/data/Bravura/E224-tremolo5.xml new file mode 100644 index 00000000000..0c586e2cf87 --- /dev/null +++ b/data/Bravura/E224-tremolo5.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E4A0-articAccentAbove.xml b/data/Bravura/E4A0-articAccentAbove.xml new file mode 100644 index 00000000000..33458b06504 --- /dev/null +++ b/data/Bravura/E4A0-articAccentAbove.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E4A1-articAccentBelow.xml b/data/Bravura/E4A1-articAccentBelow.xml new file mode 100644 index 00000000000..37cab26c05f --- /dev/null +++ b/data/Bravura/E4A1-articAccentBelow.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E4A8-articStaccatissimoWedgeAbove.xml b/data/Bravura/E4A8-articStaccatissimoWedgeAbove.xml new file mode 100644 index 00000000000..e19121edfa1 --- /dev/null +++ b/data/Bravura/E4A8-articStaccatissimoWedgeAbove.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E4A9-articStaccatissimoWedgeBelow.xml b/data/Bravura/E4A9-articStaccatissimoWedgeBelow.xml new file mode 100644 index 00000000000..eab7522c6bf --- /dev/null +++ b/data/Bravura/E4A9-articStaccatissimoWedgeBelow.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E4AC-articMarcatoAbove.xml b/data/Bravura/E4AC-articMarcatoAbove.xml new file mode 100644 index 00000000000..b8effed2254 --- /dev/null +++ b/data/Bravura/E4AC-articMarcatoAbove.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E4AD-articMarcatoBelow.xml b/data/Bravura/E4AD-articMarcatoBelow.xml new file mode 100644 index 00000000000..fdfbef6f9c9 --- /dev/null +++ b/data/Bravura/E4AD-articMarcatoBelow.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E500-repeat1Bar.xml b/data/Bravura/E500-repeat1Bar.xml new file mode 100644 index 00000000000..cd02f6c7168 --- /dev/null +++ b/data/Bravura/E500-repeat1Bar.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E520-dynamicPiano.xml b/data/Bravura/E520-dynamicPiano.xml new file mode 100644 index 00000000000..3ab48fe6114 --- /dev/null +++ b/data/Bravura/E520-dynamicPiano.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E521-dynamicMezzo.xml b/data/Bravura/E521-dynamicMezzo.xml new file mode 100644 index 00000000000..c05092504b7 --- /dev/null +++ b/data/Bravura/E521-dynamicMezzo.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E522-dynamicForte.xml b/data/Bravura/E522-dynamicForte.xml new file mode 100644 index 00000000000..94799153f67 --- /dev/null +++ b/data/Bravura/E522-dynamicForte.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E523-dynamicRinforzando.xml b/data/Bravura/E523-dynamicRinforzando.xml new file mode 100644 index 00000000000..58502b7f27e --- /dev/null +++ b/data/Bravura/E523-dynamicRinforzando.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E524-dynamicSforzando.xml b/data/Bravura/E524-dynamicSforzando.xml new file mode 100644 index 00000000000..4b64fa9b5a1 --- /dev/null +++ b/data/Bravura/E524-dynamicSforzando.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E525-dynamicZ.xml b/data/Bravura/E525-dynamicZ.xml new file mode 100644 index 00000000000..52f996cc493 --- /dev/null +++ b/data/Bravura/E525-dynamicZ.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E52F-dynamicFF.xml b/data/Bravura/E52F-dynamicFF.xml new file mode 100644 index 00000000000..cea1089f503 --- /dev/null +++ b/data/Bravura/E52F-dynamicFF.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E530-dynamicFFF.xml b/data/Bravura/E530-dynamicFFF.xml new file mode 100644 index 00000000000..2b1dd0382b3 --- /dev/null +++ b/data/Bravura/E530-dynamicFFF.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E531-dynamicFFFF.xml b/data/Bravura/E531-dynamicFFFF.xml new file mode 100644 index 00000000000..de6e2d2273e --- /dev/null +++ b/data/Bravura/E531-dynamicFFFF.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E532-dynamicFFFFF.xml b/data/Bravura/E532-dynamicFFFFF.xml new file mode 100644 index 00000000000..ffc4559bfc3 --- /dev/null +++ b/data/Bravura/E532-dynamicFFFFF.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E567-ornamentTurn.xml b/data/Bravura/E567-ornamentTurn.xml new file mode 100644 index 00000000000..69295fdb8fd --- /dev/null +++ b/data/Bravura/E567-ornamentTurn.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E568-ornamentTurnInverted.xml b/data/Bravura/E568-ornamentTurnInverted.xml new file mode 100644 index 00000000000..3ecf103c832 --- /dev/null +++ b/data/Bravura/E568-ornamentTurnInverted.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E56A-ornamentTurnUp.xml b/data/Bravura/E56A-ornamentTurnUp.xml new file mode 100644 index 00000000000..75660714ef2 --- /dev/null +++ b/data/Bravura/E56A-ornamentTurnUp.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E56B-ornamentTurnUpS.xml b/data/Bravura/E56B-ornamentTurnUpS.xml new file mode 100644 index 00000000000..26aa539c869 --- /dev/null +++ b/data/Bravura/E56B-ornamentTurnUpS.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E56E-ornamentTremblement.xml b/data/Bravura/E56E-ornamentTremblement.xml new file mode 100644 index 00000000000..e8e8b586024 --- /dev/null +++ b/data/Bravura/E56E-ornamentTremblement.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E650-keyboardPedalPed.xml b/data/Bravura/E650-keyboardPedalPed.xml new file mode 100644 index 00000000000..d5b8248a7f7 --- /dev/null +++ b/data/Bravura/E650-keyboardPedalPed.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E655-keyboardPedalUp.xml b/data/Bravura/E655-keyboardPedalUp.xml new file mode 100644 index 00000000000..980069a2606 --- /dev/null +++ b/data/Bravura/E655-keyboardPedalUp.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Bravura/E88A-tupletColon.xml b/data/Bravura/E88A-tupletColon.xml new file mode 100644 index 00000000000..7c9bfb87ba3 --- /dev/null +++ b/data/Bravura/E88A-tupletColon.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville.xml b/data/Gootville.xml index fddb8a23083..9f702efcb23 100644 --- a/data/Gootville.xml +++ b/data/Gootville.xml @@ -2,6 +2,11 @@ + + + + + @@ -30,6 +35,11 @@ + + + + + @@ -44,6 +54,12 @@ + + + + + + @@ -52,9 +68,27 @@ + + + + + + + + + + + + + + + + + + @@ -65,4 +99,5 @@ + diff --git a/data/Gootville/E045-dalSegno.xml b/data/Gootville/E045-dalSegno.xml new file mode 100644 index 00000000000..f794a235dfc --- /dev/null +++ b/data/Gootville/E045-dalSegno.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E046-daCapo.xml b/data/Gootville/E046-daCapo.xml new file mode 100644 index 00000000000..27d21c99259 --- /dev/null +++ b/data/Gootville/E046-daCapo.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E047-segno.xml b/data/Gootville/E047-segno.xml new file mode 100644 index 00000000000..4061ccf9251 --- /dev/null +++ b/data/Gootville/E047-segno.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E048-coda.xml b/data/Gootville/E048-coda.xml new file mode 100644 index 00000000000..f33293d7cd2 --- /dev/null +++ b/data/Gootville/E048-coda.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E04B-segnoSerpent2.xml b/data/Gootville/E04B-segnoSerpent2.xml new file mode 100644 index 00000000000..e87dd8c6170 --- /dev/null +++ b/data/Gootville/E04B-segnoSerpent2.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E220-tremolo1.xml b/data/Gootville/E220-tremolo1.xml new file mode 100644 index 00000000000..5e941e51d68 --- /dev/null +++ b/data/Gootville/E220-tremolo1.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E221-tremolo2.xml b/data/Gootville/E221-tremolo2.xml new file mode 100644 index 00000000000..a74e2fa0516 --- /dev/null +++ b/data/Gootville/E221-tremolo2.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E222-tremolo3.xml b/data/Gootville/E222-tremolo3.xml new file mode 100644 index 00000000000..6133afaaafd --- /dev/null +++ b/data/Gootville/E222-tremolo3.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E223-tremolo4.xml b/data/Gootville/E223-tremolo4.xml new file mode 100644 index 00000000000..586077210ee --- /dev/null +++ b/data/Gootville/E223-tremolo4.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E224-tremolo5.xml b/data/Gootville/E224-tremolo5.xml new file mode 100644 index 00000000000..f017db380eb --- /dev/null +++ b/data/Gootville/E224-tremolo5.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E4A0-articAccentAbove.xml b/data/Gootville/E4A0-articAccentAbove.xml new file mode 100644 index 00000000000..700da5dd8e9 --- /dev/null +++ b/data/Gootville/E4A0-articAccentAbove.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E4A1-articAccentBelow.xml b/data/Gootville/E4A1-articAccentBelow.xml new file mode 100644 index 00000000000..e9845d12222 --- /dev/null +++ b/data/Gootville/E4A1-articAccentBelow.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E4A8-articStaccatissimoWedgeAbove.xml b/data/Gootville/E4A8-articStaccatissimoWedgeAbove.xml new file mode 100644 index 00000000000..371dd5cdde8 --- /dev/null +++ b/data/Gootville/E4A8-articStaccatissimoWedgeAbove.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E4A9-articStaccatissimoWedgeBelow.xml b/data/Gootville/E4A9-articStaccatissimoWedgeBelow.xml new file mode 100644 index 00000000000..da7cab6d00a --- /dev/null +++ b/data/Gootville/E4A9-articStaccatissimoWedgeBelow.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E4AC-articMarcatoAbove.xml b/data/Gootville/E4AC-articMarcatoAbove.xml new file mode 100644 index 00000000000..90ab59891b3 --- /dev/null +++ b/data/Gootville/E4AC-articMarcatoAbove.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E4AD-articMarcatoBelow.xml b/data/Gootville/E4AD-articMarcatoBelow.xml new file mode 100644 index 00000000000..e3af557e0e1 --- /dev/null +++ b/data/Gootville/E4AD-articMarcatoBelow.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E500-repeat1Bar.xml b/data/Gootville/E500-repeat1Bar.xml new file mode 100644 index 00000000000..4386d7270fb --- /dev/null +++ b/data/Gootville/E500-repeat1Bar.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E520-dynamicPiano.xml b/data/Gootville/E520-dynamicPiano.xml new file mode 100644 index 00000000000..cc966f88d66 --- /dev/null +++ b/data/Gootville/E520-dynamicPiano.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E521-dynamicMezzo.xml b/data/Gootville/E521-dynamicMezzo.xml new file mode 100644 index 00000000000..e8bae288588 --- /dev/null +++ b/data/Gootville/E521-dynamicMezzo.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E522-dynamicForte.xml b/data/Gootville/E522-dynamicForte.xml new file mode 100644 index 00000000000..b2a4a8c655e --- /dev/null +++ b/data/Gootville/E522-dynamicForte.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E523-dynamicRinforzando.xml b/data/Gootville/E523-dynamicRinforzando.xml new file mode 100644 index 00000000000..19700619d09 --- /dev/null +++ b/data/Gootville/E523-dynamicRinforzando.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E524-dynamicSforzando.xml b/data/Gootville/E524-dynamicSforzando.xml new file mode 100644 index 00000000000..75d9fe17d6f --- /dev/null +++ b/data/Gootville/E524-dynamicSforzando.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E525-dynamicZ.xml b/data/Gootville/E525-dynamicZ.xml new file mode 100644 index 00000000000..f0e1ea82475 --- /dev/null +++ b/data/Gootville/E525-dynamicZ.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E52F-dynamicFF.xml b/data/Gootville/E52F-dynamicFF.xml new file mode 100644 index 00000000000..6d55ce3e13a --- /dev/null +++ b/data/Gootville/E52F-dynamicFF.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E530-dynamicFFF.xml b/data/Gootville/E530-dynamicFFF.xml new file mode 100644 index 00000000000..71131190ea6 --- /dev/null +++ b/data/Gootville/E530-dynamicFFF.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E531-dynamicFFFF.xml b/data/Gootville/E531-dynamicFFFF.xml new file mode 100644 index 00000000000..bae0440d82a --- /dev/null +++ b/data/Gootville/E531-dynamicFFFF.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E532-dynamicFFFFF.xml b/data/Gootville/E532-dynamicFFFFF.xml new file mode 100644 index 00000000000..8fa45838c6b --- /dev/null +++ b/data/Gootville/E532-dynamicFFFFF.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E567-ornamentTurn.xml b/data/Gootville/E567-ornamentTurn.xml new file mode 100644 index 00000000000..b77cc10a671 --- /dev/null +++ b/data/Gootville/E567-ornamentTurn.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E568-ornamentTurnInverted.xml b/data/Gootville/E568-ornamentTurnInverted.xml new file mode 100644 index 00000000000..015d27b223e --- /dev/null +++ b/data/Gootville/E568-ornamentTurnInverted.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E56A-ornamentTurnUp.xml b/data/Gootville/E56A-ornamentTurnUp.xml new file mode 100644 index 00000000000..4488fee377b --- /dev/null +++ b/data/Gootville/E56A-ornamentTurnUp.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E56B-ornamentTurnUpS.xml b/data/Gootville/E56B-ornamentTurnUpS.xml new file mode 100644 index 00000000000..376003449df --- /dev/null +++ b/data/Gootville/E56B-ornamentTurnUpS.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E56E-ornamentTremblement.xml b/data/Gootville/E56E-ornamentTremblement.xml new file mode 100644 index 00000000000..934b38d80f7 --- /dev/null +++ b/data/Gootville/E56E-ornamentTremblement.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E650-keyboardPedalPed.xml b/data/Gootville/E650-keyboardPedalPed.xml new file mode 100644 index 00000000000..aae3a660237 --- /dev/null +++ b/data/Gootville/E650-keyboardPedalPed.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E655-keyboardPedalUp.xml b/data/Gootville/E655-keyboardPedalUp.xml new file mode 100644 index 00000000000..204d14fbad8 --- /dev/null +++ b/data/Gootville/E655-keyboardPedalUp.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Gootville/E88A-tupletColon.xml b/data/Gootville/E88A-tupletColon.xml new file mode 100644 index 00000000000..519dbff7d15 --- /dev/null +++ b/data/Gootville/E88A-tupletColon.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig.xml b/data/Leipzig.xml index ece8a6d7bcf..8637a471181 100644 --- a/data/Leipzig.xml +++ b/data/Leipzig.xml @@ -65,4 +65,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/Leipzig/E045-dalSegno.xml b/data/Leipzig/E045-dalSegno.xml new file mode 100644 index 00000000000..81bdc228478 --- /dev/null +++ b/data/Leipzig/E045-dalSegno.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E046-daCapo.xml b/data/Leipzig/E046-daCapo.xml new file mode 100644 index 00000000000..539d917a12d --- /dev/null +++ b/data/Leipzig/E046-daCapo.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E047-segno.xml b/data/Leipzig/E047-segno.xml new file mode 100644 index 00000000000..4450570cf0a --- /dev/null +++ b/data/Leipzig/E047-segno.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E048-coda.xml b/data/Leipzig/E048-coda.xml new file mode 100644 index 00000000000..acde03241b9 --- /dev/null +++ b/data/Leipzig/E048-coda.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E04B-segnoSerpent2.xml b/data/Leipzig/E04B-segnoSerpent2.xml new file mode 100644 index 00000000000..7f84b40b8e4 --- /dev/null +++ b/data/Leipzig/E04B-segnoSerpent2.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E220-tremolo1.xml b/data/Leipzig/E220-tremolo1.xml new file mode 100644 index 00000000000..2bbb7989734 --- /dev/null +++ b/data/Leipzig/E220-tremolo1.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E221-tremolo2.xml b/data/Leipzig/E221-tremolo2.xml new file mode 100644 index 00000000000..3d12fd2e87a --- /dev/null +++ b/data/Leipzig/E221-tremolo2.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E222-tremolo3.xml b/data/Leipzig/E222-tremolo3.xml new file mode 100644 index 00000000000..1b4396c45d3 --- /dev/null +++ b/data/Leipzig/E222-tremolo3.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E223-tremolo4.xml b/data/Leipzig/E223-tremolo4.xml new file mode 100644 index 00000000000..957aa60c438 --- /dev/null +++ b/data/Leipzig/E223-tremolo4.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E224-tremolo5.xml b/data/Leipzig/E224-tremolo5.xml new file mode 100644 index 00000000000..48067df4911 --- /dev/null +++ b/data/Leipzig/E224-tremolo5.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E4A0-articAccentAbove.xml b/data/Leipzig/E4A0-articAccentAbove.xml new file mode 100644 index 00000000000..77cb8c84bd2 --- /dev/null +++ b/data/Leipzig/E4A0-articAccentAbove.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E4A1-articAccentBelow.xml b/data/Leipzig/E4A1-articAccentBelow.xml new file mode 100644 index 00000000000..0cb47b6db76 --- /dev/null +++ b/data/Leipzig/E4A1-articAccentBelow.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E4A8-articStaccatissimoWedgeAbove.xml b/data/Leipzig/E4A8-articStaccatissimoWedgeAbove.xml new file mode 100644 index 00000000000..8598e5b49d3 --- /dev/null +++ b/data/Leipzig/E4A8-articStaccatissimoWedgeAbove.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E4A9-articStaccatissimoWedgeBelow.xml b/data/Leipzig/E4A9-articStaccatissimoWedgeBelow.xml new file mode 100644 index 00000000000..879a755bd6e --- /dev/null +++ b/data/Leipzig/E4A9-articStaccatissimoWedgeBelow.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E4AC-articMarcatoAbove.xml b/data/Leipzig/E4AC-articMarcatoAbove.xml new file mode 100644 index 00000000000..caf76a51928 --- /dev/null +++ b/data/Leipzig/E4AC-articMarcatoAbove.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E4AD-articMarcatoBelow.xml b/data/Leipzig/E4AD-articMarcatoBelow.xml new file mode 100644 index 00000000000..10176992183 --- /dev/null +++ b/data/Leipzig/E4AD-articMarcatoBelow.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E500-repeat1Bar.xml b/data/Leipzig/E500-repeat1Bar.xml new file mode 100644 index 00000000000..8ce31697b37 --- /dev/null +++ b/data/Leipzig/E500-repeat1Bar.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E520-dynamicPiano.xml b/data/Leipzig/E520-dynamicPiano.xml new file mode 100644 index 00000000000..ff28465345f --- /dev/null +++ b/data/Leipzig/E520-dynamicPiano.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E521-dynamicMezzo.xml b/data/Leipzig/E521-dynamicMezzo.xml new file mode 100644 index 00000000000..d01d90c0772 --- /dev/null +++ b/data/Leipzig/E521-dynamicMezzo.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E522-dynamicForte.xml b/data/Leipzig/E522-dynamicForte.xml new file mode 100644 index 00000000000..e4ddff87ee3 --- /dev/null +++ b/data/Leipzig/E522-dynamicForte.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E523-dynamicRinforzando.xml b/data/Leipzig/E523-dynamicRinforzando.xml new file mode 100644 index 00000000000..3a43155938d --- /dev/null +++ b/data/Leipzig/E523-dynamicRinforzando.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E524-dynamicSforzando.xml b/data/Leipzig/E524-dynamicSforzando.xml new file mode 100644 index 00000000000..a7f901ee44c --- /dev/null +++ b/data/Leipzig/E524-dynamicSforzando.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E525-dynamicZ.xml b/data/Leipzig/E525-dynamicZ.xml new file mode 100644 index 00000000000..5a4d7648ef2 --- /dev/null +++ b/data/Leipzig/E525-dynamicZ.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E52F-dynamicFF.xml b/data/Leipzig/E52F-dynamicFF.xml new file mode 100644 index 00000000000..6e2ca7f825e --- /dev/null +++ b/data/Leipzig/E52F-dynamicFF.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E530-dynamicFFF.xml b/data/Leipzig/E530-dynamicFFF.xml new file mode 100644 index 00000000000..b3bcbe1f970 --- /dev/null +++ b/data/Leipzig/E530-dynamicFFF.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E531-dynamicFFFF.xml b/data/Leipzig/E531-dynamicFFFF.xml new file mode 100644 index 00000000000..a57983caa2f --- /dev/null +++ b/data/Leipzig/E531-dynamicFFFF.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E532-dynamicFFFFF.xml b/data/Leipzig/E532-dynamicFFFFF.xml new file mode 100644 index 00000000000..6ef88988cd3 --- /dev/null +++ b/data/Leipzig/E532-dynamicFFFFF.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E567-ornamentTurn.xml b/data/Leipzig/E567-ornamentTurn.xml new file mode 100644 index 00000000000..f0df038a070 --- /dev/null +++ b/data/Leipzig/E567-ornamentTurn.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E568-ornamentTurnInverted.xml b/data/Leipzig/E568-ornamentTurnInverted.xml new file mode 100644 index 00000000000..1509b6c14fe --- /dev/null +++ b/data/Leipzig/E568-ornamentTurnInverted.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E56A-ornamentTurnUp.xml b/data/Leipzig/E56A-ornamentTurnUp.xml new file mode 100644 index 00000000000..fce89b199ad --- /dev/null +++ b/data/Leipzig/E56A-ornamentTurnUp.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E56B-ornamentTurnUpS.xml b/data/Leipzig/E56B-ornamentTurnUpS.xml new file mode 100644 index 00000000000..c1b8888e327 --- /dev/null +++ b/data/Leipzig/E56B-ornamentTurnUpS.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E56E-ornamentTremblement.xml b/data/Leipzig/E56E-ornamentTremblement.xml new file mode 100644 index 00000000000..d485d4253fb --- /dev/null +++ b/data/Leipzig/E56E-ornamentTremblement.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E650-keyboardPedalPed.xml b/data/Leipzig/E650-keyboardPedalPed.xml new file mode 100644 index 00000000000..6bce15eb44a --- /dev/null +++ b/data/Leipzig/E650-keyboardPedalPed.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E655-keyboardPedalUp.xml b/data/Leipzig/E655-keyboardPedalUp.xml new file mode 100644 index 00000000000..e6c395cec15 --- /dev/null +++ b/data/Leipzig/E655-keyboardPedalUp.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/Leipzig/E88A-tupletColon.xml b/data/Leipzig/E88A-tupletColon.xml new file mode 100644 index 00000000000..5b6f30cfec5 --- /dev/null +++ b/data/Leipzig/E88A-tupletColon.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/fonts/Leipzig-5.0.sfd b/fonts/Leipzig-5.1.sfd similarity index 57% rename from fonts/Leipzig-5.0.sfd rename to fonts/Leipzig-5.1.sfd index ff4c7fb70b2..d4accb6741e 100644 --- a/fonts/Leipzig-5.0.sfd +++ b/fonts/Leipzig-5.1.sfd @@ -20,7 +20,7 @@ OS2Version: 0 OS2_WeightWidthSlopeOnly: 0 OS2_UseTypoMetrics: 1 CreationTime: 1395388130 -ModificationTime: 1420559201 +ModificationTime: 1439743806 PfmFamily: 17 TTFWeight: 500 TTFWidth: 5 @@ -49,11 +49,11 @@ NameList: Adobe Glyph List DisplaySize: -72 AntiAlias: 1 FitToEm: 1 -WinInfo: 57450 15 7 +WinInfo: 57690 15 7 BeginPrivate: 0 EndPrivate TeXData: 1 0 0 346030 173015 115343 0 1048576 115343 783286 444596 497025 792723 393216 433062 380633 303038 157286 324010 404750 52429 2506097 1059062 262144 -BeginChars: 1114115 65 +BeginChars: 1114115 107 StartChar: uniE0A3 Encoding: 57507 57507 0 @@ -3224,93 +3224,93 @@ EndChar StartChar: uniE56C Encoding: 58732 58732 61 -Width: 488 -VWidth: 2048 -Flags: HW -LayerCount: 2 -Fore -SplineSet -0 21 m 5 - 0 80 l 5 - 129 230 l 5 - 146 240 l 5 - 153 240 157 238 158 234 c 5 - 264 141 l 5 - 281 131 l 5 - 293 137 l 5 - 373 230 l 5 - 391 240 l 5 - 396 240 400 238 403 234 c 5 - 508 141 l 5 - 517 134 l 5 - 525 129 l 5 - 530 130 534 133 537 137 c 6 - 605 217 l 5 - 605 158 l 5 - 477 8 l 5 - 468 1 461 -2 457 -2 c 4 - 454 -2 450 0 447 4 c 5 - 342 98 l 6 - 336 103 329 105 322 105 c 4 - 318 105 315 104 313 102 c 6 - 232 8 l 5 - 225 1 218 -2 213 -2 c 4 - 210 -2 206 0 203 4 c 5 - 98 98 l 6 - 92 104 85 107 78 107 c 4 - 75 107 71 105 68 102 c 6 - 0 21 l 5 +Width: 605 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 21 m 1 + 0 80 l 1 + 129 230 l 1 + 146 240 l 1 + 153 240 157 238 158 234 c 1 + 264 141 l 1 + 281 131 l 1 + 293 137 l 1 + 373 230 l 1 + 391 240 l 1 + 396 240 400 238 403 234 c 1 + 508 141 l 1 + 517 134 l 1 + 525 129 l 1 + 530 130 534 133 537 137 c 2 + 605 217 l 1 + 605 158 l 1 + 477 8 l 1 + 468 1 461 -2 457 -2 c 0 + 454 -2 450 0 447 4 c 1 + 342 98 l 2 + 336 103 329 105 322 105 c 0 + 318 105 315 104 313 102 c 2 + 232 8 l 1 + 225 1 218 -2 213 -2 c 0 + 210 -2 206 0 203 4 c 1 + 98 98 l 2 + 92 104 85 107 78 107 c 0 + 75 107 71 105 68 102 c 2 + 0 21 l 1 EndSplineSet EndChar StartChar: uniE56D Encoding: 58733 58733 62 -Width: 488 -VWidth: 2048 -Flags: HW -LayerCount: 2 -Fore -SplineSet -0 21 m 5 - 0 80 l 5 - 121 223 l 6 - 125 227 129 230 132 232 c 132 - 135 234 139 235 143 236 c 5 - 148 236 156 230 168 219 c 6 - 275 125 l 5 - 275 309 l 5 - 305 309 l 5 - 305 150 l 5 - 363 219 l 6 - 374 232 382 239 386 239 c 5 - 410 223 l 5 - 494 148 l 5 - 525 123 l 5 - 528 124 532 128 538 135 c 6 - 552 150 l 5 - 586 194 l 5 - 586 139 l 5 - 480 14 l 5 - 472 3 464 -2 457 -2 c 5 - 454 -1 452 1 450 2 c 4 - 444 6 438 11 432 16 c 6 - 354 86 l 5 - 340 100 329 107 320 107 c 5 - 315 105 l 5 - 310 100 l 5 - 305 94 l 5 - 305 -90 l 5 - 275 -90 l 5 - 275 59 l 5 - 239 14 l 5 - 229 3 221 -2 215 -2 c 5 - 208 0 l 5 - 198 8 l 5 - 188 16 l 5 - 100 96 l 6 - 93 103 86 107 80 109 c 5 - 77 109 71 105 63 96 c 6 - 0 21 l 5 +Width: 587 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 21 m 1 + 0 80 l 1 + 121 223 l 2 + 125 227 129 230 132 232 c 128 + 135 234 139 235 143 236 c 1 + 148 236 156 230 168 219 c 2 + 275 125 l 1 + 275 309 l 1 + 305 309 l 1 + 305 150 l 1 + 363 219 l 2 + 374 232 382 239 386 239 c 1 + 410 223 l 1 + 494 148 l 1 + 525 123 l 1 + 528 124 532 128 538 135 c 2 + 552 150 l 1 + 586 194 l 1 + 586 139 l 1 + 480 14 l 1 + 472 3 464 -2 457 -2 c 1 + 454 -1 452 1 450 2 c 0 + 444 6 438 11 432 16 c 2 + 354 86 l 1 + 340 100 329 107 320 107 c 1 + 315 105 l 1 + 310 100 l 1 + 305 94 l 1 + 305 -90 l 1 + 275 -90 l 1 + 275 59 l 1 + 239 14 l 1 + 229 3 221 -2 215 -2 c 1 + 208 0 l 1 + 198 8 l 1 + 188 16 l 1 + 100 96 l 2 + 93 103 86 107 80 109 c 1 + 77 109 71 105 63 96 c 2 + 0 21 l 1 EndSplineSet EndChar @@ -3349,5 +3349,2081 @@ SplineSet -0 74 0 37 0 -0 c 5 EndSplineSet EndChar + +StartChar: uniE88A +Encoding: 59530 59530 65 +Width: 144 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +16 87 m 0 + 16 98 19 106 26 113 c 128 + 33 120 42 123 53 123 c 0 + 64 123 72 120 79 113 c 128 + 86 106 90 97 90 87 c 128 + 90 77 86 68 79 60 c 1 + 72 53 62 50 52 50 c 128 + 42 50 33 53 26 60 c 128 + 19 67 16 76 16 87 c 0 +52 207 m 128 + 52 218 56 227 63 234 c 128 + 70 241 80 244 90 244 c 128 + 100 244 109 240 116 233 c 0 + 123 226 126 217 126 207 c 128 + 126 197 122 188 115 181 c 0 + 108 174 99 171 89 171 c 128 + 79 171 70 174 63 181 c 128 + 56 188 52 196 52 207 c 128 +EndSplineSet +EndChar + +StartChar: uniE522 +Encoding: 58658 58658 66 +Width: 232 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +-76 -179 m 5 + -78 -181.667 -78.667 -184 -78 -186 c 132 + -77.333 -188 -73.667 -189.333 -67 -190 c 5 + -48.333 -190 -32.667 -176.333 -20 -149 c 4 + -13.333 -135 -6.66699 -119 0 -101 c 132 + 6.66699 -83 11.667 -65.667 15 -49 c 6 + 29 12 l 5 + 73 220 l 5 + 15 220 l 5 + 15 258 l 5 + 85 258 l 5 + 92.333 278.667 98.333 294.333 103 305 c 4 + 110.333 323 117.667 337.667 125 349 c 4 + 145.666 379 167.333 402 190 418 c 132 + 212.667 434 237.667 442 265 442 c 4 + 274.333 442 282 441 288 439 c 132 + 294 437 300.333 431.667 307 423 c 4 + 311.667 416.333 314.667 410 316 404 c 6 + 320 388 l 5 + 320 373.333 319.333 362.666 318 356 c 132 + 316.667 349.333 313 340 307 328 c 4 + 304.333 322 298.333 315 289 307 c 4 + 285 303.667 280.667 301.667 276 301 c 132 + 271.333 300.333 265.667 300.333 259 301 c 5 + 253 302.333 248.667 306 246 312 c 132 + 243.333 318 241.333 324.667 240 332 c 5 + 240 344 242.333 354.667 247 364 c 132 + 251.667 373.333 259 381.333 269 388 c 4 + 276 393 276 393 283 398 c 5 + 283 406.667 277 412 265 414 c 5 + 251.667 415.33 240.333 412.663 231 406 c 132 + 221.667 399.333 212 385 202 363 c 5 + 197.333 351 191.667 333.333 185 310 c 132 + 178.333 286.667 173.667 270 171 260 c 5 + 248 260 l 5 + 248 220 l 5 + 163 220 l 5 + 151 151.333 134 82.667 112 14 c 4 + 94 -41.333 76.667 -85 60 -117 c 4 + 46.667 -143 33 -164 19 -180 c 4 + -5.66699 -208.667 -31 -223 -57 -223 c 4 + -81.666 -223 -100.333 -213.333 -113 -194 c 4 + -123 -178.667 -128 -160.667 -128 -140 c 4 + -128 -123.333 -124 -107.333 -116 -92 c 5 + -111.333 -84.667 -105.667 -79 -99 -75 c 132 + -92.333 -71 -85.667 -69 -79 -69 c 4 + -70.333 -69 -63.333 -73 -58 -81 c 132 + -52.667 -89 -49 -96.333 -47 -103 c 132 + -45 -109.667 -44 -115.333 -44 -120 c 4 + -44 -129.333 -46.333 -137.333 -51 -144 c 132 + -55.6641 -150.667 -60.3301 -157.667 -65 -165 c 132 + -69.6641 -172.333 -73.3301 -177 -76 -179 c 5 +EndSplineSet +EndChar + +StartChar: uniE521 +Encoding: 58657 58657 67 +Width: 430 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +337 262 m 0 + 358 262 380 248 380 227 c 2 + 380 220 l 1 + 317 37 l 1 + 317 24 321 17 329 16 c 1 + 337 16 346 21 355 31 c 128 + 364 41 370 47 371 48 c 0 + 375 55 378 60 380 63 c 2 + 407 103 l 1 + 428 103 l 1 + 398 53 l 2 + 386 33 373 16 360 3 c 128 + 347 -10 331 -17 314 -18 c 0 + 296 -18 280 -13 265 -4 c 1 + 249 11 l 1 + 246 18 244 23 244 28 c 1 + 264 91 288 152 309 214 c 1 + 309 221 304 226 294 227 c 1 + 278 227 263 212 250 182 c 1 + 186 0 l 1 + 115 0 l 1 + 192 214 l 1 + 192 223 186 227 175 227 c 0 + 166 227 158 223 153 216 c 128 + 148 209 141 197 133 182 c 1 + 69 0 l 1 + 0 0 l 1 + 77 210 l 1 + 77 214 l 2 + 77 224 72 226 65 230 c 1 + 40 230 13 183 -1 157 c 0 + -6 148 -13 134 -22 115 c 1 + -44 115 l 1 + -25 154 -4 191 20 222 c 0 + 41 249 67 262 99 262 c 0 + 120 262 130 243 133 221 c 1 + 152 238 167 248 178 253 c 1 + 189 259 202 262 217 262 c 0 + 238 262 249 243 252 221 c 1 + 274 238 301 262 337 262 c 0 +EndSplineSet +EndChar + +StartChar: uniE520 +Encoding: 58656 58656 68 +Width: 306 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +23 124 m 1 + 0 124 l 1 + 22 166.667 42.667 200.333 62 225 c 128 + 81.333 249.667 106.667 262.333 138 263 c 0 + 144 263 150 258.667 156 250 c 1 + 162.667 243.333 166 234.333 166 223 c 1 + 190 237 l 1 + 215 250 l 1 + 227 254.667 239.333 257 252 257 c 0 + 276 257 295.333 247.667 310 229 c 128 + 324.667 210.333 332.333 184.667 333 152 c 0 + 333 138 332 125.333 330 114 c 128 + 328 102.667 324.667 93 320 85 c 128 + 315.333 77 309 68 301 58 c 0 + 287 40 271.333 26 254 16 c 128 + 236.667 6 218.667 1 200 1 c 0 + 191.333 1 180.333 4.33301 167 11 c 0 + 161.667 14.333 156.667 17.667 152 21 c 128 + 147.333 24.333 143 29 139 35 c 1 + 83 -123 l 1 + 80 -127 l 1 + 82.667 -133.667 86.667 -137.333 92 -138 c 1 + 124 -138 l 1 + 124 -167 l 1 + -49 -167 l 1 + -49 -138 l 1 + -28 -138 l 2 + -24 -138 -19.333 -136.333 -14 -133 c 1 + -10 -129 -7 -124.333 -5 -119 c 2 + 114 212 l 1 + 114 218 l 1 + 111 228 l 1 + 105 231 l 1 + 96.333 231 88 227 80 219 c 128 + 72 211 64.333 200.667 57 188 c 1 + 46 171 l 1 + 36 151 l 1 + 23 124 l 1 +197 201 m 0 + 185 180.333 175.333 156.333 168 129 c 1 + 161.333 99 158 78.333 158 67 c 0 + 158 43 165.333 31 180 31 c 0 + 192.667 31 203 33.333 211 38 c 128 + 219 42.667 226 49.333 232 58 c 1 + 242 74.667 247.333 84 248 86 c 0 + 252.667 97.333 256 112 258 130 c 128 + 260 148 261.333 161 262 169 c 0 + 262 176.333 261.333 182.333 260 187 c 128 + 258.667 191.667 256.667 196.334 254 201 c 0 + 248.667 210.333 239.333 215 226 215 c 0 + 212 215 202.333 210.333 197 201 c 0 +EndSplineSet +EndChar + +StartChar: uniE523 +Encoding: 58659 58659 69 +Width: 225 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +194 174 m 0 + 180 174 171 186 171 203 c 1 + 172 214 l 1 + 175 226 l 1 + 175 231 172 233 167 233 c 0 + 154 233 141 223 129 202 c 1 + 113 170 l 1 + 92 116 78 57 60 0 c 1 + 0 0 l 1 + 57 194 l 1 + 57 199 l 2 + 57 210 54 215 49 215 c 0 + 34 215 29 206 19 194 c 0 + 10 183 2 171 -6 158 c 1 + -20 166 l 1 + -14 181 -4 191 8 204 c 0 + 27 223 58 252 91 252 c 0 + 106 252 113 243 113 224 c 0 + 112 217 112 210 111 203 c 1 + 127 227 150 259 185 259 c 0 + 206 259 225 240 225 219 c 0 + 225 189 215 174 194 174 c 0 +EndSplineSet +EndChar + +StartChar: uniE524 +Encoding: 58660 58660 70 +Width: 194 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +81 33 m 2 + 102 33 119 48 121 67 c 0 + 121 74 118 82 113 89 c 0 + 110 94 104 100 94 107 c 0 + 72 120 56 133 47 145 c 128 + 38 157 33 171 32 188 c 0 + 32 238 72 270 119 270 c 1 + 147 267 l 1 + 156 264 164 260 171 254 c 1 + 186 245 194 230 194 211 c 1 + 193 201 l 1 + 187 191 l 2 + 184 186 179 182 170 181 c 1 + 153 181 144 189 141 205 c 1 + 145 224 l 1 + 145 234 131 240 121 242 c 0 + 102 245 89 226 86 206 c 1 + 86 199 90 191 97 184 c 1 + 106 177 115 170 123 163 c 0 + 151 140 166 126 167 123 c 1 + 175 113 179 100 179 84 c 2 + 179 74 l 2 + 179 53 169 35 150 20 c 1 + 134 10 112 2 89 0 c 1 + 42 0 0 26 0 67 c 1 + 1 82 l 1 + 6 95 l 1 + 16 104 l 1 + 29 108 l 1 + 45 108 53 98 53 77 c 0 + 53 64 48 61 45 49 c 1 + 45 41 56 33 68 33 c 130 + 81 33 l 2 +EndSplineSet +EndChar + +StartChar: uniE525 +Encoding: 58661 58661 71 +Width: 260 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +173 115 m 0 + 194 115 207 92 207 67 c 0 + 207 44 199 25 183 9 c 1 + 168 -8 144 -16 110 -16 c 0 + 98 -16 89 -15 83 -12 c 2 + 71 -6 l 1 + 54 4 l 1 + 39 11 30 14 25 14 c 0 + 16 14 6 9 -5 0 c 1 + -36 0 l 1 + -36 16 l 1 + 173 193 l 1 + 109 192 l 1 + 86 189 77 177 65 162 c 1 + 41 162 l 1 + 71 249 l 1 + 260 249 l 1 + 260 217 l 1 + 49 54 l 1 + 62 60 75 63 88 63 c 0 + 102 63 141 45 151 43 c 1 + 160 44 165 51 165 62 c 1 + 152 62 145 70 143 85 c 1 + 143 102 156 115 173 115 c 0 +EndSplineSet +EndChar + +StartChar: uniE650 +Encoding: 58960 58960 72 +Width: 695 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +657 134 m 0 + 657 99.333 644.667 68.333 620 41 c 128 + 595.333 13.667 566.333 0 533 0 c 2 + 519 0 l 1 + 513 8 508.333 13.667 505 17 c 0 + 493.667 29 484 35 476 35 c 0 + 461.333 35 448.667 31.667 438 25 c 1 + 424.667 14.333 414 6 406 0 c 1 + 340 0 l 1 + 300 47 l 1 + 267 0 l 1 + 190 0 l 1 + 184.667 19.333 180.333 33.333 177 42 c 0 + 171 58 162 65.333 150 64 c 0 + 133.333 62 117 52 101 34 c 0 + 91.667 22.667 82 11.333 72 0 c 1 + 38 0 l 1 + 38 29.333 72.333 67 141 113 c 0 + 173.667 135 190 159 190 185 c 0 + 190.002 202.333 179.335 226 158 256 c 128 + 136.667 286 125.667 321.333 125 362 c 0 + 125 376.667 126 392.333 128 409 c 128 + 130 425.667 133.667 446 139 470 c 1 + 137.684 474 135.351 477 132 479 c 128 + 128.667 481 122.667 482 114 482 c 1 + 95.333 476.667 81.333 470.667 72 464 c 0 + 44 442.667 30 410.333 30 367 c 0 + 30 355.667 31.667 346.667 35 340 c 128 + 38.333 333.333 42.667 328.333 48 325 c 1 + 64 320.333 78 334 90 366 c 1 + 93.333 368.667 96.333 371.333 99 374 c 1 + 99.667 372 100 368.333 100 363 c 0 + 100 348.333 96 335 88 323 c 0 + 76.667 307 60 296.667 38 292 c 1 + 29.333 292 21.333 297 14 307 c 0 + 4.66699 320.334 0 338.667 0 362 c 0 + 0 407.333 15 444 45 472 c 128 + 75 500 112.667 514 158 514 c 0 + 210 514 249.667 504 277 484 c 128 + 304.333 464 318.333 436.333 319 401 c 0 + 319 387 316.667 373 312 359 c 1 + 300 338.333 285.333 328 268 328 c 0 + 250 328 232.333 337.333 215 356 c 128 + 197.667 374.667 189 390.333 189 403 c 0 + 189 409 191.333 412.333 196 413 c 1 + 200 401.667 204 393.333 208 388 c 0 + 220 370.667 235.333 362 254 362 c 0 + 268.667 362 278.667 366 284 374 c 128 + 289.333 382 292 392.667 292 406 c 0 + 292 426.667 284.333 442.333 269 453 c 128 + 253.667 463.667 233.667 471.667 209 477 c 0 + 199 479 192.333 480 189 480 c 0 + 185 480 176.333 479 163 477 c 1 + 157.667 461.667 154 446.333 152 431 c 128 + 150 415.667 149 396.667 149 374 c 0 + 149 353.333 156 330.666 170 306 c 1 + 197 261 197 261 224 216 c 1 + 226.667 203.333 228 191 228 179 c 0 + 228 157 219.667 136.667 203 118 c 0 + 194.333 108.667 190 101.333 190 96 c 1 + 199.333 87.333 205.333 76.333 208 63 c 128 + 210.667 49.667 222.667 40.333 244 35 c 1 + 261.333 39.667 273.333 44.667 280 50 c 128 + 286.667 55.333 290 62.333 290 71 c 0 + 290 77.667 286 90.333 278 109 c 0 + 272.667 121.667 269 131.667 267 139 c 1 + 266.333 145 266 149.667 266 153 c 0 + 266 181 274 206.333 290 229 c 128 + 306 251.667 328.333 263 357 263 c 0 + 378.333 263 393 259 401 251 c 128 + 409 243 414.667 227.667 418 205 c 0 + 420.667 183 413.667 163.667 397 147 c 1 + 374.334 126.333 351.667 106 329 86 c 1 + 335 75.333 342 65 350 55 c 0 + 366.667 34.333 383.333 24 400 24 c 0 + 412 24 425 29 439 39 c 0 + 443 42.333 448.667 47.333 456 54 c 1 + 454.667 66 454 76.333 454 85 c 0 + 454 121.667 460.667 153.333 474 180 c 0 + 492.667 218 525 247 571 267 c 1 + 550.333 313.667 518.333 355 475 391 c 1 + 434.333 419.667 393.333 448.333 352 477 c 1 + 381.333 474.332 418.333 459.666 463 433 c 0 + 517.667 401 561.333 362.667 594 318 c 0 + 636 261.333 657 200 657 134 c 0 +379 227 m 1 + 369 227 358.667 226.333 348 225 c 128 + 337.333 223.667 330 218.667 326 210 c 128 + 322 201.333 319.333 193 318 185 c 128 + 316.667 177 316 168.333 316 159 c 2 + 316 139 l 1 + 344 139 362.333 148.333 371 167 c 0 + 376.333 178.333 379 198.333 379 227 c 1 +513 54 m 1 + 519 41.333 529 35 543 35 c 0 + 559 35 573.333 43 586 59 c 128 + 598.667 75 605.333 98.333 606 129 c 0 + 606 154.333 602.667 181 596 209 c 128 + 589.333 237 581 251.333 571 252 c 1 + 549.667 243.333 533 226 521 200 c 128 + 509 174 503 145 503 113 c 0 + 503 89.667 506.333 70 513 54 c 1 +671 50 m 0 + 677.667 50 683.333 47.333 688 42 c 128 + 692.667 36.667 695 30.667 695 24 c 128 + 695 17.333 692.333 11.667 687 7 c 128 + 681.667 2.33301 675.333 -0 668 0 c 0 + 661.333 -0 655.667 2.66699 651 8 c 128 + 646.333 13.333 644 19.667 644 27 c 0 + 644 42.333 653 50 671 50 c 0 +EndSplineSet +EndChar + +StartChar: uniE655 +Encoding: 58965 58965 73 +Width: 507 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +255 288 m 1 + 229 288 210 270 210 245 c 0 + 210 224 234 204 255 203 c 1 + 279 203 296 225 296 247 c 0 + 296 272 279 287 255 288 c 1 +52 374 m 1 + 56 404 81 434 113 434 c 0 + 132 434 145 429 150 420 c 1 + 163 404 166 355 176 331 c 1 + 183 322 193 316 206 314 c 1 + 225 320 l 1 + 236 326 241 332 242 349 c 0 + 242 357 240 364 237 369 c 2 + 223 390 l 1 + 204 411 l 1 + 193 437 l 1 + 193 470 222 492 255 492 c 0 + 288 492 314 465 314 437 c 0 + 314 413 306 407 290 390 c 1 + 272 367 l 1 + 267 359 265 352 264 346 c 1 + 265 341 269 333 269 329 c 1 + 282 317 l 1 + 299 308 l 1 + 323 310 335 334 338 363 c 1 + 338 409 357 432 395 432 c 0 + 425 432 450 407 450 377 c 0 + 450 343 422 322 386 322 c 0 + 351 322 332 309 329 282 c 1 + 335 268 l 2 + 336 265 339 262 343 259 c 0 + 344 257 350 255 360 253 c 1 + 372 255 380 260 387 267 c 1 + 396 271 394 272 406 281 c 2 + 431 299 l 2 + 436 303 444 305 455 305 c 0 + 482 305 506 274 507 247 c 1 + 507 223 489 199 472 189 c 0 + 469 188 461 186 450 185 c 1 + 442 186 430 193 414 206 c 1 + 384 228 l 2 + 379 231 371 233 360 233 c 0 + 351 233 344 231 340 228 c 1 + 329 206 l 1 + 331 191 337 182 346 178 c 2 + 359 173 l 1 + 390 167 l 1 + 409 167 423 162 434 153 c 1 + 445 146 450 133 450 113 c 0 + 450 98 444 84 433 73 c 1 + 422 64 407 58 390 54 c 1 + 377 56 364 64 351 77 c 1 + 342 90 338 109 338 132 c 0 + 338 145 332 156 329 163 c 0 + 323 173 313 178 299 178 c 0 + 277 178 265 160 261 141 c 1 + 264 133 270 125 274 117 c 0 + 279 108 284 100 290 92 c 1 + 299 82 l 1 + 305 70 l 1 + 309 64 310 56 311 46 c 1 + 311 16 280 0 250 0 c 0 + 221 0 196 18 193 46 c 1 + 194 53 199 67 201 71 c 0 + 214 88 227 105 240 121 c 1 + 242 126 244 133 245 144 c 1 + 245 164 235 175 216 178 c 1 + 179 178 169 155 169 118 c 0 + 169 81 150 60 113 54 c 1 + 74 62 63 77 54 115 c 1 + 58 151 84 169 132 169 c 0 + 154 169 175 184 175 206 c 0 + 175 215 172 221 166 225 c 1 + 162 230 156 233 147 233 c 0 + 135 233 119 226 100 212 c 0 + 84 201 71 193 54 187 c 1 + 21 191 1 211 0 247 c 1 + 0 277 22 302 52 302 c 0 + 74 302 89 292 104 280 c 2 + 125 264 l 1 + 147 255 l 1 + 168 260 178 269 178 282 c 0 + 178 309 160 322 123 322 c 0 + 80 322 57 339 52 374 c 1 +EndSplineSet +EndChar + +StartChar: uniE046 +Encoding: 57414 57414 74 +Width: 935 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +51 64 m 1 + 130 349 l 1 + 132 358 l 1 + 133 363 l 1 + 133 371 130.333 377.333 125 382 c 128 + 119.667 386.667 106.333 391 85 395 c 1 + 85 404 l 1 + 237 404 l 2 + 371 404 438 348.667 438 238 c 0 + 438 190 425 147.333 399 110 c 0 + 386.333 92.6667 371 77 353 63 c 128 + 335 49 315 37.3333 293 28 c 0 + 249.667 9.33333 203.667 9.53674e-07 155 0 c 2 + 0 0 l 1 + 0 10 l 1 + 14.6667 10 26.3333 14.6667 35 24 c 0 + 39.6667 28.6667 43.3334 34.3333 46 41 c 128 + 48.6669 47.6667 50.3335 55.3334 51 64 c 1 +200 374 m 1 + 110 51 l 1 + 108 40 l 1 + 110 24.6667 125 17 153 17 c 0 + 193 17 229.667 28.3333 263 51 c 1 + 279.667 61 294.333 72.6667 307 86 c 128 + 319.667 99.3333 330.333 115 339 133 c 1 + 348.333 148.333 355 165.667 359 185 c 128 + 363 204.333 365.333 225.667 366 249 c 1 + 366 294.333 355.667 328.333 335 351 c 128 + 314.333 373.667 282 385 238 385 c 0 + 228.667 385 220.667 384.333 214 383 c 128 + 207.333 381.667 202.667 378.667 200 374 c 1 +890 404 m 1 + 868 279 l 1 + 857 279 l 1 + 857 295 855 309.667 851 323 c 128 + 847 336.333 840.667 348 832 358 c 1 + 813.333 375.333 789.667 384 761 384 c 0 + 742.333 384 725 381 709 375 c 128 + 693 369 678 359 664 345 c 1 + 635.333 320.333 614 288.666 600 250 c 1 + 591.333 230 585.333 212 582 196 c 128 + 578.667 180 576.667 161.667 576 141 c 0 + 576 121 577.667 103.667 581 89 c 128 + 584.333 74.3333 591 60.3333 601 47 c 1 + 617.667 22.3333 643 10 677 10 c 0 + 705 10 731 15.6667 755 27 c 128 + 779 38.3333 802.667 57.3333 826 84 c 1 + 834 74 l 1 + 787.333 10 730.333 -22 663 -22 c 0 + 633 -22 605.333 -14.3333 580 1 c 1 + 570 8.33333 560.333 17.3333 551 28 c 128 + 541.667 38.6667 533 50.6667 525 64 c 1 + 512.333 90 506 118.333 506 149 c 0 + 506.002 191.667 517.335 233 540 273 c 1 + 564 311.667 595.333 344.333 634 371 c 1 + 674 394.333 715.333 406 758 406 c 2 + 776 406 l 2 + 783.333 406 788.333 405.333 791 404 c 1 + 827 397 l 1 + 855 389 l 1 + 880 404 l 1 + 890 404 l 1 +398 33 m 128 + 398 44.3333 400.667 51.6667 406 55 c 1 + 414 63 422 67 430 67 c 128 + 438 67 445 63 451 55 c 1 + 457.667 51 461 43.6667 461 33 c 0 + 461 24.3333 457.667 16.6667 451 10 c 1 + 446.333 3.33333 439.333 0 430 0 c 128 + 420.667 -4.76837e-07 413 2.66667 407 8 c 128 + 401 13.3333 398 21.6667 398 33 c 128 +871 28 m 1 + 871 39.3333 874.333 47 881 51 c 1 + 887 57.6667 894.667 61 904 61 c 0 + 912 61 920 58 928 52 c 1 + 932.667 46 935 38 935 28 c 0 + 935 20 932 13.3333 926 8 c 1 + 920.66 2 913.326 -1 904 -1 c 0 + 894 -1 886.667 2 882 8 c 1 + 876 12.6667 872.333 19.3333 871 28 c 1 +EndSplineSet +EndChar + +StartChar: uniE045 +Encoding: 57413 57413 75 +Width: 860 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +133 363 m 1 + 133 387 115 389 85 395 c 1 + 85 404 l 1 + 237 404 l 2 + 371 404 438 349 438 238 c 0 + 438 190 425 147 399 110 c 1 + 352 45 261 0 155 0 c 2 + 0 0 l 1 + 0 10 l 1 + 32 10 49 33 51 64 c 1 + 130 349 l 1 + 132 358 l 1 + 133 363 l 1 +366 249 m 0 + 366 339 327 385 238 385 c 0 + 221 385 206 384 200 374 c 1 + 110 51 l 1 + 108 40 l 1 + 110 25 125 17 153 17 c 0 + 292 17 365 109 366 249 c 0 +704 384 m 0 + 669 384 640 358 640 323 c 0 + 640 306 645 290 655 276 c 1 + 675 252 681 245 703 226 c 1 + 716 210 739 183 751 167 c 1 + 763 148 769 129 769 108 c 0 + 769 82 760 62 750 43 c 1 + 737 24 721 10 704 1 c 1 + 689 -9 670 -14 645 -14 c 0 + 634 -14 617 -10 594 -1 c 1 + 578 3 562 5 552 10 c 1 + 545 10 540 7 536 1 c 1 + 532 0 529 -5 528 -13 c 1 + 516 -13 l 1 + 537 122 l 1 + 552 122 l 1 + 549 105 l 1 + 549 90 552 79 554 68 c 1 + 558 57 565 47 576 36 c 1 + 591 17 611 8 638 8 c 0 + 662 8 680 16 692 32 c 1 + 708 47 716 66 716 87 c 0 + 716 107 711 123 702 135 c 1 + 690 148 682 160 669 173 c 128 + 664 178 658 184 652 191 c 0 + 630 212 614 231 603 249 c 1 + 592 262 587 280 587 303 c 0 + 587 341 595 356 618 375 c 1 + 637 394 662 404 693 404 c 0 + 717 404 735 402 747 397 c 1 + 758 390 768 387 778 387 c 0 + 785 387 793 393 802 404 c 1 + 815 404 l 1 + 791 285 l 1 + 781 285 l 1 + 781 351 755 384 704 384 c 0 +430 0 m 128 + 410 0 398 12 398 33 c 128 + 398 54 415 67 430 67 c 128 + 438 67 445 63 451 55 c 1 + 458 51 461 44 461 33 c 0 + 461 17 448 0 430 0 c 128 +829 -1 m 0 + 809 -1 797 11 794 28 c 1 + 794 45 811 61 829 61 c 0 + 848 61 860 49 860 28 c 0 + 860 10 845 -1 829 -1 c 0 +EndSplineSet +EndChar + +StartChar: uniE047 +Encoding: 57415 57415 76 +Width: 410 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +108 474 m 4 + 86 474 70 444 70 418 c 4 + 70 364 143 333 210 302 c 5 + 348 507 l 5 + 389 507 l 5 + 243 286 l 5 + 284 265 316 242 339 219 c 4 + 367 190 381 157 381 122 c 4 + 381 54 327 2 257 1 c 4 + 217 1 181 33 181 73 c 4 + 181 95 202 111 224 111 c 4 + 247 111 258 94 263 73 c 4 + 269 50 279 39 294 39 c 4 + 321 39 336 62 336 93 c 4 + 336 106 333 116 328 125 c 4 + 319 142 295 161 256 182 c 5 + 226 197 226 197 196 212 c 5 + 62 4 l 5 + 22 4 l 5 + 163 227 l 5 + 114 250 78 277 54 307 c 4 + 33 334 22 362 22 391 c 4 + 22 438 47 471 76 493 c 132 + 93 506 113 513 134 513 c 4 + 180 513 224 481 225 436 c 4 + 225 414 202 401 180 400 c 4 + 161 400 150 408 145 425 c 6 + 138 448 l 6 + 133 465 123 474 108 474 c 4 +75 192 m 5 + 75 171 59 155 39 154 c 5 + 16 154 2 167 1 189 c 4 + 0 210 15 228 36 228 c 132 + 58 228 74 213 75 192 c 5 +337 322 m 4 + 337 346 353 360 374 360 c 4 + 397 360 411 341 411 323 c 4 + 411 300 394 286 374 286 c 4 + 351 286 337 303 337 322 c 4 +EndSplineSet +EndChar + +StartChar: uniE048 +Encoding: 57416 57416 77 +Width: 536 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +537 233 m 1 + 473 233 l 1 + 473 217 469 193 460 160 c 1 + 446 121 l 1 + 430 90 l 1 + 417 73 400 50 383 37 c 128 + 361 20 326 10 286 0 c 1 + 286 -73 l 1 + 251 -73 l 1 + 251 0 l 1 + 212 6 l 130 + 203 7 196 9 189 12 c 0 + 132 43 100 86 78 160 c 1 + 67 199 l 1 + 65 233 l 1 + 0 233 l 1 + 0 273 l 1 + 65 273 l 1 + 65 307 67 316 77 346 c 1 + 83 370 95 398 107 416 c 1 + 130 446 l 1 + 154 471 l 1 + 175 487 184 494 215 499 c 128 + 227 501 239 503 251 506 c 1 + 251 580 l 1 + 286 580 l 1 + 286 506 l 1 + 307 503 332 502 347 493 c 1 + 360 488 372 480 382 471 c 0 + 398 458 414 439 430 416 c 1 + 443 393 473 309 473 273 c 1 + 537 273 l 1 + 537 233 l 1 +370 273 m 1 + 369 295 l 1 + 367 332 l 2 + 367 349 364 369 358 390 c 1 + 352 425 320 471 286 471 c 1 + 286 273 l 1 + 370 273 l 1 +251 273 m 1 + 251 471 l 1 + 236 471 221 462 205 445 c 1 + 190 426 181 409 178 393 c 0 + 175 375 173 357 170 339 c 1 + 169 303 l 2 + 169 290 168 280 167 273 c 1 + 251 273 l 1 +370 233 m 1 + 286 233 l 1 + 286 37 l 1 + 301 37 317 45 332 61 c 0 + 345 76 354 94 358 115 c 2 + 367 177 l 1 + 370 233 l 1 +251 37 m 1 + 251 233 l 1 + 167 233 l 1 + 167 212 l 1 + 169 175 l 1 + 169 133 182 88 204 61 c 1 + 219 45 235 37 251 37 c 1 +EndSplineSet +EndChar + +StartChar: uniE04B +Encoding: 57419 57419 78 +Width: 477 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +187 643 m 1 + 253 605 l 1 + 253 751 l 1 + 187 788 l 1 + 187 643 l 1 +320 572 m 1 + 349 580 380 608 380 644 c 0 + 380 671 364 698 346 707 c 1 + 282 745 l 1 + 282 597 l 1 + 320 572 l 1 +159 381 m 1 + 159 530 l 1 + 122 552 l 1 + 103 552 94 545 83 533 c 1 + 68 520 61 507 61 496 c 0 + 61 460 79 433 100 418 c 1 + 159 381 l 1 +187 375 m 1 + 253 339 l 1 + 253 483 l 1 + 187 520 l 1 + 187 375 l 1 +320 305 m 1 + 352 310 380 337 380 373 c 0 + 380 402 368 424 344 440 c 1 + 282 476 l 1 + 282 330 l 1 + 320 305 l 1 +159 924 m 1 + 159 962 l 1 + 187 962 l 1 + 187 909 l 1 + 253 874 l 1 + 253 962 l 1 + 282 962 l 1 + 282 863 l 1 + 315 849 341 835 360 822 c 1 + 401 797 439 759 442 696 c 0 + 442 686 440 676 437 667 c 2 + 431 651 l 2 + 426 638 420 626 413 617 c 1 + 407 606 396 595 387 585 c 2 + 356 553 l 1 + 378 541 395 528 407 514 c 1 + 420 501 428 487 432 472 c 1 + 439 459 442 440 442 416 c 0 + 442 360 413 316 356 285 c 1 + 383 266 406 247 423 226 c 128 + 440 205 449 181 450 152 c 0 + 450 111 439 83 420 57 c 1 + 401 28 375 6 343 -10 c 1 + 314 -23 281 -32 244 -34 c 1 + 201 -34 187 -30 149 -18 c 1 + 102 -5 46 27 44 78 c 1 + 46 91 l 1 + 51 116 65 128 88 128 c 2 + 101 128 l 1 + 116 126 134 111 155 84 c 0 + 178 54 193 34 216 19 c 128 + 223 15 242 10 250 7 c 128 + 254 6 259 5 266 6 c 0 + 308 6 339 27 357 51 c 1 + 365 64 369 78 369 91 c 1 + 366 113 l 2 + 365 121 362 129 357 136 c 1 + 340 167 314 184 282 201 c 1 + 282 164 l 1 + 253 164 l 1 + 253 217 l 1 + 187 249 l 1 + 187 164 l 1 + 159 164 l 1 + 159 262 l 1 + 109 288 l 2 + 95 296 66 315 54 326 c 1 + 39 338 26 353 17 370 c 1 + 5 399 l 1 + 3 407 2 412 2 415 c 128 + 2 418 2 423 1 430 c 1 + 3 450 l 1 + 12 488 33 515 56 540 c 1 + 88 572 l 1 + 56 591 33 611 20 630 c 1 + 7 651 1 677 1 708 c 0 + 1 741 9 767 24 786 c 128 + 39 805 61 824 90 842 c 1 + 63 859 41 879 25 902 c 128 + 9 925 1 955 0 992 c 0 + 0 1026 10 1055 29 1078 c 1 + 65 1125 124 1157 201 1158 c 1 + 270 1158 333 1137 370 1103 c 128 + 390 1085 400 1067 400 1049 c 1 + 398 1034 l 1 + 391 1005 376 990 352 990 c 0 + 337 990 325 994 318 1001 c 128 + 308 1011 279 1054 264 1070 c 128 + 257 1077 249 1085 239 1093 c 1 + 222 1104 200 1111 174 1114 c 1 + 143 1114 118 1106 101 1091 c 1 + 86 1076 72 1061 71 1034 c 1 + 72 1029 l 1 + 72 983 123 940 159 924 c 1 +161 649 m 1 + 161 797 l 1 + 124 820 l 1 + 111 818 101 814 94 807 c 1 + 87 797 84 791 79 779 c 2 + 68 749 l 1 + 68 726 67 723 77 709 c 0 + 84 698 92 689 100 684 c 2 + 161 649 l 1 +EndSplineSet +EndChar + +StartChar: uniE500 +Encoding: 58624 58624 79 +Width: 508 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +508 212 m 1 + 146 -212 l 1 + 0 -212 l 1 + 362 212 l 1 + 508 212 l 1 +52 108 m 0 + 52 121.333 56.333 132.667 65 142 c 128 + 73.667 151.333 84.333 156.333 97 157 c 1 + 111 157 122.667 153 132 145 c 128 + 141.333 137 146.333 126 147 112 c 0 + 147 98.667 142.667 87.333 134 78 c 128 + 125.333 68.667 114.667 63.667 102 63 c 1 + 88 63 76.333 67 67 75 c 128 + 57.667 83 52.667 94 52 108 c 0 +361 -111 m 0 + 361 -97.667 365.333 -86.333 374 -77 c 128 + 382.667 -67.667 393.334 -62.667 406 -62 c 1 + 420 -62 431.667 -66 441 -74 c 128 + 450.333 -82 455.333 -93 456 -107 c 0 + 456 -120.333 451.667 -131.667 443 -141 c 128 + 434.333 -150.333 423.667 -155.333 411 -156 c 1 + 397 -156 385.333 -152 376 -144 c 128 + 366.667 -136 361.667 -125 361 -111 c 0 +EndSplineSet +EndChar + +StartChar: uniE220 +Encoding: 57888 57888 80 +Width: 163 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +-163 -124 m 1 + -163 -41 l 1 + 163 125 l 1 + 163 39 l 1 + -163 -124 l 1 +EndSplineSet +EndChar + +StartChar: uniE222 +Encoding: 57890 57890 81 +Width: 162 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +162 175 m 1 + -162 11 l 1 + -162 95 l 1 + 162 258 l 1 + 162 175 l 1 +162 40 m 1 + -162 -124 l 1 + -162 -40 l 1 + 162 124 l 1 + 162 40 l 1 +162 -95 m 1 + -162 -258 l 1 + -162 -175 l 1 + 162 -11 l 1 + 162 -95 l 1 +EndSplineSet +EndChar + +StartChar: uniE223 +Encoding: 57891 57891 82 +Width: 162 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +162 108 m 1 + -162 -56 l 1 + -162 28 l 1 + 162 191 l 1 + 162 108 l 1 +162 -27 m 1 + -162 -191 l 1 + -162 -107 l 1 + 162 57 l 1 + 162 -27 l 1 +162 -162 m 1 + -162 -325 l 1 + -162 -242 l 1 + 162 -78 l 1 + 162 -162 l 1 +162 242 m 1 + -162 78 l 1 + -162 162 l 1 + 162 326 l 1 + 162 242 l 1 +EndSplineSet +EndChar + +StartChar: uniE224 +Encoding: 57892 57892 83 +Width: 162 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +162 41 m 1 + -162 -123 l 1 + -162 -39 l 1 + 162 124 l 1 + 162 41 l 1 +162 -94 m 1 + -162 -258 l 1 + -162 -174 l 1 + 162 -10 l 1 + 162 -94 l 1 +162 -229 m 1 + -162 -392 l 1 + -162 -309 l 1 + 162 -145 l 1 + 162 -229 l 1 +162 310 m 1 + -162 146 l 1 + -162 230 l 1 + 162 393 l 1 + 162 310 l 1 +162 175 m 1 + -162 11 l 1 + -162 95 l 1 + 162 259 l 1 + 162 175 l 1 +EndSplineSet +EndChar + +StartChar: uniE221 +Encoding: 57889 57889 84 +Width: 164 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +-163 -193 m 1 + -163 -110 l 1 + 163 56 l 1 + 163 -30 l 1 + -163 -193 l 1 +-163 -57 m 1 + -163 27 l 1 + 163 193 l 1 + 163 110 l 1 + -163 -57 l 1 +EndSplineSet +EndChar + +StartChar: uniE530 +Encoding: 58672 58672 85 +Width: 780 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +378 -69 m 5 + 401 -69 413 -92 414 -116 c 4 + 414 -124 410 -139 405 -147 c 6 + 395 -162 l 6 + 388 -172 387 -174 382 -183 c 5 + 382 -188 385 -190 392 -190 c 4 + 411 -190 427 -176 440 -148 c 5 + 453 -116 463 -88 473 -51 c 5 + 487 11 500 72 514 134 c 6 + 532 220 l 5 + 392 220 l 5 + 378 131 332 -36 299 -98 c 5 + 284 -129 269 -155 252 -177 c 132 + 235 -199 214 -214 187 -221 c 5 + 169 -223 l 5 + 125 -223 102 -183 102 -136 c 4 + 102 -97 120 -83 147 -69 c 5 + 153 -69 158 -70 161 -73 c 5 + 166 -75 170 -80 174 -84 c 4 + 181 -93 184 -104 184 -118 c 4 + 184 -133 173 -154 152 -183 c 5 + 152 -188 155 -190 161 -190 c 4 + 195 -190 222 -144 243 -51 c 4 + 250 -22 256 8 263 38 c 4 + 276 99 289 159 302 220 c 5 + 161 220 l 5 + 148 135 99 -35 68 -98 c 5 + 35 -170 -2 -211 -42 -221 c 5 + -61 -223 l 5 + -96 -223 -112 -199 -124 -169 c 5 + -129 -136 l 5 + -124 -97 -116 -81 -83 -69 c 5 + -60 -69 -45 -95 -45 -118 c 4 + -45 -126 -47 -134 -51 -141 c 6 + -65 -164 l 5 + -79 -183 l 5 + -79 -188 -76 -190 -69 -190 c 4 + -58 -190 -48 -185 -39 -175 c 5 + -21 -160 -13 -129 -2 -104 c 5 + 13 -51 l 5 + 30 26 47 104 63 182 c 132 + 66 195 69 208 72 220 c 5 + 15 220 l 5 + 15 258 l 5 + 84 258 l 5 + 93 291 107 320 124 347 c 5 + 141 375 162 398 187 417 c 5 + 212 434 240 442 270 442 c 4 + 303 442 319 412 319 376 c 132 + 319 338 300 306 269 300 c 5 + 252 300 242 311 240 332 c 5 + 240 359 257 385 277 394 c 5 + 280 394 282 396 282 400 c 5 + 276 409 l 5 + 271 412 265 414 258 414 c 4 + 235 414 217 398 203 366 c 132 + 189 334 178 299 171 260 c 5 + 315 260 l 5 + 338 344 400 442 500 442 c 4 + 536 442 547 411 549 376 c 5 + 549 358 545 341 536 325 c 5 + 528 313 516 305 499 300 c 5 + 481 300 471 311 469 332 c 5 + 469 361 487 383 506 394 c 5 + 509 394 511 396 511 400 c 5 + 507 410 500 414 488 414 c 4 + 451 414 421 362 400 258 c 5 + 544 258 l 5 + 559 307 583 351 616 390 c 4 + 647 426 685 444 730 444 c 4 + 764 444 779 408 779 374 c 4 + 779 337 760 306 728 300 c 5 + 712 300 703 311 701 332 c 5 + 701 358 719 384 736 394 c 5 + 740 394 742 396 742 400 c 5 + 737 409 731 414 718 414 c 4 + 681 414 651 362 630 258 c 5 + 706 258 l 5 + 706 220 l 5 + 621 220 l 5 + 614 176 606 136 595 99 c 5 + 577 24 556 -42 529 -98 c 5 + 514 -126 498 -153 479 -177 c 5 + 463 -198 443 -213 418 -221 c 5 + 400 -223 l 5 + 365 -223 347 -200 338 -169 c 5 + 334 -159 332 -148 332 -136 c 5 + 336 -99 347 -79 378 -69 c 5 +EndSplineSet +EndChar + +StartChar: uniE52F +Encoding: 58671 58671 86 +Width: 571 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +496 220 m 1 + 413 220 l 1 + 404.333 164.667 390.667 105.667 372 43 c 128 + 353.333 -19.667 336.333 -66.667 321 -98 c 128 + 305.667 -129.333 289 -156 271 -178 c 1 + 255 -199.333 234 -213.666 208 -221 c 1 + 189 -223 l 1 + 167.667 -223 151.667 -214.333 141 -197 c 0 + 137 -191.667 134 -186.667 132 -182 c 128 + 130 -177.334 128 -171.667 126 -165 c 128 + 124 -158.334 123 -148.667 123 -136 c 0 + 123 -117.333 127 -103.333 135 -94 c 128 + 143 -84.667 153.667 -76.333 167 -69 c 1 + 172.333 -69 177 -70 181 -72 c 128 + 185 -74 189.333 -78 194 -84 c 0 + 201.333 -93.333 205 -104.667 205 -118 c 0 + 205 -132.667 194.333 -154.333 173 -183 c 1 + 173 -187.667 176 -190 182 -190 c 0 + 216 -190 243.333 -143.667 264 -51 c 1 + 271 -22 l 1 + 284 38 l 1 + 306 140 l 1 + 323 220 l 1 + 162 220 l 1 + 154 166.667 139.667 106.667 119 40 c 0 + 107 0.666992 98.333 -26 93 -40 c 0 + 85 -61.333 76.667 -80.667 68 -98 c 1 + 35.333 -170 -1.33301 -211 -42 -221 c 1 + -60 -223 l 1 + -81.3311 -223 -97.6641 -214.333 -109 -197 c 1 + -114.333 -191 -119.333 -181.667 -124 -169 c 1 + -124.667 -163.667 -125.333 -158.667 -126 -154 c 128 + -126.667 -149.333 -127.333 -143.333 -128 -136 c 1 + -126.667 -124.667 -125.333 -115.667 -124 -109 c 128 + -122.667 -102.333 -119.667 -96 -115 -90 c 0 + -108.333 -81.333 -97.333 -74.333 -82 -69 c 1 + -71.3379 -69 -62.6719 -74 -56 -84 c 128 + -49.3428 -94 -45.6758 -105.333 -45 -118 c 0 + -45 -125.333 -45.667 -130.667 -47 -134 c 128 + -48.333 -137.332 -49.333 -139.666 -50 -141 c 2 + -64 -164 l 1 + -79 -183 l 1 + -79 -187.667 -75.667 -190 -69 -190 c 0 + -57.667 -190 -47.333 -185 -38 -175 c 0 + -34.667 -171.667 -31 -167 -27 -161 c 128 + -23 -155 -19 -148 -15 -140 c 1 + -1 -104 l 1 + 14 -51 l 1 + 33 35 l 1 + 55 140 l 1 + 72 220 l 1 + 15 220 l 1 + 15 258 l 1 + 85 258 l 1 + 94.333 289.334 107 318.667 123 346 c 128 + 139 373.333 160.667 397 188 417 c 1 + 212.667 433.667 240.333 442 271 442 c 0 + 286.333 442 298.333 435.667 307 423 c 128 + 315.667 410.333 320 394.666 320 376 c 128 + 320 357.333 315.667 340.666 307 326 c 128 + 298.334 311.332 285.667 302.665 269 300 c 1 + 252.333 300 243 310.667 241 332 c 1 + 241 343.335 244.333 355.668 251 369 c 1 + 257.667 380.335 266.667 388.668 278 394 c 1 + 281.333 396.667 283 398.667 283 400 c 1 + 279.667 404.667 277.333 407.667 276 409 c 0 + 271.333 412.333 265.333 414 258 414 c 0 + 236 414 218 398.333 204 367 c 128 + 190 335.667 179 300 171 260 c 1 + 335 260 l 1 + 348.333 309.333 371.667 352 405 388 c 128 + 438.333 424 477 442 521 442 c 0 + 529 442 536 440.667 542 438 c 128 + 548 435.333 553 430 557 422 c 1 + 559.667 418.667 562.333 413 565 405 c 128 + 567.667 397 569.333 387.333 570 376 c 1 + 570 357.333 565.667 341 557 327 c 128 + 548.333 313 536 304 520 300 c 1 + 502 300 492 310.667 490 332 c 0 + 490 338 491 344 493 350 c 128 + 495 356 497.667 362 501 368 c 128 + 504.333 374 508 379 512 383 c 128 + 516 387 521 390.667 527 394 c 1 + 530.333 396.667 532 398.667 532 400 c 1 + 526 409 l 1 + 521.333 412.333 515.667 414 509 414 c 0 + 471.667 414 442.333 362 421 258 c 1 + 496 258 l 1 + 496 220 l 1 +EndSplineSet +EndChar + +StartChar: uniE531 +Encoding: 58673 58673 87 +Width: 1013 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +612 -69 m 4 + 633.386 -69 647 -99.9216 647 -120 c 4 + 647 -140.113 634.398 -151.813 626 -165 c 132 + 621.336 -172.333 617.67 -177 615 -179 c 4 + 609.479 -186.362 613.662 -188.966 624 -190 c 5 + 659.075 -190 678.221 -135.5 691 -101 c 132 + 697.667 -83 702.667 -65.667 706 -49 c 4 + 726.706 39.2938 744.664 130.336 764 220 c 5 + 621 220 l 5 + 614 176 606 136 595 99 c 5 + 577 24 556 -42 529 -98 c 5 + 514 -126 498 -153 479 -177 c 4 + 463 -198 443 -213 418 -221 c 5 + 400 -223 l 5 + 365 -223 347 -200 338 -169 c 5 + 334 -159 332 -148 332 -136 c 5 + 336 -99 347 -79 378 -69 c 5 + 401 -69 413 -92 414 -116 c 4 + 414 -124 410 -139 405 -147 c 6 + 395 -162 l 6 + 388 -172 387 -174 382 -183 c 5 + 382 -188 385 -190 392 -190 c 4 + 411 -190 427 -176 440 -148 c 5 + 453 -116 463 -88 473 -51 c 5 + 487 11 500 72 514 134 c 5 + 532 220 l 5 + 392 220 l 5 + 378 131 332 -36 299 -98 c 5 + 284 -129 269 -155 252 -177 c 132 + 235 -199 214 -214 187 -221 c 5 + 169 -223 l 5 + 125 -223 102 -183 102 -136 c 4 + 102 -97 120 -83 147 -69 c 5 + 153 -69 158 -70 161 -73 c 5 + 175.846 -78.9384 184 -98.0512 184 -118 c 4 + 184 -133 173 -154 152 -183 c 5 + 152 -188 155 -190 161 -190 c 4 + 195 -190 222 -144 243 -51 c 5 + 264.424 37.7557 282.772 129.774 302 220 c 5 + 161 220 l 5 + 148 135 99 -35 68 -98 c 5 + 35 -170 -2 -211 -42 -221 c 5 + -61 -223 l 5 + -96 -223 -112 -199 -124 -169 c 5 + -129 -136 l 5 + -124 -97 -116 -81 -83 -69 c 5 + -60 -69 -45 -95 -45 -118 c 4 + -45 -126 -47 -134 -51 -141 c 6 + -65 -164 l 5 + -79 -183 l 5 + -79 -188 -76 -190 -69 -190 c 4 + -58 -190 -48 -185 -39 -175 c 5 + -21 -160 -13 -129 -2 -104 c 5 + 13 -51 l 5 + 30 26 47 104 63 182 c 132 + 66 195 69 208 72 220 c 5 + 15 220 l 5 + 15 258 l 5 + 84 258 l 5 + 93 291 107 320 124 347 c 4 + 141 375 162 398 187 417 c 5 + 212 434 240 442 270 442 c 4 + 303 442 319 412 319 376 c 132 + 319 338 300 306 269 300 c 5 + 252 300 242 311 240 332 c 5 + 240 359 257 385 277 394 c 5 + 280 394 282 396 282 400 c 5 + 276 409 l 5 + 271 412 265 414 258 414 c 4 + 235 414 217 398 203 366 c 132 + 189 334 178 299 171 260 c 5 + 315 260 l 5 + 338 344 400 442 500 442 c 4 + 536 442 547 411 549 376 c 5 + 549 358 545 341 536 325 c 5 + 528 313 516 305 499 300 c 5 + 481 300 471 311 469 332 c 5 + 469 361 487 383 506 394 c 5 + 509 394 511 396 511 400 c 5 + 507 410 500 414 488 414 c 4 + 451 414 421 362 400 258 c 5 + 544 258 l 5 + 559 307 583 351 616 390 c 4 + 647 426 685 444 730 444 c 4 + 764 444 779 408 779 374 c 4 + 779 337 760 306 728 300 c 5 + 712 300 703 311 701 332 c 5 + 701 358 719 384 736 394 c 5 + 740 394 742 396 742 400 c 5 + 737 409 731 414 718 414 c 4 + 681 414 651 362 630 258 c 5 + 776 258 l 5 + 789.429 295.847 798.957 322.661 816 349 c 4 + 836.666 379 858.333 402 881 418 c 132 + 903.667 434 928.667 442 956 442 c 4 + 984.318 442 1001.6 428.326 1007 404 c 6 + 1011 388 l 5 + 1011 354.861 1010 351.993 998 328 c 4 + 994.862 320.94 980.617 302.946 967 301 c 132 + 962.333 300.333 956.667 300.333 950 301 c 4 + 937.394 303.801 933.434 318.612 931 332 c 5 + 931 359.28 942.325 376.216 960 388 c 6 + 974 398 l 5 + 974 406.667 968 412 956 414 c 4 + 942.667 415.33 931.333 412.663 922 406 c 132 + 912.667 399.333 903 385 893 363 c 5 + 886.086 345.222 867.1 279.121 862 260 c 5 + 939 260 l 5 + 939 220 l 5 + 854 220 l 5 + 834.986 111.195 793.939 -34.5584 751 -117 c 4 + 727.343 -163.132 686.698 -223 634 -223 c 4 + 589.383 -223 563 -186.317 563 -140 c 4 + 563 -108.178 578.31 -69 612 -69 c 4 +EndSplineSet +EndChar + +StartChar: uniE532 +Encoding: 58674 58674 88 +Width: 1245 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +998 220 m 1 + 954 12 l 1 + 940 -49 l 2 + 936.667 -65.667 931.667 -83 925 -101 c 128 + 918.333 -119 911.667 -135 905 -149 c 0 + 892.333 -176.333 876.667 -190 858 -190 c 1 + 851.333 -189.333 847.667 -188 847 -186 c 128 + 846.333 -184 847 -181.667 849 -179 c 1 + 851.67 -177 855.336 -172.333 860 -165 c 128 + 864.67 -157.667 869.336 -150.667 874 -144 c 128 + 878.667 -137.333 881 -129.333 881 -120 c 0 + 881 -115.333 880 -109.667 878 -103 c 128 + 876 -96.333 872.333 -89 867 -81 c 128 + 861.667 -73 854.667 -69 846 -69 c 0 + 839.333 -69 832.667 -71 826 -75 c 128 + 819.333 -79 813.667 -84.667 809 -92 c 1 + 801 -107.333 797 -123.333 797 -140 c 0 + 797 -160.667 802 -178.667 812 -194 c 0 + 824.667 -213.333 843.334 -223 868 -223 c 0 + 894 -223 919.333 -208.667 944 -180 c 0 + 958 -164 971.667 -143 985 -117 c 0 + 1001.67 -85 1019 -41.333 1037 14 c 0 + 1059 82.667 1076 151.333 1088 220 c 1 + 1173 220 l 1 + 1173 260 l 1 + 1096 260 l 1 + 1098.67 270 1103.33 286.667 1110 310 c 128 + 1116.67 333.333 1122.33 351 1127 363 c 1 + 1137 385 1146.67 399.333 1156 406 c 128 + 1165.33 412.663 1176.67 415.33 1190 414 c 1 + 1202 412 1208 406.667 1208 398 c 1 + 1201 393 1201 393 1194 388 c 0 + 1184 381.333 1176.67 373.333 1172 364 c 128 + 1167.33 354.667 1165 344 1165 332 c 1 + 1166.33 324.667 1168.33 318 1171 312 c 128 + 1173.67 306 1178 302.333 1184 301 c 1 + 1190.67 300.333 1196.33 300.333 1201 301 c 128 + 1205.67 301.667 1210 303.667 1214 307 c 0 + 1223.33 315 1229.33 322 1232 328 c 0 + 1238 340 1241.67 349.333 1243 356 c 128 + 1244.33 362.666 1245 373.333 1245 388 c 1 + 1241 404 l 2 + 1239.67 410 1236.67 416.333 1232 423 c 0 + 1225.33 431.667 1219 437 1213 439 c 128 + 1207 441 1199.33 442 1190 442 c 0 + 1162.67 442 1137.67 434 1115 418 c 128 + 1092.33 402 1070.67 379 1050 349 c 0 + 1042.67 337.667 1035.33 323 1028 305 c 0 + 1023.33 294.333 1017.33 278.667 1010 258 c 1 + 862 258 l 1 + 867.1 277.121 886.086 345.222 893 363 c 1 + 903 385 912.667 399.333 922 406 c 128 + 931.333 412.663 942.667 415.33 956 414 c 0 + 968 412 974 406.667 974 398 c 1 + 960 388 l 2 + 942.325 376.216 931 359.28 931 332 c 1 + 933.434 318.612 937.394 303.801 950 301 c 0 + 956.667 300.333 962.333 300.333 967 301 c 128 + 980.617 302.946 994.862 320.94 998 328 c 0 + 1010 351.993 1011 354.861 1011 388 c 1 + 1007 404 l 2 + 1001.6 428.326 984.318 442 956 442 c 0 + 928.667 442 903.667 434 881 418 c 128 + 858.333 402 836.666 379 816 349 c 0 + 798.957 322.661 789.429 295.847 776 258 c 1 + 630 258 l 1 + 651 362 681 414 718 414 c 0 + 731 414 737 409 742 400 c 1 + 742 396 740 394 736 394 c 1 + 719 384 701 358 701 332 c 1 + 703 311 712 300 728 300 c 1 + 760 306 779 337 779 374 c 0 + 779 408 764 444 730 444 c 0 + 685 444 647 426 616 390 c 0 + 583 351 559 307 544 258 c 1 + 400 258 l 1 + 421 362 451 414 488 414 c 0 + 500 414 507 410 511 400 c 1 + 511 396 509 394 506 394 c 1 + 487 383 469 361 469 332 c 1 + 471 311 481 300 499 300 c 1 + 516 305 528 313 536 325 c 1 + 545 341 549 358 549 376 c 1 + 547 411 536 442 500 442 c 0 + 400 442 338 344 315 260 c 1 + 171 260 l 1 + 178 299 189 334 203 366 c 128 + 217 398 235 414 258 414 c 0 + 265 414 271 412 276 409 c 1 + 282 400 l 1 + 282 396 280 394 277 394 c 1 + 257 385 240 359 240 332 c 1 + 242 311 252 300 269 300 c 1 + 300 306 319 338 319 376 c 128 + 319 412 303 442 270 442 c 0 + 240 442 212 434 187 417 c 1 + 162 398 141 375 124 347 c 0 + 107 320 93 291 84 258 c 1 + 15 258 l 1 + 15 220 l 1 + 72 220 l 1 + 69 208 66 195 63 182 c 128 + 47 104 30 26 13 -51 c 1 + -2 -104 l 1 + -13 -129 -21 -160 -39 -175 c 1 + -48 -185 -58 -190 -69 -190 c 0 + -76 -190 -79 -188 -79 -183 c 1 + -65 -164 l 1 + -51 -141 l 2 + -47 -134 -45 -126 -45 -118 c 0 + -45 -95 -60 -69 -83 -69 c 1 + -116 -81 -124 -97 -129 -136 c 1 + -124 -169 l 1 + -112 -199 -96 -223 -61 -223 c 1 + -42 -221 l 1 + -2 -211 35 -170 68 -98 c 1 + 99 -35 148 135 161 220 c 1 + 302 220 l 1 + 282.772 129.774 264.424 37.7557 243 -51 c 1 + 222 -144 195 -190 161 -190 c 0 + 155 -190 152 -188 152 -183 c 1 + 173 -154 184 -133 184 -118 c 0 + 184 -98.0512 175.846 -78.9384 161 -73 c 1 + 158 -70 153 -69 147 -69 c 1 + 120 -83 102 -97 102 -136 c 0 + 102 -183 125 -223 169 -223 c 1 + 187 -221 l 1 + 214 -214 235 -199 252 -177 c 128 + 269 -155 284 -129 299 -98 c 1 + 332 -36 378 131 392 220 c 1 + 532 220 l 1 + 514 134 l 1 + 500 72 487 11 473 -51 c 1 + 463 -88 453 -116 440 -148 c 1 + 427 -176 411 -190 392 -190 c 0 + 385 -190 382 -188 382 -183 c 1 + 387 -174 388 -172 395 -162 c 2 + 405 -147 l 2 + 410 -139 414 -124 414 -116 c 0 + 413 -92 401 -69 378 -69 c 1 + 347 -79 336 -99 332 -136 c 1 + 332 -148 334 -159 338 -169 c 1 + 347 -200 365 -223 400 -223 c 1 + 418 -221 l 1 + 443 -213 463 -198 479 -177 c 0 + 498 -153 514 -126 529 -98 c 1 + 556 -42 577 24 595 99 c 1 + 606 136 614 176 621 220 c 1 + 764 220 l 1 + 744.664 130.336 726.706 39.2938 706 -49 c 0 + 702.667 -65.667 697.667 -83 691 -101 c 128 + 678.221 -135.5 659.075 -190 624 -190 c 1 + 613.662 -188.966 609.479 -186.362 615 -179 c 0 + 617.67 -177 621.336 -172.333 626 -165 c 128 + 634.398 -151.813 647 -140.113 647 -120 c 0 + 647 -99.9216 633.386 -69 612 -69 c 0 + 578.31 -69 563 -108.178 563 -140 c 0 + 563 -186.317 589.383 -223 634 -223 c 0 + 686.698 -223 727.343 -163.132 751 -117 c 0 + 793.939 -34.5584 834.986 111.195 854 220 c 1 + 998 220 l 1 +EndSplineSet +EndChar + +StartChar: u +Encoding: 117 117 89 +Width: 322 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 265 m 5 + 322 265 l 5 + 322 -2 l 5 + 270 -2 l 5 + 270 189 l 5 + 52 189 l 5 + 52 -2 l 5 + 0 -2 l 5 + 0 265 l 5 +EndSplineSet +EndChar + +StartChar: NameMe.58897 +Encoding: 1114112 -1 90 +Width: 322 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 -2 m 5 + 322 -2 l 5 + 322 265 l 5 + 270 265 l 5 + 270 74 l 5 + 52 74 l 5 + 52 265 l 5 + 0 265 l 5 + 0 -2 l 5 +EndSplineSet +EndChar + +StartChar: NameMe.58898 +Encoding: 1114113 -1 91 +Width: 263 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 418 m 5 + 36 418 l 5 + 130 104 l 5 + 226 418 l 5 + 262 418 l 5 + 130 0 l 5 + 0 418 l 5 +EndSplineSet +EndChar + +StartChar: NameMe.58899 +Encoding: 1114114 -1 92 +Width: 263 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 418 m 5 + 36 418 l 5 + 130 104 l 5 + 226 418 l 5 + 262 418 l 5 + 130 0 l 5 + 0 418 l 5 +EndSplineSet +EndChar + +StartChar: uniE4A0 +Encoding: 58528 58528 93 +Width: 347 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 236 m 5 + 347 117 l 5 + 0 0 l 5 + 0 28 l 5 + 257 117 l 5 + 0 208 l 5 + 0 236 l 5 +EndSplineSet +EndChar + +StartChar: uniE4A1 +Encoding: 58529 58529 94 +Width: 347 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 -236 m 5 + 347 -117 l 5 + 0 0 l 5 + 0 -28 l 5 + 257 -117 l 5 + 0 -208 l 5 + 0 -236 l 5 +EndSplineSet +EndChar + +StartChar: uniE4A8 +Encoding: 58536 58536 95 +Width: 153 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +153 214 m 5 + 116 214 l 5 + 106 210 97.333 200 90 184 c 4 + 86.667 176.667 82 172 76 170 c 5 + 72 171.333 65.333 180 56 196 c 4 + 51.333 204.667 44.667 210.667 36 214 c 5 + 0 214 l 5 + 76 0 l 5 + 153 214 l 5 +EndSplineSet +EndChar + +StartChar: uniE4A9 +Encoding: 58537 58537 96 +Width: 153 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +153 -214 m 1 + 116 -214 l 1 + 106 -210 97.333 -200 90 -184 c 0 + 86.667 -176.667 82 -172 76 -170 c 1 + 72 -171.333 65.333 -180 56 -196 c 0 + 51.333 -204.667 44.667 -210.667 36 -214 c 1 + 0 -214 l 1 + 76 0 l 1 + 153 -214 l 1 +EndSplineSet +EndChar + +StartChar: uniE4AA +Encoding: 58538 58538 97 +Width: 1000 +VWidth: 0 +Flags: HW +LayerCount: 2 +EndChar + +StartChar: uniE4AB +Encoding: 58539 58539 98 +Width: 274 +VWidth: 2048 +Flags: HW +LayerCount: 2 +EndChar + +StartChar: uniE568 +Encoding: 58728 58728 99 +Width: 468 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +468 126 m 4 + 468 195.355 430.486 242.042 362 244 c 4 + 339.333 244 318.333 239 299 229 c 5 + 278.398 216.323 254.209 196.949 235 180 c 5 + 212.439 156.228 189.186 133.147 166 110 c 5 + 150 96 135 85 121 77 c 132 + 107 69 94.667 64.667 84 64 c 4 + 64.2417 64 56.2814 77.5628 47 92 c 5 + 35 118 l 6 + 31.667 127.333 30 133.667 30 137 c 134 + 30 145 l 6 + 30 173.667 43.333 188 70 188 c 5 + 79 186 l 5 + 90 177 l 5 + 97 170 l 5 + 103.447 165.97 111.151 162 121 162 c 4 + 138.333 162 149.333 171.333 154 190 c 5 + 154 224.187 127.229 242.58 96 244 c 5 + 73.1704 244 70.2894 244.34 55 236 c 5 + 22.0184 222.418 0 182.422 0 139 c 4 + 0 88.5491 20.6276 52.237 49 25 c 5 + 67 10.333 85.333 2 104 0 c 5 + 130 0 155 7 179 21 c 4 + 187.667 26.333 193.667 30 197 32 c 6 + 215 47 l 134 + 223.638 54.1975 240.24 69.1328 248 78 c 6 + 313 145 l 5 + 323 154 l 5 + 345 170 l 5 + 358.333 177.333 370.667 181 382 181 c 4 + 419.101 181 437 145.129 437 111 c 4 + 437 83.0401 425.03 56 398 56 c 5 + 391.647 58.1187 387.309 60.7935 381 65 c 6 + 363 78 l 6 + 359.667 80.667 353.667 82 345 82 c 4 + 325.549 82 315.324 64.7595 313 45 c 5 + 313 16.949 341.285 3.28677 371 1 c 5 + 414.494 1 440.733 32.4674 456 63 c 132 + 464.667 80.333 468.667 101.333 468 126 c 4 +EndSplineSet +EndChar + +StartChar: uniE567 +Encoding: 58727 58727 100 +Width: 468 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +468 118 m 4 + 468 48.6445 430.486 1.95801 362 0 c 4 + 339.333 0 318.333 5 299 15 c 5 + 278.397 27.6768 254.209 47.0508 235 64 c 5 + 212.438 87.7725 189.187 110.854 166 134 c 5 + 150 148 135 159 121 167 c 132 + 107 175 94.667 179.333 84 180 c 4 + 64.2422 180 56.2812 166.438 47 152 c 5 + 35 126 l 6 + 31.667 116.667 30 110.333 30 107 c 134 + 30 99 l 6 + 30 70.333 43.333 56 70 56 c 5 + 79 58 l 5 + 90 67 l 5 + 97 74 l 5 + 103.447 78.0293 111.151 82 121 82 c 4 + 138.333 82 149.333 72.667 154 54 c 5 + 154 19.8125 127.229 1.41992 96 0 c 5 + 73.1699 0 70.2891 -0.339844 55 8 c 5 + 22.0186 21.582 0 61.5781 0 105 c 4 + 0 155.451 20.6279 191.763 49 219 c 5 + 67 233.667 85.333 242 104 244 c 5 + 130 244 155 237 179 223 c 4 + 187.667 217.667 193.667 214 197 212 c 6 + 215 197 l 134 + 223.638 189.803 240.24 174.867 248 166 c 6 + 313 99 l 5 + 323 90 l 5 + 345 74 l 5 + 358.333 66.667 370.667 63 382 63 c 4 + 419.102 63 437 98.8711 437 133 c 4 + 437 160.96 425.029 188 398 188 c 5 + 391.646 185.881 387.309 183.206 381 179 c 6 + 363 166 l 6 + 359.667 163.333 353.667 162 345 162 c 4 + 325.549 162 315.324 179.24 313 199 c 5 + 313 227.051 341.285 240.713 371 243 c 5 + 414.493 243 440.732 211.532 456 181 c 132 + 464.667 163.667 468.667 142.667 468 118 c 4 +EndSplineSet +EndChar + +StartChar: uniE56E +Encoding: 58734 58734 101 +Width: 711 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +710 134 m 1 + 601 7 l 2 + 598.333 3.66667 596 1.66667 594 1 c 128 + 591 0 591 0 588 -1 c 1 + 582.649 1 579.316 2.66667 578 4 c 2 + 489 82 l 2 + 484.33 86.6667 478.663 89.3333 472 90 c 1 + 468 88.6667 465.333 87.3333 464 86 c 2 + 398 7 l 1 + 394.667 1.66667 390.333 -1 385 -1 c 1 + 374 4 l 1 + 285 82 l 2 + 279 86.6667 273.667 89.3333 269 90 c 1 + 265 88.6667 262.333 87.3333 261 86 c 2 + 194 7 l 2 + 188.667 1.66667 184 -1 180 -1 c 0 + 178 -1 174.667 0.666667 170 4 c 2 + 82 82 l 2 + 76.6667 86.6667 71 89.3333 65 90 c 1 + 60.3333 88.6667 57.6667 87.3333 57 86 c 2 + 0 18 l 1 + 0 67 l 1 + 108 194 l 1 + 118 198 l 2 + 118.667 198 120 197.667 122 197 c 128 + 124 196.333 128 194 134 190 c 1 + 222 112 l 1 + 232 107 l 1 + 236 107 240.667 109.667 246 115 c 2 + 313 194 l 1 + 316.333 196.667 319 198 321 198 c 0 + 325.667 198 331 195.333 337 190 c 2 + 426 112 l 1 + 437 107 l 1 + 443 108 l 1 + 450 115 l 1 + 517 194 l 1 + 520.333 196.667 522.667 198 524 198 c 0 + 528 196.666 530.667 195.333 532 194 c 2 + 539 188 l 1 + 628 111 l 2 + 631.333 107.667 635 106 639 106 c 128 + 643 106 647.333 108.667 652 114 c 2 + 710 181 l 1 + 710 134 l 1 +EndSplineSet +EndChar + +StartChar: uniE56A +Encoding: 58730 58730 102 +Width: 248 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +126 468 m 4 + 195.355 468 242.042 430.486 244 362 c 4 + 244 339.333 239 318.333 229 299 c 5 + 216.323 278.397 196.949 254.209 180 235 c 5 + 156.228 212.438 133.146 189.187 110 166 c 5 + 96 150 85 135 77 121 c 132 + 69 107 64.667 94.667 64 84 c 4 + 64 64.2422 77.5625 56.2812 92 47 c 5 + 118 35 l 6 + 127.333 31.667 133.667 30 137 30 c 134 + 145 30 l 6 + 173.667 30 188 43.333 188 70 c 5 + 186 79 l 5 + 177 90 l 5 + 170 97 l 5 + 165.971 103.447 162 111.151 162 121 c 4 + 162 138.333 171.333 149.333 190 154 c 5 + 224.188 154 242.58 127.229 244 96 c 5 + 244 73.1699 244.34 70.2891 236 55 c 5 + 222.418 22.0186 182.422 0 139 0 c 4 + 88.5488 0 52.2373 20.6279 25 49 c 5 + 10.333 67 2 85.333 0 104 c 5 + 0 130 7 155 21 179 c 4 + 26.333 187.667 30 193.667 32 197 c 6 + 47 215 l 134 + 54.1973 223.638 69.1328 240.24 78 248 c 6 + 145 313 l 5 + 154 323 l 5 + 170 345 l 5 + 177.333 358.333 181 370.667 181 382 c 4 + 181 419.102 145.129 437 111 437 c 4 + 83.04 437 56 425.029 56 398 c 5 + 58.1191 391.646 60.7939 387.309 65 381 c 6 + 78 363 l 6 + 80.667 359.667 82 353.667 82 345 c 4 + 82 325.549 64.7598 315.324 45 313 c 5 + 16.9492 313 3.28711 341.285 1 371 c 5 + 1 414.493 32.4678 440.732 63 456 c 132 + 80.333 464.667 101.333 468.667 126 468 c 4 +EndSplineSet +EndChar + +StartChar: uniE569 +Encoding: 58729 58729 103 +Width: 248 +VWidth: 2048 +Flags: HW +LayerCount: 2 +EndChar + +StartChar: uniE4AC +Encoding: 58540 58540 104 +Width: 274 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +273 0 m 5 + 214 0 l 5 + 106 180 l 5 + 24 0 l 5 + 0 0 l 5 + 114 265 l 5 + 273 0 l 5 +EndSplineSet +EndChar + +StartChar: uniE4AD +Encoding: 58541 58541 105 +Width: 274 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +273 0 m 5 + 214 0 l 5 + 106 -180 l 5 + 24 0 l 5 + 0 0 l 5 + 114 -265 l 5 + 273 0 l 5 +EndSplineSet +EndChar + +StartChar: uniE56B +Encoding: 58731 58731 106 +Width: 248 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +118 468 m 4 + 48.6445 468 1.95801 430.486 0 362 c 4 + 0 339.333 5 318.333 15 299 c 5 + 27.6768 278.397 47.0508 254.209 64 235 c 5 + 87.7725 212.438 110.854 189.187 134 166 c 5 + 148 150 159 135 167 121 c 132 + 175 107 179.333 94.667 180 84 c 4 + 180 64.2422 166.438 56.2812 152 47 c 5 + 126 35 l 6 + 116.667 31.667 110.333 30 107 30 c 134 + 99 30 l 6 + 70.333 30 56 43.333 56 70 c 5 + 58 79 l 5 + 67 90 l 5 + 74 97 l 5 + 78.0293 103.447 82 111.151 82 121 c 4 + 82 138.333 72.667 149.333 54 154 c 5 + 19.8125 154 1.41992 127.229 0 96 c 5 + 0 73.1699 -0.339844 70.2891 8 55 c 5 + 21.582 22.0186 61.5781 0 105 0 c 4 + 155.451 0 191.763 20.6279 219 49 c 5 + 233.667 67 242 85.333 244 104 c 5 + 244 130 237 155 223 179 c 4 + 217.667 187.667 214 193.667 212 197 c 6 + 197 215 l 134 + 189.803 223.638 174.867 240.24 166 248 c 6 + 99 313 l 5 + 90 323 l 5 + 74 345 l 5 + 66.667 358.333 63 370.667 63 382 c 4 + 63 419.102 98.8711 437 133 437 c 4 + 160.96 437 188 425.029 188 398 c 5 + 185.881 391.646 183.206 387.309 179 381 c 6 + 166 363 l 6 + 163.333 359.667 162 353.667 162 345 c 4 + 162 325.549 179.24 315.324 199 313 c 5 + 227.051 313 240.713 341.285 243 371 c 5 + 243 414.493 211.532 440.732 181 456 c 132 + 163.667 464.667 142.667 468.667 118 468 c 4 +EndSplineSet +EndChar EndChars EndSplineFont diff --git a/fonts/Leipzig.svg b/fonts/Leipzig.svg index 43d799fd2cc..8f24098d36a 100644 --- a/fonts/Leipzig.svg +++ b/fonts/Leipzig.svg @@ -5,12 +5,12 @@ --> -Created by FontForge 20120731 at Tue Jan 6 16:47:08 2015 +Created by FontForge 20120731 at Sun Aug 16 18:52:26 2015 By laurent Created by Etienne Darbellay, Jean-Francois Marti and Laurent Pugin with FontForge 2.0. This font is licensed under the SIL Open Font License \(http://scripts.sil.org/OFL\). - + - - - - - - - - @@ -259,15 +260,203 @@ c-13 -5 -21 -8 -37 -8c-43 0 -69 29 -69 72c0 33 11 63 32 90s52 41 91 41zM167 264c d="M18 208c0 -27 17 -47 45 -47l3 -2l13 4l23 9l14 55c-17 15 -35 22 -55 22c-26 0 -43 -17 -43 -41zM432 225c0 -21 -11 -36 -31 -37c-15 0 -20 10 -23 25l3 14l2 11l1 9l-4 4c-1 -1 -2 -1 -3 -1c-23 -13 -36 -24 -47 -48l-12 -27c-18 -50 -31 -105 -47 -157h-60l58 214 c0 7 -3 5 -5 9c-7 0 -25 -8 -51 -28l-43 -33l5 6c21 -35 32 -68 32 -98c0 -12 -1 -21 -4 -28l-6 -15c-1 -3 -5 -10 -12 -19c-14 -18 -30 -26 -49 -26c-30 0 -67 18 -67 52c1 1 1 6 3 15l20 84c-9 -5 -21 -8 -36 -8c-21 0 -29 7 -40 19c-10 12 -16 27 -16 47c0 23 6 33 17 45 s25 18 46 18c19 0 39 -8 60 -25l34 117h63l-46 -158l38 31l32 20c21 10 35 13 62 15c16 0 24 -7 24 -21l-1 -10l-6 -24c21 37 44 55 70 55c23 0 39 -23 39 -47zM162 167l-36 -115l-1 -10c0 -10 5 -16 16 -19c32 18 48 43 48 75c0 20 -9 43 -27 69z" /> - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/fonts/supported.xsl b/fonts/supported.xsl index a5a3787f519..d7307870583 100644 --- a/fonts/supported.xsl +++ b/fonts/supported.xsl @@ -68,13 +68,13 @@ - - - - + + + + - + U+E04F @@ -554,11 +554,11 @@ Tremolos - - - - - + + + + + @@ -1108,20 +1108,20 @@ Articulation - - + --> + --> - - + + - - + + @@ -1196,7 +1196,7 @@ Bar repeats - + U+E50F @@ -1221,12 +1221,12 @@ Dynamics - - - - - - + + + + + + @@ -1236,10 +1236,10 @@ - - - - + + + + @@ -1277,14 +1277,14 @@ - - + + - - + + - + U+E56F U+E560 @@ -1505,12 +1505,12 @@ Keyboard techniques - + - + @@ -2015,7 +2015,7 @@ - + U+E88F U+E880 diff --git a/include/vrv/smufl.h b/include/vrv/smufl.h index 7e9a3785836..642391fca94 100644 --- a/include/vrv/smufl.h +++ b/include/vrv/smufl.h @@ -24,6 +24,11 @@ namespace vrv { enum { SMUFL_E003_bracketTop = 0xE003, SMUFL_E004_bracketBottom = 0xE004, + SMUFL_E045_dalSegno = 0xE045, + SMUFL_E046_daCapo = 0xE046, + SMUFL_E047_segno = 0xE047, + SMUFL_E048_coda = 0xE048, + SMUFL_E04B_segnoSerpent2 = 0xE04B, SMUFL_E050_gClef = 0xE050, SMUFL_E051_gClef15mb = 0xE051, SMUFL_E052_gClef8vb = 0xE052, @@ -52,6 +57,11 @@ enum { SMUFL_E0A3_noteheadHalf = 0xE0A3, SMUFL_E0A4_noteheadBlack = 0xE0A4, SMUFL_E0FA_noteheadWholeFilled = 0xE0FA, + SMUFL_E220_tremolo1 = 0xE220, + SMUFL_E221_tremolo2 = 0xE221, + SMUFL_E222_tremolo3 = 0xE222, + SMUFL_E223_tremolo4 = 0xE223, + SMUFL_E224_tremolo5 = 0xE224, SMUFL_E240_flag8thUp = 0xE240, SMUFL_E241_flag8thDown = 0xE241, SMUFL_E260_accidentalFlat = 0xE260, @@ -66,6 +76,12 @@ enum { SMUFL_E269_accidentalSharpSharp = 0xE269, SMUFL_E26A_accidentalParensLeft = 0xE26A, SMUFL_E26B_accidentalParensRight = 0xE26B, + SMUFL_E4A0_articAccentAbove = 0xE4A0, + SMUFL_E4A1_articAccentBelow = 0xE4A1, + SMUFL_E4A8_articStaccatissimoWedgeAbove = 0xE4A8, + SMUFL_E4A9_articStaccatissimoWedgeBelow = 0xE4A9, + SMUFL_E4AC_articMarcatoAbove = 0xE4AC, + SMUFL_E4AD_articMarcatoBelow = 0xE4AD, SMUFL_E4C0_fermataAbove = 0xE4C0, SMUFL_E4C1_fermataBelow = 0xE4C1, SMUFL_E4E5_restQuarter = 0xE4E5, @@ -74,9 +90,27 @@ enum { SMUFL_E4E8_rest32nd = 0xE4E8, SMUFL_E4E9_rest64th = 0xE4E9, SMUFL_E4EA_rest128th = 0xE4EA, + SMUFL_E500_repeat1Bar = 0xE500, + SMUFL_E520_dynamicPiano = 0xE520, + SMUFL_E521_dynamicMezzo = 0xE521, + SMUFL_E522_dynamicForte = 0xE522, + SMUFL_E523_dynamicRinforzando = 0xE523, + SMUFL_E524_dynamicSforzando = 0xE524, + SMUFL_E525_dynamicZ = 0xE525, + SMUFL_E52F_dynamicFF = 0xE52F, + SMUFL_E530_dynamicFFF = 0xE530, + SMUFL_E531_dynamicFFFF = 0xE531, + SMUFL_E532_dynamicFFFFF = 0xE532, SMUFL_E566_ornamentTrill = 0xE566, + SMUFL_E567_ornamentTurn = 0xE567, + SMUFL_E568_ornamentTurnInverted = 0xE568, + SMUFL_E56A_ornamentTurnUp = 0xE56A, + SMUFL_E56B_ornamentTurnUpS = 0xE56B, SMUFL_E56C_ornamentMordent = 0xE56C, SMUFL_E56D_ornamentMordentInverted = 0xE56D, + SMUFL_E56E_ornamentTremblement = 0xE56E, + SMUFL_E650_keyboardPedalPed = 0xE650, + SMUFL_E655_keyboardPedalUp = 0xE655, SMUFL_E880_tuplet0 = 0xE880, SMUFL_E881_tuplet1 = 0xE881, SMUFL_E882_tuplet2 = 0xE882, @@ -87,10 +121,11 @@ enum { SMUFL_E887_tuplet7 = 0xE887, SMUFL_E888_tuplet8 = 0xE888, SMUFL_E889_tuplet9 = 0xE889, + SMUFL_E88A_tupletColon = 0xE88A, }; /** The number of glyphs for verification **/ -#define SMUFL_COUNT 65 +#define SMUFL_COUNT 100 } // vrv namespace From bbf5ddc11e5b1acc3f7431a205f98152ed392de5 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Mon, 17 Aug 2015 08:11:50 +0200 Subject: [PATCH 064/114] Removing unused font ascent corruption --- include/vrv/devicecontext.h | 4 +--- include/vrv/doc.h | 2 -- src/bboxdevicecontext.cpp | 4 +--- src/doc.cpp | 7 ------- src/svgdevicecontext.cpp | 3 --- src/view_graph.cpp | 17 ++--------------- 6 files changed, 4 insertions(+), 33 deletions(-) diff --git a/include/vrv/devicecontext.h b/include/vrv/devicecontext.h index be3c52f324d..08f6840ca31 100644 --- a/include/vrv/devicecontext.h +++ b/include/vrv/devicecontext.h @@ -44,7 +44,7 @@ class DeviceContext * @name Constructors, destructors, and other standard methods */ ///@{ - DeviceContext () { m_correctMusicAscent = true; m_drawingBoundingBoxes = false; m_isDeactivated = false; }; + DeviceContext () { m_drawingBoundingBoxes = false; m_isDeactivated = false; }; virtual ~DeviceContext() {}; ///@} @@ -80,7 +80,6 @@ class DeviceContext */ ///@{ virtual Point GetLogicalOrigin( ) = 0; - virtual bool CorrectMusicAscent( ) { return m_correctMusicAscent; }; ///@} /** @@ -173,7 +172,6 @@ class DeviceContext protected: - bool m_correctMusicAscent; // specify if the ascent has to be correct when view the music font (true wxDC, false SVG) bool m_drawingBoundingBoxes; /** * Flag for indicating if the VerovioText font is currently used. diff --git a/include/vrv/doc.h b/include/vrv/doc.h index d27c4a2d850..46c935398ef 100644 --- a/include/vrv/doc.h +++ b/include/vrv/doc.h @@ -240,8 +240,6 @@ class Doc: public Object int m_drawingOctaveSize[2]; /** Font height (100 par defaut) */ int m_drawingFontHeight; - /** Font height with ascent for normal and small staff and normal and grace size */ - int m_drawingFontHeightAscent[2][2]; /** Normal and small staff ration (4 / 5 by default) */ int m_drawingSmallStaffRatio[2]; /** Normal and grace size (3 / 4 by default) */ diff --git a/src/bboxdevicecontext.cpp b/src/bboxdevicecontext.cpp index 959f33f573a..08f18b2682d 100644 --- a/src/bboxdevicecontext.cpp +++ b/src/bboxdevicecontext.cpp @@ -33,9 +33,7 @@ static inline double DegToRad(double deg) { return (deg * M_PI) / 180.0; } BBoxDeviceContext::BBoxDeviceContext ( View *view, int width, int height): DeviceContext() -{ - m_correctMusicAscent = false; // do not correct the ascent in the music font - +{ m_view = view; m_width = width; m_height = height; diff --git a/src/doc.cpp b/src/doc.cpp index 18a445021b0..479356474df 100644 --- a/src/doc.cpp +++ b/src/doc.cpp @@ -538,13 +538,6 @@ Page *Doc::SetDrawingPage( int pageIdx ) m_drawingFontHeight = CalcMusicFontSize(); - /* - m_drawingFontHeightAscent[0][0] = floor(LEIPZIG_ASCENT * (double)m_drawingFontHeight / LEIPZIG_UNITS_PER_EM); - m_drawingFontHeightAscent[0][1] = (m_drawingFontHeightAscent[0][0] * m_drawingGraceRatio[0]) / m_drawingGraceRatio[1]; - m_drawingFontHeightAscent[1][0] = (m_drawingFontHeightAscent[0][0] * m_drawingSmallStaffRatio[0]) / m_drawingSmallStaffRatio[1]; - m_drawingFontHeightAscent[1][1] = (m_drawingFontHeightAscent[1][0] * m_drawingGraceRatio[0]) / m_drawingGraceRatio[1]; - */ - m_drawingSmuflFonts[0][0].SetPointSize( m_drawingFontHeight ); m_drawingSmuflFonts[0][1].SetPointSize( (m_drawingFontHeight * m_drawingGraceRatio[0]) / m_drawingGraceRatio[1] ); m_drawingSmuflFonts[1][0].SetPointSize( (m_drawingFontHeight * m_drawingSmallStaffRatio[0]) / m_drawingSmallStaffRatio[1] ); diff --git a/src/svgdevicecontext.cpp b/src/svgdevicecontext.cpp index 865013ba163..743ecbc01ba 100644 --- a/src/svgdevicecontext.cpp +++ b/src/svgdevicecontext.cpp @@ -41,9 +41,6 @@ static inline double DegToRad(double deg) { return (deg * M_PI) / 180.0; } SvgDeviceContext::SvgDeviceContext(int width, int height): DeviceContext() { - - m_correctMusicAscent = false; // do not correct the ascent in the music font - m_width = width; m_height = height; diff --git a/src/view_graph.cpp b/src/view_graph.cpp index 5092b72f316..4fdec2c7047 100644 --- a/src/view_graph.cpp +++ b/src/view_graph.cpp @@ -109,12 +109,6 @@ void View::DrawSmuflCode ( DeviceContext *dc, int x, int y, wchar_t code, int staffSize, bool dimin ) { assert( dc ); - - int fontCorr = 0; - - if (dc->CorrectMusicAscent()) { - fontCorr = m_doc->m_drawingFontHeightAscent[staffSize][dimin]; - } dc->SetBackground( AxBLUE ); dc->SetBackgroundMode( AxTRANSPARENT ); @@ -125,7 +119,7 @@ void View::DrawSmuflCode ( DeviceContext *dc, int x, int y, wchar_t code, dc->SetBrush( m_currentColour, AxSOLID ); dc->SetFont( &m_doc->m_drawingSmuflFonts[staffSize][dimin] ); - dc->DrawMusicText( str, ToDeviceContextX(x), ToDeviceContextY(y + fontCorr) ); + dc->DrawMusicText( str, ToDeviceContextX(x), ToDeviceContextY(y) ); dc->ResetFont(); dc->ResetBrush(); @@ -136,18 +130,11 @@ void View::DrawSmuflCode ( DeviceContext *dc, int x, int y, wchar_t code, void View::DrawSmuflString ( DeviceContext *dc, int x, int y, std::wstring s, int centrer, int staffSize) { assert( dc ); - - int fontCorr = 0; int xDC = ToDeviceContextX(x); - if (dc->CorrectMusicAscent()) { - fontCorr = m_doc->m_drawingFontHeightAscent[staffSize][0]; - } if ( centrer ) { - LogDebug("Centering string not implemented with DeviceContext"); - int w, h; dc->GetSmuflTextExtent( s, &w, &h ); xDC -= w / 2; @@ -156,7 +143,7 @@ void View::DrawSmuflString ( DeviceContext *dc, int x, int y, std::wstring s, in dc->SetBrush( m_currentColour, AxSOLID ); dc->SetFont( &m_doc->m_drawingSmuflFonts[staffSize][0] ); - dc->DrawMusicText( s, xDC, ToDeviceContextY(y + fontCorr )); + dc->DrawMusicText( s, xDC, ToDeviceContextY(y) ); dc->ResetFont(); dc->ResetBrush(); From c92acbaf93d9cab1dc986f8b9a73896c2ae0948a Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Mon, 17 Aug 2015 09:26:28 +0200 Subject: [PATCH 065/114] Adding methods for getting glyph size --- include/vrv/doc.h | 14 ++++++++++++++ src/doc.cpp | 26 +++++++++++++++++++++++++- src/view_element.cpp | 5 +++-- 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/include/vrv/doc.h b/include/vrv/doc.h index 46c935398ef..800905e5d82 100644 --- a/include/vrv/doc.h +++ b/include/vrv/doc.h @@ -68,6 +68,13 @@ class Doc: public Object * Get the total page count */ int GetPageCount( ); + + /* + * @name Get the height or width for a glyph taking into account the staff and grace sizes */ + ///@{ + int GetGlyphHeight( wchar_t smuflCode, int staffSize, bool graceSize ); + int GetGlyphWidth( wchar_t smuflCode, int staffSize, bool graceSize ); + ///@} /** * @name Setters for the page dimensions and margins @@ -194,6 +201,13 @@ class Doc: public Object */ int CalcMusicFontSize( ); + /** + * Get the glyph bounding box. + * Asserts the parameters and the glyph in the resources. + */ + void GetGlyphBoundingBox( wchar_t smuflCode, int *x, int *y, int *w, int *h ); + + public: diff --git a/src/doc.cpp b/src/doc.cpp index 479356474df..5976cc50c45 100644 --- a/src/doc.cpp +++ b/src/doc.cpp @@ -389,8 +389,32 @@ int Doc::GetPageCount( ) { return GetChildCount() ; } - +void Doc::GetGlyphBoundingBox( wchar_t smuflCode, int *x, int *y, int *w, int *h ) +{ + assert( x && y && w && h ); + Glyph *glyph; + glyph = Resources::GetGlyph( smuflCode ); + assert( glyph ); + glyph->GetBoundingBox( x, y, w, h ); +} + +int Doc::GetGlyphHeight( wchar_t smuflCode, int staffSize, bool graceSize ) +{ + int x, y, w, h; + this->GetGlyphBoundingBox( smuflCode, &x, &y, &w, &h); + if ( graceSize ) h = h * this->m_style->m_graceNum / this->m_style->m_graceDen; + return h; +} + +int Doc::GetGlyphWidth( wchar_t smuflCode, int staffSize, bool graceSize ) +{ + int x, y, w, h; + this->GetGlyphBoundingBox( smuflCode, &x, &y, &w, &h); + if ( graceSize ) w = w * this->m_style->m_graceNum / this->m_style->m_graceDen; + return w; +} + char Doc::GetLeftMargin( const ClassId classId ) { if (classId == BAR_LINE) return m_style->m_leftMarginBarline; diff --git a/src/view_element.cpp b/src/view_element.cpp index d40210a3dad..d7b0b98e930 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -244,8 +244,9 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St drawingDur = note->GetDrawingDur(); drawingDur = ((note->GetColored()==BOOLEAN_true) && drawingDur > DUR_1) ? (drawingDur+1) : drawingDur; - int radius = m_doc->m_drawingNoteRadius[staffSize][drawingCueSize]; - + //int radius = m_doc->m_drawingNoteRadius[staffSize][drawingCueSize]; + int radius = m_doc->GetGlyphHeight(SMUFL_E0A3_noteheadHalf, staffSize, drawingCueSize) / 2; + if (drawingDur > DUR_1 || (drawingDur == DUR_1 && staff->notAnc)) { // annuler provisoirement la modif. des lignes addit. ledge = m_doc->m_drawingLedgerLine[staffSize][drawingCueSize]; } From 5cd656f73dcc31c9cb0aa79615928632863add8a Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Mon, 17 Aug 2015 16:15:03 +0200 Subject: [PATCH 066/114] Method for getting bounding box sizes (update) --- include/vrv/doc.h | 7 ------- src/doc.cpp | 21 ++++++++++----------- src/view_element.cpp | 3 ++- 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/include/vrv/doc.h b/include/vrv/doc.h index 800905e5d82..53c5b674a07 100644 --- a/include/vrv/doc.h +++ b/include/vrv/doc.h @@ -201,13 +201,6 @@ class Doc: public Object */ int CalcMusicFontSize( ); - /** - * Get the glyph bounding box. - * Asserts the parameters and the glyph in the resources. - */ - void GetGlyphBoundingBox( wchar_t smuflCode, int *x, int *y, int *w, int *h ); - - public: diff --git a/src/doc.cpp b/src/doc.cpp index 5976cc50c45..5dc012e882d 100644 --- a/src/doc.cpp +++ b/src/doc.cpp @@ -389,20 +389,15 @@ int Doc::GetPageCount( ) { return GetChildCount() ; } - -void Doc::GetGlyphBoundingBox( wchar_t smuflCode, int *x, int *y, int *w, int *h ) -{ - assert( x && y && w && h ); - Glyph *glyph; - glyph = Resources::GetGlyph( smuflCode ); - assert( glyph ); - glyph->GetBoundingBox( x, y, w, h ); -} int Doc::GetGlyphHeight( wchar_t smuflCode, int staffSize, bool graceSize ) { int x, y, w, h; - this->GetGlyphBoundingBox( smuflCode, &x, &y, &w, &h); + Glyph *glyph; + glyph = Resources::GetGlyph( smuflCode ); + assert( glyph ); + glyph->GetBoundingBox( &x, &y, &w, &h ); + h = h * m_drawingFontHeight / glyph->GetUnitsPerEm(); if ( graceSize ) h = h * this->m_style->m_graceNum / this->m_style->m_graceDen; return h; } @@ -410,7 +405,11 @@ int Doc::GetGlyphHeight( wchar_t smuflCode, int staffSize, bool graceSize ) int Doc::GetGlyphWidth( wchar_t smuflCode, int staffSize, bool graceSize ) { int x, y, w, h; - this->GetGlyphBoundingBox( smuflCode, &x, &y, &w, &h); + Glyph *glyph; + glyph = Resources::GetGlyph( smuflCode ); + assert( glyph ); + glyph->GetBoundingBox( &x, &y, &w, &h ); + w = w * m_drawingFontHeight / glyph->GetUnitsPerEm(); if ( graceSize ) w = w * this->m_style->m_graceNum / this->m_style->m_graceDen; return w; } diff --git a/src/view_element.cpp b/src/view_element.cpp index d7b0b98e930..642dead065d 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -12,6 +12,7 @@ #include #include +#include //---------------------------------------------------------------------------- @@ -245,7 +246,7 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St drawingDur = ((note->GetColored()==BOOLEAN_true) && drawingDur > DUR_1) ? (drawingDur+1) : drawingDur; //int radius = m_doc->m_drawingNoteRadius[staffSize][drawingCueSize]; - int radius = m_doc->GetGlyphHeight(SMUFL_E0A3_noteheadHalf, staffSize, drawingCueSize) / 2; + int radius = m_doc->GetGlyphWidth(SMUFL_E0A3_noteheadHalf, staffSize, drawingCueSize) / 2; if (drawingDur > DUR_1 || (drawingDur == DUR_1 && staff->notAnc)) { // annuler provisoirement la modif. des lignes addit. ledge = m_doc->m_drawingLedgerLine[staffSize][drawingCueSize]; From f865ac563644b1fa15ca4f8b7918276dcf60ba61 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Mon, 17 Aug 2015 16:15:20 +0200 Subject: [PATCH 067/114] Adding horiz-adv-x info to glyphs --- data/Bravura/E003-bracketTop.xml | 5 +- data/Bravura/E004-bracketBottom.xml | 5 +- data/Bravura/E045-dalSegno.xml | 5 +- data/Bravura/E046-daCapo.xml | 5 +- data/Bravura/E047-segno.xml | 5 +- data/Bravura/E048-coda.xml | 5 +- data/Bravura/E04B-segnoSerpent2.xml | 5 +- data/Bravura/E050-gClef.xml | 5 +- data/Bravura/E051-gClef15mb.xml | 5 +- data/Bravura/E052-gClef8vb.xml | 5 +- data/Bravura/E053-gClef8va.xml | 5 +- data/Bravura/E054-gClef15ma.xml | 5 +- data/Bravura/E05C-cClef.xml | 5 +- data/Bravura/E05D-cClef8vb.xml | 5 +- data/Bravura/E062-fClef.xml | 5 +- data/Bravura/E063-fClef15mb.xml | 5 +- data/Bravura/E064-fClef8vb.xml | 5 +- data/Bravura/E065-fClef8va.xml | 5 +- data/Bravura/E066-fClef15ma.xml | 5 +- data/Bravura/E080-timeSig0.xml | 5 +- data/Bravura/E081-timeSig1.xml | 5 +- data/Bravura/E082-timeSig2.xml | 5 +- data/Bravura/E083-timeSig3.xml | 5 +- data/Bravura/E084-timeSig4.xml | 5 +- data/Bravura/E085-timeSig5.xml | 5 +- data/Bravura/E086-timeSig6.xml | 5 +- data/Bravura/E087-timeSig7.xml | 5 +- data/Bravura/E088-timeSig8.xml | 5 +- data/Bravura/E089-timeSig9.xml | 5 +- data/Bravura/E08A-timeSigCommon.xml | 5 +- data/Bravura/E08B-timeSigCutCommon.xml | 5 +- data/Bravura/E0A2-noteheadWhole.xml | 5 +- data/Bravura/E0A3-noteheadHalf.xml | 5 +- data/Bravura/E0A4-noteheadBlack.xml | 5 +- data/Bravura/E0FA-noteheadWholeFilled.xml | 5 +- data/Bravura/E220-tremolo1.xml | 5 +- data/Bravura/E221-tremolo2.xml | 5 +- data/Bravura/E222-tremolo3.xml | 5 +- data/Bravura/E223-tremolo4.xml | 5 +- data/Bravura/E224-tremolo5.xml | 5 +- data/Bravura/E240-flag8thUp.xml | 5 +- data/Bravura/E241-flag8thDown.xml | 5 +- data/Bravura/E260-accidentalFlat.xml | 5 +- data/Bravura/E261-accidentalNatural.xml | 5 +- data/Bravura/E262-accidentalSharp.xml | 5 +- data/Bravura/E263-accidentalDoubleSharp.xml | 5 +- data/Bravura/E264-accidentalDoubleFlat.xml | 5 +- data/Bravura/E265-accidentalTripleSharp.xml | 5 +- data/Bravura/E266-accidentalTripleFlat.xml | 5 +- data/Bravura/E267-accidentalNaturalFlat.xml | 5 +- data/Bravura/E268-accidentalNaturalSharp.xml | 5 +- data/Bravura/E269-accidentalSharpSharp.xml | 5 +- data/Bravura/E26A-accidentalParensLeft.xml | 5 +- data/Bravura/E26B-accidentalParensRight.xml | 5 +- data/Bravura/E4A0-articAccentAbove.xml | 5 +- data/Bravura/E4A1-articAccentBelow.xml | 5 +- .../E4A8-articStaccatissimoWedgeAbove.xml | 5 +- .../E4A9-articStaccatissimoWedgeBelow.xml | 5 +- data/Bravura/E4AC-articMarcatoAbove.xml | 5 +- data/Bravura/E4AD-articMarcatoBelow.xml | 5 +- data/Bravura/E4C0-fermataAbove.xml | 5 +- data/Bravura/E4C1-fermataBelow.xml | 5 +- data/Bravura/E4E5-restQuarter.xml | 5 +- data/Bravura/E4E6-rest8th.xml | 5 +- data/Bravura/E4E7-rest16th.xml | 5 +- data/Bravura/E4E8-rest32nd.xml | 5 +- data/Bravura/E4E9-rest64th.xml | 5 +- data/Bravura/E4EA-rest128th.xml | 5 +- data/Bravura/E500-repeat1Bar.xml | 5 +- data/Bravura/E520-dynamicPiano.xml | 5 +- data/Bravura/E521-dynamicMezzo.xml | 5 +- data/Bravura/E522-dynamicForte.xml | 5 +- data/Bravura/E523-dynamicRinforzando.xml | 5 +- data/Bravura/E524-dynamicSforzando.xml | 5 +- data/Bravura/E525-dynamicZ.xml | 5 +- data/Bravura/E52F-dynamicFF.xml | 5 +- data/Bravura/E530-dynamicFFF.xml | 5 +- data/Bravura/E531-dynamicFFFF.xml | 5 +- data/Bravura/E532-dynamicFFFFF.xml | 5 +- data/Bravura/E566-ornamentTrill.xml | 5 +- data/Bravura/E567-ornamentTurn.xml | 5 +- data/Bravura/E568-ornamentTurnInverted.xml | 5 +- data/Bravura/E56A-ornamentTurnUp.xml | 5 +- data/Bravura/E56B-ornamentTurnUpS.xml | 5 +- data/Bravura/E56C-ornamentMordent.xml | 5 +- data/Bravura/E56D-ornamentMordentInverted.xml | 5 +- data/Bravura/E56E-ornamentTremblement.xml | 5 +- data/Bravura/E650-keyboardPedalPed.xml | 5 +- data/Bravura/E655-keyboardPedalUp.xml | 5 +- data/Bravura/E880-tuplet0.xml | 5 +- data/Bravura/E881-tuplet1.xml | 5 +- data/Bravura/E882-tuplet2.xml | 5 +- data/Bravura/E883-tuplet3.xml | 5 +- data/Bravura/E884-tuplet4.xml | 5 +- data/Bravura/E885-tuplet5.xml | 5 +- data/Bravura/E886-tuplet6.xml | 5 +- data/Bravura/E887-tuplet7.xml | 5 +- data/Bravura/E888-tuplet8.xml | 5 +- data/Bravura/E889-tuplet9.xml | 5 +- data/Bravura/E88A-tupletColon.xml | 5 +- data/Gootville/E003-bracketTop.xml | 5 +- data/Gootville/E004-bracketBottom.xml | 5 +- data/Gootville/E045-dalSegno.xml | 5 +- data/Gootville/E046-daCapo.xml | 5 +- data/Gootville/E047-segno.xml | 5 +- data/Gootville/E048-coda.xml | 5 +- data/Gootville/E04B-segnoSerpent2.xml | 5 +- data/Gootville/E050-gClef.xml | 5 +- data/Gootville/E051-gClef15mb.xml | 5 +- data/Gootville/E052-gClef8vb.xml | 5 +- data/Gootville/E053-gClef8va.xml | 5 +- data/Gootville/E054-gClef15ma.xml | 5 +- data/Gootville/E05C-cClef.xml | 5 +- data/Gootville/E05D-cClef8vb.xml | 5 +- data/Gootville/E062-fClef.xml | 5 +- data/Gootville/E063-fClef15mb.xml | 5 +- data/Gootville/E064-fClef8vb.xml | 5 +- data/Gootville/E065-fClef8va.xml | 5 +- data/Gootville/E066-fClef15ma.xml | 5 +- data/Gootville/E080-timeSig0.xml | 5 +- data/Gootville/E081-timeSig1.xml | 5 +- data/Gootville/E082-timeSig2.xml | 5 +- data/Gootville/E083-timeSig3.xml | 5 +- data/Gootville/E084-timeSig4.xml | 5 +- data/Gootville/E085-timeSig5.xml | 5 +- data/Gootville/E086-timeSig6.xml | 5 +- data/Gootville/E087-timeSig7.xml | 5 +- data/Gootville/E088-timeSig8.xml | 5 +- data/Gootville/E089-timeSig9.xml | 5 +- data/Gootville/E08A-timeSigCommon.xml | 5 +- data/Gootville/E08B-timeSigCutCommon.xml | 5 +- data/Gootville/E0A2-noteheadWhole.xml | 5 +- data/Gootville/E0A3-noteheadHalf.xml | 5 +- data/Gootville/E0A4-noteheadBlack.xml | 5 +- data/Gootville/E0FA-noteheadWholeFilled.xml | 5 +- data/Gootville/E220-tremolo1.xml | 5 +- data/Gootville/E221-tremolo2.xml | 5 +- data/Gootville/E222-tremolo3.xml | 5 +- data/Gootville/E223-tremolo4.xml | 5 +- data/Gootville/E224-tremolo5.xml | 5 +- data/Gootville/E240-flag8thUp.xml | 5 +- data/Gootville/E241-flag8thDown.xml | 5 +- data/Gootville/E260-accidentalFlat.xml | 5 +- data/Gootville/E261-accidentalNatural.xml | 5 +- data/Gootville/E262-accidentalSharp.xml | 5 +- data/Gootville/E263-accidentalDoubleSharp.xml | 5 +- data/Gootville/E264-accidentalDoubleFlat.xml | 5 +- data/Gootville/E265-accidentalTripleSharp.xml | 5 +- data/Gootville/E266-accidentalTripleFlat.xml | 5 +- data/Gootville/E267-accidentalNaturalFlat.xml | 5 +- .../Gootville/E268-accidentalNaturalSharp.xml | 5 +- data/Gootville/E269-accidentalSharpSharp.xml | 5 +- data/Gootville/E26A-accidentalParensLeft.xml | 5 +- data/Gootville/E26B-accidentalParensRight.xml | 5 +- data/Gootville/E4A0-articAccentAbove.xml | 5 +- data/Gootville/E4A1-articAccentBelow.xml | 5 +- .../E4A8-articStaccatissimoWedgeAbove.xml | 5 +- .../E4A9-articStaccatissimoWedgeBelow.xml | 5 +- data/Gootville/E4AC-articMarcatoAbove.xml | 5 +- data/Gootville/E4AD-articMarcatoBelow.xml | 5 +- data/Gootville/E4C0-fermataAbove.xml | 5 +- data/Gootville/E4C1-fermataBelow.xml | 5 +- data/Gootville/E4E5-restQuarter.xml | 5 +- data/Gootville/E4E6-rest8th.xml | 5 +- data/Gootville/E4E7-rest16th.xml | 5 +- data/Gootville/E4E8-rest32nd.xml | 5 +- data/Gootville/E4E9-rest64th.xml | 5 +- data/Gootville/E4EA-rest128th.xml | 5 +- data/Gootville/E500-repeat1Bar.xml | 5 +- data/Gootville/E520-dynamicPiano.xml | 5 +- data/Gootville/E521-dynamicMezzo.xml | 5 +- data/Gootville/E522-dynamicForte.xml | 5 +- data/Gootville/E523-dynamicRinforzando.xml | 5 +- data/Gootville/E524-dynamicSforzando.xml | 5 +- data/Gootville/E525-dynamicZ.xml | 5 +- data/Gootville/E52F-dynamicFF.xml | 5 +- data/Gootville/E530-dynamicFFF.xml | 5 +- data/Gootville/E531-dynamicFFFF.xml | 5 +- data/Gootville/E532-dynamicFFFFF.xml | 5 +- data/Gootville/E566-ornamentTrill.xml | 5 +- data/Gootville/E567-ornamentTurn.xml | 5 +- data/Gootville/E568-ornamentTurnInverted.xml | 5 +- data/Gootville/E56A-ornamentTurnUp.xml | 5 +- data/Gootville/E56B-ornamentTurnUpS.xml | 5 +- data/Gootville/E56C-ornamentMordent.xml | 5 +- .../E56D-ornamentMordentInverted.xml | 5 +- data/Gootville/E56E-ornamentTremblement.xml | 5 +- data/Gootville/E650-keyboardPedalPed.xml | 5 +- data/Gootville/E655-keyboardPedalUp.xml | 5 +- data/Gootville/E880-tuplet0.xml | 5 +- data/Gootville/E881-tuplet1.xml | 5 +- data/Gootville/E882-tuplet2.xml | 5 +- data/Gootville/E883-tuplet3.xml | 5 +- data/Gootville/E884-tuplet4.xml | 5 +- data/Gootville/E885-tuplet5.xml | 5 +- data/Gootville/E886-tuplet6.xml | 5 +- data/Gootville/E887-tuplet7.xml | 5 +- data/Gootville/E888-tuplet8.xml | 5 +- data/Gootville/E889-tuplet9.xml | 5 +- data/Gootville/E88A-tupletColon.xml | 5 +- data/Leipzig/E003-bracketTop.xml | 5 +- data/Leipzig/E004-bracketBottom.xml | 5 +- data/Leipzig/E045-dalSegno.xml | 5 +- data/Leipzig/E046-daCapo.xml | 5 +- data/Leipzig/E047-segno.xml | 5 +- data/Leipzig/E048-coda.xml | 5 +- data/Leipzig/E04B-segnoSerpent2.xml | 5 +- data/Leipzig/E050-gClef.xml | 5 +- data/Leipzig/E051-gClef15mb.xml | 5 +- data/Leipzig/E052-gClef8vb.xml | 5 +- data/Leipzig/E053-gClef8va.xml | 5 +- data/Leipzig/E054-gClef15ma.xml | 5 +- data/Leipzig/E05C-cClef.xml | 5 +- data/Leipzig/E05D-cClef8vb.xml | 5 +- data/Leipzig/E062-fClef.xml | 5 +- data/Leipzig/E063-fClef15mb.xml | 5 +- data/Leipzig/E064-fClef8vb.xml | 5 +- data/Leipzig/E065-fClef8va.xml | 5 +- data/Leipzig/E066-fClef15ma.xml | 5 +- data/Leipzig/E080-timeSig0.xml | 5 +- data/Leipzig/E081-timeSig1.xml | 5 +- data/Leipzig/E082-timeSig2.xml | 5 +- data/Leipzig/E083-timeSig3.xml | 5 +- data/Leipzig/E084-timeSig4.xml | 5 +- data/Leipzig/E085-timeSig5.xml | 5 +- data/Leipzig/E086-timeSig6.xml | 5 +- data/Leipzig/E087-timeSig7.xml | 5 +- data/Leipzig/E088-timeSig8.xml | 5 +- data/Leipzig/E089-timeSig9.xml | 5 +- data/Leipzig/E08A-timeSigCommon.xml | 5 +- data/Leipzig/E08B-timeSigCutCommon.xml | 5 +- data/Leipzig/E0A2-noteheadWhole.xml | 5 +- data/Leipzig/E0A3-noteheadHalf.xml | 5 +- data/Leipzig/E0A4-noteheadBlack.xml | 5 +- data/Leipzig/E0FA-noteheadWholeFilled.xml | 5 +- data/Leipzig/E220-tremolo1.xml | 5 +- data/Leipzig/E221-tremolo2.xml | 5 +- data/Leipzig/E222-tremolo3.xml | 5 +- data/Leipzig/E223-tremolo4.xml | 5 +- data/Leipzig/E224-tremolo5.xml | 5 +- data/Leipzig/E240-flag8thUp.xml | 5 +- data/Leipzig/E241-flag8thDown.xml | 5 +- data/Leipzig/E260-accidentalFlat.xml | 5 +- data/Leipzig/E261-accidentalNatural.xml | 5 +- data/Leipzig/E262-accidentalSharp.xml | 5 +- data/Leipzig/E263-accidentalDoubleSharp.xml | 5 +- data/Leipzig/E264-accidentalDoubleFlat.xml | 5 +- data/Leipzig/E265-accidentalTripleSharp.xml | 5 +- data/Leipzig/E266-accidentalTripleFlat.xml | 5 +- data/Leipzig/E267-accidentalNaturalFlat.xml | 5 +- data/Leipzig/E268-accidentalNaturalSharp.xml | 5 +- data/Leipzig/E269-accidentalSharpSharp.xml | 5 +- data/Leipzig/E26A-accidentalParensLeft.xml | 5 +- data/Leipzig/E26B-accidentalParensRight.xml | 5 +- data/Leipzig/E4A0-articAccentAbove.xml | 5 +- data/Leipzig/E4A1-articAccentBelow.xml | 5 +- .../E4A8-articStaccatissimoWedgeAbove.xml | 5 +- .../E4A9-articStaccatissimoWedgeBelow.xml | 5 +- data/Leipzig/E4AC-articMarcatoAbove.xml | 5 +- data/Leipzig/E4AD-articMarcatoBelow.xml | 5 +- data/Leipzig/E4C0-fermataAbove.xml | 5 +- data/Leipzig/E4C1-fermataBelow.xml | 5 +- data/Leipzig/E4E5-restQuarter.xml | 5 +- data/Leipzig/E4E6-rest8th.xml | 5 +- data/Leipzig/E4E7-rest16th.xml | 5 +- data/Leipzig/E4E8-rest32nd.xml | 5 +- data/Leipzig/E4E9-rest64th.xml | 5 +- data/Leipzig/E4EA-rest128th.xml | 5 +- data/Leipzig/E500-repeat1Bar.xml | 5 +- data/Leipzig/E520-dynamicPiano.xml | 5 +- data/Leipzig/E521-dynamicMezzo.xml | 5 +- data/Leipzig/E522-dynamicForte.xml | 5 +- data/Leipzig/E523-dynamicRinforzando.xml | 5 +- data/Leipzig/E524-dynamicSforzando.xml | 5 +- data/Leipzig/E525-dynamicZ.xml | 5 +- data/Leipzig/E52F-dynamicFF.xml | 5 +- data/Leipzig/E530-dynamicFFF.xml | 5 +- data/Leipzig/E531-dynamicFFFF.xml | 5 +- data/Leipzig/E532-dynamicFFFFF.xml | 5 +- data/Leipzig/E566-ornamentTrill.xml | 5 +- data/Leipzig/E567-ornamentTurn.xml | 5 +- data/Leipzig/E568-ornamentTurnInverted.xml | 5 +- data/Leipzig/E56A-ornamentTurnUp.xml | 5 +- data/Leipzig/E56B-ornamentTurnUpS.xml | 5 +- data/Leipzig/E56C-ornamentMordent.xml | 5 +- data/Leipzig/E56D-ornamentMordentInverted.xml | 5 +- data/Leipzig/E56E-ornamentTremblement.xml | 5 +- data/Leipzig/E650-keyboardPedalPed.xml | 5 +- data/Leipzig/E655-keyboardPedalUp.xml | 5 +- data/Leipzig/E880-tuplet0.xml | 5 +- data/Leipzig/E881-tuplet1.xml | 5 +- data/Leipzig/E882-tuplet2.xml | 5 +- data/Leipzig/E883-tuplet3.xml | 5 +- data/Leipzig/E884-tuplet4.xml | 5 +- data/Leipzig/E885-tuplet5.xml | 5 +- data/Leipzig/E886-tuplet6.xml | 5 +- data/Leipzig/E887-tuplet7.xml | 5 +- data/Leipzig/E888-tuplet8.xml | 5 +- data/Leipzig/E889-tuplet9.xml | 5 +- data/Leipzig/E88A-tupletColon.xml | 5 +- fonts/Leipzig-5.1.sfd | 1074 ++++++++--------- fonts/extract-glyphs.xsl | 3 +- 302 files changed, 1739 insertions(+), 838 deletions(-) diff --git a/data/Bravura/E003-bracketTop.xml b/data/Bravura/E003-bracketTop.xml index 002075f2ddd..7ea1d3c0bed 100644 --- a/data/Bravura/E003-bracketTop.xml +++ b/data/Bravura/E003-bracketTop.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E004-bracketBottom.xml b/data/Bravura/E004-bracketBottom.xml index 6708854b03d..09da46fb728 100644 --- a/data/Bravura/E004-bracketBottom.xml +++ b/data/Bravura/E004-bracketBottom.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E045-dalSegno.xml b/data/Bravura/E045-dalSegno.xml index 9c35229c236..518fd698076 100644 --- a/data/Bravura/E045-dalSegno.xml +++ b/data/Bravura/E045-dalSegno.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E046-daCapo.xml b/data/Bravura/E046-daCapo.xml index 6f18f5d64b7..9d6542c9d2b 100644 --- a/data/Bravura/E046-daCapo.xml +++ b/data/Bravura/E046-daCapo.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E047-segno.xml b/data/Bravura/E047-segno.xml index bc3f16138a9..d09e8509ba9 100644 --- a/data/Bravura/E047-segno.xml +++ b/data/Bravura/E047-segno.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E048-coda.xml b/data/Bravura/E048-coda.xml index 1bee2e57bb8..b0eda069f53 100644 --- a/data/Bravura/E048-coda.xml +++ b/data/Bravura/E048-coda.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E04B-segnoSerpent2.xml b/data/Bravura/E04B-segnoSerpent2.xml index c0502978f41..59f9c9862c7 100644 --- a/data/Bravura/E04B-segnoSerpent2.xml +++ b/data/Bravura/E04B-segnoSerpent2.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E050-gClef.xml b/data/Bravura/E050-gClef.xml index e1845b9eb0d..2dfad085d5c 100644 --- a/data/Bravura/E050-gClef.xml +++ b/data/Bravura/E050-gClef.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E051-gClef15mb.xml b/data/Bravura/E051-gClef15mb.xml index 43e387bd77c..573d52216dd 100644 --- a/data/Bravura/E051-gClef15mb.xml +++ b/data/Bravura/E051-gClef15mb.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E052-gClef8vb.xml b/data/Bravura/E052-gClef8vb.xml index 106e67ccc5f..cbf59916c09 100644 --- a/data/Bravura/E052-gClef8vb.xml +++ b/data/Bravura/E052-gClef8vb.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E053-gClef8va.xml b/data/Bravura/E053-gClef8va.xml index ae13e42d3d2..b27704a7473 100644 --- a/data/Bravura/E053-gClef8va.xml +++ b/data/Bravura/E053-gClef8va.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E054-gClef15ma.xml b/data/Bravura/E054-gClef15ma.xml index 99597f2ceac..17aa35561ba 100644 --- a/data/Bravura/E054-gClef15ma.xml +++ b/data/Bravura/E054-gClef15ma.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E05C-cClef.xml b/data/Bravura/E05C-cClef.xml index b30db19d19b..7881fb29372 100644 --- a/data/Bravura/E05C-cClef.xml +++ b/data/Bravura/E05C-cClef.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E05D-cClef8vb.xml b/data/Bravura/E05D-cClef8vb.xml index 523d050eead..843e57b0147 100644 --- a/data/Bravura/E05D-cClef8vb.xml +++ b/data/Bravura/E05D-cClef8vb.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E062-fClef.xml b/data/Bravura/E062-fClef.xml index 5d0b69db16d..c861ff49d7c 100644 --- a/data/Bravura/E062-fClef.xml +++ b/data/Bravura/E062-fClef.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E063-fClef15mb.xml b/data/Bravura/E063-fClef15mb.xml index d82968852eb..a534cc7e4f9 100644 --- a/data/Bravura/E063-fClef15mb.xml +++ b/data/Bravura/E063-fClef15mb.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E064-fClef8vb.xml b/data/Bravura/E064-fClef8vb.xml index c7091c3109c..fa7d55c09f3 100644 --- a/data/Bravura/E064-fClef8vb.xml +++ b/data/Bravura/E064-fClef8vb.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E065-fClef8va.xml b/data/Bravura/E065-fClef8va.xml index d3b3d6400bb..d7cfc2825f8 100644 --- a/data/Bravura/E065-fClef8va.xml +++ b/data/Bravura/E065-fClef8va.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E066-fClef15ma.xml b/data/Bravura/E066-fClef15ma.xml index 3603f185c30..e1ae6cf518b 100644 --- a/data/Bravura/E066-fClef15ma.xml +++ b/data/Bravura/E066-fClef15ma.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E080-timeSig0.xml b/data/Bravura/E080-timeSig0.xml index 1b64c2d3a5b..e08e1bf72ff 100644 --- a/data/Bravura/E080-timeSig0.xml +++ b/data/Bravura/E080-timeSig0.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E081-timeSig1.xml b/data/Bravura/E081-timeSig1.xml index 479799f0c47..b85ff73db03 100644 --- a/data/Bravura/E081-timeSig1.xml +++ b/data/Bravura/E081-timeSig1.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E082-timeSig2.xml b/data/Bravura/E082-timeSig2.xml index 9621167b6e0..052572d11f4 100644 --- a/data/Bravura/E082-timeSig2.xml +++ b/data/Bravura/E082-timeSig2.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E083-timeSig3.xml b/data/Bravura/E083-timeSig3.xml index 8130d75053d..c94e887417a 100644 --- a/data/Bravura/E083-timeSig3.xml +++ b/data/Bravura/E083-timeSig3.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E084-timeSig4.xml b/data/Bravura/E084-timeSig4.xml index 3d77cdc1cbd..f5474acf995 100644 --- a/data/Bravura/E084-timeSig4.xml +++ b/data/Bravura/E084-timeSig4.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E085-timeSig5.xml b/data/Bravura/E085-timeSig5.xml index 2aea34acd3b..055263dbdf0 100644 --- a/data/Bravura/E085-timeSig5.xml +++ b/data/Bravura/E085-timeSig5.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E086-timeSig6.xml b/data/Bravura/E086-timeSig6.xml index c89bac340c3..b1735f5e15d 100644 --- a/data/Bravura/E086-timeSig6.xml +++ b/data/Bravura/E086-timeSig6.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E087-timeSig7.xml b/data/Bravura/E087-timeSig7.xml index 794d8a2bbe5..67068c8c6a4 100644 --- a/data/Bravura/E087-timeSig7.xml +++ b/data/Bravura/E087-timeSig7.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E088-timeSig8.xml b/data/Bravura/E088-timeSig8.xml index 7e9cfcda1e2..8f841c1faf6 100644 --- a/data/Bravura/E088-timeSig8.xml +++ b/data/Bravura/E088-timeSig8.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E089-timeSig9.xml b/data/Bravura/E089-timeSig9.xml index 68a984c6583..adfb6a93ae6 100644 --- a/data/Bravura/E089-timeSig9.xml +++ b/data/Bravura/E089-timeSig9.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E08A-timeSigCommon.xml b/data/Bravura/E08A-timeSigCommon.xml index f163063d239..51a17bff490 100644 --- a/data/Bravura/E08A-timeSigCommon.xml +++ b/data/Bravura/E08A-timeSigCommon.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E08B-timeSigCutCommon.xml b/data/Bravura/E08B-timeSigCutCommon.xml index 1f5f4dddb4e..af039a8334f 100644 --- a/data/Bravura/E08B-timeSigCutCommon.xml +++ b/data/Bravura/E08B-timeSigCutCommon.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E0A2-noteheadWhole.xml b/data/Bravura/E0A2-noteheadWhole.xml index df2c20a080e..bdc86ca237a 100644 --- a/data/Bravura/E0A2-noteheadWhole.xml +++ b/data/Bravura/E0A2-noteheadWhole.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E0A3-noteheadHalf.xml b/data/Bravura/E0A3-noteheadHalf.xml index 84360dd3d68..e1efbcb562e 100644 --- a/data/Bravura/E0A3-noteheadHalf.xml +++ b/data/Bravura/E0A3-noteheadHalf.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E0A4-noteheadBlack.xml b/data/Bravura/E0A4-noteheadBlack.xml index b392e8738ae..16b78ad1e9a 100644 --- a/data/Bravura/E0A4-noteheadBlack.xml +++ b/data/Bravura/E0A4-noteheadBlack.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E0FA-noteheadWholeFilled.xml b/data/Bravura/E0FA-noteheadWholeFilled.xml index 47a4eac7022..7b02fda0380 100644 --- a/data/Bravura/E0FA-noteheadWholeFilled.xml +++ b/data/Bravura/E0FA-noteheadWholeFilled.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E220-tremolo1.xml b/data/Bravura/E220-tremolo1.xml index e72e6af77d3..44f0f86c020 100644 --- a/data/Bravura/E220-tremolo1.xml +++ b/data/Bravura/E220-tremolo1.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E221-tremolo2.xml b/data/Bravura/E221-tremolo2.xml index 5f84165499a..e14bbe897f9 100644 --- a/data/Bravura/E221-tremolo2.xml +++ b/data/Bravura/E221-tremolo2.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E222-tremolo3.xml b/data/Bravura/E222-tremolo3.xml index 734b6c4130f..65f27e18d97 100644 --- a/data/Bravura/E222-tremolo3.xml +++ b/data/Bravura/E222-tremolo3.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E223-tremolo4.xml b/data/Bravura/E223-tremolo4.xml index 8fa5e93d6e5..f3419c77131 100644 --- a/data/Bravura/E223-tremolo4.xml +++ b/data/Bravura/E223-tremolo4.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E224-tremolo5.xml b/data/Bravura/E224-tremolo5.xml index 0c586e2cf87..86fb7835454 100644 --- a/data/Bravura/E224-tremolo5.xml +++ b/data/Bravura/E224-tremolo5.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E240-flag8thUp.xml b/data/Bravura/E240-flag8thUp.xml index 74b51dd2cf5..872980a64e3 100644 --- a/data/Bravura/E240-flag8thUp.xml +++ b/data/Bravura/E240-flag8thUp.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E241-flag8thDown.xml b/data/Bravura/E241-flag8thDown.xml index 6338de4f4c6..7d5c4afbc05 100644 --- a/data/Bravura/E241-flag8thDown.xml +++ b/data/Bravura/E241-flag8thDown.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E260-accidentalFlat.xml b/data/Bravura/E260-accidentalFlat.xml index ea5a908a8b0..2b6608563b7 100644 --- a/data/Bravura/E260-accidentalFlat.xml +++ b/data/Bravura/E260-accidentalFlat.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E261-accidentalNatural.xml b/data/Bravura/E261-accidentalNatural.xml index 02ce5429707..a0a0aeddac5 100644 --- a/data/Bravura/E261-accidentalNatural.xml +++ b/data/Bravura/E261-accidentalNatural.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E262-accidentalSharp.xml b/data/Bravura/E262-accidentalSharp.xml index 49558ebdd4e..61825b2847d 100644 --- a/data/Bravura/E262-accidentalSharp.xml +++ b/data/Bravura/E262-accidentalSharp.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E263-accidentalDoubleSharp.xml b/data/Bravura/E263-accidentalDoubleSharp.xml index aff58073c29..302bc232c9c 100644 --- a/data/Bravura/E263-accidentalDoubleSharp.xml +++ b/data/Bravura/E263-accidentalDoubleSharp.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E264-accidentalDoubleFlat.xml b/data/Bravura/E264-accidentalDoubleFlat.xml index f2f775be342..bc4edd42d98 100644 --- a/data/Bravura/E264-accidentalDoubleFlat.xml +++ b/data/Bravura/E264-accidentalDoubleFlat.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E265-accidentalTripleSharp.xml b/data/Bravura/E265-accidentalTripleSharp.xml index d1fb5e3144c..d2c72ab348e 100644 --- a/data/Bravura/E265-accidentalTripleSharp.xml +++ b/data/Bravura/E265-accidentalTripleSharp.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E266-accidentalTripleFlat.xml b/data/Bravura/E266-accidentalTripleFlat.xml index 4181f565f51..27b5505874a 100644 --- a/data/Bravura/E266-accidentalTripleFlat.xml +++ b/data/Bravura/E266-accidentalTripleFlat.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E267-accidentalNaturalFlat.xml b/data/Bravura/E267-accidentalNaturalFlat.xml index b1d6fedbf4c..6020057edfa 100644 --- a/data/Bravura/E267-accidentalNaturalFlat.xml +++ b/data/Bravura/E267-accidentalNaturalFlat.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E268-accidentalNaturalSharp.xml b/data/Bravura/E268-accidentalNaturalSharp.xml index 643ac79a6d7..c73488512d1 100644 --- a/data/Bravura/E268-accidentalNaturalSharp.xml +++ b/data/Bravura/E268-accidentalNaturalSharp.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E269-accidentalSharpSharp.xml b/data/Bravura/E269-accidentalSharpSharp.xml index 80610b31c11..58d261b9f9a 100644 --- a/data/Bravura/E269-accidentalSharpSharp.xml +++ b/data/Bravura/E269-accidentalSharpSharp.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E26A-accidentalParensLeft.xml b/data/Bravura/E26A-accidentalParensLeft.xml index 2561edf75c0..6aac22b3044 100644 --- a/data/Bravura/E26A-accidentalParensLeft.xml +++ b/data/Bravura/E26A-accidentalParensLeft.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E26B-accidentalParensRight.xml b/data/Bravura/E26B-accidentalParensRight.xml index 8e4068beb44..5b8d55a85e4 100644 --- a/data/Bravura/E26B-accidentalParensRight.xml +++ b/data/Bravura/E26B-accidentalParensRight.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E4A0-articAccentAbove.xml b/data/Bravura/E4A0-articAccentAbove.xml index 33458b06504..a554d95c399 100644 --- a/data/Bravura/E4A0-articAccentAbove.xml +++ b/data/Bravura/E4A0-articAccentAbove.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E4A1-articAccentBelow.xml b/data/Bravura/E4A1-articAccentBelow.xml index 37cab26c05f..e041305781d 100644 --- a/data/Bravura/E4A1-articAccentBelow.xml +++ b/data/Bravura/E4A1-articAccentBelow.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E4A8-articStaccatissimoWedgeAbove.xml b/data/Bravura/E4A8-articStaccatissimoWedgeAbove.xml index e19121edfa1..b1825b0f65d 100644 --- a/data/Bravura/E4A8-articStaccatissimoWedgeAbove.xml +++ b/data/Bravura/E4A8-articStaccatissimoWedgeAbove.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E4A9-articStaccatissimoWedgeBelow.xml b/data/Bravura/E4A9-articStaccatissimoWedgeBelow.xml index eab7522c6bf..d6bc92147f1 100644 --- a/data/Bravura/E4A9-articStaccatissimoWedgeBelow.xml +++ b/data/Bravura/E4A9-articStaccatissimoWedgeBelow.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E4AC-articMarcatoAbove.xml b/data/Bravura/E4AC-articMarcatoAbove.xml index b8effed2254..00a16c4c90a 100644 --- a/data/Bravura/E4AC-articMarcatoAbove.xml +++ b/data/Bravura/E4AC-articMarcatoAbove.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E4AD-articMarcatoBelow.xml b/data/Bravura/E4AD-articMarcatoBelow.xml index fdfbef6f9c9..cd9dce329b0 100644 --- a/data/Bravura/E4AD-articMarcatoBelow.xml +++ b/data/Bravura/E4AD-articMarcatoBelow.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E4C0-fermataAbove.xml b/data/Bravura/E4C0-fermataAbove.xml index 226d51050a7..fedaf609343 100644 --- a/data/Bravura/E4C0-fermataAbove.xml +++ b/data/Bravura/E4C0-fermataAbove.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E4C1-fermataBelow.xml b/data/Bravura/E4C1-fermataBelow.xml index 36b2c48e1c0..39bd9a72ec8 100644 --- a/data/Bravura/E4C1-fermataBelow.xml +++ b/data/Bravura/E4C1-fermataBelow.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E4E5-restQuarter.xml b/data/Bravura/E4E5-restQuarter.xml index 655b9314bb4..998d81bb3ab 100644 --- a/data/Bravura/E4E5-restQuarter.xml +++ b/data/Bravura/E4E5-restQuarter.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E4E6-rest8th.xml b/data/Bravura/E4E6-rest8th.xml index 59e6e80b787..a2db1d6025d 100644 --- a/data/Bravura/E4E6-rest8th.xml +++ b/data/Bravura/E4E6-rest8th.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E4E7-rest16th.xml b/data/Bravura/E4E7-rest16th.xml index 4e8e67cd0cc..ac3d490e512 100644 --- a/data/Bravura/E4E7-rest16th.xml +++ b/data/Bravura/E4E7-rest16th.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E4E8-rest32nd.xml b/data/Bravura/E4E8-rest32nd.xml index 2c5d163bbde..14b87eceb2c 100644 --- a/data/Bravura/E4E8-rest32nd.xml +++ b/data/Bravura/E4E8-rest32nd.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E4E9-rest64th.xml b/data/Bravura/E4E9-rest64th.xml index 8d2953680f2..93c6b21ea79 100644 --- a/data/Bravura/E4E9-rest64th.xml +++ b/data/Bravura/E4E9-rest64th.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E4EA-rest128th.xml b/data/Bravura/E4EA-rest128th.xml index f5c17905bbc..bf5b6c0080d 100644 --- a/data/Bravura/E4EA-rest128th.xml +++ b/data/Bravura/E4EA-rest128th.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E500-repeat1Bar.xml b/data/Bravura/E500-repeat1Bar.xml index cd02f6c7168..c517cd85487 100644 --- a/data/Bravura/E500-repeat1Bar.xml +++ b/data/Bravura/E500-repeat1Bar.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E520-dynamicPiano.xml b/data/Bravura/E520-dynamicPiano.xml index 3ab48fe6114..7d1fac6efb6 100644 --- a/data/Bravura/E520-dynamicPiano.xml +++ b/data/Bravura/E520-dynamicPiano.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E521-dynamicMezzo.xml b/data/Bravura/E521-dynamicMezzo.xml index c05092504b7..68537a70608 100644 --- a/data/Bravura/E521-dynamicMezzo.xml +++ b/data/Bravura/E521-dynamicMezzo.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E522-dynamicForte.xml b/data/Bravura/E522-dynamicForte.xml index 94799153f67..7671814309e 100644 --- a/data/Bravura/E522-dynamicForte.xml +++ b/data/Bravura/E522-dynamicForte.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E523-dynamicRinforzando.xml b/data/Bravura/E523-dynamicRinforzando.xml index 58502b7f27e..679d9790b82 100644 --- a/data/Bravura/E523-dynamicRinforzando.xml +++ b/data/Bravura/E523-dynamicRinforzando.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E524-dynamicSforzando.xml b/data/Bravura/E524-dynamicSforzando.xml index 4b64fa9b5a1..541dd184c2a 100644 --- a/data/Bravura/E524-dynamicSforzando.xml +++ b/data/Bravura/E524-dynamicSforzando.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E525-dynamicZ.xml b/data/Bravura/E525-dynamicZ.xml index 52f996cc493..c3f4ee0c479 100644 --- a/data/Bravura/E525-dynamicZ.xml +++ b/data/Bravura/E525-dynamicZ.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E52F-dynamicFF.xml b/data/Bravura/E52F-dynamicFF.xml index cea1089f503..7d9702150ea 100644 --- a/data/Bravura/E52F-dynamicFF.xml +++ b/data/Bravura/E52F-dynamicFF.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E530-dynamicFFF.xml b/data/Bravura/E530-dynamicFFF.xml index 2b1dd0382b3..21f1a46baa9 100644 --- a/data/Bravura/E530-dynamicFFF.xml +++ b/data/Bravura/E530-dynamicFFF.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E531-dynamicFFFF.xml b/data/Bravura/E531-dynamicFFFF.xml index de6e2d2273e..311ccec70df 100644 --- a/data/Bravura/E531-dynamicFFFF.xml +++ b/data/Bravura/E531-dynamicFFFF.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E532-dynamicFFFFF.xml b/data/Bravura/E532-dynamicFFFFF.xml index ffc4559bfc3..5c3e01eb7f4 100644 --- a/data/Bravura/E532-dynamicFFFFF.xml +++ b/data/Bravura/E532-dynamicFFFFF.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E566-ornamentTrill.xml b/data/Bravura/E566-ornamentTrill.xml index 650f44720af..04567920270 100644 --- a/data/Bravura/E566-ornamentTrill.xml +++ b/data/Bravura/E566-ornamentTrill.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E567-ornamentTurn.xml b/data/Bravura/E567-ornamentTurn.xml index 69295fdb8fd..31a8ed108de 100644 --- a/data/Bravura/E567-ornamentTurn.xml +++ b/data/Bravura/E567-ornamentTurn.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E568-ornamentTurnInverted.xml b/data/Bravura/E568-ornamentTurnInverted.xml index 3ecf103c832..d223dc005ed 100644 --- a/data/Bravura/E568-ornamentTurnInverted.xml +++ b/data/Bravura/E568-ornamentTurnInverted.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E56A-ornamentTurnUp.xml b/data/Bravura/E56A-ornamentTurnUp.xml index 75660714ef2..9b3fc1ba922 100644 --- a/data/Bravura/E56A-ornamentTurnUp.xml +++ b/data/Bravura/E56A-ornamentTurnUp.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E56B-ornamentTurnUpS.xml b/data/Bravura/E56B-ornamentTurnUpS.xml index 26aa539c869..f054749b2e9 100644 --- a/data/Bravura/E56B-ornamentTurnUpS.xml +++ b/data/Bravura/E56B-ornamentTurnUpS.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E56C-ornamentMordent.xml b/data/Bravura/E56C-ornamentMordent.xml index 2e1083abda9..f67d25b04af 100644 --- a/data/Bravura/E56C-ornamentMordent.xml +++ b/data/Bravura/E56C-ornamentMordent.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E56D-ornamentMordentInverted.xml b/data/Bravura/E56D-ornamentMordentInverted.xml index 7a72959b15b..456c01bbb1c 100644 --- a/data/Bravura/E56D-ornamentMordentInverted.xml +++ b/data/Bravura/E56D-ornamentMordentInverted.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E56E-ornamentTremblement.xml b/data/Bravura/E56E-ornamentTremblement.xml index e8e8b586024..312d82702bd 100644 --- a/data/Bravura/E56E-ornamentTremblement.xml +++ b/data/Bravura/E56E-ornamentTremblement.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E650-keyboardPedalPed.xml b/data/Bravura/E650-keyboardPedalPed.xml index d5b8248a7f7..b94f5e733ff 100644 --- a/data/Bravura/E650-keyboardPedalPed.xml +++ b/data/Bravura/E650-keyboardPedalPed.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E655-keyboardPedalUp.xml b/data/Bravura/E655-keyboardPedalUp.xml index 980069a2606..3c43516e762 100644 --- a/data/Bravura/E655-keyboardPedalUp.xml +++ b/data/Bravura/E655-keyboardPedalUp.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E880-tuplet0.xml b/data/Bravura/E880-tuplet0.xml index b95c2aa37c8..6ffc825384a 100644 --- a/data/Bravura/E880-tuplet0.xml +++ b/data/Bravura/E880-tuplet0.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E881-tuplet1.xml b/data/Bravura/E881-tuplet1.xml index 1d9adf158c5..7cb75f748a2 100644 --- a/data/Bravura/E881-tuplet1.xml +++ b/data/Bravura/E881-tuplet1.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E882-tuplet2.xml b/data/Bravura/E882-tuplet2.xml index 3099a39fd87..3c1fded0c0c 100644 --- a/data/Bravura/E882-tuplet2.xml +++ b/data/Bravura/E882-tuplet2.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E883-tuplet3.xml b/data/Bravura/E883-tuplet3.xml index c9bbc8403c2..79550cd5a48 100644 --- a/data/Bravura/E883-tuplet3.xml +++ b/data/Bravura/E883-tuplet3.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E884-tuplet4.xml b/data/Bravura/E884-tuplet4.xml index 68ed9e0df48..558e59b10f4 100644 --- a/data/Bravura/E884-tuplet4.xml +++ b/data/Bravura/E884-tuplet4.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E885-tuplet5.xml b/data/Bravura/E885-tuplet5.xml index 00eaa0251fd..ed80e497f11 100644 --- a/data/Bravura/E885-tuplet5.xml +++ b/data/Bravura/E885-tuplet5.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E886-tuplet6.xml b/data/Bravura/E886-tuplet6.xml index 4cd7c411eca..6ce0b768399 100644 --- a/data/Bravura/E886-tuplet6.xml +++ b/data/Bravura/E886-tuplet6.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E887-tuplet7.xml b/data/Bravura/E887-tuplet7.xml index dd6d4edc6d2..18f471b1c25 100644 --- a/data/Bravura/E887-tuplet7.xml +++ b/data/Bravura/E887-tuplet7.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E888-tuplet8.xml b/data/Bravura/E888-tuplet8.xml index 399337ab5ae..061e8788f3c 100644 --- a/data/Bravura/E888-tuplet8.xml +++ b/data/Bravura/E888-tuplet8.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E889-tuplet9.xml b/data/Bravura/E889-tuplet9.xml index b869d699adb..e679a984f62 100644 --- a/data/Bravura/E889-tuplet9.xml +++ b/data/Bravura/E889-tuplet9.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Bravura/E88A-tupletColon.xml b/data/Bravura/E88A-tupletColon.xml index 7c9bfb87ba3..e0ba285f0d0 100644 --- a/data/Bravura/E88A-tupletColon.xml +++ b/data/Bravura/E88A-tupletColon.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E003-bracketTop.xml b/data/Gootville/E003-bracketTop.xml index 63813abf3e8..d15bea2f1da 100644 --- a/data/Gootville/E003-bracketTop.xml +++ b/data/Gootville/E003-bracketTop.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E004-bracketBottom.xml b/data/Gootville/E004-bracketBottom.xml index 861b48755f0..9cbf5d64bc4 100644 --- a/data/Gootville/E004-bracketBottom.xml +++ b/data/Gootville/E004-bracketBottom.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E045-dalSegno.xml b/data/Gootville/E045-dalSegno.xml index f794a235dfc..6a2b7297f52 100644 --- a/data/Gootville/E045-dalSegno.xml +++ b/data/Gootville/E045-dalSegno.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E046-daCapo.xml b/data/Gootville/E046-daCapo.xml index 27d21c99259..aa946d29f75 100644 --- a/data/Gootville/E046-daCapo.xml +++ b/data/Gootville/E046-daCapo.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E047-segno.xml b/data/Gootville/E047-segno.xml index 4061ccf9251..8f4a06df2f9 100644 --- a/data/Gootville/E047-segno.xml +++ b/data/Gootville/E047-segno.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E048-coda.xml b/data/Gootville/E048-coda.xml index f33293d7cd2..96533853486 100644 --- a/data/Gootville/E048-coda.xml +++ b/data/Gootville/E048-coda.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E04B-segnoSerpent2.xml b/data/Gootville/E04B-segnoSerpent2.xml index e87dd8c6170..f22cf9ede49 100644 --- a/data/Gootville/E04B-segnoSerpent2.xml +++ b/data/Gootville/E04B-segnoSerpent2.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E050-gClef.xml b/data/Gootville/E050-gClef.xml index 01371b4e3ad..b0358b52c63 100644 --- a/data/Gootville/E050-gClef.xml +++ b/data/Gootville/E050-gClef.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E051-gClef15mb.xml b/data/Gootville/E051-gClef15mb.xml index 27efeb57704..a3737e2a3ab 100644 --- a/data/Gootville/E051-gClef15mb.xml +++ b/data/Gootville/E051-gClef15mb.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E052-gClef8vb.xml b/data/Gootville/E052-gClef8vb.xml index 5716578ad8d..fc878ac9b0f 100644 --- a/data/Gootville/E052-gClef8vb.xml +++ b/data/Gootville/E052-gClef8vb.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E053-gClef8va.xml b/data/Gootville/E053-gClef8va.xml index 58223d20554..5013eaddf0e 100644 --- a/data/Gootville/E053-gClef8va.xml +++ b/data/Gootville/E053-gClef8va.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E054-gClef15ma.xml b/data/Gootville/E054-gClef15ma.xml index 67f58e4ce20..6a5ef204dbe 100644 --- a/data/Gootville/E054-gClef15ma.xml +++ b/data/Gootville/E054-gClef15ma.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E05C-cClef.xml b/data/Gootville/E05C-cClef.xml index 7a35e654b2b..b032b47268b 100644 --- a/data/Gootville/E05C-cClef.xml +++ b/data/Gootville/E05C-cClef.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E05D-cClef8vb.xml b/data/Gootville/E05D-cClef8vb.xml index feb9a6bfcc6..5081bf207b2 100644 --- a/data/Gootville/E05D-cClef8vb.xml +++ b/data/Gootville/E05D-cClef8vb.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E062-fClef.xml b/data/Gootville/E062-fClef.xml index 6f12c6ed1a0..badb5ec5dd8 100644 --- a/data/Gootville/E062-fClef.xml +++ b/data/Gootville/E062-fClef.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E063-fClef15mb.xml b/data/Gootville/E063-fClef15mb.xml index 86c5c045190..87d0020b217 100644 --- a/data/Gootville/E063-fClef15mb.xml +++ b/data/Gootville/E063-fClef15mb.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E064-fClef8vb.xml b/data/Gootville/E064-fClef8vb.xml index 21a94dfe105..967046bda10 100644 --- a/data/Gootville/E064-fClef8vb.xml +++ b/data/Gootville/E064-fClef8vb.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E065-fClef8va.xml b/data/Gootville/E065-fClef8va.xml index f7f75cfee15..b1e40319fab 100644 --- a/data/Gootville/E065-fClef8va.xml +++ b/data/Gootville/E065-fClef8va.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E066-fClef15ma.xml b/data/Gootville/E066-fClef15ma.xml index 8fd1b013b00..df060ea232e 100644 --- a/data/Gootville/E066-fClef15ma.xml +++ b/data/Gootville/E066-fClef15ma.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E080-timeSig0.xml b/data/Gootville/E080-timeSig0.xml index e95d115f45b..d041ab69f93 100644 --- a/data/Gootville/E080-timeSig0.xml +++ b/data/Gootville/E080-timeSig0.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E081-timeSig1.xml b/data/Gootville/E081-timeSig1.xml index 5dd0deeada2..8965279be82 100644 --- a/data/Gootville/E081-timeSig1.xml +++ b/data/Gootville/E081-timeSig1.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E082-timeSig2.xml b/data/Gootville/E082-timeSig2.xml index 0ad2b00038c..123615af908 100644 --- a/data/Gootville/E082-timeSig2.xml +++ b/data/Gootville/E082-timeSig2.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E083-timeSig3.xml b/data/Gootville/E083-timeSig3.xml index f5e610821b5..78385e92c2e 100644 --- a/data/Gootville/E083-timeSig3.xml +++ b/data/Gootville/E083-timeSig3.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E084-timeSig4.xml b/data/Gootville/E084-timeSig4.xml index e2d8a26666b..e95952c3cb5 100644 --- a/data/Gootville/E084-timeSig4.xml +++ b/data/Gootville/E084-timeSig4.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E085-timeSig5.xml b/data/Gootville/E085-timeSig5.xml index 887fba57f3d..00776ddb9bc 100644 --- a/data/Gootville/E085-timeSig5.xml +++ b/data/Gootville/E085-timeSig5.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E086-timeSig6.xml b/data/Gootville/E086-timeSig6.xml index 2469f547679..f0a8ccd9680 100644 --- a/data/Gootville/E086-timeSig6.xml +++ b/data/Gootville/E086-timeSig6.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E087-timeSig7.xml b/data/Gootville/E087-timeSig7.xml index 55a5bd8100a..2cc9f2ffc30 100644 --- a/data/Gootville/E087-timeSig7.xml +++ b/data/Gootville/E087-timeSig7.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E088-timeSig8.xml b/data/Gootville/E088-timeSig8.xml index 9cbd466d8c3..a94a68921c3 100644 --- a/data/Gootville/E088-timeSig8.xml +++ b/data/Gootville/E088-timeSig8.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E089-timeSig9.xml b/data/Gootville/E089-timeSig9.xml index 17d9ed69585..19468e235ad 100644 --- a/data/Gootville/E089-timeSig9.xml +++ b/data/Gootville/E089-timeSig9.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E08A-timeSigCommon.xml b/data/Gootville/E08A-timeSigCommon.xml index 8236ec583c7..b17831fb5a9 100644 --- a/data/Gootville/E08A-timeSigCommon.xml +++ b/data/Gootville/E08A-timeSigCommon.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E08B-timeSigCutCommon.xml b/data/Gootville/E08B-timeSigCutCommon.xml index bdc074c668e..ee9c17422ce 100644 --- a/data/Gootville/E08B-timeSigCutCommon.xml +++ b/data/Gootville/E08B-timeSigCutCommon.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E0A2-noteheadWhole.xml b/data/Gootville/E0A2-noteheadWhole.xml index 087b6b5ef2c..91f0594dad6 100644 --- a/data/Gootville/E0A2-noteheadWhole.xml +++ b/data/Gootville/E0A2-noteheadWhole.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E0A3-noteheadHalf.xml b/data/Gootville/E0A3-noteheadHalf.xml index 6c7d5b0941a..41920dedcb3 100644 --- a/data/Gootville/E0A3-noteheadHalf.xml +++ b/data/Gootville/E0A3-noteheadHalf.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E0A4-noteheadBlack.xml b/data/Gootville/E0A4-noteheadBlack.xml index c7d5f1a7751..742700658ca 100644 --- a/data/Gootville/E0A4-noteheadBlack.xml +++ b/data/Gootville/E0A4-noteheadBlack.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E0FA-noteheadWholeFilled.xml b/data/Gootville/E0FA-noteheadWholeFilled.xml index 0e1e5bf1a2a..0c49d0f117a 100644 --- a/data/Gootville/E0FA-noteheadWholeFilled.xml +++ b/data/Gootville/E0FA-noteheadWholeFilled.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E220-tremolo1.xml b/data/Gootville/E220-tremolo1.xml index 5e941e51d68..3c4caff0b62 100644 --- a/data/Gootville/E220-tremolo1.xml +++ b/data/Gootville/E220-tremolo1.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E221-tremolo2.xml b/data/Gootville/E221-tremolo2.xml index a74e2fa0516..0a782b07f0f 100644 --- a/data/Gootville/E221-tremolo2.xml +++ b/data/Gootville/E221-tremolo2.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E222-tremolo3.xml b/data/Gootville/E222-tremolo3.xml index 6133afaaafd..fab798d587a 100644 --- a/data/Gootville/E222-tremolo3.xml +++ b/data/Gootville/E222-tremolo3.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E223-tremolo4.xml b/data/Gootville/E223-tremolo4.xml index 586077210ee..2d64b671107 100644 --- a/data/Gootville/E223-tremolo4.xml +++ b/data/Gootville/E223-tremolo4.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E224-tremolo5.xml b/data/Gootville/E224-tremolo5.xml index f017db380eb..7a5a8c033dc 100644 --- a/data/Gootville/E224-tremolo5.xml +++ b/data/Gootville/E224-tremolo5.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E240-flag8thUp.xml b/data/Gootville/E240-flag8thUp.xml index 686cc8afa92..441a882a0ec 100644 --- a/data/Gootville/E240-flag8thUp.xml +++ b/data/Gootville/E240-flag8thUp.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E241-flag8thDown.xml b/data/Gootville/E241-flag8thDown.xml index a2aafb5ff56..241ff441cbf 100644 --- a/data/Gootville/E241-flag8thDown.xml +++ b/data/Gootville/E241-flag8thDown.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E260-accidentalFlat.xml b/data/Gootville/E260-accidentalFlat.xml index 6ab261ecf9d..806c46c8e99 100644 --- a/data/Gootville/E260-accidentalFlat.xml +++ b/data/Gootville/E260-accidentalFlat.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E261-accidentalNatural.xml b/data/Gootville/E261-accidentalNatural.xml index 3bb14727502..5e39dfc0b1a 100644 --- a/data/Gootville/E261-accidentalNatural.xml +++ b/data/Gootville/E261-accidentalNatural.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E262-accidentalSharp.xml b/data/Gootville/E262-accidentalSharp.xml index 4d79d08f501..5245cbc0239 100644 --- a/data/Gootville/E262-accidentalSharp.xml +++ b/data/Gootville/E262-accidentalSharp.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E263-accidentalDoubleSharp.xml b/data/Gootville/E263-accidentalDoubleSharp.xml index 084a19cf6e7..d3c2f9d9191 100644 --- a/data/Gootville/E263-accidentalDoubleSharp.xml +++ b/data/Gootville/E263-accidentalDoubleSharp.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E264-accidentalDoubleFlat.xml b/data/Gootville/E264-accidentalDoubleFlat.xml index a9d079639b5..963439f29a4 100644 --- a/data/Gootville/E264-accidentalDoubleFlat.xml +++ b/data/Gootville/E264-accidentalDoubleFlat.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E265-accidentalTripleSharp.xml b/data/Gootville/E265-accidentalTripleSharp.xml index c7926eb2dbb..0101c2e0d99 100644 --- a/data/Gootville/E265-accidentalTripleSharp.xml +++ b/data/Gootville/E265-accidentalTripleSharp.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E266-accidentalTripleFlat.xml b/data/Gootville/E266-accidentalTripleFlat.xml index 521407fbf54..fb3cd1ca448 100644 --- a/data/Gootville/E266-accidentalTripleFlat.xml +++ b/data/Gootville/E266-accidentalTripleFlat.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E267-accidentalNaturalFlat.xml b/data/Gootville/E267-accidentalNaturalFlat.xml index bf683bfc173..98e32f5b454 100644 --- a/data/Gootville/E267-accidentalNaturalFlat.xml +++ b/data/Gootville/E267-accidentalNaturalFlat.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E268-accidentalNaturalSharp.xml b/data/Gootville/E268-accidentalNaturalSharp.xml index 0c153dccaa0..84014834d5f 100644 --- a/data/Gootville/E268-accidentalNaturalSharp.xml +++ b/data/Gootville/E268-accidentalNaturalSharp.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E269-accidentalSharpSharp.xml b/data/Gootville/E269-accidentalSharpSharp.xml index 1a5a48413b9..d310378e341 100644 --- a/data/Gootville/E269-accidentalSharpSharp.xml +++ b/data/Gootville/E269-accidentalSharpSharp.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E26A-accidentalParensLeft.xml b/data/Gootville/E26A-accidentalParensLeft.xml index 1fce927122e..4cfe633d5b4 100644 --- a/data/Gootville/E26A-accidentalParensLeft.xml +++ b/data/Gootville/E26A-accidentalParensLeft.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E26B-accidentalParensRight.xml b/data/Gootville/E26B-accidentalParensRight.xml index 77f9a3cd705..f2fc22010a0 100644 --- a/data/Gootville/E26B-accidentalParensRight.xml +++ b/data/Gootville/E26B-accidentalParensRight.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E4A0-articAccentAbove.xml b/data/Gootville/E4A0-articAccentAbove.xml index 700da5dd8e9..c96f3363fdd 100644 --- a/data/Gootville/E4A0-articAccentAbove.xml +++ b/data/Gootville/E4A0-articAccentAbove.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E4A1-articAccentBelow.xml b/data/Gootville/E4A1-articAccentBelow.xml index e9845d12222..9a40f5fcbf5 100644 --- a/data/Gootville/E4A1-articAccentBelow.xml +++ b/data/Gootville/E4A1-articAccentBelow.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E4A8-articStaccatissimoWedgeAbove.xml b/data/Gootville/E4A8-articStaccatissimoWedgeAbove.xml index 371dd5cdde8..5741f453510 100644 --- a/data/Gootville/E4A8-articStaccatissimoWedgeAbove.xml +++ b/data/Gootville/E4A8-articStaccatissimoWedgeAbove.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E4A9-articStaccatissimoWedgeBelow.xml b/data/Gootville/E4A9-articStaccatissimoWedgeBelow.xml index da7cab6d00a..229aca1e754 100644 --- a/data/Gootville/E4A9-articStaccatissimoWedgeBelow.xml +++ b/data/Gootville/E4A9-articStaccatissimoWedgeBelow.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E4AC-articMarcatoAbove.xml b/data/Gootville/E4AC-articMarcatoAbove.xml index 90ab59891b3..30fb0b57a72 100644 --- a/data/Gootville/E4AC-articMarcatoAbove.xml +++ b/data/Gootville/E4AC-articMarcatoAbove.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E4AD-articMarcatoBelow.xml b/data/Gootville/E4AD-articMarcatoBelow.xml index e3af557e0e1..2eaf0ea4090 100644 --- a/data/Gootville/E4AD-articMarcatoBelow.xml +++ b/data/Gootville/E4AD-articMarcatoBelow.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E4C0-fermataAbove.xml b/data/Gootville/E4C0-fermataAbove.xml index e90bc7a87a5..371fae1576b 100644 --- a/data/Gootville/E4C0-fermataAbove.xml +++ b/data/Gootville/E4C0-fermataAbove.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E4C1-fermataBelow.xml b/data/Gootville/E4C1-fermataBelow.xml index 278c4b897da..6756bd0d61b 100644 --- a/data/Gootville/E4C1-fermataBelow.xml +++ b/data/Gootville/E4C1-fermataBelow.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E4E5-restQuarter.xml b/data/Gootville/E4E5-restQuarter.xml index e066b53f505..1d2f809d6c3 100644 --- a/data/Gootville/E4E5-restQuarter.xml +++ b/data/Gootville/E4E5-restQuarter.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E4E6-rest8th.xml b/data/Gootville/E4E6-rest8th.xml index 049107e79b3..22aec6c44d1 100644 --- a/data/Gootville/E4E6-rest8th.xml +++ b/data/Gootville/E4E6-rest8th.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E4E7-rest16th.xml b/data/Gootville/E4E7-rest16th.xml index e09c6a01125..82aa9bb0b8b 100644 --- a/data/Gootville/E4E7-rest16th.xml +++ b/data/Gootville/E4E7-rest16th.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E4E8-rest32nd.xml b/data/Gootville/E4E8-rest32nd.xml index 61b2868940f..347216269fc 100644 --- a/data/Gootville/E4E8-rest32nd.xml +++ b/data/Gootville/E4E8-rest32nd.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E4E9-rest64th.xml b/data/Gootville/E4E9-rest64th.xml index 37fbf03c07a..b236d1312cd 100644 --- a/data/Gootville/E4E9-rest64th.xml +++ b/data/Gootville/E4E9-rest64th.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E4EA-rest128th.xml b/data/Gootville/E4EA-rest128th.xml index a8b5340faff..2aa267966b7 100644 --- a/data/Gootville/E4EA-rest128th.xml +++ b/data/Gootville/E4EA-rest128th.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E500-repeat1Bar.xml b/data/Gootville/E500-repeat1Bar.xml index 4386d7270fb..1c29daf656a 100644 --- a/data/Gootville/E500-repeat1Bar.xml +++ b/data/Gootville/E500-repeat1Bar.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E520-dynamicPiano.xml b/data/Gootville/E520-dynamicPiano.xml index cc966f88d66..5dc9ffc835f 100644 --- a/data/Gootville/E520-dynamicPiano.xml +++ b/data/Gootville/E520-dynamicPiano.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E521-dynamicMezzo.xml b/data/Gootville/E521-dynamicMezzo.xml index e8bae288588..78b9c5461d0 100644 --- a/data/Gootville/E521-dynamicMezzo.xml +++ b/data/Gootville/E521-dynamicMezzo.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E522-dynamicForte.xml b/data/Gootville/E522-dynamicForte.xml index b2a4a8c655e..89b705929d6 100644 --- a/data/Gootville/E522-dynamicForte.xml +++ b/data/Gootville/E522-dynamicForte.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E523-dynamicRinforzando.xml b/data/Gootville/E523-dynamicRinforzando.xml index 19700619d09..efdfc17c9e2 100644 --- a/data/Gootville/E523-dynamicRinforzando.xml +++ b/data/Gootville/E523-dynamicRinforzando.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E524-dynamicSforzando.xml b/data/Gootville/E524-dynamicSforzando.xml index 75d9fe17d6f..3e8ac2a27da 100644 --- a/data/Gootville/E524-dynamicSforzando.xml +++ b/data/Gootville/E524-dynamicSforzando.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E525-dynamicZ.xml b/data/Gootville/E525-dynamicZ.xml index f0e1ea82475..97a1172bc61 100644 --- a/data/Gootville/E525-dynamicZ.xml +++ b/data/Gootville/E525-dynamicZ.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E52F-dynamicFF.xml b/data/Gootville/E52F-dynamicFF.xml index 6d55ce3e13a..c03df46eb2c 100644 --- a/data/Gootville/E52F-dynamicFF.xml +++ b/data/Gootville/E52F-dynamicFF.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E530-dynamicFFF.xml b/data/Gootville/E530-dynamicFFF.xml index 71131190ea6..bd1971ec87d 100644 --- a/data/Gootville/E530-dynamicFFF.xml +++ b/data/Gootville/E530-dynamicFFF.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E531-dynamicFFFF.xml b/data/Gootville/E531-dynamicFFFF.xml index bae0440d82a..333ceadedb1 100644 --- a/data/Gootville/E531-dynamicFFFF.xml +++ b/data/Gootville/E531-dynamicFFFF.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E532-dynamicFFFFF.xml b/data/Gootville/E532-dynamicFFFFF.xml index 8fa45838c6b..931fbe9fa00 100644 --- a/data/Gootville/E532-dynamicFFFFF.xml +++ b/data/Gootville/E532-dynamicFFFFF.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E566-ornamentTrill.xml b/data/Gootville/E566-ornamentTrill.xml index 2f8720f2bd9..1704a610df8 100644 --- a/data/Gootville/E566-ornamentTrill.xml +++ b/data/Gootville/E566-ornamentTrill.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E567-ornamentTurn.xml b/data/Gootville/E567-ornamentTurn.xml index b77cc10a671..fbc6426fb35 100644 --- a/data/Gootville/E567-ornamentTurn.xml +++ b/data/Gootville/E567-ornamentTurn.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E568-ornamentTurnInverted.xml b/data/Gootville/E568-ornamentTurnInverted.xml index 015d27b223e..20f1d35f997 100644 --- a/data/Gootville/E568-ornamentTurnInverted.xml +++ b/data/Gootville/E568-ornamentTurnInverted.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E56A-ornamentTurnUp.xml b/data/Gootville/E56A-ornamentTurnUp.xml index 4488fee377b..30e5b76412a 100644 --- a/data/Gootville/E56A-ornamentTurnUp.xml +++ b/data/Gootville/E56A-ornamentTurnUp.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E56B-ornamentTurnUpS.xml b/data/Gootville/E56B-ornamentTurnUpS.xml index 376003449df..675b8298163 100644 --- a/data/Gootville/E56B-ornamentTurnUpS.xml +++ b/data/Gootville/E56B-ornamentTurnUpS.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E56C-ornamentMordent.xml b/data/Gootville/E56C-ornamentMordent.xml index f6586c256ce..5c801b799bf 100644 --- a/data/Gootville/E56C-ornamentMordent.xml +++ b/data/Gootville/E56C-ornamentMordent.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E56D-ornamentMordentInverted.xml b/data/Gootville/E56D-ornamentMordentInverted.xml index 9bdef935f38..ba4e2ffd69d 100644 --- a/data/Gootville/E56D-ornamentMordentInverted.xml +++ b/data/Gootville/E56D-ornamentMordentInverted.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E56E-ornamentTremblement.xml b/data/Gootville/E56E-ornamentTremblement.xml index 934b38d80f7..b340c76dcd0 100644 --- a/data/Gootville/E56E-ornamentTremblement.xml +++ b/data/Gootville/E56E-ornamentTremblement.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E650-keyboardPedalPed.xml b/data/Gootville/E650-keyboardPedalPed.xml index aae3a660237..caa87d7124b 100644 --- a/data/Gootville/E650-keyboardPedalPed.xml +++ b/data/Gootville/E650-keyboardPedalPed.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E655-keyboardPedalUp.xml b/data/Gootville/E655-keyboardPedalUp.xml index 204d14fbad8..71f174fd658 100644 --- a/data/Gootville/E655-keyboardPedalUp.xml +++ b/data/Gootville/E655-keyboardPedalUp.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E880-tuplet0.xml b/data/Gootville/E880-tuplet0.xml index d9ebae885b1..215a9daa15e 100644 --- a/data/Gootville/E880-tuplet0.xml +++ b/data/Gootville/E880-tuplet0.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E881-tuplet1.xml b/data/Gootville/E881-tuplet1.xml index a0f12a6adb5..93b7f0b64be 100644 --- a/data/Gootville/E881-tuplet1.xml +++ b/data/Gootville/E881-tuplet1.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E882-tuplet2.xml b/data/Gootville/E882-tuplet2.xml index 9fe2bee9383..92c9e67e4b8 100644 --- a/data/Gootville/E882-tuplet2.xml +++ b/data/Gootville/E882-tuplet2.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E883-tuplet3.xml b/data/Gootville/E883-tuplet3.xml index a1796702bee..0d1c4c76bef 100644 --- a/data/Gootville/E883-tuplet3.xml +++ b/data/Gootville/E883-tuplet3.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E884-tuplet4.xml b/data/Gootville/E884-tuplet4.xml index 9aca15e5e9c..db1cfb81a96 100644 --- a/data/Gootville/E884-tuplet4.xml +++ b/data/Gootville/E884-tuplet4.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E885-tuplet5.xml b/data/Gootville/E885-tuplet5.xml index 7c0ab97b712..0edc06fa58a 100644 --- a/data/Gootville/E885-tuplet5.xml +++ b/data/Gootville/E885-tuplet5.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E886-tuplet6.xml b/data/Gootville/E886-tuplet6.xml index 2e042694747..794bb8592c3 100644 --- a/data/Gootville/E886-tuplet6.xml +++ b/data/Gootville/E886-tuplet6.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E887-tuplet7.xml b/data/Gootville/E887-tuplet7.xml index 24b9c1dcb3c..66929f9a76b 100644 --- a/data/Gootville/E887-tuplet7.xml +++ b/data/Gootville/E887-tuplet7.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E888-tuplet8.xml b/data/Gootville/E888-tuplet8.xml index df2138e5420..d17229bc59b 100644 --- a/data/Gootville/E888-tuplet8.xml +++ b/data/Gootville/E888-tuplet8.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E889-tuplet9.xml b/data/Gootville/E889-tuplet9.xml index 82fa6ed288a..3eaf78b15d1 100644 --- a/data/Gootville/E889-tuplet9.xml +++ b/data/Gootville/E889-tuplet9.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Gootville/E88A-tupletColon.xml b/data/Gootville/E88A-tupletColon.xml index 519dbff7d15..2feb1f444eb 100644 --- a/data/Gootville/E88A-tupletColon.xml +++ b/data/Gootville/E88A-tupletColon.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E003-bracketTop.xml b/data/Leipzig/E003-bracketTop.xml index 9f34f4b4d98..67997bc8d6b 100644 --- a/data/Leipzig/E003-bracketTop.xml +++ b/data/Leipzig/E003-bracketTop.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E004-bracketBottom.xml b/data/Leipzig/E004-bracketBottom.xml index 435196ca025..7d82b1db483 100644 --- a/data/Leipzig/E004-bracketBottom.xml +++ b/data/Leipzig/E004-bracketBottom.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E045-dalSegno.xml b/data/Leipzig/E045-dalSegno.xml index 81bdc228478..07c05844f1d 100644 --- a/data/Leipzig/E045-dalSegno.xml +++ b/data/Leipzig/E045-dalSegno.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E046-daCapo.xml b/data/Leipzig/E046-daCapo.xml index 539d917a12d..c6a149d0cb9 100644 --- a/data/Leipzig/E046-daCapo.xml +++ b/data/Leipzig/E046-daCapo.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E047-segno.xml b/data/Leipzig/E047-segno.xml index 4450570cf0a..69b00c8ea7b 100644 --- a/data/Leipzig/E047-segno.xml +++ b/data/Leipzig/E047-segno.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E048-coda.xml b/data/Leipzig/E048-coda.xml index acde03241b9..de93a51450a 100644 --- a/data/Leipzig/E048-coda.xml +++ b/data/Leipzig/E048-coda.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E04B-segnoSerpent2.xml b/data/Leipzig/E04B-segnoSerpent2.xml index 7f84b40b8e4..d369695540c 100644 --- a/data/Leipzig/E04B-segnoSerpent2.xml +++ b/data/Leipzig/E04B-segnoSerpent2.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E050-gClef.xml b/data/Leipzig/E050-gClef.xml index 810573a1771..ea8febc7c95 100644 --- a/data/Leipzig/E050-gClef.xml +++ b/data/Leipzig/E050-gClef.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E051-gClef15mb.xml b/data/Leipzig/E051-gClef15mb.xml index af182031dcc..6b27cb30ca0 100644 --- a/data/Leipzig/E051-gClef15mb.xml +++ b/data/Leipzig/E051-gClef15mb.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E052-gClef8vb.xml b/data/Leipzig/E052-gClef8vb.xml index ddd34820d67..d42611c0bd2 100644 --- a/data/Leipzig/E052-gClef8vb.xml +++ b/data/Leipzig/E052-gClef8vb.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E053-gClef8va.xml b/data/Leipzig/E053-gClef8va.xml index 679328dd04a..da0e6f4dce3 100644 --- a/data/Leipzig/E053-gClef8va.xml +++ b/data/Leipzig/E053-gClef8va.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E054-gClef15ma.xml b/data/Leipzig/E054-gClef15ma.xml index eff0876c1ec..5da73c78c96 100644 --- a/data/Leipzig/E054-gClef15ma.xml +++ b/data/Leipzig/E054-gClef15ma.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E05C-cClef.xml b/data/Leipzig/E05C-cClef.xml index c1038539322..d5f3a2063e7 100644 --- a/data/Leipzig/E05C-cClef.xml +++ b/data/Leipzig/E05C-cClef.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E05D-cClef8vb.xml b/data/Leipzig/E05D-cClef8vb.xml index 2159c16b94f..3f5fda1d484 100644 --- a/data/Leipzig/E05D-cClef8vb.xml +++ b/data/Leipzig/E05D-cClef8vb.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E062-fClef.xml b/data/Leipzig/E062-fClef.xml index 3e329086175..806d4828d39 100644 --- a/data/Leipzig/E062-fClef.xml +++ b/data/Leipzig/E062-fClef.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E063-fClef15mb.xml b/data/Leipzig/E063-fClef15mb.xml index 4e50deb28c0..5d633bcbae1 100644 --- a/data/Leipzig/E063-fClef15mb.xml +++ b/data/Leipzig/E063-fClef15mb.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E064-fClef8vb.xml b/data/Leipzig/E064-fClef8vb.xml index 3302a70ef4e..9ae80b7ab67 100644 --- a/data/Leipzig/E064-fClef8vb.xml +++ b/data/Leipzig/E064-fClef8vb.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E065-fClef8va.xml b/data/Leipzig/E065-fClef8va.xml index 16168896ae7..685587596c5 100644 --- a/data/Leipzig/E065-fClef8va.xml +++ b/data/Leipzig/E065-fClef8va.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E066-fClef15ma.xml b/data/Leipzig/E066-fClef15ma.xml index feb45133911..6500b5c6f4e 100644 --- a/data/Leipzig/E066-fClef15ma.xml +++ b/data/Leipzig/E066-fClef15ma.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E080-timeSig0.xml b/data/Leipzig/E080-timeSig0.xml index 9415b725f92..963b563adcf 100644 --- a/data/Leipzig/E080-timeSig0.xml +++ b/data/Leipzig/E080-timeSig0.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E081-timeSig1.xml b/data/Leipzig/E081-timeSig1.xml index baedd61541a..baa471a8a01 100644 --- a/data/Leipzig/E081-timeSig1.xml +++ b/data/Leipzig/E081-timeSig1.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E082-timeSig2.xml b/data/Leipzig/E082-timeSig2.xml index 3a27b7d79ec..2b3c542d078 100644 --- a/data/Leipzig/E082-timeSig2.xml +++ b/data/Leipzig/E082-timeSig2.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E083-timeSig3.xml b/data/Leipzig/E083-timeSig3.xml index 14251d9e569..ac72900a682 100644 --- a/data/Leipzig/E083-timeSig3.xml +++ b/data/Leipzig/E083-timeSig3.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E084-timeSig4.xml b/data/Leipzig/E084-timeSig4.xml index f725a91571c..e353f8a33a1 100644 --- a/data/Leipzig/E084-timeSig4.xml +++ b/data/Leipzig/E084-timeSig4.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E085-timeSig5.xml b/data/Leipzig/E085-timeSig5.xml index bff5ff6058b..20432349dd6 100644 --- a/data/Leipzig/E085-timeSig5.xml +++ b/data/Leipzig/E085-timeSig5.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E086-timeSig6.xml b/data/Leipzig/E086-timeSig6.xml index bd2b5fc1846..42faf6a86ea 100644 --- a/data/Leipzig/E086-timeSig6.xml +++ b/data/Leipzig/E086-timeSig6.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E087-timeSig7.xml b/data/Leipzig/E087-timeSig7.xml index e3e7703b512..e11dd29af43 100644 --- a/data/Leipzig/E087-timeSig7.xml +++ b/data/Leipzig/E087-timeSig7.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E088-timeSig8.xml b/data/Leipzig/E088-timeSig8.xml index 797818e25dc..48d33ee32b3 100644 --- a/data/Leipzig/E088-timeSig8.xml +++ b/data/Leipzig/E088-timeSig8.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E089-timeSig9.xml b/data/Leipzig/E089-timeSig9.xml index 51a04969081..020e8480185 100644 --- a/data/Leipzig/E089-timeSig9.xml +++ b/data/Leipzig/E089-timeSig9.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E08A-timeSigCommon.xml b/data/Leipzig/E08A-timeSigCommon.xml index b32da3615cd..58340d6aa45 100644 --- a/data/Leipzig/E08A-timeSigCommon.xml +++ b/data/Leipzig/E08A-timeSigCommon.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E08B-timeSigCutCommon.xml b/data/Leipzig/E08B-timeSigCutCommon.xml index c51ab96db89..b926fad945b 100644 --- a/data/Leipzig/E08B-timeSigCutCommon.xml +++ b/data/Leipzig/E08B-timeSigCutCommon.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E0A2-noteheadWhole.xml b/data/Leipzig/E0A2-noteheadWhole.xml index 4cf8f91fa24..ccc65c1d51c 100644 --- a/data/Leipzig/E0A2-noteheadWhole.xml +++ b/data/Leipzig/E0A2-noteheadWhole.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E0A3-noteheadHalf.xml b/data/Leipzig/E0A3-noteheadHalf.xml index 409c13f7015..22f50355d76 100644 --- a/data/Leipzig/E0A3-noteheadHalf.xml +++ b/data/Leipzig/E0A3-noteheadHalf.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E0A4-noteheadBlack.xml b/data/Leipzig/E0A4-noteheadBlack.xml index 46ff86ebc63..7999be3f430 100644 --- a/data/Leipzig/E0A4-noteheadBlack.xml +++ b/data/Leipzig/E0A4-noteheadBlack.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E0FA-noteheadWholeFilled.xml b/data/Leipzig/E0FA-noteheadWholeFilled.xml index ce3ca04abeb..6c3245d07b1 100644 --- a/data/Leipzig/E0FA-noteheadWholeFilled.xml +++ b/data/Leipzig/E0FA-noteheadWholeFilled.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E220-tremolo1.xml b/data/Leipzig/E220-tremolo1.xml index 2bbb7989734..a7600a2fa94 100644 --- a/data/Leipzig/E220-tremolo1.xml +++ b/data/Leipzig/E220-tremolo1.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E221-tremolo2.xml b/data/Leipzig/E221-tremolo2.xml index 3d12fd2e87a..1f01df30291 100644 --- a/data/Leipzig/E221-tremolo2.xml +++ b/data/Leipzig/E221-tremolo2.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E222-tremolo3.xml b/data/Leipzig/E222-tremolo3.xml index 1b4396c45d3..b7451404f63 100644 --- a/data/Leipzig/E222-tremolo3.xml +++ b/data/Leipzig/E222-tremolo3.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E223-tremolo4.xml b/data/Leipzig/E223-tremolo4.xml index 957aa60c438..34bb7d04fbe 100644 --- a/data/Leipzig/E223-tremolo4.xml +++ b/data/Leipzig/E223-tremolo4.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E224-tremolo5.xml b/data/Leipzig/E224-tremolo5.xml index 48067df4911..ea6f31a5cc6 100644 --- a/data/Leipzig/E224-tremolo5.xml +++ b/data/Leipzig/E224-tremolo5.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E240-flag8thUp.xml b/data/Leipzig/E240-flag8thUp.xml index 009613dff66..c5c62678227 100644 --- a/data/Leipzig/E240-flag8thUp.xml +++ b/data/Leipzig/E240-flag8thUp.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E241-flag8thDown.xml b/data/Leipzig/E241-flag8thDown.xml index d21b42eeda8..5a4a25204d5 100644 --- a/data/Leipzig/E241-flag8thDown.xml +++ b/data/Leipzig/E241-flag8thDown.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E260-accidentalFlat.xml b/data/Leipzig/E260-accidentalFlat.xml index c706f77689b..b9f85d40676 100644 --- a/data/Leipzig/E260-accidentalFlat.xml +++ b/data/Leipzig/E260-accidentalFlat.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E261-accidentalNatural.xml b/data/Leipzig/E261-accidentalNatural.xml index c5657963ba4..8c23f943d57 100644 --- a/data/Leipzig/E261-accidentalNatural.xml +++ b/data/Leipzig/E261-accidentalNatural.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E262-accidentalSharp.xml b/data/Leipzig/E262-accidentalSharp.xml index a76acd346fa..dc625b8a4e7 100644 --- a/data/Leipzig/E262-accidentalSharp.xml +++ b/data/Leipzig/E262-accidentalSharp.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E263-accidentalDoubleSharp.xml b/data/Leipzig/E263-accidentalDoubleSharp.xml index b7ca92cfcb0..cde941e2e39 100644 --- a/data/Leipzig/E263-accidentalDoubleSharp.xml +++ b/data/Leipzig/E263-accidentalDoubleSharp.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E264-accidentalDoubleFlat.xml b/data/Leipzig/E264-accidentalDoubleFlat.xml index bb3b4be0102..6988f3fcfdc 100644 --- a/data/Leipzig/E264-accidentalDoubleFlat.xml +++ b/data/Leipzig/E264-accidentalDoubleFlat.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E265-accidentalTripleSharp.xml b/data/Leipzig/E265-accidentalTripleSharp.xml index b8267c480f1..8ca799e6777 100644 --- a/data/Leipzig/E265-accidentalTripleSharp.xml +++ b/data/Leipzig/E265-accidentalTripleSharp.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E266-accidentalTripleFlat.xml b/data/Leipzig/E266-accidentalTripleFlat.xml index 5c2fbc78a95..8a732945944 100644 --- a/data/Leipzig/E266-accidentalTripleFlat.xml +++ b/data/Leipzig/E266-accidentalTripleFlat.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E267-accidentalNaturalFlat.xml b/data/Leipzig/E267-accidentalNaturalFlat.xml index 60614ab64f3..7ab6dd15492 100644 --- a/data/Leipzig/E267-accidentalNaturalFlat.xml +++ b/data/Leipzig/E267-accidentalNaturalFlat.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E268-accidentalNaturalSharp.xml b/data/Leipzig/E268-accidentalNaturalSharp.xml index 55a89b4ddec..2058bc01087 100644 --- a/data/Leipzig/E268-accidentalNaturalSharp.xml +++ b/data/Leipzig/E268-accidentalNaturalSharp.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E269-accidentalSharpSharp.xml b/data/Leipzig/E269-accidentalSharpSharp.xml index eefba05d9e8..756a8ddb0b9 100644 --- a/data/Leipzig/E269-accidentalSharpSharp.xml +++ b/data/Leipzig/E269-accidentalSharpSharp.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E26A-accidentalParensLeft.xml b/data/Leipzig/E26A-accidentalParensLeft.xml index 99793683fd7..4ef7800c677 100644 --- a/data/Leipzig/E26A-accidentalParensLeft.xml +++ b/data/Leipzig/E26A-accidentalParensLeft.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E26B-accidentalParensRight.xml b/data/Leipzig/E26B-accidentalParensRight.xml index 79bc1f15347..41677af3e26 100644 --- a/data/Leipzig/E26B-accidentalParensRight.xml +++ b/data/Leipzig/E26B-accidentalParensRight.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E4A0-articAccentAbove.xml b/data/Leipzig/E4A0-articAccentAbove.xml index 77cb8c84bd2..79ce8b9f39f 100644 --- a/data/Leipzig/E4A0-articAccentAbove.xml +++ b/data/Leipzig/E4A0-articAccentAbove.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E4A1-articAccentBelow.xml b/data/Leipzig/E4A1-articAccentBelow.xml index 0cb47b6db76..e345585342f 100644 --- a/data/Leipzig/E4A1-articAccentBelow.xml +++ b/data/Leipzig/E4A1-articAccentBelow.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E4A8-articStaccatissimoWedgeAbove.xml b/data/Leipzig/E4A8-articStaccatissimoWedgeAbove.xml index 8598e5b49d3..67247e91415 100644 --- a/data/Leipzig/E4A8-articStaccatissimoWedgeAbove.xml +++ b/data/Leipzig/E4A8-articStaccatissimoWedgeAbove.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E4A9-articStaccatissimoWedgeBelow.xml b/data/Leipzig/E4A9-articStaccatissimoWedgeBelow.xml index 879a755bd6e..939e754fa81 100644 --- a/data/Leipzig/E4A9-articStaccatissimoWedgeBelow.xml +++ b/data/Leipzig/E4A9-articStaccatissimoWedgeBelow.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E4AC-articMarcatoAbove.xml b/data/Leipzig/E4AC-articMarcatoAbove.xml index caf76a51928..4439b63c403 100644 --- a/data/Leipzig/E4AC-articMarcatoAbove.xml +++ b/data/Leipzig/E4AC-articMarcatoAbove.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E4AD-articMarcatoBelow.xml b/data/Leipzig/E4AD-articMarcatoBelow.xml index 10176992183..790b5698836 100644 --- a/data/Leipzig/E4AD-articMarcatoBelow.xml +++ b/data/Leipzig/E4AD-articMarcatoBelow.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E4C0-fermataAbove.xml b/data/Leipzig/E4C0-fermataAbove.xml index 90a7b58b6be..e19685e132c 100644 --- a/data/Leipzig/E4C0-fermataAbove.xml +++ b/data/Leipzig/E4C0-fermataAbove.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E4C1-fermataBelow.xml b/data/Leipzig/E4C1-fermataBelow.xml index 531278d21f2..a932736790b 100644 --- a/data/Leipzig/E4C1-fermataBelow.xml +++ b/data/Leipzig/E4C1-fermataBelow.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E4E5-restQuarter.xml b/data/Leipzig/E4E5-restQuarter.xml index 6a0a375e75a..7d1fd473e93 100644 --- a/data/Leipzig/E4E5-restQuarter.xml +++ b/data/Leipzig/E4E5-restQuarter.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E4E6-rest8th.xml b/data/Leipzig/E4E6-rest8th.xml index 2f4bc3abeb8..e4e67ecb340 100644 --- a/data/Leipzig/E4E6-rest8th.xml +++ b/data/Leipzig/E4E6-rest8th.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E4E7-rest16th.xml b/data/Leipzig/E4E7-rest16th.xml index 92999c9a059..6125fc05ff7 100644 --- a/data/Leipzig/E4E7-rest16th.xml +++ b/data/Leipzig/E4E7-rest16th.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E4E8-rest32nd.xml b/data/Leipzig/E4E8-rest32nd.xml index 1d3f8c7a771..ff60125964e 100644 --- a/data/Leipzig/E4E8-rest32nd.xml +++ b/data/Leipzig/E4E8-rest32nd.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E4E9-rest64th.xml b/data/Leipzig/E4E9-rest64th.xml index d428e37e8e6..31bf30ae88d 100644 --- a/data/Leipzig/E4E9-rest64th.xml +++ b/data/Leipzig/E4E9-rest64th.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E4EA-rest128th.xml b/data/Leipzig/E4EA-rest128th.xml index 9dd3d27bdab..9187fadb1bb 100644 --- a/data/Leipzig/E4EA-rest128th.xml +++ b/data/Leipzig/E4EA-rest128th.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E500-repeat1Bar.xml b/data/Leipzig/E500-repeat1Bar.xml index 8ce31697b37..70ea3e1ce82 100644 --- a/data/Leipzig/E500-repeat1Bar.xml +++ b/data/Leipzig/E500-repeat1Bar.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E520-dynamicPiano.xml b/data/Leipzig/E520-dynamicPiano.xml index ff28465345f..080b8f9dfc4 100644 --- a/data/Leipzig/E520-dynamicPiano.xml +++ b/data/Leipzig/E520-dynamicPiano.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E521-dynamicMezzo.xml b/data/Leipzig/E521-dynamicMezzo.xml index d01d90c0772..2efaf4e9af6 100644 --- a/data/Leipzig/E521-dynamicMezzo.xml +++ b/data/Leipzig/E521-dynamicMezzo.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E522-dynamicForte.xml b/data/Leipzig/E522-dynamicForte.xml index e4ddff87ee3..5220a34b34e 100644 --- a/data/Leipzig/E522-dynamicForte.xml +++ b/data/Leipzig/E522-dynamicForte.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E523-dynamicRinforzando.xml b/data/Leipzig/E523-dynamicRinforzando.xml index 3a43155938d..f20bb9e7cf3 100644 --- a/data/Leipzig/E523-dynamicRinforzando.xml +++ b/data/Leipzig/E523-dynamicRinforzando.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E524-dynamicSforzando.xml b/data/Leipzig/E524-dynamicSforzando.xml index a7f901ee44c..95b541ce4b6 100644 --- a/data/Leipzig/E524-dynamicSforzando.xml +++ b/data/Leipzig/E524-dynamicSforzando.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E525-dynamicZ.xml b/data/Leipzig/E525-dynamicZ.xml index 5a4d7648ef2..6a35b1885a2 100644 --- a/data/Leipzig/E525-dynamicZ.xml +++ b/data/Leipzig/E525-dynamicZ.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E52F-dynamicFF.xml b/data/Leipzig/E52F-dynamicFF.xml index 6e2ca7f825e..0f532f2e2bb 100644 --- a/data/Leipzig/E52F-dynamicFF.xml +++ b/data/Leipzig/E52F-dynamicFF.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E530-dynamicFFF.xml b/data/Leipzig/E530-dynamicFFF.xml index b3bcbe1f970..5db17cf11f6 100644 --- a/data/Leipzig/E530-dynamicFFF.xml +++ b/data/Leipzig/E530-dynamicFFF.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E531-dynamicFFFF.xml b/data/Leipzig/E531-dynamicFFFF.xml index a57983caa2f..6130c3a415b 100644 --- a/data/Leipzig/E531-dynamicFFFF.xml +++ b/data/Leipzig/E531-dynamicFFFF.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E532-dynamicFFFFF.xml b/data/Leipzig/E532-dynamicFFFFF.xml index 6ef88988cd3..63b189f3abc 100644 --- a/data/Leipzig/E532-dynamicFFFFF.xml +++ b/data/Leipzig/E532-dynamicFFFFF.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E566-ornamentTrill.xml b/data/Leipzig/E566-ornamentTrill.xml index ffe883c103d..3bcca4a92a7 100644 --- a/data/Leipzig/E566-ornamentTrill.xml +++ b/data/Leipzig/E566-ornamentTrill.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E567-ornamentTurn.xml b/data/Leipzig/E567-ornamentTurn.xml index f0df038a070..409fcfa968c 100644 --- a/data/Leipzig/E567-ornamentTurn.xml +++ b/data/Leipzig/E567-ornamentTurn.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E568-ornamentTurnInverted.xml b/data/Leipzig/E568-ornamentTurnInverted.xml index 1509b6c14fe..6f6550210fb 100644 --- a/data/Leipzig/E568-ornamentTurnInverted.xml +++ b/data/Leipzig/E568-ornamentTurnInverted.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E56A-ornamentTurnUp.xml b/data/Leipzig/E56A-ornamentTurnUp.xml index fce89b199ad..5080ed5688a 100644 --- a/data/Leipzig/E56A-ornamentTurnUp.xml +++ b/data/Leipzig/E56A-ornamentTurnUp.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E56B-ornamentTurnUpS.xml b/data/Leipzig/E56B-ornamentTurnUpS.xml index c1b8888e327..2e7912f4e19 100644 --- a/data/Leipzig/E56B-ornamentTurnUpS.xml +++ b/data/Leipzig/E56B-ornamentTurnUpS.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E56C-ornamentMordent.xml b/data/Leipzig/E56C-ornamentMordent.xml index b23fb1e11f0..d521694e7d1 100644 --- a/data/Leipzig/E56C-ornamentMordent.xml +++ b/data/Leipzig/E56C-ornamentMordent.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E56D-ornamentMordentInverted.xml b/data/Leipzig/E56D-ornamentMordentInverted.xml index e013e28690a..e5e59c37824 100644 --- a/data/Leipzig/E56D-ornamentMordentInverted.xml +++ b/data/Leipzig/E56D-ornamentMordentInverted.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E56E-ornamentTremblement.xml b/data/Leipzig/E56E-ornamentTremblement.xml index d485d4253fb..3665869dfe4 100644 --- a/data/Leipzig/E56E-ornamentTremblement.xml +++ b/data/Leipzig/E56E-ornamentTremblement.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E650-keyboardPedalPed.xml b/data/Leipzig/E650-keyboardPedalPed.xml index 6bce15eb44a..e45f4c5732c 100644 --- a/data/Leipzig/E650-keyboardPedalPed.xml +++ b/data/Leipzig/E650-keyboardPedalPed.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E655-keyboardPedalUp.xml b/data/Leipzig/E655-keyboardPedalUp.xml index e6c395cec15..56999a42205 100644 --- a/data/Leipzig/E655-keyboardPedalUp.xml +++ b/data/Leipzig/E655-keyboardPedalUp.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E880-tuplet0.xml b/data/Leipzig/E880-tuplet0.xml index 272ef2d4f98..16fd301eae6 100644 --- a/data/Leipzig/E880-tuplet0.xml +++ b/data/Leipzig/E880-tuplet0.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E881-tuplet1.xml b/data/Leipzig/E881-tuplet1.xml index 93c97b1b147..ec71b0ba91c 100644 --- a/data/Leipzig/E881-tuplet1.xml +++ b/data/Leipzig/E881-tuplet1.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E882-tuplet2.xml b/data/Leipzig/E882-tuplet2.xml index 7b8417901e6..854cf7723ad 100644 --- a/data/Leipzig/E882-tuplet2.xml +++ b/data/Leipzig/E882-tuplet2.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E883-tuplet3.xml b/data/Leipzig/E883-tuplet3.xml index 9c9137755c5..1bb7ef8321f 100644 --- a/data/Leipzig/E883-tuplet3.xml +++ b/data/Leipzig/E883-tuplet3.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E884-tuplet4.xml b/data/Leipzig/E884-tuplet4.xml index 6985a519376..bb01f8fa88e 100644 --- a/data/Leipzig/E884-tuplet4.xml +++ b/data/Leipzig/E884-tuplet4.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E885-tuplet5.xml b/data/Leipzig/E885-tuplet5.xml index e35f563a8e3..41884b4dcc8 100644 --- a/data/Leipzig/E885-tuplet5.xml +++ b/data/Leipzig/E885-tuplet5.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E886-tuplet6.xml b/data/Leipzig/E886-tuplet6.xml index 5e8217958de..427c9a67dbe 100644 --- a/data/Leipzig/E886-tuplet6.xml +++ b/data/Leipzig/E886-tuplet6.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E887-tuplet7.xml b/data/Leipzig/E887-tuplet7.xml index ece9b06c6f9..f110c9cb474 100644 --- a/data/Leipzig/E887-tuplet7.xml +++ b/data/Leipzig/E887-tuplet7.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E888-tuplet8.xml b/data/Leipzig/E888-tuplet8.xml index dc264f5548f..eb55f79ebf6 100644 --- a/data/Leipzig/E888-tuplet8.xml +++ b/data/Leipzig/E888-tuplet8.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E889-tuplet9.xml b/data/Leipzig/E889-tuplet9.xml index 0f047991cd8..36733420af5 100644 --- a/data/Leipzig/E889-tuplet9.xml +++ b/data/Leipzig/E889-tuplet9.xml @@ -1,4 +1,7 @@ - + diff --git a/data/Leipzig/E88A-tupletColon.xml b/data/Leipzig/E88A-tupletColon.xml index 5b6f30cfec5..f3e3b5aa6b4 100644 --- a/data/Leipzig/E88A-tupletColon.xml +++ b/data/Leipzig/E88A-tupletColon.xml @@ -1,4 +1,7 @@ - + diff --git a/fonts/Leipzig-5.1.sfd b/fonts/Leipzig-5.1.sfd index d4accb6741e..9131873c3c1 100644 --- a/fonts/Leipzig-5.1.sfd +++ b/fonts/Leipzig-5.1.sfd @@ -20,7 +20,7 @@ OS2Version: 0 OS2_WeightWidthSlopeOnly: 0 OS2_UseTypoMetrics: 1 CreationTime: 1395388130 -ModificationTime: 1439743806 +ModificationTime: 1439817061 PfmFamily: 17 TTFWeight: 500 TTFWidth: 5 @@ -49,7 +49,7 @@ NameList: Adobe Glyph List DisplaySize: -72 AntiAlias: 1 FitToEm: 1 -WinInfo: 57690 15 7 +WinInfo: 58554 18 9 BeginPrivate: 0 EndPrivate TeXData: 1 0 0 346030 173015 115343 0 1048576 115343 783286 444596 497025 792723 393216 433062 380633 303038 157286 324010 404750 52429 2506097 1059062 262144 @@ -3354,28 +3354,28 @@ StartChar: uniE88A Encoding: 59530 59530 65 Width: 144 VWidth: 2048 -Flags: HW +Flags: HMW LayerCount: 2 Fore SplineSet -16 87 m 0 - 16 98 19 106 26 113 c 128 - 33 120 42 123 53 123 c 0 - 64 123 72 120 79 113 c 128 - 86 106 90 97 90 87 c 128 - 90 77 86 68 79 60 c 1 - 72 53 62 50 52 50 c 128 - 42 50 33 53 26 60 c 128 - 19 67 16 76 16 87 c 0 -52 207 m 128 - 52 218 56 227 63 234 c 128 - 70 241 80 244 90 244 c 128 - 100 244 109 240 116 233 c 0 - 123 226 126 217 126 207 c 128 - 126 197 122 188 115 181 c 0 - 108 174 99 171 89 171 c 128 - 79 171 70 174 63 181 c 128 - 56 188 52 196 52 207 c 128 +17 87 m 0 + 17 98 20 106 27 113 c 0 + 34 120 43 123 54 123 c 0 + 65 123 73 120 80 113 c 0 + 87 106 91 97 91 87 c 0 + 91 77 87 68 80 60 c 1 + 73 53 63 50 53 50 c 0 + 43 50 34 53 27 60 c 0 + 20 67 17 76 17 87 c 0 +53 207 m 4 + 53 218 57 227 64 234 c 0 + 71 241 81 244 91 244 c 0 + 101 244 110 240 117 233 c 0 + 124 226 127 217 127 207 c 0 + 127 197 123 188 116 181 c 0 + 109 174 100 171 90 171 c 0 + 80 171 71 174 64 181 c 0 + 57 188 53 196 53 207 c 4 EndSplineSet EndChar @@ -3387,64 +3387,64 @@ Flags: HW LayerCount: 2 Fore SplineSet --76 -179 m 5 - -78 -181.667 -78.667 -184 -78 -186 c 132 - -77.333 -188 -73.667 -189.333 -67 -190 c 5 - -48.333 -190 -32.667 -176.333 -20 -149 c 4 - -13.333 -135 -6.66699 -119 0 -101 c 132 - 6.66699 -83 11.667 -65.667 15 -49 c 6 - 29 12 l 5 - 73 220 l 5 - 15 220 l 5 - 15 258 l 5 - 85 258 l 5 - 92.333 278.667 98.333 294.333 103 305 c 4 - 110.333 323 117.667 337.667 125 349 c 4 - 145.666 379 167.333 402 190 418 c 132 - 212.667 434 237.667 442 265 442 c 4 - 274.333 442 282 441 288 439 c 132 - 294 437 300.333 431.667 307 423 c 4 - 311.667 416.333 314.667 410 316 404 c 6 - 320 388 l 5 - 320 373.333 319.333 362.666 318 356 c 132 - 316.667 349.333 313 340 307 328 c 4 - 304.333 322 298.333 315 289 307 c 4 - 285 303.667 280.667 301.667 276 301 c 132 - 271.333 300.333 265.667 300.333 259 301 c 5 - 253 302.333 248.667 306 246 312 c 132 - 243.333 318 241.333 324.667 240 332 c 5 - 240 344 242.333 354.667 247 364 c 132 - 251.667 373.333 259 381.333 269 388 c 4 - 276 393 276 393 283 398 c 5 - 283 406.667 277 412 265 414 c 5 - 251.667 415.33 240.333 412.663 231 406 c 132 - 221.667 399.333 212 385 202 363 c 5 - 197.333 351 191.667 333.333 185 310 c 132 - 178.333 286.667 173.667 270 171 260 c 5 - 248 260 l 5 - 248 220 l 5 - 163 220 l 5 - 151 151.333 134 82.667 112 14 c 4 - 94 -41.333 76.667 -85 60 -117 c 4 - 46.667 -143 33 -164 19 -180 c 4 - -5.66699 -208.667 -31 -223 -57 -223 c 4 - -81.666 -223 -100.333 -213.333 -113 -194 c 4 - -123 -178.667 -128 -160.667 -128 -140 c 4 - -128 -123.333 -124 -107.333 -116 -92 c 5 - -111.333 -84.667 -105.667 -79 -99 -75 c 132 - -92.333 -71 -85.667 -69 -79 -69 c 4 - -70.333 -69 -63.333 -73 -58 -81 c 132 - -52.667 -89 -49 -96.333 -47 -103 c 132 - -45 -109.667 -44 -115.333 -44 -120 c 4 - -44 -129.333 -46.333 -137.333 -51 -144 c 132 - -55.6641 -150.667 -60.3301 -157.667 -65 -165 c 132 - -69.6641 -172.333 -73.3301 -177 -76 -179 c 5 +-91 -179 m 1 + -93 -181.667 -93.667 -184 -93 -186 c 128 + -92.333 -188 -88.667 -189.333 -82 -190 c 1 + -63.333 -190 -47.667 -176.333 -35 -149 c 0 + -28.333 -135 -21.667 -119 -15 -101 c 128 + -8.33301 -83 -3.33301 -65.667 0 -49 c 2 + 14 12 l 1 + 58 220 l 1 + 0 220 l 5 + 0 258 l 1 + 70 258 l 1 + 77.333 278.667 83.333 294.333 88 305 c 0 + 95.333 323 102.667 337.667 110 349 c 0 + 130.666 379 152.333 402 175 418 c 128 + 197.667 434 222.667 442 250 442 c 0 + 259.333 442 267 441 273 439 c 128 + 279 437 285.333 431.667 292 423 c 0 + 296.667 416.333 299.667 410 301 404 c 2 + 305 388 l 1 + 305 373.333 304.333 362.666 303 356 c 128 + 301.667 349.333 298 340 292 328 c 0 + 289.333 322 283.333 315 274 307 c 0 + 270 303.667 265.667 301.667 261 301 c 128 + 256.333 300.333 250.667 300.333 244 301 c 1 + 238 302.333 233.667 306 231 312 c 128 + 228.333 318 226.333 324.667 225 332 c 1 + 225 344 227.333 354.667 232 364 c 128 + 236.667 373.333 244 381.333 254 388 c 0 + 261 393 261 393 268 398 c 1 + 268 406.667 262 412 250 414 c 1 + 236.667 415.33 225.333 412.663 216 406 c 128 + 206.667 399.333 197 385 187 363 c 1 + 182.333 351 176.667 333.333 170 310 c 128 + 163.333 286.667 158.667 270 156 260 c 1 + 233 260 l 1 + 233 220 l 1 + 148 220 l 1 + 136 151.333 119 82.667 97 14 c 0 + 79 -41.333 61.667 -85 45 -117 c 0 + 31.667 -143 18 -164 4 -180 c 0 + -20.667 -208.667 -46 -223 -72 -223 c 0 + -96.666 -223 -115.333 -213.333 -128 -194 c 0 + -138 -178.667 -143 -160.667 -143 -140 c 0 + -143 -123.333 -139 -107.333 -131 -92 c 1 + -126.333 -84.667 -120.667 -79 -114 -75 c 128 + -107.333 -71 -100.667 -69 -94 -69 c 0 + -85.333 -69 -78.333 -73 -73 -81 c 128 + -67.667 -89 -64 -96.333 -62 -103 c 128 + -60 -109.667 -59 -115.333 -59 -120 c 0 + -59 -129.333 -61.333 -137.333 -66 -144 c 128 + -70.6641 -150.667 -75.3301 -157.667 -80 -165 c 128 + -84.6641 -172.333 -88.3301 -177 -91 -179 c 1 EndSplineSet EndChar StartChar: uniE521 Encoding: 58657 58657 67 -Width: 430 +Width: 405 VWidth: 2048 Flags: HW LayerCount: 2 @@ -3457,11 +3457,11 @@ SplineSet 317 24 321 17 329 16 c 1 337 16 346 21 355 31 c 128 364 41 370 47 371 48 c 0 - 375 55 378 60 380 63 c 2 - 407 103 l 1 - 428 103 l 1 - 398 53 l 2 - 386 33 373 16 360 3 c 128 + 375 55 389.633 79.6631 391 83 c 2 + 405 124 l 1 + 428 124 l 1 + 404 61 l 2 + 395.696 39.2031 373 16 360 3 c 128 347 -10 331 -17 314 -18 c 0 296 -18 280 -13 265 -4 c 1 249 11 l 1 @@ -3501,7 +3501,7 @@ Flags: HW LayerCount: 2 Fore SplineSet -23 124 m 1 +23 124 m 5 0 124 l 1 22 166.667 42.667 200.333 62 225 c 128 81.333 249.667 106.667 262.333 138 263 c 0 @@ -3538,7 +3538,7 @@ SplineSet 72 211 64.333 200.667 57 188 c 1 46 171 l 1 36 151 l 1 - 23 124 l 1 + 23 124 l 5 197 201 m 0 185 180.333 175.333 156.333 168 129 c 1 161.333 99 158 78.333 158 67 c 0 @@ -4464,497 +4464,497 @@ EndChar StartChar: uniE530 Encoding: 58672 58672 85 -Width: 780 +Width: 692 VWidth: 2048 Flags: HW LayerCount: 2 Fore SplineSet -378 -69 m 5 - 401 -69 413 -92 414 -116 c 4 - 414 -124 410 -139 405 -147 c 6 - 395 -162 l 6 - 388 -172 387 -174 382 -183 c 5 - 382 -188 385 -190 392 -190 c 4 - 411 -190 427 -176 440 -148 c 5 - 453 -116 463 -88 473 -51 c 5 - 487 11 500 72 514 134 c 6 - 532 220 l 5 - 392 220 l 5 - 378 131 332 -36 299 -98 c 5 - 284 -129 269 -155 252 -177 c 132 - 235 -199 214 -214 187 -221 c 5 - 169 -223 l 5 - 125 -223 102 -183 102 -136 c 4 - 102 -97 120 -83 147 -69 c 5 - 153 -69 158 -70 161 -73 c 5 - 166 -75 170 -80 174 -84 c 4 - 181 -93 184 -104 184 -118 c 4 - 184 -133 173 -154 152 -183 c 5 - 152 -188 155 -190 161 -190 c 4 - 195 -190 222 -144 243 -51 c 4 - 250 -22 256 8 263 38 c 4 - 276 99 289 159 302 220 c 5 - 161 220 l 5 - 148 135 99 -35 68 -98 c 5 - 35 -170 -2 -211 -42 -221 c 5 - -61 -223 l 5 - -96 -223 -112 -199 -124 -169 c 5 - -129 -136 l 5 - -124 -97 -116 -81 -83 -69 c 5 - -60 -69 -45 -95 -45 -118 c 4 - -45 -126 -47 -134 -51 -141 c 6 - -65 -164 l 5 - -79 -183 l 5 - -79 -188 -76 -190 -69 -190 c 4 - -58 -190 -48 -185 -39 -175 c 5 - -21 -160 -13 -129 -2 -104 c 5 - 13 -51 l 5 - 30 26 47 104 63 182 c 132 - 66 195 69 208 72 220 c 5 - 15 220 l 5 - 15 258 l 5 - 84 258 l 5 - 93 291 107 320 124 347 c 5 - 141 375 162 398 187 417 c 5 - 212 434 240 442 270 442 c 4 - 303 442 319 412 319 376 c 132 - 319 338 300 306 269 300 c 5 - 252 300 242 311 240 332 c 5 - 240 359 257 385 277 394 c 5 - 280 394 282 396 282 400 c 5 - 276 409 l 5 - 271 412 265 414 258 414 c 4 - 235 414 217 398 203 366 c 132 - 189 334 178 299 171 260 c 5 - 315 260 l 5 - 338 344 400 442 500 442 c 4 - 536 442 547 411 549 376 c 5 - 549 358 545 341 536 325 c 5 - 528 313 516 305 499 300 c 5 - 481 300 471 311 469 332 c 5 - 469 361 487 383 506 394 c 5 - 509 394 511 396 511 400 c 5 - 507 410 500 414 488 414 c 4 - 451 414 421 362 400 258 c 5 - 544 258 l 5 - 559 307 583 351 616 390 c 4 - 647 426 685 444 730 444 c 4 - 764 444 779 408 779 374 c 4 - 779 337 760 306 728 300 c 5 - 712 300 703 311 701 332 c 5 - 701 358 719 384 736 394 c 5 - 740 394 742 396 742 400 c 5 - 737 409 731 414 718 414 c 4 - 681 414 651 362 630 258 c 5 - 706 258 l 5 - 706 220 l 5 - 621 220 l 5 - 614 176 606 136 595 99 c 5 - 577 24 556 -42 529 -98 c 5 - 514 -126 498 -153 479 -177 c 5 - 463 -198 443 -213 418 -221 c 5 - 400 -223 l 5 - 365 -223 347 -200 338 -169 c 5 - 334 -159 332 -148 332 -136 c 5 - 336 -99 347 -79 378 -69 c 5 +363 -69 m 1 + 386 -69 398 -92 399 -116 c 0 + 399 -124 395 -139 390 -147 c 2 + 380 -162 l 2 + 373 -172 372 -174 367 -183 c 1 + 367 -188 370 -190 377 -190 c 0 + 396 -190 412 -176 425 -148 c 1 + 438 -116 448 -88 458 -51 c 1 + 472 11 485 72 499 134 c 2 + 517 220 l 1 + 377 220 l 1 + 363 131 317 -36 284 -98 c 1 + 269 -129 254 -155 237 -177 c 128 + 220 -199 199 -214 172 -221 c 1 + 154 -223 l 1 + 110 -223 87 -183 87 -136 c 0 + 87 -97 105 -83 132 -69 c 1 + 138 -69 143 -70 146 -73 c 1 + 151 -75 155 -80 159 -84 c 0 + 166 -93 169 -104 169 -118 c 0 + 169 -133 158 -154 137 -183 c 1 + 137 -188 140 -190 146 -190 c 0 + 180 -190 207 -144 228 -51 c 0 + 235 -22 241 8 248 38 c 0 + 261 99 274 159 287 220 c 1 + 146 220 l 1 + 133 135 84 -35 53 -98 c 1 + 20 -170 -17 -211 -57 -221 c 1 + -76 -223 l 1 + -111 -223 -127 -199 -139 -169 c 1 + -144 -136 l 1 + -139 -97 -131 -81 -98 -69 c 1 + -75 -69 -60 -95 -60 -118 c 0 + -60 -126 -62 -134 -66 -141 c 2 + -80 -164 l 1 + -94 -183 l 1 + -94 -188 -91 -190 -84 -190 c 0 + -73 -190 -63 -185 -54 -175 c 1 + -36 -160 -28 -129 -17 -104 c 1 + -2 -51 l 1 + 15 26 32 104 48 182 c 128 + 51 195 54 208 57 220 c 1 + 0 220 l 1 + 0 258 l 1 + 69 258 l 1 + 78 291 92 320 109 347 c 1 + 126 375 147 398 172 417 c 1 + 197 434 225 442 255 442 c 0 + 288 442 304 412 304 376 c 128 + 304 338 285 306 254 300 c 1 + 237 300 227 311 225 332 c 1 + 225 359 242 385 262 394 c 1 + 265 394 267 396 267 400 c 1 + 261 409 l 1 + 256 412 250 414 243 414 c 0 + 220 414 202 398 188 366 c 128 + 174 334 163 299 156 260 c 1 + 300 260 l 1 + 323 344 385 442 485 442 c 0 + 521 442 532 411 534 376 c 1 + 534 358 530 341 521 325 c 1 + 513 313 501 305 484 300 c 1 + 466 300 456 311 454 332 c 1 + 454 361 472 383 491 394 c 1 + 494 394 496 396 496 400 c 1 + 492 410 485 414 473 414 c 0 + 436 414 406 362 385 258 c 1 + 529 258 l 1 + 544 307 568 351 601 390 c 0 + 632 426 670 444 715 444 c 0 + 749 444 764 408 764 374 c 0 + 764 337 745 306 713 300 c 1 + 697 300 688 311 686 332 c 1 + 686 358 704 384 721 394 c 1 + 725 394 727 396 727 400 c 1 + 722 409 716 414 703 414 c 0 + 666 414 636 362 615 258 c 1 + 691 258 l 1 + 691 220 l 1 + 606 220 l 1 + 599 176 591 136 580 99 c 1 + 562 24 541 -42 514 -98 c 1 + 499 -126 483 -153 464 -177 c 1 + 448 -198 428 -213 403 -221 c 1 + 385 -223 l 1 + 350 -223 332 -200 323 -169 c 1 + 319 -159 317 -148 317 -136 c 1 + 321 -99 332 -79 363 -69 c 1 EndSplineSet EndChar StartChar: uniE52F Encoding: 58671 58671 86 -Width: 571 +Width: 479 VWidth: 2048 Flags: HW LayerCount: 2 Fore SplineSet -496 220 m 1 - 413 220 l 1 - 404.333 164.667 390.667 105.667 372 43 c 128 - 353.333 -19.667 336.333 -66.667 321 -98 c 128 - 305.667 -129.333 289 -156 271 -178 c 1 - 255 -199.333 234 -213.666 208 -221 c 1 - 189 -223 l 1 - 167.667 -223 151.667 -214.333 141 -197 c 0 - 137 -191.667 134 -186.667 132 -182 c 128 - 130 -177.334 128 -171.667 126 -165 c 128 - 124 -158.334 123 -148.667 123 -136 c 0 - 123 -117.333 127 -103.333 135 -94 c 128 - 143 -84.667 153.667 -76.333 167 -69 c 1 - 172.333 -69 177 -70 181 -72 c 128 - 185 -74 189.333 -78 194 -84 c 0 - 201.333 -93.333 205 -104.667 205 -118 c 0 - 205 -132.667 194.333 -154.333 173 -183 c 1 - 173 -187.667 176 -190 182 -190 c 0 - 216 -190 243.333 -143.667 264 -51 c 1 - 271 -22 l 1 - 284 38 l 1 - 306 140 l 1 - 323 220 l 1 - 162 220 l 1 - 154 166.667 139.667 106.667 119 40 c 0 - 107 0.666992 98.333 -26 93 -40 c 0 - 85 -61.333 76.667 -80.667 68 -98 c 1 - 35.333 -170 -1.33301 -211 -42 -221 c 1 - -60 -223 l 1 - -81.3311 -223 -97.6641 -214.333 -109 -197 c 1 - -114.333 -191 -119.333 -181.667 -124 -169 c 1 - -124.667 -163.667 -125.333 -158.667 -126 -154 c 128 - -126.667 -149.333 -127.333 -143.333 -128 -136 c 1 - -126.667 -124.667 -125.333 -115.667 -124 -109 c 128 - -122.667 -102.333 -119.667 -96 -115 -90 c 0 - -108.333 -81.333 -97.333 -74.333 -82 -69 c 1 - -71.3379 -69 -62.6719 -74 -56 -84 c 128 - -49.3428 -94 -45.6758 -105.333 -45 -118 c 0 - -45 -125.333 -45.667 -130.667 -47 -134 c 128 - -48.333 -137.332 -49.333 -139.666 -50 -141 c 2 - -64 -164 l 1 - -79 -183 l 1 - -79 -187.667 -75.667 -190 -69 -190 c 0 - -57.667 -190 -47.333 -185 -38 -175 c 0 - -34.667 -171.667 -31 -167 -27 -161 c 128 - -23 -155 -19 -148 -15 -140 c 1 - -1 -104 l 1 - 14 -51 l 1 - 33 35 l 1 - 55 140 l 1 - 72 220 l 1 - 15 220 l 1 - 15 258 l 1 - 85 258 l 1 - 94.333 289.334 107 318.667 123 346 c 128 - 139 373.333 160.667 397 188 417 c 1 - 212.667 433.667 240.333 442 271 442 c 0 - 286.333 442 298.333 435.667 307 423 c 128 - 315.667 410.333 320 394.666 320 376 c 128 - 320 357.333 315.667 340.666 307 326 c 128 - 298.334 311.332 285.667 302.665 269 300 c 1 - 252.333 300 243 310.667 241 332 c 1 - 241 343.335 244.333 355.668 251 369 c 1 - 257.667 380.335 266.667 388.668 278 394 c 1 - 281.333 396.667 283 398.667 283 400 c 1 - 279.667 404.667 277.333 407.667 276 409 c 0 - 271.333 412.333 265.333 414 258 414 c 0 - 236 414 218 398.333 204 367 c 128 - 190 335.667 179 300 171 260 c 1 - 335 260 l 1 - 348.333 309.333 371.667 352 405 388 c 128 - 438.333 424 477 442 521 442 c 0 - 529 442 536 440.667 542 438 c 128 - 548 435.333 553 430 557 422 c 1 - 559.667 418.667 562.333 413 565 405 c 128 - 567.667 397 569.333 387.333 570 376 c 1 - 570 357.333 565.667 341 557 327 c 128 - 548.333 313 536 304 520 300 c 1 - 502 300 492 310.667 490 332 c 0 - 490 338 491 344 493 350 c 128 - 495 356 497.667 362 501 368 c 128 - 504.333 374 508 379 512 383 c 128 - 516 387 521 390.667 527 394 c 1 - 530.333 396.667 532 398.667 532 400 c 1 - 526 409 l 1 - 521.333 412.333 515.667 414 509 414 c 0 - 471.667 414 442.333 362 421 258 c 1 - 496 258 l 1 - 496 220 l 1 +481 220 m 1 + 398 220 l 1 + 389.333 164.667 375.667 105.667 357 43 c 128 + 338.333 -19.667 321.333 -66.667 306 -98 c 128 + 290.667 -129.333 274 -156 256 -178 c 1 + 240 -199.333 219 -213.666 193 -221 c 1 + 174 -223 l 1 + 152.667 -223 136.667 -214.333 126 -197 c 0 + 122 -191.667 119 -186.667 117 -182 c 128 + 115 -177.334 113 -171.667 111 -165 c 128 + 109 -158.334 108 -148.667 108 -136 c 0 + 108 -117.333 112 -103.333 120 -94 c 128 + 128 -84.667 138.667 -76.333 152 -69 c 1 + 157.333 -69 162 -70 166 -72 c 128 + 170 -74 174.333 -78 179 -84 c 0 + 186.333 -93.333 190 -104.667 190 -118 c 0 + 190 -132.667 179.333 -154.333 158 -183 c 1 + 158 -187.667 161 -190 167 -190 c 0 + 201 -190 228.333 -143.667 249 -51 c 1 + 256 -22 l 1 + 269 38 l 1 + 291 140 l 1 + 308 220 l 1 + 147 220 l 1 + 139 166.667 124.667 106.667 104 40 c 0 + 92 0.666992 83.333 -26 78 -40 c 0 + 70 -61.333 61.667 -80.667 53 -98 c 1 + 20.333 -170 -16.333 -211 -57 -221 c 1 + -75 -223 l 1 + -96.3311 -223 -112.664 -214.333 -124 -197 c 1 + -129.333 -191 -134.333 -181.667 -139 -169 c 1 + -139.667 -163.667 -140.333 -158.667 -141 -154 c 128 + -141.667 -149.333 -142.333 -143.333 -143 -136 c 1 + -141.667 -124.667 -140.333 -115.667 -139 -109 c 128 + -137.667 -102.333 -134.667 -96 -130 -90 c 0 + -123.333 -81.333 -112.333 -74.333 -97 -69 c 1 + -86.3379 -69 -77.6719 -74 -71 -84 c 128 + -64.3428 -94 -60.6758 -105.333 -60 -118 c 0 + -60 -125.333 -60.667 -130.667 -62 -134 c 128 + -63.333 -137.332 -64.333 -139.666 -65 -141 c 2 + -79 -164 l 1 + -94 -183 l 1 + -94 -187.667 -90.667 -190 -84 -190 c 0 + -72.667 -190 -62.333 -185 -53 -175 c 0 + -49.667 -171.667 -46 -167 -42 -161 c 128 + -38 -155 -34 -148 -30 -140 c 1 + -16 -104 l 1 + -1 -51 l 1 + 18 35 l 1 + 40 140 l 1 + 57 220 l 1 + 0 220 l 1 + 0 258 l 1 + 70 258 l 1 + 79.333 289.334 92 318.667 108 346 c 128 + 124 373.333 145.667 397 173 417 c 1 + 197.667 433.667 225.333 442 256 442 c 0 + 271.333 442 283.333 435.667 292 423 c 128 + 300.667 410.333 305 394.666 305 376 c 128 + 305 357.333 300.667 340.666 292 326 c 128 + 283.334 311.332 270.667 302.665 254 300 c 1 + 237.333 300 228 310.667 226 332 c 1 + 226 343.335 229.333 355.668 236 369 c 1 + 242.667 380.335 251.667 388.668 263 394 c 1 + 266.333 396.667 268 398.667 268 400 c 1 + 264.667 404.667 262.333 407.667 261 409 c 0 + 256.333 412.333 250.333 414 243 414 c 0 + 221 414 203 398.333 189 367 c 128 + 175 335.667 164 300 156 260 c 1 + 320 260 l 1 + 333.333 309.333 356.667 352 390 388 c 128 + 423.333 424 462 442 506 442 c 0 + 514 442 521 440.667 527 438 c 128 + 533 435.333 538 430 542 422 c 1 + 544.667 418.667 547.333 413 550 405 c 128 + 552.667 397 554.333 387.333 555 376 c 1 + 555 357.333 550.667 341 542 327 c 128 + 533.333 313 521 304 505 300 c 1 + 487 300 477 310.667 475 332 c 0 + 475 338 476 344 478 350 c 128 + 480 356 482.667 362 486 368 c 128 + 489.333 374 493 379 497 383 c 128 + 501 387 506 390.667 512 394 c 1 + 515.333 396.667 517 398.667 517 400 c 1 + 511 409 l 1 + 506.333 412.333 500.667 414 494 414 c 0 + 456.667 414 427.333 362 406 258 c 1 + 481 258 l 1 + 481 220 l 1 EndSplineSet EndChar StartChar: uniE531 Encoding: 58673 58673 87 -Width: 1013 +Width: 925 VWidth: 2048 Flags: HW LayerCount: 2 Fore SplineSet -612 -69 m 4 - 633.386 -69 647 -99.9216 647 -120 c 4 - 647 -140.113 634.398 -151.813 626 -165 c 132 - 621.336 -172.333 617.67 -177 615 -179 c 4 - 609.479 -186.362 613.662 -188.966 624 -190 c 5 - 659.075 -190 678.221 -135.5 691 -101 c 132 - 697.667 -83 702.667 -65.667 706 -49 c 4 - 726.706 39.2938 744.664 130.336 764 220 c 5 - 621 220 l 5 - 614 176 606 136 595 99 c 5 - 577 24 556 -42 529 -98 c 5 - 514 -126 498 -153 479 -177 c 4 - 463 -198 443 -213 418 -221 c 5 - 400 -223 l 5 - 365 -223 347 -200 338 -169 c 5 - 334 -159 332 -148 332 -136 c 5 - 336 -99 347 -79 378 -69 c 5 - 401 -69 413 -92 414 -116 c 4 - 414 -124 410 -139 405 -147 c 6 - 395 -162 l 6 - 388 -172 387 -174 382 -183 c 5 - 382 -188 385 -190 392 -190 c 4 - 411 -190 427 -176 440 -148 c 5 - 453 -116 463 -88 473 -51 c 5 - 487 11 500 72 514 134 c 5 - 532 220 l 5 - 392 220 l 5 - 378 131 332 -36 299 -98 c 5 - 284 -129 269 -155 252 -177 c 132 - 235 -199 214 -214 187 -221 c 5 - 169 -223 l 5 - 125 -223 102 -183 102 -136 c 4 - 102 -97 120 -83 147 -69 c 5 - 153 -69 158 -70 161 -73 c 5 - 175.846 -78.9384 184 -98.0512 184 -118 c 4 - 184 -133 173 -154 152 -183 c 5 - 152 -188 155 -190 161 -190 c 4 - 195 -190 222 -144 243 -51 c 5 - 264.424 37.7557 282.772 129.774 302 220 c 5 - 161 220 l 5 - 148 135 99 -35 68 -98 c 5 - 35 -170 -2 -211 -42 -221 c 5 - -61 -223 l 5 - -96 -223 -112 -199 -124 -169 c 5 - -129 -136 l 5 - -124 -97 -116 -81 -83 -69 c 5 - -60 -69 -45 -95 -45 -118 c 4 - -45 -126 -47 -134 -51 -141 c 6 - -65 -164 l 5 - -79 -183 l 5 - -79 -188 -76 -190 -69 -190 c 4 - -58 -190 -48 -185 -39 -175 c 5 - -21 -160 -13 -129 -2 -104 c 5 - 13 -51 l 5 - 30 26 47 104 63 182 c 132 - 66 195 69 208 72 220 c 5 - 15 220 l 5 - 15 258 l 5 - 84 258 l 5 - 93 291 107 320 124 347 c 4 - 141 375 162 398 187 417 c 5 - 212 434 240 442 270 442 c 4 - 303 442 319 412 319 376 c 132 - 319 338 300 306 269 300 c 5 - 252 300 242 311 240 332 c 5 - 240 359 257 385 277 394 c 5 - 280 394 282 396 282 400 c 5 - 276 409 l 5 - 271 412 265 414 258 414 c 4 - 235 414 217 398 203 366 c 132 - 189 334 178 299 171 260 c 5 - 315 260 l 5 - 338 344 400 442 500 442 c 4 - 536 442 547 411 549 376 c 5 - 549 358 545 341 536 325 c 5 - 528 313 516 305 499 300 c 5 - 481 300 471 311 469 332 c 5 - 469 361 487 383 506 394 c 5 - 509 394 511 396 511 400 c 5 - 507 410 500 414 488 414 c 4 - 451 414 421 362 400 258 c 5 - 544 258 l 5 - 559 307 583 351 616 390 c 4 - 647 426 685 444 730 444 c 4 - 764 444 779 408 779 374 c 4 - 779 337 760 306 728 300 c 5 - 712 300 703 311 701 332 c 5 - 701 358 719 384 736 394 c 5 - 740 394 742 396 742 400 c 5 - 737 409 731 414 718 414 c 4 - 681 414 651 362 630 258 c 5 - 776 258 l 5 - 789.429 295.847 798.957 322.661 816 349 c 4 - 836.666 379 858.333 402 881 418 c 132 - 903.667 434 928.667 442 956 442 c 4 - 984.318 442 1001.6 428.326 1007 404 c 6 - 1011 388 l 5 - 1011 354.861 1010 351.993 998 328 c 4 - 994.862 320.94 980.617 302.946 967 301 c 132 - 962.333 300.333 956.667 300.333 950 301 c 4 - 937.394 303.801 933.434 318.612 931 332 c 5 - 931 359.28 942.325 376.216 960 388 c 6 - 974 398 l 5 - 974 406.667 968 412 956 414 c 4 - 942.667 415.33 931.333 412.663 922 406 c 132 - 912.667 399.333 903 385 893 363 c 5 - 886.086 345.222 867.1 279.121 862 260 c 5 - 939 260 l 5 - 939 220 l 5 - 854 220 l 5 - 834.986 111.195 793.939 -34.5584 751 -117 c 4 - 727.343 -163.132 686.698 -223 634 -223 c 4 - 589.383 -223 563 -186.317 563 -140 c 4 - 563 -108.178 578.31 -69 612 -69 c 4 +597 -69 m 0 + 618.386 -69 632 -99.9219 632 -120 c 0 + 632 -140.113 619.398 -151.813 611 -165 c 128 + 606.336 -172.333 602.67 -177 600 -179 c 0 + 594.479 -186.362 598.662 -188.966 609 -190 c 1 + 644.075 -190 663.221 -135.5 676 -101 c 128 + 682.667 -83 687.667 -65.667 691 -49 c 0 + 711.706 39.2939 729.664 130.336 749 220 c 1 + 606 220 l 1 + 599 176 591 136 580 99 c 1 + 562 24 541 -42 514 -98 c 1 + 499 -126 483 -153 464 -177 c 0 + 448 -198 428 -213 403 -221 c 1 + 385 -223 l 1 + 350 -223 332 -200 323 -169 c 1 + 319 -159 317 -148 317 -136 c 1 + 321 -99 332 -79 363 -69 c 1 + 386 -69 398 -92 399 -116 c 0 + 399 -124 395 -139 390 -147 c 2 + 380 -162 l 2 + 373 -172 372 -174 367 -183 c 1 + 367 -188 370 -190 377 -190 c 0 + 396 -190 412 -176 425 -148 c 1 + 438 -116 448 -88 458 -51 c 1 + 472 11 485 72 499 134 c 1 + 517 220 l 1 + 377 220 l 1 + 363 131 317 -36 284 -98 c 1 + 269 -129 254 -155 237 -177 c 128 + 220 -199 199 -214 172 -221 c 1 + 154 -223 l 1 + 110 -223 87 -183 87 -136 c 0 + 87 -97 105 -83 132 -69 c 1 + 138 -69 143 -70 146 -73 c 1 + 160.846 -78.9385 169 -98.0508 169 -118 c 0 + 169 -133 158 -154 137 -183 c 1 + 137 -188 140 -190 146 -190 c 0 + 180 -190 207 -144 228 -51 c 1 + 249.424 37.7559 267.772 129.774 287 220 c 1 + 146 220 l 1 + 133 135 84 -35 53 -98 c 1 + 20 -170 -17 -211 -57 -221 c 1 + -76 -223 l 1 + -111 -223 -127 -199 -139 -169 c 1 + -144 -136 l 1 + -139 -97 -131 -81 -98 -69 c 1 + -75 -69 -60 -95 -60 -118 c 0 + -60 -126 -62 -134 -66 -141 c 2 + -80 -164 l 1 + -94 -183 l 1 + -94 -188 -91 -190 -84 -190 c 0 + -73 -190 -63 -185 -54 -175 c 1 + -36 -160 -28 -129 -17 -104 c 1 + -2 -51 l 1 + 15 26 32 104 48 182 c 128 + 51 195 54 208 57 220 c 1 + 0 220 l 1 + 0 258 l 1 + 69 258 l 1 + 78 291 92 320 109 347 c 0 + 126 375 147 398 172 417 c 1 + 197 434 225 442 255 442 c 0 + 288 442 304 412 304 376 c 128 + 304 338 285 306 254 300 c 1 + 237 300 227 311 225 332 c 1 + 225 359 242 385 262 394 c 1 + 265 394 267 396 267 400 c 1 + 261 409 l 1 + 256 412 250 414 243 414 c 0 + 220 414 202 398 188 366 c 128 + 174 334 163 299 156 260 c 1 + 300 260 l 1 + 323 344 385 442 485 442 c 0 + 521 442 532 411 534 376 c 1 + 534 358 530 341 521 325 c 1 + 513 313 501 305 484 300 c 1 + 466 300 456 311 454 332 c 1 + 454 361 472 383 491 394 c 1 + 494 394 496 396 496 400 c 1 + 492 410 485 414 473 414 c 0 + 436 414 406 362 385 258 c 1 + 529 258 l 1 + 544 307 568 351 601 390 c 0 + 632 426 670 444 715 444 c 0 + 749 444 764 408 764 374 c 0 + 764 337 745 306 713 300 c 1 + 697 300 688 311 686 332 c 1 + 686 358 704 384 721 394 c 1 + 725 394 727 396 727 400 c 1 + 722 409 716 414 703 414 c 0 + 666 414 636 362 615 258 c 1 + 761 258 l 1 + 774.429 295.847 783.957 322.661 801 349 c 0 + 821.666 379 843.333 402 866 418 c 128 + 888.667 434 913.667 442 941 442 c 0 + 969.318 442 986.6 428.326 992 404 c 2 + 996 388 l 1 + 996 354.861 995 351.993 983 328 c 0 + 979.862 320.94 965.617 302.946 952 301 c 128 + 947.333 300.333 941.667 300.333 935 301 c 0 + 922.394 303.801 918.434 318.612 916 332 c 1 + 916 359.28 927.325 376.216 945 388 c 2 + 959 398 l 1 + 959 406.667 953 412 941 414 c 0 + 927.667 415.33 916.333 412.663 907 406 c 128 + 897.667 399.333 888 385 878 363 c 1 + 871.086 345.222 852.1 279.121 847 260 c 1 + 924 260 l 1 + 924 220 l 1 + 839 220 l 1 + 819.986 111.195 778.939 -34.5586 736 -117 c 0 + 712.343 -163.132 671.698 -223 619 -223 c 0 + 574.383 -223 548 -186.317 548 -140 c 0 + 548 -108.178 563.31 -69 597 -69 c 0 EndSplineSet EndChar StartChar: uniE532 Encoding: 58674 58674 88 -Width: 1245 +Width: 1158 VWidth: 2048 Flags: HW LayerCount: 2 Fore SplineSet -998 220 m 1 - 954 12 l 1 - 940 -49 l 2 - 936.667 -65.667 931.667 -83 925 -101 c 128 - 918.333 -119 911.667 -135 905 -149 c 0 - 892.333 -176.333 876.667 -190 858 -190 c 1 - 851.333 -189.333 847.667 -188 847 -186 c 128 - 846.333 -184 847 -181.667 849 -179 c 1 - 851.67 -177 855.336 -172.333 860 -165 c 128 - 864.67 -157.667 869.336 -150.667 874 -144 c 128 - 878.667 -137.333 881 -129.333 881 -120 c 0 - 881 -115.333 880 -109.667 878 -103 c 128 - 876 -96.333 872.333 -89 867 -81 c 128 - 861.667 -73 854.667 -69 846 -69 c 0 - 839.333 -69 832.667 -71 826 -75 c 128 - 819.333 -79 813.667 -84.667 809 -92 c 1 - 801 -107.333 797 -123.333 797 -140 c 0 - 797 -160.667 802 -178.667 812 -194 c 0 - 824.667 -213.333 843.334 -223 868 -223 c 0 - 894 -223 919.333 -208.667 944 -180 c 0 - 958 -164 971.667 -143 985 -117 c 0 - 1001.67 -85 1019 -41.333 1037 14 c 0 - 1059 82.667 1076 151.333 1088 220 c 1 - 1173 220 l 1 - 1173 260 l 1 - 1096 260 l 1 - 1098.67 270 1103.33 286.667 1110 310 c 128 - 1116.67 333.333 1122.33 351 1127 363 c 1 - 1137 385 1146.67 399.333 1156 406 c 128 - 1165.33 412.663 1176.67 415.33 1190 414 c 1 - 1202 412 1208 406.667 1208 398 c 1 - 1201 393 1201 393 1194 388 c 0 - 1184 381.333 1176.67 373.333 1172 364 c 128 - 1167.33 354.667 1165 344 1165 332 c 1 - 1166.33 324.667 1168.33 318 1171 312 c 128 - 1173.67 306 1178 302.333 1184 301 c 1 - 1190.67 300.333 1196.33 300.333 1201 301 c 128 - 1205.67 301.667 1210 303.667 1214 307 c 0 - 1223.33 315 1229.33 322 1232 328 c 0 - 1238 340 1241.67 349.333 1243 356 c 128 - 1244.33 362.666 1245 373.333 1245 388 c 1 - 1241 404 l 2 - 1239.67 410 1236.67 416.333 1232 423 c 0 - 1225.33 431.667 1219 437 1213 439 c 128 - 1207 441 1199.33 442 1190 442 c 0 - 1162.67 442 1137.67 434 1115 418 c 128 - 1092.33 402 1070.67 379 1050 349 c 0 - 1042.67 337.667 1035.33 323 1028 305 c 0 - 1023.33 294.333 1017.33 278.667 1010 258 c 1 - 862 258 l 1 - 867.1 277.121 886.086 345.222 893 363 c 1 - 903 385 912.667 399.333 922 406 c 128 - 931.333 412.663 942.667 415.33 956 414 c 0 - 968 412 974 406.667 974 398 c 1 - 960 388 l 2 - 942.325 376.216 931 359.28 931 332 c 1 - 933.434 318.612 937.394 303.801 950 301 c 0 - 956.667 300.333 962.333 300.333 967 301 c 128 - 980.617 302.946 994.862 320.94 998 328 c 0 - 1010 351.993 1011 354.861 1011 388 c 1 - 1007 404 l 2 - 1001.6 428.326 984.318 442 956 442 c 0 - 928.667 442 903.667 434 881 418 c 128 - 858.333 402 836.666 379 816 349 c 0 - 798.957 322.661 789.429 295.847 776 258 c 1 - 630 258 l 1 - 651 362 681 414 718 414 c 0 - 731 414 737 409 742 400 c 1 - 742 396 740 394 736 394 c 1 - 719 384 701 358 701 332 c 1 - 703 311 712 300 728 300 c 1 - 760 306 779 337 779 374 c 0 - 779 408 764 444 730 444 c 0 - 685 444 647 426 616 390 c 0 - 583 351 559 307 544 258 c 1 - 400 258 l 1 - 421 362 451 414 488 414 c 0 - 500 414 507 410 511 400 c 1 - 511 396 509 394 506 394 c 1 - 487 383 469 361 469 332 c 1 - 471 311 481 300 499 300 c 1 - 516 305 528 313 536 325 c 1 - 545 341 549 358 549 376 c 1 - 547 411 536 442 500 442 c 0 - 400 442 338 344 315 260 c 1 - 171 260 l 1 - 178 299 189 334 203 366 c 128 - 217 398 235 414 258 414 c 0 - 265 414 271 412 276 409 c 1 - 282 400 l 1 - 282 396 280 394 277 394 c 1 - 257 385 240 359 240 332 c 1 - 242 311 252 300 269 300 c 1 - 300 306 319 338 319 376 c 128 - 319 412 303 442 270 442 c 0 - 240 442 212 434 187 417 c 1 - 162 398 141 375 124 347 c 0 - 107 320 93 291 84 258 c 1 - 15 258 l 1 - 15 220 l 1 - 72 220 l 1 - 69 208 66 195 63 182 c 128 - 47 104 30 26 13 -51 c 1 - -2 -104 l 1 - -13 -129 -21 -160 -39 -175 c 1 - -48 -185 -58 -190 -69 -190 c 0 - -76 -190 -79 -188 -79 -183 c 1 - -65 -164 l 1 - -51 -141 l 2 - -47 -134 -45 -126 -45 -118 c 0 - -45 -95 -60 -69 -83 -69 c 1 - -116 -81 -124 -97 -129 -136 c 1 - -124 -169 l 1 - -112 -199 -96 -223 -61 -223 c 1 - -42 -221 l 1 - -2 -211 35 -170 68 -98 c 1 - 99 -35 148 135 161 220 c 1 - 302 220 l 1 - 282.772 129.774 264.424 37.7557 243 -51 c 1 - 222 -144 195 -190 161 -190 c 0 - 155 -190 152 -188 152 -183 c 1 - 173 -154 184 -133 184 -118 c 0 - 184 -98.0512 175.846 -78.9384 161 -73 c 1 - 158 -70 153 -69 147 -69 c 1 - 120 -83 102 -97 102 -136 c 0 - 102 -183 125 -223 169 -223 c 1 - 187 -221 l 1 - 214 -214 235 -199 252 -177 c 128 - 269 -155 284 -129 299 -98 c 1 - 332 -36 378 131 392 220 c 1 - 532 220 l 1 - 514 134 l 1 - 500 72 487 11 473 -51 c 1 - 463 -88 453 -116 440 -148 c 1 - 427 -176 411 -190 392 -190 c 0 - 385 -190 382 -188 382 -183 c 1 - 387 -174 388 -172 395 -162 c 2 - 405 -147 l 2 - 410 -139 414 -124 414 -116 c 0 - 413 -92 401 -69 378 -69 c 1 - 347 -79 336 -99 332 -136 c 1 - 332 -148 334 -159 338 -169 c 1 - 347 -200 365 -223 400 -223 c 1 - 418 -221 l 1 - 443 -213 463 -198 479 -177 c 0 - 498 -153 514 -126 529 -98 c 1 - 556 -42 577 24 595 99 c 1 - 606 136 614 176 621 220 c 1 - 764 220 l 1 - 744.664 130.336 726.706 39.2938 706 -49 c 0 - 702.667 -65.667 697.667 -83 691 -101 c 128 - 678.221 -135.5 659.075 -190 624 -190 c 1 - 613.662 -188.966 609.479 -186.362 615 -179 c 0 - 617.67 -177 621.336 -172.333 626 -165 c 128 - 634.398 -151.813 647 -140.113 647 -120 c 0 - 647 -99.9216 633.386 -69 612 -69 c 0 - 578.31 -69 563 -108.178 563 -140 c 0 - 563 -186.317 589.383 -223 634 -223 c 0 - 686.698 -223 727.343 -163.132 751 -117 c 0 - 793.939 -34.5584 834.986 111.195 854 220 c 1 - 998 220 l 1 +983 220 m 1 + 939 12 l 1 + 925 -49 l 2 + 921.667 -65.667 916.667 -83 910 -101 c 128 + 903.333 -119 896.667 -135 890 -149 c 0 + 877.333 -176.333 861.667 -190 843 -190 c 1 + 836.333 -189.333 832.667 -188 832 -186 c 128 + 831.333 -184 832 -181.667 834 -179 c 1 + 836.67 -177 840.336 -172.333 845 -165 c 128 + 849.67 -157.667 854.336 -150.667 859 -144 c 128 + 863.667 -137.333 866 -129.333 866 -120 c 0 + 866 -115.333 865 -109.667 863 -103 c 128 + 861 -96.333 857.333 -89 852 -81 c 128 + 846.667 -73 839.667 -69 831 -69 c 0 + 824.333 -69 817.667 -71 811 -75 c 128 + 804.333 -79 798.667 -84.667 794 -92 c 1 + 786 -107.333 782 -123.333 782 -140 c 0 + 782 -160.667 787 -178.667 797 -194 c 0 + 809.667 -213.333 828.334 -223 853 -223 c 0 + 879 -223 904.333 -208.667 929 -180 c 0 + 943 -164 956.667 -143 970 -117 c 0 + 986.67 -85 1004 -41.333 1022 14 c 0 + 1044 82.667 1061 151.333 1073 220 c 1 + 1158 220 l 1 + 1158 260 l 1 + 1081 260 l 1 + 1083.67 270 1088.33 286.667 1095 310 c 128 + 1101.67 333.333 1107.33 351 1112 363 c 1 + 1122 385 1131.67 399.333 1141 406 c 128 + 1150.33 412.663 1161.67 415.33 1175 414 c 1 + 1187 412 1193 406.667 1193 398 c 1 + 1186 393 1186 393 1179 388 c 0 + 1169 381.333 1161.67 373.333 1157 364 c 128 + 1152.33 354.667 1150 344 1150 332 c 1 + 1151.33 324.667 1153.33 318 1156 312 c 128 + 1158.67 306 1163 302.333 1169 301 c 1 + 1175.67 300.333 1181.33 300.333 1186 301 c 128 + 1190.67 301.667 1195 303.667 1199 307 c 0 + 1208.33 315 1214.33 322 1217 328 c 0 + 1223 340 1226.67 349.333 1228 356 c 128 + 1229.33 362.666 1230 373.333 1230 388 c 1 + 1226 404 l 2 + 1224.67 410 1221.67 416.333 1217 423 c 0 + 1210.33 431.667 1204 437 1198 439 c 128 + 1192 441 1184.33 442 1175 442 c 0 + 1147.67 442 1122.67 434 1100 418 c 128 + 1077.33 402 1055.67 379 1035 349 c 0 + 1027.67 337.667 1020.33 323 1013 305 c 0 + 1008.33 294.333 1002.33 278.667 995 258 c 1 + 847 258 l 1 + 852.1 277.121 871.086 345.222 878 363 c 1 + 888 385 897.667 399.333 907 406 c 128 + 916.333 412.663 927.667 415.33 941 414 c 0 + 953 412 959 406.667 959 398 c 1 + 945 388 l 2 + 927.325 376.216 916 359.28 916 332 c 1 + 918.434 318.612 922.394 303.801 935 301 c 0 + 941.667 300.333 947.333 300.333 952 301 c 128 + 965.617 302.946 979.862 320.94 983 328 c 0 + 995 351.993 996 354.861 996 388 c 1 + 992 404 l 2 + 986.6 428.326 969.318 442 941 442 c 0 + 913.667 442 888.667 434 866 418 c 128 + 843.333 402 821.666 379 801 349 c 0 + 783.957 322.661 774.429 295.847 761 258 c 1 + 615 258 l 1 + 636 362 666 414 703 414 c 0 + 716 414 722 409 727 400 c 1 + 727 396 725 394 721 394 c 1 + 704 384 686 358 686 332 c 1 + 688 311 697 300 713 300 c 1 + 745 306 764 337 764 374 c 0 + 764 408 749 444 715 444 c 0 + 670 444 632 426 601 390 c 0 + 568 351 544 307 529 258 c 1 + 385 258 l 1 + 406 362 436 414 473 414 c 0 + 485 414 492 410 496 400 c 1 + 496 396 494 394 491 394 c 1 + 472 383 454 361 454 332 c 1 + 456 311 466 300 484 300 c 1 + 501 305 513 313 521 325 c 1 + 530 341 534 358 534 376 c 1 + 532 411 521 442 485 442 c 0 + 385 442 323 344 300 260 c 1 + 156 260 l 1 + 163 299 174 334 188 366 c 128 + 202 398 220 414 243 414 c 0 + 250 414 256 412 261 409 c 1 + 267 400 l 1 + 267 396 265 394 262 394 c 1 + 242 385 225 359 225 332 c 1 + 227 311 237 300 254 300 c 1 + 285 306 304 338 304 376 c 128 + 304 412 288 442 255 442 c 0 + 225 442 197 434 172 417 c 1 + 147 398 126 375 109 347 c 0 + 92 320 78 291 69 258 c 1 + 0 258 l 1 + 0 220 l 1 + 57 220 l 1 + 54 208 51 195 48 182 c 128 + 32 104 15 26 -2 -51 c 1 + -17 -104 l 1 + -28 -129 -36 -160 -54 -175 c 1 + -63 -185 -73 -190 -84 -190 c 0 + -91 -190 -94 -188 -94 -183 c 1 + -80 -164 l 1 + -66 -141 l 2 + -62 -134 -60 -126 -60 -118 c 0 + -60 -95 -75 -69 -98 -69 c 1 + -131 -81 -139 -97 -144 -136 c 1 + -139 -169 l 1 + -127 -199 -111 -223 -76 -223 c 1 + -57 -221 l 1 + -17 -211 20 -170 53 -98 c 1 + 84 -35 133 135 146 220 c 1 + 287 220 l 1 + 267.772 129.774 249.424 37.7559 228 -51 c 1 + 207 -144 180 -190 146 -190 c 0 + 140 -190 137 -188 137 -183 c 1 + 158 -154 169 -133 169 -118 c 0 + 169 -98.0508 160.846 -78.9385 146 -73 c 1 + 143 -70 138 -69 132 -69 c 1 + 105 -83 87 -97 87 -136 c 0 + 87 -183 110 -223 154 -223 c 1 + 172 -221 l 1 + 199 -214 220 -199 237 -177 c 128 + 254 -155 269 -129 284 -98 c 1 + 317 -36 363 131 377 220 c 1 + 517 220 l 1 + 499 134 l 1 + 485 72 472 11 458 -51 c 1 + 448 -88 438 -116 425 -148 c 1 + 412 -176 396 -190 377 -190 c 0 + 370 -190 367 -188 367 -183 c 1 + 372 -174 373 -172 380 -162 c 2 + 390 -147 l 2 + 395 -139 399 -124 399 -116 c 0 + 398 -92 386 -69 363 -69 c 1 + 332 -79 321 -99 317 -136 c 1 + 317 -148 319 -159 323 -169 c 1 + 332 -200 350 -223 385 -223 c 1 + 403 -221 l 1 + 428 -213 448 -198 464 -177 c 0 + 483 -153 499 -126 514 -98 c 1 + 541 -42 562 24 580 99 c 1 + 591 136 599 176 606 220 c 1 + 749 220 l 1 + 729.664 130.336 711.706 39.2939 691 -49 c 0 + 687.667 -65.667 682.667 -83 676 -101 c 128 + 663.221 -135.5 644.075 -190 609 -190 c 1 + 598.662 -188.966 594.479 -186.362 600 -179 c 0 + 602.67 -177 606.336 -172.333 611 -165 c 128 + 619.398 -151.813 632 -140.113 632 -120 c 0 + 632 -99.9219 618.386 -69 597 -69 c 0 + 563.31 -69 548 -108.178 548 -140 c 0 + 548 -186.317 574.383 -223 619 -223 c 0 + 671.698 -223 712.343 -163.132 736 -117 c 0 + 778.939 -34.5586 819.986 111.195 839 220 c 1 + 983 220 l 1 EndSplineSet EndChar diff --git a/fonts/extract-glyphs.xsl b/fonts/extract-glyphs.xsl index eafb4903830..0b32514ffb8 100644 --- a/fonts/extract-glyphs.xsl +++ b/fonts/extract-glyphs.xsl @@ -30,10 +30,11 @@ + - + From 2729057b1bea60360aed2ce0a471b50c16cecf71 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Mon, 17 Aug 2015 16:35:28 +0200 Subject: [PATCH 068/114] Fixing toolkit output with -t mei --- include/vrv/toolkit.h | 9 ++++++++ src/toolkit.cpp | 2 ++ tools/main.cpp | 50 ++++++++++++++++++++++++++----------------- 3 files changed, 41 insertions(+), 20 deletions(-) diff --git a/include/vrv/toolkit.h b/include/vrv/toolkit.h index 278d9f27e5c..debac7e3094 100644 --- a/include/vrv/toolkit.h +++ b/include/vrv/toolkit.h @@ -247,6 +247,14 @@ class Toolkit void SetRdgXPathQuery( std::string const &rdgXPathQuery ) { m_rdgXPathQuery = rdgXPathQuery; }; std::string GetRdgXPathQuery() { return m_rdgXPathQuery; }; ///@} + + /** + * @name Set and get the xPath query for selecting (if any) + */ + ///@{ + void SetScoreBasedMei( bool scoreBasedMei ) { m_scoreBasedMei = scoreBasedMei; }; + bool GetScoreBasedMei() { return m_scoreBasedMei; }; + ///@} /** * @name Set a specific font @@ -309,6 +317,7 @@ class Toolkit bool m_ignoreLayout; bool m_adjustPageHeight; std::string m_rdgXPathQuery; + bool m_scoreBasedMei; // for debugging bool m_noJustification; bool m_showBoundingBoxes; diff --git a/src/toolkit.cpp b/src/toolkit.cpp index 50a398abec7..1933d539c1d 100644 --- a/src/toolkit.cpp +++ b/src/toolkit.cpp @@ -53,6 +53,7 @@ Toolkit::Toolkit( bool initFont ) m_adjustPageHeight = false; m_noJustification = false; m_showBoundingBoxes = false; + m_scoreBasedMei = false; m_cString = NULL; @@ -323,6 +324,7 @@ std::string Toolkit::GetMEI( int pageNo, bool scoreBased ) bool Toolkit::SaveFile( const std::string &filename ) { MeiOutput meioutput( &m_doc, filename.c_str()); + meioutput.SetScoreBasedMEI( m_scoreBasedMei ); if (!meioutput.ExportFile()) { LogError( "Unknown error" ); return false; diff --git a/tools/main.cpp b/tools/main.cpp index 536f549ac68..a1289c8499c 100644 --- a/tools/main.cpp +++ b/tools/main.cpp @@ -387,15 +387,14 @@ int main(int argc, char** argv) if (all_pages) { to = toolkit.GetPageCount() + 1; } - - int p; - for (p = from; p < to; p++) { - std::string cur_outfile = outfile; - if (all_pages) { - cur_outfile += StringFormat("_%03d", p); - } - // Create SVG or mei - if (outformat == "svg") { + + if (outformat == "svg") { + int p; + for (p = from; p < to; p++) { + std::string cur_outfile = outfile; + if (all_pages) { + cur_outfile += StringFormat("_%03d", p); + } cur_outfile += ".svg"; if (std_output) { cout << toolkit.RenderToSvg( p ); @@ -405,25 +404,36 @@ int main(int argc, char** argv) exit(1); } else { - cerr << "Output written to " << cur_outfile << endl; + cerr << "Output written to " << cur_outfile << "." << endl; } - // Write it to file - - } else { - // To be implemented in Toolkit - cur_outfile += ".mei"; + } + } + else { + if (all_pages) { + toolkit.SetScoreBasedMei( true ); + outfile += ".mei"; if (std_output) { - cout << toolkit.GetMEI( p ); + cerr << "MEI output of all pages to standard output is not possible." << endl; + exit(1); + } - else if ( !toolkit.SaveFile( cur_outfile ) ) { - cerr << "Unable to write MEI to " << cur_outfile << "." << endl; + else if ( !toolkit.SaveFile( outfile ) ) { + cerr << "Unable to write MEI to " << outfile << "." << endl; exit(1); } else { - cerr << "Output written to " << cur_outfile << endl; + cerr << "Output written to " << outfile << "." << endl; + } + } + else { + if (std_output) { + cout << toolkit.GetMEI( page ); + } + else { + cerr << "MEI output of one page is available only to standard output." << endl; + exit(1); } } - } return 0; From 901d22ef7d128fbd0b93d17764017718b5188f2a Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Tue, 18 Aug 2015 10:38:48 +0200 Subject: [PATCH 069/114] Removing fixed drawing Doc member variables (WIP) --- Verovio.xcodeproj/project.pbxproj | 4 + include/vrv/doc.h | 82 ++++++++------ src/aligner.cpp | 6 +- src/doc.cpp | 62 ++++------- src/page.cpp | 8 +- src/view_beam.cpp | 31 +++--- src/view_element.cpp | 177 +++++++++++++++--------------- src/view_floating.cpp | 32 +++--- src/view_graph.cpp | 12 +- src/view_mensural.cpp | 94 ++++++++-------- src/view_page.cpp | 28 ++--- 11 files changed, 266 insertions(+), 270 deletions(-) diff --git a/Verovio.xcodeproj/project.pbxproj b/Verovio.xcodeproj/project.pbxproj index ba539d5ffdb..5d4d7d2a503 100644 --- a/Verovio.xcodeproj/project.pbxproj +++ b/Verovio.xcodeproj/project.pbxproj @@ -969,6 +969,8 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; + CLANG_CXX_LIBRARY = "compiler-default"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; @@ -1010,6 +1012,8 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; + CLANG_CXX_LIBRARY = "compiler-default"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; diff --git a/include/vrv/doc.h b/include/vrv/doc.h index 53c5b674a07..b84b8f31bf5 100644 --- a/include/vrv/doc.h +++ b/include/vrv/doc.h @@ -69,13 +69,30 @@ class Doc: public Object */ int GetPageCount( ); - /* - * @name Get the height or width for a glyph taking into account the staff and grace sizes */ + /** + * @name Get the height or width for a glyph taking into account the staff and grace sizes + */ ///@{ int GetGlyphHeight( wchar_t smuflCode, int staffSize, bool graceSize ); int GetGlyphWidth( wchar_t smuflCode, int staffSize, bool graceSize ); + int GetDrawingUnit( int staffSize ); + int GetDrawingDoubleUnit( int staffSize ); + int GetDrawingStaffSize( int staffSize ); + int GetDrawingOctaveSize( int staffSize ); + int GetDrawingBrevisWidth( int staffSize ); + int GetDrawingBeamWidth( int staffSize, bool graceSize ); + int GetDrawingBeamWhiteWidth( int staffSize, bool graceSize ); + int GetDrawingLedgerLineLength( int staffSize, bool graceSize ); ///@} - + + /** + * @name Get the height or width for a glyph taking into account the staff and grace sizes + */ + ///@{ + FontInfo *GetDrawingSmuflFont( int staffSize, bool graceSize ); + FontInfo *GetDrawingLyricFont( int staffSize ); + ///@} + /** * @name Setters for the page dimensions and margins */ @@ -237,39 +254,36 @@ class Doc: public Object /** The page currently being drawn */ Page *m_drawingPage; - /** Half a the space between to staff lines for normal and small staff */ - int m_drawingUnit[2]; - /** Space between to staff lines for normal and small staff */ - int m_drawingDoubleUnit[2]; - /** Height of a five line staff for normal and small staff */ - int m_drawingStaffSize[2]; - /** Height of an octave for normal and small staff */ - int m_drawingOctaveSize[2]; - /** Font height (100 par defaut) */ - int m_drawingFontHeight; - /** Normal and small staff ration (4 / 5 by default) */ - int m_drawingSmallStaffRatio[2]; - /** Normal and grace size (3 / 4 by default) */ - int m_drawingGraceRatio[2]; - /** Height of a beam for normal and small staff (10 and 6 by default) */ - int m_drawingBeamWidth[2]; - /** Height of a beam spacing (white) for normal and small staff (10 and 6 by default) */ - int m_drawingBeamWhiteWidth[2]; - /** Note radius for normal and small staff and normal and grace size */ - int m_drawingNoteRadius[2][2]; - /** Ledger line length for normal and small staff and normal and grace size */ - int m_drawingLedgerLine[2][3]; - /** Brevis width for normal and small staff */ - int m_drawingBrevisWidth[2]; - /** Accident width/height for normal and small staff and normal and grace size */ + /** Half a the space between to staff lines */ + int m_drawingUnit; + /** Space between to staff lines */ + int m_drawingDoubleUnit; + /** Height of a five line staff */ + int m_drawingStaffSize; + /** Height of an octave */ + int m_drawingOctaveSize; + /** Height of a beam (10 and 6 by default) */ + int m_drawingBeamWidth; + /** Height of a beam spacing (white) (10 and 6 by default) */ + int m_drawingBeamWhiteWidth; + /** Ledger line length and normal and grace size */ + int m_drawingLedgerLine; + /** Brevis width */ + int m_drawingBrevisWidth; + + /** Smufl font size (100 par defaut) */ + int m_drawingSmuflFontSize; + /** Lyric font size */ + int m_drawingLyricFontSize; + /** Current music font */ + FontInfo m_drawingSmuflFont; + /** Current lyric font */ + FontInfo m_drawingLyricFont; + + /** Accident width/height and normal and grace size */ int m_drawingAccidWidth[2][2]; int m_drawingAccidHeight[2][2]; - /** Current music font for normal and small staff and normal and grace size */ - FontInfo m_drawingSmuflFonts[2][2]; - /** Current lyric font for normal and small staff and normal and grace size */ - FontInfo m_drawingLyricFonts[2]; - /** Lyric font by default */ - FontInfo m_drawingLyricFont; + /** The current page height */ int m_drawingPageHeight; /** The current page height */ diff --git a/src/aligner.cpp b/src/aligner.cpp index 77645806352..9f3afbe24f0 100644 --- a/src/aligner.cpp +++ b/src/aligner.cpp @@ -311,12 +311,12 @@ int StaffAlignment::SetAligmentYPos( ArrayPtrVoid *params ) // param 3: the functor to be redirected to SystemAligner (unused) int *previousStaffHeight = static_cast((*params)[0]); int *staffMargin = static_cast((*params)[1]); - int **interlineSizes = static_cast((*params)[2]); + int *interlineSize = static_cast((*params)[2]); // take into account the number of lyrics if (this->GetVerseCount() > 0) { // We need + 1 lyric line space - m_yShift -= (this->GetVerseCount() + 1) * TEMP_STYLE_LYIRC_LINE_SPACE * (*interlineSizes[0] / 2) / PARAM_DENOMINATOR; + m_yShift -= (this->GetVerseCount() + 1) * TEMP_STYLE_LYIRC_LINE_SPACE * (*interlineSize / 2) / PARAM_DENOMINATOR; } int min_shift = (*staffMargin) + (*previousStaffHeight); @@ -326,7 +326,7 @@ int StaffAlignment::SetAligmentYPos( ArrayPtrVoid *params ) } // for now always four interlines, eventually should be taken from the staffDef, so should the staff size - (*previousStaffHeight) = 4 * (*interlineSizes)[0]; + (*previousStaffHeight) = 4 * (*interlineSize); return FUNCTOR_CONTINUE; } diff --git a/src/doc.cpp b/src/doc.cpp index 5dc012e882d..e592e59ceeb 100644 --- a/src/doc.cpp +++ b/src/doc.cpp @@ -76,6 +76,8 @@ void Doc::Reset( DocType type ) m_scoreDef.Reset(); + m_drawingSmuflFontSize = 0; + m_drawingLyricFontSize = 0; m_drawingLyricFont.SetFaceName("Garamond"); } @@ -397,7 +399,7 @@ int Doc::GetGlyphHeight( wchar_t smuflCode, int staffSize, bool graceSize ) glyph = Resources::GetGlyph( smuflCode ); assert( glyph ); glyph->GetBoundingBox( &x, &y, &w, &h ); - h = h * m_drawingFontHeight / glyph->GetUnitsPerEm(); + h = h * m_drawingSmuflFontSize / glyph->GetUnitsPerEm(); if ( graceSize ) h = h * this->m_style->m_graceNum / this->m_style->m_graceDen; return h; } @@ -409,7 +411,7 @@ int Doc::GetGlyphWidth( wchar_t smuflCode, int staffSize, bool graceSize ) glyph = Resources::GetGlyph( smuflCode ); assert( glyph ); glyph->GetBoundingBox( &x, &y, &w, &h ); - w = w * m_drawingFontHeight / glyph->GetUnitsPerEm(); + w = w * m_drawingSmuflFontSize / glyph->GetUnitsPerEm(); if ( graceSize ) w = w * this->m_style->m_graceNum / this->m_style->m_graceDen; return w; } @@ -533,64 +535,45 @@ Page *Doc::SetDrawingPage( int pageIdx ) m_drawingBeamMaxSlope /= 100; m_drawingBeamMinSlope /= 100; + /* m_drawingSmallStaffRatio[0] = this->m_style->m_smallStaffNum; m_drawingSmallStaffRatio[1] = this->m_style->m_smallStaffDen; m_drawingGraceRatio[0] = this->m_style->m_graceNum; m_drawingGraceRatio[1] = this->m_style->m_graceDen; + */ // half of the space between two lines - m_drawingUnit[0] = m_style->m_unit; - // same for small staves - m_drawingUnit[1] = (m_drawingUnit[0] * m_drawingSmallStaffRatio[0]) / m_drawingSmallStaffRatio[1]; + m_drawingUnit = m_style->m_unit; // space between two lines - m_drawingDoubleUnit[0] = m_drawingUnit[0] * 2; - // same for small staves - m_drawingDoubleUnit[1] = m_drawingUnit[1] * 2; + m_drawingDoubleUnit = m_drawingUnit * 2; // staff (with five lines) - m_drawingStaffSize[0] = m_drawingDoubleUnit[0] * 4; - m_drawingStaffSize[1] = m_drawingDoubleUnit[1] * 4; + m_drawingStaffSize = m_drawingDoubleUnit * 4; // - m_drawingOctaveSize[0] = m_drawingUnit[0] * 7; - m_drawingOctaveSize[1] = m_drawingUnit[1] * 7; + m_drawingOctaveSize = m_drawingUnit * 7; // values for beams - m_drawingBeamWidth[0] = this->m_style->m_unit; - m_drawingBeamWhiteWidth[0] = this->m_style->m_unit / 2; - m_drawingBeamWidth[1] = (m_drawingBeamWidth[0] * m_drawingSmallStaffRatio[0]) / m_drawingSmallStaffRatio[1]; - m_drawingBeamWhiteWidth[1] = (m_drawingBeamWhiteWidth[0] * m_drawingSmallStaffRatio[0]) / m_drawingSmallStaffRatio[1]; - - m_drawingFontHeight = CalcMusicFontSize(); - - m_drawingSmuflFonts[0][0].SetPointSize( m_drawingFontHeight ); - m_drawingSmuflFonts[0][1].SetPointSize( (m_drawingFontHeight * m_drawingGraceRatio[0]) / m_drawingGraceRatio[1] ); - m_drawingSmuflFonts[1][0].SetPointSize( (m_drawingFontHeight * m_drawingSmallStaffRatio[0]) / m_drawingSmallStaffRatio[1] ); - m_drawingSmuflFonts[1][1].SetPointSize( ( (m_drawingFontHeight * m_drawingSmallStaffRatio[0]) / m_drawingSmallStaffRatio[1] * m_drawingGraceRatio[0]) / m_drawingGraceRatio[1] ); + m_drawingBeamWidth = this->m_style->m_unit; + m_drawingBeamWhiteWidth = this->m_style->m_unit / 2; + + m_drawingSmuflFontSize = CalcMusicFontSize(); + m_drawingLyricFontSize = m_drawingUnit * m_style->m_lyricSize / PARAM_DENOMINATOR; - m_drawingLyricFonts[0] = m_drawingLyricFont; - m_drawingLyricFonts[1] = m_drawingLyricFont; - m_drawingLyricFonts[0].SetPointSize( m_drawingUnit[0] * m_style->m_lyricSize / PARAM_DENOMINATOR ); - m_drawingLyricFonts[1].SetPointSize( m_drawingUnit[1] * m_style->m_lyricSize / PARAM_DENOMINATOR ); + //m_drawingSmuflFonts[0][0].SetPointSize( m_drawingFontHeight ); - m_drawingMinMeasureWidth = m_drawingUnit[0] * m_style->m_minMeasureWidth / PARAM_DENOMINATOR ; + m_drawingMinMeasureWidth = m_drawingUnit * m_style->m_minMeasureWidth / PARAM_DENOMINATOR ; - float glyph_size; + int glyph_size; Glyph *glyph; int x, y, w, h; glyph = Resources::GetGlyph(SMUFL_E0A3_noteheadHalf); assert( glyph ); glyph->GetBoundingBox( &x, &y, &w, &h ); - glyph_size = round((double)w * (double)m_drawingFontHeight / (double)glyph->GetUnitsPerEm()); - m_drawingNoteRadius[0][0] = ceil(glyph_size / 2); - m_drawingNoteRadius[0][1] = (m_drawingNoteRadius[0][0] * m_drawingGraceRatio[0])/m_drawingGraceRatio[1]; - m_drawingNoteRadius[1][0] = (m_drawingNoteRadius[0][0] * m_drawingSmallStaffRatio[0])/m_drawingSmallStaffRatio[1]; - m_drawingNoteRadius[1][1] = (m_drawingNoteRadius[1][0] * m_drawingGraceRatio[0])/m_drawingGraceRatio[1]; - - m_drawingLedgerLine[0][0] = (int)(glyph_size * .72); - m_drawingLedgerLine[0][1] = (m_drawingLedgerLine[0][0] * m_drawingGraceRatio[0])/m_drawingGraceRatio[1]; - m_drawingLedgerLine[1][0] = (m_drawingLedgerLine[0][0] * m_drawingSmallStaffRatio[0])/m_drawingSmallStaffRatio[1]; - m_drawingLedgerLine[1][1] = (m_drawingLedgerLine[1][0] * m_drawingGraceRatio[0])/m_drawingGraceRatio[1]; + glyph_size = w * m_drawingSmuflFontSize / glyph->GetUnitsPerEm(); + m_drawingLedgerLine = glyph_size * 100 / 72; + + /* glyph = Resources::GetGlyph(SMUFL_E0A2_noteheadWhole); assert( glyph ); glyph->GetBoundingBox( &x, &y, &w, &h ); @@ -614,6 +597,7 @@ Page *Doc::SetDrawingPage( int pageIdx ) m_drawingAccidHeight[0][1] = (m_drawingAccidHeight[0][0] * m_drawingGraceRatio[0])/m_drawingGraceRatio[1]; m_drawingAccidHeight[1][0] = (m_drawingAccidHeight[0][0] * m_drawingSmallStaffRatio[0]) /m_drawingSmallStaffRatio[1]; m_drawingAccidHeight[1][1] = (m_drawingAccidHeight[1][0] * m_drawingGraceRatio[0])/m_drawingGraceRatio[1]; + */ return m_drawingPage; } diff --git a/src/page.cpp b/src/page.cpp index 6ff4d6c8cce..52ba21cbd49 100644 --- a/src/page.cpp +++ b/src/page.cpp @@ -228,11 +228,11 @@ void Page::LayOutVertically( ) // Adjusts the Y shift for making sure there is a minimal space (staffMargin) between each staff params.clear(); int previousStaffHeight = 0; // 0 for the first staff, reset for each system (see System::SetAlignmentYPos) - int staffMargin = doc->GetSpacingStaff() * doc->m_drawingDoubleUnit[0]; // the minimal space we want to have between each staff - int* interlineSizes = doc->m_drawingDoubleUnit; // the interline sizes to be used for calculating the (previous) staff height + int staffMargin = doc->GetSpacingStaff() * doc->GetDrawingDoubleUnit( 100 ); // the minimal space we want to have between each staff + int interlineSize = doc->GetDrawingDoubleUnit( 100 ); // the interline sizes to be used for calculating the (previous) staff height params.push_back( &previousStaffHeight ); params.push_back( &staffMargin ); - params.push_back( &interlineSizes ); + params.push_back( &interlineSize ); Functor setAlignmentY( &Object::SetAligmentYPos ); // special case: because we redirect the functor, pass is a parameter to itself (!) params.push_back( &setAlignmentY ); @@ -251,7 +251,7 @@ void Page::LayOutVertically( ) // Adjust system Y position params.clear(); shift = doc->m_drawingPageHeight - doc->m_drawingPageTopMar; - int systemMargin = doc->GetSpacingSystem() * doc->m_drawingDoubleUnit[0]; + int systemMargin = doc->GetSpacingSystem() * doc->GetDrawingDoubleUnit( 100 ); params.push_back( &shift ); params.push_back( &systemMargin ); Functor alignSystems( &Object::AlignSystems ); diff --git a/src/view_beam.cpp b/src/view_beam.cpp index 1537fe184cb..ce963e2810c 100644 --- a/src/view_beam.cpp +++ b/src/view_beam.cpp @@ -23,6 +23,7 @@ #include "layer.h" #include "layerelement.h" #include "note.h" +#include "smufl.h" #include "staff.h" #include "style.h" #include "vrv.h" @@ -91,7 +92,7 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta lastDur = elementCount = 0; high = avgY = verticalBoost = 0.0; - verticalCenter = staff->GetDrawingY() - (m_doc->m_drawingDoubleUnit[staff->staffSize] * 2); //center point of the staff + verticalCenter = staff->GetDrawingY() - (m_doc->GetDrawingDoubleUnit(staff->staffSize) * 2); //center point of the staff yExtreme = verticalCenter; //value of farthest y point on the staff from verticalCenter minus verticalCenter; used if beamHasChord = ON ListOfObjects* beamChildren = beam->GetList(beam); @@ -111,8 +112,8 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta lastDur = dynamic_cast(current)->GetActualDur(); // x-offset values for stem bases, dx[y] where y = element->m_cueSize - dx[0] = m_doc->m_drawingNoteRadius[staff->staffSize][0] - (m_doc->m_style->m_stemWidth)/2; - dx[1] = m_doc->m_drawingNoteRadius[staff->staffSize][1] - (m_doc->m_style->m_stemWidth)/2; + dx[0] = m_doc->GetGlyphWidth(SMUFL_E0A3_noteheadHalf, staff->staffSize, false) - (m_doc->m_style->m_stemWidth)/2; + dx[1] = m_doc->GetGlyphWidth(SMUFL_E0A3_noteheadHalf, staff->staffSize, true) - (m_doc->m_style->m_stemWidth)/2; /******************************************************************/ // Populate BeamElementCoord for each element in the beam @@ -254,14 +255,8 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta } // We look only at the last note for checking if cuesized. Somehow arbitrarily - if ((*beamElementCoords)[last]->m_element->IsCueSize() == false) { - beamWidthBlack = m_doc->m_drawingBeamWidth[staff->staffSize]; - beamWidthWhite = m_doc->m_drawingBeamWhiteWidth[staff->staffSize]; - } - else { - beamWidthBlack = std::max(2, (m_doc->m_drawingBeamWidth[staff->staffSize] * m_doc->m_style->m_graceNum / m_doc->m_style->m_graceDen)); - beamWidthWhite = std::max(2, (m_doc->m_drawingBeamWhiteWidth[staff->staffSize] * m_doc->m_style->m_graceNum / m_doc->m_style->m_graceDen)); - } + beamWidthBlack = m_doc->GetDrawingBeamWidth(staff->staffSize, (*beamElementCoords)[last]->m_element->IsCueSize()); + beamWidthWhite = m_doc->GetDrawingBeamWhiteWidth(staff->staffSize, (*beamElementCoords)[last]->m_element->IsCueSize()); beamWidth = beamWidthBlack + beamWidthWhite; @@ -273,12 +268,12 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta //if the beam has smaller-size notes if ((*beamElementCoords)[last]->m_element->IsCueSize()) { - verticalShift += m_doc->m_drawingUnit[staff->staffSize]*5; + verticalShift += m_doc->GetDrawingUnit(staff->staffSize)*5; } else { verticalShift += (shortestDur > DUR_8) ? - m_doc->m_drawingDoubleUnit[staff->staffSize] * verticalShiftFactor : - m_doc->m_drawingDoubleUnit[staff->staffSize] * (verticalShiftFactor + 0.5); + m_doc->GetDrawingDoubleUnit(staff->staffSize) * verticalShiftFactor : + m_doc->GetDrawingDoubleUnit(staff->staffSize) * (verticalShiftFactor + 0.5); } // swap x position and verticalShift direction with stem down @@ -355,11 +350,11 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta { if (stemDir == STEMDIRECTION_up) { fy1 = (*beamElementCoords)[i]->m_yBeam - m_doc->m_style->m_stemWidth; - fy2 = (*beamElementCoords)[i]->m_yBottom + m_doc->m_drawingUnit[staff->staffSize]/4; + fy2 = (*beamElementCoords)[i]->m_yBottom + m_doc->GetDrawingUnit(staff->staffSize)/4; } else { fy1 = (*beamElementCoords)[i]->m_yBeam + m_doc->m_style->m_stemWidth; - fy2 = (*beamElementCoords)[i]->m_yTop - m_doc->m_drawingUnit[staff->staffSize]/4; + fy2 = (*beamElementCoords)[i]->m_yTop - m_doc->GetDrawingUnit(staff->staffSize)/4; } // All notes and chords, including notes within chords, get their stem value stored @@ -505,14 +500,14 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta } else if ((*beamElementCoords)[i]->m_partialFlags[testDur-DUR_8] == PARTIAL_RIGHT) { fy1 = (*beamElementCoords)[i]->m_yBeam + barY; - int x2 = (*beamElementCoords)[i]->m_x + m_doc->m_drawingLedgerLine[staff->staffSize][0]; + int x2 = (*beamElementCoords)[i]->m_x + m_doc->GetDrawingLedgerLineLength(staff->staffSize, false); fy2 = startingY + verticalBoost + barY + beamSlope * x2; polygonHeight= beamWidthBlack*shiftY; DrawObliquePolygon (dc, (*beamElementCoords)[i]->m_x, fy1, x2, fy2, polygonHeight); } else if ((*beamElementCoords)[i]->m_partialFlags[testDur-DUR_8] == PARTIAL_LEFT) { fy2 = (*beamElementCoords)[i]->m_yBeam + barY; - int x1 = (*beamElementCoords)[i]->m_x - m_doc->m_drawingLedgerLine[staff->staffSize][0]; + int x1 = (*beamElementCoords)[i]->m_x - m_doc->GetDrawingLedgerLineLength(staff->staffSize, false); fy1 = startingY + verticalBoost + barY + beamSlope * x1; polygonHeight = beamWidthBlack*shiftY; DrawObliquePolygon (dc, x1, fy1, (*beamElementCoords)[i]->m_x, fy2, polygonHeight); diff --git a/src/view_element.cpp b/src/view_element.cpp index 642dead065d..8a42f35ff80 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -245,20 +245,19 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St drawingDur = note->GetDrawingDur(); drawingDur = ((note->GetColored()==BOOLEAN_true) && drawingDur > DUR_1) ? (drawingDur+1) : drawingDur; - //int radius = m_doc->m_drawingNoteRadius[staffSize][drawingCueSize]; int radius = m_doc->GetGlyphWidth(SMUFL_E0A3_noteheadHalf, staffSize, drawingCueSize) / 2; if (drawingDur > DUR_1 || (drawingDur == DUR_1 && staff->notAnc)) { // annuler provisoirement la modif. des lignes addit. - ledge = m_doc->m_drawingLedgerLine[staffSize][drawingCueSize]; + ledge = m_doc->GetDrawingLedgerLineLength(staffSize, drawingCueSize); } else { - ledge = m_doc->m_drawingLedgerLine[staffSize][drawingCueSize]; + ledge = m_doc->GetDrawingLedgerLineLength(staffSize, drawingCueSize); radius += radius/3; } /************** Stem/notehead direction: **************/ - verticalCenter = staffY - m_doc->m_drawingDoubleUnit[staffSize]*2; + verticalCenter = staffY - m_doc->GetDrawingDoubleUnit(staffSize)*2; if ( note->HasDrawingStemDir() ) { note->m_drawingStemDir = note->GetDrawingStemDir(); } @@ -354,8 +353,8 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St /************** Ledger lines: **************/ - int staffTop = staffY + m_doc->m_drawingUnit[staffSize]; - int staffBot = staffY - m_doc->m_drawingStaffSize[staffSize] - m_doc->m_drawingUnit[staffSize]; + int staffTop = staffY + m_doc->GetDrawingUnit(staffSize); + int staffBot = staffY - m_doc->GetDrawingStaffSize(staffSize) - m_doc->GetDrawingUnit(staffSize); //if the note is not in the staff if (!is_in(noteY,staffTop,staffBot)) @@ -364,9 +363,9 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St bool aboveStaff = (noteY > staffTop); - distance = (aboveStaff ? (noteY - staffY) : staffY - m_doc->m_drawingStaffSize[staffSize] - noteY); - highestNewLine = ((distance % m_doc->m_drawingDoubleUnit[staffSize] > 0) ? (distance - m_doc->m_drawingUnit[staffSize]) : distance); - numLines = highestNewLine / m_doc->m_drawingDoubleUnit[staffSize]; + distance = (aboveStaff ? (noteY - staffY) : staffY - m_doc->GetDrawingStaffSize(staffSize) - noteY); + highestNewLine = ((distance % m_doc->GetDrawingDoubleUnit(staffSize) > 0) ? (distance - m_doc->GetDrawingUnit(staffSize)) : distance); + numLines = highestNewLine / m_doc->GetDrawingDoubleUnit(staffSize); //if this is in a chord, we don't want to draw it yet, but we want to keep track of the maxima if (inChord) { @@ -403,9 +402,9 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St if (note->GetDots() && !inChord) { int xDot; if (note->GetActualDur() < DUR_2 || (note->GetActualDur() > DUR_8 && !inBeam && (note->m_drawingStemDir == STEMDIRECTION_up))) - xDot = xStem + m_doc->m_drawingUnit[staffSize]*7/2; + xDot = xStem + m_doc->GetDrawingUnit(staffSize)*7/2; else - xDot = xStem + m_doc->m_drawingUnit[staffSize]*5/2; + xDot = xStem + m_doc->GetDrawingUnit(staffSize)*5/2; DrawDots( dc, xDot, noteY, note->GetDots(), staff ); } @@ -441,10 +440,10 @@ void View::DrawStem( DeviceContext *dc, LayerElement *object, Staff *staff, data int baseStem, totalFlagStemHeight, flagStemHeight, nbFlags; int drawingDur = dynamic_cast(object)->GetActualDur(); bool drawingCueSize = object->IsCueSize(); - int verticalCenter = staffY - m_doc->m_drawingDoubleUnit[staffSize]*2; + int verticalCenter = staffY - m_doc->GetDrawingDoubleUnit(staffSize)*2; - baseStem = m_doc->m_drawingUnit[staffSize]*7; - flagStemHeight = m_doc->m_drawingDoubleUnit[staffSize]; + baseStem = m_doc->GetDrawingUnit(staffSize)*7; + flagStemHeight = m_doc->GetDrawingDoubleUnit(staffSize); if (drawingCueSize) { baseStem = baseStem * m_doc->m_style->m_graceNum / m_doc->m_style->m_graceDen; flagStemHeight = flagStemHeight * m_doc->m_style->m_graceNum / m_doc->m_style->m_graceDen; @@ -474,13 +473,13 @@ void View::DrawStem( DeviceContext *dc, LayerElement *object, Staff *staff, data } // shorten the stem at its connection with the note head - int stemY1 = (dir == STEMDIRECTION_up) ? y1 + m_doc->m_drawingUnit[staffSize] / 4 : y1 - m_doc->m_drawingUnit[staffSize] / 4; + int stemY1 = (dir == STEMDIRECTION_up) ? y1 + m_doc->GetDrawingUnit(staffSize) / 4 : y1 - m_doc->GetDrawingUnit(staffSize) / 4; int stemY2 = y2; if (drawingDur > DUR_4) { // if we have flags, shorten the stem to make sure we have a nice overlap with the flag glyph int shortener = (drawingCueSize) ? - m_doc->m_drawingUnit[staffSize] * m_doc->m_style->m_graceNum / m_doc->m_style->m_graceDen : - m_doc->m_drawingUnit[staffSize]; + m_doc->GetDrawingUnit(staffSize) * m_doc->m_style->m_graceNum / m_doc->m_style->m_graceDen : + m_doc->GetDrawingUnit(staffSize); stemY2 = (dir == STEMDIRECTION_up) ? y2 - shortener : y2 + shortener; } @@ -528,10 +527,10 @@ void View::DrawLedgerLines ( DeviceContext *dc, LayerElement *element, Staff *st int ledgerY; int staffY = staff->GetDrawingY(); int staffSize = staff->staffSize; - int betweenLines = m_doc->m_drawingDoubleUnit[staffSize]; + int betweenLines = m_doc->GetDrawingDoubleUnit(staffSize); bool drawingCueSize = element->IsCueSize(); - int ledge = m_doc->m_drawingLedgerLine[staffSize][drawingCueSize]; - int noteDiameter = m_doc->m_drawingNoteRadius[staffSize][drawingCueSize] * 2; + int ledge = m_doc->GetDrawingLedgerLineLength(staffSize, drawingCueSize); + int noteDiameter = m_doc->GetGlyphWidth(SMUFL_E0A3_noteheadHalf, staffSize, drawingCueSize); //prep start and end positions of ledger line depending on stem direction and doubleLength int xLedgerStart, xLedgerEnd; @@ -557,8 +556,8 @@ void View::DrawLedgerLines ( DeviceContext *dc, LayerElement *element, Staff *st ledgerY = (skip * betweenLines) + staffY; } else { - ledgerY = staffY - m_doc->m_drawingStaffSize[staffSize] - (skip * betweenLines); - betweenLines = -m_doc->m_drawingDoubleUnit[staffSize]; + ledgerY = staffY - m_doc->GetDrawingStaffSize(staffSize) - (skip * betweenLines); + betweenLines = -m_doc->GetDrawingDoubleUnit(staffSize); } //add one line's distance to get it off the edge of the staff @@ -601,7 +600,7 @@ void View::DrawRest ( DeviceContext *dc, LayerElement *element, Layer *layer, St if (drawingDur > DUR_2) { - x -= m_doc->m_drawingNoteRadius[staff->staffSize][drawingCueSize]; + x -= m_doc->GetGlyphWidth(SMUFL_E0A3_noteheadHalf, staff->staffSize, drawingCueSize); } switch (drawingDur) @@ -639,7 +638,7 @@ void View::DrawMRest(DeviceContext *dc, LayerElement *element, Layer *layer, Sta int y = element->GetDrawingY(); // move it down according to the number of line in the staff - y -= staff->m_drawingLines / 2 * m_doc->m_drawingDoubleUnit[staff->staffSize] - m_doc->m_drawingDoubleUnit[staff->staffSize]; + y -= staff->m_drawingLines / 2 * m_doc->GetDrawingDoubleUnit(staff->staffSize) - m_doc->GetDrawingDoubleUnit(staff->staffSize); DrawWholeRest ( dc, xCentered, y, DUR_1, 0, false, staff ); @@ -672,12 +671,12 @@ void View::DrawMultiRest(DeviceContext *dc, LayerElement *element, Layer *layer, multirest->SetNum(999); // This is 1/2 the length of th black rectangle - length = (m_doc->m_drawingUnit[staff->staffSize] * 5); + length = (m_doc->GetDrawingUnit(staff->staffSize) * 5); // Position centered in third line // it would be m_drawingDoubleUnit * 6.5, or m_drawingDoubleUnit / 2 * 13 - y1 = staff->GetDrawingY() - (m_doc->m_drawingDoubleUnit[staff->staffSize] / 2) * 5; - y2 = y1 + m_doc->m_drawingDoubleUnit[staff->staffSize]; + y1 = staff->GetDrawingY() - (m_doc->GetDrawingDoubleUnit(staff->staffSize) / 2) * 5; + y2 = y1 + m_doc->GetDrawingDoubleUnit(staff->staffSize); // a is the central point, claculate x and x2 x1 = x - length; @@ -690,7 +689,7 @@ void View::DrawMultiRest(DeviceContext *dc, LayerElement *element, Layer *layer, //Draw the to lines at beginning and end // make it 8 pixesl longers, and 4 pixels width - int border = m_doc->m_drawingUnit[staff->staffSize]; + int border = m_doc->GetDrawingUnit(staff->staffSize); DrawVerticalLine(dc, y1 - border, y2 + border, x1, m_doc->m_style->m_stemWidth * 2); DrawVerticalLine(dc, y1 - border, y2 + border, x2, m_doc->m_style->m_stemWidth * 2); @@ -719,13 +718,13 @@ void View::DrawLongRest ( DeviceContext *dc, int x, int y, Staff *staff) y1 = y; x1 = x; - x2 = x + (m_doc->m_drawingUnit[staff->staffSize] * 2 / 3); + x2 = x + (m_doc->GetDrawingUnit(staff->staffSize) * 2 / 3); // look if on line or between line - if ( (y - staff->GetDrawingY()) % m_doc->m_drawingDoubleUnit[staff->staffSize]) - y1 -= m_doc->m_drawingUnit[staff->staffSize]; + if ( (y - staff->GetDrawingY()) % m_doc->GetDrawingDoubleUnit(staff->staffSize)) + y1 -= m_doc->GetDrawingUnit(staff->staffSize); - y2 = y1 + m_doc->m_drawingDoubleUnit[staff->staffSize]*2; + y2 = y1 + m_doc->GetDrawingDoubleUnit(staff->staffSize)*2; DrawFullRectangle( dc, x1, y2, x2, y1); return; } @@ -736,18 +735,18 @@ void View::DrawBreveRest ( DeviceContext *dc, int x, int y, Staff *staff) int x1, x2, y1, y2; y1 = y; x1 = x; - x2 = x + (m_doc->m_drawingUnit[staff->staffSize] * 2 / 3); + x2 = x + (m_doc->GetDrawingUnit(staff->staffSize) * 2 / 3); // look if one line or between line - if ( (y - staff->GetDrawingY()) % m_doc->m_drawingDoubleUnit[staff->staffSize]) - y1 -= m_doc->m_drawingUnit[staff->staffSize]; + if ( (y - staff->GetDrawingY()) % m_doc->GetDrawingDoubleUnit(staff->staffSize)) + y1 -= m_doc->GetDrawingUnit(staff->staffSize); - y2 = y1 + m_doc->m_drawingDoubleUnit[staff->staffSize]; + y2 = y1 + m_doc->GetDrawingDoubleUnit(staff->staffSize); DrawFullRectangle( dc, x1, y2, x2, y1); // lines - x1 = x - m_doc->m_drawingUnit[staff->staffSize]; - x2 = x + m_doc->m_drawingUnit[staff->staffSize]; + x1 = x - m_doc->GetDrawingUnit(staff->staffSize); + x2 = x + m_doc->GetDrawingUnit(staff->staffSize); DrawHorizontalLine ( dc, x1, x2, y2, 1); DrawHorizontalLine ( dc, x1, x2, y1, 1); @@ -758,13 +757,13 @@ void View::DrawWholeRest ( DeviceContext *dc, int x, int y, int valeur, unsigned { int x1, x2, y1, y2, vertic; y1 = y; - vertic = m_doc->m_drawingUnit[staff->staffSize]; + vertic = m_doc->GetDrawingUnit(staff->staffSize); int off; float foff; if (staff->notAnc) - foff = (m_doc->m_drawingUnit[staff->staffSize] *1 / 3); + foff = (m_doc->GetDrawingUnit(staff->staffSize) *1 / 3); else foff = (m_doc->m_drawingLedgerLine[staff->staffSize][2] * 2) / 3; // i.e., la moitie de la ronde @@ -779,7 +778,7 @@ void View::DrawWholeRest ( DeviceContext *dc, int x, int y, int valeur, unsigned vertic = -vertic; // look if one line or between line - if ( (y - staff->GetDrawingY()) % m_doc->m_drawingDoubleUnit[staff->staffSize]) + if ( (y - staff->GetDrawingY()) % m_doc->GetDrawingDoubleUnit(staff->staffSize)) { if (valeur == DUR_2) y1 -= vertic; @@ -799,32 +798,32 @@ void View::DrawWholeRest ( DeviceContext *dc, int x, int y, int valeur, unsigned DrawHorizontalLine ( dc, x1, x2, y1, m_doc->m_style->m_staffLineWidth); if (dots) - DrawDots( dc, (x2 + m_doc->m_drawingUnit[staff->staffSize]), y2, dots, staff); + DrawDots( dc, (x2 + m_doc->GetDrawingUnit(staff->staffSize)), y2, dots, staff); } void View::DrawQuarterRest ( DeviceContext *dc, int x, int y, int valeur, unsigned char dots, unsigned int smaller, Staff *staff) { - int y2 = y + m_doc->m_drawingDoubleUnit[staff->staffSize]; + int y2 = y + m_doc->GetDrawingDoubleUnit(staff->staffSize); DrawSmuflCode( dc, x, y2, SMUFL_E4E5_restQuarter + (valeur-DUR_4), staff->staffSize, smaller ); if (dots) { if (valeur < DUR_16) - y += m_doc->m_drawingDoubleUnit[staff->staffSize]; - DrawDots( dc, (x + 2 * m_doc->m_drawingDoubleUnit[staff->staffSize]), y, dots, staff); + y += m_doc->GetDrawingDoubleUnit(staff->staffSize); + DrawDots( dc, (x + 2 * m_doc->GetDrawingDoubleUnit(staff->staffSize)), y, dots, staff); } return; } bool View::IsOnStaffLine ( int y, Staff *staff) { - return ((y - staff->GetDrawingY()) % m_doc->m_drawingDoubleUnit[staff->staffSize] == 0 ); + return ((y - staff->GetDrawingY()) % m_doc->GetDrawingDoubleUnit(staff->staffSize) == 0 ); } void View::PrepareChordDots ( DeviceContext *dc, Chord *chord, int x, int y, unsigned char dots, Staff *staff ) { std::list *dotsList = &chord->m_dots; - int fullUnit = m_doc->m_drawingUnit[staff->staffSize]; + int fullUnit = m_doc->GetDrawingUnit(staff->staffSize); int doubleUnit = fullUnit * 2; //if it's on a staff line to start with, we need to compensate here and add a full unit like DrawDots would @@ -866,11 +865,11 @@ void View::DrawDots ( DeviceContext *dc, int x, int y, unsigned char dots, Staff { int i; if ( IsOnStaffLine(y, staff) ) { - y += m_doc->m_drawingUnit[staff->staffSize]; + y += m_doc->GetDrawingUnit(staff->staffSize); } for (i = 0; i < dots; i++) { DrawDot ( dc, x, y ); - x += std::max (6, 2 * m_doc->m_drawingUnit[staff->staffSize]); + x += std::max (6, 2 * m_doc->GetDrawingUnit(staff->staffSize)); } return; } @@ -907,10 +906,10 @@ void View::DrawChord( DeviceContext *dc, LayerElement *element, Layer *layer, St int staffSize = staff->staffSize; int staffY = staff->GetDrawingY(); - int verticalCenter = staffY - m_doc->m_drawingDoubleUnit[staffSize]*2; + int verticalCenter = staffY - m_doc->GetDrawingDoubleUnit(staffSize)*2; bool drawingCueSize = chord->IsCueSize(); - int radius = m_doc->m_drawingNoteRadius[staffSize][drawingCueSize]; - int fullUnit = m_doc->m_drawingUnit[staffSize]; + int radius = m_doc->GetGlyphWidth(SMUFL_E0A3_noteheadHalf, staffSize, drawingCueSize); + int fullUnit = m_doc->GetDrawingUnit(staffSize); bool inBeam = false; // Get the immadiate parent of the note @@ -1139,43 +1138,43 @@ void View::DrawClef( DeviceContext *dc, LayerElement *element, Layer *layer, Sta break; case G2_8va : sym = SMUFL_E053_gClef8va; - b -= m_doc->m_drawingDoubleUnit[ staff->staffSize ]*3; + b -= m_doc->GetDrawingDoubleUnit( staff->staffSize )*3; break; case G2_8vb : sym = SMUFL_E052_gClef8vb; - b -= m_doc->m_drawingDoubleUnit[ staff->staffSize ]*3; + b -= m_doc->GetDrawingDoubleUnit( staff->staffSize )*3; break; case C2 : sym = SMUFL_E05C_cClef; - b -= m_doc->m_drawingDoubleUnit[ staff->staffSize ]*3; + b -= m_doc->GetDrawingDoubleUnit( staff->staffSize )*3; break; case G2 : - b -= m_doc->m_drawingDoubleUnit[ staff->staffSize ]*3; + b -= m_doc->GetDrawingDoubleUnit( staff->staffSize )*3; break; case F3 : sym = SMUFL_E062_fClef; - b -= m_doc->m_drawingDoubleUnit[ staff->staffSize ]*2; + b -= m_doc->GetDrawingDoubleUnit( staff->staffSize )*2; break; case C3 : sym = SMUFL_E05C_cClef; - b -= m_doc->m_drawingDoubleUnit[ staff->staffSize ]*2; + b -= m_doc->GetDrawingDoubleUnit( staff->staffSize )*2; break; case F5 : sym =SMUFL_E062_fClef; break; case F4 : sym = SMUFL_E062_fClef; - b -= m_doc->m_drawingDoubleUnit[ staff->staffSize ]; + b -= m_doc->GetDrawingDoubleUnit( staff->staffSize ); break; case C4 : sym = SMUFL_E05C_cClef; - b -= m_doc->m_drawingDoubleUnit[ staff->staffSize ]; + b -= m_doc->GetDrawingDoubleUnit( staff->staffSize ); break; case C5 : sym = SMUFL_E05C_cClef; break; case perc : - b -= m_doc->m_drawingDoubleUnit[ staff->staffSize ]*2; + b -= m_doc->GetDrawingDoubleUnit( staff->staffSize )*2; // FIXME sym = SMUFL_E05C_cClef; break; @@ -1188,7 +1187,7 @@ void View::DrawClef( DeviceContext *dc, LayerElement *element, Layer *layer, Sta if (clef->GetFirstParent( LAYER )) cueSize = true; if (!cueSize) - a -= m_doc->m_drawingUnit[staff->staffSize] * 2; + a -= m_doc->GetDrawingUnit(staff->staffSize) * 2; DrawSmuflCode ( dc, a, b, sym, staff->staffSize, cueSize ); @@ -1205,14 +1204,14 @@ void View::DrawMeterSigFigures( DeviceContext *dc, int x, int y, int num, int nu if (numBase) { - ynum = y - (m_doc->m_drawingUnit[staff->staffSize]*2); - yden = ynum - (m_doc->m_drawingDoubleUnit[staff->staffSize]*2); + ynum = y - (m_doc->GetDrawingUnit(staff->staffSize)*2); + yden = ynum - (m_doc->GetDrawingDoubleUnit(staff->staffSize)*2); } else - ynum = y - (m_doc->m_drawingUnit[staff->staffSize]*4); + ynum = y - (m_doc->GetDrawingUnit(staff->staffSize)*4); if (numBase > 9 || num > 9) { - x += m_doc->m_drawingUnit[staff->staffSize] * 2; + x += m_doc->GetDrawingUnit(staff->staffSize) * 2; } dc->SetFont( &m_doc->m_drawingSmuflFonts[staff->staffSize][0] ); @@ -1249,11 +1248,11 @@ void View::DrawMeterSig( DeviceContext *dc, LayerElement *element, Layer *layer, if ( meterSig->GetSym() == METERSIGN_common ) { DrawSmuflCode( dc, element->GetDrawingX(), y, SMUFL_E08A_timeSigCommon, staff->staffSize, false); - x += m_doc->m_drawingUnit[staff->staffSize] * 5; // step forward because we have a symbol + x += m_doc->GetDrawingUnit(staff->staffSize) * 5; // step forward because we have a symbol } else if ( meterSig->GetSym() == METERSIGN_cut ) { DrawSmuflCode( dc, element->GetDrawingX(), y, SMUFL_E08B_timeSigCutCommon, staff->staffSize, false); - x += m_doc->m_drawingUnit[staff->staffSize] * 5; // step forward because we have a symbol + x += m_doc->GetDrawingUnit(staff->staffSize) * 5; // step forward because we have a symbol } else if (meterSig->GetCount()) { @@ -1269,7 +1268,7 @@ bool View::CalculateAccidX(Staff *staff, Accid *accid, Chord *chord, bool adjust std::vector< std::vector > *accidSpace = &chord->m_accidSpace; //global drawing variables - int fullUnit = m_doc->m_drawingUnit[staff->staffSize]; + int fullUnit = m_doc->GetDrawingUnit(staff->staffSize); int halfUnit = fullUnit / 2; int accidHeight = ACCID_HEIGHT * halfUnit; @@ -1470,18 +1469,18 @@ void View::DrawAccid( DeviceContext *dc, LayerElement *element, Layer *layer, St Note *note = dynamic_cast( accid->GetFirstParent( NOTE, MAX_ACCID_DEPTH ) ); if ( note ) { if ( note->GetDrawingY() > y ) { - y = note->GetDrawingY() + m_doc->m_drawingUnit[staff->staffSize]; + y = note->GetDrawingY() + m_doc->GetDrawingUnit(staff->staffSize); } if ( (note->m_drawingStemDir == STEMDIRECTION_up) && (note->m_drawingStemEnd.y > y )) { y = note->m_drawingStemEnd.y; } // adjust the x position so it is centered - int radius = m_doc->m_drawingNoteRadius[staff->staffSize][accid->m_drawingCueSize]; + int radius = m_doc->GetGlyphWidth(SMUFL_E0A3_noteheadHalf, staff->staffSize, accid->m_drawingCueSize); if ( note->GetActualDur() < DUR_2 ) radius += radius/3; accid->SetDrawingX( accid->GetDrawingX() + radius / 2 ); } - accid->SetDrawingY( y + TEMP_STYLE_ACCID_EDIT_SPACE * m_doc->m_drawingUnit[staff->staffSize] / PARAM_DENOMINATOR ); + accid->SetDrawingY( y + TEMP_STYLE_ACCID_EDIT_SPACE * m_doc->GetDrawingUnit(staff->staffSize) / PARAM_DENOMINATOR ); } int x = accid->GetDrawingX(); @@ -1510,7 +1509,7 @@ void View::DrawAccid( DeviceContext *dc, LayerElement *element, Layer *layer, St if (staff->notAnc) { symc = SMUFL_E262_accidentalSharp; DrawSmuflCode ( dc, x, y, symc, staff->staffSize, accid->m_drawingCueSize ); - y += 7*m_doc->m_drawingUnit[staff->staffSize]; // LP + y += 7*m_doc->GetDrawingUnit(staff->staffSize); // LP } else { symc = SMUFL_E263_accidentalDoubleSharp; break; @@ -1559,7 +1558,7 @@ void View::DrawCustos( DeviceContext *dc, LayerElement *element, Layer *layer, S int x = element->GetDrawingX(); int y = element->GetDrawingY(); - y -= m_doc->m_drawingUnit[staff->staffSize] - m_doc->m_drawingUnit[staff->staffSize]/4; // LP - correction in 2.0.0 + y -= m_doc->GetDrawingUnit(staff->staffSize) - m_doc->GetDrawingUnit(staff->staffSize)/4; // LP - correction in 2.0.0 // HARDCODED (smufl code wrong) DrawSmuflCode( dc, x, y, 35, staff->staffSize, false ); @@ -1588,7 +1587,7 @@ void View::DrawDot( DeviceContext *dc, LayerElement *element, Layer *layer, Staf // Use the note to which the points to for position if ( dot->m_drawingNote ) { - x = dot->m_drawingNote->GetDrawingX() + m_doc->m_drawingUnit[staff->staffSize]*7/2; + x = dot->m_drawingNote->GetDrawingX() + m_doc->GetDrawingUnit(staff->staffSize)*7/2; y = dot->m_drawingNote->GetDrawingY(); } @@ -1605,7 +1604,7 @@ int View::GetSylY( Syl *syl, Staff *staff ) int y = syl->GetStart()->GetDrawingY(); if (staff->GetAlignment() ) { y = staff->GetDrawingY() + staff->GetAlignment()->GetMaxHeight() - - syl->m_drawingVerse * TEMP_STYLE_LYIRC_LINE_SPACE * m_doc->m_drawingUnit[staff->staffSize] / PARAM_DENOMINATOR; + syl->m_drawingVerse * TEMP_STYLE_LYIRC_LINE_SPACE * m_doc->GetDrawingUnit(staff->staffSize) / PARAM_DENOMINATOR; } return y; } @@ -1621,7 +1620,7 @@ void View::DrawSyl( DeviceContext *dc, LayerElement *element, Layer *layer, Staf } // move the position back - to be updated HARDCODED also see View::DrawSylConnector and View::DrawSylConnectorLines - syl->SetDrawingX( syl->GetStart()->GetDrawingX() - m_doc->m_drawingUnit[staff->staffSize] * 2 ); + syl->SetDrawingX( syl->GetStart()->GetDrawingX() - m_doc->GetDrawingUnit(staff->staffSize) * 2 ); syl->SetDrawingY( GetSylY(syl, staff) ); dc->StartGraphic( syl, "", syl->GetUuid() ); @@ -1630,12 +1629,12 @@ void View::DrawSyl( DeviceContext *dc, LayerElement *element, Layer *layer, Staf FontInfo currentFont; if (syl->HasFontstyle()) { - currentFont = m_doc->m_drawingLyricFonts[ staff->staffSize ]; + currentFont = m_doc->GetDrawingLyricFonts( staff->staffSize ); currentFont.SetStyle(syl->GetFontstyle()); dc->SetFont(¤tFont); } else { - dc->SetFont( &m_doc->m_drawingLyricFonts[ staff->staffSize ] ); + dc->SetFont( &m_doc->GetDrawingLyricFonts( staff->staffSize ) ); } DrawLyricString(dc, syl->GetDrawingX(), syl->GetDrawingY(), syl->GetText().c_str(), staff->staffSize ); @@ -1747,7 +1746,7 @@ void View::DrawAcciaccaturaSlash(DeviceContext *dc, LayerElement *element) dc->SetPen(AxBLACK, m_doc->m_style->m_stemWidth, AxSOLID); dc->SetBrush( AxBLACK, AxSOLID ); - int positionShift = m_doc->m_drawingUnit[staff->staffSize] * m_doc->m_style->m_graceNum / m_doc->m_style->m_graceDen; + int positionShift = m_doc->GetDrawingUnit(staff->staffSize) * m_doc->m_style->m_graceNum / m_doc->m_style->m_graceDen; int positionShiftX1 = positionShift * 3 / 2; int positionShiftY1 = positionShift * 2; int positionShiftX2 = positionShift * 3; @@ -1783,7 +1782,7 @@ void View::DrawFermata(DeviceContext *dc, LayerElement *element, Staff *staff) // We position the fermata in the same horizontal pos. of th object // but it shoud be moved according to half of the fermata size - x = element->GetDrawingX() - m_doc->m_drawingDoubleUnit[staff->staffSize]; + x = element->GetDrawingX() - m_doc->GetDrawingDoubleUnit(staff->staffSize); // First case, notes if (element->Is() == NOTE) { @@ -1796,15 +1795,15 @@ void View::DrawFermata(DeviceContext *dc, LayerElement *element, Staff *staff) */ // only for up-fermatas, if there is a trill on the same note if (note->m_embellishment) - emb_offset = m_doc->m_drawingDoubleUnit[staff->staffSize]; + emb_offset = m_doc->GetDrawingDoubleUnit(staff->staffSize); // check that the notehead is in the staff. if ((element->GetDrawingY()) < staff->GetDrawingY()) // in the staff, set the fermata 20 pixels above the last line (+ embellishment offset) - y = staff->GetDrawingY() + m_doc->m_drawingUnit[staff->staffSize] + emb_offset; + y = staff->GetDrawingY() + m_doc->GetDrawingUnit(staff->staffSize) + emb_offset; else // out of the staff, place the trill above the notehead - y = (element->GetDrawingY()) + m_doc->m_drawingUnit[staff->staffSize] + emb_offset; + y = (element->GetDrawingY()) + m_doc->GetDrawingUnit(staff->staffSize) + emb_offset; // draw the up-fermata DrawSmuflCode ( dc, x, y, SMUFL_E4C0_fermataAbove, staff->staffSize, false ); @@ -1815,10 +1814,10 @@ void View::DrawFermata(DeviceContext *dc, LayerElement *element, Staff *staff) // UNDER the staff if ((element->GetDrawingY()) > (staff->GetDrawingY() - m_doc->m_drawingStaffSize[staff->staffSize])) // notehead in staff, set under - y = staff->GetDrawingY() - m_doc->m_drawingStaffSize[staff->staffSize] - m_doc->m_drawingDoubleUnit[staff->staffSize]; + y = staff->GetDrawingY() - m_doc->m_drawingStaffSize[staff->staffSize] - m_doc->GetDrawingDoubleUnit(staff->staffSize); else // notehead under staff, set under notehead - y = (element->GetDrawingY()) - m_doc->m_drawingDoubleUnit[staff->staffSize]; + y = (element->GetDrawingY()) - m_doc->GetDrawingDoubleUnit(staff->staffSize); DrawSmuflCode ( dc, x, y, LEIPZIG_FERMATA_DOWN, staff, false ); } @@ -1827,7 +1826,7 @@ void View::DrawFermata(DeviceContext *dc, LayerElement *element, Staff *staff) // this is a rest // rests for the moment are always in the staff // so just place the fermata above the staff - y = staff->GetDrawingY() + m_doc->m_drawingDoubleUnit[staff->staffSize]; + y = staff->GetDrawingY() + m_doc->GetDrawingDoubleUnit(staff->staffSize); DrawSmuflCode ( dc, x, y, SMUFL_E4C0_fermataAbove, staff->staffSize, false ); } } @@ -1844,9 +1843,9 @@ void View::DrawTrill(DeviceContext *dc, LayerElement *element, Staff *staff) // HARDCODED if ((element->GetDrawingY()) < staff->GetDrawingY()) - y = staff->GetDrawingY() + m_doc->m_drawingDoubleUnit[staff->staffSize]; + y = staff->GetDrawingY() + m_doc->GetDrawingDoubleUnit(staff->staffSize); else - y = (element->GetDrawingY()) + m_doc->m_drawingDoubleUnit[staff->staffSize]; + y = (element->GetDrawingY()) + m_doc->GetDrawingDoubleUnit(staff->staffSize); DrawSmuflCode ( dc, x, y, SMUFL_E566_ornamentTrill, staff->staffSize, false ); } diff --git a/src/view_floating.cpp b/src/view_floating.cpp index 054dabf4df6..d2b330b1c59 100644 --- a/src/view_floating.cpp +++ b/src/view_floating.cpp @@ -130,7 +130,7 @@ void View::DrawTimeSpanningElement( DeviceContext *dc, DocObject *element, Syste // takes into account the scoreDef Note *firstNote = dynamic_cast( staff->FindChildByType( NOTE ) ); - x1 = firstNote ? firstNote->GetDrawingX() - 2 * m_doc->m_drawingDoubleUnit[staff->staffSize] : first->GetDrawingX(); + x1 = firstNote ? firstNote->GetDrawingX() - 2 * m_doc->GetDrawingDoubleUnit(staff->staffSize) : first->GetDrawingX(); x2 = interface->GetEnd()->GetDrawingX(); spanningType = SPANNING_END; } @@ -157,7 +157,7 @@ void View::DrawTimeSpanningElement( DeviceContext *dc, DocObject *element, Syste return; } - x1 = firstNote ? firstNote->GetDrawingX() - 2 * m_doc->m_drawingDoubleUnit[staff->staffSize] : first->GetDrawingX(); + x1 = firstNote ? firstNote->GetDrawingX() - 2 * m_doc->GetDrawingDoubleUnit(staff->staffSize) : first->GetDrawingX(); x2 = last->GetDrawingX() + last->GetRightBarlineX(); spanningType = SPANNING_MIDDLE; } @@ -267,7 +267,7 @@ void View::DrawTieOrSlur( DeviceContext *dc, FloatingElement *element, int x1, i } else if (noteStemDir == STEMDIRECTION_NONE) { // no information from the note stem directions, look at the position in the notes - int center = staff->GetDrawingY() - m_doc->m_drawingDoubleUnit[staff->staffSize] * 2; + int center = staff->GetDrawingY() - m_doc->GetDrawingDoubleUnit(staff->staffSize) * 2; up = (y1 > center) ? true : false; } @@ -275,12 +275,12 @@ void View::DrawTieOrSlur( DeviceContext *dc, FloatingElement *element, int x1, i // 20 height nice with 70, not nice with 50 // Also remove HARDCODED values! if (up) { - y1 += m_doc->m_drawingUnit[staff->staffSize] * 1.6; - y2 += m_doc->m_drawingUnit[staff->staffSize] * 1.6; + y1 += m_doc->GetDrawingUnit(staff->staffSize) * 1.6; + y2 += m_doc->GetDrawingUnit(staff->staffSize) * 1.6; } else { - y1 -= m_doc->m_drawingUnit[staff->staffSize] * 1.6; - y2 -= m_doc->m_drawingUnit[staff->staffSize] * 1.6; + y1 -= m_doc->GetDrawingUnit(staff->staffSize) * 1.6; + y2 -= m_doc->GetDrawingUnit(staff->staffSize) * 1.6; } if ( graphic ) dc->ResumeGraphic(graphic, graphic->GetUuid()); @@ -304,19 +304,19 @@ void View::DrawSylConnector( DeviceContext *dc, Syl *syl, int x1, int x2, Staff // The both correspond to the current system, which means no system break in-between (simple case) if ( spanningType == SPANNING_START_END ) { - dc->SetFont( &m_doc->m_drawingLyricFonts[ staff->staffSize ] ); + dc->SetFont( m_doc->GetDrawingLyricFont( staff->staffSize ) ); dc->GetTextExtent(syl->GetText(), &w, &h); dc->ResetFont(); // x position of the syl is two units back - x1 += w - m_doc->m_drawingUnit[staff->staffSize] * 2; + x1 += w - m_doc->GetDrawingUnit(staff->staffSize) * 2; } // Only the first parent is the same, this means that the syl is "open" at the end of the system else if ( spanningType == SPANNING_START) { - dc->SetFont( &m_doc->m_drawingLyricFonts[ staff->staffSize ] ); + dc->SetFont( m_doc->GetDrawingLyricFont( staff->staffSize ) ); dc->GetTextExtent(syl->GetText(), &w, &h); dc->ResetFont(); // idem - x1 += w - m_doc->m_drawingUnit[staff->staffSize] * 2; + x1 += w - m_doc->GetDrawingUnit(staff->staffSize) * 2; } // We are in the system of the last note - draw the connector from the beginning of the system @@ -342,9 +342,9 @@ void View::DrawSylConnectorLines( DeviceContext *dc, int x1, int x2, int y, Syl { if (syl->GetCon() == CON_d) { - y += m_doc->m_drawingUnit[staff->staffSize] * 2 / 3; + y += m_doc->GetDrawingUnit(staff->staffSize) * 2 / 3; // x position of the syl is two units back - x2 -= 2 * (int)m_doc->m_drawingUnit[staff->staffSize]; + x2 -= 2 * (int)m_doc->GetDrawingUnit(staff->staffSize); //if ( x1 > x2 ) { // DrawFullRectangle(dc, x1, y + 2* m_doc->m_style->m_barlineWidth, x2, y + 3 * m_doc->m_style->m_barlineWidth); @@ -352,8 +352,8 @@ void View::DrawSylConnectorLines( DeviceContext *dc, int x1, int x2, int y, Syl //} // the length of the dash and the space between them - can be made a parameter - int dashLength = m_doc->m_drawingUnit[staff->staffSize] * 4 / 3; - int dashSpace = m_doc->m_drawingStaffSize[staff->staffSize] * 5 / 3; + int dashLength = m_doc->GetDrawingUnit(staff->staffSize) * 4 / 3; + int dashSpace = m_doc->GetDrawingStaffSize(staff->staffSize) * 5 / 3; int halfDashLength = dashLength / 2; int dist = x2 - x1; @@ -376,7 +376,7 @@ void View::DrawSylConnectorLines( DeviceContext *dc, int x1, int x2, int y, Syl } else if (syl->GetCon() == CON_u) { - x1 += (int)m_doc->m_drawingUnit[staff->staffSize] / 2; + x1 += (int)m_doc->GetDrawingUnit(staff->staffSize) / 2; DrawFullRectangle(dc, x1, y, x2, y + m_doc->m_style->m_barlineWidth); } diff --git a/src/view_graph.cpp b/src/view_graph.cpp index 4fdec2c7047..4b8ce2aa088 100644 --- a/src/view_graph.cpp +++ b/src/view_graph.cpp @@ -94,7 +94,7 @@ void View::DrawObliquePolygon ( DeviceContext *dc, int x1, int y1, int x2, int y void View::DrawDot ( DeviceContext *dc, int x, int y ) { - int r = std::max( ToDeviceContextX( m_doc->m_drawingDoubleUnit[0] / 5 ), 2 ); + int r = std::max( ToDeviceContextX( m_doc->GetDrawingDoubleUnit( 100 ) / 5 ), 2 ); dc->SetPen( m_currentColour, 1, AxSOLID ); dc->SetBrush( m_currentColour, AxSOLID ); @@ -117,7 +117,7 @@ void View::DrawSmuflCode ( DeviceContext *dc, int x, int y, wchar_t code, str.push_back(code); dc->SetBrush( m_currentColour, AxSOLID ); - dc->SetFont( &m_doc->m_drawingSmuflFonts[staffSize][dimin] ); + dc->SetFont( m_doc->GetDrawingSmuflFont(staffSize, dimin) ); dc->DrawMusicText( str, ToDeviceContextX(x), ToDeviceContextY(y) ); @@ -141,7 +141,7 @@ void View::DrawSmuflString ( DeviceContext *dc, int x, int y, std::wstring s, in } dc->SetBrush( m_currentColour, AxSOLID ); - dc->SetFont( &m_doc->m_drawingSmuflFonts[staffSize][0] ); + dc->SetFont( m_doc->GetDrawingSmuflFont(staffSize, 0) ); dc->DrawMusicText( s, xDC, ToDeviceContextY(y) ); @@ -166,7 +166,7 @@ void View::DrawLyricString ( DeviceContext *dc, int x, int y, std::wstring s, in FontInfo vrvTxt; vrvTxt.SetFaceName("VerovioText"); - vrvTxt.SetPointSize( m_doc->m_drawingLyricFonts[staffSize].GetPointSize()); + vrvTxt.SetPointSize( m_doc->GetDrawingLyricFont(staffSize)->GetPointSize() ); dc->SetFont( &vrvTxt ); dc->VrvTextFont(); @@ -184,9 +184,9 @@ void View::DrawTieOrSlurBezier(DeviceContext *dc, int x, int y, int x1, int y1, { assert( dc ); - int height = std::max( MIN_TIE_HEIGHT * DEFINITON_FACTOR, std::min( 5 * m_doc->m_drawingDoubleUnit[0] / 3, abs( x1 - x ) / 4 ) ); + int height = std::max( MIN_TIE_HEIGHT * DEFINITON_FACTOR, std::min( 5 * m_doc->GetDrawingDoubleUnit( 100 ) / 3, abs( x1 - x ) / 4 ) ); - int thickness = std::max( m_doc->m_drawingDoubleUnit[0] / 3, MIN_TIE_THICKNESS * DEFINITON_FACTOR ); + int thickness = std::max( m_doc->GetDrawingDoubleUnit(100) / 3, MIN_TIE_THICKNESS * DEFINITON_FACTOR ); int one, two; // control points at 1/4 and 3/4 of total lenght int bez1[6], bez2[6]; // filled array with control points and end point diff --git a/src/view_mensural.cpp b/src/view_mensural.cpp index 9b234899fa7..5992b9f3989 100644 --- a/src/view_mensural.cpp +++ b/src/view_mensural.cpp @@ -59,19 +59,19 @@ void View::DrawMensuralNote ( DeviceContext *dc, LayerElement *element, Layer *l drawingDur = note->GetDrawingDur(); drawingCueSize = note->HasGrace(); - int radius = m_doc->m_drawingNoteRadius[staffSize][drawingCueSize]; + int radius = m_doc->GetGlyphWidth(SMUFL_E0A3_noteheadHalf, staffSize, drawingCueSize); if (drawingDur > DUR_1 || (drawingDur == DUR_1 && staff->notAnc)) { // annuler provisoirement la modif. des lignes addit. - ledge = m_doc->m_drawingLedgerLine[staffSize][drawingCueSize]; + ledge = m_doc->GetDrawingLedgerLineLength(staffSize, drawingCueSize); } else { - ledge = m_doc->m_drawingLedgerLine[staffSize][drawingCueSize]; + ledge = m_doc->GetDrawingLedgerLineLength(staffSize, drawingCueSize); radius += radius/3; } /************** Stem/notehead direction: **************/ - verticalCenter = staffY - m_doc->m_drawingDoubleUnit[staffSize]*2; + verticalCenter = staffY - m_doc->GetDrawingDoubleUnit(staffSize)*2; if ( note->HasDrawingStemDir() ) { note->m_drawingStemDir = note->GetDrawingStemDir(); } @@ -120,8 +120,8 @@ void View::DrawMensuralNote ( DeviceContext *dc, LayerElement *element, Layer *l /************** Ledger lines: **************/ - int staffTop = staffY + m_doc->m_drawingUnit[staffSize]; - int staffBot = staffY - m_doc->m_drawingStaffSize[staffSize] - m_doc->m_drawingUnit[staffSize]; + int staffTop = staffY + m_doc->GetDrawingUnit(staffSize); + int staffBot = staffY - m_doc->GetDrawingStaffSize(staffSize) - m_doc->GetDrawingUnit(staffSize); //if the note is not in the staff if (!is_in(noteY,staffTop,staffBot)) @@ -129,9 +129,9 @@ void View::DrawMensuralNote ( DeviceContext *dc, LayerElement *element, Layer *l int distance, highestNewLine, numLines; bool aboveStaff = (noteY > staffTop); - distance = (aboveStaff ? (noteY - staffY) : staffY - m_doc->m_drawingStaffSize[staffSize] - noteY); - highestNewLine = ((distance % m_doc->m_drawingDoubleUnit[staffSize] > 0) ? (distance - m_doc->m_drawingUnit[staffSize]) : distance); - numLines = highestNewLine / m_doc->m_drawingDoubleUnit[staffSize]; + distance = (aboveStaff ? (noteY - staffY) : staffY - m_doc->GetDrawingStaffSize(staffSize) - noteY); + highestNewLine = ((distance % m_doc->GetDrawingDoubleUnit(staffSize) > 0) ? (distance - m_doc->GetDrawingUnit(staffSize)) : distance); + numLines = highestNewLine / m_doc->GetDrawingDoubleUnit(staffSize); DrawLedgerLines(dc, note, staff, aboveStaff, false, 0, numLines); @@ -142,9 +142,9 @@ void View::DrawMensuralNote ( DeviceContext *dc, LayerElement *element, Layer *l if (note->GetDots()) { int xDot; if (note->GetDur() < DUR_2 || (note->GetDur() > DUR_8 && (note->m_drawingStemDir == STEMDIRECTION_up))) - xDot = xStem + m_doc->m_drawingUnit[staffSize]*7/2; + xDot = xStem + m_doc->GetDrawingUnit(staffSize)*7/2; else - xDot = xStem + m_doc->m_drawingUnit[staffSize]*5/2; + xDot = xStem + m_doc->GetDrawingUnit(staffSize)*5/2; DrawDots( dc, xDot, noteY, note->GetDots(), staff ); } @@ -193,7 +193,7 @@ void View::DrawMensur( DeviceContext *dc, LayerElement *element, Layer *layer, S x = element->GetDrawingX(); if (mensur->GetSign() || mensur->HasTempus()) { - x += m_doc->m_drawingUnit[staff->staffSize] * 5; // step forward because we have a sign or a meter symbol + x += m_doc->GetDrawingUnit(staff->staffSize) * 5; // step forward because we have a sign or a meter symbol } int numbase = mensur->HasNumbase() ? mensur->GetNumbase() : 0; DrawMeterSigFigures ( dc, x, staff->GetDrawingY(), mensur->GetNum(), numbase, staff); @@ -209,8 +209,8 @@ void View::DrawMensurCircle( DeviceContext *dc, int x, int yy, Staff *staff ) assert( dc ); assert( staff ); - int y = ToDeviceContextY (yy - m_doc->m_drawingDoubleUnit[ staff->staffSize ] * 2); - int r = ToDeviceContextX( m_doc->m_drawingDoubleUnit[ staff->staffSize ]); + int y = ToDeviceContextY (yy - m_doc->GetDrawingDoubleUnit( staff->staffSize ) * 2); + int r = ToDeviceContextX( m_doc->GetDrawingDoubleUnit( staff->staffSize )); dc->SetPen( m_currentColour, m_doc->m_style->m_staffLineWidth, AxSOLID ); dc->SetBrush( m_currentColour, AxTRANSPARENT ); @@ -229,8 +229,8 @@ void View::DrawMensurHalfCircle( DeviceContext *dc, int x, int yy, Staff *staff dc->SetPen( m_currentColour, m_doc->m_style->m_staffLineWidth, AxSOLID ); dc->SetBrush( m_currentColour, AxTRANSPARENT ); - int y = ToDeviceContextY (yy - m_doc->m_drawingDoubleUnit[ staff->staffSize ]); - int r = ToDeviceContextX( m_doc->m_drawingDoubleUnit[ staff->staffSize ]); + int y = ToDeviceContextY (yy - m_doc->GetDrawingDoubleUnit( staff->staffSize )); + int r = ToDeviceContextX( m_doc->GetDrawingDoubleUnit( staff->staffSize )); x = ToDeviceContextX (x); x -= 3*r/3; @@ -251,8 +251,8 @@ void View::DrawMensurReversedHalfCircle( DeviceContext *dc, int x, int yy, Staff dc->SetPen( m_currentColour, m_doc->m_style->m_staffLineWidth, AxSOLID ); dc->SetBrush( m_currentColour, AxTRANSPARENT ); - int y = ToDeviceContextY (yy - m_doc->m_drawingDoubleUnit[ staff->staffSize ]); - int r = ToDeviceContextX( m_doc->m_drawingDoubleUnit[ staff->staffSize ] ); + int y = ToDeviceContextY (yy - m_doc->GetDrawingDoubleUnit( staff->staffSize )); + int r = ToDeviceContextX( m_doc->GetDrawingDoubleUnit( staff->staffSize ) ); // needs to be fixed x = ToDeviceContextX (x); @@ -271,8 +271,8 @@ void View::DrawMensurDot ( DeviceContext *dc, int x, int yy, Staff *staff ) assert( dc ); assert( staff ); - int y = ToDeviceContextY (yy - m_doc->m_drawingDoubleUnit[ staff->staffSize ] * 2); - int r = m_doc->m_drawingUnit[staff->staffSize] * 2 / 3; + int y = ToDeviceContextY (yy - m_doc->GetDrawingDoubleUnit( staff->staffSize ) * 2); + int r = m_doc->GetDrawingUnit(staff->staffSize) * 2 / 3; dc->SetPen( m_currentColour, 1, AxSOLID ); dc->SetBrush( m_currentColour, AxSOLID ); @@ -292,7 +292,7 @@ void View::DrawMensurSlash ( DeviceContext *dc, int a, int yy, Staff *staff ) assert( staff ); int y1 = yy; - int y2 = y1 - m_doc->m_drawingStaffSize[ staff->staffSize ]; + int y2 = y1 - m_doc->GetDrawingStaffSize( staff->staffSize ); DrawVerticalLine ( dc, y1, y2, a, m_doc->m_style->m_staffLineWidth); return; @@ -337,20 +337,20 @@ void View::DrawMaximaToBrevis( DeviceContext *dc, int y, LayerElement *element, // int yy2, y5; // unused int verticalCenter, up, height; - height = m_doc->m_drawingBeamWidth[staff->staffSize]/2 ; + height = m_doc->GetDrawingBeamWidth(staff->staffSize, false) / 2 ; xn = element->GetDrawingX(); // calcul des dimensions du rectangle - x1 = xn - m_doc->m_drawingBrevisWidth[staff->staffSize]; - x2 = xn + m_doc->m_drawingBrevisWidth[staff->staffSize]; + x1 = xn - m_doc->GetDrawingBrevisWidth( staff->staffSize ); + x2 = xn + m_doc->GetDrawingBrevisWidth( staff->staffSize ); if (note->GetActualDur() == DUR_MX) { - x1 -= m_doc->m_drawingBrevisWidth[staff->staffSize]; - x2 += m_doc->m_drawingBrevisWidth[staff->staffSize]; + x1 -= m_doc->GetDrawingBrevisWidth( staff->staffSize ); + x2 += m_doc->GetDrawingBrevisWidth( staff->staffSize ); } - y1 = y + m_doc->m_drawingUnit[staff->staffSize]; - y2 = y - m_doc->m_drawingUnit[staff->staffSize]; - y3 = (int)(y1 + m_doc->m_drawingUnit[staff->staffSize]/2); // partie d'encadrement qui depasse - y4 = (int)(y2 - m_doc->m_drawingUnit[staff->staffSize]/2); + y1 = y + m_doc->GetDrawingUnit(staff->staffSize); + y2 = y - m_doc->GetDrawingUnit(staff->staffSize); + y3 = (int)(y1 + m_doc->GetDrawingUnit(staff->staffSize)/2); // partie d'encadrement qui depasse + y4 = (int)(y2 - m_doc->GetDrawingUnit(staff->staffSize)/2); if (note->GetColored()!=BOOLEAN_true) { // double base des carrees @@ -367,7 +367,7 @@ void View::DrawMaximaToBrevis( DeviceContext *dc, int y, LayerElement *element, // stem if (note->GetActualDur() < DUR_BR) { - verticalCenter = staff->GetDrawingY() - m_doc->m_drawingDoubleUnit[staff->staffSize]*2; + verticalCenter = staff->GetDrawingY() - m_doc->GetDrawingDoubleUnit(staff->staffSize)*2; up = (y < verticalCenter) ? true : false; if ( note->m_drawingStemDir != STEMDIRECTION_NONE ) { if ( note->m_drawingStemDir == STEMDIRECTION_up) { @@ -379,11 +379,11 @@ void View::DrawMaximaToBrevis( DeviceContext *dc, int y, LayerElement *element, } if (!up) { - y3 = y1 - m_doc->m_drawingUnit[staff->staffSize]*8; + y3 = y1 - m_doc->GetDrawingUnit(staff->staffSize)*8; y2 = y1; } else { - y3 = y1 + m_doc->m_drawingUnit[staff->staffSize]*6; + y3 = y1 + m_doc->GetDrawingUnit(staff->staffSize)*6; y2 = y1; } DrawVerticalLine ( dc, y2,y3,x2, m_doc->m_style->m_stemWidth ); @@ -406,7 +406,7 @@ void View::DrawLigature ( DeviceContext *dc, int y, LayerElement *element, Layer // int yy2, y5; // unused int verticalCenter, up, epaisseur; - epaisseur = std::max (2, m_doc->m_drawingBeamWidth[staff->staffSize]/2); + epaisseur = std::max (2, m_doc->GetDrawingBeamWidth(staff->staffSize, false) / 2); xn = element->GetDrawingX(); /* @@ -420,11 +420,11 @@ void View::DrawLigature ( DeviceContext *dc, int y, LayerElement *element, Layer } // calcul des dimensions du rectangle - x1 = xn - m_doc->m_drawingBrevisWidth[staff->staffSize]; x2 = xn + m_doc->m_drawingBrevisWidth[staff->staffSize]; - y1 = y + m_doc->m_drawingUnit[staff->staffSize]; - y2 = y - m_doc->m_drawingUnit[staff->staffSize]; - y3 = (int)(y1 + m_doc->m_drawingUnit[staff->staffSize]/2); // partie d'encadrement qui depasse - y4 = (int)(y2 - m_doc->m_drawingUnit[staff->staffSize]/2); + x1 = xn - m_doc->GetDrawingBrevisWidth(staff->staffSize); x2 = xn + m_doc->GetDrawingBrevisWidth(staff->staffSize); + y1 = y + m_doc->GetDrawingUnit(staff->staffSize); + y2 = y - m_doc->GetDrawingUnit(staff->staffSize); + y3 = (int)(y1 + m_doc->GetDrawingUnit(staff->staffSize)/2); // partie d'encadrement qui depasse + y4 = (int)(y2 - m_doc->GetDrawingUnit(staff->staffSize)/2); //if (!note->m_ligObliqua && (!View::s_drawingLigObliqua)) // notes rectangulaires, y c. en ligature @@ -455,12 +455,12 @@ void View::DrawLigature ( DeviceContext *dc, int y, LayerElement *element, Layer { x1 -= m_doc->m_drawingBrevisWidth[staff->staffSize]*2; // avance auto - y1 = *View::s_drawingLigY - m_doc->m_drawingUnit[staff->staffSize]; // ligat_y contient y original + y1 = *View::s_drawingLigY - m_doc->GetDrawingUnit(staff->staffSize); // ligat_y contient y original yy2 = y2; - y5 = y1+ m_doc->m_drawingDoubleUnit[staff->staffSize]; y2 += m_doc->m_drawingDoubleUnit[staff->staffSize]; // on monte d'un INTERL + y5 = y1+ m_doc->GetDrawingDoubleUnit(staff->staffSize); y2 += m_doc->GetDrawingDoubleUnit(staff->staffSize); // on monte d'un INTERL if (note->GetColored()==BOOLEAN_true) - DrawObliquePolygon ( dc, x1, y1, x2, yy2, m_doc->m_drawingDoubleUnit[staff->staffSize]); + DrawObliquePolygon ( dc, x1, y1, x2, yy2, m_doc->GetDrawingDoubleUnit(staff->staffSize)); else { DrawObliquePolygon ( dc, x1, y1, x2, yy2, 5); DrawObliquePolygon ( dc, x1, y5, x2, y2, -5); @@ -484,7 +484,7 @@ void View::DrawLigature ( DeviceContext *dc, int y, LayerElement *element, Layer } - y3 = y2 - m_doc->m_drawingUnit[staff->staffSize]*6; + y3 = y2 - m_doc->GetDrawingUnit(staff->staffSize)*6; if (note->m_lig) { @@ -498,7 +498,7 @@ void View::DrawLigature ( DeviceContext *dc, int y, LayerElement *element, Layer } else if (note->m_dur == DUR_1) // && this->queue_lig ) // queue gauche haut // ax2 - no support of queue_lig { - y2 = y1 + m_doc->m_drawingUnit[staff->staffSize]*6; + y2 = y1 + m_doc->GetDrawingUnit(staff->staffSize)*6; DrawVerticalLine ( dc, y1, y2, x1, m_doc->m_style->m_stemWidth ); } } @@ -506,7 +506,7 @@ void View::DrawLigature ( DeviceContext *dc, int y, LayerElement *element, Layer */ if (note->GetActualDur() == DUR_LG) { - verticalCenter = staff->GetDrawingY() - m_doc->m_drawingDoubleUnit[staff->staffSize]*2; + verticalCenter = staff->GetDrawingY() - m_doc->GetDrawingDoubleUnit(staff->staffSize)*2; // ENZ up = (y < verticalCenter) ? ON : OFF; // ENZ @@ -521,11 +521,11 @@ void View::DrawLigature ( DeviceContext *dc, int y, LayerElement *element, Layer if (!up) { - y3 = y1 - m_doc->m_drawingUnit[staff->staffSize]*8; + y3 = y1 - m_doc->GetDrawingUnit(staff->staffSize)*8; y2 = y1; } else { - y3 = y1 + m_doc->m_drawingUnit[staff->staffSize]*6; + y3 = y1 + m_doc->GetDrawingUnit(staff->staffSize)*6; y2 = y1; } DrawVerticalLine ( dc, y2,y3,x2, m_doc->m_style->m_stemWidth ); diff --git a/src/view_page.cpp b/src/view_page.cpp index 8036d815611..b30ab0f27ab 100644 --- a/src/view_page.cpp +++ b/src/view_page.cpp @@ -302,7 +302,7 @@ void View::DrawStaffDefLabels( DeviceContext *dc, Measure *measure, ScoreDef *sc } int x = system->GetDrawingX() - 3 * m_doc->m_drawingBeamWidth[0]; - int y = staff->GetDrawingY() - (staffDef->GetLines() * m_doc->m_drawingDoubleUnit[staff->staffSize] / 2); + int y = staff->GetDrawingY() - (staffDef->GetLines() * m_doc->GetDrawingDoubleUnit(staff->staffSize) / 2); dc->SetBrush( m_currentColour, AxSOLID ); dc->SetFont( &m_doc->m_drawingLyricFonts[ 0 ] ); @@ -371,7 +371,7 @@ void View::DrawBrace ( DeviceContext *dc, int x, int y1, int y2, int staffSize) points[1].y = points[0].y - ToDeviceContextX( m_doc->m_drawingDoubleUnit[ staffSize ]*3); points[3].x = ToDeviceContextX(x - m_doc->m_drawingDoubleUnit[ staffSize ] ); points[3].y = ToDeviceContextY(ymed); - points[2].x = ToDeviceContextX(x + m_doc->m_drawingUnit[staffSize]); + points[2].x = ToDeviceContextX(x + m_doc->GetDrawingUnit(staffSize)); points[2].y = points[3].y + ToDeviceContextX( m_doc->m_drawingDoubleUnit[ staffSize ]); new_coords[0][0] = points[1].x; @@ -462,7 +462,7 @@ void View::DrawBarlines( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp } int y_top = staff->GetDrawingY(); // for the bottom position we need to take into account the number of lines and the staff size - int y_bottom = staff->GetDrawingY() - (childStaffDef->GetLines() - 1) * m_doc->m_drawingDoubleUnit[staff->staffSize]; + int y_bottom = staff->GetDrawingY() - (childStaffDef->GetLines() - 1) * m_doc->GetDrawingDoubleUnit(staff->staffSize); DrawBarline( dc, y_top, y_bottom, barLine ); if ( barLine->HasRepetitionDots() ) { DrawBarlineDots( dc, childStaffDef, staff, barLine ); @@ -582,8 +582,8 @@ void View::DrawBarlineDots ( DeviceContext *dc, StaffDef *staffDef, Staff *staff int x1 = x - 2 * m_doc->m_drawingBeamWidth[0] - m_doc->m_style->m_barlineWidth; int x2 = x + 2 * m_doc->m_drawingBeamWidth[0] + m_doc->m_style->m_barlineWidth; - int y_bottom = staff->GetDrawingY() - staffDef->GetLines() * m_doc->m_drawingUnit[staff->staffSize]; - int y_top = y_bottom + m_doc->m_drawingDoubleUnit[staff->staffSize]; + int y_bottom = staff->GetDrawingY() - staffDef->GetLines() * m_doc->GetDrawingUnit(staff->staffSize); + int y_top = y_bottom + m_doc->GetDrawingDoubleUnit(staff->staffSize); if ((barLine->GetRend() == BARRENDITION_rptstart) || (barLine->GetRend() == BARRENDITION_rptboth)) { @@ -645,16 +645,16 @@ int View::CalculatePitchPosY ( Staff *staff, data_PITCHNAME pname, int dec_clef, // Old Wolfgang code with octave stored in an unsigned char - this could be refactored oct -= OCTAVE_OFFSET; - y_int = ((dec_clef + oct*7) - 9 ) * m_doc->m_drawingUnit[staff->staffSize]; + y_int = ((dec_clef + oct*7) - 9 ) * m_doc->GetDrawingUnit(staff->staffSize); if (staff->m_drawingLines > 5) { - y_int -= ((staff->m_drawingLines - 5) * 2) * m_doc->m_drawingUnit[staff->staffSize]; + y_int -= ((staff->m_drawingLines - 5) * 2) * m_doc->GetDrawingUnit(staff->staffSize); } /* exprime distance separant m_drawingY de position 1e Si, corrigee par dec_clef et oct. Elle est additionnee ensuite, donc elle doit etre NEGATIVE si plus bas que m_drawingY */ for (i=0; i<(signed)sizeof(touches); i++) { - if (*(ptouche+i) == pname) return (y_int += ((i+1)*m_doc->m_drawingUnit[staff->staffSize])); + if (*(ptouche+i) == pname) return (y_int += ((i+1)*m_doc->GetDrawingUnit(staff->staffSize))); } return 0; } @@ -663,7 +663,7 @@ int View::CalculateRestPosY ( Staff *staff, char duration) { assert(staff); // Pointer to staff cannot be NULL" - int staff_space = m_doc->m_drawingUnit[staff->staffSize]; + int staff_space = m_doc->GetDrawingUnit(staff->staffSize); int base = -17 * staff_space; // -17 is a magic number copied from above int offset; @@ -740,7 +740,7 @@ void View::DrawStaffLines( DeviceContext *dc, Staff *staff, Measure *measure, Sy dc->DrawLine( ToDeviceContextX (x1) , ToDeviceContextY ( yy ) , ToDeviceContextX (x2) , ToDeviceContextY ( yy ) ); // For drawing rectangles insteam of line //DrawFullRectangle(dc, x1, yy - m_doc->m_style->m_barlineWidth / 2, x2, yy + m_doc->m_style->m_barlineWidth / 2 ); - yy -= m_doc->m_drawingDoubleUnit[staff->staffSize]; + yy -= m_doc->GetDrawingDoubleUnit(staff->staffSize); } staff->m_drawingHeight = staff->GetDrawingY() - yy; @@ -774,8 +774,8 @@ int View::CalculatePitchCode ( Layer *layer, int y_n, int x_pos, int *octave ) int staffSize = parentStaff->staffSize; // calculer position du do central en fonction clef - //y_n += (int) m_doc->m_drawingUnit[staffSize]/4; - yb = parentStaff->GetDrawingY() - m_doc->m_drawingStaffSize[staffSize]; // UT1 default + //y_n += (int) m_doc->GetDrawingUnit(staffSize)/4; + yb = parentStaff->GetDrawingY() - m_doc->GetDrawingStaffSize(staffSize); // UT1 default plafond = yb + 8 * m_doc->m_drawingOctaveSize[staffSize]; @@ -790,7 +790,7 @@ int View::CalculatePitchCode ( Layer *layer, int y_n, int x_pos, int *octave ) Clef *clef = layer->GetClef (pelement); if (clef) { clefId = clef->GetClefId(); - yb += (clef->GetClefOffset()) * m_doc->m_drawingUnit[staffSize]; // UT1 reel + yb += (clef->GetClefOffset()) * m_doc->GetDrawingUnit(staffSize); // UT1 reel } yb -= 4 * m_doc->m_drawingOctaveSize[staffSize]; // UT, note la plus grave @@ -799,7 +799,7 @@ int View::CalculatePitchCode ( Layer *layer, int y_n, int x_pos, int *octave ) if (y_dec< 0) y_dec = 0; - degres = y_dec / m_doc->m_drawingUnit[staffSize]; // ecart en degres (PITCHNAME_c..PITCHNAME_b) par rapport a UT1 + degres = y_dec / m_doc->GetDrawingUnit(staffSize); // ecart en degres (PITCHNAME_c..PITCHNAME_b) par rapport a UT1 octaves = degres / 7; position = degres % 7; From ac3e82e1dab995318d2e4a57bc0fa5b72f62c98f Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Tue, 18 Aug 2015 21:27:05 +0200 Subject: [PATCH 070/114] Removing fixed drawing fixed Doc member variables (done) --- include/vrv/doc.h | 4 -- include/vrv/view.h | 4 +- src/doc.cpp | 113 +++++++++++++++++++++++++------------------ src/object.cpp | 18 +++---- src/staff.cpp | 2 +- src/view_beam.cpp | 4 +- src/view_element.cpp | 60 ++++++++++------------- src/view_page.cpp | 58 +++++++++++----------- src/view_tuplet.cpp | 8 +-- 9 files changed, 139 insertions(+), 132 deletions(-) diff --git a/include/vrv/doc.h b/include/vrv/doc.h index b84b8f31bf5..d8cd306c916 100644 --- a/include/vrv/doc.h +++ b/include/vrv/doc.h @@ -279,10 +279,6 @@ class Doc: public Object FontInfo m_drawingSmuflFont; /** Current lyric font */ FontInfo m_drawingLyricFont; - - /** Accident width/height and normal and grace size */ - int m_drawingAccidWidth[2][2]; - int m_drawingAccidHeight[2][2]; /** The current page height */ int m_drawingPageHeight; diff --git a/include/vrv/view.h b/include/vrv/view.h index 6b522e38944..acc82acf2ae 100644 --- a/include/vrv/view.h +++ b/include/vrv/view.h @@ -238,10 +238,10 @@ class View void DrawLedgerLines ( DeviceContext *dc, LayerElement *element, Staff *staff, bool aboveStaff, bool doubleLength, int skip, int n); void DrawLongRest ( DeviceContext *dc, int x, int y, Staff *staff); void DrawMeterSigFigures( DeviceContext *dc, int x, int y, int num, int numBase, Staff *staff); - void DrawQuarterRest ( DeviceContext *dc, int x, int y, int valeur, unsigned char dots, unsigned int smaller, Staff *staff); + void DrawQuarterRest ( DeviceContext *dc, int x, int y, int valeur, unsigned char dots, bool cueSize, Staff *staff); void DrawStem( DeviceContext *dc, LayerElement *object, Staff *staff, data_STEMDIRECTION dir, int radius, int xn, int originY, int heightY = 0); void DrawTrill(DeviceContext *dc, LayerElement *element, Staff *staff ); - void DrawWholeRest ( DeviceContext *dc, int x, int y, int valeur, unsigned char dots, unsigned int smaller, Staff *staff); + void DrawWholeRest ( DeviceContext *dc, int x, int y, int valeur, unsigned char dots, bool cueSize, Staff *staff); ///@} /** diff --git a/src/doc.cpp b/src/doc.cpp index e592e59ceeb..416a16bee1f 100644 --- a/src/doc.cpp +++ b/src/doc.cpp @@ -401,6 +401,7 @@ int Doc::GetGlyphHeight( wchar_t smuflCode, int staffSize, bool graceSize ) glyph->GetBoundingBox( &x, &y, &w, &h ); h = h * m_drawingSmuflFontSize / glyph->GetUnitsPerEm(); if ( graceSize ) h = h * this->m_style->m_graceNum / this->m_style->m_graceDen; + h = h * staffSize / 100; return h; } @@ -413,8 +414,62 @@ int Doc::GetGlyphWidth( wchar_t smuflCode, int staffSize, bool graceSize ) glyph->GetBoundingBox( &x, &y, &w, &h ); w = w * m_drawingSmuflFontSize / glyph->GetUnitsPerEm(); if ( graceSize ) w = w * this->m_style->m_graceNum / this->m_style->m_graceDen; + w = w * staffSize / 100; return w; } + +int Doc::GetDrawingUnit( int staffSize ) +{ + return m_drawingUnit * staffSize / 100; +} +int Doc::GetDrawingDoubleUnit( int staffSize ) +{ + return m_drawingDoubleUnit * staffSize / 100; +} +int Doc::GetDrawingStaffSize( int staffSize ) +{ + return m_drawingStaffSize * staffSize / 100; + +} +int Doc::GetDrawingOctaveSize( int staffSize ) +{ + return m_drawingOctaveSize * staffSize / 100; +} +int Doc::GetDrawingBrevisWidth( int staffSize ) +{ + return m_drawingBrevisWidth * staffSize / 100; +} +int Doc::GetDrawingBeamWidth( int staffSize, bool graceSize ) +{ + int value = m_drawingBeamWidth * staffSize / 100; + if ( graceSize ) value = value * this->m_style->m_graceNum / this->m_style->m_graceDen; + return value; +} +int Doc::GetDrawingBeamWhiteWidth( int staffSize, bool graceSize ) +{ + int value = m_drawingBeamWhiteWidth * staffSize / 100; + if ( graceSize ) value = value * this->m_style->m_graceNum / this->m_style->m_graceDen; + return value; +} +int Doc::GetDrawingLedgerLineLength( int staffSize, bool graceSize ) +{ + int value = m_drawingLedgerLine * staffSize / 100; + if ( graceSize ) value = value * this->m_style->m_graceNum / this->m_style->m_graceDen; + return value; +} + +FontInfo *Doc::GetDrawingSmuflFont( int staffSize, bool graceSize ) +{ + int value = m_drawingSmuflFontSize * staffSize / 100; + if ( graceSize ) value = value * this->m_style->m_graceNum / this->m_style->m_graceDen; + m_drawingSmuflFont.SetPointSize( value ); + return &m_drawingSmuflFont; +} + FontInfo *Doc::GetDrawingLyricFont( int staffSize ) +{ + m_drawingLyricFont.SetPointSize( m_drawingLyricFontSize * staffSize / 100 ); + return &m_drawingLyricFont; +} char Doc::GetLeftMargin( const ClassId classId ) { @@ -490,6 +545,8 @@ Page *Doc::SetDrawingPage( int pageIdx ) m_drawingPage = dynamic_cast(this->GetChild( pageIdx ) ); assert( m_drawingPage ); + int glyph_size; + // we use the page members only if set (!= -1) if ( m_drawingPage->m_pageHeight != -1 ) { @@ -535,69 +592,31 @@ Page *Doc::SetDrawingPage( int pageIdx ) m_drawingBeamMaxSlope /= 100; m_drawingBeamMinSlope /= 100; - /* - m_drawingSmallStaffRatio[0] = this->m_style->m_smallStaffNum; - m_drawingSmallStaffRatio[1] = this->m_style->m_smallStaffDen; - m_drawingGraceRatio[0] = this->m_style->m_graceNum; - m_drawingGraceRatio[1] = this->m_style->m_graceDen; - */ - // half of the space between two lines m_drawingUnit = m_style->m_unit; // space between two lines m_drawingDoubleUnit = m_drawingUnit * 2; // staff (with five lines) m_drawingStaffSize = m_drawingDoubleUnit * 4; - // + // octave height m_drawingOctaveSize = m_drawingUnit * 7; + // measure minimal width + m_drawingMinMeasureWidth = m_drawingUnit * m_style->m_minMeasureWidth / PARAM_DENOMINATOR ; // values for beams m_drawingBeamWidth = this->m_style->m_unit; m_drawingBeamWhiteWidth = this->m_style->m_unit / 2; + // values for fonts m_drawingSmuflFontSize = CalcMusicFontSize(); m_drawingLyricFontSize = m_drawingUnit * m_style->m_lyricSize / PARAM_DENOMINATOR; - - //m_drawingSmuflFonts[0][0].SetPointSize( m_drawingFontHeight ); - - m_drawingMinMeasureWidth = m_drawingUnit * m_style->m_minMeasureWidth / PARAM_DENOMINATOR ; - - int glyph_size; - Glyph *glyph; - int x, y, w, h; - glyph = Resources::GetGlyph(SMUFL_E0A3_noteheadHalf); - assert( glyph ); - glyph->GetBoundingBox( &x, &y, &w, &h ); - glyph_size = w * m_drawingSmuflFontSize / glyph->GetUnitsPerEm(); + glyph_size = GetGlyphWidth(SMUFL_E0A3_noteheadHalf, 100, 0); + m_drawingLedgerLine = glyph_size * 72 / 100; - m_drawingLedgerLine = glyph_size * 100 / 72; - - /* - glyph = Resources::GetGlyph(SMUFL_E0A2_noteheadWhole); - assert( glyph ); - glyph->GetBoundingBox( &x, &y, &w, &h ); - glyph_size = round((double)w * (double)m_drawingFontHeight / (double)glyph->GetUnitsPerEm()); - m_drawingLedgerLine[0][2] = (int)(glyph_size * .66); - m_drawingLedgerLine[1][2] = (m_drawingLedgerLine[0][2] * m_drawingSmallStaffRatio[0]) /m_drawingSmallStaffRatio[1]; - - m_drawingBrevisWidth[0] = (int)((glyph_size * 0.8) / 2); - m_drawingBrevisWidth[1] = (m_drawingBrevisWidth[0] * m_drawingSmallStaffRatio[0]) /m_drawingSmallStaffRatio[1]; - - glyph = Resources::GetGlyph(SMUFL_E262_accidentalSharp); - assert( glyph ); - glyph->GetBoundingBox( &x, &y, &w, &h ); - glyph_size = round((double)w * (double)m_drawingFontHeight / (double)glyph->GetUnitsPerEm()); - m_drawingAccidWidth[0][0] = glyph_size; - m_drawingAccidWidth[0][1] = (m_drawingAccidWidth[0][0] * m_drawingGraceRatio[0])/m_drawingGraceRatio[1]; - m_drawingAccidWidth[1][0] = (m_drawingAccidWidth[0][0] * m_drawingSmallStaffRatio[0]) /m_drawingSmallStaffRatio[1]; - m_drawingAccidWidth[1][1] = (m_drawingAccidWidth[1][0] * m_drawingGraceRatio[0])/m_drawingGraceRatio[1]; - glyph_size = round((double)h * (double)m_drawingFontHeight / (double)glyph->GetUnitsPerEm()); - m_drawingAccidHeight[0][0] = glyph_size; - m_drawingAccidHeight[0][1] = (m_drawingAccidHeight[0][0] * m_drawingGraceRatio[0])/m_drawingGraceRatio[1]; - m_drawingAccidHeight[1][0] = (m_drawingAccidHeight[0][0] * m_drawingSmallStaffRatio[0]) /m_drawingSmallStaffRatio[1]; - m_drawingAccidHeight[1][1] = (m_drawingAccidHeight[1][0] * m_drawingGraceRatio[0])/m_drawingGraceRatio[1]; - */ + glyph_size = GetGlyphWidth(SMUFL_E0A2_noteheadWhole, 100, 0); + + m_drawingBrevisWidth = (int)((glyph_size * 0.8) / 2); return m_drawingPage; } diff --git a/src/object.cpp b/src/object.cpp index d334413f922..504df50e13e 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -1106,10 +1106,10 @@ int Object::SetBoundingBoxGraceXShift( ArrayPtrVoid *params ) // the negative offset it the part of the bounding box that overflows on the left // |____x_____| // ---- = negative offset - //int negative_offset = - (note->m_contentBB_x1) + (doc->GetLeftMargin(&typeid(*note)) * doc->m_drawingUnit[0] / PARAM_DENOMINATOR); + //int negative_offset = - (note->m_contentBB_x1) + (doc->GetLeftMargin(&typeid(*note)) * doc->GetDrawingUnit(100) / PARAM_DENOMINATOR); int negative_offset = - note->m_contentBB_x1; if ( (*min_pos) > 0 ) { - //(*min_pos) += (doc->GetLeftMargin(&typeid(*note)) * doc->m_drawingUnit[0] / PARAM_DENOMINATOR); + //(*min_pos) += (doc->GetLeftMargin(&typeid(*note)) * doc->GetDrawingUnit(100) / PARAM_DENOMINATOR); } // this should never happen (but can with glyphs not exactly registered at position x=0 in the SMuFL font used @@ -1123,9 +1123,9 @@ int Object::SetBoundingBoxGraceXShift( ArrayPtrVoid *params ) } // the next minimal position if given by the right side of the bounding box + the spacing of the element - (*min_pos) = note->GetGraceAlignment()->GetXRel() + note->m_contentBB_x2 + doc->GetRightMargin( NOTE ) * doc->m_drawingUnit[0] / PARAM_DENOMINATOR; + (*min_pos) = note->GetGraceAlignment()->GetXRel() + note->m_contentBB_x2 + doc->GetRightMargin( NOTE ) * doc->GetDrawingUnit(100) / PARAM_DENOMINATOR; //(*min_pos) = note->GetGraceAlignment()->GetXRel() + note->m_contentBB_x2; - //note->GetGraceAlignment()->SetMaxWidth( note->m_contentBB_x2 + doc->GetRightMargin(&typeid(*note)) * doc->m_drawingUnit[0] / PARAM_DENOMINATOR ); + //note->GetGraceAlignment()->SetMaxWidth( note->m_contentBB_x2 + doc->GetRightMargin(&typeid(*note)) * doc->GetDrawingUnit(100) / PARAM_DENOMINATOR ); note->GetGraceAlignment()->SetMaxWidth( note->m_contentBB_x2 ); return FUNCTOR_CONTINUE; @@ -1159,7 +1159,7 @@ int Object::SetBoundingBoxXShift( ArrayPtrVoid *params ) Layer *current_layer = dynamic_cast(this); assert( current_layer ); // reset it as the minimum position to the step (HARDCODED) - (*min_pos) = 30 * doc->m_drawingUnit[0] / 10; + (*min_pos) = 30 * doc->GetDrawingUnit(100) / 10; // set scoreDef attr if (current_layer->GetDrawingClef()) { current_layer->GetDrawingClef()->SetBoundingBoxXShift( params ); @@ -1219,14 +1219,14 @@ int Object::SetBoundingBoxXShift( ArrayPtrVoid *params ) // |____x_____| // ---- = negative offset int negative_offset = - (current->m_contentBB_x1); - if (!current->IsGraceNote()) negative_offset += (doc->GetLeftMargin( current->Is() ) * doc->m_drawingUnit[0] / PARAM_DENOMINATOR); + if (!current->IsGraceNote()) negative_offset += (doc->GetLeftMargin( current->Is() ) * doc->GetDrawingUnit(100) / PARAM_DENOMINATOR); // this should never happen (but can with glyphs not exactly registered at position x=0 in the SMuFL font used if ( negative_offset < 0 ) negative_offset = 0; if (current->Is() == MREST) { // With MRest, the only thing we want to do it keep their with as possible measure with (if only MRest in all staves/layers) - int width = current->m_contentBB_x2 + doc->GetRightMargin( current->Is() ) * doc->m_drawingUnit[0] / PARAM_DENOMINATOR + negative_offset ; + int width = current->m_contentBB_x2 + doc->GetRightMargin( current->Is() ) * doc->GetDrawingUnit(100) / PARAM_DENOMINATOR + negative_offset ; // Keep it if more than the current measure width (*measure_width) = std::max( (*measure_width), width ); (*min_pos) = 0; @@ -1261,8 +1261,8 @@ int Object::SetBoundingBoxXShift( ArrayPtrVoid *params ) } // the next minimal position if given by the right side of the bounding box + the spacing of the element - (*min_pos) = current->GetAlignment()->GetXRel() + current->m_contentBB_x2 + doc->GetRightMargin( current->Is() ) * doc->m_drawingUnit[0] / PARAM_DENOMINATOR; - current->GetAlignment()->SetMaxWidth( current->m_contentBB_x2 + doc->GetRightMargin( current->Is() ) * doc->m_drawingUnit[0] / PARAM_DENOMINATOR ); + (*min_pos) = current->GetAlignment()->GetXRel() + current->m_contentBB_x2 + doc->GetRightMargin( current->Is() ) * doc->GetDrawingUnit(100) / PARAM_DENOMINATOR; + current->GetAlignment()->SetMaxWidth( current->m_contentBB_x2 + doc->GetRightMargin( current->Is() ) * doc->GetDrawingUnit(100) / PARAM_DENOMINATOR ); return FUNCTOR_CONTINUE; } diff --git a/src/staff.cpp b/src/staff.cpp index 578c43f107d..b9cf411cebf 100644 --- a/src/staff.cpp +++ b/src/staff.cpp @@ -48,7 +48,7 @@ void Staff::Reset() notAnc = false; // LP we want modern notation :)) grise = false; invisible = false; - staffSize = 0; + staffSize = 100; m_drawingLines = 5; m_yAbs = VRV_UNSET; m_drawingY = 0; diff --git a/src/view_beam.cpp b/src/view_beam.cpp index ce963e2810c..bcbb03f4ace 100644 --- a/src/view_beam.cpp +++ b/src/view_beam.cpp @@ -112,8 +112,8 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta lastDur = dynamic_cast(current)->GetActualDur(); // x-offset values for stem bases, dx[y] where y = element->m_cueSize - dx[0] = m_doc->GetGlyphWidth(SMUFL_E0A3_noteheadHalf, staff->staffSize, false) - (m_doc->m_style->m_stemWidth)/2; - dx[1] = m_doc->GetGlyphWidth(SMUFL_E0A3_noteheadHalf, staff->staffSize, true) - (m_doc->m_style->m_stemWidth)/2; + dx[0] = m_doc->GetGlyphWidth(SMUFL_E0A3_noteheadHalf, staff->staffSize, false) / 2 - (m_doc->m_style->m_stemWidth)/2; + dx[1] = m_doc->GetGlyphWidth(SMUFL_E0A3_noteheadHalf, staff->staffSize, true) / 2 - (m_doc->m_style->m_stemWidth)/2; /******************************************************************/ // Populate BeamElementCoord for each element in the beam diff --git a/src/view_element.cpp b/src/view_element.cpp index 8a42f35ff80..cd889ae592b 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -389,7 +389,7 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St if (note->m_drawingAccid) { xAccid = xNote; if (note->m_drawingAccid->GetFunc() != FUNC_edit) { - xAccid -= 1.5 * m_doc->m_drawingAccidWidth[staffSize][drawingCueSize]; + xAccid -= 1.5 * m_doc->GetGlyphWidth(SMUFL_E262_accidentalSharp, staffSize, drawingCueSize); } note->m_drawingAccid->SetDrawingX( xAccid ); @@ -700,7 +700,7 @@ void View::DrawMultiRest(DeviceContext *dc, LayerElement *element, Layer *layer, // convert to string std::wstring wtext = IntToTimeSigFigures(multirest->GetNum()); - dc->SetFont(&m_doc->m_drawingSmuflFonts[staff->staffSize][0]); + dc->SetFont(m_doc->GetDrawingSmuflFont(staff->staffSize, false)); dc->GetSmuflTextExtent( wtext, &w, &h); start_offset = (x2 - x1 - w) / 2; // calculate offset to center text DrawSmuflString(dc, x1 + start_offset, staff->GetDrawingY() + 5, wtext, false); @@ -753,23 +753,13 @@ void View::DrawBreveRest ( DeviceContext *dc, int x, int y, Staff *staff) return; } -void View::DrawWholeRest ( DeviceContext *dc, int x, int y, int valeur, unsigned char dots, unsigned int smaller, Staff *staff) +void View::DrawWholeRest ( DeviceContext *dc, int x, int y, int valeur, unsigned char dots, bool cueSize, Staff *staff) { int x1, x2, y1, y2, vertic; y1 = y; vertic = m_doc->GetDrawingUnit(staff->staffSize); - int off; - float foff; - - if (staff->notAnc) - foff = (m_doc->GetDrawingUnit(staff->staffSize) *1 / 3); - else - foff = (m_doc->m_drawingLedgerLine[staff->staffSize][2] * 2) / 3; // i.e., la moitie de la ronde - - if (smaller) - foff *= (int)( (float)m_doc->m_drawingGraceRatio[0] / (float)m_doc->m_drawingGraceRatio[1] ); - off = (int)foff; + int off = m_doc->GetDrawingLedgerLineLength(staff->staffSize, cueSize) * 2 / 3; // i.e., la moitie de la ronde x1 = x - off; x2 = x + off; @@ -794,7 +784,7 @@ void View::DrawWholeRest ( DeviceContext *dc, int x, int y, int valeur, unsigned x2 += off; // legder line - if (y > (int)staff->GetDrawingY() || y < staff->GetDrawingY() - m_doc->m_drawingStaffSize[staff->staffSize]) + if (y > (int)staff->GetDrawingY() || y < staff->GetDrawingY() - m_doc->GetDrawingStaffSize(staff->staffSize)) DrawHorizontalLine ( dc, x1, x2, y1, m_doc->m_style->m_staffLineWidth); if (dots) @@ -802,10 +792,10 @@ void View::DrawWholeRest ( DeviceContext *dc, int x, int y, int valeur, unsigned } -void View::DrawQuarterRest ( DeviceContext *dc, int x, int y, int valeur, unsigned char dots, unsigned int smaller, Staff *staff) +void View::DrawQuarterRest ( DeviceContext *dc, int x, int y, int valeur, unsigned char dots, bool cueSize, Staff *staff) { int y2 = y + m_doc->GetDrawingDoubleUnit(staff->staffSize); - DrawSmuflCode( dc, x, y2, SMUFL_E4E5_restQuarter + (valeur-DUR_4), staff->staffSize, smaller ); + DrawSmuflCode( dc, x, y2, SMUFL_E4E5_restQuarter + (valeur-DUR_4), staff->staffSize, cueSize ); if (dots) { if (valeur < DUR_16) @@ -888,7 +878,7 @@ void View::DrawBarline( DeviceContext *dc, LayerElement *element, Layer *layer, dc->StartGraphic( element, "", element->GetUuid() ); int y = staff->GetDrawingY(); - DrawBarline( dc, y, y - m_doc->m_drawingStaffSize[staff->staffSize], barLine ); + DrawBarline( dc, y, y - m_doc->GetDrawingStaffSize(staff->staffSize), barLine ); dc->EndGraphic(element, this ); } @@ -1131,50 +1121,50 @@ void View::DrawClef( DeviceContext *dc, LayerElement *element, Layer *layer, Sta { case C1 : sym = SMUFL_E05C_cClef; - b -= m_doc->m_drawingStaffSize[ staff->staffSize ]; + b -= m_doc->GetDrawingStaffSize(staff->staffSize); break; case G1 : - b -= m_doc->m_drawingStaffSize[ staff->staffSize ]; + b -= m_doc->GetDrawingStaffSize(staff->staffSize); break; case G2_8va : sym = SMUFL_E053_gClef8va; - b -= m_doc->GetDrawingDoubleUnit( staff->staffSize )*3; + b -= m_doc->GetDrawingDoubleUnit(staff->staffSize) * 3; break; case G2_8vb : sym = SMUFL_E052_gClef8vb; - b -= m_doc->GetDrawingDoubleUnit( staff->staffSize )*3; + b -= m_doc->GetDrawingDoubleUnit(staff->staffSize) * 3; break; case C2 : sym = SMUFL_E05C_cClef; - b -= m_doc->GetDrawingDoubleUnit( staff->staffSize )*3; + b -= m_doc->GetDrawingDoubleUnit(staff->staffSize) * 3; break; case G2 : - b -= m_doc->GetDrawingDoubleUnit( staff->staffSize )*3; + b -= m_doc->GetDrawingDoubleUnit(staff->staffSize) * 3; break; case F3 : sym = SMUFL_E062_fClef; - b -= m_doc->GetDrawingDoubleUnit( staff->staffSize )*2; + b -= m_doc->GetDrawingDoubleUnit(staff->staffSize)*2; break; case C3 : sym = SMUFL_E05C_cClef; - b -= m_doc->GetDrawingDoubleUnit( staff->staffSize )*2; + b -= m_doc->GetDrawingDoubleUnit(staff->staffSize)*2; break; case F5 : sym =SMUFL_E062_fClef; break; case F4 : sym = SMUFL_E062_fClef; - b -= m_doc->GetDrawingDoubleUnit( staff->staffSize ); + b -= m_doc->GetDrawingDoubleUnit(staff->staffSize); break; case C4 : sym = SMUFL_E05C_cClef; - b -= m_doc->GetDrawingDoubleUnit( staff->staffSize ); + b -= m_doc->GetDrawingDoubleUnit(staff->staffSize); break; case C5 : sym = SMUFL_E05C_cClef; break; case perc : - b -= m_doc->GetDrawingDoubleUnit( staff->staffSize )*2; + b -= m_doc->GetDrawingDoubleUnit(staff->staffSize) * 2; // FIXME sym = SMUFL_E05C_cClef; break; @@ -1214,7 +1204,7 @@ void View::DrawMeterSigFigures( DeviceContext *dc, int x, int y, int num, int nu x += m_doc->GetDrawingUnit(staff->staffSize) * 2; } - dc->SetFont( &m_doc->m_drawingSmuflFonts[staff->staffSize][0] ); + dc->SetFont(m_doc->GetDrawingSmuflFont(staff->staffSize, false)); wtext = IntToTimeSigFigures(num); DrawSmuflString ( dc, x, ynum, wtext, 1, staff->staffSize); // '1' = centrer @@ -1243,7 +1233,7 @@ void View::DrawMeterSig( DeviceContext *dc, LayerElement *element, Layer *layer, dc->StartGraphic( element, "", element->GetUuid() ); - int y = staff->GetDrawingY() - (m_doc->m_drawingUnit[ staff->staffSize ]*4); + int y = staff->GetDrawingY() - (m_doc->GetDrawingUnit(staff->staffSize) * 4); int x = element->GetDrawingX(); if ( meterSig->GetSym() == METERSIGN_common ) { @@ -1629,12 +1619,12 @@ void View::DrawSyl( DeviceContext *dc, LayerElement *element, Layer *layer, Staf FontInfo currentFont; if (syl->HasFontstyle()) { - currentFont = m_doc->GetDrawingLyricFonts( staff->staffSize ); + currentFont = *m_doc->GetDrawingLyricFont(staff->staffSize); currentFont.SetStyle(syl->GetFontstyle()); dc->SetFont(¤tFont); } else { - dc->SetFont( &m_doc->GetDrawingLyricFonts( staff->staffSize ) ); + dc->SetFont( m_doc->GetDrawingLyricFont(staff->staffSize) ); } DrawLyricString(dc, syl->GetDrawingX(), syl->GetDrawingY(), syl->GetText().c_str(), staff->staffSize ); @@ -1702,7 +1692,7 @@ void View::DrawKeySig( DeviceContext *dc, LayerElement *element, Layer *layer, S x = element->GetDrawingX(); // HARDCODED - int step = m_doc->m_drawingAccidWidth[staff->staffSize][0] * 1.3; + int step = m_doc->GetGlyphWidth(SMUFL_E262_accidentalSharp, staff->staffSize, false) * 1.3; // Show cancellation if C major (0) or if any cancellation and show cancellation (showchange) is true (false by default) if ( (keySig->GetAlterationNumber() == 0) || (layer->DrawKeySigCancellation() && keySig->m_drawingShowchange) ) { @@ -1839,7 +1829,7 @@ void View::DrawTrill(DeviceContext *dc, LayerElement *element, Staff *staff) int x, y; // It shoud be moved according to half of the trill size - x = element->GetDrawingX() - m_doc->m_drawingAccidWidth[staff->staffSize][false]; + x = element->GetDrawingX() - m_doc->GetGlyphWidth(SMUFL_E566_ornamentTrill, staff->staffSize, false); // HARDCODED if ((element->GetDrawingY()) < staff->GetDrawingY()) diff --git a/src/view_page.cpp b/src/view_page.cpp index b30ab0f27ab..5e2c434474c 100644 --- a/src/view_page.cpp +++ b/src/view_page.cpp @@ -120,8 +120,8 @@ void View::DrawSystem( DeviceContext *dc, System *system ) // This needs to be improved because we are now using (tuplet) oblique figures. // We should also have a better way to specify if the number has to be displayed or not if ( (measure->GetN() != VRV_UNSET) && (measure->GetN() > 1) ) { - dc->SetFont( &m_doc->m_drawingSmuflFonts[0][0] ); - dc->DrawMusicText( IntToTupletFigures( measure->GetN() ) , ToDeviceContextX(system->GetDrawingX()), ToDeviceContextY(system->GetDrawingY() - m_doc->GetSpacingStaff() * m_doc->m_drawingUnit[0]) ); + dc->SetFont( m_doc->GetDrawingSmuflFont( 100, false) ); + dc->DrawMusicText( IntToTupletFigures( measure->GetN() ) , ToDeviceContextX(system->GetDrawingX()), ToDeviceContextY(system->GetDrawingY() - m_doc->GetSpacingStaff() * m_doc->GetDrawingUnit(100)) ); dc->ResetFont(); } } @@ -228,7 +228,7 @@ void View::DrawStaffGrp( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp int y_top = first->GetDrawingY(); // for the bottom position we need to take into account the number of lines and the staff size - int y_bottom = last->GetDrawingY() - (lastDef->GetLines() - 1) * m_doc->m_drawingDoubleUnit[last->staffSize]; + int y_bottom = last->GetDrawingY() - (lastDef->GetLines() - 1) * m_doc->GetDrawingDoubleUnit(last->staffSize); // ajdust the top and bottom according to staffline width y_top += m_doc->m_style->m_staffLineWidth / 2; @@ -247,7 +247,7 @@ void View::DrawStaffGrp( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp } else if ( staffGrp->GetSymbol() == STAFFGRP_BRACKET ) { DrawBracket( dc, x, y_top, y_bottom, last->staffSize ); - x -= 2 * m_doc->m_drawingBeamWidth[0] - m_doc->m_drawingBeamWhiteWidth[0]; + x -= 2 * m_doc->GetDrawingBeamWidth(100, false) - m_doc->GetDrawingBeamWhiteWidth(100, false); } // recursively draw the children @@ -301,11 +301,11 @@ void View::DrawStaffDefLabels( DeviceContext *dc, Measure *measure, ScoreDef *sc continue; } - int x = system->GetDrawingX() - 3 * m_doc->m_drawingBeamWidth[0]; + int x = system->GetDrawingX() - 3 * m_doc->GetDrawingBeamWidth(100, false); int y = staff->GetDrawingY() - (staffDef->GetLines() * m_doc->GetDrawingDoubleUnit(staff->staffSize) / 2); dc->SetBrush( m_currentColour, AxSOLID ); - dc->SetFont( &m_doc->m_drawingLyricFonts[ 0 ] ); + dc->SetFont(m_doc->GetDrawingLyricFont(100)); // keep the widest width for the system dc->GetTextExtent( label, &w, &h); @@ -329,8 +329,8 @@ void View::DrawBracket ( DeviceContext *dc, int x, int y1, int y2, int staffSize int x1, x2; - x2 = x - m_doc->m_drawingBeamWidth[0]; - x1 = x2 - m_doc->m_drawingBeamWidth[0]; + x2 = x - m_doc->GetDrawingBeamWidth(100, false); + x1 = x2 - m_doc->GetDrawingBeamWidth(100, false); DrawSmuflCode( dc, x1, y1,SMUFL_E003_bracketTop, staffSize, false ); DrawSmuflCode( dc, x1, y2,SMUFL_E004_bracketBottom, staffSize, false ); @@ -359,20 +359,20 @@ void View::DrawBrace ( DeviceContext *dc, int x, int y1, int y2, int staffSize) int ymed, xdec, fact; - x -= m_doc->m_drawingBeamWhiteWidth[ staffSize ]; // distance entre barre et debut accolade + x -= m_doc->GetDrawingBeamWhiteWidth(staffSize, false); // distance entre barre et debut accolade ymed = (y1 + y2) / 2; - fact = m_doc->m_drawingBeamWidth[ staffSize ] + m_doc->m_style->m_stemWidth; + fact = m_doc->GetDrawingBeamWhiteWidth(staffSize, false) + m_doc->m_style->m_stemWidth; xdec = ToDeviceContextX(fact); points[0].x = ToDeviceContextX(x); points[0].y = ToDeviceContextY(y1); - points[1].x = ToDeviceContextX(x - m_doc->m_drawingDoubleUnit[ staffSize ]*2); - points[1].y = points[0].y - ToDeviceContextX( m_doc->m_drawingDoubleUnit[ staffSize ]*3); - points[3].x = ToDeviceContextX(x - m_doc->m_drawingDoubleUnit[ staffSize ] ); + points[1].x = ToDeviceContextX(x - m_doc->GetDrawingDoubleUnit(staffSize) * 2); + points[1].y = points[0].y - ToDeviceContextX( m_doc->GetDrawingDoubleUnit(staffSize) * 3); + points[3].x = ToDeviceContextX(x - m_doc->GetDrawingDoubleUnit(staffSize) ); points[3].y = ToDeviceContextY(ymed); points[2].x = ToDeviceContextX(x + m_doc->GetDrawingUnit(staffSize)); - points[2].y = points[3].y + ToDeviceContextX( m_doc->m_drawingDoubleUnit[ staffSize ]); + points[2].y = points[3].y + ToDeviceContextX( m_doc->GetDrawingDoubleUnit(staffSize)); new_coords[0][0] = points[1].x; new_coords[0][1] = points[1].y; @@ -386,7 +386,7 @@ void View::DrawBrace ( DeviceContext *dc, int x, int y1, int y2, int staffSize) points[1].x += xdec; points[2].x += xdec; - points[1].y = points[0].y + ToDeviceContextX( m_doc->m_drawingDoubleUnit[ staffSize ]*2); + points[1].y = points[0].y + ToDeviceContextX( m_doc->GetDrawingDoubleUnit(staffSize) * 2); new_coords[1][0] = points[1].x; new_coords[1][1] = points[1].y; @@ -401,9 +401,9 @@ void View::DrawBrace ( DeviceContext *dc, int x, int y1, int y2, int staffSize) dc->DrawComplexBezierPath(ToDeviceContextX(x), ToDeviceContextY(y1), new_coords[0], new_coords[1]); // on produit l'image reflet vers le bas: 0 est identique - points[1].y = points[0].y - ToDeviceContextX( m_doc->m_drawingDoubleUnit[ staffSize ]*2); + points[1].y = points[0].y - ToDeviceContextX( m_doc->GetDrawingDoubleUnit(staffSize)*2); points[3].y = ToDeviceContextY(y2); - points[2].y = points[3].y + ToDeviceContextX( m_doc->m_drawingDoubleUnit[ staffSize ]*3); + points[2].y = points[3].y + ToDeviceContextX( m_doc->GetDrawingDoubleUnit(staffSize)*3); new_coords[0][0] = points[1].x; new_coords[0][1] = points[1].y; @@ -417,7 +417,7 @@ void View::DrawBrace ( DeviceContext *dc, int x, int y1, int y2, int staffSize) points[1].x -= xdec; points[2].x -= xdec; - points[2].y = points[3].y - ToDeviceContextX( m_doc->m_drawingDoubleUnit[ staffSize ]); + points[2].y = points[3].y - ToDeviceContextX( m_doc->GetDrawingDoubleUnit(staffSize)); new_coords[1][0] = points[1].x; new_coords[1][1] = points[1].y; @@ -499,7 +499,7 @@ void View::DrawBarlines( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp int y_top = first->GetDrawingY(); // for the bottom position we need to take into account the number of lines and the staff size - int y_bottom = last->GetDrawingY() - (lastDef->GetLines() - 1) * m_doc->m_drawingDoubleUnit[last->staffSize]; + int y_bottom = last->GetDrawingY() - (lastDef->GetLines() - 1) * m_doc->GetDrawingDoubleUnit(last->staffSize); DrawBarline( dc, y_top, y_bottom, barLine ); @@ -533,8 +533,8 @@ void View::DrawBarline( DeviceContext *dc, int y_top, int y_bottom, Barline *bar y_bottom -= m_doc->m_style->m_staffLineWidth / 2; int x = barLine->GetDrawingX(); - int x1 = x - m_doc->m_drawingBeamWidth[0] - m_doc->m_style->m_barlineWidth; - int x2 = x + m_doc->m_drawingBeamWidth[0] + m_doc->m_style->m_barlineWidth; + int x1 = x - m_doc->GetDrawingBeamWidth(100, false) - m_doc->m_style->m_barlineWidth; + int x2 = x + m_doc->GetDrawingBeamWidth(100, false) + m_doc->m_style->m_barlineWidth; if (barLine->GetRend() == BARRENDITION_single) { @@ -543,18 +543,18 @@ void View::DrawBarline( DeviceContext *dc, int y_top, int y_bottom, Barline *bar else if (barLine->GetRend() == BARRENDITION_rptboth) { DrawVerticalLine( dc , y_top, y_bottom, x1, m_doc->m_style->m_barlineWidth); - DrawVerticalLine( dc , y_top, y_bottom, x, m_doc->m_drawingBeamWidth[0]); + DrawVerticalLine( dc , y_top, y_bottom, x, m_doc->GetDrawingBeamWidth(100, false)); DrawVerticalLine( dc , y_top, y_bottom, x2, m_doc->m_style->m_barlineWidth); } else if (barLine->GetRend() == BARRENDITION_rptstart) { - DrawVerticalLine( dc , y_top, y_bottom, x, m_doc->m_drawingBeamWidth[0]); + DrawVerticalLine( dc , y_top, y_bottom, x, m_doc->GetDrawingBeamWidth(100, false)); DrawVerticalLine( dc , y_top, y_bottom, x2, m_doc->m_style->m_barlineWidth); } else if (barLine->GetRend() == BARRENDITION_rptend) { DrawVerticalLine( dc , y_top, y_bottom, x1, m_doc->m_style->m_barlineWidth); - DrawVerticalLine( dc , y_top, y_bottom, x, m_doc->m_drawingBeamWidth[0]); + DrawVerticalLine( dc , y_top, y_bottom, x, m_doc->GetDrawingBeamWidth(100, false)); } else if (barLine->GetRend() == BARRENDITION_dbl) { @@ -566,7 +566,7 @@ void View::DrawBarline( DeviceContext *dc, int y_top, int y_bottom, Barline *bar else if (barLine->GetRend() == BARRENDITION_end) { DrawVerticalLine( dc , y_top, y_bottom, x1, m_doc->m_style->m_barlineWidth); - DrawVerticalLine( dc , y_top, y_bottom, x, m_doc->m_drawingBeamWidth[0]); + DrawVerticalLine( dc , y_top, y_bottom, x, m_doc->GetDrawingBeamWidth(100, false)); } } @@ -579,8 +579,8 @@ void View::DrawBarlineDots ( DeviceContext *dc, StaffDef *staffDef, Staff *staff assert( barLine ); int x = barLine->GetDrawingX(); - int x1 = x - 2 * m_doc->m_drawingBeamWidth[0] - m_doc->m_style->m_barlineWidth; - int x2 = x + 2 * m_doc->m_drawingBeamWidth[0] + m_doc->m_style->m_barlineWidth; + int x1 = x - 2 * m_doc->GetDrawingBeamWidth(100, false) - m_doc->m_style->m_barlineWidth; + int x2 = x + 2 * m_doc->GetDrawingBeamWidth(100, false) + m_doc->m_style->m_barlineWidth; int y_bottom = staff->GetDrawingY() - staffDef->GetLines() * m_doc->GetDrawingUnit(staff->staffSize); int y_top = y_bottom + m_doc->GetDrawingDoubleUnit(staff->staffSize); @@ -778,7 +778,7 @@ int View::CalculatePitchCode ( Layer *layer, int y_n, int x_pos, int *octave ) yb = parentStaff->GetDrawingY() - m_doc->GetDrawingStaffSize(staffSize); // UT1 default - plafond = yb + 8 * m_doc->m_drawingOctaveSize[staffSize]; + plafond = yb + 8 * m_doc->GetDrawingOctaveSize(staffSize); if (y_n > plafond) y_n = plafond; @@ -792,7 +792,7 @@ int View::CalculatePitchCode ( Layer *layer, int y_n, int x_pos, int *octave ) clefId = clef->GetClefId(); yb += (clef->GetClefOffset()) * m_doc->GetDrawingUnit(staffSize); // UT1 reel } - yb -= 4 * m_doc->m_drawingOctaveSize[staffSize]; // UT, note la plus grave + yb -= 4 * m_doc->GetDrawingOctaveSize(staffSize); // UT, note la plus grave y_dec = y_n - yb; // decalage par rapport a UT le plus grave diff --git a/src/view_tuplet.cpp b/src/view_tuplet.cpp index d7f40f420b3..14275e329e8 100644 --- a/src/view_tuplet.cpp +++ b/src/view_tuplet.cpp @@ -17,6 +17,7 @@ #include "beam.h" #include "devicecontext.h" #include "doc.h" +#include "smufl.h" #include "staff.h" #include "style.h" #include "tuplet.h" @@ -240,7 +241,8 @@ void View::DrawTupletPostponed( DeviceContext *dc, Tuplet *tuplet, Layer *layer, std::wstring notes; - dc->SetFont(&m_doc->m_drawingSmuflFonts[staff->staffSize][0]); + // + dc->SetFont(m_doc->GetDrawingSmuflFont(staff->staffSize, tuplet->IsCueSize())); if (tuplet->GetNum() > 0) { notes = IntToTupletFigures((short int)tuplet->GetNum()); @@ -256,7 +258,7 @@ void View::DrawTupletPostponed( DeviceContext *dc, Tuplet *tuplet, Layer *layer, int txt_x = center.x - (txt_length / 2); // we need to move down the figure of half of it height, which is about an accid width; // also, cue size is not supported. Does it has to? - int txt_y = center.y - m_doc->m_drawingAccidWidth[staff->staffSize][false]; + int txt_y = center.y - m_doc->GetGlyphWidth(SMUFL_E262_accidentalSharp, staff->staffSize, tuplet->IsCueSize()); if (tuplet->GetNum()) { DrawSmuflString(dc, txt_x, txt_y, notes, false, staff->staffSize); @@ -264,7 +266,7 @@ void View::DrawTupletPostponed( DeviceContext *dc, Tuplet *tuplet, Layer *layer, dc->ResetFont(); - int verticalLine = m_doc->m_drawingUnit[0]; + int verticalLine = m_doc->GetDrawingUnit(100); dc->SetPen(m_currentColour, m_doc->m_style->m_stemWidth, AxSOLID); From baa6117aea788b52db8620a85aaa3f9b6495f7e0 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Tue, 18 Aug 2015 21:29:36 +0200 Subject: [PATCH 071/114] Adjusting fermata position --- src/view_element.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/view_element.cpp b/src/view_element.cpp index cd889ae592b..72e618de31d 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -1770,9 +1770,8 @@ void View::DrawFermata(DeviceContext *dc, LayerElement *element, Staff *staff) int x, y; int emb_offset = 0; // if there is and embellishment, offset the note up - // We position the fermata in the same horizontal pos. of th object - // but it shoud be moved according to half of the fermata size - x = element->GetDrawingX() - m_doc->GetDrawingDoubleUnit(staff->staffSize); + // We move the fermata position of half of the fermata size + x = element->GetDrawingX() - m_doc->GetGlyphWidth(SMUFL_E4C0_fermataAbove, staff->staffSize, false) / 2; // First case, notes if (element->Is() == NOTE) { From d014fc12f7577735ad292442849d20bff20e9844 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Tue, 18 Aug 2015 21:48:23 +0200 Subject: [PATCH 072/114] Removing small staff num and den --- include/vrv/style.h | 4 ---- src/style.cpp | 5 +---- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/include/vrv/style.h b/include/vrv/style.h index b3e2b9f1684..36a5271fafd 100644 --- a/include/vrv/style.h +++ b/include/vrv/style.h @@ -184,10 +184,6 @@ class Style unsigned char m_beamMaxSlope; /** The minimum beam slope */ unsigned char m_beamMinSlope; - /** The small staff size ratio numerator */ - unsigned char m_smallStaffNum; - /** The small staff size ratio denominator */ - unsigned char m_smallStaffDen; /** The grace size ratio numerator */ unsigned char m_graceNum; /** The grace size ratio denominator */ diff --git a/src/style.cpp b/src/style.cpp index ba6e1c1c487..7b7e8bf952f 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -34,11 +34,8 @@ Style::Style() m_beamMinSlope = 0; /** - * We should probably keep graceNum and Den for cue sized notes. - * smallStaffNum and Den should be replaced for a more MEI way (percentage?) + * graceNum and Den for cue sized notes. */ - m_smallStaffNum = 4; - m_smallStaffDen = 5; m_graceNum = 5; m_graceDen = 7; From dc4dc059409aeece2e65fdd05e0ee05df63ab4a4 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Tue, 18 Aug 2015 23:18:55 +0200 Subject: [PATCH 073/114] Adding support for staffDef scale (att.scaled) and finalizing style scaling refactoring --- include/vrv/att.h | 3 + include/vrv/attdef.h | 5 + include/vrv/doc.h | 76 +++++++------- include/vrv/scoredef.h | 1 + include/vrv/staff.h | 2 +- include/vrv/style.h | 2 +- include/vrv/view.h | 6 +- libmei/atts_shared.cpp | 12 +-- libmei/atts_shared.h | 6 +- src/att.cpp | 19 ++++ src/doc.cpp | 27 +++++ src/iomei.cpp | 2 + src/scoredef.cpp | 3 + src/staff.cpp | 2 +- src/style.cpp | 2 +- src/view_beam.cpp | 36 ++++--- src/view_element.cpp | 232 ++++++++++++++++++++--------------------- src/view_floating.cpp | 38 +++---- src/view_graph.cpp | 6 +- src/view_mensural.cpp | 112 ++++++++++---------- src/view_page.cpp | 93 +++++++++-------- src/view_tuplet.cpp | 8 +- 22 files changed, 382 insertions(+), 311 deletions(-) diff --git a/include/vrv/att.h b/include/vrv/att.h index e79f0ec0aa4..7092c978d18 100644 --- a/include/vrv/att.h +++ b/include/vrv/att.h @@ -161,6 +161,9 @@ class Att std::string NumformatToStr(data_NUMFORMAT data); data_NUMFORMAT StrToNumformat(std::string value); + std::string PercentToStr(data_PERCENT data); + data_PERCENT StrToPercent(std::string value); + std::string OctaveDisToStr(data_OCTAVE_DIS data); data_OCTAVE_DIS StrToOctaveDis(std::string value); diff --git a/include/vrv/attdef.h b/include/vrv/attdef.h index e3050853e67..a12f73a79e2 100644 --- a/include/vrv/attdef.h +++ b/include/vrv/attdef.h @@ -335,6 +335,11 @@ enum data_OCTAVE_DIS { OCTAVE_DIS_22 = 22 }; +/** + * MEI data.PERCENT + */ +typedef int data_PERCENT; + /** * MEI data.PITCHNAME */ diff --git a/include/vrv/doc.h b/include/vrv/doc.h index d8cd306c916..69092215550 100644 --- a/include/vrv/doc.h +++ b/include/vrv/doc.h @@ -80,9 +80,13 @@ class Doc: public Object int GetDrawingStaffSize( int staffSize ); int GetDrawingOctaveSize( int staffSize ); int GetDrawingBrevisWidth( int staffSize ); + int GetDrawingBarLineWidth( int staffSize ); + int GetDrawingStaffLineWidth( int staffSize ); + int GetDrawingStemWidth( int staffSize ); int GetDrawingBeamWidth( int staffSize, bool graceSize ); int GetDrawingBeamWhiteWidth( int staffSize, bool graceSize ); int GetDrawingLedgerLineLength( int staffSize, bool graceSize ); + int GetGraceSize( int value ); ///@} /** @@ -231,27 +235,54 @@ class Doc: public Object */ pugi::xml_document m_header; - /** - * The object with the default values. - * This could be saved somewhere as preferences (todo). - */ - Style *m_style; - /** * Holds the top scoreDef. * In a standard MEI file, this is the encoded before the first
. */ ScoreDef m_scoreDef; + /** The current page height */ + int m_drawingPageHeight; + /** The current page height */ + int m_drawingPageWidth; + /** The current page witdth */ + int m_drawingPageLeftMar; + /** The current page left margin */ + int m_drawingPageRightMar; + /** The current page right margin */ + int m_drawingPageTopMar; + /** the current beam minimal slope */ + float m_drawingBeamMinSlope; + /** the current beam maximal slope */ + float m_drawingBeamMaxSlope; + /** flag for disabling justification */ + bool m_drawingJustifyX; + /** minimum measure width */ + int m_drawingMinMeasureWidth; + +private: + /** + * The type of document indicates how to deal with the layout information. + * A Transcription document types means that the layout information is included + * and that no layout algorithm should be applied. + */ + DocType m_type; + + /** + * The object with the default values. + * This could be saved somewhere as preferences (todo). + */ + Style *m_style; + /* - * The following values are set in the Doc::SetRenderedPage. + * The following values are set in the Doc::SetDrawingPage. * They are all current values to be used when drawing a page in a View and * reset for every page. However, most of them are based on the m_staffDefin values * and will remain the same. This can be optimized. - * The pages dimensions and margins are based on the page ones, the document ones or + * The pages dimensions and margins are based on the page ones, the document ones or * the default in the following order and if available. */ - + /** The page currently being drawn */ Page *m_drawingPage; /** Half a the space between to staff lines */ @@ -280,33 +311,6 @@ class Doc: public Object /** Current lyric font */ FontInfo m_drawingLyricFont; - /** The current page height */ - int m_drawingPageHeight; - /** The current page height */ - int m_drawingPageWidth; - /** The current page witdth */ - int m_drawingPageLeftMar; - /** The current page left margin */ - int m_drawingPageRightMar; - /** The current page right margin */ - int m_drawingPageTopMar; - /** the current beam minimal slope */ - float m_drawingBeamMinSlope; - /** the current beam maximal slope */ - float m_drawingBeamMaxSlope; - /** flag for disabling justification */ - bool m_drawingJustifyX; - /** minimum measure width */ - int m_drawingMinMeasureWidth; - -private: - /** - * The type of document indicates how to deal with the layout information. - * A Transcription document types means that the layout information is included - * and that no layout algorithm should be applied. - */ - DocType m_type; - /** * A flag for indicating whether the currentScoreDef has been set or not * If yes, SetCurrentScoreDef will not parse the document (again) unless diff --git a/include/vrv/scoredef.h b/include/vrv/scoredef.h index f1f4da423ff..e145a900c0f 100644 --- a/include/vrv/scoredef.h +++ b/include/vrv/scoredef.h @@ -300,6 +300,7 @@ class StaffGrp: public Object, public ObjectListInterface class StaffDef: public Object, public ScoreOrStaffDefAttrInterface, public AttCommon, public AttLabelsAddl, + public AttScalable, public AttStaffDefVis { public: diff --git a/include/vrv/staff.h b/include/vrv/staff.h index 43fbfae99db..8280a17e957 100644 --- a/include/vrv/staff.h +++ b/include/vrv/staff.h @@ -137,7 +137,7 @@ class Staff: public DocObject, /** portee invisible (wolfgang legacy) */ char invisible; /** taille. 0 = normale1 = petite (wolfgang legacy) (to be set as scale in staffDef) */ - unsigned char staffSize; + int m_drawingStaffSize; private: /** diff --git a/include/vrv/style.h b/include/vrv/style.h index 36a5271fafd..2a7fc313e65 100644 --- a/include/vrv/style.h +++ b/include/vrv/style.h @@ -179,7 +179,7 @@ class Style /** The stem width */ unsigned short m_stemWidth; /** The barLine width */ - unsigned short m_barlineWidth; + unsigned short m_barLineWidth; /** The maximum beam slope */ unsigned char m_beamMaxSlope; /** The minimum beam slope */ diff --git a/include/vrv/view.h b/include/vrv/view.h index acc82acf2ae..c2f3c6c62d8 100644 --- a/include/vrv/view.h +++ b/include/vrv/view.h @@ -304,11 +304,11 @@ class View void DrawHorizontalLine ( DeviceContext *dc, int x1, int x2, int y1, int nbr); void DrawSmuflCode ( DeviceContext *dc, int x, int y, wchar_t code, int staffSize, bool dimin ); void DrawTieOrSlurBezier(DeviceContext *dc, int x, int y, int x1, int y1, bool direction); - void DrawSmuflString ( DeviceContext *dc, int x, int y, std::wstring s, int centrer, int staffSize = 0); - void DrawLyricString ( DeviceContext *dc, int x, int y, std::wstring s, int staffSize = 0); + void DrawSmuflString ( DeviceContext *dc, int x, int y, std::wstring s, int centrer, int staffSize = 100); + void DrawLyricString ( DeviceContext *dc, int x, int y, std::wstring s, int staffSize = 100); void DrawFullRectangle( DeviceContext *dc, int x1, int y1, int x2, int y2); void DrawObliquePolygon ( DeviceContext *dc, int x1, int y1, int x2, int y2, int height); - void DrawDot ( DeviceContext *dc, int x, int y ); + void DrawDot ( DeviceContext *dc, int x, int y, int staffSize ); ///@} private: diff --git a/libmei/atts_shared.cpp b/libmei/atts_shared.cpp index 06383c46c1f..4cdd1e61ed6 100644 --- a/libmei/atts_shared.cpp +++ b/libmei/atts_shared.cpp @@ -4506,13 +4506,13 @@ AttScalable::~AttScalable() { } void AttScalable::ResetScalable() { - m_scale = ""; + m_scale = 0; } bool AttScalable::ReadScalable( pugi::xml_node element ) { bool hasAttribute = false; if (element.attribute("scale")) { - this->SetScale(StrToStr(element.attribute("scale").value())); + this->SetScale(StrToPercent(element.attribute("scale").value())); element.remove_attribute("scale"); hasAttribute = true; } @@ -4522,7 +4522,7 @@ bool AttScalable::ReadScalable( pugi::xml_node element ) { bool AttScalable::WriteScalable( pugi::xml_node element ) { bool wroteAttribute = false; if (this->HasScale()) { - element.append_attribute("scale") = StrToStr(this->GetScale()).c_str(); + element.append_attribute("scale") = PercentToStr(this->GetScale()).c_str(); wroteAttribute = true; } return wroteAttribute; @@ -4530,7 +4530,7 @@ bool AttScalable::WriteScalable( pugi::xml_node element ) { bool AttScalable::HasScale( ) { - return (m_scale != ""); + return (m_scale != 0); } @@ -7853,7 +7853,7 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu AttScalable *att = dynamic_cast(element); assert( att ); if (attrType == "scale") { - att->SetScale(att->StrToStr(attrValue)); + att->SetScale(att->StrToPercent(attrValue)); return true; } } @@ -9133,7 +9133,7 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { AttScalable *att = dynamic_cast(element); assert( att ); if (att->HasScale()) { - attributes->push_back(std::make_pair("scale", att->StrToStr(att->GetScale()))); + attributes->push_back(std::make_pair("scale", att->PercentToStr(att->GetScale()))); } } if (element->HasAttClass( ATT_SCOREDEFGES ) ) { diff --git a/libmei/atts_shared.h b/libmei/atts_shared.h index 38f5bd7e06c..4dda52bbee5 100644 --- a/libmei/atts_shared.h +++ b/libmei/atts_shared.h @@ -3894,15 +3894,15 @@ class AttScalable: public Att * to the default value) **/ ///@{ - void SetScale(std::string scale_) { m_scale = scale_; }; - std::string GetScale() const { return m_scale; }; + void SetScale(data_PERCENT scale_) { m_scale = scale_; }; + data_PERCENT GetScale() const { return m_scale; }; bool HasScale( ); ///@} private: /** Scale factor to be applied to the feature to make it the desired display size. **/ - std::string m_scale; + data_PERCENT m_scale; /* include */ }; diff --git a/src/att.cpp b/src/att.cpp index 8c0b79059de..f4a7aa00828 100644 --- a/src/att.cpp +++ b/src/att.cpp @@ -738,6 +738,25 @@ data_NUMFORMAT Att::StrToNumformat(std::string value) return NUMFORMAT_NONE; } +std::string Att::PercentToStr( data_PERCENT data) +{ + return StringFormat("%d%%", data); +} + +data_PERCENT Att::StrToPercent(std::string value) +{ + int percent = atoi( std::string( value.begin(), value.end() - 1 ).c_str() ); + if (percent > 1000) { + LogWarning("Percent cannot be greater than 1000%"); + return 100; + } + else if (percent < 1) { + LogWarning("Percent has to be greater than 0%"); + return 100; + } + return percent; +} + std::string Att::OctaveDisToStr( data_OCTAVE_DIS data ) { std::string value; diff --git a/src/doc.cpp b/src/doc.cpp index 416a16bee1f..1aca85df760 100644 --- a/src/doc.cpp +++ b/src/doc.cpp @@ -422,41 +422,68 @@ int Doc::GetDrawingUnit( int staffSize ) { return m_drawingUnit * staffSize / 100; } + int Doc::GetDrawingDoubleUnit( int staffSize ) { return m_drawingDoubleUnit * staffSize / 100; } + int Doc::GetDrawingStaffSize( int staffSize ) { return m_drawingStaffSize * staffSize / 100; } + int Doc::GetDrawingOctaveSize( int staffSize ) { return m_drawingOctaveSize * staffSize / 100; } + int Doc::GetDrawingBrevisWidth( int staffSize ) { return m_drawingBrevisWidth * staffSize / 100; } + +int Doc::GetDrawingBarLineWidth( int staffSize ) +{ + return m_style->m_barLineWidth * staffSize / 100; +} + +int Doc::GetDrawingStaffLineWidth( int staffSize ) +{ + return m_style->m_staffLineWidth * staffSize / 100; +} + +int Doc::GetDrawingStemWidth( int staffSize ) +{ + return m_style->m_stemWidth * staffSize / 100; +} + int Doc::GetDrawingBeamWidth( int staffSize, bool graceSize ) { int value = m_drawingBeamWidth * staffSize / 100; if ( graceSize ) value = value * this->m_style->m_graceNum / this->m_style->m_graceDen; return value; } + int Doc::GetDrawingBeamWhiteWidth( int staffSize, bool graceSize ) { int value = m_drawingBeamWhiteWidth * staffSize / 100; if ( graceSize ) value = value * this->m_style->m_graceNum / this->m_style->m_graceDen; return value; } + int Doc::GetDrawingLedgerLineLength( int staffSize, bool graceSize ) { int value = m_drawingLedgerLine * staffSize / 100; if ( graceSize ) value = value * this->m_style->m_graceNum / this->m_style->m_graceDen; return value; } + +int Doc::GetGraceSize(int value) +{ + return value * this->m_style->m_graceNum / this->m_style->m_graceDen; +} FontInfo *Doc::GetDrawingSmuflFont( int staffSize, bool graceSize ) { diff --git a/src/iomei.cpp b/src/iomei.cpp index 639889ce952..039dd1cb5dc 100644 --- a/src/iomei.cpp +++ b/src/iomei.cpp @@ -442,6 +442,7 @@ bool MeiOutput::WriteMeiStaffDef( pugi::xml_node currentNode, StaffDef *staffDef staffDef->WriteCommon(currentNode); staffDef->WriteLabelsAddl(currentNode); + staffDef->WriteScalable(currentNode); staffDef->WriteStaffDefVis(currentNode); if (staffDef->GetClefAttr()) { @@ -1354,6 +1355,7 @@ bool MeiInput::ReadMeiStaffDef( Object *parent, pugi::xml_node staffDef ) vrvStaffDef->ReadCommon(staffDef); vrvStaffDef->ReadLabelsAddl(staffDef); + vrvStaffDef->ReadScalable(staffDef); vrvStaffDef->ReadStaffDefVis(staffDef); if ( !vrvStaffDef->HasN() ) { diff --git a/src/scoredef.cpp b/src/scoredef.cpp index 994c69e5451..ea4dbba6c4c 100644 --- a/src/scoredef.cpp +++ b/src/scoredef.cpp @@ -452,10 +452,12 @@ StaffDef::StaffDef() : Object(), ScoreOrStaffDefAttrInterface(), AttCommon(), AttLabelsAddl(), + AttScalable(), AttStaffDefVis() { RegisterAttClass(ATT_COMMON); RegisterAttClass(ATT_LABELSADDL); + RegisterAttClass(ATT_SCALABLE); RegisterAttClass(ATT_STAFFDEFVIS); Reset(); } @@ -470,6 +472,7 @@ void StaffDef::Reset() ScoreOrStaffDefAttrInterface::Reset(); ResetCommon(); ResetLabelsAddl(); + ResetScalable(); ResetStaffDefVis(); m_drawClef = false; m_drawKeySig = false; diff --git a/src/staff.cpp b/src/staff.cpp index b9cf411cebf..2a9d5f84f8d 100644 --- a/src/staff.cpp +++ b/src/staff.cpp @@ -48,7 +48,7 @@ void Staff::Reset() notAnc = false; // LP we want modern notation :)) grise = false; invisible = false; - staffSize = 100; + m_drawingStaffSize = 100; m_drawingLines = 5; m_yAbs = VRV_UNSET; m_drawingY = 0; diff --git a/src/style.cpp b/src/style.cpp index 7b7e8bf952f..8fc021dd0d5 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -22,7 +22,7 @@ Style::Style() m_unit = DEFAULT_UNIT * DEFINITON_FACTOR; m_landscape = false; - m_barlineWidth = (unsigned short)(DEFAULT_BARLINE_WITDH * DEFINITON_FACTOR); + m_barLineWidth = (unsigned short)(DEFAULT_BARLINE_WITDH * DEFINITON_FACTOR); m_staffLineWidth = (unsigned short)(DEFAULT_STAFFLINE_WITDH * DEFINITON_FACTOR); m_stemWidth = (unsigned short)(DEFAULT_STEM_WITDH * DEFINITON_FACTOR); diff --git a/src/view_beam.cpp b/src/view_beam.cpp index bcbb03f4ace..ac80b79c4bb 100644 --- a/src/view_beam.cpp +++ b/src/view_beam.cpp @@ -92,7 +92,7 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta lastDur = elementCount = 0; high = avgY = verticalBoost = 0.0; - verticalCenter = staff->GetDrawingY() - (m_doc->GetDrawingDoubleUnit(staff->staffSize) * 2); //center point of the staff + verticalCenter = staff->GetDrawingY() - (m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) * 2); //center point of the staff yExtreme = verticalCenter; //value of farthest y point on the staff from verticalCenter minus verticalCenter; used if beamHasChord = ON ListOfObjects* beamChildren = beam->GetList(beam); @@ -112,8 +112,10 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta lastDur = dynamic_cast(current)->GetActualDur(); // x-offset values for stem bases, dx[y] where y = element->m_cueSize - dx[0] = m_doc->GetGlyphWidth(SMUFL_E0A3_noteheadHalf, staff->staffSize, false) / 2 - (m_doc->m_style->m_stemWidth)/2; - dx[1] = m_doc->GetGlyphWidth(SMUFL_E0A3_noteheadHalf, staff->staffSize, true) / 2 - (m_doc->m_style->m_stemWidth)/2; + dx[0] = m_doc->GetGlyphWidth(SMUFL_E0A3_noteheadHalf, staff->m_drawingStaffSize, false) / 2 - + (m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize))/2; + dx[1] = m_doc->GetGlyphWidth(SMUFL_E0A3_noteheadHalf, staff->m_drawingStaffSize, true) / 2 - + (m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize))/2; /******************************************************************/ // Populate BeamElementCoord for each element in the beam @@ -255,8 +257,8 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta } // We look only at the last note for checking if cuesized. Somehow arbitrarily - beamWidthBlack = m_doc->GetDrawingBeamWidth(staff->staffSize, (*beamElementCoords)[last]->m_element->IsCueSize()); - beamWidthWhite = m_doc->GetDrawingBeamWhiteWidth(staff->staffSize, (*beamElementCoords)[last]->m_element->IsCueSize()); + beamWidthBlack = m_doc->GetDrawingBeamWidth(staff->m_drawingStaffSize, (*beamElementCoords)[last]->m_element->IsCueSize()); + beamWidthWhite = m_doc->GetDrawingBeamWhiteWidth(staff->m_drawingStaffSize, (*beamElementCoords)[last]->m_element->IsCueSize()); beamWidth = beamWidthBlack + beamWidthWhite; @@ -268,12 +270,12 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta //if the beam has smaller-size notes if ((*beamElementCoords)[last]->m_element->IsCueSize()) { - verticalShift += m_doc->GetDrawingUnit(staff->staffSize)*5; + verticalShift += m_doc->GetDrawingUnit(staff->m_drawingStaffSize)*5; } else { verticalShift += (shortestDur > DUR_8) ? - m_doc->GetDrawingDoubleUnit(staff->staffSize) * verticalShiftFactor : - m_doc->GetDrawingDoubleUnit(staff->staffSize) * (verticalShiftFactor + 0.5); + m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) * verticalShiftFactor : + m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) * (verticalShiftFactor + 0.5); } // swap x position and verticalShift direction with stem down @@ -349,12 +351,12 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta for (i=0; im_yBeam - m_doc->m_style->m_stemWidth; - fy2 = (*beamElementCoords)[i]->m_yBottom + m_doc->GetDrawingUnit(staff->staffSize)/4; + fy1 = (*beamElementCoords)[i]->m_yBeam - m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize); + fy2 = (*beamElementCoords)[i]->m_yBottom + m_doc->GetDrawingUnit(staff->m_drawingStaffSize)/4; } else { - fy1 = (*beamElementCoords)[i]->m_yBeam + m_doc->m_style->m_stemWidth; - fy2 = (*beamElementCoords)[i]->m_yTop - m_doc->GetDrawingUnit(staff->staffSize)/4; + fy1 = (*beamElementCoords)[i]->m_yBeam + m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize); + fy2 = (*beamElementCoords)[i]->m_yTop - m_doc->GetDrawingUnit(staff->m_drawingStaffSize)/4; } // All notes and chords, including notes within chords, get their stem value stored @@ -378,7 +380,7 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta { LayerElement *el = (*beamElementCoords)[i]->m_element; if( ( (el->Is() == NOTE) && !dynamic_cast(el)->IsChordTone()) || (el->Is() == CHORD) ) { - DrawVerticalLine (dc, el->m_drawingStemStart.y, el->m_drawingStemEnd.y, el->m_drawingStemStart.x, m_doc->m_style->m_stemWidth); + DrawVerticalLine (dc, el->m_drawingStemStart.y, el->m_drawingStemEnd.y, el->m_drawingStemStart.x, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize)); } } @@ -388,8 +390,8 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta fullBars = !changingDur ? (shortestDur - DUR_4) : 1; // Adjust the x position of the first and last element for taking into account the stem width - (*beamElementCoords)[0]->m_x -= (m_doc->m_style->m_stemWidth) / 2; - (*beamElementCoords)[last]->m_x += (m_doc->m_style->m_stemWidth) / 2; + (*beamElementCoords)[0]->m_x -= (m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize)) / 2; + (*beamElementCoords)[last]->m_x += (m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize)) / 2; // Shift direction shiftY = (stemDir == STEMDIRECTION_down) ? 1.0 : -1.0; @@ -500,14 +502,14 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta } else if ((*beamElementCoords)[i]->m_partialFlags[testDur-DUR_8] == PARTIAL_RIGHT) { fy1 = (*beamElementCoords)[i]->m_yBeam + barY; - int x2 = (*beamElementCoords)[i]->m_x + m_doc->GetDrawingLedgerLineLength(staff->staffSize, false); + int x2 = (*beamElementCoords)[i]->m_x + m_doc->GetDrawingLedgerLineLength(staff->m_drawingStaffSize, false); fy2 = startingY + verticalBoost + barY + beamSlope * x2; polygonHeight= beamWidthBlack*shiftY; DrawObliquePolygon (dc, (*beamElementCoords)[i]->m_x, fy1, x2, fy2, polygonHeight); } else if ((*beamElementCoords)[i]->m_partialFlags[testDur-DUR_8] == PARTIAL_LEFT) { fy2 = (*beamElementCoords)[i]->m_yBeam + barY; - int x1 = (*beamElementCoords)[i]->m_x - m_doc->GetDrawingLedgerLineLength(staff->staffSize, false); + int x1 = (*beamElementCoords)[i]->m_x - m_doc->GetDrawingLedgerLineLength(staff->m_drawingStaffSize, false); fy1 = startingY + verticalBoost + barY + beamSlope * x1; polygonHeight = beamWidthBlack*shiftY; DrawObliquePolygon (dc, x1, fy1, (*beamElementCoords)[i]->m_x, fy2, polygonHeight); diff --git a/src/view_element.cpp b/src/view_element.cpp index 72e618de31d..ce8cac0fa84 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -228,7 +228,7 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St } } - int staffSize = staff->staffSize; + int staffSize = staff->m_drawingStaffSize; int noteY = element->GetDrawingY(); int xLedger, xNote, xAccid, xStem; int drawingDur; @@ -305,10 +305,10 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St //if we have a flipped notehead, we need to be in a chord assert(inChord); if (note->m_drawingStemDir == STEMDIRECTION_up) { - xNote = xStem + radius - m_doc->m_style->m_stemWidth; + xNote = xStem + radius - m_doc->GetDrawingStemWidth(staffSize); } else if (note->m_drawingStemDir == STEMDIRECTION_down) { - xNote = xStem - radius * 3 + m_doc->m_style->m_stemWidth; + xNote = xStem - radius * 3 + m_doc->GetDrawingStemWidth(staffSize); } else { xNote = xStem - radius; @@ -332,7 +332,7 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St else fontNo = SMUFL_E0A2_noteheadWhole; - DrawSmuflCode( dc, xNote, noteY, fontNo, staff->staffSize, drawingCueSize ); + DrawSmuflCode( dc, xNote, noteY, fontNo, staff->m_drawingStaffSize, drawingCueSize ); } // Other values else { @@ -343,7 +343,7 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St fontNo = SMUFL_E0A4_noteheadBlack; } - DrawSmuflCode( dc, xNote, noteY, fontNo, staff->staffSize, drawingCueSize ); + DrawSmuflCode( dc, xNote, noteY, fontNo, staff->m_drawingStaffSize, drawingCueSize ); if (!(inBeam && drawingDur > DUR_4) && !inChord) { DrawStem(dc, note, staff, note->m_drawingStemDir, radius, xStem, noteY); @@ -435,7 +435,7 @@ void View::DrawStem( DeviceContext *dc, LayerElement *object, Staff *staff, data { assert(dynamic_cast(object)); - int staffSize = staff->staffSize; + int staffSize = staff->m_drawingStaffSize; int staffY = staff->GetDrawingY(); int baseStem, totalFlagStemHeight, flagStemHeight, nbFlags; int drawingDur = dynamic_cast(object)->GetActualDur(); @@ -445,8 +445,8 @@ void View::DrawStem( DeviceContext *dc, LayerElement *object, Staff *staff, data baseStem = m_doc->GetDrawingUnit(staffSize)*7; flagStemHeight = m_doc->GetDrawingDoubleUnit(staffSize); if (drawingCueSize) { - baseStem = baseStem * m_doc->m_style->m_graceNum / m_doc->m_style->m_graceDen; - flagStemHeight = flagStemHeight * m_doc->m_style->m_graceNum / m_doc->m_style->m_graceDen; + baseStem = m_doc->GetGraceSize(baseStem); + flagStemHeight = m_doc->GetGraceSize(flagStemHeight); } nbFlags = drawingDur - DUR_8; @@ -478,38 +478,38 @@ void View::DrawStem( DeviceContext *dc, LayerElement *object, Staff *staff, data if (drawingDur > DUR_4) { // if we have flags, shorten the stem to make sure we have a nice overlap with the flag glyph int shortener = (drawingCueSize) ? - m_doc->GetDrawingUnit(staffSize) * m_doc->m_style->m_graceNum / m_doc->m_style->m_graceDen : + m_doc->GetGraceSize(m_doc->GetDrawingUnit(staffSize)) : m_doc->GetDrawingUnit(staffSize); stemY2 = (dir == STEMDIRECTION_up) ? y2 - shortener : y2 + shortener; } // draw the stems and the flags if (dir == STEMDIRECTION_up) { - DrawFullRectangle( dc, x2 - m_doc->m_style->m_stemWidth, stemY1, x2, stemY2); + DrawFullRectangle( dc, x2 - m_doc->GetDrawingStemWidth(staffSize), stemY1, x2, stemY2); - object->m_drawingStemStart.x = object->m_drawingStemEnd.x = x2 - (m_doc->m_style->m_stemWidth / 2); + object->m_drawingStemStart.x = object->m_drawingStemEnd.x = x2 - (m_doc->GetDrawingStemWidth(staffSize) / 2); object->m_drawingStemStart.y = y1; object->m_drawingStemEnd.y = y2; object->m_drawingStemDir = STEMDIRECTION_up; if (drawingDur > DUR_4) { - DrawSmuflCode( dc, x2 - m_doc->m_style->m_stemWidth, y2, SMUFL_E240_flag8thUp, staff->staffSize, drawingCueSize ); + DrawSmuflCode( dc, x2 - m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize), y2, SMUFL_E240_flag8thUp, staff->m_drawingStaffSize, drawingCueSize ); for (int i=0; i < nbFlags; i++) - DrawSmuflCode( dc, x2 - m_doc->m_style->m_stemWidth, y2 - (i + 1) * flagStemHeight, SMUFL_E240_flag8thUp, staff->staffSize, drawingCueSize ); + DrawSmuflCode( dc, x2 - m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize), y2 - (i + 1) * flagStemHeight, SMUFL_E240_flag8thUp, staff->m_drawingStaffSize, drawingCueSize ); } } else { - DrawFullRectangle( dc, x2, stemY1, x2 + m_doc->m_style->m_stemWidth, stemY2); + DrawFullRectangle( dc, x2, stemY1, x2 + m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize), stemY2); - object->m_drawingStemStart.x = object->m_drawingStemEnd.x = x2 - (m_doc->m_style->m_stemWidth / 2); + object->m_drawingStemStart.x = object->m_drawingStemEnd.x = x2 - (m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) / 2); object->m_drawingStemStart.y = y1; object->m_drawingStemEnd.y = y2; object->m_drawingStemDir = STEMDIRECTION_down; if (drawingDur > DUR_4) { - DrawSmuflCode( dc, x2 , y2, SMUFL_E241_flag8thDown , staff->staffSize, drawingCueSize ); + DrawSmuflCode( dc, x2 , y2, SMUFL_E241_flag8thDown , staff->m_drawingStaffSize, drawingCueSize ); for (int i=0; i < nbFlags; i++) - DrawSmuflCode( dc, x2, y2 + (i + 1) * flagStemHeight, SMUFL_E241_flag8thDown, staff->staffSize, drawingCueSize ); + DrawSmuflCode( dc, x2, y2 + (i + 1) * flagStemHeight, SMUFL_E241_flag8thDown, staff->m_drawingStaffSize, drawingCueSize ); } } @@ -526,7 +526,7 @@ void View::DrawLedgerLines ( DeviceContext *dc, LayerElement *element, Staff *st //various variables int ledgerY; int staffY = staff->GetDrawingY(); - int staffSize = staff->staffSize; + int staffSize = staff->m_drawingStaffSize; int betweenLines = m_doc->GetDrawingDoubleUnit(staffSize); bool drawingCueSize = element->IsCueSize(); int ledge = m_doc->GetDrawingLedgerLineLength(staffSize, drawingCueSize); @@ -563,7 +563,7 @@ void View::DrawLedgerLines ( DeviceContext *dc, LayerElement *element, Staff *st //add one line's distance to get it off the edge of the staff ledgerY += betweenLines; - dc->SetPen( m_currentColour, ToDeviceContextX( m_doc->m_style->m_staffLineWidth ), AxSOLID ); + dc->SetPen( m_currentColour, ToDeviceContextX( m_doc->GetDrawingStaffLineWidth(staffSize) ), AxSOLID ); dc->SetBrush(m_currentColour , AxTRANSPARENT ); //draw the lines @@ -594,13 +594,13 @@ void View::DrawRest ( DeviceContext *dc, LayerElement *element, Layer *layer, St int y = element->GetDrawingY(); // Temporary fix for rest within tuplet because drawing tuplet requires m_drawingStemXXX to be set - element->m_drawingStemStart.x = element->m_drawingStemEnd.x = element->GetDrawingX() - (m_doc->m_style->m_stemWidth / 2); + element->m_drawingStemStart.x = element->m_drawingStemEnd.x = element->GetDrawingX() - (m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) / 2); element->m_drawingStemEnd.y = element->GetDrawingY(); element->m_drawingStemStart.y = element->GetDrawingY(); if (drawingDur > DUR_2) { - x -= m_doc->GetGlyphWidth(SMUFL_E0A3_noteheadHalf, staff->staffSize, drawingCueSize); + x -= m_doc->GetGlyphWidth(SMUFL_E0A3_noteheadHalf, staff->m_drawingStaffSize, drawingCueSize); } switch (drawingDur) @@ -638,7 +638,7 @@ void View::DrawMRest(DeviceContext *dc, LayerElement *element, Layer *layer, Sta int y = element->GetDrawingY(); // move it down according to the number of line in the staff - y -= staff->m_drawingLines / 2 * m_doc->GetDrawingDoubleUnit(staff->staffSize) - m_doc->GetDrawingDoubleUnit(staff->staffSize); + y -= staff->m_drawingLines / 2 * m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) - m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); DrawWholeRest ( dc, xCentered, y, DUR_1, 0, false, staff ); @@ -671,12 +671,12 @@ void View::DrawMultiRest(DeviceContext *dc, LayerElement *element, Layer *layer, multirest->SetNum(999); // This is 1/2 the length of th black rectangle - length = (m_doc->GetDrawingUnit(staff->staffSize) * 5); + length = (m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 5); // Position centered in third line // it would be m_drawingDoubleUnit * 6.5, or m_drawingDoubleUnit / 2 * 13 - y1 = staff->GetDrawingY() - (m_doc->GetDrawingDoubleUnit(staff->staffSize) / 2) * 5; - y2 = y1 + m_doc->GetDrawingDoubleUnit(staff->staffSize); + y1 = staff->GetDrawingY() - (m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) / 2) * 5; + y2 = y1 + m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); // a is the central point, claculate x and x2 x1 = x - length; @@ -689,9 +689,9 @@ void View::DrawMultiRest(DeviceContext *dc, LayerElement *element, Layer *layer, //Draw the to lines at beginning and end // make it 8 pixesl longers, and 4 pixels width - int border = m_doc->GetDrawingUnit(staff->staffSize); - DrawVerticalLine(dc, y1 - border, y2 + border, x1, m_doc->m_style->m_stemWidth * 2); - DrawVerticalLine(dc, y1 - border, y2 + border, x2, m_doc->m_style->m_stemWidth * 2); + int border = m_doc->GetDrawingUnit(staff->m_drawingStaffSize); + DrawVerticalLine(dc, y1 - border, y2 + border, x1, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) * 2); + DrawVerticalLine(dc, y1 - border, y2 + border, x2, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) * 2); // Draw the text above int w, h; @@ -700,7 +700,7 @@ void View::DrawMultiRest(DeviceContext *dc, LayerElement *element, Layer *layer, // convert to string std::wstring wtext = IntToTimeSigFigures(multirest->GetNum()); - dc->SetFont(m_doc->GetDrawingSmuflFont(staff->staffSize, false)); + dc->SetFont(m_doc->GetDrawingSmuflFont(staff->m_drawingStaffSize, false)); dc->GetSmuflTextExtent( wtext, &w, &h); start_offset = (x2 - x1 - w) / 2; // calculate offset to center text DrawSmuflString(dc, x1 + start_offset, staff->GetDrawingY() + 5, wtext, false); @@ -718,13 +718,13 @@ void View::DrawLongRest ( DeviceContext *dc, int x, int y, Staff *staff) y1 = y; x1 = x; - x2 = x + (m_doc->GetDrawingUnit(staff->staffSize) * 2 / 3); + x2 = x + (m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 2 / 3); // look if on line or between line - if ( (y - staff->GetDrawingY()) % m_doc->GetDrawingDoubleUnit(staff->staffSize)) - y1 -= m_doc->GetDrawingUnit(staff->staffSize); + if ( (y - staff->GetDrawingY()) % m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize)) + y1 -= m_doc->GetDrawingUnit(staff->m_drawingStaffSize); - y2 = y1 + m_doc->GetDrawingDoubleUnit(staff->staffSize)*2; + y2 = y1 + m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize)*2; DrawFullRectangle( dc, x1, y2, x2, y1); return; } @@ -735,18 +735,18 @@ void View::DrawBreveRest ( DeviceContext *dc, int x, int y, Staff *staff) int x1, x2, y1, y2; y1 = y; x1 = x; - x2 = x + (m_doc->GetDrawingUnit(staff->staffSize) * 2 / 3); + x2 = x + (m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 2 / 3); // look if one line or between line - if ( (y - staff->GetDrawingY()) % m_doc->GetDrawingDoubleUnit(staff->staffSize)) - y1 -= m_doc->GetDrawingUnit(staff->staffSize); + if ( (y - staff->GetDrawingY()) % m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize)) + y1 -= m_doc->GetDrawingUnit(staff->m_drawingStaffSize); - y2 = y1 + m_doc->GetDrawingDoubleUnit(staff->staffSize); + y2 = y1 + m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); DrawFullRectangle( dc, x1, y2, x2, y1); // lines - x1 = x - m_doc->GetDrawingUnit(staff->staffSize); - x2 = x + m_doc->GetDrawingUnit(staff->staffSize); + x1 = x - m_doc->GetDrawingUnit(staff->m_drawingStaffSize); + x2 = x + m_doc->GetDrawingUnit(staff->m_drawingStaffSize); DrawHorizontalLine ( dc, x1, x2, y2, 1); DrawHorizontalLine ( dc, x1, x2, y1, 1); @@ -757,9 +757,9 @@ void View::DrawWholeRest ( DeviceContext *dc, int x, int y, int valeur, unsigned { int x1, x2, y1, y2, vertic; y1 = y; - vertic = m_doc->GetDrawingUnit(staff->staffSize); + vertic = m_doc->GetDrawingUnit(staff->m_drawingStaffSize); - int off = m_doc->GetDrawingLedgerLineLength(staff->staffSize, cueSize) * 2 / 3; // i.e., la moitie de la ronde + int off = m_doc->GetDrawingLedgerLineLength(staff->m_drawingStaffSize, cueSize) * 2 / 3; // i.e., la moitie de la ronde x1 = x - off; x2 = x + off; @@ -768,7 +768,7 @@ void View::DrawWholeRest ( DeviceContext *dc, int x, int y, int valeur, unsigned vertic = -vertic; // look if one line or between line - if ( (y - staff->GetDrawingY()) % m_doc->GetDrawingDoubleUnit(staff->staffSize)) + if ( (y - staff->GetDrawingY()) % m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize)) { if (valeur == DUR_2) y1 -= vertic; @@ -784,36 +784,36 @@ void View::DrawWholeRest ( DeviceContext *dc, int x, int y, int valeur, unsigned x2 += off; // legder line - if (y > (int)staff->GetDrawingY() || y < staff->GetDrawingY() - m_doc->GetDrawingStaffSize(staff->staffSize)) - DrawHorizontalLine ( dc, x1, x2, y1, m_doc->m_style->m_staffLineWidth); + if (y > (int)staff->GetDrawingY() || y < staff->GetDrawingY() - m_doc->GetDrawingStaffSize(staff->m_drawingStaffSize)) + DrawHorizontalLine ( dc, x1, x2, y1, m_doc->GetDrawingStaffLineWidth(staff->m_drawingStaffSize)); if (dots) - DrawDots( dc, (x2 + m_doc->GetDrawingUnit(staff->staffSize)), y2, dots, staff); + DrawDots( dc, (x2 + m_doc->GetDrawingUnit(staff->m_drawingStaffSize)), y2, dots, staff); } void View::DrawQuarterRest ( DeviceContext *dc, int x, int y, int valeur, unsigned char dots, bool cueSize, Staff *staff) { - int y2 = y + m_doc->GetDrawingDoubleUnit(staff->staffSize); - DrawSmuflCode( dc, x, y2, SMUFL_E4E5_restQuarter + (valeur-DUR_4), staff->staffSize, cueSize ); + int y2 = y + m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); + DrawSmuflCode( dc, x, y2, SMUFL_E4E5_restQuarter + (valeur-DUR_4), staff->m_drawingStaffSize, cueSize ); if (dots) { if (valeur < DUR_16) - y += m_doc->GetDrawingDoubleUnit(staff->staffSize); - DrawDots( dc, (x + 2 * m_doc->GetDrawingDoubleUnit(staff->staffSize)), y, dots, staff); + y += m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); + DrawDots( dc, (x + 2 * m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize)), y, dots, staff); } return; } bool View::IsOnStaffLine ( int y, Staff *staff) { - return ((y - staff->GetDrawingY()) % m_doc->GetDrawingDoubleUnit(staff->staffSize) == 0 ); + return ((y - staff->GetDrawingY()) % m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) == 0 ); } void View::PrepareChordDots ( DeviceContext *dc, Chord *chord, int x, int y, unsigned char dots, Staff *staff ) { std::list *dotsList = &chord->m_dots; - int fullUnit = m_doc->GetDrawingUnit(staff->staffSize); + int fullUnit = m_doc->GetDrawingUnit(staff->m_drawingStaffSize); int doubleUnit = fullUnit * 2; //if it's on a staff line to start with, we need to compensate here and add a full unit like DrawDots would @@ -855,11 +855,11 @@ void View::DrawDots ( DeviceContext *dc, int x, int y, unsigned char dots, Staff { int i; if ( IsOnStaffLine(y, staff) ) { - y += m_doc->GetDrawingUnit(staff->staffSize); + y += m_doc->GetDrawingUnit(staff->m_drawingStaffSize); } for (i = 0; i < dots; i++) { - DrawDot ( dc, x, y ); - x += std::max (6, 2 * m_doc->GetDrawingUnit(staff->staffSize)); + DrawDot ( dc, x, y, staff->m_drawingStaffSize ); + x += std::max (6, 2 * m_doc->GetDrawingUnit(staff->m_drawingStaffSize)); } return; } @@ -878,7 +878,7 @@ void View::DrawBarline( DeviceContext *dc, LayerElement *element, Layer *layer, dc->StartGraphic( element, "", element->GetUuid() ); int y = staff->GetDrawingY(); - DrawBarline( dc, y, y - m_doc->GetDrawingStaffSize(staff->staffSize), barLine ); + DrawBarline( dc, y, y - m_doc->GetDrawingStaffSize(staff->m_drawingStaffSize), barLine ); dc->EndGraphic(element, this ); } @@ -894,7 +894,7 @@ void View::DrawChord( DeviceContext *dc, LayerElement *element, Layer *layer, St Chord* chord = dynamic_cast(element); assert( chord ); - int staffSize = staff->staffSize; + int staffSize = staff->m_drawingStaffSize; int staffY = staff->GetDrawingY(); int verticalCenter = staffY - m_doc->GetDrawingDoubleUnit(staffSize)*2; bool drawingCueSize = chord->IsCueSize(); @@ -1066,7 +1066,7 @@ void View::DrawChord( DeviceContext *dc, LayerElement *element, Layer *layer, St /************ Ledger lines ************/ - dc->SetPen( m_currentColour, ToDeviceContextX( m_doc->m_style->m_staffLineWidth ), AxSOLID ); + dc->SetPen( m_currentColour, ToDeviceContextX( m_doc->GetDrawingStaffLineWidth(staffSize) ), AxSOLID ); dc->SetBrush(m_currentColour , AxTRANSPARENT ); MapOfLedgerLineFlags::iterator iter; @@ -1121,50 +1121,50 @@ void View::DrawClef( DeviceContext *dc, LayerElement *element, Layer *layer, Sta { case C1 : sym = SMUFL_E05C_cClef; - b -= m_doc->GetDrawingStaffSize(staff->staffSize); + b -= m_doc->GetDrawingStaffSize(staff->m_drawingStaffSize); break; case G1 : - b -= m_doc->GetDrawingStaffSize(staff->staffSize); + b -= m_doc->GetDrawingStaffSize(staff->m_drawingStaffSize); break; case G2_8va : sym = SMUFL_E053_gClef8va; - b -= m_doc->GetDrawingDoubleUnit(staff->staffSize) * 3; + b -= m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) * 3; break; case G2_8vb : sym = SMUFL_E052_gClef8vb; - b -= m_doc->GetDrawingDoubleUnit(staff->staffSize) * 3; + b -= m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) * 3; break; case C2 : sym = SMUFL_E05C_cClef; - b -= m_doc->GetDrawingDoubleUnit(staff->staffSize) * 3; + b -= m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) * 3; break; case G2 : - b -= m_doc->GetDrawingDoubleUnit(staff->staffSize) * 3; + b -= m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) * 3; break; case F3 : sym = SMUFL_E062_fClef; - b -= m_doc->GetDrawingDoubleUnit(staff->staffSize)*2; + b -= m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize)*2; break; case C3 : sym = SMUFL_E05C_cClef; - b -= m_doc->GetDrawingDoubleUnit(staff->staffSize)*2; + b -= m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize)*2; break; case F5 : sym =SMUFL_E062_fClef; break; case F4 : sym = SMUFL_E062_fClef; - b -= m_doc->GetDrawingDoubleUnit(staff->staffSize); + b -= m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); break; case C4 : sym = SMUFL_E05C_cClef; - b -= m_doc->GetDrawingDoubleUnit(staff->staffSize); + b -= m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); break; case C5 : sym = SMUFL_E05C_cClef; break; case perc : - b -= m_doc->GetDrawingDoubleUnit(staff->staffSize) * 2; + b -= m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) * 2; // FIXME sym = SMUFL_E05C_cClef; break; @@ -1177,9 +1177,9 @@ void View::DrawClef( DeviceContext *dc, LayerElement *element, Layer *layer, Sta if (clef->GetFirstParent( LAYER )) cueSize = true; if (!cueSize) - a -= m_doc->GetDrawingUnit(staff->staffSize) * 2; + a -= m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 2; - DrawSmuflCode ( dc, a, b, sym, staff->staffSize, cueSize ); + DrawSmuflCode ( dc, a, b, sym, staff->m_drawingStaffSize, cueSize ); dc->EndGraphic(element, this ); } @@ -1194,25 +1194,25 @@ void View::DrawMeterSigFigures( DeviceContext *dc, int x, int y, int num, int nu if (numBase) { - ynum = y - (m_doc->GetDrawingUnit(staff->staffSize)*2); - yden = ynum - (m_doc->GetDrawingDoubleUnit(staff->staffSize)*2); + ynum = y - (m_doc->GetDrawingUnit(staff->m_drawingStaffSize)*2); + yden = ynum - (m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize)*2); } else - ynum = y - (m_doc->GetDrawingUnit(staff->staffSize)*4); + ynum = y - (m_doc->GetDrawingUnit(staff->m_drawingStaffSize)*4); if (numBase > 9 || num > 9) { - x += m_doc->GetDrawingUnit(staff->staffSize) * 2; + x += m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 2; } - dc->SetFont(m_doc->GetDrawingSmuflFont(staff->staffSize, false)); + dc->SetFont(m_doc->GetDrawingSmuflFont(staff->m_drawingStaffSize, false)); wtext = IntToTimeSigFigures(num); - DrawSmuflString ( dc, x, ynum, wtext, 1, staff->staffSize); // '1' = centrer + DrawSmuflString ( dc, x, ynum, wtext, 1, staff->m_drawingStaffSize); // '1' = centrer if (numBase) { wtext = IntToTimeSigFigures(numBase); - DrawSmuflString ( dc, x, yden, wtext, 1, staff->staffSize); // '1' = centrer + DrawSmuflString ( dc, x, yden, wtext, 1, staff->m_drawingStaffSize); // '1' = centrer } dc->ResetFont(); @@ -1233,16 +1233,16 @@ void View::DrawMeterSig( DeviceContext *dc, LayerElement *element, Layer *layer, dc->StartGraphic( element, "", element->GetUuid() ); - int y = staff->GetDrawingY() - (m_doc->GetDrawingUnit(staff->staffSize) * 4); + int y = staff->GetDrawingY() - (m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 4); int x = element->GetDrawingX(); if ( meterSig->GetSym() == METERSIGN_common ) { - DrawSmuflCode( dc, element->GetDrawingX(), y, SMUFL_E08A_timeSigCommon, staff->staffSize, false); - x += m_doc->GetDrawingUnit(staff->staffSize) * 5; // step forward because we have a symbol + DrawSmuflCode( dc, element->GetDrawingX(), y, SMUFL_E08A_timeSigCommon, staff->m_drawingStaffSize, false); + x += m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 5; // step forward because we have a symbol } else if ( meterSig->GetSym() == METERSIGN_cut ) { - DrawSmuflCode( dc, element->GetDrawingX(), y, SMUFL_E08B_timeSigCutCommon, staff->staffSize, false); - x += m_doc->GetDrawingUnit(staff->staffSize) * 5; // step forward because we have a symbol + DrawSmuflCode( dc, element->GetDrawingX(), y, SMUFL_E08B_timeSigCutCommon, staff->m_drawingStaffSize, false); + x += m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 5; // step forward because we have a symbol } else if (meterSig->GetCount()) { @@ -1258,7 +1258,7 @@ bool View::CalculateAccidX(Staff *staff, Accid *accid, Chord *chord, bool adjust std::vector< std::vector > *accidSpace = &chord->m_accidSpace; //global drawing variables - int fullUnit = m_doc->GetDrawingUnit(staff->staffSize); + int fullUnit = m_doc->GetDrawingUnit(staff->m_drawingStaffSize); int halfUnit = fullUnit / 2; int accidHeight = ACCID_HEIGHT * halfUnit; @@ -1459,18 +1459,18 @@ void View::DrawAccid( DeviceContext *dc, LayerElement *element, Layer *layer, St Note *note = dynamic_cast( accid->GetFirstParent( NOTE, MAX_ACCID_DEPTH ) ); if ( note ) { if ( note->GetDrawingY() > y ) { - y = note->GetDrawingY() + m_doc->GetDrawingUnit(staff->staffSize); + y = note->GetDrawingY() + m_doc->GetDrawingUnit(staff->m_drawingStaffSize); } if ( (note->m_drawingStemDir == STEMDIRECTION_up) && (note->m_drawingStemEnd.y > y )) { y = note->m_drawingStemEnd.y; } // adjust the x position so it is centered - int radius = m_doc->GetGlyphWidth(SMUFL_E0A3_noteheadHalf, staff->staffSize, accid->m_drawingCueSize); + int radius = m_doc->GetGlyphWidth(SMUFL_E0A3_noteheadHalf, staff->m_drawingStaffSize, accid->m_drawingCueSize); if ( note->GetActualDur() < DUR_2 ) radius += radius/3; accid->SetDrawingX( accid->GetDrawingX() + radius / 2 ); } - accid->SetDrawingY( y + TEMP_STYLE_ACCID_EDIT_SPACE * m_doc->GetDrawingUnit(staff->staffSize) / PARAM_DENOMINATOR ); + accid->SetDrawingY( y + TEMP_STYLE_ACCID_EDIT_SPACE * m_doc->GetDrawingUnit(staff->m_drawingStaffSize) / PARAM_DENOMINATOR ); } int x = accid->GetDrawingX(); @@ -1498,8 +1498,8 @@ void View::DrawAccid( DeviceContext *dc, LayerElement *element, Layer *layer, St // mensural notation if (staff->notAnc) { symc = SMUFL_E262_accidentalSharp; - DrawSmuflCode ( dc, x, y, symc, staff->staffSize, accid->m_drawingCueSize ); - y += 7*m_doc->GetDrawingUnit(staff->staffSize); // LP + DrawSmuflCode ( dc, x, y, symc, staff->m_drawingStaffSize, accid->m_drawingCueSize ); + y += 7*m_doc->GetDrawingUnit(staff->m_drawingStaffSize); // LP } else { symc = SMUFL_E263_accidentalDoubleSharp; break; @@ -1512,7 +1512,7 @@ void View::DrawAccid( DeviceContext *dc, LayerElement *element, Layer *layer, St default : break; } - DrawSmuflCode ( dc, x, y, symc, staff->staffSize, accid->m_drawingCueSize ); + DrawSmuflCode ( dc, x, y, symc, staff->m_drawingStaffSize, accid->m_drawingCueSize ); dc->EndGraphic(element, this ); } @@ -1548,10 +1548,10 @@ void View::DrawCustos( DeviceContext *dc, LayerElement *element, Layer *layer, S int x = element->GetDrawingX(); int y = element->GetDrawingY(); - y -= m_doc->GetDrawingUnit(staff->staffSize) - m_doc->GetDrawingUnit(staff->staffSize)/4; // LP - correction in 2.0.0 + y -= m_doc->GetDrawingUnit(staff->m_drawingStaffSize) - m_doc->GetDrawingUnit(staff->m_drawingStaffSize)/4; // LP - correction in 2.0.0 // HARDCODED (smufl code wrong) - DrawSmuflCode( dc, x, y, 35, staff->staffSize, false ); + DrawSmuflCode( dc, x, y, 35, staff->m_drawingStaffSize, false ); dc->EndGraphic(element, this ); @@ -1577,7 +1577,7 @@ void View::DrawDot( DeviceContext *dc, LayerElement *element, Layer *layer, Staf // Use the note to which the points to for position if ( dot->m_drawingNote ) { - x = dot->m_drawingNote->GetDrawingX() + m_doc->GetDrawingUnit(staff->staffSize)*7/2; + x = dot->m_drawingNote->GetDrawingX() + m_doc->GetDrawingUnit(staff->m_drawingStaffSize)*7/2; y = dot->m_drawingNote->GetDrawingY(); } @@ -1594,7 +1594,7 @@ int View::GetSylY( Syl *syl, Staff *staff ) int y = syl->GetStart()->GetDrawingY(); if (staff->GetAlignment() ) { y = staff->GetDrawingY() + staff->GetAlignment()->GetMaxHeight() - - syl->m_drawingVerse * TEMP_STYLE_LYIRC_LINE_SPACE * m_doc->GetDrawingUnit(staff->staffSize) / PARAM_DENOMINATOR; + syl->m_drawingVerse * TEMP_STYLE_LYIRC_LINE_SPACE * m_doc->GetDrawingUnit(staff->m_drawingStaffSize) / PARAM_DENOMINATOR; } return y; } @@ -1610,7 +1610,7 @@ void View::DrawSyl( DeviceContext *dc, LayerElement *element, Layer *layer, Staf } // move the position back - to be updated HARDCODED also see View::DrawSylConnector and View::DrawSylConnectorLines - syl->SetDrawingX( syl->GetStart()->GetDrawingX() - m_doc->GetDrawingUnit(staff->staffSize) * 2 ); + syl->SetDrawingX( syl->GetStart()->GetDrawingX() - m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 2 ); syl->SetDrawingY( GetSylY(syl, staff) ); dc->StartGraphic( syl, "", syl->GetUuid() ); @@ -1619,15 +1619,15 @@ void View::DrawSyl( DeviceContext *dc, LayerElement *element, Layer *layer, Staf FontInfo currentFont; if (syl->HasFontstyle()) { - currentFont = *m_doc->GetDrawingLyricFont(staff->staffSize); + currentFont = *m_doc->GetDrawingLyricFont(staff->m_drawingStaffSize); currentFont.SetStyle(syl->GetFontstyle()); dc->SetFont(¤tFont); } else { - dc->SetFont( m_doc->GetDrawingLyricFont(staff->staffSize) ); + dc->SetFont( m_doc->GetDrawingLyricFont(staff->m_drawingStaffSize) ); } - DrawLyricString(dc, syl->GetDrawingX(), syl->GetDrawingY(), syl->GetText().c_str(), staff->staffSize ); + DrawLyricString(dc, syl->GetDrawingX(), syl->GetDrawingY(), syl->GetText().c_str(), staff->m_drawingStaffSize ); dc->ResetFont(); dc->ResetBrush(); @@ -1692,7 +1692,7 @@ void View::DrawKeySig( DeviceContext *dc, LayerElement *element, Layer *layer, S x = element->GetDrawingX(); // HARDCODED - int step = m_doc->GetGlyphWidth(SMUFL_E262_accidentalSharp, staff->staffSize, false) * 1.3; + int step = m_doc->GetGlyphWidth(SMUFL_E262_accidentalSharp, staff->m_drawingStaffSize, false) * 1.3; // Show cancellation if C major (0) or if any cancellation and show cancellation (showchange) is true (false by default) if ( (keySig->GetAlterationNumber() == 0) || (layer->DrawKeySigCancellation() && keySig->m_drawingShowchange) ) { @@ -1701,7 +1701,7 @@ void View::DrawKeySig( DeviceContext *dc, LayerElement *element, Layer *layer, S y = staff->GetDrawingY() + CalculatePitchPosY( staff, pitch, layer->GetClefOffset( element ), KeySig::GetOctave( keySig->m_drawingCancelAccidType, pitch, c->GetClefId()));; - DrawSmuflCode ( dc, x, y, SMUFL_E261_accidentalNatural, staff->staffSize, false ); + DrawSmuflCode ( dc, x, y, SMUFL_E261_accidentalNatural, staff->m_drawingStaffSize, false ); x += step; } } @@ -1714,7 +1714,7 @@ void View::DrawKeySig( DeviceContext *dc, LayerElement *element, Layer *layer, S if (keySig->GetAlterationType() == ACCIDENTAL_EXPLICIT_f) symb = SMUFL_E260_accidentalFlat; else symb = SMUFL_E262_accidentalSharp; - DrawSmuflCode ( dc, x, y, symb, staff->staffSize, false ); + DrawSmuflCode ( dc, x, y, symb, staff->m_drawingStaffSize, false ); x += step; } @@ -1733,10 +1733,10 @@ void View::DrawAcciaccaturaSlash(DeviceContext *dc, LayerElement *element) if (note->GetActualDur() < DUR_8) return; - dc->SetPen(AxBLACK, m_doc->m_style->m_stemWidth, AxSOLID); + dc->SetPen(AxBLACK, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize), AxSOLID); dc->SetBrush( AxBLACK, AxSOLID ); - int positionShift = m_doc->GetDrawingUnit(staff->staffSize) * m_doc->m_style->m_graceNum / m_doc->m_style->m_graceDen; + int positionShift = m_doc->GetGraceSize(m_doc->GetDrawingUnit(staff->m_drawingStaffSize)); int positionShiftX1 = positionShift * 3 / 2; int positionShiftY1 = positionShift * 2; int positionShiftX2 = positionShift * 3; @@ -1771,7 +1771,7 @@ void View::DrawFermata(DeviceContext *dc, LayerElement *element, Staff *staff) int emb_offset = 0; // if there is and embellishment, offset the note up // We move the fermata position of half of the fermata size - x = element->GetDrawingX() - m_doc->GetGlyphWidth(SMUFL_E4C0_fermataAbove, staff->staffSize, false) / 2; + x = element->GetDrawingX() - m_doc->GetGlyphWidth(SMUFL_E4C0_fermataAbove, staff->m_drawingStaffSize, false) / 2; // First case, notes if (element->Is() == NOTE) { @@ -1784,29 +1784,29 @@ void View::DrawFermata(DeviceContext *dc, LayerElement *element, Staff *staff) */ // only for up-fermatas, if there is a trill on the same note if (note->m_embellishment) - emb_offset = m_doc->GetDrawingDoubleUnit(staff->staffSize); + emb_offset = m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); // check that the notehead is in the staff. if ((element->GetDrawingY()) < staff->GetDrawingY()) // in the staff, set the fermata 20 pixels above the last line (+ embellishment offset) - y = staff->GetDrawingY() + m_doc->GetDrawingUnit(staff->staffSize) + emb_offset; + y = staff->GetDrawingY() + m_doc->GetDrawingUnit(staff->m_drawingStaffSize) + emb_offset; else // out of the staff, place the trill above the notehead - y = (element->GetDrawingY()) + m_doc->GetDrawingUnit(staff->staffSize) + emb_offset; + y = (element->GetDrawingY()) + m_doc->GetDrawingUnit(staff->m_drawingStaffSize) + emb_offset; // draw the up-fermata - DrawSmuflCode ( dc, x, y, SMUFL_E4C0_fermataAbove, staff->staffSize, false ); + DrawSmuflCode ( dc, x, y, SMUFL_E4C0_fermataAbove, staff->m_drawingStaffSize, false ); /* } else { // stem up fermata down // This works as above, only we check that the note head is not // UNDER the staff - if ((element->GetDrawingY()) > (staff->GetDrawingY() - m_doc->m_drawingStaffSize[staff->staffSize])) + if ((element->GetDrawingY()) > (staff->GetDrawingY() - m_doc->m_drawingStaffSize[staff->m_drawingStaffSize])) // notehead in staff, set under - y = staff->GetDrawingY() - m_doc->m_drawingStaffSize[staff->staffSize] - m_doc->GetDrawingDoubleUnit(staff->staffSize); + y = staff->GetDrawingY() - m_doc->m_drawingStaffSize[staff->m_drawingStaffSize] - m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); else // notehead under staff, set under notehead - y = (element->GetDrawingY()) - m_doc->GetDrawingDoubleUnit(staff->staffSize); + y = (element->GetDrawingY()) - m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); DrawSmuflCode ( dc, x, y, LEIPZIG_FERMATA_DOWN, staff, false ); } @@ -1815,8 +1815,8 @@ void View::DrawFermata(DeviceContext *dc, LayerElement *element, Staff *staff) // this is a rest // rests for the moment are always in the staff // so just place the fermata above the staff - y = staff->GetDrawingY() + m_doc->GetDrawingDoubleUnit(staff->staffSize); - DrawSmuflCode ( dc, x, y, SMUFL_E4C0_fermataAbove, staff->staffSize, false ); + y = staff->GetDrawingY() + m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); + DrawSmuflCode ( dc, x, y, SMUFL_E4C0_fermataAbove, staff->m_drawingStaffSize, false ); } } @@ -1828,15 +1828,15 @@ void View::DrawTrill(DeviceContext *dc, LayerElement *element, Staff *staff) int x, y; // It shoud be moved according to half of the trill size - x = element->GetDrawingX() - m_doc->GetGlyphWidth(SMUFL_E566_ornamentTrill, staff->staffSize, false); + x = element->GetDrawingX() - m_doc->GetGlyphWidth(SMUFL_E566_ornamentTrill, staff->m_drawingStaffSize, false); // HARDCODED if ((element->GetDrawingY()) < staff->GetDrawingY()) - y = staff->GetDrawingY() + m_doc->GetDrawingDoubleUnit(staff->staffSize); + y = staff->GetDrawingY() + m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); else - y = (element->GetDrawingY()) + m_doc->GetDrawingDoubleUnit(staff->staffSize); + y = (element->GetDrawingY()) + m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); - DrawSmuflCode ( dc, x, y, SMUFL_E566_ornamentTrill, staff->staffSize, false ); + DrawSmuflCode ( dc, x, y, SMUFL_E566_ornamentTrill, staff->m_drawingStaffSize, false ); } } // namespace vrv diff --git a/src/view_floating.cpp b/src/view_floating.cpp index d2b330b1c59..e617875b2cb 100644 --- a/src/view_floating.cpp +++ b/src/view_floating.cpp @@ -130,7 +130,7 @@ void View::DrawTimeSpanningElement( DeviceContext *dc, DocObject *element, Syste // takes into account the scoreDef Note *firstNote = dynamic_cast( staff->FindChildByType( NOTE ) ); - x1 = firstNote ? firstNote->GetDrawingX() - 2 * m_doc->GetDrawingDoubleUnit(staff->staffSize) : first->GetDrawingX(); + x1 = firstNote ? firstNote->GetDrawingX() - 2 * m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) : first->GetDrawingX(); x2 = interface->GetEnd()->GetDrawingX(); spanningType = SPANNING_END; } @@ -157,7 +157,7 @@ void View::DrawTimeSpanningElement( DeviceContext *dc, DocObject *element, Syste return; } - x1 = firstNote ? firstNote->GetDrawingX() - 2 * m_doc->GetDrawingDoubleUnit(staff->staffSize) : first->GetDrawingX(); + x1 = firstNote ? firstNote->GetDrawingX() - 2 * m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) : first->GetDrawingX(); x2 = last->GetDrawingX() + last->GetRightBarlineX(); spanningType = SPANNING_MIDDLE; } @@ -267,7 +267,7 @@ void View::DrawTieOrSlur( DeviceContext *dc, FloatingElement *element, int x1, i } else if (noteStemDir == STEMDIRECTION_NONE) { // no information from the note stem directions, look at the position in the notes - int center = staff->GetDrawingY() - m_doc->GetDrawingDoubleUnit(staff->staffSize) * 2; + int center = staff->GetDrawingY() - m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) * 2; up = (y1 > center) ? true : false; } @@ -275,12 +275,12 @@ void View::DrawTieOrSlur( DeviceContext *dc, FloatingElement *element, int x1, i // 20 height nice with 70, not nice with 50 // Also remove HARDCODED values! if (up) { - y1 += m_doc->GetDrawingUnit(staff->staffSize) * 1.6; - y2 += m_doc->GetDrawingUnit(staff->staffSize) * 1.6; + y1 += m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 1.6; + y2 += m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 1.6; } else { - y1 -= m_doc->GetDrawingUnit(staff->staffSize) * 1.6; - y2 -= m_doc->GetDrawingUnit(staff->staffSize) * 1.6; + y1 -= m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 1.6; + y2 -= m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 1.6; } if ( graphic ) dc->ResumeGraphic(graphic, graphic->GetUuid()); @@ -304,19 +304,19 @@ void View::DrawSylConnector( DeviceContext *dc, Syl *syl, int x1, int x2, Staff // The both correspond to the current system, which means no system break in-between (simple case) if ( spanningType == SPANNING_START_END ) { - dc->SetFont( m_doc->GetDrawingLyricFont( staff->staffSize ) ); + dc->SetFont( m_doc->GetDrawingLyricFont( staff->m_drawingStaffSize ) ); dc->GetTextExtent(syl->GetText(), &w, &h); dc->ResetFont(); // x position of the syl is two units back - x1 += w - m_doc->GetDrawingUnit(staff->staffSize) * 2; + x1 += w - m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 2; } // Only the first parent is the same, this means that the syl is "open" at the end of the system else if ( spanningType == SPANNING_START) { - dc->SetFont( m_doc->GetDrawingLyricFont( staff->staffSize ) ); + dc->SetFont( m_doc->GetDrawingLyricFont( staff->m_drawingStaffSize ) ); dc->GetTextExtent(syl->GetText(), &w, &h); dc->ResetFont(); // idem - x1 += w - m_doc->GetDrawingUnit(staff->staffSize) * 2; + x1 += w - m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 2; } // We are in the system of the last note - draw the connector from the beginning of the system @@ -342,18 +342,18 @@ void View::DrawSylConnectorLines( DeviceContext *dc, int x1, int x2, int y, Syl { if (syl->GetCon() == CON_d) { - y += m_doc->GetDrawingUnit(staff->staffSize) * 2 / 3; + y += m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 2 / 3; // x position of the syl is two units back - x2 -= 2 * (int)m_doc->GetDrawingUnit(staff->staffSize); + x2 -= 2 * (int)m_doc->GetDrawingUnit(staff->m_drawingStaffSize); //if ( x1 > x2 ) { - // DrawFullRectangle(dc, x1, y + 2* m_doc->m_style->m_barlineWidth, x2, y + 3 * m_doc->m_style->m_barlineWidth); + // DrawFullRectangle(dc, x1, y + 2* m_doc->GetDrawingBarLineWidth(staff->m_drawingStaffSize), x2, y + 3 * m_doc->GetDrawingBarLineWidth(staff->m_drawingStaffSize)); // LogDebug("x1 > x2 (%d %d)", x1, x2 ); //} // the length of the dash and the space between them - can be made a parameter - int dashLength = m_doc->GetDrawingUnit(staff->staffSize) * 4 / 3; - int dashSpace = m_doc->GetDrawingStaffSize(staff->staffSize) * 5 / 3; + int dashLength = m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 4 / 3; + int dashSpace = m_doc->GetDrawingStaffSize(staff->m_drawingStaffSize) * 5 / 3; int halfDashLength = dashLength / 2; int dist = x2 - x1; @@ -371,13 +371,13 @@ void View::DrawSylConnectorLines( DeviceContext *dc, int x1, int x2, int y, Syl int i, x; for (i = 0; i < nbDashes; i++) { x = x1 + margin + (i * dashSpace); - DrawFullRectangle(dc, x - halfDashLength, y, x + halfDashLength, y + m_doc->m_style->m_barlineWidth); + DrawFullRectangle(dc, x - halfDashLength, y, x + halfDashLength, y + m_doc->GetDrawingBarLineWidth(staff->m_drawingStaffSize)); } } else if (syl->GetCon() == CON_u) { - x1 += (int)m_doc->GetDrawingUnit(staff->staffSize) / 2; - DrawFullRectangle(dc, x1, y, x2, y + m_doc->m_style->m_barlineWidth); + x1 += (int)m_doc->GetDrawingUnit(staff->m_drawingStaffSize) / 2; + DrawFullRectangle(dc, x1, y, x2, y + m_doc->GetDrawingBarLineWidth(staff->m_drawingStaffSize)); } } diff --git a/src/view_graph.cpp b/src/view_graph.cpp index 4b8ce2aa088..55bcccad8fe 100644 --- a/src/view_graph.cpp +++ b/src/view_graph.cpp @@ -92,9 +92,9 @@ void View::DrawObliquePolygon ( DeviceContext *dc, int x1, int y1, int x2, int y } -void View::DrawDot ( DeviceContext *dc, int x, int y ) +void View::DrawDot ( DeviceContext *dc, int x, int y, int staffSize ) { - int r = std::max( ToDeviceContextX( m_doc->GetDrawingDoubleUnit( 100 ) / 5 ), 2 ); + int r = std::max( ToDeviceContextX( m_doc->GetDrawingDoubleUnit( staffSize ) / 5 ), 2 ); dc->SetPen( m_currentColour, 1, AxSOLID ); dc->SetBrush( m_currentColour, AxSOLID ); @@ -219,7 +219,7 @@ void View::DrawTieOrSlurBezier(DeviceContext *dc, int x, int y, int x1, int y1, bez2[4] = ToDeviceContextX(x); bez2[5] = ToDeviceContextY(y); // Actually draw it - dc->SetPen( m_currentColour, std::max( 1, m_doc->m_style->m_stemWidth / 2 ), AxSOLID ); + dc->SetPen( m_currentColour, std::max( 1, m_doc->GetDrawingStemWidth(100) / 2 ), AxSOLID ); dc->DrawComplexBezierPath(ToDeviceContextX(x), ToDeviceContextY(y), bez1, bez2); dc->ResetPen(); } diff --git a/src/view_mensural.cpp b/src/view_mensural.cpp index 5992b9f3989..113f0d0d4a1 100644 --- a/src/view_mensural.cpp +++ b/src/view_mensural.cpp @@ -43,7 +43,7 @@ void View::DrawMensuralNote ( DeviceContext *dc, LayerElement *element, Layer *l Note *note = dynamic_cast(element); assert( note ); - int staffSize = staff->staffSize; + int staffSize = staff->m_drawingStaffSize; int noteY = element->GetDrawingY(); int xLedger, xNote, xStem; int drawingDur; @@ -100,7 +100,7 @@ void View::DrawMensuralNote ( DeviceContext *dc, LayerElement *element, Layer *l else fontNo = SMUFL_E0A2_noteheadWhole; - DrawSmuflCode( dc, xNote, noteY, fontNo, staff->staffSize, drawingCueSize ); + DrawSmuflCode( dc, xNote, noteY, fontNo, staff->m_drawingStaffSize, drawingCueSize ); } // Other values else { @@ -113,7 +113,7 @@ void View::DrawMensuralNote ( DeviceContext *dc, LayerElement *element, Layer *l else fontNo = SMUFL_E0A3_noteheadHalf; } - DrawSmuflCode( dc, xNote, noteY, fontNo, staff->staffSize, drawingCueSize ); + DrawSmuflCode( dc, xNote, noteY, fontNo, staff->m_drawingStaffSize, drawingCueSize ); DrawStem(dc, note, staff, note->m_drawingStemDir, radius, xStem, noteY); } @@ -193,7 +193,7 @@ void View::DrawMensur( DeviceContext *dc, LayerElement *element, Layer *layer, S x = element->GetDrawingX(); if (mensur->GetSign() || mensur->HasTempus()) { - x += m_doc->GetDrawingUnit(staff->staffSize) * 5; // step forward because we have a sign or a meter symbol + x += m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 5; // step forward because we have a sign or a meter symbol } int numbase = mensur->HasNumbase() ? mensur->GetNumbase() : 0; DrawMeterSigFigures ( dc, x, staff->GetDrawingY(), mensur->GetNum(), numbase, staff); @@ -209,10 +209,10 @@ void View::DrawMensurCircle( DeviceContext *dc, int x, int yy, Staff *staff ) assert( dc ); assert( staff ); - int y = ToDeviceContextY (yy - m_doc->GetDrawingDoubleUnit( staff->staffSize ) * 2); - int r = ToDeviceContextX( m_doc->GetDrawingDoubleUnit( staff->staffSize )); + int y = ToDeviceContextY (yy - m_doc->GetDrawingDoubleUnit( staff->m_drawingStaffSize ) * 2); + int r = ToDeviceContextX( m_doc->GetDrawingDoubleUnit( staff->m_drawingStaffSize )); - dc->SetPen( m_currentColour, m_doc->m_style->m_staffLineWidth, AxSOLID ); + dc->SetPen( m_currentColour, m_doc->GetDrawingStaffLineWidth(staff->m_drawingStaffSize), AxSOLID ); dc->SetBrush( m_currentColour, AxTRANSPARENT ); dc->DrawCircle( ToDeviceContextX(x), y, r ); @@ -226,11 +226,11 @@ void View::DrawMensurHalfCircle( DeviceContext *dc, int x, int yy, Staff *staff assert( dc ); assert( staff ); - dc->SetPen( m_currentColour, m_doc->m_style->m_staffLineWidth, AxSOLID ); + dc->SetPen( m_currentColour, m_doc->GetDrawingStaffLineWidth(staff->m_drawingStaffSize), AxSOLID ); dc->SetBrush( m_currentColour, AxTRANSPARENT ); - int y = ToDeviceContextY (yy - m_doc->GetDrawingDoubleUnit( staff->staffSize )); - int r = ToDeviceContextX( m_doc->GetDrawingDoubleUnit( staff->staffSize )); + int y = ToDeviceContextY (yy - m_doc->GetDrawingDoubleUnit( staff->m_drawingStaffSize )); + int r = ToDeviceContextX( m_doc->GetDrawingDoubleUnit( staff->m_drawingStaffSize )); x = ToDeviceContextX (x); x -= 3*r/3; @@ -248,11 +248,11 @@ void View::DrawMensurReversedHalfCircle( DeviceContext *dc, int x, int yy, Staff assert( dc ); assert (staff ); - dc->SetPen( m_currentColour, m_doc->m_style->m_staffLineWidth, AxSOLID ); + dc->SetPen( m_currentColour, m_doc->GetDrawingStaffLineWidth(staff->m_drawingStaffSize), AxSOLID ); dc->SetBrush( m_currentColour, AxTRANSPARENT ); - int y = ToDeviceContextY (yy - m_doc->GetDrawingDoubleUnit( staff->staffSize )); - int r = ToDeviceContextX( m_doc->GetDrawingDoubleUnit( staff->staffSize ) ); + int y = ToDeviceContextY (yy - m_doc->GetDrawingDoubleUnit( staff->m_drawingStaffSize )); + int r = ToDeviceContextX( m_doc->GetDrawingDoubleUnit( staff->m_drawingStaffSize ) ); // needs to be fixed x = ToDeviceContextX (x); @@ -271,8 +271,8 @@ void View::DrawMensurDot ( DeviceContext *dc, int x, int yy, Staff *staff ) assert( dc ); assert( staff ); - int y = ToDeviceContextY (yy - m_doc->GetDrawingDoubleUnit( staff->staffSize ) * 2); - int r = m_doc->GetDrawingUnit(staff->staffSize) * 2 / 3; + int y = ToDeviceContextY (yy - m_doc->GetDrawingDoubleUnit( staff->m_drawingStaffSize ) * 2); + int r = m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 2 / 3; dc->SetPen( m_currentColour, 1, AxSOLID ); dc->SetBrush( m_currentColour, AxSOLID ); @@ -292,9 +292,9 @@ void View::DrawMensurSlash ( DeviceContext *dc, int a, int yy, Staff *staff ) assert( staff ); int y1 = yy; - int y2 = y1 - m_doc->GetDrawingStaffSize( staff->staffSize ); + int y2 = y1 - m_doc->GetDrawingStaffSize( staff->m_drawingStaffSize ); - DrawVerticalLine ( dc, y1, y2, a, m_doc->m_style->m_staffLineWidth); + DrawVerticalLine ( dc, y1, y2, a, m_doc->GetDrawingStaffLineWidth(staff->m_drawingStaffSize)); return; } @@ -317,7 +317,7 @@ void View::CalculateLigaturePosX ( LayerElement *element, Layer *layer, Staff *s } if (previousNote->m_lig && previousNote->m_dur <= DUR_1) { - element->SetDrawingX( previous->GetDrawingX() + m_doc->m_drawingBrevisWidth[staff->staffSize] * 2 ); + element->SetDrawingX( previous->GetDrawingX() + m_doc->m_drawingBrevisWidth[staff->m_drawingStaffSize] * 2 ); } */ return; @@ -337,20 +337,20 @@ void View::DrawMaximaToBrevis( DeviceContext *dc, int y, LayerElement *element, // int yy2, y5; // unused int verticalCenter, up, height; - height = m_doc->GetDrawingBeamWidth(staff->staffSize, false) / 2 ; + height = m_doc->GetDrawingBeamWidth(staff->m_drawingStaffSize, false) / 2 ; xn = element->GetDrawingX(); // calcul des dimensions du rectangle - x1 = xn - m_doc->GetDrawingBrevisWidth( staff->staffSize ); - x2 = xn + m_doc->GetDrawingBrevisWidth( staff->staffSize ); + x1 = xn - m_doc->GetDrawingBrevisWidth( staff->m_drawingStaffSize ); + x2 = xn + m_doc->GetDrawingBrevisWidth( staff->m_drawingStaffSize ); if (note->GetActualDur() == DUR_MX) { - x1 -= m_doc->GetDrawingBrevisWidth( staff->staffSize ); - x2 += m_doc->GetDrawingBrevisWidth( staff->staffSize ); + x1 -= m_doc->GetDrawingBrevisWidth( staff->m_drawingStaffSize ); + x2 += m_doc->GetDrawingBrevisWidth( staff->m_drawingStaffSize ); } - y1 = y + m_doc->GetDrawingUnit(staff->staffSize); - y2 = y - m_doc->GetDrawingUnit(staff->staffSize); - y3 = (int)(y1 + m_doc->GetDrawingUnit(staff->staffSize)/2); // partie d'encadrement qui depasse - y4 = (int)(y2 - m_doc->GetDrawingUnit(staff->staffSize)/2); + y1 = y + m_doc->GetDrawingUnit(staff->m_drawingStaffSize); + y2 = y - m_doc->GetDrawingUnit(staff->m_drawingStaffSize); + y3 = (int)(y1 + m_doc->GetDrawingUnit(staff->m_drawingStaffSize)/2); // partie d'encadrement qui depasse + y4 = (int)(y2 - m_doc->GetDrawingUnit(staff->m_drawingStaffSize)/2); if (note->GetColored()!=BOOLEAN_true) { // double base des carrees @@ -361,13 +361,13 @@ void View::DrawMaximaToBrevis( DeviceContext *dc, int y, LayerElement *element, DrawFullRectangle( dc,x1,y1,x2,y2); } - DrawVerticalLine ( dc, y3, y4, x1, m_doc->m_style->m_stemWidth ); // corset lateral - DrawVerticalLine ( dc, y3, y4, x2, m_doc->m_style->m_stemWidth ); + DrawVerticalLine ( dc, y3, y4, x1, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) ); // corset lateral + DrawVerticalLine ( dc, y3, y4, x2, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) ); // stem if (note->GetActualDur() < DUR_BR) { - verticalCenter = staff->GetDrawingY() - m_doc->GetDrawingDoubleUnit(staff->staffSize)*2; + verticalCenter = staff->GetDrawingY() - m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize)*2; up = (y < verticalCenter) ? true : false; if ( note->m_drawingStemDir != STEMDIRECTION_NONE ) { if ( note->m_drawingStemDir == STEMDIRECTION_up) { @@ -379,14 +379,14 @@ void View::DrawMaximaToBrevis( DeviceContext *dc, int y, LayerElement *element, } if (!up) { - y3 = y1 - m_doc->GetDrawingUnit(staff->staffSize)*8; + y3 = y1 - m_doc->GetDrawingUnit(staff->m_drawingStaffSize)*8; y2 = y1; } else { - y3 = y1 + m_doc->GetDrawingUnit(staff->staffSize)*6; + y3 = y1 + m_doc->GetDrawingUnit(staff->m_drawingStaffSize)*6; y2 = y1; } - DrawVerticalLine ( dc, y2,y3,x2, m_doc->m_style->m_stemWidth ); + DrawVerticalLine ( dc, y2,y3,x2, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) ); } return; @@ -406,7 +406,7 @@ void View::DrawLigature ( DeviceContext *dc, int y, LayerElement *element, Layer // int yy2, y5; // unused int verticalCenter, up, epaisseur; - epaisseur = std::max (2, m_doc->GetDrawingBeamWidth(staff->staffSize, false) / 2); + epaisseur = std::max (2, m_doc->GetDrawingBeamWidth(staff->m_drawingStaffSize, false) / 2); xn = element->GetDrawingX(); /* @@ -420,11 +420,11 @@ void View::DrawLigature ( DeviceContext *dc, int y, LayerElement *element, Layer } // calcul des dimensions du rectangle - x1 = xn - m_doc->GetDrawingBrevisWidth(staff->staffSize); x2 = xn + m_doc->GetDrawingBrevisWidth(staff->staffSize); - y1 = y + m_doc->GetDrawingUnit(staff->staffSize); - y2 = y - m_doc->GetDrawingUnit(staff->staffSize); - y3 = (int)(y1 + m_doc->GetDrawingUnit(staff->staffSize)/2); // partie d'encadrement qui depasse - y4 = (int)(y2 - m_doc->GetDrawingUnit(staff->staffSize)/2); + x1 = xn - m_doc->GetDrawingBrevisWidth(staff->m_drawingStaffSize); x2 = xn + m_doc->GetDrawingBrevisWidth(staff->m_drawingStaffSize); + y1 = y + m_doc->GetDrawingUnit(staff->m_drawingStaffSize); + y2 = y - m_doc->GetDrawingUnit(staff->m_drawingStaffSize); + y3 = (int)(y1 + m_doc->GetDrawingUnit(staff->m_drawingStaffSize)/2); // partie d'encadrement qui depasse + y4 = (int)(y2 - m_doc->GetDrawingUnit(staff->m_drawingStaffSize)/2); //if (!note->m_ligObliqua && (!View::s_drawingLigObliqua)) // notes rectangulaires, y c. en ligature @@ -437,15 +437,15 @@ void View::DrawLigature ( DeviceContext *dc, int y, LayerElement *element, Layer else DrawFullRectangle( dc,x1,y1,x2,y2); // dessine val carree pleine // ENZ correction de x2 - DrawVerticalLine ( dc, y3, y4, x1, m_doc->m_style->m_stemWidth ); // corset lateral - DrawVerticalLine ( dc, y3, y4, x2, m_doc->m_style->m_stemWidth ); + DrawVerticalLine ( dc, y3, y4, x1, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) ); // corset lateral + DrawVerticalLine ( dc, y3, y4, x2, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) ); } /* else // traitement des obliques { if (!View::s_drawingLigObliqua) // 1e passage: ligne flagStemHeighte initiale { - DrawVerticalLine (dc,y3,y4,x1, m_doc->m_style->m_stemWidth ); + DrawVerticalLine (dc,y3,y4,x1, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) ); View::s_drawingLigObliqua = true; //oblique = OFF; // if (val == DUR_1) // queue gauche haut si DUR_1 @@ -453,19 +453,19 @@ void View::DrawLigature ( DeviceContext *dc, int y, LayerElement *element, Layer } else // 2e passage: lignes obl. et flagStemHeighte finale { - x1 -= m_doc->m_drawingBrevisWidth[staff->staffSize]*2; // avance auto + x1 -= m_doc->m_drawingBrevisWidth[staff->m_drawingStaffSize]*2; // avance auto - y1 = *View::s_drawingLigY - m_doc->GetDrawingUnit(staff->staffSize); // ligat_y contient y original + y1 = *View::s_drawingLigY - m_doc->GetDrawingUnit(staff->m_drawingStaffSize); // ligat_y contient y original yy2 = y2; - y5 = y1+ m_doc->GetDrawingDoubleUnit(staff->staffSize); y2 += m_doc->GetDrawingDoubleUnit(staff->staffSize); // on monte d'un INTERL + y5 = y1+ m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); y2 += m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); // on monte d'un INTERL if (note->GetColored()==BOOLEAN_true) - DrawObliquePolygon ( dc, x1, y1, x2, yy2, m_doc->GetDrawingDoubleUnit(staff->staffSize)); + DrawObliquePolygon ( dc, x1, y1, x2, yy2, m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize)); else { DrawObliquePolygon ( dc, x1, y1, x2, yy2, 5); DrawObliquePolygon ( dc, x1, y5, x2, y2, -5); } - DrawVerticalLine ( dc,y3,y4,x2,m_doc->m_style->m_stemWidth); //cloture flagStemHeighte + DrawVerticalLine ( dc,y3,y4,x2,m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize)); //cloture flagStemHeighte View::s_drawingLigObliqua = false; // queue_lig = OFF; //desamorce alg.queue DUR_BR @@ -484,29 +484,29 @@ void View::DrawLigature ( DeviceContext *dc, int y, LayerElement *element, Layer } - y3 = y2 - m_doc->GetDrawingUnit(staff->staffSize)*6; + y3 = y2 - m_doc->GetDrawingUnit(staff->m_drawingStaffSize)*6; if (note->m_lig) { if (note->m_dur == DUR_BR) // && this->queue_lig) // queue gauche bas: DUR_BR initiale descendante // ax2 - no support of queue_lig (see WG corrigeLigature) { - DrawVerticalLine ( dc, y2, y3, x1, m_doc->m_style->m_stemWidth ); + DrawVerticalLine ( dc, y2, y3, x1, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) ); } else if (note->m_dur == DUR_LG) // && !this->queue_lig) // DUR_LG en ligature, queue droite bas // ax2 - no support of queue_lig { - DrawVerticalLine (dc, y2, y3, x2, m_doc->m_style->m_stemWidth ); + DrawVerticalLine (dc, y2, y3, x2, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) ); } else if (note->m_dur == DUR_1) // && this->queue_lig ) // queue gauche haut // ax2 - no support of queue_lig { - y2 = y1 + m_doc->GetDrawingUnit(staff->staffSize)*6; - DrawVerticalLine ( dc, y1, y2, x1, m_doc->m_style->m_stemWidth ); + y2 = y1 + m_doc->GetDrawingUnit(staff->m_drawingStaffSize)*6; + DrawVerticalLine ( dc, y1, y2, x1, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) ); } } else if (note->m_dur == DUR_LG) // DUR_LG isolee: queue comme notes normales */ if (note->GetActualDur() == DUR_LG) { - verticalCenter = staff->GetDrawingY() - m_doc->GetDrawingDoubleUnit(staff->staffSize)*2; + verticalCenter = staff->GetDrawingY() - m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize)*2; // ENZ up = (y < verticalCenter) ? ON : OFF; // ENZ @@ -521,14 +521,14 @@ void View::DrawLigature ( DeviceContext *dc, int y, LayerElement *element, Layer if (!up) { - y3 = y1 - m_doc->GetDrawingUnit(staff->staffSize)*8; + y3 = y1 - m_doc->GetDrawingUnit(staff->m_drawingStaffSize)*8; y2 = y1; } else { - y3 = y1 + m_doc->GetDrawingUnit(staff->staffSize)*6; + y3 = y1 + m_doc->GetDrawingUnit(staff->m_drawingStaffSize)*6; y2 = y1; } - DrawVerticalLine ( dc, y2,y3,x2, m_doc->m_style->m_stemWidth ); + DrawVerticalLine ( dc, y2,y3,x2, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) ); } return; diff --git a/src/view_page.cpp b/src/view_page.cpp index 5e2c434474c..f202efaf813 100644 --- a/src/view_page.cpp +++ b/src/view_page.cpp @@ -226,27 +226,29 @@ void View::DrawStaffGrp( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp return; } + int y_top = first->GetDrawingY(); // for the bottom position we need to take into account the number of lines and the staff size - int y_bottom = last->GetDrawingY() - (lastDef->GetLines() - 1) * m_doc->GetDrawingDoubleUnit(last->staffSize); + int y_bottom = last->GetDrawingY() - (lastDef->GetLines() - 1) * m_doc->GetDrawingDoubleUnit(last->m_drawingStaffSize); + int barLineWidth = m_doc->GetDrawingBarLineWidth(100); // ajdust the top and bottom according to staffline width - y_top += m_doc->m_style->m_staffLineWidth / 2; - y_bottom -= m_doc->m_style->m_staffLineWidth / 2; + y_top += m_doc->GetDrawingStaffLineWidth(100) / 2; + y_bottom -= m_doc->GetDrawingStaffLineWidth(100) / 2; // actually draw the line, the brace or the bracket if ( topStaffGrp && ( (firstDef != lastDef) || (staffGrp->GetSymbol() != STAFFGRP_NONE) ) ) { - DrawVerticalLine( dc , y_top, y_bottom, x, m_doc->m_style->m_barlineWidth ); + DrawVerticalLine( dc , y_top, y_bottom, x, barLineWidth); } // this will need to be changed with the next version of MEI will line means additional thick line if ( staffGrp->GetSymbol() == STAFFGRP_LINE ) { - DrawVerticalLine( dc , y_top, y_bottom, x, m_doc->m_style->m_barlineWidth ); + DrawVerticalLine( dc , y_top, y_bottom, x, barLineWidth); } else if ( staffGrp->GetSymbol() == STAFFGRP_BRACE ) { - DrawBrace ( dc, x, y_top, y_bottom, last->staffSize ); + DrawBrace ( dc, x, y_top, y_bottom, last->m_drawingStaffSize ); } else if ( staffGrp->GetSymbol() == STAFFGRP_BRACKET ) { - DrawBracket( dc, x, y_top, y_bottom, last->staffSize ); + DrawBracket( dc, x, y_top, y_bottom, last->m_drawingStaffSize ); x -= 2 * m_doc->GetDrawingBeamWidth(100, false) - m_doc->GetDrawingBeamWhiteWidth(100, false); } @@ -302,7 +304,7 @@ void View::DrawStaffDefLabels( DeviceContext *dc, Measure *measure, ScoreDef *sc } int x = system->GetDrawingX() - 3 * m_doc->GetDrawingBeamWidth(100, false); - int y = staff->GetDrawingY() - (staffDef->GetLines() * m_doc->GetDrawingDoubleUnit(staff->staffSize) / 2); + int y = staff->GetDrawingY() - (staffDef->GetLines() * m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) / 2); dc->SetBrush( m_currentColour, AxSOLID ); dc->SetFont(m_doc->GetDrawingLyricFont(100)); @@ -337,8 +339,8 @@ void View::DrawBracket ( DeviceContext *dc, int x, int y1, int y2, int staffSize // adjust to top and bottom position so we make sure the is not white space between // the glyphs and the line - y1 += m_doc->m_style->m_stemWidth; - y2 -= m_doc->m_style->m_stemWidth; + y1 += m_doc->GetDrawingStemWidth(100); + y2 -= m_doc->GetDrawingStemWidth(100); DrawFullRectangle(dc, x1 , y1, x2, y2 ); return; @@ -352,7 +354,7 @@ void View::DrawBrace ( DeviceContext *dc, int x, int y1, int y2, int staffSize) int new_coords[2][6]; Point points[4]; - int penWidth = m_doc->m_style->m_stemWidth; + int penWidth = m_doc->GetDrawingStemWidth(100); y1 -= penWidth; y2 += penWidth; SwapY( &y1, &y2 ); @@ -362,7 +364,7 @@ void View::DrawBrace ( DeviceContext *dc, int x, int y1, int y2, int staffSize) x -= m_doc->GetDrawingBeamWhiteWidth(staffSize, false); // distance entre barre et debut accolade ymed = (y1 + y2) / 2; - fact = m_doc->GetDrawingBeamWhiteWidth(staffSize, false) + m_doc->m_style->m_stemWidth; + fact = m_doc->GetDrawingBeamWhiteWidth(staffSize, false) + m_doc->GetDrawingStemWidth(100); xdec = ToDeviceContextX(fact); points[0].x = ToDeviceContextX(x); @@ -462,7 +464,7 @@ void View::DrawBarlines( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp } int y_top = staff->GetDrawingY(); // for the bottom position we need to take into account the number of lines and the staff size - int y_bottom = staff->GetDrawingY() - (childStaffDef->GetLines() - 1) * m_doc->GetDrawingDoubleUnit(staff->staffSize); + int y_bottom = staff->GetDrawingY() - (childStaffDef->GetLines() - 1) * m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); DrawBarline( dc, y_top, y_bottom, barLine ); if ( barLine->HasRepetitionDots() ) { DrawBarlineDots( dc, childStaffDef, staff, barLine ); @@ -499,7 +501,7 @@ void View::DrawBarlines( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp int y_top = first->GetDrawingY(); // for the bottom position we need to take into account the number of lines and the staff size - int y_bottom = last->GetDrawingY() - (lastDef->GetLines() - 1) * m_doc->GetDrawingDoubleUnit(last->staffSize); + int y_bottom = last->GetDrawingY() - (lastDef->GetLines() - 1) * m_doc->GetDrawingDoubleUnit(last->m_drawingStaffSize); DrawBarline( dc, y_top, y_bottom, barLine ); @@ -529,43 +531,44 @@ void View::DrawBarline( DeviceContext *dc, int y_top, int y_bottom, Barline *bar assert( barLine ); // adjust the top and bottom - y_top += m_doc->m_style->m_staffLineWidth / 2; - y_bottom -= m_doc->m_style->m_staffLineWidth / 2; + y_top += m_doc->GetDrawingStaffLineWidth(100) / 2; + y_bottom -= m_doc->GetDrawingStaffLineWidth(100) / 2; int x = barLine->GetDrawingX(); - int x1 = x - m_doc->GetDrawingBeamWidth(100, false) - m_doc->m_style->m_barlineWidth; - int x2 = x + m_doc->GetDrawingBeamWidth(100, false) + m_doc->m_style->m_barlineWidth; + int barLineWidth = m_doc->GetDrawingBarLineWidth(100); + int x1 = x - m_doc->GetDrawingBeamWidth(100, false) - barLineWidth; + int x2 = x + m_doc->GetDrawingBeamWidth(100, false) + barLineWidth; if (barLine->GetRend() == BARRENDITION_single) { - DrawVerticalLine( dc , y_top, y_bottom, x, m_doc->m_style->m_barlineWidth); + DrawVerticalLine( dc , y_top, y_bottom, x, barLineWidth); } else if (barLine->GetRend() == BARRENDITION_rptboth) { - DrawVerticalLine( dc , y_top, y_bottom, x1, m_doc->m_style->m_barlineWidth); + DrawVerticalLine( dc , y_top, y_bottom, x1, barLineWidth); DrawVerticalLine( dc , y_top, y_bottom, x, m_doc->GetDrawingBeamWidth(100, false)); - DrawVerticalLine( dc , y_top, y_bottom, x2, m_doc->m_style->m_barlineWidth); + DrawVerticalLine( dc , y_top, y_bottom, x2, barLineWidth); } else if (barLine->GetRend() == BARRENDITION_rptstart) { DrawVerticalLine( dc , y_top, y_bottom, x, m_doc->GetDrawingBeamWidth(100, false)); - DrawVerticalLine( dc , y_top, y_bottom, x2, m_doc->m_style->m_barlineWidth); + DrawVerticalLine( dc , y_top, y_bottom, x2, barLineWidth); } else if (barLine->GetRend() == BARRENDITION_rptend) { - DrawVerticalLine( dc , y_top, y_bottom, x1, m_doc->m_style->m_barlineWidth); + DrawVerticalLine( dc , y_top, y_bottom, x1, barLineWidth); DrawVerticalLine( dc , y_top, y_bottom, x, m_doc->GetDrawingBeamWidth(100, false)); } else if (barLine->GetRend() == BARRENDITION_dbl) { // Narrow the bars a little bit - should be centered? - x1 += m_doc->m_style->m_barlineWidth; - DrawVerticalLine( dc , y_top, y_bottom, x, m_doc->m_style->m_barlineWidth); - DrawVerticalLine( dc , y_top, y_bottom, x1, m_doc->m_style->m_barlineWidth); + x1 += barLineWidth; + DrawVerticalLine( dc , y_top, y_bottom, x, barLineWidth); + DrawVerticalLine( dc , y_top, y_bottom, x1, barLineWidth); } else if (barLine->GetRend() == BARRENDITION_end) { - DrawVerticalLine( dc , y_top, y_bottom, x1, m_doc->m_style->m_barlineWidth); + DrawVerticalLine( dc , y_top, y_bottom, x1, barLineWidth); DrawVerticalLine( dc , y_top, y_bottom, x, m_doc->GetDrawingBeamWidth(100, false)); } } @@ -579,22 +582,22 @@ void View::DrawBarlineDots ( DeviceContext *dc, StaffDef *staffDef, Staff *staff assert( barLine ); int x = barLine->GetDrawingX(); - int x1 = x - 2 * m_doc->GetDrawingBeamWidth(100, false) - m_doc->m_style->m_barlineWidth; - int x2 = x + 2 * m_doc->GetDrawingBeamWidth(100, false) + m_doc->m_style->m_barlineWidth; + int x1 = x - 2 * m_doc->GetDrawingBeamWidth(staff->m_drawingStaffSize, false) - m_doc->GetDrawingBarLineWidth(staff->m_drawingStaffSize); + int x2 = x + 2 * m_doc->GetDrawingBeamWidth(staff->m_drawingStaffSize, false) + m_doc->GetDrawingBarLineWidth(staff->m_drawingStaffSize); - int y_bottom = staff->GetDrawingY() - staffDef->GetLines() * m_doc->GetDrawingUnit(staff->staffSize); - int y_top = y_bottom + m_doc->GetDrawingDoubleUnit(staff->staffSize); + int y_bottom = staff->GetDrawingY() - staffDef->GetLines() * m_doc->GetDrawingUnit(staff->m_drawingStaffSize); + int y_top = y_bottom + m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); if ((barLine->GetRend() == BARRENDITION_rptstart) || (barLine->GetRend() == BARRENDITION_rptboth)) { - DrawDot(dc, x2, y_bottom ); - DrawDot(dc, x2, y_top ); + DrawDot(dc, x2, y_bottom, staff->m_drawingStaffSize); + DrawDot(dc, x2, y_top, staff->m_drawingStaffSize); } if ((barLine->GetRend() == BARRENDITION_rptend) || (barLine->GetRend() == BARRENDITION_rptboth)) { - DrawDot(dc, x1, y_bottom ); - DrawDot(dc, x1, y_top ); + DrawDot(dc, x1, y_bottom, staff->m_drawingStaffSize); + DrawDot(dc, x1, y_top, staff->m_drawingStaffSize); } return; @@ -645,16 +648,16 @@ int View::CalculatePitchPosY ( Staff *staff, data_PITCHNAME pname, int dec_clef, // Old Wolfgang code with octave stored in an unsigned char - this could be refactored oct -= OCTAVE_OFFSET; - y_int = ((dec_clef + oct*7) - 9 ) * m_doc->GetDrawingUnit(staff->staffSize); + y_int = ((dec_clef + oct*7) - 9 ) * m_doc->GetDrawingUnit(staff->m_drawingStaffSize); if (staff->m_drawingLines > 5) { - y_int -= ((staff->m_drawingLines - 5) * 2) * m_doc->GetDrawingUnit(staff->staffSize); + y_int -= ((staff->m_drawingLines - 5) * 2) * m_doc->GetDrawingUnit(staff->m_drawingStaffSize); } /* exprime distance separant m_drawingY de position 1e Si, corrigee par dec_clef et oct. Elle est additionnee ensuite, donc elle doit etre NEGATIVE si plus bas que m_drawingY */ for (i=0; i<(signed)sizeof(touches); i++) { - if (*(ptouche+i) == pname) return (y_int += ((i+1)*m_doc->GetDrawingUnit(staff->staffSize))); + if (*(ptouche+i) == pname) return (y_int += ((i+1)*m_doc->GetDrawingUnit(staff->m_drawingStaffSize))); } return 0; } @@ -663,7 +666,7 @@ int View::CalculateRestPosY ( Staff *staff, char duration) { assert(staff); // Pointer to staff cannot be NULL" - int staff_space = m_doc->GetDrawingUnit(staff->staffSize); + int staff_space = m_doc->GetDrawingUnit(staff->m_drawingStaffSize); int base = -17 * staff_space; // -17 is a magic number copied from above int offset; @@ -697,6 +700,9 @@ void View::DrawStaff( DeviceContext *dc, Staff *staff, Measure *measure, System // Doing it here might be problematic with cross-staff, even though the default value will be 5 if ( StaffDef *staffDef = m_drawingScoreDef.GetStaffDef( staff->GetN() ) ) { staff->m_drawingLines = staffDef->GetLines( ) ; + if (staffDef->HasScale()) { + staff->m_drawingStaffSize = staffDef->GetScale(); + } } DrawStaffLines( dc, staff, measure, system ); @@ -730,17 +736,16 @@ void View::DrawStaffLines( DeviceContext *dc, Staff *staff, Measure *measure, Sy //x2 = m_doc->m_drawingPageWidth - m_doc->m_drawingPageLeftMar - m_doc->m_drawingPageRightMar - system->m_systemRightMar; x1 = measure->GetDrawingX(); - x2 = x1 + measure->GetWidth(); // - m_doc->m_style->m_barlineWidth / 2; + x2 = x1 + measure->GetWidth(); - dc->SetPen( m_currentColour, ToDeviceContextX( m_doc->m_style->m_staffLineWidth ), AxSOLID ); + dc->SetPen( m_currentColour, ToDeviceContextX( m_doc->GetDrawingStaffLineWidth(staff->m_drawingStaffSize) ), AxSOLID ); dc->SetBrush( m_currentColour , AxSOLID ); for(j = 0;j < staff->m_drawingLines; j++) { dc->DrawLine( ToDeviceContextX (x1) , ToDeviceContextY ( yy ) , ToDeviceContextX (x2) , ToDeviceContextY ( yy ) ); // For drawing rectangles insteam of line - //DrawFullRectangle(dc, x1, yy - m_doc->m_style->m_barlineWidth / 2, x2, yy + m_doc->m_style->m_barlineWidth / 2 ); - yy -= m_doc->GetDrawingDoubleUnit(staff->staffSize); + yy -= m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); } staff->m_drawingHeight = staff->GetDrawingY() - yy; @@ -772,7 +777,7 @@ int View::CalculatePitchCode ( Layer *layer, int y_n, int x_pos, int *octave ) int degres, octaves, position, code; char clefId=0; - int staffSize = parentStaff->staffSize; + int staffSize = parentStaff->m_drawingStaffSize; // calculer position du do central en fonction clef //y_n += (int) m_doc->GetDrawingUnit(staffSize)/4; yb = parentStaff->GetDrawingY() - m_doc->GetDrawingStaffSize(staffSize); // UT1 default diff --git a/src/view_tuplet.cpp b/src/view_tuplet.cpp index 14275e329e8..e65f849f753 100644 --- a/src/view_tuplet.cpp +++ b/src/view_tuplet.cpp @@ -242,7 +242,7 @@ void View::DrawTupletPostponed( DeviceContext *dc, Tuplet *tuplet, Layer *layer, std::wstring notes; // - dc->SetFont(m_doc->GetDrawingSmuflFont(staff->staffSize, tuplet->IsCueSize())); + dc->SetFont(m_doc->GetDrawingSmuflFont(staff->m_drawingStaffSize, tuplet->IsCueSize())); if (tuplet->GetNum() > 0) { notes = IntToTupletFigures((short int)tuplet->GetNum()); @@ -258,17 +258,17 @@ void View::DrawTupletPostponed( DeviceContext *dc, Tuplet *tuplet, Layer *layer, int txt_x = center.x - (txt_length / 2); // we need to move down the figure of half of it height, which is about an accid width; // also, cue size is not supported. Does it has to? - int txt_y = center.y - m_doc->GetGlyphWidth(SMUFL_E262_accidentalSharp, staff->staffSize, tuplet->IsCueSize()); + int txt_y = center.y - m_doc->GetGlyphWidth(SMUFL_E262_accidentalSharp, staff->m_drawingStaffSize, tuplet->IsCueSize()); if (tuplet->GetNum()) { - DrawSmuflString(dc, txt_x, txt_y, notes, false, staff->staffSize); + DrawSmuflString(dc, txt_x, txt_y, notes, false, staff->m_drawingStaffSize); } dc->ResetFont(); int verticalLine = m_doc->GetDrawingUnit(100); - dc->SetPen(m_currentColour, m_doc->m_style->m_stemWidth, AxSOLID); + dc->SetPen(m_currentColour, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize), AxSOLID); // Start is 0 when no line is necessary (i.e. beamed notes) if (start.x > 0) { From 67d8de9d84df563b470704f00a844ef165fa6497 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Wed, 19 Aug 2015 00:20:21 +0200 Subject: [PATCH 074/114] Taking into account bracket.visible and num.visible in tuplet --- libmei/atts_cmn.cpp | 24 ++++++++++++------------ libmei/atts_cmn.h | 12 ++++++------ src/view_tuplet.cpp | 31 +++++++++++++++++++++++-------- 3 files changed, 41 insertions(+), 26 deletions(-) diff --git a/libmei/atts_cmn.cpp b/libmei/atts_cmn.cpp index 50def276fe2..76739fd5875 100644 --- a/libmei/atts_cmn.cpp +++ b/libmei/atts_cmn.cpp @@ -1178,19 +1178,19 @@ AttNumberplacement::~AttNumberplacement() { } void AttNumberplacement::ResetNumberplacement() { - m_numPlace = ""; - m_numVisible = ""; + m_numPlace = PLACE_NONE; + m_numVisible = BOOLEAN_NONE; } bool AttNumberplacement::ReadNumberplacement( pugi::xml_node element ) { bool hasAttribute = false; if (element.attribute("num.place")) { - this->SetNumPlace(StrToStr(element.attribute("num.place").value())); + this->SetNumPlace(StrToPlace(element.attribute("num.place").value())); element.remove_attribute("num.place"); hasAttribute = true; } if (element.attribute("num.visible")) { - this->SetNumVisible(StrToStr(element.attribute("num.visible").value())); + this->SetNumVisible(StrToBool(element.attribute("num.visible").value())); element.remove_attribute("num.visible"); hasAttribute = true; } @@ -1200,11 +1200,11 @@ bool AttNumberplacement::ReadNumberplacement( pugi::xml_node element ) { bool AttNumberplacement::WriteNumberplacement( pugi::xml_node element ) { bool wroteAttribute = false; if (this->HasNumPlace()) { - element.append_attribute("num.place") = StrToStr(this->GetNumPlace()).c_str(); + element.append_attribute("num.place") = PlaceToStr(this->GetNumPlace()).c_str(); wroteAttribute = true; } if (this->HasNumVisible()) { - element.append_attribute("num.visible") = StrToStr(this->GetNumVisible()).c_str(); + element.append_attribute("num.visible") = BoolToStr(this->GetNumVisible()).c_str(); wroteAttribute = true; } return wroteAttribute; @@ -1212,12 +1212,12 @@ bool AttNumberplacement::WriteNumberplacement( pugi::xml_node element ) { bool AttNumberplacement::HasNumPlace( ) { - return (m_numPlace != ""); + return (m_numPlace != PLACE_NONE); } bool AttNumberplacement::HasNumVisible( ) { - return (m_numVisible != ""); + return (m_numVisible != BOOLEAN_NONE); } @@ -1985,11 +1985,11 @@ bool Att::SetCmn( Object *element, std::string attrType, std::string attrValue ) AttNumberplacement *att = dynamic_cast(element); assert( att ); if (attrType == "numPlace") { - att->SetNumPlace(att->StrToStr(attrValue)); + att->SetNumPlace(att->StrToPlace(attrValue)); return true; } if (attrType == "numVisible") { - att->SetNumVisible(att->StrToStr(attrValue)); + att->SetNumVisible(att->StrToBool(attrValue)); return true; } } @@ -2297,10 +2297,10 @@ void Att::GetCmn( Object *element, ArrayOfStrAttr *attributes ) { AttNumberplacement *att = dynamic_cast(element); assert( att ); if (att->HasNumPlace()) { - attributes->push_back(std::make_pair("numPlace", att->StrToStr(att->GetNumPlace()))); + attributes->push_back(std::make_pair("numPlace", att->PlaceToStr(att->GetNumPlace()))); } if (att->HasNumVisible()) { - attributes->push_back(std::make_pair("numVisible", att->StrToStr(att->GetNumVisible()))); + attributes->push_back(std::make_pair("numVisible", att->BoolToStr(att->GetNumVisible()))); } } if (element->HasAttClass( ATT_OCTAVELOG ) ) { diff --git a/libmei/atts_cmn.h b/libmei/atts_cmn.h index f6fc3944977..0427fa217e9 100644 --- a/libmei/atts_cmn.h +++ b/libmei/atts_cmn.h @@ -1034,22 +1034,22 @@ class AttNumberplacement: public Att * to the default value) **/ ///@{ - void SetNumPlace(std::string numPlace_) { m_numPlace = numPlace_; }; - std::string GetNumPlace() const { return m_numPlace; }; + void SetNumPlace(data_PLACE numPlace_) { m_numPlace = numPlace_; }; + data_PLACE GetNumPlace() const { return m_numPlace; }; bool HasNumPlace( ); // - void SetNumVisible(std::string numVisible_) { m_numVisible = numVisible_; }; - std::string GetNumVisible() const { return m_numVisible; }; + void SetNumVisible(data_BOOLEAN numVisible_) { m_numVisible = numVisible_; }; + data_BOOLEAN GetNumVisible() const { return m_numVisible; }; bool HasNumVisible( ); ///@} private: /** States where the tuplet number will be placed in relation to the note heads. **/ - std::string m_numPlace; + data_PLACE m_numPlace; /** Determines if the tuplet number is visible. **/ - std::string m_numVisible; + data_BOOLEAN m_numVisible; /* include */ }; diff --git a/src/view_tuplet.cpp b/src/view_tuplet.cpp index e65f849f753..92482d9481c 100644 --- a/src/view_tuplet.cpp +++ b/src/view_tuplet.cpp @@ -234,6 +234,10 @@ void View::DrawTupletPostponed( DeviceContext *dc, Tuplet *tuplet, Layer *layer, assert( layer ); assert( staff ); + if ((tuplet->GetBracketVisible() == BOOLEAN_false) && (tuplet->GetNumVisible() == BOOLEAN_false)) { + return; + } + tuplet->ResetList(tuplet); int txt_length = 0; @@ -260,12 +264,17 @@ void View::DrawTupletPostponed( DeviceContext *dc, Tuplet *tuplet, Layer *layer, // also, cue size is not supported. Does it has to? int txt_y = center.y - m_doc->GetGlyphWidth(SMUFL_E262_accidentalSharp, staff->m_drawingStaffSize, tuplet->IsCueSize()); - if (tuplet->GetNum()) { + if (tuplet->GetNum() && (tuplet->GetNumVisible() != BOOLEAN_false)) { DrawSmuflString(dc, txt_x, txt_y, notes, false, staff->m_drawingStaffSize); } dc->ResetFont(); + // Nothing to do if the bracket is not visible + if (tuplet->GetBracketVisible() == BOOLEAN_false) { + return; + } + int verticalLine = m_doc->GetDrawingUnit(100); dc->SetPen(m_currentColour, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize), AxSOLID); @@ -278,19 +287,25 @@ void View::DrawTupletPostponed( DeviceContext *dc, Tuplet *tuplet, Layer *layer, double m = (double)(start.y - end.y) / (double)(start.x - end.x); // x = 10 pixels before the number - double x = txt_x - 40; + int x = txt_x - 40; // xa = just after, the number is abundant so I do not add anything - double xa = txt_x + txt_length + 20; + int xa = txt_x + txt_length + 20; // calculate the y coords in the slope double y1 = (double)start.y + m * (x - (double)start.x); double y2 = (double)start.y + m * (xa - (double)start.x); - // first line - dc->DrawLine(start.x, ToDeviceContextY(start.y), (int)x, ToDeviceContextY((int)y1)); - // second line after gap - dc->DrawLine((int)xa, ToDeviceContextY((int)y2), end.x, ToDeviceContextY(end.y)); - + if (tuplet->GetNumVisible() == BOOLEAN_false) { + // one single line + dc->DrawLine(start.x, ToDeviceContextY(start.y), end.x, ToDeviceContextY((int)y1)); + } + else { + // first line + dc->DrawLine(start.x, ToDeviceContextY(start.y), (int)x, ToDeviceContextY((int)y1)); + // second line after gap + dc->DrawLine((int)xa, ToDeviceContextY((int)y2), end.x, ToDeviceContextY(end.y)); + } + // vertical bracket lines if (direction == STEMDIRECTION_up) { dc->DrawLine(start.x, ToDeviceContextY(start.y), start.x, ToDeviceContextY(start.y - verticalLine)); From 12974fb35868be3997c9aff63091df202a0b0948 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Wed, 19 Aug 2015 09:32:43 +0200 Subject: [PATCH 075/114] Removing unused defines --- include/vrv/scoredef.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/include/vrv/scoredef.h b/include/vrv/scoredef.h index e145a900c0f..602addd5033 100644 --- a/include/vrv/scoredef.h +++ b/include/vrv/scoredef.h @@ -25,13 +25,6 @@ class MeterSigAttr; class StaffGrp; class StaffDef; -// unused? LP -#define STAFFDEF_DRAW_NONE 0 -#define STAFFDEF_DRAW_CLEF (1<<0) -#define STAFFDEF_DRAW_KEYSIG (1<<1) -#define STAFFDEF_DRAW_MENSUR (1<<2) -#define STAFFDEF_DRAW_ALL (1<<3) - 1 - //---------------------------------------------------------------------------- // ScoreOrStaffDefAttrInterface //---------------------------------------------------------------------------- From 921d3c7a8d1a1f6df1984abcf8f3e1d8510c51c6 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Wed, 19 Aug 2015 10:47:04 +0200 Subject: [PATCH 076/114] Adding curvedir support to slur and clarifying stem direction in notes --- include/vrv/att.h | 3 + include/vrv/attdef.h | 11 ++- include/vrv/chord.h | 3 +- include/vrv/layerelement.h | 6 ++ include/vrv/note.h | 22 ++++-- include/vrv/slur.h | 3 +- include/vrv/view.h | 4 +- libmei/atts_shared.cpp | 12 ++-- libmei/atts_shared.h | 6 +- src/att.cpp | 26 ++++++- src/iomei.cpp | 4 ++ src/layerelement.cpp | 15 ++++ src/note.cpp | 7 +- src/slur.cpp | 7 +- src/view_beam.cpp | 2 +- src/view_element.cpp | 21 +++--- src/view_floating.cpp | 138 ++++++++++++++++++++++++++++--------- src/view_mensural.cpp | 21 +++--- 18 files changed, 227 insertions(+), 84 deletions(-) diff --git a/include/vrv/att.h b/include/vrv/att.h index 7092c978d18..19ac9f433b9 100644 --- a/include/vrv/att.h +++ b/include/vrv/att.h @@ -119,6 +119,9 @@ class Att std::string ConToStr(data_CON data); data_CON StrToCon(std::string value); + std::string CurvedirToStr(data_CURVEDIR data); + data_CURVEDIR StrToCurvedir(std::string value); + std::string DurToStr(data_DURATION data); data_DURATION StrToDur(std::string value); diff --git a/include/vrv/attdef.h b/include/vrv/attdef.h index a12f73a79e2..ab17294a02e 100644 --- a/include/vrv/attdef.h +++ b/include/vrv/attdef.h @@ -147,6 +147,15 @@ enum data_CON { CON_i, CON_b }; + +/** + * MEI values for @curvedir (no datatype in MEI) + */ +enum data_CURVEDIR { + CURVEDIR_NONE = 0, + CURVEDIR_above, + CURVEDIR_below +}; /** * MEI data.DURATION @@ -336,7 +345,7 @@ enum data_OCTAVE_DIS { }; /** - * MEI data.PERCENT + * MEI value for @scale (no datatype in MEI) */ typedef int data_PERCENT; diff --git a/include/vrv/chord.h b/include/vrv/chord.h index ff965da2b77..8d0c09676a2 100644 --- a/include/vrv/chord.h +++ b/include/vrv/chord.h @@ -68,12 +68,11 @@ class Chord: public LayerElement, public ObjectListInterface, public DurationInt void ResetAccidSpace(int fullUnit); /** - * @name Set and get the stem direction of the beam. + * @name Set and get the stem direction of the chord. */ ///@{ void SetDrawingStemDir( data_STEMDIRECTION stemDirection ) { m_drawingStemDir = stemDirection; }; data_STEMDIRECTION GetDrawingStemDir() { return m_drawingStemDir; }; - ///@} //----------// diff --git a/include/vrv/layerelement.h b/include/vrv/layerelement.h index 102e76804d8..0bd7be1e839 100644 --- a/include/vrv/layerelement.h +++ b/include/vrv/layerelement.h @@ -78,6 +78,12 @@ class LayerElement: public DocObject * Returns true if the element is a note or a note child and the note has a @grace */ bool IsCueSize(); + + /** + * Returns the drawing stem direction if the element is a note or a chord. + * (Could one day go in a drawing stem interface) + */ + data_STEMDIRECTION GetDrawingStemDir(); Alignment *GetAlignment() { return m_alignment; }; diff --git a/include/vrv/note.h b/include/vrv/note.h index 790b1c5f70b..dabff061db3 100644 --- a/include/vrv/note.h +++ b/include/vrv/note.h @@ -96,13 +96,21 @@ class Note: public LayerElement, public DurationInterface, public PitchInterface Chord* IsChordTone( ); int GetDrawingDur( ); bool IsClusterExtreme( ); //used to find if is the highest or lowest note in a cluster - - bool HasDrawingStemDir( ); - data_STEMDIRECTION GetDrawingStemDir( ); - - + ///@} + + /** + * @name Set and get the stem direction of the note. + */ + ///@{ + void SetDrawingStemDir( data_STEMDIRECTION stemDirection ) { m_drawingStemDir = stemDirection; }; + data_STEMDIRECTION GetDrawingStemDir() { return m_drawingStemDir; }; ///@} + /** + * Calculate the drawing stem direction looking a potential beam or chord parents + */ + data_STEMDIRECTION CalcDrawingStemDir( ); + /** * Returns a single integer representing pitch and octave. */ @@ -143,8 +151,6 @@ class Note: public LayerElement, public DurationInterface, public PitchInterface /** embellishment on this note **/ unsigned int m_embellishment; // To be changed to Att - /** drawing stem direction */ - data_STEMDIRECTION m_drawingStemDir; /** drawing stem length */ int d_stemLen; @@ -172,6 +178,8 @@ class Note: public LayerElement, public DurationInterface, public PitchInterface * An alignment for grace notes */ Alignment *m_graceAlignment; + /** drawing stem direction */ + data_STEMDIRECTION m_drawingStemDir; }; diff --git a/include/vrv/slur.h b/include/vrv/slur.h index 16e13038799..d5f5d069ddb 100644 --- a/include/vrv/slur.h +++ b/include/vrv/slur.h @@ -18,7 +18,8 @@ namespace vrv { // Slur //---------------------------------------------------------------------------- -class Slur: public FloatingElement, public TimeSpanningInterface +class Slur: public FloatingElement, public TimeSpanningInterface, + public AttCurvature { public: /** diff --git a/include/vrv/view.h b/include/vrv/view.h index c2f3c6c62d8..ec645bea359 100644 --- a/include/vrv/view.h +++ b/include/vrv/view.h @@ -256,7 +256,9 @@ class View Staff *staff, char spanningType, DocObject *graphic = NULL ); void DrawSylConnectorLines( DeviceContext *dc, int x1, int x2, int y, Syl *syl, Staff *staff ); void DrawTimeSpanningElement( DeviceContext *dc, DocObject *object, System *system ); - void DrawTieOrSlur( DeviceContext *dc, FloatingElement *element, int x1, int x2, + void DrawSlur( DeviceContext *dc, Slur *slur, int x1, int x2, + Staff *staff, char spanningType, DocObject *graphic = NULL ); + void DrawTie( DeviceContext *dc, Tie *tie, int x1, int x2, Staff *staff, char spanningType, DocObject *graphic = NULL ); ///@} diff --git a/libmei/atts_shared.cpp b/libmei/atts_shared.cpp index 4cdd1e61ed6..ec849f617a5 100644 --- a/libmei/atts_shared.cpp +++ b/libmei/atts_shared.cpp @@ -1268,7 +1268,7 @@ AttCurvature::~AttCurvature() { void AttCurvature::ResetCurvature() { m_bezier = ""; m_bulge = ""; - m_curvedir = ""; + m_curvedir = CURVEDIR_NONE; } bool AttCurvature::ReadCurvature( pugi::xml_node element ) { @@ -1284,7 +1284,7 @@ bool AttCurvature::ReadCurvature( pugi::xml_node element ) { hasAttribute = true; } if (element.attribute("curvedir")) { - this->SetCurvedir(StrToStr(element.attribute("curvedir").value())); + this->SetCurvedir(StrToCurvedir(element.attribute("curvedir").value())); element.remove_attribute("curvedir"); hasAttribute = true; } @@ -1302,7 +1302,7 @@ bool AttCurvature::WriteCurvature( pugi::xml_node element ) { wroteAttribute = true; } if (this->HasCurvedir()) { - element.append_attribute("curvedir") = StrToStr(this->GetCurvedir()).c_str(); + element.append_attribute("curvedir") = CurvedirToStr(this->GetCurvedir()).c_str(); wroteAttribute = true; } return wroteAttribute; @@ -1320,7 +1320,7 @@ bool AttCurvature::HasBulge( ) bool AttCurvature::HasCurvedir( ) { - return (m_curvedir != ""); + return (m_curvedir != CURVEDIR_NONE); } @@ -7205,7 +7205,7 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } if (attrType == "curvedir") { - att->SetCurvedir(att->StrToStr(attrValue)); + att->SetCurvedir(att->StrToCurvedir(attrValue)); return true; } } @@ -8587,7 +8587,7 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("bulge", att->StrToStr(att->GetBulge()))); } if (att->HasCurvedir()) { - attributes->push_back(std::make_pair("curvedir", att->StrToStr(att->GetCurvedir()))); + attributes->push_back(std::make_pair("curvedir", att->CurvedirToStr(att->GetCurvedir()))); } } if (element->HasAttClass( ATT_CURVEREND ) ) { diff --git a/libmei/atts_shared.h b/libmei/atts_shared.h index 4dda52bbee5..4b92719eb4c 100644 --- a/libmei/atts_shared.h +++ b/libmei/atts_shared.h @@ -1123,8 +1123,8 @@ class AttCurvature: public Att bool HasBulge( ); // - void SetCurvedir(std::string curvedir_) { m_curvedir = curvedir_; }; - std::string GetCurvedir() const { return m_curvedir; }; + void SetCurvedir(data_CURVEDIR curvedir_) { m_curvedir = curvedir_; }; + data_CURVEDIR GetCurvedir() const { return m_curvedir; }; bool HasCurvedir( ); ///@} @@ -1143,7 +1143,7 @@ class AttCurvature: public Att **/ std::string m_bulge; /** Describes a curve with a generic term indicating the direction of curvature. **/ - std::string m_curvedir; + data_CURVEDIR m_curvedir; /* include */ }; diff --git a/src/att.cpp b/src/att.cpp index f4a7aa00828..107ef5f5c41 100644 --- a/src/att.cpp +++ b/src/att.cpp @@ -211,7 +211,6 @@ std::string Att::BoolToStr(data_BOOLEAN data) break; } return value; - } data_BOOLEAN Att::StrToBool(std::string value) @@ -294,6 +293,31 @@ data_CON Att::StrToCon(std::string value) return CON_NONE; } +std::string Att::CurvedirToStr(data_CURVEDIR data) +{ + std::string value; + switch(data) + { + case CURVEDIR_above : value = "above"; break; + case CURVEDIR_below: value = "below"; break; + default: + LogWarning("Unknown curvedir '%d'", data); + value = ""; + break; + } + return value; +} + +data_CURVEDIR Att::StrToCurvedir(std::string value) +{ + if (value == "above") return CURVEDIR_above; + else if (value == "below") return CURVEDIR_below; + else { + LogWarning("Unsupported curvedir '%s'", value.c_str() ); + } + return CURVEDIR_NONE; +} + std::string Att::DurToStr(data_DURATION data) { std::string value; diff --git a/src/iomei.cpp b/src/iomei.cpp index 039dd1cb5dc..163fda6be26 100644 --- a/src/iomei.cpp +++ b/src/iomei.cpp @@ -497,6 +497,8 @@ void MeiOutput::WriteMeiSlur( pugi::xml_node currentNode, Slur *slur ) currentNode.append_attribute( "xml:id" ) = UuidToMeiStr( slur ).c_str(); + slur->WriteCurvature(currentNode); + WriteTimeSpanningInterface(currentNode, slur); return; @@ -1485,6 +1487,8 @@ bool MeiInput::ReadMeiSlur( Object *parent, pugi::xml_node slur ) Slur *vrvSlur = new Slur(); SetMeiUuid(slur, vrvSlur); + vrvSlur->ReadCurvature(slur); + ReadTimeSpanningInterface(slur, vrvSlur); AddFloatingElement(parent, vrvSlur); diff --git a/src/layerelement.cpp b/src/layerelement.cpp index fbaeb762e96..e6fa6e0a24f 100644 --- a/src/layerelement.cpp +++ b/src/layerelement.cpp @@ -107,6 +107,21 @@ bool LayerElement::IsGraceNote() return (note && note->HasGrace()); } +data_STEMDIRECTION LayerElement::GetDrawingStemDir() +{ + if (this->Is() == NOTE) { + Note *note = dynamic_cast(this); + assert( note ); + return note->GetDrawingStemDir(); + } + if (this->Is() == CHORD) { + Chord *chord = dynamic_cast(this); + assert( chord ); + return chord->GetDrawingStemDir(); + } + return STEMDIRECTION_NONE; +} + bool LayerElement::IsCueSize() { if ( this->Is() == NOTE ) { diff --git a/src/note.cpp b/src/note.cpp index f98c7013fbc..d6cabaa991e 100644 --- a/src/note.cpp +++ b/src/note.cpp @@ -164,12 +164,7 @@ bool Note::IsClusterExtreme() else return false; } -bool Note::HasDrawingStemDir() -{ - return (this->GetDrawingStemDir() != STEMDIRECTION_NONE); -} - -data_STEMDIRECTION Note::GetDrawingStemDir() +data_STEMDIRECTION Note::CalcDrawingStemDir() { Chord* chordParent = dynamic_cast(this->GetFirstParent( CHORD, MAX_CHORD_DEPTH)); Beam* beamParent = dynamic_cast(this->GetFirstParent( BEAM, MAX_BEAM_DEPTH)); diff --git a/src/slur.cpp b/src/slur.cpp index ec06209cd7e..50764eebdf9 100644 --- a/src/slur.cpp +++ b/src/slur.cpp @@ -21,8 +21,11 @@ namespace vrv { //---------------------------------------------------------------------------- Slur::Slur(): - FloatingElement("slur-"), TimeSpanningInterface() + FloatingElement("slur-"), TimeSpanningInterface(), + AttCurvature() { + RegisterAttClass(ATT_CURVATURE); + RegisterInterface( TimeSpanningInterface::GetAttClasses(), TimeSpanningInterface::IsInterface() ); Reset(); @@ -37,6 +40,8 @@ void Slur::Reset() { FloatingElement::Reset(); TimeSpanningInterface::Reset(); + + ResetCurvature(); } } // namespace vrv diff --git a/src/view_beam.cpp b/src/view_beam.cpp index ac80b79c4bb..fe7bc16b224 100644 --- a/src/view_beam.cpp +++ b/src/view_beam.cpp @@ -289,7 +289,7 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta { //change the stem dir for all objects if ( (*beamElementCoords)[i]->m_element->Is() == NOTE ) { - ((Note*)(*beamElementCoords)[i]->m_element)->m_drawingStemDir = stemDir; + ((Note*)(*beamElementCoords)[i]->m_element)->SetDrawingStemDir( stemDir ); } else if ( (*beamElementCoords)[i]->m_element->Is() == CHORD ) { ((Chord*)(*beamElementCoords)[i]->m_element)->SetDrawingStemDir(stemDir); diff --git a/src/view_element.cpp b/src/view_element.cpp index ce8cac0fa84..a772c03287a 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -258,19 +258,20 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St /************** Stem/notehead direction: **************/ verticalCenter = staffY - m_doc->GetDrawingDoubleUnit(staffSize)*2; - if ( note->HasDrawingStemDir() ) { - note->m_drawingStemDir = note->GetDrawingStemDir(); + data_STEMDIRECTION noteStemDir = note->CalcDrawingStemDir(); + if ( noteStemDir != STEMDIRECTION_NONE ) { + note->SetDrawingStemDir( noteStemDir ); } else if ( layer->GetDrawingStemDir() != STEMDIRECTION_NONE) { - note->m_drawingStemDir = layer->GetDrawingStemDir(); + note->SetDrawingStemDir( layer->GetDrawingStemDir() ); } else { - note->m_drawingStemDir = (noteY >= verticalCenter) ? STEMDIRECTION_down : STEMDIRECTION_up; + note->SetDrawingStemDir( (noteY >= verticalCenter) ? STEMDIRECTION_down : STEMDIRECTION_up ); } //if the note is clustered, calculations are different if (note->m_cluster) { - if (note->m_drawingStemDir == STEMDIRECTION_down) { + if (note->GetDrawingStemDir() == STEMDIRECTION_down) { //stem down/even cluster = noteheads start on left (incorrect side) if (note->m_cluster->size() % 2 == 0) { flippedNotehead = (note->m_clusterPosition % 2 != 0); @@ -304,10 +305,10 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St else { //if we have a flipped notehead, we need to be in a chord assert(inChord); - if (note->m_drawingStemDir == STEMDIRECTION_up) { + if (note->GetDrawingStemDir() == STEMDIRECTION_up) { xNote = xStem + radius - m_doc->GetDrawingStemWidth(staffSize); } - else if (note->m_drawingStemDir == STEMDIRECTION_down) { + else if (note->GetDrawingStemDir() == STEMDIRECTION_down) { xNote = xStem - radius * 3 + m_doc->GetDrawingStemWidth(staffSize); } else { @@ -346,7 +347,7 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St DrawSmuflCode( dc, xNote, noteY, fontNo, staff->m_drawingStaffSize, drawingCueSize ); if (!(inBeam && drawingDur > DUR_4) && !inChord) { - DrawStem(dc, note, staff, note->m_drawingStemDir, radius, xStem, noteY); + DrawStem(dc, note, staff, note->GetDrawingStemDir(), radius, xStem, noteY); } } @@ -401,7 +402,7 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St if (note->GetDots() && !inChord) { int xDot; - if (note->GetActualDur() < DUR_2 || (note->GetActualDur() > DUR_8 && !inBeam && (note->m_drawingStemDir == STEMDIRECTION_up))) + if (note->GetActualDur() < DUR_2 || (note->GetActualDur() > DUR_8 && !inBeam && (note->GetDrawingStemDir() == STEMDIRECTION_up))) xDot = xStem + m_doc->GetDrawingUnit(staffSize)*7/2; else xDot = xStem + m_doc->GetDrawingUnit(staffSize)*5/2; @@ -1461,7 +1462,7 @@ void View::DrawAccid( DeviceContext *dc, LayerElement *element, Layer *layer, St if ( note->GetDrawingY() > y ) { y = note->GetDrawingY() + m_doc->GetDrawingUnit(staff->m_drawingStaffSize); } - if ( (note->m_drawingStemDir == STEMDIRECTION_up) && (note->m_drawingStemEnd.y > y )) { + if ( (note->GetDrawingStemDir() == STEMDIRECTION_up) && (note->m_drawingStemEnd.y > y )) { y = note->m_drawingStemEnd.y; } diff --git a/src/view_floating.cpp b/src/view_floating.cpp index e617875b2cb..e55f4e44c0b 100644 --- a/src/view_floating.cpp +++ b/src/view_floating.cpp @@ -164,7 +164,7 @@ void View::DrawTimeSpanningElement( DeviceContext *dc, DocObject *element, Syste if (element->Is() == SLUR) { // cast to Slur check in DrawTieOrSlur - DrawTieOrSlur(dc, dynamic_cast(element), x1, x2, staff, spanningType, graphic); + DrawSlur(dc, dynamic_cast(element), x1, x2, staff, spanningType, graphic); } else if (element->Is() == SYL) { // cast to Syl check in DrawSylConnector @@ -172,23 +172,18 @@ void View::DrawTimeSpanningElement( DeviceContext *dc, DocObject *element, Syste } else if (element->Is() == TIE) { // cast to Slur check in DrawTieOrSlur - DrawTieOrSlur(dc, dynamic_cast(element), x1, x2, staff, spanningType, graphic); + DrawTie(dc, dynamic_cast(element), x1, x2, staff, spanningType, graphic); } } -void View::DrawTieOrSlur( DeviceContext *dc, FloatingElement *element, int x1, int x2, Staff *staff, +void View::DrawSlur( DeviceContext *dc, Slur *slur, int x1, int x2, Staff *staff, char spanningType, DocObject *graphic ) { assert( dc ); - assert( element ); + assert( slur ); assert( staff ); - assert(dynamic_cast(element) || dynamic_cast(element)); // Element must be a Tie or a Slur - - TimeSpanningInterface *interface = dynamic_cast(element); - assert( interface ); - LayerElement *element1 = NULL; LayerElement *element2 = NULL; @@ -196,31 +191,20 @@ void View::DrawTieOrSlur( DeviceContext *dc, FloatingElement *element, int x1, i data_STEMDIRECTION noteStemDir = STEMDIRECTION_NONE; int y1, y2; - element1 = interface->GetStart(); - element2 = interface->GetEnd(); + element1 = slur->GetStart(); + element2 = slur->GetEnd(); if ( !element1 || !element2 ) { // no note, obviously nothing to do... return; } - Note *note1 = NULL; - Note *note2 = NULL; - Chord *chord1 = NULL; - Chord *chord2 = NULL; - if (element1->Is() == NOTE ) note1 = dynamic_cast(element1); - else chord1 = dynamic_cast(element1); - assert( note1 || chord1 ); - if (element2->Is() == NOTE ) note2 = dynamic_cast(element2); - else chord2 = dynamic_cast(element2); - assert( note2 || chord2 ); - Layer* layer1 = dynamic_cast(element1->GetFirstParent( LAYER ) ); Layer* layer2 = dynamic_cast(element2->GetFirstParent( LAYER ) ); assert( layer1 && layer2 ); if ( layer1->GetN() != layer2->GetN() ) { - LogWarning("Ties between different layers may not be fully supported."); + LogWarning("Slur between different layers may not be fully supported."); } //the normal case @@ -230,27 +214,113 @@ void View::DrawTieOrSlur( DeviceContext *dc, FloatingElement *element, int x1, i // but then we have to take in account (1) beams (2) stemmed and non stemmed notes tied together y1 = element1->GetDrawingY(); y2 = element2->GetDrawingY(); - // for now we only look at the first note - needs to be improved - // m_drawingStemDir it not set properly in beam - needs to be fixed. - if (note1) noteStemDir = note1->m_drawingStemDir; - else noteStemDir = chord1->GetDrawingStemDir(); + noteStemDir = element1->GetDrawingStemDir(); + } + // This is the case when the tie is split over two system of two pages. + // In this case, we are now drawing its beginning to the end of the measure (i.e., the last aligner) + else if ( spanningType == SPANNING_START ) { + y1 = element1->GetDrawingY(); + y2 = y1; + noteStemDir = element1->GetDrawingStemDir(); + } + // Now this is the case when the tie is split but we are drawing the end of it + else if ( spanningType == SPANNING_END ) { + y1 = element2->GetDrawingY(); + y2 = y1; + x2 = element2->GetDrawingX(); + noteStemDir = element2->GetDrawingStemDir(); + } + // Finally + else { + LogDebug("Slur across an entire system is not supported"); + return; + } + + //layer direction trumps note direction + if (layer1 && layer1->GetDrawingStemDir() != STEMDIRECTION_NONE){ + up = layer1->GetDrawingStemDir() == STEMDIRECTION_up ? true : false; + } + else if (noteStemDir == STEMDIRECTION_up) { + up = false; + } + else if (noteStemDir == STEMDIRECTION_NONE) { + // no information from the note stem directions, look at the position in the notes + int center = staff->GetDrawingY() - m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) * 2; + up = (y1 > center) ? true : false; + } + + // FIXME, take in account elements that can be netween notes, eg keys time etc + // 20 height nice with 70, not nice with 50 + // Also remove HARDCODED values! + if (up) { + y1 += m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 1.6; + y2 += m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 1.6; + } + else { + y1 -= m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 1.6; + y2 -= m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 1.6; + } + + if ( graphic ) dc->ResumeGraphic(graphic, graphic->GetUuid()); + else dc->StartGraphic(slur, "spanning-slur", ""); + dc->DeactivateGraphic(); + DrawTieOrSlurBezier(dc, x1, y1, x2, y2, !up); + dc->ReactivateGraphic(); + + if ( graphic ) dc->EndResumedGraphic(graphic, this); + else dc->EndGraphic(slur, this); +} + +void View::DrawTie( DeviceContext *dc, Tie *tie, int x1, int x2, Staff *staff, + char spanningType, DocObject *graphic ) +{ + assert( dc ); + assert( tie ); + assert( staff ); + + LayerElement *element1 = NULL; + LayerElement *element2 = NULL; + + bool up = true; + data_STEMDIRECTION noteStemDir = STEMDIRECTION_NONE; + int y1, y2; + + element1 = tie->GetStart(); + element2 = tie->GetEnd(); + + if ( !element1 || !element2 ) { + // no note, obviously nothing to do... + return; + } + + Layer* layer1 = dynamic_cast(element1->GetFirstParent( LAYER ) ); + Layer* layer2 = dynamic_cast(element2->GetFirstParent( LAYER ) ); + assert( layer1 && layer2 ); + + if ( layer1->GetN() != layer2->GetN() ) { + LogWarning("Ties between different layers may not be fully supported."); + } + + //the normal case + if ( spanningType == SPANNING_START_END ) { + y1 = element1->GetDrawingY(); + y2 = element2->GetDrawingY(); + noteStemDir = element1->GetDrawingStemDir(); } // This is the case when the tie is split over two system of two pages. // In this case, we are now drawing its beginning to the end of the measure (i.e., the last aligner) else if ( spanningType == SPANNING_START ) { y1 = element1->GetDrawingY(); y2 = y1; - // m_drawingStemDir it not set properly in beam - needs to be fixed. - if (note1) noteStemDir = note1->m_drawingStemDir; - else noteStemDir = chord1->GetDrawingStemDir(); + noteStemDir = element1->GetDrawingStemDir(); } // Now this is the case when the tie is split but we are drawing the end of it else if ( spanningType == SPANNING_END ) { y1 = element2->GetDrawingY(); y2 = y1; x2 = element2->GetDrawingX(); - if (note2) noteStemDir = note2->m_drawingStemDir; - else noteStemDir = chord2->GetDrawingStemDir(); + noteStemDir = element2->GetDrawingStemDir(); + } // Finally else { @@ -284,13 +354,13 @@ void View::DrawTieOrSlur( DeviceContext *dc, FloatingElement *element, int x1, i } if ( graphic ) dc->ResumeGraphic(graphic, graphic->GetUuid()); - else dc->StartGraphic(element, "spanning-tie-or-slur", ""); + else dc->StartGraphic(tie, "spanning-tie", ""); dc->DeactivateGraphic(); DrawTieOrSlurBezier(dc, x1, y1, x2, y2, !up); dc->ReactivateGraphic(); if ( graphic ) dc->EndResumedGraphic(graphic, this); - else dc->EndGraphic(element, this); + else dc->EndGraphic(tie, this); } void View::DrawSylConnector( DeviceContext *dc, Syl *syl, int x1, int x2, Staff *staff, char spanningType, DocObject *graphic ) diff --git a/src/view_mensural.cpp b/src/view_mensural.cpp index 113f0d0d4a1..2ab846bc377 100644 --- a/src/view_mensural.cpp +++ b/src/view_mensural.cpp @@ -72,14 +72,15 @@ void View::DrawMensuralNote ( DeviceContext *dc, LayerElement *element, Layer *l /************** Stem/notehead direction: **************/ verticalCenter = staffY - m_doc->GetDrawingDoubleUnit(staffSize)*2; - if ( note->HasDrawingStemDir() ) { - note->m_drawingStemDir = note->GetDrawingStemDir(); + data_STEMDIRECTION noteStemDir = note->CalcDrawingStemDir(); + if ( noteStemDir != STEMDIRECTION_NONE ) { + note->SetDrawingStemDir( noteStemDir ); } else if ( layer->GetDrawingStemDir() != STEMDIRECTION_NONE) { - note->m_drawingStemDir = layer->GetDrawingStemDir(); + note->SetDrawingStemDir( layer->GetDrawingStemDir() ); } else { - note->m_drawingStemDir = (noteY >= verticalCenter) ? STEMDIRECTION_down : STEMDIRECTION_up; + note->SetDrawingStemDir((noteY >= verticalCenter) ? STEMDIRECTION_down : STEMDIRECTION_up); } xNote = xStem - radius; @@ -115,7 +116,7 @@ void View::DrawMensuralNote ( DeviceContext *dc, LayerElement *element, Layer *l DrawSmuflCode( dc, xNote, noteY, fontNo, staff->m_drawingStaffSize, drawingCueSize ); - DrawStem(dc, note, staff, note->m_drawingStemDir, radius, xStem, noteY); + DrawStem(dc, note, staff, note->GetDrawingStemDir(), radius, xStem, noteY); } /************** Ledger lines: **************/ @@ -141,7 +142,7 @@ void View::DrawMensuralNote ( DeviceContext *dc, LayerElement *element, Layer *l if (note->GetDots()) { int xDot; - if (note->GetDur() < DUR_2 || (note->GetDur() > DUR_8 && (note->m_drawingStemDir == STEMDIRECTION_up))) + if (note->GetDur() < DUR_2 || (note->GetDur() > DUR_8 && (note->GetDrawingStemDir() == STEMDIRECTION_up))) xDot = xStem + m_doc->GetDrawingUnit(staffSize)*7/2; else xDot = xStem + m_doc->GetDrawingUnit(staffSize)*5/2; @@ -369,8 +370,8 @@ void View::DrawMaximaToBrevis( DeviceContext *dc, int y, LayerElement *element, { verticalCenter = staff->GetDrawingY() - m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize)*2; up = (y < verticalCenter) ? true : false; - if ( note->m_drawingStemDir != STEMDIRECTION_NONE ) { - if ( note->m_drawingStemDir == STEMDIRECTION_up) { + if ( note->GetDrawingStemDir() != STEMDIRECTION_NONE ) { + if ( note->GetDrawingStemDir() == STEMDIRECTION_up) { up = true; } else { @@ -510,8 +511,8 @@ void View::DrawLigature ( DeviceContext *dc, int y, LayerElement *element, Layer // ENZ up = (y < verticalCenter) ? ON : OFF; // ENZ - if ( note->m_drawingStemDir != STEMDIRECTION_NONE ) { - if ( note->m_drawingStemDir == STEMDIRECTION_up) { + if ( note->GetDrawingStemDir() != STEMDIRECTION_NONE ) { + if ( note->GetDrawingStemDir() == STEMDIRECTION_up) { up = ON; } else { From 4d85e4100b99bc038ce3f629421a157c28797469 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Fri, 21 Aug 2015 10:31:43 +0200 Subject: [PATCH 077/114] Fixing FilterList in Beam and Chord --- src/beam.cpp | 3 ++- src/chord.cpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/beam.cpp b/src/beam.cpp index 973408e92d5..ee11dcc6b14 100644 --- a/src/beam.cpp +++ b/src/beam.cpp @@ -58,7 +58,8 @@ void Beam::FilterList( ListOfObjects *childList ) while ( iter != childList->end()) { if ( !(*iter)->IsLayerElement() ) { // remove anything that is not an LayerElement (e.g. Verse, Syl, etc) - iter = childList->erase( iter ); + iter = childList->erase( iter ); + continue; } LayerElement *currentElement = dynamic_cast(*iter); assert( currentElement ); diff --git a/src/chord.cpp b/src/chord.cpp index 443b1bdbe7a..634fe97b500 100644 --- a/src/chord.cpp +++ b/src/chord.cpp @@ -95,6 +95,7 @@ void Chord::FilterList( ListOfObjects *childList ) if ( !(*iter)->IsLayerElement() ) { // remove anything that is not an LayerElement iter = childList->erase( iter ); + continue; } LayerElement *currentElement = dynamic_cast(*iter); assert( currentElement ); From d2113904823e088d722138b1c2e20ab71609baf3 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sat, 22 Aug 2015 20:33:17 +0200 Subject: [PATCH 078/114] Major refactoring for staffDef/scoreDef attributes Removing ClefAttr, KeySigAttr, etc classes for attributes and replacing them by a ScoreDefInterface Adding a ScoreDefElement class as base class for ScoreDef and StaffDef Adding a StaffDefDrawingInterace for storing drawing values in StaffDef and Layer Removing the KeySigDrawingInterface and moving its content to the KeySig class --- Verovio.xcodeproj/project.pbxproj | 26 +- emscripten/build.sh | 3 +- include/vrv/beam.h | 2 +- include/vrv/clef.h | 38 +-- include/vrv/drawinginterface.h | 172 +++++++++++++ include/vrv/drawinglistinterface.h | 112 -------- include/vrv/iomei.h | 3 + include/vrv/keysig.h | 55 ++-- include/vrv/layer.h | 75 +----- include/vrv/mensur.h | 38 +-- include/vrv/metersig.h | 40 +-- include/vrv/object.h | 3 +- include/vrv/scoredef.h | 136 +++------- include/vrv/scoredefinterface.h | 60 +++++ include/vrv/system.h | 2 +- include/vrv/vrvdef.h | 8 +- java/build.sh | 3 +- python/setup.py | 7 +- src/beam.cpp | 3 +- src/clef.cpp | 26 +- src/doc.cpp | 4 + src/drawinginterface.cpp | 178 +++++++++++++ src/drawinglistinterface.cpp | 79 ------ src/iomei.cpp | 109 +++----- src/iopae.cpp | 10 +- src/keysig.cpp | 45 +--- src/layer.cpp | 140 +++------- src/mensur.cpp | 27 +- src/metersig.cpp | 29 +-- src/object.cpp | 45 +--- src/scoredef.cpp | 395 +++++++++++++---------------- src/scoredefinterface.cpp | 62 +++++ src/view_page.cpp | 6 +- tools/CMakeLists.txt | 3 +- 34 files changed, 852 insertions(+), 1092 deletions(-) create mode 100644 include/vrv/drawinginterface.h delete mode 100644 include/vrv/drawinglistinterface.h create mode 100644 include/vrv/scoredefinterface.h create mode 100644 src/drawinginterface.cpp delete mode 100644 src/drawinglistinterface.cpp create mode 100644 src/scoredefinterface.cpp diff --git a/Verovio.xcodeproj/project.pbxproj b/Verovio.xcodeproj/project.pbxproj index 5d4d7d2a503..c84d66564e1 100644 --- a/Verovio.xcodeproj/project.pbxproj +++ b/Verovio.xcodeproj/project.pbxproj @@ -12,6 +12,7 @@ 4D1D733E1A1D08CD001E08F6 /* glyph.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D1D733D1A1D08CD001E08F6 /* glyph.h */; }; 4D1D73401A1D08DC001E08F6 /* glyph.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D1D733F1A1D08DC001E08F6 /* glyph.cpp */; }; 4D1D73411A1D08DC001E08F6 /* glyph.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D1D733F1A1D08DC001E08F6 /* glyph.cpp */; }; + 4D20B5EC1B873A1300EA9EC3 /* scoredefinterface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D20B5EB1B873A1300EA9EC3 /* scoredefinterface.cpp */; }; 4D22C41918890E6100D0831F /* mrest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D22C41818890E6100D0831F /* mrest.cpp */; }; 4D22C41A18890E6100D0831F /* mrest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D22C41818890E6100D0831F /* mrest.cpp */; }; 4D22C41C18890E9900D0831F /* mrest.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D22C41B18890E9900D0831F /* mrest.h */; }; @@ -75,9 +76,9 @@ 4DF28A031A754DE400BA9F7D /* floatingelement.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DF28A021A754DE400BA9F7D /* floatingelement.h */; }; 4DF28A051A754DF000BA9F7D /* floatingelement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DF28A041A754DF000BA9F7D /* floatingelement.cpp */; }; 4DF28A061A754DF000BA9F7D /* floatingelement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DF28A041A754DF000BA9F7D /* floatingelement.cpp */; }; - 4DF2AF7E1A62F6A50016F869 /* drawinglistinterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DF2AF7D1A62F6A50016F869 /* drawinglistinterface.h */; }; - 4DF2AF801A62FC4A0016F869 /* drawinglistinterface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DF2AF7F1A62FC4A0016F869 /* drawinglistinterface.cpp */; }; - 4DF2AF811A62FC4A0016F869 /* drawinglistinterface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DF2AF7F1A62FC4A0016F869 /* drawinglistinterface.cpp */; }; + 4DF2AF7E1A62F6A50016F869 /* drawinginterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DF2AF7D1A62F6A50016F869 /* drawinginterface.h */; }; + 4DF2AF801A62FC4A0016F869 /* drawinginterface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DF2AF7F1A62FC4A0016F869 /* drawinginterface.cpp */; }; + 4DF2AF811A62FC4A0016F869 /* drawinginterface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DF2AF7F1A62FC4A0016F869 /* drawinginterface.cpp */; }; 8F086EE2188539540037FD8E /* aligner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8F086EB6188539540037FD8E /* aligner.cpp */; }; 8F086EE4188539540037FD8E /* barline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8F086EB8188539540037FD8E /* barline.cpp */; }; 8F086EE5188539540037FD8E /* bboxdevicecontext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8F086EB9188539540037FD8E /* bboxdevicecontext.cpp */; }; @@ -214,6 +215,8 @@ 4D1D733B1A1D0390001E08F6 /* smufl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = smufl.h; path = include/vrv/smufl.h; sourceTree = ""; }; 4D1D733D1A1D08CD001E08F6 /* glyph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glyph.h; path = include/vrv/glyph.h; sourceTree = ""; }; 4D1D733F1A1D08DC001E08F6 /* glyph.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = glyph.cpp; path = src/glyph.cpp; sourceTree = ""; }; + 4D20B5EB1B873A1300EA9EC3 /* scoredefinterface.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = scoredefinterface.cpp; path = src/scoredefinterface.cpp; sourceTree = ""; }; + 4D20B5ED1B873A2B00EA9EC3 /* scoredefinterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = scoredefinterface.h; path = include/vrv/scoredefinterface.h; sourceTree = ""; }; 4D22C41818890E6100D0831F /* mrest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mrest.cpp; path = src/mrest.cpp; sourceTree = ""; }; 4D22C41B18890E9900D0831F /* mrest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mrest.h; path = include/vrv/mrest.h; sourceTree = ""; }; 4D22C41F18891D6D00D0831F /* pugixml.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = pugixml.cpp; path = src/pugixml.cpp; sourceTree = ""; }; @@ -294,8 +297,8 @@ 4DF289FE1A7545E500BA9F7D /* timeinterface.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = timeinterface.cpp; path = src/timeinterface.cpp; sourceTree = ""; }; 4DF28A021A754DE400BA9F7D /* floatingelement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = floatingelement.h; path = include/vrv/floatingelement.h; sourceTree = ""; }; 4DF28A041A754DF000BA9F7D /* floatingelement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = floatingelement.cpp; path = src/floatingelement.cpp; sourceTree = ""; }; - 4DF2AF7D1A62F6A50016F869 /* drawinglistinterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = drawinglistinterface.h; path = include/vrv/drawinglistinterface.h; sourceTree = ""; }; - 4DF2AF7F1A62FC4A0016F869 /* drawinglistinterface.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = drawinglistinterface.cpp; path = src/drawinglistinterface.cpp; sourceTree = ""; }; + 4DF2AF7D1A62F6A50016F869 /* drawinginterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = drawinginterface.h; path = include/vrv/drawinginterface.h; sourceTree = ""; }; + 4DF2AF7F1A62FC4A0016F869 /* drawinginterface.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = drawinginterface.cpp; path = src/drawinginterface.cpp; sourceTree = ""; }; 8F086EA9188534680037FD8E /* Verovio */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Verovio; sourceTree = BUILT_PRODUCTS_DIR; }; 8F086EB6188539540037FD8E /* aligner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = aligner.cpp; path = src/aligner.cpp; sourceTree = ""; }; 8F086EB8188539540037FD8E /* barline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = barline.cpp; path = src/barline.cpp; sourceTree = ""; }; @@ -429,14 +432,16 @@ 4DC34B9E19BC33A0006175CD /* interfaces */ = { isa = PBXGroup; children = ( - 4DF2AF7F1A62FC4A0016F869 /* drawinglistinterface.cpp */, - 4DF2AF7D1A62F6A50016F869 /* drawinglistinterface.h */, + 4DF2AF7F1A62FC4A0016F869 /* drawinginterface.cpp */, + 4DF2AF7D1A62F6A50016F869 /* drawinginterface.h */, 8F086EBE188539540037FD8E /* durationinterface.cpp */, 8F59291518854BF800FE51AD /* durationinterface.h */, 8F086ECF188539540037FD8E /* pitchinterface.cpp */, 8F59292618854BF800FE51AD /* pitchinterface.h */, 8F086ED0188539540037FD8E /* positioninterface.cpp */, 8F59292718854BF800FE51AD /* positioninterface.h */, + 4D20B5EB1B873A1300EA9EC3 /* scoredefinterface.cpp */, + 4D20B5ED1B873A2B00EA9EC3 /* scoredefinterface.h */, 4DA60EE31B6307B9006E2DFC /* textdirinterface.cpp */, 4DA60EDF1B6307A8006E2DFC /* textdirinterface.h */, 4DF289FE1A7545E500BA9F7D /* timeinterface.cpp */, @@ -735,7 +740,7 @@ 4DC34BA219BC4A71006175CD /* accid.h in Headers */, 4DC34BA319BC4A71006175CD /* custos.h in Headers */, 4DC34BA419BC4A71006175CD /* dot.h in Headers */, - 4DF2AF7E1A62F6A50016F869 /* drawinglistinterface.h in Headers */, + 4DF2AF7E1A62F6A50016F869 /* drawinginterface.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -845,7 +850,7 @@ 8F086EF1188539540037FD8E /* keysig.cpp in Sources */, 4D43C30C1A9BB22A00EA28F3 /* view_mensural.cpp in Sources */, 8F086EF2188539540037FD8E /* layer.cpp in Sources */, - 4DF2AF801A62FC4A0016F869 /* drawinglistinterface.cpp in Sources */, + 4DF2AF801A62FC4A0016F869 /* drawinginterface.cpp in Sources */, 8F086EF3188539540037FD8E /* layerelement.cpp in Sources */, 8F086EF5188539540037FD8E /* measure.cpp in Sources */, 8F086EF6188539540037FD8E /* mensur.cpp in Sources */, @@ -862,6 +867,7 @@ 8F086F01188539540037FD8E /* svgdevicecontext.cpp in Sources */, 4DA80D961A6ACF5D0089802D /* style.cpp in Sources */, 8F086F03188539540037FD8E /* system.cpp in Sources */, + 4D20B5EC1B873A1300EA9EC3 /* scoredefinterface.cpp in Sources */, 4DCA95D81A515D0E008AD7E9 /* editorial.cpp in Sources */, 8F086F04188539540037FD8E /* tie.cpp in Sources */, 8F086F05188539540037FD8E /* tuplet.cpp in Sources */, @@ -936,7 +942,7 @@ 8F3DD33818854B250051330C /* system.cpp in Sources */, 8F3DD32418854B090051330C /* io.cpp in Sources */, 8F3DD32618854B090051330C /* iodarms.cpp in Sources */, - 4DF2AF811A62FC4A0016F869 /* drawinglistinterface.cpp in Sources */, + 4DF2AF811A62FC4A0016F869 /* drawinginterface.cpp in Sources */, 4DA60EE51B6307B9006E2DFC /* textdirective.cpp in Sources */, 8F3DD32818854B090051330C /* iomei.cpp in Sources */, 8F3DD32A18854B090051330C /* iomusxml.cpp in Sources */, diff --git a/emscripten/build.sh b/emscripten/build.sh index 79159d1a7fa..0b47dda2003 100755 --- a/emscripten/build.sh +++ b/emscripten/build.sh @@ -107,7 +107,7 @@ python $EMCC $CHATTY \ $VEROVIO_ROOT/src/devicecontext.cpp \ $VEROVIO_ROOT/src/doc.cpp \ $VEROVIO_ROOT/src/dot.cpp \ - $VEROVIO_ROOT/src/drawinglistinterface.cpp \ + $VEROVIO_ROOT/src/drawinginterface.cpp \ $VEROVIO_ROOT/src/durationinterface.cpp \ $VEROVIO_ROOT/src/editorial.cpp \ $VEROVIO_ROOT/src/floatingelement.cpp \ @@ -140,6 +140,7 @@ python $EMCC $CHATTY \ $VEROVIO_ROOT/src/view_tuplet.cpp \ $VEROVIO_ROOT/src/rest.cpp \ $VEROVIO_ROOT/src/scoredef.cpp \ + $VEROVIO_ROOT/src/scoredefinterface.cpp \ $VEROVIO_ROOT/src/slur.cpp \ $VEROVIO_ROOT/src/space.cpp \ $VEROVIO_ROOT/src/staff.cpp \ diff --git a/include/vrv/beam.h b/include/vrv/beam.h index f01a8099de9..3ca901d4954 100644 --- a/include/vrv/beam.h +++ b/include/vrv/beam.h @@ -10,7 +10,7 @@ #define __VRV_BEAM_H__ #include "layerelement.h" -#include "drawinglistinterface.h" +#include "drawinginterface.h" namespace vrv { diff --git a/include/vrv/clef.h b/include/vrv/clef.h index 07895ac2cae..efb5e6d16bc 100644 --- a/include/vrv/clef.h +++ b/include/vrv/clef.h @@ -13,8 +13,8 @@ #include "layerelement.h" namespace vrv { - -class ClefAttr; + +class ScoreDefInterface; //---------------------------------------------------------------------------- // Clef @@ -35,7 +35,7 @@ class Clef: public LayerElement, */ ///@{ Clef(); - Clef( ClefAttr *clefAttr ); + Clef( ScoreDefInterface *clefAttr ); void Init(); virtual ~Clef(); virtual void Reset(); @@ -61,38 +61,6 @@ class Clef: public LayerElement, private: -}; - -//---------------------------------------------------------------------------- -// ClefAttr -//---------------------------------------------------------------------------- - -/** - * This class models the MEI @clef attributes in scoreDef or staffDef elements. - */ -class ClefAttr: public Object, - public AttCleffingLog -{ -public: - /** - * @name Constructors, destructors, reset and class name methods - * Reset method reset all attribute classes - */ - ///@{ - ClefAttr(); - virtual ~ClefAttr(); - virtual void Reset(); - virtual std::string GetClassName( ) { return "ClefAttr"; }; - virtual ClassId Is() { return CLEF_ATTR; }; - virtual Object* Clone() { return new ClefAttr(*this); }; - ///@} - -private: - -public: - -private: - }; } // namespace vrv diff --git a/include/vrv/drawinginterface.h b/include/vrv/drawinginterface.h new file mode 100644 index 00000000000..e0b9ef137a2 --- /dev/null +++ b/include/vrv/drawinginterface.h @@ -0,0 +1,172 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: drawinglistinterface +// Author: Laurent Pugin +// Created: 2015 +// Copyright (c) Authors and others. All rights reserved. +///////////////////////////////////////////////////////////////////////////// + + +#ifndef __VRV_DRAWING_LIST_INTERFACE_H__ +#define __VRV_DRAWING_LIST_INTERFACE_H__ + +#include "vrvdef.h" + +namespace vrv { + +class Clef; +class DocObject; +class KeySig; +class Mensur; +class MeterSig; + +//---------------------------------------------------------------------------- +// DrawingListInterface +//---------------------------------------------------------------------------- + +/** + * This class is an interface for elements with duration, such as notes and rests. + * It is not an abstract class but should not be instanciate directly. + */ +class DrawingListInterface +{ +public: + /** + * @name Constructors, destructors, reset methods + * Reset method reset all attribute classes + */ + ///@{ + DrawingListInterface(); + virtual ~DrawingListInterface(); + virtual void Reset(); + ///@} + + /** + * Add an element to the drawing list. + * The drawing list is used to postponed the drawing of elements + * that need to be drawn in a particular order. + * For example, we need to draw beams before tuplets + */ + void AddToDrawingList( DocObject *element ); + + /** + * Return the drawing list. + * This is used when actually drawing the list (see View::DrawLayerList) + */ + ListOfObjects *GetDrawingList( ); + + /** + * Reset the drawing list. + * Clears the list - called when the layer starts to be drawn + */ + void ResetDrawingList( ); + +private: + +public: + +private: + /** The list of object for which drawing is postponed */ + ListOfObjects m_drawingList; +}; + +//---------------------------------------------------------------------------- +// StaffDefDrawingInterface +//---------------------------------------------------------------------------- + +/** + * This class is an interface for MEI scoreDef or staffDef attributes clef, keysig and mensur. + * It can either hold element or attribute values. Element values are hold in normal objects + * (e.g., Clef) and attribute values are hold in dedicated Object classes (e.g., ClefAttr) + * During rendering, only Element object are used. They are obained by the GetXXXCopy methods + * that create a copy of the Element object or a corresponding Element object if a attribute value + * object is hold. + */ +class StaffDefDrawingInterface +{ +public: + /** + * @name Constructors, destructors, and other standard methods + */ + ///@{ + StaffDefDrawingInterface(); + virtual ~StaffDefDrawingInterface(); + virtual void Reset(); + StaffDefDrawingInterface( const StaffDefDrawingInterface& interface ); // copy contructor + StaffDefDrawingInterface& operator=( const StaffDefDrawingInterface& interface ); // copy assignement; + ///@} + + /** + * @name Set and get the layer drawing flags for clef, keysig and mensur. + * This will be true when starting a new system or when a scoreDef or staffDef changes occurs + * This will be true only for the first layer in the staff. + */ + ///@{ + bool DrawClef() const { return m_drawClef; }; + void SetDrawClef( bool drawClef ) { m_drawClef = drawClef; }; + bool DrawKeySig() const { return m_drawKeySig; }; + void SetDrawKeySig( bool drawKeySig ) { m_drawKeySig = drawKeySig; }; + bool DrawKeySigCancellation() const { return m_drawKeySigCancellation; }; + void SetDrawKeySigCancellation( bool drawKeySigCancellation ) { m_drawKeySigCancellation = drawKeySigCancellation; }; + bool DrawMensur() const { return m_drawMensur; }; + void SetDrawMensur( bool drawMensur ) { m_drawMensur = drawMensur; }; + bool DrawMeterSig() const { return m_drawMeterSig; }; + void SetDrawMeterSig( bool drawMeterSig ) { m_drawMeterSig = drawMeterSig; }; + ///@} + + /** + * @name Set the current clef, keySig, mensur and meterSig. + */ + ///@{ + void SetCurrentClef( Clef *clef ); + void SetCurrentKeySig( KeySig *keySig ); + void SetCurrentMensur( Mensur *mensur ); + void SetCurrentMeterSig( MeterSig *meterSig ); + ///@} + + /** + * @name Get the clef, keySig, mensur and meterSig to be drawn. + */ + ///@{ + Clef *GetDrawingClef( ) { if (m_drawClef) return m_currentClef; return NULL; }; + KeySig *GetDrawingKeySig( ) { if (m_drawKeySig) return m_currentKeySig; return NULL; }; + Mensur *GetDrawingMensur( ) { if (m_drawMensur) return m_currentMensur; return NULL; }; + MeterSig *GetDrawingMeterSig( ) { if (m_drawMeterSig) return m_currentMeterSig; return NULL; }; + ///@} + + /** + * @name Get the clef, keysig, mensur and meterSig object. + * They will return a reference to the hold object (element or attribute). + */ + ///@{ + Clef *GetCurrentClef() const { return m_currentClef; }; + KeySig *GetCurrentKeySig() const { return m_currentKeySig; }; + Mensur *GetCurrentMensur() const { return m_currentMensur; }; + MeterSig *GetCurrentMeterSig() const { return m_currentMeterSig; }; + ///@} + +private: + /** The clef or clef attributes */ + Clef *m_currentClef; + /** The key signature */ + KeySig *m_currentKeySig; + /** The mensur */ + Mensur *m_currentMensur; + /** The meter signature (time signature) */ + MeterSig *m_currentMeterSig; + + /** + * @name Flags for indicating whether the clef, keysig and mensur needs to be drawn or not + */ + ///@{ + bool m_drawClef; + bool m_drawKeySig; + bool m_drawKeySigCancellation; + bool m_drawMensur; + bool m_drawMeterSig; + ///@} + +}; + +} // namespace vrv + +#endif diff --git a/include/vrv/drawinglistinterface.h b/include/vrv/drawinglistinterface.h deleted file mode 100644 index 40069279618..00000000000 --- a/include/vrv/drawinglistinterface.h +++ /dev/null @@ -1,112 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: drawinglistinterface -// Author: Laurent Pugin -// Created: 2015 -// Copyright (c) Authors and others. All rights reserved. -///////////////////////////////////////////////////////////////////////////// - - -#ifndef __VRV_DRAWING_LIST_INTERFACE_H__ -#define __VRV_DRAWING_LIST_INTERFACE_H__ - -#include "vrvdef.h" - -namespace vrv { - -class DocObject; - -//---------------------------------------------------------------------------- -// DrawingListInterface -//---------------------------------------------------------------------------- - -/** - * This class is an interface for elements with duration, such as notes and rests. - * It is not an abstract class but should not be instanciate directly. - */ -class DrawingListInterface -{ -public: - /** - * @name Constructors, destructors, reset methods - * Reset method reset all attribute classes - */ - ///@{ - DrawingListInterface(); - virtual ~DrawingListInterface(); - virtual void Reset(); - ///@} - - /** - * Add an element to the drawing list. - * The drawing list is used to postponed the drawing of elements - * that need to be drawn in a particular order. - * For example, we need to draw beams before tuplets - */ - void AddToDrawingList( DocObject *element ); - - /** - * Return the drawing list. - * This is used when actually drawing the list (see View::DrawLayerList) - */ - ListOfObjects *GetDrawingList( ); - - /** - * Reset the drawing list. - * Clears the list - called when the layer starts to be drawn - */ - void ResetDrawingList( ); - -private: - -public: - -private: - /** The list of object for which drawing is postponed */ - ListOfObjects m_drawingList; -}; - -//---------------------------------------------------------------------------- -// KeySigDrawingInterface -//---------------------------------------------------------------------------- - -/** - * This class is an interface for drawing variables for KeySig and KeySigAttr. - * It is not an abstract class but should not be instanciate directly. - */ -class KeySigDrawingInterface -{ -public: - /** - * @name Constructors, destructors, reset and class name methods - * Reset method reset all attribute classes - */ - ///@{ - KeySigDrawingInterface(); - virtual ~KeySigDrawingInterface(); - virtual void Reset(); - ///@} - -private: - -public: - /** - * Variables for storing cancellation introduced by the key sig. - * The values are ScoreOrStaffDefAttrInterface::ReplaceKeySig - */ - data_ACCIDENTAL_EXPLICIT m_drawingCancelAccidType; - char m_drawingCancelAccidCount; - /** - * Equivalent to @key.sig.show and @showchange, but set for drawing - * KeySig has no equivalent in MEI and will be true and false by default - * See KeySig::KeySig( KeySigAttr *keySigAttr ) for initialisation - */ - bool m_drawingShow; - bool m_drawingShowchange; - -private: - -}; - -} // namespace vrv - -#endif diff --git a/include/vrv/iomei.h b/include/vrv/iomei.h index c70d2c6cdf4..d19ca00dc15 100644 --- a/include/vrv/iomei.h +++ b/include/vrv/iomei.h @@ -43,6 +43,7 @@ class PositionInterface; class Rdg; class Rest; class ScoreDef; +class ScoreDefInterface; class Slur; class Space; class Staff; @@ -191,6 +192,7 @@ class MeiOutput: public FileOutputStream void WriteDurationInterface( pugi::xml_node currentNode, DurationInterface *interface ); void WritePitchInterface( pugi::xml_node currentNode, PitchInterface *interface ); void WritePositionInterface( pugi::xml_node currentNode, PositionInterface *interface ); + void WriteScoreDefInterface( pugi::xml_node currentNode, ScoreDefInterface *interface ); void WriteTextDirInterface( pugi::xml_node currentNode, TextDirInterface *interface ); void WriteTimeSpanningInterface( pugi::xml_node currentNode, TimeSpanningInterface *interface ); ///@} @@ -339,6 +341,7 @@ class MeiInput: public FileInputStream bool ReadDurationInterface( pugi::xml_node element, DurationInterface *interface ); bool ReadPitchInterface( pugi::xml_node element, PitchInterface *interface ); bool ReadPositionInterface( pugi::xml_node element, PositionInterface *interface ); + bool ReadScoreDefInterface( pugi::xml_node element, ScoreDefInterface *interface ); bool ReadTextDirInterface( pugi::xml_node element, TextDirInterface *interface ); bool ReadTimeSpanningInterface( pugi::xml_node element, TimeSpanningInterface *interface ); ///@} diff --git a/include/vrv/keysig.h b/include/vrv/keysig.h index 64529e36f7d..545640d2441 100644 --- a/include/vrv/keysig.h +++ b/include/vrv/keysig.h @@ -11,12 +11,11 @@ #define __VRV_KEYSIG_H__ #include "atts_shared.h" -#include "drawinglistinterface.h" #include "layerelement.h" namespace vrv { -class KeySigAttr; +class ScoreDefInterface; //---------------------------------------------------------------------------- // KeySig @@ -33,7 +32,7 @@ class KeySigAttr; * are available for converting from and to the MEI representation to the * internal (and reverse) */ -class KeySig: public LayerElement, public KeySigDrawingInterface, +class KeySig: public LayerElement, public AttAccidental, public AttPitch { @@ -45,7 +44,7 @@ class KeySig: public LayerElement, public KeySigDrawingInterface, ///@{ KeySig(); KeySig(int alterationNumber, data_ACCIDENTAL_EXPLICIT alterationType); - KeySig( KeySigAttr *keySigAttr ); + KeySig( ScoreDefInterface *keySigAttr ); void Init(); virtual ~KeySig(); virtual void Reset(); @@ -73,7 +72,20 @@ class KeySig: public LayerElement, public KeySigDrawingInterface, private: -public: +public: + /** + * Variables for storing cancellation introduced by the key sig. + * The values are StaffDefDrawingInterface::ReplaceKeySig + */ + data_ACCIDENTAL_EXPLICIT m_drawingCancelAccidType; + char m_drawingCancelAccidCount; + /** + * Equivalent to @key.sig.show and @showchange, but set for drawing + * KeySig has no equivalent in MEI and will be true and false by default + * See KeySig::KeySig( KeySigAttr *keySigAttr ) for initialisation + */ + bool m_drawingShow; + bool m_drawingShowchange; private: static data_PITCHNAME flats[]; @@ -85,39 +97,6 @@ class KeySig: public LayerElement, public KeySigDrawingInterface, data_ACCIDENTAL_EXPLICIT m_alterationType; }; - -//---------------------------------------------------------------------------- -// KeySigAttr -//---------------------------------------------------------------------------- - -/** - * This class models the MEI @key attributes in scoreDef or staffDef elements. - */ -class KeySigAttr: public Object, public KeySigDrawingInterface, - public AttKeySigDefaultLog, - public AttKeySigDefaultVis -{ -public: - /** - * @name Constructors, destructors, reset and class name methods - * Reset method reset all attribute classes - */ - ///@{ - KeySigAttr(); - virtual ~KeySigAttr(); - virtual void Reset(); - virtual std::string GetClassName( ) { return "KeySigAttr"; }; - virtual ClassId Is() { return KEY_SIG_ATTR; }; - virtual Object* Clone() { return new KeySigAttr(*this); }; - ///@} - -private: - -public: - -private: - -}; } // namespace vrv diff --git a/include/vrv/layer.h b/include/vrv/layer.h index 6b838b3c7ac..7d336fa38eb 100644 --- a/include/vrv/layer.h +++ b/include/vrv/layer.h @@ -11,19 +11,16 @@ #include "atts_shared.h" #include "clef.h" -#include "drawinglistinterface.h" +#include "drawinginterface.h" #include "object.h" namespace vrv { class DeviceContext; -class KeySig; class LayerElement; class Note; class ScoreDef; class StaffDef; -class Mensur; -class MeterSig; //---------------------------------------------------------------------------- // Layer @@ -34,7 +31,7 @@ class MeterSig; * A Layer is contained in a Staff. * It contains LayerElement objects. */ -class Layer: public DocObject, public DrawingListInterface, public ObjectListInterface, +class Layer: public DocObject, public DrawingListInterface, public ObjectListInterface, public StaffDefDrawingInterface, public AttCommon { public: @@ -85,43 +82,7 @@ class Layer: public DocObject, public DrawingListInterface, public ObjectListInt * Set drawing clef, keysig and mensur if necessary and if available. * Also set the current clef. */ - void SetDrawingAndCurrentValues( ScoreDef *currentScoreDef, StaffDef *currentStaffDef ); - - /** - * @name Set the clef, keySig, mensur and meterSig to be drawn. - */ - ///@{ - void SetDrawClef( bool draw ) { m_drawClef = draw; }; - void SetDrawKeySig( bool draw ) { m_drawKeySig = draw; }; - void SetDrawKeySigCancellation( bool draw ) { m_drawKeySigCancellation = draw; }; - void SetDrawMensur( bool draw ) { m_drawMensur = draw; }; - void SetDrawMeterSig( bool draw ) { m_drawMeterSig = draw; }; - ///@} - - /** - * @name Get the clef, keySig, mensur and meterSig to be drawn. - */ - ///@{ - Clef *GetDrawingClef( ) { if (m_drawClef) return m_currentClef; return NULL; }; - KeySig *GetDrawingKeySig( ) { if (m_drawKeySig) return m_currentKeySig; return NULL; }; - Mensur *GetDrawingMensur( ) { if (m_drawMensur) return m_currentMensur; return NULL; }; - MeterSig *GetDrawingMeterSig( ) { if (m_drawMeterSig) return m_currentMeterSig; return NULL; }; - ///@} - - /** - * Getter for seeing if the key signature cancellation applies - */ - bool DrawKeySigCancellation() { return m_drawKeySigCancellation; }; - - /** - * @name Set the current clef, keySig, mensur and meterSig. - */ - ///@{ - void SetCurrentClef( Clef *clef ); - void SetCurrentKeySig( KeySig *keySig ); - void SetCurrentMensur( Mensur *mensur ); - void SetCurrentMeterSig( MeterSig *meterSig ); - ///@} + void SetDrawingAndCurrentValues( StaffDef *currentStaffDef ); /** * @name Set and get the stem direction of the layer. @@ -163,38 +124,8 @@ class Layer: public DocObject, public DrawingListInterface, public ObjectListInt public: protected: - /** - * @name Drawing flags - */ - ///@{ - /** The clef attribute */ - bool m_drawClef; - /** - * The key signature and key signature cancellation - * We need two because flags are reset at the beginning of a as system - */ - bool m_drawKeySig; - bool m_drawKeySigCancellation; - /** The mensur */ - bool m_drawMensur; - /** The meter signature (time signature) */ - bool m_drawMeterSig; - ///@} private: - /** - * @name The current values - */ - ///@{ - /** The clef attribute */ - Clef *m_currentClef; - /** The key signature */ - KeySig *m_currentKeySig; - /** The mensur */ - Mensur *m_currentMensur; - /** The meter signature (time signature) */ - MeterSig *m_currentMeterSig; - ///@} /** * */ diff --git a/include/vrv/mensur.h b/include/vrv/mensur.h index b8e6e50a23f..c7fe359b7ea 100644 --- a/include/vrv/mensur.h +++ b/include/vrv/mensur.h @@ -19,7 +19,7 @@ namespace vrv { // Mensur //---------------------------------------------------------------------------- -class MensurAttr; +class ScoreDefInterface; /** * This class models the MEI element. @@ -38,7 +38,7 @@ class Mensur: public LayerElement, */ ///@{ Mensur(); - Mensur( MensurAttr *mensurAttr ); + Mensur( ScoreDefInterface *mensurAttr ); void Init(); virtual ~Mensur(); virtual void Reset(); @@ -65,40 +65,6 @@ class Mensur: public LayerElement, }; - -//---------------------------------------------------------------------------- -// MensurAttr -//---------------------------------------------------------------------------- - -/** - * This class models the MEI @mensur attributes in scoreDef or staffDef elements. - */ -class MensurAttr: public Object, - public AttMensuralShared, - public AttMensuralLog -{ -public: - /** - * @name Constructors, destructors, reset and class name methods - * Reset method reset all attribute classes - */ - ///@{ - MensurAttr(); - virtual ~MensurAttr(); - virtual void Reset(); - virtual std::string GetClassName( ) { return "MensurAttr"; }; - virtual ClassId Is() { return MENSUR_ATTR; }; - virtual Object* Clone() { return new MensurAttr(*this); }; - ///@} - -private: - -public: - -private: - -}; - } // namespace vrv #endif diff --git a/include/vrv/metersig.h b/include/vrv/metersig.h index 1c478a14fd1..8d95f60420e 100644 --- a/include/vrv/metersig.h +++ b/include/vrv/metersig.h @@ -13,8 +13,8 @@ #include "layerelement.h" namespace vrv { - -class MeterSigAttr; + +class ScoreDefInterface; //---------------------------------------------------------------------------- // MeterSig @@ -33,7 +33,7 @@ class MeterSig: public LayerElement, */ ///@{ MeterSig(); - MeterSig( MeterSigAttr *meterSigAttr ); + MeterSig( ScoreDefInterface *meterSigAttr ); void Init(); virtual ~MeterSig(); virtual void Reset(); @@ -49,40 +49,6 @@ class MeterSig: public LayerElement, private: }; - - -//---------------------------------------------------------------------------- -// MeterSigAttr -//---------------------------------------------------------------------------- - -/** - * This class models the MEI @meter attributes in scoreDef or staffDef elements. - */ -class MeterSigAttr: public Object, - public AttMeterSigDefaultLog, - public AttMeterSigDefaultVis -{ -public: - /** - * @name Constructors, destructors, reset and class name methods - * Reset method reset all attribute classes - */ - ///@{ - MeterSigAttr(); - virtual ~MeterSigAttr(); - virtual void Reset(); - virtual std::string GetClassName( ) { return "MeterSigAttr"; }; - virtual ClassId Is() { return METER_SIG_ATTR; }; - virtual Object* Clone() { return new MeterSigAttr(*this); }; - ///@} - -private: - -public: - -private: - -}; } // namespace vrv diff --git a/include/vrv/object.h b/include/vrv/object.h index 5f2b3c42f18..65967a97bc3 100644 --- a/include/vrv/object.h +++ b/include/vrv/object.h @@ -72,6 +72,7 @@ class Object bool IsEditorialElement() { return (this->Is() > EDITORIAL_ELEMENT && this->Is() < EDITORIAL_ELEMENT_max); }; bool IsLayerElement() { return (this->Is() > LAYER_ELEMENT && this->Is() < LAYER_ELEMENT_max); }; bool IsFloatingElement() { return (this->Is() > FLOATING_ELEMENT && this->Is() < FLOATING_ELEMENT_max); }; + bool IsScoreDefElement() { return (this->Is() > SCORE_DEF_ELEMENT && this->Is() < SCORE_DEF_ELEMENT_max); }; /** * @@ -486,7 +487,7 @@ class Object * Replace all the staffDefs in a scoreDef. * param 0: a pointer to the scoreDef we are going to replace the staffDefs */ - virtual int ReplaceStaffDefsInScoreDef( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; + virtual int ReplaceDrawingValuesInScoreDef( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; /** * Set the initial scoreDef of each page. diff --git a/include/vrv/scoredef.h b/include/vrv/scoredef.h index 602addd5033..513ac0b944d 100644 --- a/include/vrv/scoredef.h +++ b/include/vrv/scoredef.h @@ -6,27 +6,25 @@ ///////////////////////////////////////////////////////////////////////////// -#ifndef __VRV_SCOREDEF_H__ -#define __VRV_SCOREDEF_H__ +#ifndef __VRV_SCORE_DEF_H__ +#define __VRV_SCORE_DEF_H__ #include "atts_shared.h" +#include "drawinginterface.h" #include "object.h" +#include "scoredefinterface.h" namespace vrv { class Clef; -class ClefAttr; class KeySig; -class KeySigAttr; class Mensur; -class MensurAttr; class MeterSig; -class MeterSigAttr; class StaffGrp; class StaffDef; //---------------------------------------------------------------------------- -// ScoreOrStaffDefAttrInterface +// ScoreOrStaffDefElement //---------------------------------------------------------------------------- /** @@ -37,31 +35,17 @@ class StaffDef; * that create a copy of the Element object or a corresponding Element object if a attribute value * object is hold. */ -class ScoreOrStaffDefAttrInterface +class ScoreDefElement: public Object, public ScoreDefInterface { public: /** * @name Constructors, destructors, and other standard methods */ ///@{ - ScoreOrStaffDefAttrInterface(); - virtual ~ScoreOrStaffDefAttrInterface(); + ScoreDefElement(std::string classid); + virtual ~ScoreDefElement(); virtual void Reset(); - ScoreOrStaffDefAttrInterface( const ScoreOrStaffDefAttrInterface& interface ); // copy contructor - ScoreOrStaffDefAttrInterface& operator=( const ScoreOrStaffDefAttrInterface& interface ); // copy assignement; - ///@} - - /** - * @name Replace the clef, keysig, mensur and meterSig. - * The current value (if any) is replaced by the new value (if any). - * Values passed and hold can be either a object or attribute value object. - * For example, it can be either a Clef or a ClefAttr. - ///@{ - */ - void ReplaceClef( Object *newClef ); - void ReplaceKeySig( Object *newKeySig ); - void ReplaceMensur( Object *newMensur ); - void ReplaceMeterSig( Object *newMeterSig ); + virtual ClassId Is() { return SCORE_DEF_ELEMENT; }; ///@} /** @@ -72,58 +56,49 @@ class ScoreOrStaffDefAttrInterface * They are used when writing the MEI. */ ///@{ - Clef *GetClefCopy() const; - KeySig *GetKeySigCopy() const; - Mensur *GetMensurCopy() const; - MeterSig *GetMeterSigCopy() const; + bool HasClefInfo(); + bool HasKeySigInfo(); + bool HasMensurInfo(); + bool HasMeterSigInfo(); ///@} /** - * @name Get the clef, keysig, mensur and meterSig. - * They will return a reference only if the value hold is - * an element (e.g., Clef) and not a attribute value object (ClefAttr). + * @name Get a copy of the clef, keysig, mensur and meterSig. + * These methods creates new objects that need to be deleted. + * The also convert attribute value object to an object. For example, + * if m_clef holds a ClefAttr object, the copy will be a Clef object. * They are used when writing the MEI. */ ///@{ - Clef *GetClefElement() const; - KeySig *GetKeySigElement() const; - Mensur *GetMensurElement() const; - MeterSig *GetMeterSigElement() const; + Clef *GetClefCopy(); + KeySig *GetKeySigCopy(); + Mensur *GetMensurCopy(); + MeterSig *GetMeterSigCopy(); ///@} +protected: + +private: /** - * @name Get the clef, keysig, mensur and meterSig attributes. - * They will return a reference only if the value hold is - * an attibute value object (e.g., ClefAtt) and not an element (Clef). + * @name Methods for checking if clef info is available at the attribute level */ ///@{ - ClefAttr *GetClefAttr() const; - KeySigAttr *GetKeySigAttr() const; - MensurAttr *GetMensurAttr() const; - MeterSigAttr *GetMeterSigAttr() const; + bool HasClefAttrInfo(); + bool HasKeySigAttrInfo(); + bool HasMensurAttrInfo(); + bool HasMeterSigAttrInfo(); ///@} - + /** - * @name Get the clef, keysig, mensur and meterSig object. - * They will return a reference to the hold object (element or attribute). + * @name Methods for checking if clef info is available at the element level */ ///@{ - Object *GetClef() const { return m_clef; }; - Object *GetKeySig() const { return m_keySig; }; - Object *GetMensur() const { return m_mensur; }; - Object *GetMeterSig() const { return m_meterSig; }; + bool HasClefElementInfo(); + bool HasKeySigElementInfo(); + bool HasMensurElementInfo(); + bool HasMeterSigElementInfo(); ///@} -protected: - /** The clef or clef attributes */ - Object *m_clef; - /** The key signature */ - Object *m_keySig; - /** The mensur */ - Object *m_mensur; - /** The meter signature (time signature) */ - Object *m_meterSig; - }; @@ -136,7 +111,7 @@ class ScoreOrStaffDefAttrInterface * This class represents a MEI scoreDef. * It contains StaffGrp objects. */ -class ScoreDef: public Object, public ScoreOrStaffDefAttrInterface, public ObjectListInterface +class ScoreDef: public ScoreDefElement, public ObjectListInterface { public: /** @@ -156,14 +131,14 @@ class ScoreDef: public Object, public ScoreOrStaffDefAttrInterface, public Objec /** * Replace the scoreDef with the content of the newScoreDef. */ - void Replace( ScoreDef *newScoreDef ); + void ReplaceDrawingValues( ScoreDef *newScoreDef ); /** * Replace the corresponding staffDef with the content of the newStaffDef. * Looks for the staffDef with the same m_n (@n) and replace the attribute set. - * Attribute set is provided by the ScoreOrStaffDefAttrInterface. + * Attribute set is provided by the ScoreOrStaffDefInterface. */ - void Replace( StaffDef *newStaffDef ); + void ReplaceDrawingValues( StaffDef *newStaffDef ); /** * Get the staffDef with number n (NULL if not found). @@ -290,7 +265,7 @@ class StaffGrp: public Object, public ObjectListInterface /** * This class represents a MEI staffDef. */ -class StaffDef: public Object, public ScoreOrStaffDefAttrInterface, +class StaffDef: public ScoreDefElement, public StaffDefDrawingInterface, public AttCommon, public AttLabelsAddl, public AttScalable, @@ -310,25 +285,6 @@ class StaffDef: public Object, public ScoreOrStaffDefAttrInterface, virtual ClassId Is() { return STAFF_DEF; }; ///@} - /** - * @name Set and get the layer drawing flags for clef, keysig and mensur. - * This will be true when starting a new system or when a scoreDef or staffDef changes occurs - * This will be true only for the first layer in the staff. - */ - ///@{ - bool DrawClef() const { return m_drawClef; }; - void SetDrawClef( bool drawClef ) { m_drawClef = drawClef; }; - bool DrawKeySig() const { return m_drawKeySig; }; - void SetDrawKeySig( bool drawKeySig ) { m_drawKeySig = drawKeySig; }; - bool DrawKeySigCancellation() const { return m_drawKeySigCancellation; }; - void SetDrawKeySigCancellation( bool drawKeySigCancellation ) { m_drawKeySigCancellation = drawKeySigCancellation; }; - bool DrawMensur() const { return m_drawMensur; }; - void SetDrawMensur( bool drawMensur ) { m_drawMensur = drawMensur; }; - bool DrawMeterSig() const { return m_drawMeterSig; }; - void SetDrawMeterSig( bool drawMeterSig ) { m_drawMeterSig = drawMeterSig; }; - ///@} - - //----------// // Functors // //----------// @@ -338,7 +294,7 @@ class StaffDef: public Object, public ScoreOrStaffDefAttrInterface, * Calls ScoreDef::Replace. * param 0: a pointer to the scoreDef we are going to replace the staffDefs */ - virtual int ReplaceStaffDefsInScoreDef( ArrayPtrVoid *params ); + virtual int ReplaceDrawingValuesInScoreDef( ArrayPtrVoid *params ); /** * Set flags for the staff set for indicating whether clefs, keysig, etc. needs to be redrawn. @@ -354,16 +310,6 @@ class StaffDef: public Object, public ScoreOrStaffDefAttrInterface, public: private: - /** - * @name Flags for indicating whether the clef, keysig and mensur needs to be drawn or not - */ - ///@{ - bool m_drawClef; - bool m_drawKeySig; - bool m_drawKeySigCancellation; - bool m_drawMensur; - bool m_drawMeterSig; - ///@} }; diff --git a/include/vrv/scoredefinterface.h b/include/vrv/scoredefinterface.h new file mode 100644 index 00000000000..272a5c44cb0 --- /dev/null +++ b/include/vrv/scoredefinterface.h @@ -0,0 +1,60 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: scoredefinterface.h +// Author: Laurent Pugin +// Created: 2015 +// Copyright (c) Authors and others. All rights reserved. +///////////////////////////////////////////////////////////////////////////// + + +#ifndef __VRV_SCORE_DEF_INTERFACE_H__ +#define __VRV_SCORE_DEF_INTERFACE_H__ + +#include "atts_mensural.h" +#include "atts_shared.h" +#include "vrvdef.h" + +namespace vrv { + +//---------------------------------------------------------------------------- +// ScoreDefInterface +//---------------------------------------------------------------------------- + +/** + * This class is an interface for elements implementing a text directive, such + * as , , or + * It is not an abstract class but should not be instanciate directly. + */ +class ScoreDefInterface: public Interface, + public AttCleffingLog, + public AttKeySigDefaultLog, + public AttKeySigDefaultVis, + public AttMensuralLog, + public AttMensuralShared, + public AttMeterSigDefaultLog, + public AttMeterSigDefaultVis +{ +public: + /** + * @name Constructors, destructors, reset methods + * Reset method reset all attribute classes + */ + ///@{ + ScoreDefInterface(); + virtual ~ScoreDefInterface(); + virtual void Reset(); + virtual InterfaceId IsInterface() { return INTERFACE_SCOREDEF; }; + ///@} + +protected: + +private: + +public: + +private: + +}; + +} // namespace vrv + +#endif diff --git a/include/vrv/system.h b/include/vrv/system.h index 69801417f03..568dc5bdcfa 100644 --- a/include/vrv/system.h +++ b/include/vrv/system.h @@ -10,7 +10,7 @@ #define __VRV_SYSTEM_H__ #include "aligner.h" -#include "drawinglistinterface.h" +#include "drawinginterface.h" #include "object.h" namespace vrv { diff --git a/include/vrv/vrvdef.h b/include/vrv/vrvdef.h index a23d8e69dab..ffd09722fb0 100644 --- a/include/vrv/vrvdef.h +++ b/include/vrv/vrvdef.h @@ -59,10 +59,8 @@ enum ClassId { MENSUR_ATTR, METER_SIG_ATTR, PAGE, - SCORE_DEF, STAFF, STAFF_ALIGNMENT, - STAFF_DEF, STAFF_GRP, SYSTEM, SYSTEM_ALIGNER, @@ -104,6 +102,11 @@ enum ClassId { TIE, FLOATING_ELEMENT_max, // + SCORE_DEF_ELEMENT, + SCORE_DEF, + STAFF_DEF, + SCORE_DEF_ELEMENT_max, + // UNSPECIFIED }; @@ -112,6 +115,7 @@ enum InterfaceId { INTERFACE_DURATION, INTERFACE_PITCH, INTERFACE_POSITION, + INTERFACE_SCOREDEF, INTERFACE_TEXT_DIR, INTERFACE_TIME_SPANNING }; diff --git a/java/build.sh b/java/build.sh index 44cef4a195f..fda418eb8e3 100755 --- a/java/build.sh +++ b/java/build.sh @@ -21,7 +21,7 @@ FILES="../src/accid.cpp \ ../src/devicecontext.cpp \ ../src/doc.cpp \ ../src/dot.cpp \ - ../src/drawinglistinterface.cpp \ + ../src/drawinginterface.cpp \ ../src/durationinterface.cpp \ ../src/editorial.cpp \ ../src/floatingelement.cpp \ @@ -54,6 +54,7 @@ FILES="../src/accid.cpp \ ../src/view_tuplet.cpp \ ../src/rest.cpp \ ../src/scoredef.cpp \ + ../src/scoredefinterface.cpp \ ../src/slur.cpp \ ../src/space.cpp \ ../src/staff.cpp \ diff --git a/python/setup.py b/python/setup.py index 90c18b1f48d..bc9c00bce95 100755 --- a/python/setup.py +++ b/python/setup.py @@ -25,7 +25,7 @@ '../src/devicecontext.cpp', '../src/doc.cpp', '../src/dot.cpp', - '../src/drawinglistinterface.cpp', + '../src/drawinginterface.cpp', '../src/durationinterface.cpp', '../src/editorial.cpp', '../src/floatingelement.cpp', @@ -56,8 +56,9 @@ '../src/view_mensural.cpp', '../src/view_page.cpp', '../src/view_tuplet.cpp', - '../src/rest.cpp', - '../src/scoredef.cpp', + '../src/rest.cpp', + '../src/scoredef.cpp', + '../src/scoredefinterface.cpp', '../src/slur.cpp', '../src/space.cpp', '../src/staff.cpp', diff --git a/src/beam.cpp b/src/beam.cpp index ee11dcc6b14..0567399f781 100644 --- a/src/beam.cpp +++ b/src/beam.cpp @@ -33,6 +33,7 @@ Beam::Beam(): Beam::~Beam() { + ClearCoords(); } void Beam::Reset() @@ -100,7 +101,7 @@ void Beam::FilterList( ListOfObjects *childList ) void Beam::InitCoords( ListOfObjects *childList ) { - this->ClearCoords(); + ClearCoords(); m_beamElementCoords.reserve( childList->size() ); int i; for (i = 0; i < childList->size(); i++ ) { diff --git a/src/clef.cpp b/src/clef.cpp index 90c7eab3d89..d187f5313ef 100644 --- a/src/clef.cpp +++ b/src/clef.cpp @@ -7,6 +7,7 @@ #include "clef.h" +#include "scoredefinterface.h" namespace vrv { @@ -23,7 +24,7 @@ Clef::Clef(): Init(); } -Clef::Clef( ClefAttr *clefAttr ): +Clef::Clef( ScoreDefInterface *clefAttr ): LayerElement("clef-") { Init(); @@ -81,28 +82,5 @@ int Clef::GetClefOffset () } return offset; } - - -//---------------------------------------------------------------------------- -// ClefAttr -//---------------------------------------------------------------------------- - -ClefAttr::ClefAttr(): - Object(), - AttCleffingLog() -{ - RegisterAttClass(ATT_CLEFFINGLOG); - Reset(); -} - -ClefAttr::~ClefAttr() -{ -} - -void ClefAttr::Reset() -{ - Object::Reset(); - ResetCleffingLog(); -} } // namespace vrv diff --git a/src/doc.cpp b/src/doc.cpp index 1aca85df760..d4962bb1dd4 100644 --- a/src/doc.cpp +++ b/src/doc.cpp @@ -295,6 +295,10 @@ void Doc::SetCurrentScoreDef( bool force ) params.push_back( &staffDef ); Functor setCurrentScoreDef( &Object::SetCurrentScoreDef ); + // First process the current scoreDef in order to fill the staffDef with + // the appropriate drawing values + currentScoreDef.Process( &setCurrentScoreDef, ¶ms ); + //LogElapsedTimeStart( ); this->Process( &setCurrentScoreDef, ¶ms ); //LogElapsedTimeEnd ( "Setting scoreDefs" ); diff --git a/src/drawinginterface.cpp b/src/drawinginterface.cpp new file mode 100644 index 00000000000..7bde16d591f --- /dev/null +++ b/src/drawinginterface.cpp @@ -0,0 +1,178 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: drawinginterface.cpp +// Author: Laurent Pugin +// Created: 2015 +// Copyright (c) Authors and others. All rights reserved. +///////////////////////////////////////////////////////////////////////////// + + +#include "drawinginterface.h" + +//---------------------------------------------------------------------------- + +#include "clef.h" +#include "keysig.h" +#include "layerelement.h" +#include "mensur.h" +#include "metersig.h" + +namespace vrv { + +//---------------------------------------------------------------------------- +// DrawingListInterface +//---------------------------------------------------------------------------- + +DrawingListInterface::DrawingListInterface() +{ + Reset(); +} + + +DrawingListInterface::~DrawingListInterface() +{ +} + + +void DrawingListInterface::Reset() +{ + m_drawingList.clear(); +} + + + +void DrawingListInterface::AddToDrawingList( DocObject *object ) +{ + m_drawingList.push_back( object ); + m_drawingList.sort(); + m_drawingList.unique(); +} + +ListOfObjects *DrawingListInterface::GetDrawingList( ) +{ + return &m_drawingList; +} + +void DrawingListInterface::ResetDrawingList( ) +{ + m_drawingList.clear(); +} + +//---------------------------------------------------------------------------- +// StaffDefDrawingInterface +//---------------------------------------------------------------------------- + +StaffDefDrawingInterface::StaffDefDrawingInterface() +{ + // owned pointers need to be set to NULL; + m_currentClef = NULL; + m_currentKeySig = NULL; + m_currentMensur = NULL; + m_currentMeterSig = NULL; + Reset(); +} + +StaffDefDrawingInterface::~StaffDefDrawingInterface() +{ + Reset(); +} + +void StaffDefDrawingInterface::Reset() +{ + if (m_currentClef) { + delete m_currentClef; + m_currentClef = NULL; + } + if (m_currentKeySig) { + delete m_currentKeySig; + m_currentKeySig = NULL; + } + if (m_currentMensur) { + delete m_currentMensur; + m_currentMensur = NULL; + } + if (m_currentMeterSig) { + delete m_currentMeterSig; + m_currentMeterSig = NULL; + } + m_drawClef = false; + m_drawKeySig = false; + m_drawKeySigCancellation = false; + m_drawMensur = false; + m_drawMeterSig = false; +} + +void StaffDefDrawingInterface::SetCurrentClef( Clef *clef ) +{ + if (clef) { + if (m_currentClef) delete m_currentClef; + m_currentClef = clef; + m_currentClef->SetScoreOrStaffDefAttr(true); + } +} + +void StaffDefDrawingInterface::SetCurrentKeySig( KeySig *keySig ) +{ + if (keySig) { + if (m_currentKeySig) { + keySig->m_drawingCancelAccidCount = m_currentKeySig->GetAlterationNumber(); + keySig->m_drawingCancelAccidType = m_currentKeySig->GetAlterationType(); + delete m_currentKeySig; + } + m_currentKeySig = keySig; + m_currentKeySig->SetScoreOrStaffDefAttr(true); + } +} + +void StaffDefDrawingInterface::SetCurrentMensur( Mensur *mensur ) +{ + if (mensur) { + if (m_currentMensur) delete m_currentMensur; + m_currentMensur = mensur; + m_currentMensur->SetScoreOrStaffDefAttr(true); + } +} + +void StaffDefDrawingInterface::SetCurrentMeterSig( MeterSig *meterSig ) +{ + if (meterSig) { + if (m_currentMeterSig) delete m_currentMeterSig; + m_currentMeterSig = meterSig; + m_currentMeterSig->SetScoreOrStaffDefAttr(true); + } +} + +StaffDefDrawingInterface::StaffDefDrawingInterface( const StaffDefDrawingInterface& interface ) +{ + m_currentClef = NULL; + m_currentKeySig = NULL; + m_currentMensur = NULL; + m_currentMeterSig = NULL; + Reset(); +} + +StaffDefDrawingInterface& StaffDefDrawingInterface::operator=( const StaffDefDrawingInterface& interface ) +{ + if ( this != &interface ) // not self assignement + { + if (m_currentClef) { + delete m_currentClef; + m_currentClef = NULL; + } + if (m_currentKeySig) { + delete m_currentKeySig; + m_currentKeySig = NULL; + } + if (m_currentMensur) { + delete m_currentMensur; + m_currentMensur = NULL; + } + if (m_currentMeterSig) { + delete m_currentMeterSig; + m_currentMeterSig = NULL; + } + Reset(); + } + return *this; +} + +} // namespace vrv diff --git a/src/drawinglistinterface.cpp b/src/drawinglistinterface.cpp deleted file mode 100644 index 8bfec4aba7a..00000000000 --- a/src/drawinglistinterface.cpp +++ /dev/null @@ -1,79 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: drawinglistinterface.cpp -// Author: Laurent Pugin -// Created: 2015 -// Copyright (c) Authors and others. All rights reserved. -///////////////////////////////////////////////////////////////////////////// - - -#include "drawinglistinterface.h" - -//---------------------------------------------------------------------------- - -#include "layerelement.h" - -namespace vrv { - -//---------------------------------------------------------------------------- -// DrawingListInterface -//---------------------------------------------------------------------------- - -DrawingListInterface::DrawingListInterface() -{ - Reset(); -} - - -DrawingListInterface::~DrawingListInterface() -{ -} - - -void DrawingListInterface::Reset() -{ - m_drawingList.clear(); -} - - - -void DrawingListInterface::AddToDrawingList( DocObject *object ) -{ - m_drawingList.push_back( object ); - m_drawingList.sort(); - m_drawingList.unique(); -} - -ListOfObjects *DrawingListInterface::GetDrawingList( ) -{ - return &m_drawingList; -} - -void DrawingListInterface::ResetDrawingList( ) -{ - m_drawingList.clear(); -} - -//---------------------------------------------------------------------------- -// KeySigDrawingInterface -//---------------------------------------------------------------------------- - -KeySigDrawingInterface::KeySigDrawingInterface() -{ - Reset(); -} - - -KeySigDrawingInterface::~KeySigDrawingInterface() -{ -} - - -void KeySigDrawingInterface::Reset() -{ - m_drawingCancelAccidType = ACCIDENTAL_EXPLICIT_n; - m_drawingCancelAccidCount = 0; - m_drawingShow = true; - m_drawingShowchange = false; -} - -} // namespace vrv diff --git a/src/iomei.cpp b/src/iomei.cpp index 163fda6be26..261948b5d6c 100644 --- a/src/iomei.cpp +++ b/src/iomei.cpp @@ -399,23 +399,9 @@ bool MeiOutput::WriteMeiScoreDef( pugi::xml_node currentNode, ScoreDef *scoreDef assert( scoreDef ); currentNode.append_attribute( "xml:id" ) = UuidToMeiStr( scoreDef ).c_str(); - if (scoreDef->GetClefAttr()) { - scoreDef->GetClefAttr()->WriteCleffingLog(currentNode); - } - if (scoreDef->GetKeySigAttr()) { - scoreDef->GetKeySigAttr()->WriteKeySigDefaultLog(currentNode); - scoreDef->GetKeySigAttr()->WriteKeySigDefaultVis(currentNode); - } - if ( scoreDef->GetMensurAttr() ) { - scoreDef->GetMensurAttr()->WriteMensuralLog(currentNode); - scoreDef->GetMensurAttr()->WriteMensuralShared(currentNode); - } - if ( scoreDef->GetMeterSigAttr() ) { - scoreDef->GetMeterSigAttr()->WriteMeterSigDefaultLog(currentNode); - scoreDef->GetMeterSigAttr()->WriteMeterSigDefaultVis(currentNode); - } + + WriteScoreDefInterface(currentNode, scoreDef); - // this needs to be fixed return true; } @@ -445,21 +431,7 @@ bool MeiOutput::WriteMeiStaffDef( pugi::xml_node currentNode, StaffDef *staffDef staffDef->WriteScalable(currentNode); staffDef->WriteStaffDefVis(currentNode); - if (staffDef->GetClefAttr()) { - staffDef->GetClefAttr()->WriteCleffingLog(currentNode); - } - if (staffDef->GetKeySigAttr()) { - staffDef->GetKeySigAttr()->WriteKeySigDefaultLog(currentNode); - staffDef->GetKeySigAttr()->WriteKeySigDefaultVis(currentNode); - } - if ( staffDef->GetMensurAttr() ) { - staffDef->GetMensurAttr()->WriteMensuralLog(currentNode); - staffDef->GetMensurAttr()->WriteMensuralShared(currentNode); - } - if ( staffDef->GetMeterSigAttr() ) { - staffDef->GetMeterSigAttr()->WriteMeterSigDefaultLog(currentNode); - staffDef->GetMeterSigAttr()->WriteMeterSigDefaultVis(currentNode); - } + WriteScoreDefInterface(currentNode, staffDef); return true; } @@ -755,7 +727,7 @@ void MeiOutput::WriteDurationInterface(pugi::xml_node element, vrv::DurationInte interface->WriteStaffident(element); } -void MeiOutput::WritePitchInterface(pugi::xml_node element, vrv::PitchInterface *interface) +void MeiOutput::WritePitchInterface(pugi::xml_node element, PitchInterface *interface) { assert( interface ); @@ -764,14 +736,27 @@ void MeiOutput::WritePitchInterface(pugi::xml_node element, vrv::PitchInterface interface->WritePitch(element); } -void MeiOutput::WritePositionInterface(pugi::xml_node element, vrv::PositionInterface *interface) +void MeiOutput::WritePositionInterface(pugi::xml_node element, PositionInterface *interface) { assert( interface ); interface->WriteStafflocPitched(element); } + +void MeiOutput::WriteScoreDefInterface(pugi::xml_node element, ScoreDefInterface *interface) +{ + assert( interface ); + + interface->WriteCleffingLog(element); + interface->WriteKeySigDefaultLog(element); + interface->WriteKeySigDefaultVis(element); + interface->WriteMensuralLog(element); + interface->WriteMensuralShared(element); + interface->WriteMeterSigDefaultLog(element); + interface->WriteMeterSigDefaultVis(element); +} -void MeiOutput::WriteTextDirInterface(pugi::xml_node element, vrv::TextDirInterface *interface) +void MeiOutput::WriteTextDirInterface(pugi::xml_node element, TextDirInterface *interface) { assert( interface ); @@ -780,7 +765,7 @@ void MeiOutput::WriteTextDirInterface(pugi::xml_node element, vrv::TextDirInterf interface->WriteStaffident(element); } -void MeiOutput::WriteTimeSpanningInterface(pugi::xml_node element, vrv::TimeSpanningInterface *interface) +void MeiOutput::WriteTimeSpanningInterface(pugi::xml_node element, TimeSpanningInterface *interface) { assert( interface ); @@ -795,7 +780,7 @@ void MeiOutput::WriteSameAsAttr(pugi::xml_node element, Object *object) } } -void MeiOutput::WriteUnsupportedAttr(pugi::xml_node element, vrv::Object *object) +void MeiOutput::WriteUnsupportedAttr(pugi::xml_node element, Object *object) { ArrayOfStrAttr::iterator iter; for (iter = object->m_unsupported.begin(); iter != object->m_unsupported.end(); iter++) { @@ -1241,25 +1226,7 @@ bool MeiInput::ReadMeiScoreDef( Object *parent, pugi::xml_node scoreDef ) } SetMeiUuid(scoreDef, vrvScoreDef); - ClefAttr clefAttr; - if ( clefAttr.ReadCleffingLog( scoreDef ) ) { - vrvScoreDef->ReplaceClef( &clefAttr ); - } - KeySigAttr keySigAttr; - if ( keySigAttr.ReadKeySigDefaultLog( scoreDef ) || keySigAttr.ReadKeySigDefaultVis( scoreDef ) ) { - keySigAttr.ReadKeySigDefaultVis( scoreDef ); // not great, but we need to do it in case we have both and the first one succeeded - vrvScoreDef->ReplaceKeySig( &keySigAttr ); - } - MeterSigAttr meterSig; - if ( meterSig.ReadMeterSigDefaultLog( scoreDef ) || meterSig.ReadMeterSigDefaultVis( scoreDef ) ) { - meterSig.ReadMeterSigDefaultVis( scoreDef ); // same as above, needs refactoring - vrvScoreDef->ReplaceMeterSig( &meterSig ); - } - MensurAttr mensur; - if ( mensur.ReadMensuralLog( scoreDef ) || mensur.ReadMensuralShared( scoreDef ) ) { - mensur.ReadMensuralShared( scoreDef ); // same as above, needs refactoring - vrvScoreDef->ReplaceMensur( &mensur ); - } + ReadScoreDefInterface(scoreDef, vrvScoreDef); AddScoreDef(parent, vrvScoreDef); @@ -1364,25 +1331,7 @@ bool MeiInput::ReadMeiStaffDef( Object *parent, pugi::xml_node staffDef ) LogWarning("No @n on might yield unpredictable results"); } - ClefAttr clefAttr; - if ( clefAttr.ReadCleffingLog( staffDef ) ) { - vrvStaffDef->ReplaceClef( &clefAttr ); - } - KeySigAttr keySigAttr; - if ( keySigAttr.ReadKeySigDefaultLog( staffDef ) || keySigAttr.ReadKeySigDefaultVis( staffDef ) ) { - keySigAttr.ReadKeySigDefaultVis( staffDef ); // not great, but we need to do it in case we have both and the first one succeeded - vrvStaffDef->ReplaceKeySig( &keySigAttr ); - } - MeterSigAttr meterSig; - if ( meterSig.ReadMeterSigDefaultLog( staffDef ) || meterSig.ReadMeterSigDefaultVis( staffDef ) ) { - meterSig.ReadMeterSigDefaultVis( staffDef ); // same as above, needs refactoring - vrvStaffDef->ReplaceMeterSig( &meterSig ); - } - MensurAttr mensur; - if ( mensur.ReadMensuralLog( staffDef ) || mensur.ReadMensuralShared( staffDef ) ) { - mensur.ReadMensuralShared( staffDef ); // same as above, needs refactoring - vrvStaffDef->ReplaceMensur( &mensur ); - } + ReadScoreDefInterface(staffDef, vrvStaffDef); // This could me moved to an AddMeasure method for consistency with AddLayerElement if ( parent->Is() == STAFF_GRP ) { @@ -1974,6 +1923,18 @@ bool MeiInput::ReadPositionInterface(pugi::xml_node element, PositionInterface * return true; } +bool MeiInput::ReadScoreDefInterface(pugi::xml_node element, ScoreDefInterface *interface) +{ + interface->ReadCleffingLog(element); + interface->ReadKeySigDefaultLog(element); + interface->ReadKeySigDefaultVis(element); + interface->ReadMensuralLog(element); + interface->ReadMensuralShared(element); + interface->ReadMeterSigDefaultLog(element); + interface->ReadMeterSigDefaultVis(element); + return true; +} + bool MeiInput::ReadTextDirInterface(pugi::xml_node element, TextDirInterface *interface) { interface->ReadCommon(element); diff --git a/src/iopae.cpp b/src/iopae.cpp index db6b9a20a8c..3e76d7e6d4b 100644 --- a/src/iopae.cpp +++ b/src/iopae.cpp @@ -384,12 +384,10 @@ void PaeInput::parsePlainAndEasy(std::istream &infile) { staffDef->SetN( 1 ); staffDef->SetLines(5); if (staffDefClef) { - ClefAttr clefAttr; - clefAttr.SetClefShape(staffDefClef->GetShape()); - clefAttr.SetClefLine(staffDefClef->GetLine()); - clefAttr.SetClefDis(staffDefClef->GetDis()); - clefAttr.SetClefDisPlace(staffDefClef->GetDisPlace()); - staffDef->ReplaceClef( &clefAttr ); + staffDef->SetClefShape(staffDefClef->GetShape()); + staffDef->SetClefLine(staffDefClef->GetLine()); + staffDef->SetClefDis(staffDefClef->GetDis()); + staffDef->SetClefDisPlace(staffDefClef->GetDisPlace()); delete staffDefClef; } staffGrp->AddStaffDef( staffDef ); diff --git a/src/keysig.cpp b/src/keysig.cpp index cd02ec7c8e0..db4a803d6a9 100644 --- a/src/keysig.cpp +++ b/src/keysig.cpp @@ -7,6 +7,7 @@ #include "keysig.h" +#include "scoredefinterface.h" //---------------------------------------------------------------------------- @@ -54,7 +55,7 @@ int KeySig::octave_map[2][9][7] = { //---------------------------------------------------------------------------- KeySig::KeySig(): - LayerElement("ksig-"), KeySigDrawingInterface(), + LayerElement("ksig-"), AttAccidental(), AttPitch() { @@ -63,7 +64,7 @@ KeySig::KeySig(): } KeySig::KeySig(int alterationNumber, data_ACCIDENTAL_EXPLICIT alterationType): - LayerElement("ksig-"), KeySigDrawingInterface(), + LayerElement("ksig-"), AttAccidental(), AttPitch() { @@ -74,13 +75,13 @@ KeySig::KeySig(int alterationNumber, data_ACCIDENTAL_EXPLICIT alterationType): m_alterationType = alterationType; } -KeySig::KeySig( KeySigAttr *keySigAttr ): - LayerElement("ksig-"), KeySigDrawingInterface( *keySigAttr ), +KeySig::KeySig( ScoreDefInterface *keySigAttr ): + LayerElement("ksig-"), AttAccidental(), AttPitch() { Init(); - // Do not call reset because we key values passed by the keySigAttr arg + Reset(); char key = keySigAttr->GetKeySig() - KEYSIGNATURE_0; /* see data_KEYSIGNATURE order; key will be: @@ -124,11 +125,16 @@ KeySig::~KeySig() void KeySig::Reset() { LayerElement::Reset(); - KeySigDrawingInterface::Reset(); ResetAccidental(); ResetPitch(); m_alterationNumber = 0; m_alterationType = ACCIDENTAL_EXPLICIT_n; + + // key change drawing values + m_drawingCancelAccidType = ACCIDENTAL_EXPLICIT_n; + m_drawingCancelAccidCount = 0; + m_drawingShow = true; + m_drawingShowchange = false; } @@ -216,31 +222,4 @@ int KeySig::GetOctave(data_ACCIDENTAL_EXPLICIT alterationType, data_PITCHNAME pi return octave_map[alter_set][key_set][pitch - 1] + OCTAVE_OFFSET; } - -//---------------------------------------------------------------------------- -// KeySigAttr -//---------------------------------------------------------------------------- - -KeySigAttr::KeySigAttr(): - Object(), KeySigDrawingInterface(), - AttKeySigDefaultLog(), - AttKeySigDefaultVis() -{ - RegisterAttClass(ATT_KEYSIGDEFAULTLOG); - RegisterAttClass(ATT_KEYSIGDEFAULTVIS); - Reset(); -} - -KeySigAttr::~KeySigAttr() -{ -} - -void KeySigAttr::Reset() -{ - Object::Reset(); - KeySigDrawingInterface::Reset(); - ResetKeySigDefaultLog(); - ResetKeySigDefaultVis(); -} - } // namespace vrv \ No newline at end of file diff --git a/src/layer.cpp b/src/layer.cpp index a8aec975bbd..ab8fdcd4835 100644 --- a/src/layer.cpp +++ b/src/layer.cpp @@ -31,61 +31,25 @@ namespace vrv { //---------------------------------------------------------------------------- Layer::Layer( ): - DocObject("layer-"), DrawingListInterface(), ObjectListInterface(), + DocObject("layer-"), DrawingListInterface(), ObjectListInterface(), StaffDefDrawingInterface(), AttCommon() { RegisterAttClass(ATT_COMMON); - // own pointers need to be initialized before Reset() - m_currentClef = NULL; - m_currentKeySig = NULL; - m_currentMensur = NULL; - m_currentMeterSig = NULL; + Reset(); } Layer::~Layer() { - if (m_currentClef) { - delete m_currentClef; - } - if (m_currentKeySig) { - delete m_currentKeySig; - } - if (m_currentMensur) { - delete m_currentMensur; - } - if (m_currentMeterSig) { - delete m_currentMeterSig; - } } void Layer::Reset() { DocObject::Reset(); DrawingListInterface::Reset(); + StaffDefDrawingInterface::Reset(); ResetCommon(); - - if (m_currentClef) { - delete m_currentClef; - } - if (m_currentKeySig) { - delete m_currentKeySig; - } - if (m_currentMensur) { - delete m_currentMensur; - } - if (m_currentMeterSig) { - delete m_currentMeterSig; - } - // Have at least a clef by default - m_currentClef = new Clef(); - m_currentKeySig = NULL; - m_currentMensur = NULL; - m_currentMeterSig = NULL; - m_drawClef = false; - m_drawKeySig = false; - m_drawMensur = false; - m_drawMeterSig = false; + m_drawingStemDir = STEMDIRECTION_NONE; } @@ -122,46 +86,17 @@ LayerElement *Layer::GetAtPos( int x ) } return element; } - -void Layer::SetCurrentClef( Clef *clef ) -{ - if (clef) { - if (m_currentClef) delete m_currentClef; - m_currentClef = clef; - } -} - -void Layer::SetCurrentKeySig( KeySig *keySig ) -{ - if (keySig) { - if (m_currentKeySig) delete m_currentKeySig; - m_currentKeySig = keySig; - } -} - -void Layer::SetCurrentMensur( Mensur *mensur ) -{ - if (mensur) { - if (m_currentMensur) delete m_currentMensur; - m_currentMensur = mensur; - } -} - -void Layer::SetCurrentMeterSig( MeterSig *meterSig ) -{ - if (meterSig) { - if (m_currentMeterSig) delete m_currentMeterSig; - m_currentMeterSig = meterSig; - } -} -void Layer::SetDrawingAndCurrentValues( ScoreDef *currentScoreDef, StaffDef *currentStaffDef ) +void Layer::SetDrawingAndCurrentValues( StaffDef *currentStaffDef ) { - if (!currentStaffDef || !currentScoreDef) { - LogDebug("scoreDef and/or staffDef not found"); + if (!currentStaffDef) { + LogDebug("staffDef not found"); return; } + // Remove any previous value in the Layer + this->StaffDefDrawingInterface::Reset(); + this->SetDrawClef( currentStaffDef->DrawClef() ); this->SetDrawKeySig( currentStaffDef->DrawKeySig() ); this->SetDrawMensur( currentStaffDef->DrawMensur() ); @@ -174,32 +109,17 @@ void Layer::SetDrawingAndCurrentValues( ScoreDef *currentScoreDef, StaffDef *cur currentStaffDef->SetDrawMeterSig( false ); currentStaffDef->SetDrawKeySigCancellation( false ); - if ( currentStaffDef->GetClef() ) { - this->SetCurrentClef( currentStaffDef->GetClefCopy() ); + if ( currentStaffDef->GetCurrentClef() ) { + this->SetCurrentClef(new Clef(*currentStaffDef->GetCurrentClef())); } - else { - this->SetCurrentClef( currentScoreDef->GetClefCopy() ); + if ( currentStaffDef->GetCurrentKeySig() ) { + this->SetCurrentKeySig(new KeySig(*currentStaffDef->GetCurrentKeySig())); } - - if ( currentStaffDef->GetKeySig() ) { - this->SetCurrentKeySig( currentStaffDef->GetKeySigCopy() ); + if ( currentStaffDef->GetCurrentMensur() ) { + this->SetCurrentMensur(new Mensur(*currentStaffDef->GetCurrentMensur())); } - else { - this->SetCurrentKeySig( currentScoreDef->GetKeySigCopy() ); - } - - if ( currentStaffDef->GetMensur() ) { - this->SetCurrentMensur( currentStaffDef->GetMensurCopy() ); - } - else { - this->SetCurrentMensur( currentScoreDef->GetMensurCopy() ); - } - - if ( currentStaffDef->GetMeterSig() ) { - this->SetCurrentMeterSig( currentStaffDef->GetMeterSigCopy() ); - } - else { - this->SetCurrentMeterSig( currentScoreDef->GetMeterSigCopy() ); + if ( currentStaffDef->GetCurrentMeterSig() ) { + this->SetCurrentMeterSig(new MeterSig(*currentStaffDef->GetCurrentMeterSig())); } } @@ -208,7 +128,7 @@ Clef* Layer::GetClef( LayerElement *test ) Object *testObject = test; if (!test) { - return m_currentClef; + return GetCurrentClef(); } //make sure list is set @@ -224,7 +144,7 @@ Clef* Layer::GetClef( LayerElement *test ) return clef; } - return m_currentClef; + return GetCurrentClef(); } int Layer::GetClefOffset( LayerElement *test ) @@ -255,20 +175,20 @@ int Layer::AlignHorizontally( ArrayPtrVoid *params ) // we are starting a new layer, reset the time; (*time) = 0.0; - (*currentMensur) = m_currentMensur; - (*currentMeterSig) = m_currentMeterSig; + (*currentMensur) = GetCurrentMensur(); + (*currentMeterSig) = GetCurrentMeterSig(); - if ( m_drawClef && m_currentClef ) { - m_currentClef->AlignHorizontally( params ); + if ( DrawClef() && GetCurrentClef() ) { + GetCurrentClef()->AlignHorizontally( params ); } - if ( m_drawKeySig && m_currentKeySig ) { - m_currentKeySig->AlignHorizontally( params ); + if ( DrawKeySig() && GetCurrentKeySig() ) { + GetCurrentKeySig()->AlignHorizontally( params ); } - if ( m_drawMensur && m_currentMensur) { - m_currentMensur->AlignHorizontally( params ); + if ( DrawMensur() && GetCurrentMensur() ) { + GetCurrentMensur()->AlignHorizontally( params ); } - if ( m_drawMeterSig && m_currentMeterSig ) { - m_currentMeterSig->AlignHorizontally( params ); + if ( DrawMeterSig() && GetCurrentMeterSig() ) { + GetCurrentMeterSig()->AlignHorizontally( params ); } return FUNCTOR_CONTINUE; diff --git a/src/mensur.cpp b/src/mensur.cpp index 66744a6b687..49bbe1ebd92 100644 --- a/src/mensur.cpp +++ b/src/mensur.cpp @@ -7,6 +7,7 @@ #include "mensur.h" +#include "scoredefinterface.h" namespace vrv { @@ -28,7 +29,7 @@ Mensur::Mensur(): Init(); } -Mensur::Mensur( MensurAttr *mensurAttr ): +Mensur::Mensur( ScoreDefInterface *mensurAttr ): LayerElement("mensur-") { Init(); @@ -72,28 +73,4 @@ void Mensur::Reset() ResetSlashcount(); } -//---------------------------------------------------------------------------- -// MensurAttr -//---------------------------------------------------------------------------- - -MensurAttr::MensurAttr(): - Object(), - AttMensuralShared(), - AttMensuralLog() -{ - Reset(); -} - - -MensurAttr::~MensurAttr() -{ -} - -void MensurAttr::Reset() -{ - Object::Reset(); - ResetMensuralShared(); - ResetMensuralLog(); -} - } // namespace vrv \ No newline at end of file diff --git a/src/metersig.cpp b/src/metersig.cpp index d009fc3970b..b595c955cac 100644 --- a/src/metersig.cpp +++ b/src/metersig.cpp @@ -7,6 +7,7 @@ #include "metersig.h" +#include "scoredefinterface.h" namespace vrv { @@ -21,7 +22,7 @@ MeterSig::MeterSig(): Init(); } -MeterSig::MeterSig( MeterSigAttr *meterSigAttr ): +MeterSig::MeterSig( ScoreDefInterface *meterSigAttr ): LayerElement("msig-"), AttMeterSigLog() { @@ -48,30 +49,4 @@ void MeterSig::Reset() ResetMeterSigLog(); } -//---------------------------------------------------------------------------- -// MeterSigAttr -//---------------------------------------------------------------------------- - -MeterSigAttr::MeterSigAttr(): - Object(), - AttMeterSigDefaultLog(), - AttMeterSigDefaultVis() -{ - RegisterAttClass(ATT_METERSIGDEFAULTLOG); - RegisterAttClass(ATT_METERSIGDEFAULTVIS); - Reset(); -} - - -MeterSigAttr::~MeterSigAttr() -{ -} - -void MeterSigAttr::Reset() -{ - Object::Reset(); - ResetMeterSigDefaultLog(); - ResetMeterSigDefaultVis(); -} - } // namespace vrv diff --git a/src/object.cpp b/src/object.cpp index 504df50e13e..f3dbbcb1ac1 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -943,62 +943,27 @@ int Object::SetCurrentScoreDef( ArrayPtrVoid *params ) if (this->Is() == SYSTEM) { System *system = dynamic_cast(this); assert( system ); - currentScoreDef->SetRedrawFlags( true, true, false, false, false ); return FUNCTOR_CONTINUE; } // starting a new scoreDef - if (this->Is() == SCORE_DEF) { ScoreDef *scoreDef= dynamic_cast(this); assert( scoreDef ); - bool drawClef = false; - bool drawKeySig = false; - bool drawMensur = false; - bool drawMeterSig = false; - if (scoreDef->GetClef()) { - drawClef = true; - } - if (scoreDef->GetKeySig()) { - drawKeySig = true; - } - if (scoreDef->GetMensur()) { - drawMensur = true; - } - if (scoreDef->GetMeterSig()) { - drawMeterSig = true; - } // Replace the current scoreDef with the new one, including its content (staffDef) - currentScoreDef->Replace(scoreDef); - // The keySig cancellation flag is the same as keySig because we draw cancellation with new key sig - currentScoreDef->SetRedrawFlags( drawClef, drawKeySig, drawMensur, drawMeterSig, drawKeySig ); + currentScoreDef->ReplaceDrawingValues(scoreDef); return FUNCTOR_CONTINUE; } // starting a new staffDef - // Because staffDef have to be included in a scoreDef, a new staffDef was already - // replaced by the new scoreDef (see above). Here we only need to reset the drawing flags - if (this->Is() == STAFF_DEF) { StaffDef *staffDef= dynamic_cast(this); assert( staffDef ); StaffDef *tmpStaffDef = currentScoreDef->GetStaffDef( staffDef->GetN() ); assert( tmpStaffDef ); - if (staffDef->GetClef()) { - tmpStaffDef->SetDrawClef( true ); - } - if (staffDef->GetKeySig()) { - tmpStaffDef->SetDrawKeySig( true ); - tmpStaffDef->SetDrawKeySigCancellation( true ); - } - if (staffDef->GetMensur()) { - tmpStaffDef->SetDrawMensur( true ); - } - if (staffDef->GetMeterSig()) { - tmpStaffDef->SetDrawMeterSig( true ); - } + currentScoreDef->ReplaceDrawingValues(tmpStaffDef); } // starting a new staff @@ -1024,7 +989,7 @@ int Object::SetCurrentScoreDef( ArrayPtrVoid *params ) layer->SetDrawingStemDir(STEMDIRECTION_down); } } - layer->SetDrawingAndCurrentValues( currentScoreDef, (*currentStaffDef) ); + layer->SetDrawingAndCurrentValues( (*currentStaffDef) ); return FUNCTOR_CONTINUE; } @@ -1033,7 +998,7 @@ int Object::SetCurrentScoreDef( ArrayPtrVoid *params ) Clef *clef = dynamic_cast(this); assert( clef ); assert( *currentStaffDef ); - (*currentStaffDef)->ReplaceClef( clef ); + (*currentStaffDef)->SetCurrentClef( new Clef( *clef ) ); return FUNCTOR_CONTINUE; } @@ -1042,7 +1007,7 @@ int Object::SetCurrentScoreDef( ArrayPtrVoid *params ) KeySig *keysig = dynamic_cast(this); assert( keysig ); assert( *currentStaffDef ); - (*currentStaffDef)->ReplaceKeySig( keysig ); + (*currentStaffDef)->SetCurrentKeySig( new KeySig( *keysig ) ); return FUNCTOR_CONTINUE; } diff --git a/src/scoredef.cpp b/src/scoredef.cpp index ea4dbba6c4c..97045ac9bd3 100644 --- a/src/scoredef.cpp +++ b/src/scoredef.cpp @@ -23,274 +23,167 @@ namespace vrv { //---------------------------------------------------------------------------- -// ScoreOrStaffDefAttrInterface +// ScoreDefElement //---------------------------------------------------------------------------- -ScoreOrStaffDefAttrInterface::ScoreOrStaffDefAttrInterface() +ScoreDefElement::ScoreDefElement(std::string classid): + Object(classid), + ScoreDefInterface() { - // owned pointers need to be set to NULL; - m_clef = NULL; - m_keySig = NULL; - m_mensur = NULL; - m_meterSig = NULL; + RegisterInterface(ScoreDefInterface::GetAttClasses(), ScoreDefInterface::IsInterface()); + Reset(); } -ScoreOrStaffDefAttrInterface::~ScoreOrStaffDefAttrInterface() +ScoreDefElement::~ScoreDefElement() { - if (m_clef) { - delete m_clef; - } - if (m_keySig) { - delete m_keySig; - } - if (m_mensur) { - delete m_mensur; - } - if (m_meterSig) { - delete m_meterSig; - } + } -void ScoreOrStaffDefAttrInterface::Reset() +void ScoreDefElement::Reset() { - if (m_clef) { - delete m_clef; - m_clef = NULL; - } - if (m_keySig) { - delete m_keySig; - m_keySig = NULL; - } - if (m_mensur) { - delete m_mensur; - m_mensur = NULL; - } - if (m_meterSig) { - delete m_meterSig; - m_meterSig = NULL; - } + Object::Reset(); + ScoreDefInterface::Reset(); } - -ScoreOrStaffDefAttrInterface::ScoreOrStaffDefAttrInterface( const ScoreOrStaffDefAttrInterface& interface ) + +bool ScoreDefElement::HasClefInfo() { - m_clef = NULL; - m_keySig = NULL; - m_mensur = NULL; - m_meterSig = NULL; - this->ReplaceClef( interface.m_clef ); - this->ReplaceKeySig( interface.m_keySig ); - this->ReplaceMensur( interface.m_mensur ); - this->ReplaceMeterSig( interface.m_meterSig ); + if (this->HasClefAttrInfo()) return true; + return (this->HasClefElementInfo()); } -ScoreOrStaffDefAttrInterface& ScoreOrStaffDefAttrInterface::operator=( const ScoreOrStaffDefAttrInterface& interface ) +bool ScoreDefElement::HasKeySigInfo() { - if ( this != &interface ) // not self assignement - { - if (m_clef) { - delete m_clef; - m_clef = NULL; - } - if (m_keySig) { - delete m_keySig; - m_keySig = NULL; - } - if (m_mensur) { - delete m_mensur; - m_mensur = NULL; - } - if (m_meterSig) { - delete m_meterSig; - m_meterSig = NULL; - } - this->ReplaceClef( interface.m_clef ); - this->ReplaceKeySig( interface.m_keySig ); - this->ReplaceMensur( interface.m_mensur ); - this->ReplaceMeterSig( interface.m_meterSig ); - } - return *this; -} - -void ScoreOrStaffDefAttrInterface::ReplaceClef( Object *newClef ) -{ - if ( newClef ) { - assert( dynamic_cast(newClef) || dynamic_cast(newClef) ); - if (m_clef) { - delete m_clef; - } - m_clef = newClef->Clone(); - } + if (this->HasKeySigAttrInfo()) return true; + return (this->HasKeySigElementInfo()); } -void ScoreOrStaffDefAttrInterface::ReplaceKeySig( Object *newKeySig ) -{ - if ( newKeySig ) { - assert( dynamic_cast(newKeySig) || dynamic_cast(newKeySig) ); - if (m_keySig) { - // Set the KeySigDrawingInterface values the key sig cancellation. - KeySig *oldKeySig = this->GetKeySigCopy(); - assert( oldKeySig ); - KeySigDrawingInterface *interface = dynamic_cast(newKeySig); - assert( interface ); - interface->m_drawingCancelAccidCount = oldKeySig->GetAlterationNumber(); - interface->m_drawingCancelAccidType = oldKeySig->GetAlterationType(); - delete m_keySig; - delete oldKeySig; - } - m_keySig = newKeySig->Clone(); - } +bool ScoreDefElement::HasMensurInfo() +{ + if (this->HasMensurAttrInfo()) return true; + return (this->HasMensurElementInfo()); } -void ScoreOrStaffDefAttrInterface::ReplaceMensur( Object *newMensur ) +bool ScoreDefElement::HasMeterSigInfo() { - if ( newMensur ) { - assert( dynamic_cast(newMensur) || dynamic_cast(newMensur) ); - if (m_mensur) { - delete m_mensur; - } - m_mensur = newMensur->Clone(); - } + if (this->HasMeterSigAttrInfo()) return true; + return (this->HasMeterSigElementInfo()); } + +bool ScoreDefElement::HasClefAttrInfo() +{ + // We need at least a @clef.shape and a @clef.line ? + return (this->HasClefShape() && this->HasClefLine()); -void ScoreOrStaffDefAttrInterface::ReplaceMeterSig( Object *newMeterSig ) + // Eventually we can look a child clef element + // We would probably need to take into account app and rdg? + return false; +} + +bool ScoreDefElement::HasKeySigAttrInfo() { - if ( newMeterSig ) { - assert( dynamic_cast(newMeterSig) || dynamic_cast(newMeterSig) ); - if (m_meterSig) { - delete m_meterSig; - } - m_meterSig = newMeterSig->Clone(); - } + return (this->HasKeySig()); +} + +bool ScoreDefElement::HasMensurAttrInfo() +{ + // What is the minimum we need? Checking only some for now. Need clarification + return (this->HasProlatio() || this->HasTempus() || this->HasProportNum() || this->HasProportNumbase()); +} + +bool ScoreDefElement::HasMeterSigAttrInfo() +{ + return ( this->HasMeterCount() || this->HasMeterSym() || this->HasMeterUnit()); +} + +bool ScoreDefElement::HasClefElementInfo() +{ + // Eventually we can look a child clef element + // We would probably need to take into account app and rdg? + return false; +} + +bool ScoreDefElement::HasKeySigElementInfo() +{ + return false; +} + +bool ScoreDefElement::HasMensurElementInfo() +{ + return false; +} + +bool ScoreDefElement::HasMeterSigElementInfo() +{ + return false; } -Clef *ScoreOrStaffDefAttrInterface::GetClefCopy() const +Clef *ScoreDefElement::GetClefCopy() { - // we should not call it without having checked if a clef is set - if (!m_clef) return NULL; Clef *copy = NULL; - if (m_clef->Is() == CLEF) { - Clef *current_clef = dynamic_cast(m_clef); - assert( current_clef ); - copy = new Clef(*current_clef); + if (this->HasClefAttrInfo()) { + copy = new Clef( this ); } - else { - ClefAttr *current_attr = dynamic_cast(m_clef); - assert( current_attr ); - copy = new Clef(current_attr); + else if (this->HasClefElementInfo()) { + // Eventually return a copy of the child element; } + // Always check if HasClefInfo() is true before asking for a copy assert(copy); copy->SetScoreOrStaffDefAttr(true); return copy; } -KeySig *ScoreOrStaffDefAttrInterface::GetKeySigCopy() const +KeySig *ScoreDefElement::GetKeySigCopy() { - // we should not call it without having checked if a keysig is set - if (!m_keySig) return NULL; KeySig *copy = NULL; - if (m_keySig->Is() == KEY_SIG) { - KeySig *current_keySig = dynamic_cast(m_keySig); - assert( current_keySig ); - copy = new KeySig(*current_keySig); + if (this->HasKeySigAttrInfo()) { + copy = new KeySig(this); } else { - KeySigAttr *current_attr = dynamic_cast(m_keySig); - assert( current_attr ); - copy = new KeySig(current_attr); + // Eventually return a copy of the child element; } + // Always check if HasKeySigInfo() is true before asking for a copy assert(copy); copy->SetScoreOrStaffDefAttr(true); return copy; } -Mensur *ScoreOrStaffDefAttrInterface::GetMensurCopy() const +Mensur *ScoreDefElement::GetMensurCopy() { - // we should not call it without having checked if a mensur is set - if (!m_mensur) return NULL; Mensur *copy = NULL; - if (m_mensur->Is() == MENSUR) { - Mensur *current_mensur = dynamic_cast(m_mensur); - assert( current_mensur ); - copy = new Mensur(*current_mensur); + if (this->HasMensurAttrInfo()) { + copy = new Mensur(this); } else { - MensurAttr *current_attr = dynamic_cast(m_mensur); - assert( current_attr ); - copy = new Mensur(current_attr); + // Eventually return a copy of the child element; } + // Always check if HasMensurInfo() is true before asking for a copy assert(copy); copy->SetScoreOrStaffDefAttr(true); return copy; } -MeterSig *ScoreOrStaffDefAttrInterface::GetMeterSigCopy() const +MeterSig *ScoreDefElement::GetMeterSigCopy() { - // we should not call it without having checked if a meterSig is set - if (!m_meterSig) return NULL; MeterSig *copy = NULL; - if (m_meterSig->Is() == METER_SIG) { - MeterSig *current_meterSig = dynamic_cast(m_meterSig); - assert( current_meterSig ); - copy = new MeterSig(*current_meterSig); + if (this->HasMeterSigAttrInfo()) { + copy = new MeterSig(this); } else { - MeterSigAttr *current_attr = dynamic_cast(m_meterSig); - assert( current_attr ); - copy = new MeterSig(current_attr); + // Eventually return a copy of the child element; } + // Always check if HasMeterSigInfo() is true before asking for a copy assert(copy); copy->SetScoreOrStaffDefAttr(true); return copy; } -Clef *ScoreOrStaffDefAttrInterface::GetClefElement() const -{ - return dynamic_cast(m_clef); -} - -KeySig *ScoreOrStaffDefAttrInterface::GetKeySigElement() const -{ - return dynamic_cast(m_keySig); -} - -Mensur *ScoreOrStaffDefAttrInterface::GetMensurElement() const -{ - return dynamic_cast(m_mensur); -} - -MeterSig *ScoreOrStaffDefAttrInterface::GetMeterSigElement() const -{ - return dynamic_cast(m_meterSig); -} - -ClefAttr *ScoreOrStaffDefAttrInterface::GetClefAttr() const -{ - return dynamic_cast(m_clef); -} - -KeySigAttr *ScoreOrStaffDefAttrInterface::GetKeySigAttr() const -{ - return dynamic_cast(m_keySig); -} - -MensurAttr *ScoreOrStaffDefAttrInterface::GetMensurAttr() const -{ - return dynamic_cast(m_mensur); -} - -MeterSigAttr *ScoreOrStaffDefAttrInterface::GetMeterSigAttr() const -{ - return dynamic_cast(m_meterSig); -} - - //---------------------------------------------------------------------------- // ScoreDef //---------------------------------------------------------------------------- ScoreDef::ScoreDef() : - Object("scoredef-"), ScoreOrStaffDefAttrInterface(), ObjectListInterface() + ScoreDefElement("scoredef-"), ObjectListInterface() { Reset(); } @@ -301,8 +194,7 @@ ScoreDef::~ScoreDef() void ScoreDef::Reset() { - Object::Reset(); - ScoreOrStaffDefAttrInterface::Reset(); + ScoreDefElement::Reset(); m_drawLabels = false; } @@ -314,30 +206,76 @@ void ScoreDef::AddStaffGrp( StaffGrp *staffGrp ) Modify(); } -void ScoreDef::Replace( ScoreDef *newScoreDef ) +void ScoreDef::ReplaceDrawingValues( ScoreDef *newScoreDef ) { - ReplaceClef( newScoreDef->m_clef ); - ReplaceKeySig( newScoreDef->m_keySig ); - ReplaceMensur( newScoreDef->m_mensur ); - ReplaceMeterSig( newScoreDef->m_meterSig ); + bool drawClef = false; + bool drawKeySig = false; + bool drawMensur = false; + bool drawMeterSig = false; + Clef *clef = NULL; + KeySig *keySig = NULL; + Mensur *mensur = NULL; + MeterSig *meterSig = NULL; + if (newScoreDef->HasClefInfo()) { + drawClef = true; + clef = newScoreDef->GetClefCopy(); + } + if (newScoreDef->HasKeySigInfo()) { + drawKeySig = true; + keySig = newScoreDef->GetKeySigCopy(); + } + if (newScoreDef->HasMensurInfo()) { + drawMensur = true; + mensur = newScoreDef->GetMensurCopy(); + } + if (newScoreDef->HasMeterSigInfo()) { + drawMeterSig = true; + meterSig = newScoreDef->GetMeterSigCopy(); + } + ArrayPtrVoid params; - params.push_back( this ); - Functor replaceStaffDefsInScoreDef( &Object::ReplaceStaffDefsInScoreDef ); - newScoreDef->Process( &replaceStaffDefsInScoreDef, ¶ms ); + params.push_back( clef ); + params.push_back( keySig ); + params.push_back( mensur ); + params.push_back( meterSig ); + Functor replaceDrawingValuesInScoreDef( &Object::ReplaceDrawingValuesInScoreDef ); + this->Process( &replaceDrawingValuesInScoreDef, ¶ms ); + + if (clef) delete clef; + if (keySig) delete keySig; + if (mensur) delete mensur; + if (meterSig) delete meterSig; + + // The keySig cancellation flag is the same as keySig because we draw cancellation with new key sig + this->SetRedrawFlags( drawClef, drawKeySig, drawMensur, drawMeterSig, drawKeySig ); + } -void ScoreDef::Replace( StaffDef *newStaffDef ) +void ScoreDef::ReplaceDrawingValues( StaffDef *newStaffDef ) { // first find the staffDef with the same @n StaffDef *staffDef = this->GetStaffDef( newStaffDef->GetN() ); // if found, replace attributes if (staffDef) { - staffDef->ReplaceClef( newStaffDef->GetClef() ); - staffDef->ReplaceKeySig( newStaffDef->GetKeySig() ); - staffDef->ReplaceMensur( newStaffDef->GetMensur() ); - staffDef->ReplaceMeterSig( newStaffDef->GetMeterSig() ); + if (newStaffDef->HasClefInfo()) { + staffDef->SetDrawClef(true); + staffDef->SetCurrentClef( newStaffDef->GetClefCopy() ); + } + if (staffDef->HasKeySigInfo()) { + staffDef->SetDrawKeySig(true); + staffDef->SetDrawKeySigCancellation(true); + staffDef->SetCurrentKeySig( newStaffDef->GetKeySigCopy() ); + } + if (staffDef->HasMensurInfo()) { + staffDef->SetDrawMensur(true); + staffDef->SetCurrentMensur(newStaffDef->GetMensurCopy()); + } + if (staffDef->HasMeterSigInfo()) { + staffDef->SetDrawMeterSig(true); + staffDef->SetCurrentMeterSig(newStaffDef->GetMeterSigCopy()); + } // copy other attributes if present if ( newStaffDef->HasLabel() ) staffDef->SetLabel( newStaffDef->GetLabel() ); if ( newStaffDef->HasLabelAbbr() ) staffDef->SetLabelAbbr( newStaffDef->GetLabelAbbr() ); @@ -449,7 +387,7 @@ void StaffGrp::FilterList( ListOfObjects *childList ) //---------------------------------------------------------------------------- StaffDef::StaffDef() : - Object(), ScoreOrStaffDefAttrInterface(), + ScoreDefElement("staffdef-"), AttCommon(), AttLabelsAddl(), AttScalable(), @@ -468,16 +406,11 @@ StaffDef::~StaffDef() void StaffDef::Reset() { - Object::Reset(); - ScoreOrStaffDefAttrInterface::Reset(); + ScoreDefElement::Reset(); ResetCommon(); ResetLabelsAddl(); ResetScalable(); ResetStaffDefVis(); - m_drawClef = false; - m_drawKeySig = false; - m_drawMensur = false; - m_drawMeterSig = false; } @@ -512,12 +445,26 @@ int ScoreDef::CastOffSystems( ArrayPtrVoid *params ) // StaffDef functor methods //---------------------------------------------------------------------------- -int StaffDef::ReplaceStaffDefsInScoreDef( ArrayPtrVoid *params ) +int StaffDef::ReplaceDrawingValuesInScoreDef( ArrayPtrVoid *params ) { // param 0: the scoreDef - ScoreDef *scoreDef = static_cast((*params)[0]); + Clef *clef = static_cast((*params)[0]); + KeySig *keySig = static_cast((*params)[1]); + Mensur *mensur = static_cast((*params)[2]); + MeterSig *meterSig = static_cast((*params)[3]); - scoreDef->Replace( this ); + if (clef) { + this->SetCurrentClef(new Clef(*clef)); + } + if (keySig) { + this->SetCurrentKeySig(new KeySig(*keySig)); + } + if (mensur) { + this->SetCurrentMensur(new Mensur(*mensur)); + } + if (meterSig) { + this->SetCurrentMeterSig(new MeterSig(*meterSig)); + } return FUNCTOR_CONTINUE; } diff --git a/src/scoredefinterface.cpp b/src/scoredefinterface.cpp new file mode 100644 index 00000000000..c8bdc54d42e --- /dev/null +++ b/src/scoredefinterface.cpp @@ -0,0 +1,62 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: scoredefinterface.cpp +// Author: Laurent Pugin +// Created: 2015 +// Copyright (c) Authors and others. All rights reserved. +///////////////////////////////////////////////////////////////////////////// + + +#include "scoredefinterface.h" + +//---------------------------------------------------------------------------- + +#include + +//---------------------------------------------------------------------------- + +#include "layerelement.h" +#include "staff.h" +#include "vrv.h" + +namespace vrv { + + +//---------------------------------------------------------------------------- +// ScoreDefInterface +//---------------------------------------------------------------------------- + +ScoreDefInterface::ScoreDefInterface(): Interface(), + AttCleffingLog(), + AttKeySigDefaultLog(), + AttKeySigDefaultVis(), + AttMensuralShared(), + AttMensuralLog(), + AttMeterSigDefaultLog(), + AttMeterSigDefaultVis() +{ + RegisterInterfaceAttClass(ATT_CLEFFINGLOG); + RegisterInterfaceAttClass(ATT_KEYSIGDEFAULTLOG); + RegisterInterfaceAttClass(ATT_KEYSIGDEFAULTVIS); + RegisterInterfaceAttClass(ATT_MENSURALLOG); + RegisterInterfaceAttClass(ATT_MENSURALSHARED); + RegisterInterfaceAttClass(ATT_METERSIGDEFAULTLOG); + RegisterInterfaceAttClass(ATT_METERSIGDEFAULTVIS); + Reset(); +} + +ScoreDefInterface::~ScoreDefInterface() +{ +} + +void ScoreDefInterface::Reset() +{ + ResetCleffingLog(); + ResetKeySigDefaultLog(); + ResetKeySigDefaultVis(); + ResetMensuralLog(); + ResetMensuralShared(); + ResetMeterSigDefaultLog(); + ResetMeterSigDefaultVis(); +} + +} // namespace vrv diff --git a/src/view_page.cpp b/src/view_page.cpp index f202efaf813..be067735576 100644 --- a/src/view_page.cpp +++ b/src/view_page.cpp @@ -920,9 +920,9 @@ void View::DrawSystemChildren( DeviceContext *dc, Object *parent, System *system } // scoreDef are not drawn directly, but anything else should not be possible else if (current->Is() == SCORE_DEF) { - ScoreDef *scoreDef = dynamic_cast(current); - assert( scoreDef ); - m_drawingScoreDef.Replace( scoreDef ); + // nothing to do, then + // ScoreDef *scoreDef = dynamic_cast(current); + // assert( scoreDef ); } else { assert(false); diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index f0054d008ea..845b01d32d4 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -30,7 +30,7 @@ add_executable (verovio ../src/devicecontext.cpp ../src/doc.cpp ../src/dot.cpp - ../src/drawinglistinterface.cpp + ../src/drawinginterface.cpp ../src/durationinterface.cpp ../src/editorial.cpp ../src/floatingelement.cpp @@ -63,6 +63,7 @@ add_executable (verovio ../src/view_tuplet.cpp ../src/rest.cpp ../src/scoredef.cpp + ../src/scoredefinterface.cpp ../src/slur.cpp ../src/space.cpp ../src/staff.cpp From 6cae7e7f484850048b06fa9999839fc858c153b5 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sun, 23 Aug 2015 11:06:33 +0200 Subject: [PATCH 079/114] Fixing bug in chord radius --- src/view_element.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/view_element.cpp b/src/view_element.cpp index a772c03287a..fcf7e263af6 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -899,7 +899,7 @@ void View::DrawChord( DeviceContext *dc, LayerElement *element, Layer *layer, St int staffY = staff->GetDrawingY(); int verticalCenter = staffY - m_doc->GetDrawingDoubleUnit(staffSize)*2; bool drawingCueSize = chord->IsCueSize(); - int radius = m_doc->GetGlyphWidth(SMUFL_E0A3_noteheadHalf, staffSize, drawingCueSize); + int radius = m_doc->GetGlyphWidth(SMUFL_E0A3_noteheadHalf, staffSize, drawingCueSize) / 2; int fullUnit = m_doc->GetDrawingUnit(staffSize); bool inBeam = false; From a906fcf45e1995c5bbe4785bb24878d4743d7dba Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sun, 23 Aug 2015 11:08:03 +0200 Subject: [PATCH 080/114] Tidying up --- include/vrv/aligner.h | 2 -- include/vrv/doc.h | 7 ------- include/vrv/layerelement.h | 13 +++++++------ src/iomei.cpp | 1 - 4 files changed, 7 insertions(+), 16 deletions(-) diff --git a/include/vrv/aligner.h b/include/vrv/aligner.h index 6510a283042..568af5b5364 100644 --- a/include/vrv/aligner.h +++ b/include/vrv/aligner.h @@ -19,8 +19,6 @@ class Note; class StaffAlignment; class SystemAligner; - - /** * Alignment types for aligning types together. * For example, we align notes and rests (default) together, clef separately, etc. diff --git a/include/vrv/doc.h b/include/vrv/doc.h index 69092215550..1b7bec84790 100644 --- a/include/vrv/doc.h +++ b/include/vrv/doc.h @@ -223,13 +223,6 @@ class Doc: public Object int CalcMusicFontSize( ); public: - - - /** - * The full name of the file. Exact use to be clarified. - */ - std::string m_fname; - /** * A copy of the header tree stored as pugi::xml_document */ diff --git a/include/vrv/layerelement.h b/include/vrv/layerelement.h index 0bd7be1e839..3127e966ef3 100644 --- a/include/vrv/layerelement.h +++ b/include/vrv/layerelement.h @@ -44,7 +44,10 @@ class LayerElement: public DocObject virtual ClassId Is() { return LAYER_ELEMENT; }; ///@} - LayerElement& operator=( const LayerElement& element ); // copy assignement - this need to be changed to the Object::Clone way; + /** + * Copy assignment for resetting pointers + */ + LayerElement& operator=( const LayerElement& element ); /** * Reset the alignment values (m_drawingX, m_drawingXRel, etc.) @@ -71,13 +74,11 @@ class LayerElement: public DocObject * @name Child type checkers. */ ///@{ + /** Returns true if the element is a grace note */ bool IsGraceNote(); - ///@} - - /** - * Returns true if the element is a note or a note child and the note has a @grace - */ + /** Returns true if the element is a note or a note child and the note has a @grace */ bool IsCueSize(); + ///@} /** * Returns the drawing stem direction if the element is a note or a chord. diff --git a/src/iomei.cpp b/src/iomei.cpp index 261948b5d6c..7fba61b9061 100644 --- a/src/iomei.cpp +++ b/src/iomei.cpp @@ -901,7 +901,6 @@ MeiInput::MeiInput( Doc *doc, std::string filename ) : FileInputStream( doc ) { m_filename = filename; - m_doc->m_fname = GetFilename( filename ); m_page = NULL; m_system = NULL; // From d24b8f401a1dec1b59b79436adb4749535c7ee30 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sun, 23 Aug 2015 21:53:46 +0200 Subject: [PATCH 081/114] Code commenting --- include/vrv/att.h | 25 ++++++++++++++-- include/vrv/drawinginterface.h | 6 ++-- include/vrv/layerelement.h | 3 +- include/vrv/object.h | 51 +++++++++++++++++++++---------- include/vrv/scoredef.h | 53 ++++++++++++++++----------------- include/vrv/scoredefinterface.h | 4 +-- include/vrv/vrvdef.h | 20 ++++++++++--- src/keysig.cpp | 4 +-- src/object.cpp | 15 +--------- src/scoredef.cpp | 24 ++++++++++----- 10 files changed, 125 insertions(+), 80 deletions(-) diff --git a/include/vrv/att.h b/include/vrv/att.h index 19ac9f433b9..bf1ef45e8f6 100644 --- a/include/vrv/att.h +++ b/include/vrv/att.h @@ -211,25 +211,46 @@ class Att // Interface //---------------------------------------------------------------------------- +/** + * This is a base class for regrouping MEI att classes. + * It is not an abstract class but it should not be instanciated directly. + * The inherited classes should overwrite the InterfaceId method for returning + * their own InterfaceId. + */ + class Interface { public: + /** + * @name Constructors, destructors, and other standard methods + * Reset method reset all attribute classes + */ + ///@{ Interface() {}; virtual ~Interface() {}; + ///@} /** - * + * Method for registering an MEI att classes in the interface. */ void RegisterInterfaceAttClass( AttClassId attClassId ) { m_interfaceAttClasses.push_back( attClassId ); }; + + /** + * Method for obtaining a pointer to the attribute class vector of the interface + */ std::vector *GetAttClasses() { return &m_interfaceAttClasses; }; + /** + * Virtual method returning the InterfaceId of the interface. + * Needs to be overwritten in child classes. + */ virtual InterfaceId IsInterface() { return INTERFACE; }; private: /** - * + * A vector for storing all the MEI att classes grouped in the interface */ std::vector m_interfaceAttClasses; }; diff --git a/include/vrv/drawinginterface.h b/include/vrv/drawinginterface.h index e0b9ef137a2..445b164e80d 100644 --- a/include/vrv/drawinginterface.h +++ b/include/vrv/drawinginterface.h @@ -1,13 +1,13 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: drawinglistinterface +// Name: drawinginterface.h // Author: Laurent Pugin // Created: 2015 // Copyright (c) Authors and others. All rights reserved. ///////////////////////////////////////////////////////////////////////////// -#ifndef __VRV_DRAWING_LIST_INTERFACE_H__ -#define __VRV_DRAWING_LIST_INTERFACE_H__ +#ifndef __VRV_DRAWING_INTERFACE_H__ +#define __VRV_DRAWING_INTERFACE_H__ #include "vrvdef.h" diff --git a/include/vrv/layerelement.h b/include/vrv/layerelement.h index 3127e966ef3..cc90f050e33 100644 --- a/include/vrv/layerelement.h +++ b/include/vrv/layerelement.h @@ -63,7 +63,8 @@ class LayerElement: public DocObject /** * @name Set and get the flag for indication whether it is a ScoreDef or StaffDef attribute. * The value is false by default. Is it set to true of ScoreDef and StaffDef and used when - * drawing the element + * drawing the element. + * NB In the scoreDef or staffDef itself, it can be attributes or an element. */ ///@{ bool GetScoreOrStaffDefAttr() const { return m_isScoreOrStaffDefAttr; }; diff --git a/include/vrv/object.h b/include/vrv/object.h index 65967a97bc3..68b2cf2a2c9 100644 --- a/include/vrv/object.h +++ b/include/vrv/object.h @@ -64,23 +64,39 @@ typedef std::map StaffN_LayerN_VerseN_t; class Object { public: - // constructors and destructors + /** + * @name Constructors, destructors, and other standard methods + * Reset method reset all attribute classes + */ + ///@{ Object(); Object(std::string classid); virtual ~Object(); virtual ClassId Is(); + virtual std::string GetClassName( ) { return "[MISSING]"; }; + ///@} + + /** + * @name Methods for checking if an object is part of a group of classId. + * For example, all LayerElement child class classId is in between LAYER_ELEMENT and LAYER_ELEMENT_max. + * See classId enum. + */ + ///@{ bool IsEditorialElement() { return (this->Is() > EDITORIAL_ELEMENT && this->Is() < EDITORIAL_ELEMENT_max); }; bool IsLayerElement() { return (this->Is() > LAYER_ELEMENT && this->Is() < LAYER_ELEMENT_max); }; bool IsFloatingElement() { return (this->Is() > FLOATING_ELEMENT && this->Is() < FLOATING_ELEMENT_max); }; bool IsScoreDefElement() { return (this->Is() > SCORE_DEF_ELEMENT && this->Is() < SCORE_DEF_ELEMENT_max); }; + ///@} /** - * + * @name Methods for registering a MEI att class and for registering interfaces regrouping MEI att classes. */ + ///@{ void RegisterAttClass( AttClassId attClassId ) { m_attClasses.push_back( attClassId ); }; bool HasAttClass( AttClassId attClassId ) { return std::find(m_attClasses.begin(), m_attClasses.end(), attClassId) != m_attClasses.end(); }; void RegisterInterface( std::vector *attClasses, InterfaceId interfaceId ); bool HasInterface( InterfaceId interfaceId ) { return std::find(m_interfaces.begin(), m_interfaces.end(), interfaceId) != m_interfaces.end(); }; + ///@} /** * Reset the object, that is 1) removing all childs and 2) resetting all attributes. @@ -99,9 +115,9 @@ class Object Object( const Object& object ); /** - * See copy constructor. + * Copy assignement - see copy constructor. */ - Object& operator=( const Object& object ); // copy assignement; + Object& operator=( const Object& object ); /** * Move all the children of the object passed as parameter to this one. @@ -111,22 +127,24 @@ class Object void MoveChildren( Object *object ); /** - * Method call for copying child classes + * Method call for copying child classes. + * The method has to be overwritten. */ virtual Object* Clone(); - virtual bool operator==( Object& other ); - std::string GetUuid() { return m_uuid; }; void SetUuid( std::string uuid ); void ResetUuid( ); /** - * Children count - * Used for classes with several types of children + * @name Children count, with or without a ClassId. + * Used for classes with several types of children. + * The method with a ClassId only searches at the first level. */ + ///@{ int GetChildCount() { return (int)m_children.size(); }; int GetChildCount( const ClassId classId ); + ///@} /** * Child access (generic) @@ -162,8 +180,6 @@ class Object */ void SetParent( Object *parent ); - virtual std::string GetClassName( ) { return "[MISSING]"; }; - /** * Add an EditorialElement as child. * This can happen at many level. @@ -484,10 +500,13 @@ class Object ///@{ /** - * Replace all the staffDefs in a scoreDef. - * param 0: a pointer to the scoreDef we are going to replace the staffDefs + * Replace the drawing values a staffDef. + * param 0: Clef pointer (NULL if none) + * param 1: KeySig pointer (NULL if none) + * param 2: Mensur pointer (NULL if none) + * param 3: MeterSig pointer (NULL if none) */ - virtual int ReplaceDrawingValuesInScoreDef( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; + virtual int ReplaceDrawingValuesInStaffDef( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; /** * Set the initial scoreDef of each page. @@ -666,12 +685,12 @@ class Object ClassId m_iteratorElementType; /** - * + * A vector for storing the list of AttClassId (MEI att classes) implemented. */ std::vector m_attClasses; /** - * + * A vector for storing the list of InterfaceId (group of MEI att classes) implemented. */ std::vector m_interfaces; }; diff --git a/include/vrv/scoredef.h b/include/vrv/scoredef.h index 513ac0b944d..4a1cdd4e0df 100644 --- a/include/vrv/scoredef.h +++ b/include/vrv/scoredef.h @@ -24,22 +24,22 @@ class StaffGrp; class StaffDef; //---------------------------------------------------------------------------- -// ScoreOrStaffDefElement +// ScoreDefElement //---------------------------------------------------------------------------- /** - * This class is an interface for MEI scoreDef or staffDef attributes clef, keysig and mensur. - * It can either hold element or attribute values. Element values are hold in normal objects - * (e.g., Clef) and attribute values are hold in dedicated Object classes (e.g., ClefAttr) - * During rendering, only Element object are used. They are obained by the GetXXXCopy methods - * that create a copy of the Element object or a corresponding Element object if a attribute value - * object is hold. + * This class is a base class for MEI scoreDef or staffDef elements. + * It implements the ScoreDefInterface that implements the attribute classes + * for clef, key signature, mensur and meter signature. + * It also provides methods for checking if the scoreDef or staffDef has some + * information about clef, key signature, etc. This information can be either + * attributes (implemented) of the ScoreDefInterface or elements (not implemented). */ class ScoreDefElement: public Object, public ScoreDefInterface { public: /** - * @name Constructors, destructors, and other standard methods + * @name Constructors, destructors, and other standard methods. */ ///@{ ScoreDefElement(std::string classid); @@ -49,11 +49,8 @@ class ScoreDefElement: public Object, public ScoreDefInterface ///@} /** - * @name Get a copy of the clef, keysig, mensur and meterSig. - * These methods creates new objects that need to be deleted. - * The also convert attribute value object to an object. For example, - * if m_clef holds a ClefAttr object, the copy will be a Clef object. - * They are used when writing the MEI. + * @name Methods for checking the presence of clef, key signature, etc. information. + * Look both at the attributes (e.g., @key.sig) and at child elements (not implemented) */ ///@{ bool HasClefInfo(); @@ -64,10 +61,11 @@ class ScoreDefElement: public Object, public ScoreDefInterface /** * @name Get a copy of the clef, keysig, mensur and meterSig. - * These methods creates new objects that need to be deleted. + * These methods create new objects (heap) that will need to be deleted. * The also convert attribute value object to an object. For example, - * if m_clef holds a ClefAttr object, the copy will be a Clef object. - * They are used when writing the MEI. + * if a staffDef has a @key.sig, the copy will be a KeySig object. + * The conversion from attribute to element is performed in the appropriate + * constructor of each corresponding class (Clef, KeySig, etc.) */ ///@{ Clef *GetClefCopy(); @@ -80,7 +78,7 @@ class ScoreDefElement: public Object, public ScoreDefInterface private: /** - * @name Methods for checking if clef info is available at the attribute level + * @name Methods for checking if clef info is available at the attribute level. */ ///@{ bool HasClefAttrInfo(); @@ -90,7 +88,8 @@ class ScoreDefElement: public Object, public ScoreDefInterface ///@} /** - * @name Methods for checking if clef info is available at the element level + * @name Methods for checking if clef info is available at the element level. + * To be implemented. */ ///@{ bool HasClefElementInfo(); @@ -102,7 +101,6 @@ class ScoreDefElement: public Object, public ScoreDefInterface }; - //---------------------------------------------------------------------------- // ScoreDef //---------------------------------------------------------------------------- @@ -290,18 +288,17 @@ class StaffDef: public ScoreDefElement, public StaffDefDrawingInterface, //----------// /** - * Replace all the staffDefs in a scoreDef. - * Calls ScoreDef::Replace. - * param 0: a pointer to the scoreDef we are going to replace the staffDefs + * Set the current / drawing clef, key signature, etc. to the StaffDef + * Called form ScoreDef::ReplaceDrawingValues. + * See implementation and Object::ReplaceDrawingValuesInStaffDef for the parameters. */ - virtual int ReplaceDrawingValuesInScoreDef( ArrayPtrVoid *params ); + virtual int ReplaceDrawingValuesInStaffDef( ArrayPtrVoid *params ); /** - * Set flags for the staff set for indicating whether clefs, keysig, etc. needs to be redrawn. - * This is typically occurs when a new system or a new scoreDef is encountered. - * param 0: bool clef flag. - * param 1: bool keysig flag. - * param 2: bool the mensur flag. + * Set drawing flags for the StaffDef for indicating whether clefs, keysig, etc. needs + * to be redrawn. + * This typically occurs when a new System or a new ScoreDef is encountered. + * See implementation and Object::SetStaffDefRedrawFlags for the parameters. */ virtual int SetStaffDefRedrawFlags( ArrayPtrVoid *params ); diff --git a/include/vrv/scoredefinterface.h b/include/vrv/scoredefinterface.h index 272a5c44cb0..add4c245316 100644 --- a/include/vrv/scoredefinterface.h +++ b/include/vrv/scoredefinterface.h @@ -20,8 +20,8 @@ namespace vrv { //---------------------------------------------------------------------------- /** - * This class is an interface for elements implementing a text directive, such - * as , , or + * This class is an interface for elements implementing score attributes, such + * as , or * It is not an abstract class but should not be instanciate directly. */ class ScoreDefInterface: public Interface, diff --git a/include/vrv/vrvdef.h b/include/vrv/vrvdef.h index ffd09722fb0..967580df235 100644 --- a/include/vrv/vrvdef.h +++ b/include/vrv/vrvdef.h @@ -45,8 +45,16 @@ typedef std::map > MapOfLedgerLineFlags; // Object defines //---------------------------------------------------------------------------- +/** + * The ClassIds are used to identify Object child classes through the Object::Is virtual method. + * Each Object child class has to have its own id and has to overwrite the Is() method. + * Base classes (e.g., LayerElement) that are never instanciated have boundary ids + * used for checking if an Object is child of a base class. See for example + * Object::IsLayerElement. + */ enum ClassId { OBJECT = 0, + // ALIGNMENT, CLEF_ATTR, DOC, @@ -65,7 +73,7 @@ enum ClassId { SYSTEM, SYSTEM_ALIGNER, SYSTEM_ALIGNMENT, - // + // Ids for EditorialElement child classes EDITORIAL_ELEMENT, ANNOT, APP, @@ -73,7 +81,7 @@ enum ClassId { RDG, SUPPLIED, EDITORIAL_ELEMENT_max, - // + // Ids for LayerElement child classes LAYER_ELEMENT, ACCID, BAR_LINE, @@ -95,13 +103,13 @@ enum ClassId { TUPLET, VERSE, LAYER_ELEMENT_max, - // + // Ids for FloatingElement child classes FLOATING_ELEMENT, SLUR, TEMPO, TIE, FLOATING_ELEMENT_max, - // + // Ids for ScoreDefElement child classes SCORE_DEF_ELEMENT, SCORE_DEF, STAFF_DEF, @@ -110,6 +118,10 @@ enum ClassId { UNSPECIFIED }; +/** + * The InterfaceIds are used to identify Interface child classes through the Interface::IsInterface virtual method. + * Each Interface child class has to have its own id and has to overwrite the IsInterface() method. + */ enum InterfaceId { INTERFACE, INTERFACE_DURATION, diff --git a/src/keysig.cpp b/src/keysig.cpp index db4a803d6a9..943ed7dda49 100644 --- a/src/keysig.cpp +++ b/src/keysig.cpp @@ -60,7 +60,6 @@ KeySig::KeySig(): AttPitch() { Init(); - Reset(); } KeySig::KeySig(int alterationNumber, data_ACCIDENTAL_EXPLICIT alterationType): @@ -69,7 +68,6 @@ KeySig::KeySig(int alterationNumber, data_ACCIDENTAL_EXPLICIT alterationType): AttPitch() { Init(); - Reset(); m_alterationNumber = alterationNumber; m_alterationType = alterationType; @@ -81,7 +79,6 @@ KeySig::KeySig( ScoreDefInterface *keySigAttr ): AttPitch() { Init(); - Reset(); char key = keySigAttr->GetKeySig() - KEYSIGNATURE_0; /* see data_KEYSIGNATURE order; key will be: @@ -116,6 +113,7 @@ void KeySig::Init() { RegisterAttClass(ATT_ACCIDENTAL); RegisterAttClass(ATT_PITCH); + Reset(); } KeySig::~KeySig() diff --git a/src/object.cpp b/src/object.cpp index f3dbbcb1ac1..631c6a8f7f0 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -331,16 +331,6 @@ void Object::AddEditorialElement( EditorialElement *child ) Modify(); } -bool Object::operator==( Object& other ) -{ - // This should never happen. - // The comparison is performed in the CmpFile::Align method. - // We expect to compare only Note, Rest, etc object for which we have an overwritten method - LogError( "Missing comparison operator for '%s'", this->GetClassName().c_str() ); - assert( false ); - return false; -} - int Object::GetChildIndex( const Object *child ) { ArrayOfObjects::iterator iter; @@ -956,14 +946,11 @@ int Object::SetCurrentScoreDef( ArrayPtrVoid *params ) return FUNCTOR_CONTINUE; } - // starting a new staffDef if (this->Is() == STAFF_DEF) { StaffDef *staffDef= dynamic_cast(this); assert( staffDef ); - StaffDef *tmpStaffDef = currentScoreDef->GetStaffDef( staffDef->GetN() ); - assert( tmpStaffDef ); - currentScoreDef->ReplaceDrawingValues(tmpStaffDef); + currentScoreDef->ReplaceDrawingValues(staffDef); } // starting a new staff diff --git a/src/scoredef.cpp b/src/scoredef.cpp index 97045ac9bd3..41f52b8d850 100644 --- a/src/scoredef.cpp +++ b/src/scoredef.cpp @@ -19,6 +19,7 @@ #include "mensur.h" #include "metersig.h" #include "system.h" +#include "vrv.h" namespace vrv { @@ -37,7 +38,6 @@ ScoreDefElement::ScoreDefElement(std::string classid): ScoreDefElement::~ScoreDefElement() { - } void ScoreDefElement::Reset() @@ -208,6 +208,8 @@ void ScoreDef::AddStaffGrp( StaffGrp *staffGrp ) void ScoreDef::ReplaceDrawingValues( ScoreDef *newScoreDef ) { + assert(newScoreDef); + bool drawClef = false; bool drawKeySig = false; bool drawMensur = false; @@ -239,7 +241,7 @@ void ScoreDef::ReplaceDrawingValues( ScoreDef *newScoreDef ) params.push_back( keySig ); params.push_back( mensur ); params.push_back( meterSig ); - Functor replaceDrawingValuesInScoreDef( &Object::ReplaceDrawingValuesInScoreDef ); + Functor replaceDrawingValuesInScoreDef( &Object::ReplaceDrawingValuesInStaffDef ); this->Process( &replaceDrawingValuesInScoreDef, ¶ms ); if (clef) delete clef; @@ -254,6 +256,8 @@ void ScoreDef::ReplaceDrawingValues( ScoreDef *newScoreDef ) void ScoreDef::ReplaceDrawingValues( StaffDef *newStaffDef ) { + assert(newStaffDef); + // first find the staffDef with the same @n StaffDef *staffDef = this->GetStaffDef( newStaffDef->GetN() ); @@ -263,16 +267,16 @@ void ScoreDef::ReplaceDrawingValues( StaffDef *newStaffDef ) staffDef->SetDrawClef(true); staffDef->SetCurrentClef( newStaffDef->GetClefCopy() ); } - if (staffDef->HasKeySigInfo()) { + if (newStaffDef->HasKeySigInfo()) { staffDef->SetDrawKeySig(true); staffDef->SetDrawKeySigCancellation(true); staffDef->SetCurrentKeySig( newStaffDef->GetKeySigCopy() ); } - if (staffDef->HasMensurInfo()) { + if (newStaffDef->HasMensurInfo()) { staffDef->SetDrawMensur(true); staffDef->SetCurrentMensur(newStaffDef->GetMensurCopy()); } - if (staffDef->HasMeterSigInfo()) { + if (newStaffDef->HasMeterSigInfo()) { staffDef->SetDrawMeterSig(true); staffDef->SetCurrentMeterSig(newStaffDef->GetMeterSigCopy()); } @@ -280,6 +284,9 @@ void ScoreDef::ReplaceDrawingValues( StaffDef *newStaffDef ) if ( newStaffDef->HasLabel() ) staffDef->SetLabel( newStaffDef->GetLabel() ); if ( newStaffDef->HasLabelAbbr() ) staffDef->SetLabelAbbr( newStaffDef->GetLabelAbbr() ); } + else { + LogWarning("StaffDef with xml:id '%s' could not be found", newStaffDef->GetUuid().c_str()); + } } void ScoreDef::FilterList( ListOfObjects *childList ) @@ -445,9 +452,12 @@ int ScoreDef::CastOffSystems( ArrayPtrVoid *params ) // StaffDef functor methods //---------------------------------------------------------------------------- -int StaffDef::ReplaceDrawingValuesInScoreDef( ArrayPtrVoid *params ) +int StaffDef::ReplaceDrawingValuesInStaffDef( ArrayPtrVoid *params ) { - // param 0: the scoreDef + // param 0: Clef pointer (NULL if none) + // param 1: KeySig pointer (NULL if none) + // param 2: Mensur pointer (NULL if none) + // param 3: MeterSig pointer (NULL if none) Clef *clef = static_cast((*params)[0]); KeySig *keySig = static_cast((*params)[1]); Mensur *mensur = static_cast((*params)[2]); From f509dd0838fc342ba21ca8e93e9e7e52d9945d53 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Mon, 24 Aug 2015 18:13:49 +0200 Subject: [PATCH 082/114] Removing staffGrp legacy members and adding LibMEI attributes --- fonts/Leipzig-5.2.sfd | 5503 ++++++++++++++++++++++++++++++++++++++++ fonts/Leipzig.svg | 115 +- include/vrv/att.h | 3 + include/vrv/attdef.h | 10 + include/vrv/iomei.h | 4 - include/vrv/scoredef.h | 23 +- include/vrv/vrvdef.h | 8 - libmei/atts_shared.cpp | 24 +- libmei/atts_shared.h | 12 +- src/att.cpp | 27 + src/iomei.cpp | 58 +- src/scoredef.cpp | 13 +- src/view_page.cpp | 12 +- 13 files changed, 5651 insertions(+), 161 deletions(-) create mode 100644 fonts/Leipzig-5.2.sfd diff --git a/fonts/Leipzig-5.2.sfd b/fonts/Leipzig-5.2.sfd new file mode 100644 index 00000000000..cb6fbdc2360 --- /dev/null +++ b/fonts/Leipzig-5.2.sfd @@ -0,0 +1,5503 @@ +SplineFontDB: 3.0 +FontName: Leipzig +FullName: Leipzig +FamilyName: Leipzig +Weight: Regular +Copyright: Created by Etienne Darbellay, Jean-Francois Marti and Laurent Pugin with FontForge 2.0. This font is licensed under the SIL Open Font License \\(http://scripts.sil.org/OFL\\).\nVersion 5.2.0 +UComments: "2014-03-21: Created.+AAoA-Version 5.2 - adding glyphs (dynamics, ornaments, mensural note heads, etc)" +Version: 5.2.0 +ItalicAngle: 0 +UnderlinePosition: -50 +UnderlineWidth: 50 +Ascent: 800 +Descent: 200 +LayerCount: 2 +Layer: 0 0 "Back" 1 +Layer: 1 0 "Fore" 0 +XUID: [1021 638 1292611596 15783845] +FSType: 8 +OS2Version: 0 +OS2_WeightWidthSlopeOnly: 0 +OS2_UseTypoMetrics: 1 +CreationTime: 1395388130 +ModificationTime: 1440412960 +PfmFamily: 17 +TTFWeight: 500 +TTFWidth: 5 +LineGap: 90 +VLineGap: 0 +OS2TypoAscent: 0 +OS2TypoAOffset: 1 +OS2TypoDescent: 0 +OS2TypoDOffset: 1 +OS2TypoLinegap: 90 +OS2WinAscent: 0 +OS2WinAOffset: 1 +OS2WinDescent: 0 +OS2WinDOffset: 1 +HheadAscent: 0 +HheadAOffset: 1 +HheadDescent: 0 +HheadDOffset: 1 +OS2Vendor: 'PfEd' +MarkAttachClasses: 1 +DEI: 91125 +LangName: 1033 +Encoding: UnicodeFull +UnicodeInterp: none +NameList: Adobe Glyph List +DisplaySize: -72 +AntiAlias: 1 +FitToEm: 1 +WinInfo: 59688 18 9 +BeginPrivate: 0 +EndPrivate +TeXData: 1 0 0 346030 173015 115343 0 1048576 115343 783286 444596 497025 792723 393216 433062 380633 303038 157286 324010 404750 52429 2506097 1059062 262144 +BeginChars: 1114115 111 + +StartChar: uniE0A3 +Encoding: 57507 57507 0 +Width: 320 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +96 -132 m 0,0,0 +200 138 m 1,0,0 + 241 133 l 2,0,0 + 239 133 200 138 200 138 c 1,0,0 +278 64 m 0,8,9 + 278 86 261 103 235 103 c 0,11,12 + 223 103 209 100 194 93 c 0,13,14 + 109 50 29 -1 29 -63 c 1,0,1 + 34 -88 44 -95 78 -95 c 1,3,4 + 145 -84 278 0 278 64 c 0,8,9 +0 -36 m 0,28,29 + 0 32 73 138 200 138 c 0,17,18 + 266 138 314 99 314 41 c 0,22,23 + 314 -43 208 -132 96 -132 c 0,26,27 + 32 -132 0 -100 0 -36 c 0,28,29 +EndSplineSet +Validated: 5 +EndChar + +StartChar: uniE080 +Encoding: 57472 57472 1 +Width: 427 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +209 251 m 0,0,0 +210 -250 m 4,12,13 + 111 -250 0 -156 0 1 c 0,0,1 + 0 153 93 251 209 251 c 0,4,5 + 325 251 414 132 414 1 c 256,8,9 + 414 -138 311 -250 210 -250 c 4,12,13 +119 1 m 0,28,29 + 119 -78 132 -214 207 -214 c 0,19,20 + 275 -214 291 -102 291 1 c 0,22,23 + 291 77 276 217 207 217 c 0,25,26 + 139 217 119 81 119 1 c 0,28,29 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uniE081 +Encoding: 57473 57473 2 +Width: 296 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +48 -250 m 1 + 48 -214 l 1 + 71 -214 88 -208 97 -196 c 1 + 105 -182 109 -163 109 -139 c 2 + 109 111 l 1 + 27 -18 l 1 + 0 -5 l 1 + 107 250 l 1 + 235 250 l 1 + 235 -144 l 2 + 235 -168 240 -186 249 -197 c 128 + 258 -208 274 -214 296 -214 c 1 + 296 -250 l 1 + 48 -250 l 1 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uniE082 +Encoding: 57474 57474 3 +Width: 402 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +104 -185 m 1 + 86 -185 49 -199 39 -250 c 1 + 3 -250 l 1 + 0 -221 l 1 + 0 -196 6 -175 18 -157 c 1 + 29 -138 40 -127 57 -114 c 1 + 178 -32 l 1 + 215 -3 l 2 + 230 8 242 26 253 51 c 1 + 265 75 271 98 271 121 c 0 + 271 161 252 209 177 209 c 0 + 152 209 145 209 127 201 c 1 + 113 196 104 189 101 179 c 1 + 104 170 108 164 111 161 c 2 + 135 144 l 1 + 147 137 152 133 162 123 c 1 + 167 116 169 107 169 96 c 0 + 169 84 169 39 90 22 c 1 + 60 22 14 48 14 116 c 0 + 14 182 94 251 210 251 c 0 + 282 251 392 219 392 101 c 0 + 392 48 360 6 279 -32 c 1 + 188 -73 l 2 + 162 -84 143 -96 131 -110 c 1 + 180 -103 l 1 + 264 -103 295 -144 328 -144 c 0 + 348 -144 361 -124 367 -83 c 1 + 402 -83 l 1 + 402 -235 334 -251 288 -251 c 0 + 271 -251 233 -251 219 -244 c 2 + 219 -244 l 1 + 191 -227 l 1 + 142 -190 122 -187 104 -185 c 1 +EndSplineSet +Validated: 5 +EndChar + +StartChar: uniE083 +Encoding: 57475 57475 4 +Width: 383 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +188 250 m 0 + 285 250 365 198 365 134 c 0 + 365 65 325 23 247 9 c 1 + 303 4 372 -35 372 -107 c 0 + 372 -138 362 -164 341 -185 c 1 + 322 -206 296 -223 263 -234 c 1 + 213 -245 l 2 + 198 -248 177 -252 158 -252 c 0 + 108 -252 72 -236 45 -214 c 1 + 29 -204 22 -196 11 -180 c 1 + 4 -167 0 -155 0 -142 c 0 + 0 -99 27 -59 68 -59 c 1 + 71 -61 l 1 + 132 -61 146 -103 146 -131 c 0 + 146 -150 122 -173 120 -188 c 1 + 127 -205 140 -213 157 -213 c 0 + 201 -213 251 -184 251 -135 c 0 + 251 -60 217 -10 113 -10 c 1 + 113 26 l 1 + 197 26 244 48 244 124 c 0 + 244 178 207 212 157 212 c 256 + 131 212 114 205 106 190 c 1 + 121 168 150 174 150 120 c 0 + 150 83 113 58 79 58 c 0 + 57 58 10 73 10 134 c 0 + 10 213 111 250 188 250 c 0 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uniE084 +Encoding: 57476 57476 5 +Width: 387 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 -78 m 1 + 84 19 114 102 134 251 c 1 + 304 251 l 1 + 291 219 222 119 205 100 c 2 + 121 3 l 1 + 88 -33 62 -60 41 -78 c 1 + 203 -78 l 1 + 203 24 l 1 + 330 147 l 1 + 330 -78 l 1 + 387 -78 l 1 + 387 -117 l 1 + 330 -117 l 1 + 330 -151 l 2 + 330 -194 349 -216 387 -216 c 1 + 387 -250 l 1 + 143 -250 l 1 + 143 -214 l 1 + 191 -214 203 -188 203 -144 c 2 + 203 -117 l 1 + 0 -117 l 1 + 0 -78 l 1 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uniE085 +Encoding: 57477 57477 6 +Width: 354 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +141 38 m 0 + 127 38 85 33 49 -13 c 1 + 17 -13 l 1 + 22 250 l 1 + 77 239 130 232 180 232 c 0 + 220 232 265 238 314 249 c 1 + 306 197 275 135 155 135 c 1 + 105 137 l 2 + 86 139 74 141 56 147 c 1 + 51 36 l 1 + 89 62 132 75 180 75 c 0 + 274 75 357 11 357 -84 c 0 + 357 -184 259 -250 146 -250 c 0 + 58 -250 0 -197 0 -135 c 0 + 0 -82 39 -52 75 -52 c 0 + 112 -52 144 -84 144 -124 c 0 + 144 -128 143 -134 140 -142 c 1 + 113 -179 l 2 + 111 -182 110 -187 110 -193 c 0 + 110 -208 122 -216 146 -216 c 0 + 220 -216 238 -139 238 -84 c 0 + 238 -29 203 38 141 38 c 0 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uniE086 +Encoding: 57478 57478 7 +Width: 394 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +264 -91 m 0 + 264 -54 236 1 197 1 c 0 + 162 1 132 -53 132 -110 c 0 + 132 -162 154 -214 200 -214 c 0 + 247 -214 264 -146 264 -91 c 0 +210 214 m 0 + 174 214 120 181 120 30 c 1 + 122 -6 l 1 + 162 18 203 30 242 30 c 0 + 322 30 382 -18 382 -91 c 0 + 382 -190 283 -250 200 -250 c 4 + 40 -250 0 -77 0 -6 c 256 + 0 15 2 37 7 65 c 1 + 17 100 l 129 + 43 185 90 215 115 226 c 0 + 156 245 189 250 218 250 c 0 + 311 250 360 187 360 145 c 0 + 360 87 308 73 287 73 c 0 + 254 73 228 97 222 108 c 128 + 219 113 216 122 215 133 c 1 + 226 163 l 2 + 232 178 235 190 235 198 c 0 + 235 209 226 214 210 214 c 0 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uniE087 +Encoding: 57479 57479 8 +Width: 404 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +330 125 m 1 + 319 116 277 79 235 79 c 1 + 217 81 202 87 191 96 c 1 + 174 115 158 130 143 141 c 1 + 130 152 116 158 101 158 c 0 + 78 158 56 136 37 92 c 1 + 0 92 l 1 + 0 247 l 1 + 37 247 l 1 + 41 229 48 219 58 217 c 1 + 66 218 73 220 80 225 c 1 + 90 230 l 1 + 104 240 l 2 + 107 242 118 246 125 247 c 130 + 136 249 l 130 + 144 250 169 250 178 250 c 0 + 217 250 235 243 268 207 c 1 + 279 192 294 184 312 181 c 1 + 339 184 357 210 366 251 c 1 + 404 250 l 1 + 403 241 393 162 375 126 c 1 + 370 113 363 98 354 80 c 2 + 321 20 l 1 + 266 -72 252 -142 252 -250 c 1 + 78 -250 l 5 + 78 -205 89 -164 111 -128 c 1 + 134 -93 170 -54 217 -11 c 1 + 316 73 330 85 330 125 c 1 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uniE088 +Encoding: 57480 57480 9 +Width: 386 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +185 -214 m 0 + 261 -214 273 -156 275 -146 c 1 + 275 -112 240 -86 218 -73 c 2 + 166 -44 l 1 + 145 -34 134 -27 132 -24 c 1 + 93 -57 74 -78 70 -116 c 1 + 75 -139 93 -214 185 -214 c 0 +291 135 m 0 + 291 196 219 211 178 211 c 0 + 138 211 101 194 101 160 c 1 + 104 139 116 122 127 110 c 1 + 144 95 160 84 175 76 c 1 + 240 48 l 1 + 274 75 291 104 291 135 c 0 +166 -250 m 4 + 109 -250 0 -224 -0 -118 c 0 + 0 -71 30 -32 89 -2 c 1 + 56 13 10 58 10 117 c 0 + 10 196 95 249 188 249 c 2 + 206 249 l 130 + 211 249 227 250 234 248 c 1 + 259 248 360 218 360 138 c 0 + 360 101 337 62 291 22 c 1 + 334 -3 374 -49 374 -97 c 0 + 374 -198 256 -250 166 -250 c 4 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uniE089 +Encoding: 57481 57481 10 +Width: 397 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +119 107 m 0 + 119 56 141 3 185 3 c 0 + 223 3 249 51 249 113 c 0 + 249 163 218 213 185 213 c 0 + 145 213 119 157 119 107 c 0 +94 -74 m 0 + 134 -74 166 -101 166 -139 c 0 + 166 -147 163 -158 157 -173 c 2 + 150 -189 l 1 + 145 -204 l 1 + 147 -212 157 -216 176 -216 c 0 + 232 -216 260 -143 260 3 c 1 + 228 -21 189 -33 141 -33 c 0 + 112 -33 85 -27 62 -13 c 1 + 11 13 5 65 -0 95 c 1 + 0 159 56 250 188 250 c 0 + 346 250 385 99 385 13 c 0 + 385 -132 293 -250 178 -250 c 4 + 69 -250 23 -182 23 -149 c 0 + 23 -103 56 -74 94 -74 c 0 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uniE0A2 +Encoding: 57506 57506 11 +Width: 405 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +198 133 m 4 + 300 133 405 88 405 0 c 0 + 405 -92 307 -133 198 -133 c 0 + 97 -133 0 -87 0 0 c 256 + 0 88 93 133 198 133 c 4 +293 -21 m 0 + 293 -7 290 8 285 23 c 0 + 278 43 267 61 252 77 c 0 + 232 98 209 108 184 108 c 1 + 164 106 l 1 + 149 101 137 92 128 78 c 1 + 124 69 122 61 120 54 c 128 + 118 47 117 38 117 27 c 0 + 117 12 120 -7 126 -30 c 128 + 132 -53 144 -71 160 -85 c 1 + 175 -100 196 -108 222 -108 c 0 + 226 -108 232 -107 240 -106 c 0 + 259 -101 272 -91 280 -76 c 128 + 288 -61 293 -42 293 -21 c 0 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uniE0A4 +Encoding: 57508 57508 12 +Width: 320 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 -39 m 0 + 0 29 73 133 200 133 c 0 + 266 133 314 96 314 38 c 0 + 314 -46 208 -133 96 -133 c 4 + 32 -133 0 -103 0 -39 c 0 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uniE05C +Encoding: 57436 57436 13 +Width: 656 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 502 m 5 + 118 502 l 5 + 118 0 l 5 + 79 0 39 0 0 0 c 5 + 0 502 l 5 +175 0 m 5 + 175 -502 l 5 + 218 -502 l 5 + 218 -46 l 5 + 231 -53 243 -64 255 -75 c 5 + 265 -87 275 -99 282 -113 c 5 + 288 -127 292 -144 296 -162 c 4 + 299 -182 301 -203 301 -224 c 5 + 308 -189 333 -170 374 -164 c 5 + 452 -183 473 -232 474 -329 c 4 + 474 -373 465 -406 443 -429 c 5 + 425 -452 402 -464 374 -464 c 4 + 331 -464 309 -427 308 -380 c 5 + 315 -395 327 -398 347 -404 c 5 + 353 -404 357 -402 363 -400 c 6 + 380 -390 l 5 + 390 -376 l 5 + 397 -358 l 5 + 393 -326 374 -310 341 -310 c 4 + 285 -310 264 -349 264 -408 c 5 + 274 -444 286 -473 317 -486 c 5 + 320 -489 339 -495 344 -497 c 5 + 378 -500 l 5 + 413 -502 l 5 + 533 -502 603 -441 603 -324 c 5 + 606 -291 l 5 + 606 -239 586 -194 546 -157 c 5 + 526 -140 501 -128 472 -118 c 5 + 441 -109 408 -105 371 -105 c 5 + 278 -17 l 5 + 278 17 l 5 + 278 17 l 5 + 371 105 l 5 + 408 105 441 109 472 118 c 5 + 501 128 526 140 546 157 c 5 + 586 194 606 239 606 291 c 5 + 603 324 l 5 + 603 441 533 502 413 502 c 5 + 378 500 l 5 + 344 497 l 5 + 339 495 320 489 317 486 c 5 + 308 482 301 476 294 469 c 4 + 277 452 272 436 264 408 c 5 + 264 349 285 310 341 310 c 4 + 374 310 393 326 397 358 c 5 + 390 376 l 5 + 380 390 l 5 + 363 400 l 6 + 357 402 353 404 347 404 c 5 + 327 398 315 395 308 380 c 5 + 309 427 331 464 374 464 c 4 + 402 464 425 452 443 429 c 5 + 465 406 474 373 474 329 c 4 + 473 232 452 183 374 164 c 5 + 333 170 308 189 301 224 c 5 + 301 203 299 182 296 162 c 4 + 292 144 288 127 282 113 c 5 + 275 99 265 87 255 75 c 5 + 243 64 231 53 218 46 c 5 + 218 502 l 5 + 175 502 l 5 + 175 0 l 5 +0 -502 m 5 + 0 0 l 5 + 118 0 l 5 + 118 -502 l 5 + 0 -502 l 5 +EndSplineSet +Validated: 5 +EndChar + +StartChar: uniE05D +Encoding: 57437 57437 14 +Width: 616 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +380 -545 m 0 + 380 -518 359 -505 331 -505 c 0 + 316 -505 300 -513 300 -530 c 0 + 300 -544 310 -555 318 -564 c 0 + 326 -572 334 -582 344 -589 c 1 + 349 -591 354 -593 357 -593 c 0 + 374 -593 380 -563 380 -545 c 0 +266 -626 m 1 + 263 -628 260 -631 259 -634 c 1 + 253 -642 249 -653 249 -664 c 0 + 249 -666 249 -668 250 -671 c 0 + 257 -703 284 -723 303 -723 c 0 + 323 -723 340 -703 340 -687 c 0 + 340 -682 338 -678 336 -673 c 0 + 329 -654 311 -636 294 -625 c 0 + 290 -623 285 -619 280 -619 c 0 + 274 -619 269 -622 266 -626 c 1 +0 502 m 1 + 118 502 l 1 + 118 167 118 -167 118 -502 c 1 + 0 -502 l 1 + 0 -167 0 167 0 502 c 1 +321 -488 m 2 + 328 -488 l 2 + 336 -488 360 -491 381 -501 c 1 + 413 -502 l 1 + 533 -502 603 -441 603 -324 c 1 + 606 -291 l 1 + 606 -239 587 -193 546 -157 c 0 + 506 -122 445 -105 371 -105 c 1 + 278 -17 l 1 + 278 17 l 1 + 371 105 l 1 + 445 105 506 122 546 157 c 0 + 587 193 606 239 606 291 c 1 + 603 324 l 1 + 603 441 533 502 413 502 c 1 + 378 500 l 1 + 344 497 l 2 + 339 495 320 489 317 486 c 1 + 286 473 274 444 264 408 c 1 + 264 349 285 310 341 310 c 0 + 374 310 393 326 397 358 c 1 + 390 376 l 1 + 380 390 l 1 + 363 400 l 2 + 357 402 353 404 347 404 c 1 + 327 398 315 395 308 380 c 1 + 309 427 331 464 374 464 c 0 + 402 464 424 451 443 429 c 0 + 464 405 474 373 474 329 c 0 + 473 232 452 183 374 164 c 1 + 333 170 308 189 301 224 c 1 + 301 135 275 78 218 46 c 1 + 218 502 l 1 + 175 502 l 1 + 175 167 175 -167 175 -502 c 1 + 218 -502 l 1 + 218 -46 l 1 + 275 -78 301 -135 301 -224 c 1 + 308 -189 333 -170 374 -164 c 1 + 452 -183 473 -232 474 -329 c 0 + 474 -373 464 -405 443 -429 c 0 + 424 -451 402 -464 374 -464 c 0 + 331 -464 309 -427 308 -380 c 1 + 315 -395 327 -398 347 -404 c 1 + 353 -404 357 -402 363 -400 c 2 + 380 -390 l 1 + 390 -376 l 1 + 397 -358 l 1 + 393 -326 374 -310 341 -310 c 0 + 285 -310 264 -349 264 -408 c 1 + 274 -444 286 -473 317 -486 c 0 + 318 -487 319 -487 321 -488 c 2 +303 -735 m 0 + 267 -735 211 -711 211 -665 c 0 + 211 -637 236 -608 262 -599 c 0 + 266 -598 268 -597 268 -594 c 0 + 268 -592 267 -591 266 -591 c 0 + 255 -578 250 -564 250 -550 c 0 + 250 -516 279 -489 321 -488 c 1 + 327 -491 340 -496 344 -497 c 2 + 378 -500 l 1 + 381 -501 l 1 + 400 -510 416 -524 416 -548 c 0 + 416 -583 394 -591 385 -598 c 0 + 379 -603 377 -608 377 -614 c 0 + 377 -620 378 -625 381 -630 c 0 + 388 -641 390 -652 390 -664 c 0 + 390 -691 372 -717 344 -729 c 0 + 333 -733 317 -735 303 -735 c 0 +EndSplineSet +Validated: 5 +EndChar + +StartChar: uniE051 +Encoding: 57425 57425 15 +Width: 650 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +220 -890 m 0 + 189 -886 100 -899 100 -881 c 1 + 108 -863 129 -888 147 -851 c 0 + 155 -835 187 -754 186 -754 c 2 + 186 -754 188 -749 188 -745 c 0 + 188 -741 187 -738 181 -738 c 0 + 171 -738 167 -757 147 -757 c 0 + 141 -757 136 -754 136 -749 c 0 + 136 -747 136 -746 138 -743 c 0 + 144 -736 218 -650 225 -644 c 0 + 226 -643 228 -642 229 -641 c 1 + 219 -638 210 -633 200 -628 c 0 + 150 -604 123 -569 120 -523 c 0 + 115 -451 155 -396 219 -392 c 0 + 270 -389 318 -432 322 -479 c 0 + 326 -535 292 -573 217 -594 c 1 + 234 -618 268 -630 319 -630 c 0 + 381 -630 435 -587 459 -545 c 0 + 468 -529 472 -504 472 -471 c 0 + 472 -451 470 -429 467 -404 c 0 + 458 -351 449 -298 441 -245 c 1 + 418 -249 393 -251 365 -251 c 0 + 306 -251 263 -244 235 -231 c 0 + 147 -189 85 -138 48 -77 c 0 + 22 -33 5 26 0 99 c 0 + -10 231 78 365 154 436 c 0 + 199 478 250 521 307 563 c 1 + 304 579 299 609 294 655 c 0 + 290 698 289 728 289 744 c 0 + 289 861 305 916 358 1001 c 0 + 392 1055 422 1082 447 1083 c 0 + 468 1083 490 1053 516 991 c 0 + 542 929 555 876 557 832 c 0 + 559 712 538 659 490 576 c 0 + 477 556 427 486 392 458 c 0 + 379 449 367 439 355 429 c 1 + 386 248 l 1 + 394 249 404 250 414 250 c 0 + 472 250 516 238 547 215 c 0 + 606 172 639 111 645 31 c 0 + 656 -104 565 -198 465 -239 c 1 + 473 -296 482 -349 490 -401 c 0 + 494 -432 496 -459 496 -481 c 0 + 496 -511 491 -534 482 -551 c 0 + 458 -596 424 -626 383 -642 c 1 + 392 -642 l 2 + 426 -642 459 -641 459 -646 c 0 + 459 -668 425 -680 404 -684 c 2 + 375 -690 l 2 + 364 -692 353 -694 341 -697 c 2 + 327 -700 l 1 + 322 -704 320 -719 320 -726 c 0 + 320 -727 321 -729 324 -729 c 0 + 332 -729 346 -726 355 -726 c 0 + 379 -726 386 -738 398 -738 c 1 + 401 -741 l 1 + 416 -752 424 -774 424 -796 c 0 + 424 -856 366 -893 312 -893 c 0 + 281 -893 250 -873 250 -835 c 0 + 250 -822 255 -812 266 -806 c 1 + 273 -804 l 1 + 277 -804 l 2 + 291 -804 301 -816 301 -830 c 0 + 301 -845 287 -848 284 -866 c 1 + 284 -877 301 -880 313 -880 c 0 + 328 -879 353 -870 373 -813 c 0 + 378 -799 380 -789 380 -781 c 0 + 380 -753 358 -749 347 -749 c 0 + 320 -749 300 -776 290 -776 c 0 + 279 -776 279 -772 279 -767 c 0 + 279 -754 302 -684 317 -655 c 1 + 309 -655 300 -655 292 -654 c 1 + 282 -680 206 -851 205 -859 c 0 + 205 -880 232 -870 232 -881 c 0 + 232 -886 227 -890 220 -890 c 0 +461 939 m 0 + 366 939 326 764 326 653 c 0 + 326 629 328 605 331 582 c 1 + 381 621 423 664 458 710 c 0 + 501 767 521 816 518 858 c 0 + 514 912 495 940 461 939 c 0 +406 119 m 1 + 460 -207 l 1 + 540 -180 576 -119 569 -23 c 0 + 561 76 507 123 406 119 c 1 +382 117 m 1 + 308 115 250 67 254 -10 c 0 + 256 -56 297 -109 329 -125 c 1 + 326 -127 322 -130 319 -135 c 1 + 249 -102 203 -47 196 37 c 0 + 191 110 238 172 284 207 c 0 + 307 224 333 236 362 243 c 1 + 333 413 l 1 + 312 400 281 376 241 340 c 0 + 191 296 155 256 132 221 c 0 + 83 146 60 81 65 26 c 0 + 70 -42 100 -101 158 -150 c 0 + 216 -199 283 -223 361 -223 c 0 + 386 -223 411 -220 436 -214 c 1 + 417 -103 400 7 382 117 c 1 +EndSplineSet +Validated: 33 +EndChar + +StartChar: uniE050 +Encoding: 57424 57424 16 +Width: 646 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +441 -245 m 5 + 418 -249 393 -251 365 -251 c 4 + 306 -251 263 -244 235 -231 c 4 + 147 -189 85 -138 48 -77 c 4 + 22 -33 5 26 0 99 c 4 + -4 159 11 222 44 288 c 4 + 73 345 109 394 154 436 c 132 + 199 478 250 521 307 563 c 5 + 304 579 299 609 294 655 c 4 + 290 698 289 728 289 744 c 4 + 289 861 305 916 358 1001 c 4 + 392 1055 422 1083 447 1083 c 4 + 468 1083 490 1053 516 991 c 132 + 542 929 555 876 557 832 c 4 + 559 712 538 659 490 576 c 4 + 477 556 427 486 392 458 c 4 + 379 449 367 439 355 429 c 5 + 386 248 l 5 + 394 249 404 250 414 250 c 4 + 472 250 516 238 547 215 c 4 + 606 172 639 111 645 31 c 4 + 656 -104 565 -198 465 -239 c 5 + 473 -296 482 -349 490 -401 c 4 + 495 -432 496 -459 496 -481 c 4 + 496 -511 491 -534 482 -551 c 4 + 447 -615 394 -650 324 -654 c 4 + 282 -657 241 -648 200 -628 c 4 + 150 -604 123 -569 120 -523 c 4 + 118 -489 125 -460 140 -436 c 4 + 158 -408 185 -394 219 -392 c 4 + 270 -388 318 -432 322 -479 c 4 + 326 -535 292 -573 217 -594 c 5 + 234 -618 268 -630 319 -630 c 4 + 381 -630 435 -587 459 -545 c 4 + 468 -529 472 -504 472 -471 c 4 + 472 -451 471 -429 467 -404 c 4 + 459 -351 449 -298 441 -245 c 5 +461 939 m 4 + 366 939 326 764 326 653 c 4 + 326 629 328 605 331 582 c 5 + 381 621 423 664 458 710 c 4 + 501 767 521 816 518 858 c 4 + 514 912 495 940 461 939 c 4 +406 119 m 5 + 460 -207 l 5 + 540 -180 576 -119 569 -23 c 4 + 562 76 507 123 406 119 c 5 +382 117 m 5 + 308 115 250 67 254 -10 c 4 + 256 -56 297 -109 329 -125 c 5 + 326 -127 322 -130 319 -135 c 5 + 249 -102 203 -47 196 37 c 4 + 191 110 238 172 284 207 c 4 + 307 224 333 236 362 243 c 5 + 333 413 l 5 + 312 400 281 376 241 340 c 4 + 191 296 155 256 132 221 c 4 + 83 146 61 81 65 26 c 4 + 70 -42 100 -101 158 -150 c 132 + 216 -199 283 -223 361 -223 c 4 + 386 -223 411 -220 436 -214 c 5 + 417 -103 400 7 382 117 c 5 +EndSplineSet +Validated: 33 +EndChar + +StartChar: uniE052 +Encoding: 57426 57426 17 +Width: 646 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +382 117 m 1 + 308 115 250 67 254 -10 c 0 + 256 -56 297 -109 329 -125 c 1 + 326 -127 322 -130 319 -135 c 1 + 249 -102 203 -47 196 37 c 0 + 191 110 238 172 284 207 c 0 + 307 224 333 236 362 243 c 1 + 333 413 l 1 + 312 400 281 376 241 340 c 0 + 191 296 155 256 132 221 c 0 + 83 146 61 81 65 26 c 0 + 70 -42 100 -101 158 -150 c 0 + 216 -199 283 -223 361 -223 c 0 + 386 -223 411 -220 436 -214 c 1 + 417 -103 400 7 382 117 c 1 +406 119 m 1 + 460 -207 l 1 + 540 -180 576 -119 569 -23 c 0 + 562 76 507 123 406 119 c 1 +461 939 m 0 + 366 939 326 764 326 653 c 0 + 326 629 328 605 331 582 c 1 + 381 621 423 664 458 710 c 0 + 501 767 521 816 518 858 c 0 + 514 912 495 940 461 939 c 0 +441 -245 m 1 + 418 -249 393 -251 365 -251 c 0 + 306 -251 263 -244 235 -231 c 0 + 147 -189 85 -138 48 -77 c 0 + 22 -33 5 26 0 99 c 0 + -4 159 11 222 44 288 c 0 + 73 345 109 394 154 436 c 0 + 199 478 250 521 307 563 c 1 + 304 579 299 609 294 655 c 0 + 290 698 289 728 289 744 c 0 + 289 861 305 916 358 1001 c 0 + 392 1055 422 1083 447 1083 c 0 + 468 1083 490 1053 516 991 c 0 + 542 929 555 876 557 832 c 0 + 559 712 538 659 490 576 c 0 + 477 556 427 486 392 458 c 0 + 379 449 367 439 355 429 c 1 + 386 248 l 1 + 394 249 404 250 414 250 c 0 + 472 250 516 238 547 215 c 0 + 606 172 639 111 645 31 c 0 + 656 -104 565 -198 465 -239 c 1 + 473 -296 482 -349 490 -401 c 0 + 495 -432 496 -459 496 -481 c 0 + 496 -511 491 -534 482 -551 c 0 + 457 -597 423 -628 380 -643 c 1 + 401 -644 465 -656 465 -703 c 0 + 465 -738 443 -746 434 -753 c 0 + 428 -758 426 -763 426 -769 c 0 + 426 -775 426 -780 430 -785 c 1 + 436 -796 439 -807 439 -819 c 0 + 439 -846 421 -872 393 -884 c 0 + 382 -888 366 -890 352 -890 c 0 + 318 -890 270 -869 262 -832 c 0 + 261 -827 260 -824 260 -820 c 0 + 260 -792 285 -763 311 -754 c 0 + 315 -753 317 -752 317 -749 c 0 + 317 -747 316 -746 315 -746 c 0 + 304 -733 299 -719 299 -705 c 0 + 299 -684 310 -665 329 -654 c 1 + 328 -654 326 -654 324 -654 c 0 + 282 -657 241 -648 200 -628 c 0 + 150 -604 123 -569 120 -523 c 0 + 118 -489 125 -460 140 -436 c 0 + 158 -408 185 -394 219 -392 c 0 + 270 -388 318 -432 322 -479 c 0 + 326 -535 292 -573 217 -594 c 1 + 234 -618 268 -630 319 -630 c 0 + 381 -630 435 -587 459 -545 c 0 + 468 -529 472 -504 472 -471 c 0 + 472 -451 471 -429 467 -404 c 0 + 459 -351 449 -298 441 -245 c 1 +315 -781 m 1 + 312 -783 309 -786 308 -789 c 1 + 302 -797 298 -808 298 -819 c 0 + 298 -821 298 -823 299 -826 c 0 + 306 -858 333 -878 352 -878 c 0 + 372 -878 389 -858 389 -842 c 0 + 389 -837 387 -833 385 -828 c 0 + 380 -815 371 -804 360 -794 c 0 + 354 -789 349 -784 343 -780 c 0 + 339 -778 334 -774 329 -774 c 0 + 323 -774 318 -777 315 -781 c 1 +349 -685 m 1 + 349 -699 359 -710 367 -719 c 0 + 375 -727 383 -737 393 -744 c 1 + 398 -746 403 -748 406 -748 c 0 + 423 -748 428 -718 429 -700 c 0 + 429 -691 426 -680 420 -674 c 0 + 412 -665 397 -660 380 -660 c 1 + 365 -661 351 -668 349 -685 c 1 +EndSplineSet +Validated: 33 +EndChar + +StartChar: uniE053 +Encoding: 57427 57427 18 +Width: 646 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +382 117 m 5 + 308 115 250 67 254 -10 c 4 + 256 -56 297 -109 329 -125 c 5 + 326 -127 322 -130 319 -135 c 5 + 249 -102 203 -47 196 37 c 4 + 191 110 238 172 284 207 c 4 + 307 224 333 236 362 243 c 5 + 333 413 l 5 + 312 400 281 376 241 340 c 4 + 191 296 155 256 132 221 c 4 + 83 146 61 81 65 26 c 4 + 70 -42 100 -101 158 -150 c 4 + 216 -199 283 -223 361 -223 c 4 + 386 -223 411 -220 436 -214 c 5 + 417 -103 400 7 382 117 c 5 +406 119 m 5 + 460 -207 l 5 + 540 -180 576 -119 569 -23 c 4 + 562 76 507 123 406 119 c 5 +461 939 m 4 + 366 939 326 764 326 653 c 4 + 326 629 328 605 331 582 c 5 + 381 621 423 664 458 710 c 4 + 501 767 521 816 518 858 c 4 + 514 912 495 940 461 939 c 4 +441 -245 m 5 + 418 -249 393 -251 365 -251 c 4 + 306 -251 263 -244 235 -231 c 4 + 147 -189 85 -138 48 -77 c 4 + 22 -33 5 26 0 99 c 4 + -4 159 11 222 44 288 c 4 + 73 345 109 394 154 436 c 4 + 199 478 250 521 307 563 c 5 + 304 579 299 609 294 655 c 4 + 290 698 289 728 289 744 c 4 + 289 861 305 916 358 1001 c 4 + 380 1036 401 1060 419 1073 c 5 + 390 1080 358 1099 352 1128 c 4 + 351 1133 350 1136 350 1140 c 4 + 350 1168 375 1197 401 1206 c 4 + 405 1207 407 1208 407 1211 c 4 + 407 1213 406 1214 405 1214 c 4 + 394 1227 389 1241 389 1255 c 4 + 389 1279 403 1301 429 1311 c 5 + 439 1316 451 1317 463 1317 c 6 + 467 1317 l 6 + 483 1317 555 1307 555 1257 c 4 + 555 1222 533 1214 524 1207 c 4 + 518 1202 516 1197 516 1191 c 4 + 516 1185 516 1180 520 1175 c 5 + 526 1164 529 1153 529 1141 c 4 + 529 1114 511 1088 483 1076 c 4 + 479 1075 474 1073 469 1072 c 5 + 484 1058 499 1032 516 991 c 4 + 542 929 555 876 557 832 c 4 + 559 712 538 659 490 576 c 4 + 477 556 427 486 392 458 c 4 + 379 449 367 439 355 429 c 5 + 386 248 l 5 + 394 249 404 250 414 250 c 4 + 472 250 516 238 547 215 c 4 + 606 172 639 111 645 31 c 4 + 656 -104 565 -198 465 -239 c 5 + 473 -296 482 -349 490 -401 c 4 + 495 -432 496 -459 496 -481 c 4 + 496 -511 491 -534 482 -551 c 4 + 447 -615 394 -650 324 -654 c 4 + 282 -657 241 -648 200 -628 c 4 + 150 -604 123 -569 120 -523 c 4 + 118 -489 125 -460 140 -436 c 4 + 158 -408 185 -394 219 -392 c 4 + 270 -388 318 -432 322 -479 c 4 + 326 -535 292 -573 217 -594 c 5 + 234 -618 268 -630 319 -630 c 4 + 381 -630 435 -587 459 -545 c 4 + 468 -529 472 -504 472 -471 c 4 + 472 -451 471 -429 467 -404 c 4 + 459 -351 449 -298 441 -245 c 5 +405 1179 m 5 + 402 1177 399 1174 398 1171 c 5 + 392 1163 388 1152 388 1141 c 4 + 388 1139 388 1137 389 1134 c 4 + 396 1104 420 1084 439 1082 c 5 + 442 1083 444 1083 447 1083 c 4 + 448 1083 449 1083 450 1083 c 4 + 466 1087 479 1104 479 1118 c 4 + 479 1123 477 1127 475 1132 c 4 + 470 1145 461 1156 450 1166 c 4 + 444 1171 439 1176 433 1180 c 4 + 429 1182 424 1186 419 1186 c 4 + 413 1186 408 1183 405 1179 c 5 +439 1275 m 5 + 439 1261 449 1250 457 1241 c 4 + 465 1233 473 1223 483 1216 c 5 + 488 1214 493 1212 496 1212 c 4 + 513 1212 518 1242 519 1260 c 4 + 519 1269 516 1280 510 1286 c 4 + 502 1295 487 1300 470 1300 c 5 + 455 1299 441 1292 439 1275 c 5 +EndSplineSet +Validated: 33 +EndChar + +StartChar: uniE054 +Encoding: 57428 57428 19 +Width: 646 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +382 117 m 1 + 308 115 250 67 254 -10 c 0 + 256 -56 297 -109 329 -125 c 1 + 326 -127 322 -130 319 -135 c 1 + 249 -102 203 -47 196 37 c 1 + 191 110 238 172 284 207 c 0 + 307 224 333 236 362 243 c 1 + 333 413 l 1 + 312 400 281 376 241 340 c 0 + 191 296 155 256 132 221 c 0 + 83 146 61 81 65 26 c 0 + 70 -42 100 -101 158 -150 c 0 + 216 -199 283 -223 361 -223 c 0 + 386 -223 411 -220 436 -214 c 1 + 417 -103 400 7 382 117 c 1 +406 119 m 1 + 460 -207 l 1 + 540 -180 576 -119 569 -23 c 0 + 562 76 507 123 406 119 c 1 +461 939 m 1 + 366 939 326 764 326 653 c 0 + 326 629 328 605 331 582 c 1 + 381 621 423 664 458 710 c 0 + 501 767 521 816 518 858 c 0 + 514 912 495 940 461 939 c 1 +441 1113 m 0 + 441 1129 449 1140 464 1144 c 1 + 468 1144 l 2 + 482 1144 492 1132 492 1118 c 0 + 492 1103 478 1100 475 1082 c 1 + 475 1071 492 1068 504 1068 c 0 + 519 1069 544 1078 564 1135 c 0 + 569 1149 571 1159 571 1167 c 0 + 571 1195 549 1199 538 1199 c 0 + 511 1199 491 1172 481 1172 c 0 + 470 1172 470 1176 470 1181 c 0 + 470 1197 506 1304 518 1306 c 1 + 583 1306 l 2 + 617 1306 650 1307 650 1302 c 0 + 650 1280 616 1268 595 1264 c 2 + 566 1258 l 2 + 555 1256 544 1254 532 1251 c 2 + 518 1248 l 1 + 513 1244 511 1229 511 1222 c 0 + 511 1221 512 1219 515 1219 c 0 + 523 1219 537 1222 546 1222 c 0 + 570 1222 577 1210 589 1210 c 1 + 592 1207 l 1 + 607 1196 615 1174 615 1152 c 0 + 615 1092 557 1055 503 1055 c 0 + 496 1055 488 1056 481 1058 c 1 + 492 1043 504 1020 516 991 c 0 + 542 929 555 876 557 832 c 1 + 559 712 538 659 490 576 c 1 + 477 556 427 486 392 458 c 1 + 379 449 367 439 355 429 c 1 + 386 248 l 1 + 394 249 404 250 414 250 c 0 + 472 250 516 238 547 215 c 0 + 606 172 639 111 645 31 c 0 + 656 -104 565 -198 465 -239 c 1 + 473 -296 482 -349 490 -401 c 0 + 495 -432 496 -459 496 -481 c 0 + 496 -511 491 -534 482 -551 c 0 + 447 -615 394 -650 324 -654 c 0 + 282 -657 241 -648 200 -628 c 0 + 150 -604 123 -569 120 -523 c 0 + 116 -450 154 -396 219 -392 c 0 + 270 -388 318 -432 322 -479 c 0 + 326 -535 292 -573 217 -594 c 1 + 234 -618 268 -630 319 -630 c 0 + 381 -630 435 -587 459 -545 c 0 + 468 -529 472 -504 472 -471 c 0 + 472 -451 471 -429 467 -404 c 0 + 459 -351 449 -298 441 -245 c 1 + 418 -249 393 -251 365 -251 c 0 + 306 -251 263 -244 235 -231 c 0 + 147 -189 85 -138 48 -77 c 0 + 22 -33 5 26 0 99 c 0 + -9 231 79 366 154 436 c 0 + 199 478 250 521 307 563 c 1 + 304 579 299 609 294 655 c 0 + 290 698 289 728 289 744 c 0 + 289 861 305 916 358 1001 c 0 + 373 1026 388 1044 402 1058 c 1 + 366 1059 291 1050 291 1067 c 1 + 299 1085 320 1060 338 1097 c 0 + 346 1113 378 1194 377 1194 c 2 + 377 1194 379 1199 379 1203 c 0 + 379 1207 378 1210 372 1210 c 0 + 362 1210 358 1191 338 1191 c 0 + 332 1191 327 1194 327 1199 c 0 + 327 1201 327 1202 329 1205 c 0 + 335 1212 409 1298 416 1304 c 0 + 423 1310 427 1313 432 1313 c 0 + 442 1313 449 1302 465 1302 c 0 + 471 1302 476 1306 479 1306 c 0 + 483 1306 484 1305 484 1301 c 2 + 484 1297 l 1 + 483 1290 397 1097 396 1089 c 1 + 396 1074 410 1075 418 1072 c 1 + 428 1079 438 1083 447 1083 c 0 + 448 1083 l 1 + 443 1091 441 1101 441 1113 c 0 +EndSplineSet +Validated: 33 +EndChar + +StartChar: uniE062 +Encoding: 57442 57442 20 +Width: 698 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +158 96 m 4 + 209 96 231 82 246 47 c 6 + 262 8 l 5 + 262 -9 260 -22 255 -32 c 5 + 252 -43 245 -53 236 -63 c 4 + 219 -81 187 -106 152 -106 c 4 + 97 -106 75 -93 40 -62 c 4 + 16 -41 5 -7 5 38 c 4 + 5 84 19 119 37 150 c 4 + 67 202 108 229 174 243 c 5 + 210 249 l 5 + 236 251 l 5 + 390 251 471 183 510 69 c 4 + 521 37 528 1 528 -38 c 4 + 528 -141 502 -220 460 -288 c 4 + 371 -433 226 -518 48 -576 c 5 + 18 -581 l 5 + 9 -581 4 -578 4 -573 c 5 + 7 -563 9 -562 14 -557 c 5 + 49 -542 84 -527 110 -513 c 6 + 188 -470 l 5 + 284 -413 350 -334 385 -212 c 132 + 394 -179 402 -152 407 -112 c 132 + 410 -90 412 -77 413 -73 c 5 + 406 -4 397 42 390 67 c 4 + 383 92 386 89 374 107 c 4 + 366 119 355 130 343 141 c 4 + 319 162 281 185 225 185 c 4 + 177 185 141 177 112 157 c 4 + 84 138 70 113 70 84 c 4 + 70 76 70 76 70 68 c 5 + 72 63 73 59 74 57 c 5 + 98 79 126 96 158 96 c 4 +585 -118 m 132 + 585 -86 608 -60 642 -60 c 4 + 660 -60 675 -66 682 -78 c 132 + 691 -93 698 -96 698 -118 c 4 + 698 -127 696 -134 693 -139 c 5 + 687 -158 666 -176 642 -176 c 4 + 608 -176 585 -150 585 -118 c 132 +642 177 m 4 + 673 177 698 150 698 119 c 4 + 698 89 673 61 642 61 c 5 + 619 64 l 5 + 600 71 585 96 585 119 c 5 + 588 142 l 5 + 597 162 616 177 642 177 c 4 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uniE063 +Encoding: 57443 57443 21 +Width: 698 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +158 96 m 4 + 209 96 231 82 246 47 c 6 + 262 8 l 5 + 262 -9 260 -22 255 -32 c 5 + 252 -43 245 -53 236 -63 c 4 + 219 -81 187 -106 152 -106 c 4 + 97 -106 75 -93 40 -62 c 4 + 16 -41 5 -7 5 38 c 4 + 5 84 19 119 37 150 c 4 + 67 202 108 229 174 243 c 5 + 210 249 l 5 + 236 251 l 5 + 390 251 471 183 510 69 c 4 + 521 37 528 1 528 -38 c 4 + 528 -141 502 -220 460 -288 c 4 + 371 -433 226 -518 48 -576 c 5 + 18 -581 l 5 + 9 -581 4 -578 4 -573 c 5 + 7 -563 9 -562 14 -557 c 5 + 49 -542 84 -527 110 -513 c 6 + 188 -470 l 5 + 284 -413 350 -334 385 -212 c 132 + 394 -179 402 -152 407 -112 c 132 + 410 -90 412 -77 413 -73 c 5 + 406 -4 397 42 390 67 c 4 + 383 92 386 89 374 107 c 4 + 366 119 355 130 343 141 c 4 + 319 162 281 185 225 185 c 4 + 177 185 141 177 112 157 c 4 + 84 138 70 113 70 84 c 4 + 70 76 70 76 70 68 c 5 + 72 63 73 59 74 57 c 5 + 98 79 126 96 158 96 c 4 +585 -118 m 132 + 585 -86 608 -60 642 -60 c 4 + 660 -60 675 -66 682 -78 c 132 + 691 -93 698 -96 698 -118 c 4 + 698 -127 696 -134 693 -139 c 5 + 687 -158 666 -176 642 -176 c 4 + 608 -176 585 -150 585 -118 c 132 +642 177 m 4 + 673 177 698 150 698 119 c 4 + 698 89 673 61 642 61 c 5 + 619 64 l 5 + 600 71 585 96 585 119 c 5 + 588 142 l 5 + 597 162 616 177 642 177 c 4 +254 -752 m 2 + 254 -752 154 -752 150 -752 c 0 + 145 -752 139 -749 139 -743 c 1 + 141 -738 142 -735 150 -735 c 0 + 158 -735 168 -732 168 -732 c 1 + 168 -732 177 -730 185 -714 c 0 + 193 -698 221 -621 221 -621 c 1 + 221 -621 223 -616 223 -612 c 0 + 223 -609 222 -606 217 -606 c 0 + 213 -606 209 -609 205 -614 c 0 + 201 -619 194 -624 185 -624 c 0 + 178 -624 173 -621 173 -616 c 0 + 173 -614 173 -613 175 -611 c 0 + 181 -604 253 -521 258 -516 c 0 + 265 -509 270 -506 274 -506 c 0 + 278 -506 285 -510 290 -514 c 0 + 295 -517 299 -518 306 -518 c 0 + 311 -518 316 -514 319 -514 c 0 + 323 -514 324 -515 324 -518 c 0 + 324 -519 324 -521 324 -522 c 0 + 322 -528 241 -714 240 -722 c 0 + 240 -728 244 -736 253 -736 c 0 + 259 -736 265 -738 265 -743 c 0 + 265 -748 261 -752 254 -752 c 2 +305 -669 m 0xabcc + 307 -669 308 -669 309 -669 c 0 + 322 -669 332 -680 332 -694 c 0 + 332 -699 330 -705 327 -709 c 0 + 322 -715 317 -718 315 -726 c 1 + 315 -728 l 2 + 315 -739 332 -742 341 -742 c 2 + 343 -742 l 2xabc4 + 358 -742 381 -732 401 -677 c 0 + 405 -664 407 -655 407 -646 c 0 + 407 -620 387 -616 375 -616 c 0 + 357 -616 337 -635 329 -640 c 0 + 327 -642 324 -642 321 -642 c 0 + 317 -642 314 -641 314 -641 c 2 + 312 -640 311 -637 311 -634 c 0 + 311 -630 312 -626 312 -624 c 0 + 312 -623 313 -623 313 -622 c 0 + 317 -604 326 -586 332 -568 c 0xabac + 335 -559 344 -541 344 -534 c 1 + 346 -527 350 -515 357 -514 c 1 + 365 -514 392 -514 419 -514 c 0 + 446 -514 474 -514 482 -515 c 0 + 483 -515 483 -516 483 -517 c 0 + 483 -521 478 -529 477 -530 c 0 + 475 -534 471 -537 468 -539 c 0 + 464 -542 460 -545 455 -547 c 0 + 447 -550 439 -552 430 -554 c 0 + 421 -555 412 -557 403 -559 c 0 + 392 -562 381 -562 370 -566 c 0 + 366 -567 361 -568 357 -570 c 0x7ba4 + 352 -573 351 -581 351 -587 c 1 + 350 -589 350 -591 350 -593 c 0 + 350 -595 350 -596 352 -597 c 2 + 353 -598 l 1 + 355 -598 358 -596 361 -596 c 1 + 363 -595 365 -595 367 -595 c 0 + 373 -594 379 -594 384 -594 c 0 + 406 -594 414 -599 425 -606 c 1 + 427 -608 l 1x6bac + 438 -616 443 -627 447 -640 c 0 + 449 -646 450 -654 450 -662 c 0 + 450 -670 449 -678 448 -684 c 0 + 443 -708 423 -726 402 -738 c 0 + 385 -747 363 -755 343 -755 c 0 + 328 -755 313 -751 302 -742 c 0 + 291 -733 283 -715 283 -699 c 0 + 283 -687 288 -676 299 -671 c 0 + 301 -670 303 -670 305 -669 c 0xabcc +EndSplineSet +Validated: 1 +EndChar + +StartChar: uniE064 +Encoding: 57444 57444 22 +Width: 698 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +158 96 m 4 + 209 96 231 82 246 47 c 6 + 262 8 l 5 + 262 -9 260 -22 255 -32 c 5 + 252 -43 245 -53 236 -63 c 4 + 219 -81 187 -106 152 -106 c 4 + 97 -106 75 -93 40 -62 c 4 + 16 -41 5 -7 5 38 c 4 + 5 84 19 119 37 150 c 4 + 67 202 108 229 174 243 c 5 + 210 249 l 5 + 236 251 l 5 + 390 251 471 183 510 69 c 4 + 521 37 528 1 528 -38 c 4 + 528 -141 502 -220 460 -288 c 4 + 371 -433 226 -518 48 -576 c 5 + 18 -581 l 5 + 9 -581 4 -578 4 -573 c 5 + 7 -563 9 -562 14 -557 c 5 + 49 -542 84 -527 110 -513 c 6 + 188 -470 l 5 + 284 -413 350 -334 385 -212 c 132 + 394 -179 402 -152 407 -112 c 132 + 410 -90 412 -77 413 -73 c 5 + 406 -4 397 42 390 67 c 4 + 383 92 386 89 374 107 c 4 + 366 119 355 130 343 141 c 4 + 319 162 281 185 225 185 c 4 + 177 185 141 177 112 157 c 4 + 84 138 70 113 70 84 c 4 + 70 76 70 76 70 68 c 5 + 72 63 73 59 74 57 c 5 + 98 79 126 96 158 96 c 4 +585 -118 m 132 + 585 -86 608 -60 642 -60 c 4 + 660 -60 675 -66 682 -78 c 132 + 691 -93 698 -96 698 -118 c 4 + 698 -127 696 -134 693 -139 c 5 + 687 -158 666 -176 642 -176 c 4 + 608 -176 585 -150 585 -118 c 132 +642 177 m 4 + 673 177 698 150 698 119 c 4 + 698 89 673 61 642 61 c 5 + 619 64 l 5 + 600 71 585 96 585 119 c 5 + 588 142 l 5 + 597 162 616 177 642 177 c 4 +232 -572 m 0 + 232 -539 261 -513 303 -513 c 2 + 308 -513 l 2 + 323 -513 392 -523 392 -570 c 0 + 392 -604 371 -611 362 -619 c 0 + 356 -624 354 -629 354 -634 c 0 + 354 -639 355 -644 358 -649 c 0 + 364 -659 366 -670 366 -681 c 0 + 366 -708 350 -733 323 -744 c 0 + 311 -748 296 -750 284 -750 c 0 + 249 -750 195 -727 195 -683 c 0 + 195 -656 219 -628 244 -620 c 0 + 249 -618 250 -617 250 -615 c 0 + 250 -613 249 -612 248 -611 c 0 + 237 -600 232 -586 232 -572 c 0 +358 -567 m 2 + 358 -542 336 -529 312 -529 c 2 + 310 -529 l 1 + 295 -530 282 -537 280 -553 c 1x0520 + 280 -555 l 2 + 280 -567 290 -578 297 -586 c 0 + 306 -595 320 -614 335 -614 c 0 + 352 -614 357 -585 358 -570 c 1 + 358 -567 l 2 +261 -638 m 0x2808 + 243 -638 232 -663 232 -681 c 2 + 232 -688 l 1 + 239 -720 265 -738 283 -738 c 0 + 303 -738 318 -720 318 -704 c 0 + 318 -699 317 -695 315 -691 c 0 + 310 -678 302 -667 291 -658 c 0 + 286 -653 280 -649 275 -644 c 1 + 271 -642 266 -638 261 -638 c 0x2808 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uniE065 +Encoding: 57445 57445 23 +Width: 698 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +642 177 m 0 + 673 177 698 150 698 119 c 0 + 698 89 673 61 642 61 c 1 + 619 64 l 1 + 600 71 585 96 585 119 c 1 + 588 142 l 1 + 597 162 616 177 642 177 c 0 +585 -118 m 128 + 585 -86 608 -60 642 -60 c 0 + 660 -60 675 -66 682 -78 c 128 + 691 -93 698 -96 698 -118 c 0 + 698 -127 696 -134 693 -139 c 1 + 687 -158 666 -176 642 -176 c 0 + 608 -176 585 -150 585 -118 c 128 +158 96 m 0 + 209 96 231 82 246 47 c 2 + 262 8 l 1 + 262 -9 260 -22 255 -32 c 1 + 252 -43 245 -53 236 -63 c 0 + 219 -81 187 -106 152 -106 c 0 + 97 -106 75 -93 40 -62 c 0 + 16 -41 5 -7 5 38 c 0 + 5 84 19 119 37 150 c 0 + 67 202 108 229 174 243 c 1 + 210 249 l 1 + 236 251 l 1 + 270 251 301 247 328 241 c 1 + 315 250 305 263 302 278 c 0 + 301 283 300 286 300 290 c 0 + 300 318 325 347 351 356 c 0 + 355 357 357 358 357 361 c 0 + 357 363 356 364 355 364 c 0 + 344 377 339 391 339 405 c 0 + 339 429 353 451 379 461 c 1 + 389 466 401 467 413 467 c 2 + 417 467 l 2 + 433 467 505 457 505 407 c 0 + 505 372 483 364 474 357 c 0 + 468 352 466 347 466 341 c 0 + 466 335 466 330 470 325 c 1 + 476 314 479 303 479 291 c 0 + 479 264 461 238 433 226 c 0 + 422 222 406 220 392 220 c 0 + 390 220 389 220 387 220 c 1 + 448 190 486 138 510 69 c 0 + 521 37 528 1 528 -38 c 0 + 528 -141 502 -220 460 -288 c 0 + 371 -433 226 -518 48 -576 c 1 + 18 -581 l 1 + 9 -581 4 -578 4 -573 c 1 + 7 -563 9 -562 14 -557 c 1 + 49 -542 84 -527 110 -513 c 2 + 188 -470 l 1 + 284 -413 350 -334 385 -212 c 0 + 394 -179 402 -152 407 -112 c 0 + 410 -90 412 -77 413 -73 c 1 + 406 -4 397 42 390 67 c 0 + 383 92 386 89 374 107 c 0 + 366 119 355 130 343 141 c 0 + 319 162 281 185 225 185 c 0 + 177 185 141 177 112 157 c 0 + 84 138 70 113 70 84 c 0 + 70 76 70 76 70 68 c 1 + 72 63 73 59 74 57 c 1 + 98 79 126 96 158 96 c 0 +355 329 m 1 + 352 327 349 324 348 321 c 1 + 342 313 338 302 338 291 c 0 + 338 289 338 287 339 284 c 0 + 346 252 373 232 392 232 c 0 + 412 232 429 252 429 268 c 0 + 429 273 427 277 425 282 c 0 + 420 295 411 306 400 316 c 0 + 394 321 389 326 383 330 c 0 + 379 332 374 336 369 336 c 0 + 363 336 358 333 355 329 c 1 +389 425 m 1 + 389 411 399 400 407 391 c 0 + 415 383 423 373 433 366 c 1 + 438 364 443 362 446 362 c 0 + 463 362 468 392 469 410 c 0 + 469 419 466 430 460 436 c 0 + 452 445 437 450 420 450 c 1 + 405 449 391 442 389 425 c 1 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uniE066 +Encoding: 57446 57446 24 +Width: 698 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +642 177 m 0 + 673 177 698 150 698 119 c 0 + 698 89 673 61 642 61 c 1 + 619 64 l 1 + 600 71 585 96 585 119 c 1 + 588 142 l 1 + 597 162 616 177 642 177 c 0 +585 -118 m 128 + 585 -86 608 -60 642 -60 c 0 + 660 -60 675 -66 682 -78 c 128 + 691 -93 698 -96 698 -118 c 0 + 698 -127 696 -134 693 -139 c 1 + 687 -158 666 -176 642 -176 c 0 + 608 -176 585 -150 585 -118 c 128 +158 96 m 0 + 209 96 231 82 246 47 c 2 + 262 8 l 1 + 262 -9 260 -22 255 -32 c 1 + 252 -43 245 -53 236 -63 c 0 + 219 -81 187 -106 152 -106 c 4 + 97 -106 75 -93 40 -62 c 0 + 16 -41 5 -7 5 38 c 0 + 5 84 19 119 37 150 c 0 + 65 199 131 231 189 246 c 1 + 197 263 189 232 207 269 c 0 + 215 285 247 366 246 366 c 2 + 246 366 248 371 248 375 c 0 + 248 379 247 382 241 382 c 0 + 231 382 227 363 207 363 c 0 + 201 363 196 366 196 371 c 0 + 196 373 196 374 198 377 c 0 + 204 384 278 470 285 476 c 0 + 292 482 296 485 301 485 c 0 + 311 485 318 474 334 474 c 0 + 340 474 345 478 348 478 c 0 + 352 478 353 477 353 473 c 2 + 353 469 l 1 + 352 462 266 269 265 261 c 0 + 265 255 267 252 270 250 c 1 + 292 248 312 246 331 241 c 1 + 319 251 310 265 310 285 c 0 + 310 298 315 308 326 314 c 1 + 333 316 l 1 + 337 316 l 2 + 351 316 361 304 361 290 c 0 + 361 275 347 272 344 254 c 1 + 344 243 361 240 373 240 c 0 + 388 241 413 250 433 307 c 0 + 438 321 440 331 440 339 c 0 + 440 367 418 371 407 371 c 0 + 380 371 360 344 350 344 c 0 + 339 344 339 348 339 353 c 0 + 339 369 375 476 387 478 c 1 + 452 478 l 2 + 486 478 519 479 519 474 c 0 + 519 452 485 440 464 436 c 2 + 435 430 l 2 + 424 428 413 426 401 423 c 2 + 387 420 l 1 + 382 416 380 401 380 394 c 0 + 380 393 381 391 384 391 c 0 + 392 391 406 394 415 394 c 0 + 439 394 446 382 458 382 c 1 + 461 379 l 1 + 476 368 484 346 484 324 c 0 + 484 264 426 227 372 227 c 1 + 441 198 485 143 510 69 c 0 + 521 37 528 1 528 -38 c 0 + 528 -141 502 -220 460 -288 c 0 + 371 -433 226 -518 48 -576 c 1 + 18 -581 l 1 + 9 -581 4 -578 4 -573 c 1 + 7 -563 9 -562 14 -557 c 1 + 49 -542 84 -527 110 -513 c 2 + 188 -470 l 1 + 284 -413 350 -334 385 -212 c 0 + 394 -179 402 -152 407 -112 c 0 + 410 -90 412 -77 413 -73 c 1 + 406 -4 397 42 390 67 c 0 + 383 92 386 89 374 107 c 0 + 366 119 355 130 343 141 c 0 + 319 162 281 185 225 185 c 0 + 177 185 141 177 112 157 c 0 + 84 138 70 113 70 84 c 0 + 70 76 70 76 70 68 c 1 + 72 63 73 59 74 57 c 1 + 98 79 126 96 158 96 c 0 +EndSplineSet +Validated: 33 +EndChar + +StartChar: uniE262 +Encoding: 57954 57954 25 +Width: 280 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +136 186 m 5 + 136 355 l 5 + 153 355 l 5 + 153 191 l 5 + 197 205 l 5 + 197 114 l 5 + 153 100 l 5 + 153 -65 l 5 + 197 -53 l 5 + 197 -144 l 5 + 153 -157 l 5 + 153 -312 l 5 + 136 -312 l 5 + 136 -162 l 5 + 60 -184 l 5 + 60 -339 l 5 + 43 -339 l 5 + 43 -190 l 5 + 0 -203 l 5 + 0 -113 l 5 + 43 -99 l 5 + 43 68 l 5 + 0 54 l 5 + 0 146 l 5 + 43 159 l 5 + 43 328 l 5 + 60 328 l 5 + 60 165 l 5 + 136 186 l 5 +60 73 m 5 + 60 -94 l 5 + 136 -72 l 5 + 136 96 l 5 + 60 73 l 5 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uniE261 +Encoding: 57953 57953 26 +Width: 157 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 -188 m 5 + 0 351 l 5 + 18 351 l 5 + 18 160 l 5 + 157 182 l 5 + 157 4 157 -173 157 -351 c 5 + 140 -351 l 5 + 140 -165 l 5 + 0 -188 l 5 +18 -100 m 5 + 140 -83 l 5 + 140 93 l 5 + 18 74 l 5 + 18 -100 l 5 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uniE260 +Encoding: 57952 57952 27 +Width: 200 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +20 110 m 5 + 52 126 74 137 113 137 c 4 + 139 137 148 134 167 124 c 4 + 180 117 191 104 194 86 c 6 + 198 61 l 5 + 198 33 182 4 153 -28 c 4 + 130 -53 114 -72 88 -96 c 6 + 0 -175 l 5 + 0 469 l 5 + 20 469 l 5 + 20 110 l 5 +90 106 m 5 + 58 106 42 96 20 77 c 5 + 20 -117 l 5 + 51 -86 74 -58 91 -33 c 4 + 112 -1 123 26 123 51 c 4 + 123 60 124 67 124 71 c 4 + 124 85 121 92 113 101 c 5 + 105 104 l 5 + 90 106 l 5 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uniE264 +Encoding: 57956 57956 28 +Width: 388 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +280 106 m 1 + 248 106 232 96 210 77 c 1 + 210 -117 l 1 + 241 -86 264 -58 281 -33 c 0 + 302 -1 313 26 313 51 c 0 + 314 60 314 67 314 71 c 0 + 314 85 311 92 303 101 c 1 + 295 104 l 1 + 280 106 l 1 +113 137 m 0 + 151 137 178 124 190 96 c 1 + 190 469 l 1 + 210 469 l 1 + 210 110 l 1 + 242 126 264 137 303 137 c 0 + 329 137 338 134 357 124 c 0 + 370 117 381 104 384 86 c 2 + 388 61 l 1 + 388 33 372 4 343 -28 c 0 + 320 -53 304 -72 278 -96 c 2 + 190 -175 l 1 + 190 24 l 1 + 178 -4 144 -39 123 -63 c 0 + 114 -74 102 -85 88 -96 c 2 + 0 -175 l 1 + 0 469 l 1 + 20 469 l 1 + 20 110 l 1 + 52 126 74 137 113 137 c 0 +90 106 m 1 + 58 106 42 96 20 77 c 1 + 20 -117 l 1 + 51 -86 74 -58 91 -33 c 0 + 112 -1 123 26 123 51 c 0 + 124 60 124 67 124 71 c 0 + 124 85 121 92 113 101 c 1 + 105 104 l 1 + 90 106 l 1 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uniE266 +Encoding: 57958 57958 29 +Width: 578 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +280 106 m 1 + 248 106 232 96 210 77 c 1 + 210 -117 l 1 + 241 -86 264 -58 281 -33 c 0 + 302 -1 313 26 313 51 c 0 + 314 60 314 67 314 71 c 0 + 314 85 311 92 303 101 c 1 + 295 104 l 1 + 280 106 l 1 +303 137 m 0 + 341 137 368 124 380 96 c 1 + 380 469 l 1 + 400 469 l 1 + 400 110 l 1 + 432 126 454 137 493 137 c 0 + 519 137 528 134 547 124 c 0 + 560 117 571 104 574 86 c 2 + 578 61 l 1 + 578 33 562 4 533 -28 c 0 + 510 -53 494 -72 468 -96 c 2 + 380 -175 l 1 + 380 24 l 1 + 368 -4 334 -39 313 -63 c 0 + 304 -74 292 -85 278 -96 c 2 + 190 -175 l 1 + 190 24 l 1 + 178 -4 144 -39 123 -63 c 0 + 114 -74 102 -85 88 -96 c 2 + 0 -175 l 1 + 0 469 l 1 + 20 469 l 1 + 20 110 l 1 + 52 126 74 137 113 137 c 0 + 151 137 178 124 190 96 c 1 + 190 469 l 1 + 210 469 l 1 + 210 110 l 1 + 242 126 264 137 303 137 c 0 +470 106 m 1 + 438 106 422 96 400 77 c 1 + 400 -117 l 1 + 431 -86 454 -58 471 -33 c 0 + 492 -1 503 26 503 51 c 0 + 504 60 504 67 504 71 c 0 + 504 85 501 92 493 101 c 1 + 485 104 l 1 + 470 106 l 1 +90 106 m 1 + 58 106 42 96 20 77 c 1 + 20 -117 l 1 + 51 -86 74 -58 91 -33 c 0 + 112 -1 123 26 123 51 c 0 + 124 60 124 67 124 71 c 0 + 124 85 121 92 113 101 c 1 + 105 104 l 1 + 90 106 l 1 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uniE267 +Encoding: 57959 57959 30 +Width: 368 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 -188 m 1 + 0 351 l 1 + 18 351 l 1 + 18 160 l 1 + 157 182 l 1 + 157 4 157 -173 157 -351 c 1 + 140 -351 l 1 + 140 -165 l 1 + 0 -188 l 1 +18 -100 m 1 + 140 -83 l 1 + 140 93 l 1 + 18 74 l 1 + 18 -100 l 1 +200 110 m 1 + 232 126 254 137 293 137 c 0 + 319 137 328 134 347 124 c 0 + 360 117 371 104 374 86 c 2 + 378 61 l 1 + 378 33 362 4 333 -28 c 0 + 310 -53 294 -72 268 -96 c 2 + 180 -175 l 1 + 180 469 l 1 + 200 469 l 1 + 200 110 l 1 +270 106 m 1 + 238 106 222 96 200 77 c 1 + 200 -117 l 1 + 231 -86 254 -58 271 -33 c 0 + 292 -1 303 26 303 51 c 0 + 303 60 304 67 304 71 c 0 + 304 85 301 92 293 101 c 1 + 285 104 l 1 + 270 106 l 1 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uniE263 +Encoding: 57955 57955 31 +Width: 258 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 120 m 5 + 74 120 l 5 + 74 66 l 5 + 89 49 l 5 + 168 49 l 5 + 183 65 l 5 + 183 120 l 5 + 257 120 l 5 + 257 48 l 5 + 198 48 l 5 + 173 20 l 5 + 173 -18 l 5 + 198 -50 l 5 + 257 -50 l 5 + 257 -120 l 5 + 182 -120 l 5 + 182 -65 l 5 + 168 -50 l 5 + 88 -50 l 5 + 74 -65 l 5 + 74 -120 l 5 + 0 -120 l 5 + 0 -48 l 5 + 60 -48 l 5 + 86 -18 l 5 + 86 20 l 5 + 58 49 l 5 + 0 49 l 5 + 0 120 l 5 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uniE265 +Encoding: 57957 57957 32 +Width: 258 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +414 186 m 1 + 414 355 l 1 + 431 355 l 1 + 431 191 l 1 + 475 205 l 1 + 475 114 l 1 + 431 100 l 1 + 431 -65 l 1 + 475 -53 l 1 + 475 -144 l 1 + 431 -157 l 1 + 431 -312 l 1 + 414 -312 l 1 + 414 -162 l 1 + 338 -184 l 1 + 338 -339 l 1 + 321 -339 l 1 + 321 -190 l 1 + 278 -203 l 1 + 278 -113 l 1 + 321 -99 l 1 + 321 68 l 1 + 278 54 l 1 + 278 146 l 1 + 321 159 l 1 + 321 328 l 1 + 338 328 l 1 + 338 165 l 1 + 414 186 l 1 +338 73 m 1 + 338 -94 l 1 + 414 -72 l 1 + 414 96 l 1 + 338 73 l 1 +0 120 m 1 + 74 120 l 1 + 74 66 l 1 + 89 49 l 1 + 168 49 l 1 + 183 65 l 1 + 183 120 l 1 + 257 120 l 1 + 257 48 l 1 + 198 48 l 1 + 173 20 l 1 + 173 -18 l 1 + 198 -50 l 1 + 257 -50 l 1 + 257 -120 l 1 + 182 -120 l 1 + 182 -65 l 1 + 168 -50 l 1 + 88 -50 l 1 + 74 -65 l 1 + 74 -120 l 1 + 0 -120 l 1 + 0 -48 l 1 + 60 -48 l 1 + 86 -18 l 1 + 86 20 l 1 + 58 49 l 1 + 0 49 l 1 + 0 120 l 1 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uniE268 +Encoding: 57960 57960 33 +Width: 368 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 -188 m 1 + 0 351 l 1 + 18 351 l 1 + 18 160 l 1 + 157 182 l 1 + 157 4 157 -173 157 -351 c 1 + 140 -351 l 1 + 140 -165 l 1 + 0 -188 l 1 +18 -100 m 1 + 140 -83 l 1 + 140 93 l 1 + 18 74 l 1 + 18 -100 l 1 +316 186 m 1 + 316 355 l 1 + 333 355 l 1 + 333 191 l 1 + 377 205 l 1 + 377 114 l 1 + 333 100 l 1 + 333 -65 l 1 + 377 -53 l 1 + 377 -144 l 1 + 333 -157 l 1 + 333 -312 l 1 + 316 -312 l 1 + 316 -162 l 1 + 240 -184 l 1 + 240 -339 l 1 + 223 -339 l 1 + 223 -190 l 1 + 180 -203 l 1 + 180 -113 l 1 + 223 -99 l 1 + 223 68 l 1 + 180 54 l 1 + 180 146 l 1 + 223 159 l 1 + 223 328 l 1 + 240 328 l 1 + 240 165 l 1 + 316 186 l 1 +240 73 m 1 + 240 -94 l 1 + 316 -72 l 1 + 316 96 l 1 + 240 73 l 1 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uniE269 +Encoding: 57961 57961 34 +Width: 414 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +136 186 m 1 + 136 355 l 1 + 153 355 l 1 + 153 191 l 1 + 197 205 l 1 + 197 114 l 1 + 153 100 l 1 + 153 -65 l 1 + 197 -53 l 1 + 197 -144 l 1 + 153 -157 l 1 + 153 -312 l 1 + 136 -312 l 1 + 136 -162 l 1 + 60 -184 l 1 + 60 -339 l 1 + 43 -339 l 1 + 43 -190 l 1 + 0 -203 l 1 + 0 -113 l 1 + 43 -99 l 1 + 43 68 l 1 + 0 54 l 1 + 0 146 l 1 + 43 159 l 1 + 43 328 l 1 + 60 328 l 1 + 60 165 l 1 + 136 186 l 1 +60 73 m 1 + 60 -94 l 1 + 136 -72 l 1 + 136 96 l 1 + 60 73 l 1 +351 186 m 1 + 351 355 l 1 + 368 355 l 1 + 368 191 l 1 + 412 205 l 1 + 412 114 l 1 + 368 100 l 1 + 368 -65 l 1 + 412 -53 l 1 + 412 -144 l 1 + 368 -157 l 1 + 368 -312 l 1 + 351 -312 l 1 + 351 -162 l 1 + 275 -184 l 1 + 275 -339 l 1 + 258 -339 l 1 + 258 -190 l 1 + 215 -203 l 1 + 215 -113 l 1 + 258 -99 l 1 + 258 68 l 1 + 215 54 l 1 + 215 146 l 1 + 258 159 l 1 + 258 328 l 1 + 275 328 l 1 + 275 165 l 1 + 351 186 l 1 +275 73 m 1 + 275 -94 l 1 + 351 -72 l 1 + 351 96 l 1 + 275 73 l 1 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uniE26A +Encoding: 57962 57962 35 +Width: 163 +Flags: HW +LayerCount: 2 +Fore +SplineSet +163 -234 m 6xa0 + 163 -247 l 6 + 163 -248 162 -251 162 -251 c 5 + 160 -251 159 -251 159 -250 c 4 + 48 -189 0 -101 0 0 c 4 + 0 102 50 189 159 249 c 5 + 159 250 l 5 + 162 250 163 248 163 246 c 4 + 163 235 l 5 + 163 235 163 230 160 227 c 4x60 + 93 178 59 111 59 0 c 4 + 59 -111 96 -177 159 -228 c 5 + 162 -229 163 -231 163 -234 c 6xa0 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uniE26B +Encoding: 57963 57963 36 +Width: 163 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 -247 m 6xa0 + 0 -234 l 6 + 0 -231 1 -229 4 -228 c 5 + 67 -177 104 -111 104 0 c 4 + 104 111 70 178 3 227 c 4 + 0 230 0 235 0 235 c 5 + 0 235 0 242 0 246 c 4 + 0 248 1 250 4 250 c 5 + 4 249 l 5x60 + 113 189 163 102 163 0 c 4 + 163 -101 115 -189 4 -250 c 4 + 4 -251 3 -251 1 -251 c 5 + 1 -251 0 -248 0 -247 c 6xa0 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uniE4C0 +Encoding: 58560 58560 37 +Width: 605 +Flags: HW +LayerCount: 2 +Fore +SplineSet +605 21 m 28,0,0 +0 0 m 21,0,0 + 0 3 3 17 4 21 c 4,0,0 + 65 327 272 320 304 320 c 4,0,0 + 333 320 542 327 604 21 c 4,0,0 + 605 17 605 3 605 0 c 5,0,0 + 573 0 l 5,0,0 + 572 1 569 22 568 25 c 4,0,0 + 558 63 516 227 303 227 c 4,0,0 + 95 227 51 68 39 27 c 4,0,0 + 38 23 33 1 33 0 c 5,0,0 + 0 0 l 21,0,0 +358 52 m 4,0,0 + 358 22 333 -3 303 -3 c 4,0,0 + 274 -3 249 22 249 52 c 4,0,0 + 249 81 274 106 303 106 c 4,0,0 + 333 106 358 81 358 52 c 4,0,0 +EndSplineSet +Validated: 33 +EndChar + +StartChar: uniE4C1 +Encoding: 58561 58561 38 +Width: 605 +Flags: HW +LayerCount: 2 +Fore +SplineSet +605 -21 m 28,0,0 +0 0 m 21,0,0 + 0 -3 3 -17 4 -21 c 4,0,0 + 65 -327 272 -320 304 -320 c 4,0,0 + 333 -320 542 -327 604 -21 c 4,0,0 + 605 -17 605 -3 605 0 c 5,0,0 + 573 0 l 5,0,0 + 572 -1 569 -22 568 -25 c 4,0,0 + 558 -63 516 -227 303 -227 c 4,0,0 + 95 -227 51 -68 39 -27 c 4,0,0 + 38 -23 33 -1 33 0 c 5,0,0 + 0 0 l 21,0,0 +358 -52 m 4,0,0 + 358 -22 333 3 303 3 c 4,0,0 + 274 3 249 -22 249 -52 c 4,0,0 + 249 -81 274 -106 303 -106 c 4,0,0 + 333 -106 358 -81 358 -52 c 4,0,0 +EndSplineSet +Validated: 41 +EndChar + +StartChar: uniE0FA +Encoding: 57594 57594 39 +Width: 405 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +198 -133 m 4 + 146.667 -133 102.333 -122.333 65 -101 c 4 + 21.6667 -77 0 -43.3333 0 0 c 132 + -3.8147e-06 43.3333 21.3333 77.3333 64 102 c 5 + 101.333 122.667 146 133 198 133 c 4 + 250.667 133 296.667 122.333 336 101 c 5 + 382 77 405 43.3333 405 0 c 4 + 405 -46 382 -80.6667 336 -104 c 4 + 299.333 -123.333 253.333 -133 198 -133 c 4 +EndSplineSet +Validated: 33 +EndChar + +StartChar: uniE240 +Encoding: 57920 57920 40 +Width: 274 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +206 -548 m 4 + 230 -514 255 -454 255 -396 c 4 + 255 -291 175 -223 87 -196 c 4 + 69 -191 40 -185 0 -178 c 5 + 0 -2 l 5 + 16 -15 34 -30 53 -47 c 4 + 57 -50 91 -82 154 -141 c 4 + 216 -199 276 -278 276 -382 c 4 + 276 -419 268 -456 253 -493 c 4 + 239 -528 231 -546 209 -572 c 5 + 203 -577 199 -579 196 -579 c 4 + 193 -579 191 -577 191 -574 c 5 + 195 -564 l 134 + 196 -561 200 -555 206 -548 c 4 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uniE241 +Encoding: 57921 57921 41 +Width: 274 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +253 493 m 4 + 269 456 276 419 276 382 c 4 + 276 337 264 293 241 250 c 4 + 221 213 192 176 154 141 c 4 + 106 95 50 41 0 2 c 5 + 0 178 l 5 + 40 185 69 191 87 196 c 4 + 175 223 255 291 255 396 c 4 + 255 454 231 514 206 548 c 4 + 201 555 194 564 191 574 c 5 + 191 577 193 579 196 579 c 4 + 199 579 203 577 209 572 c 5 + 228 549 237 529 253 493 c 4 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uniE08B +Encoding: 57483 57483 42 +Width: 2048 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +188 200 m 5 + 146 178 125 131 125 59 c 6 + 125 -60 l 6 + 125 -99 132 -130 144 -154 c 4 + 156 -178 170 -194 188 -202 c 5 + 188 200 l 5 +0 -0 m 4 + 0 127 80 220 186 246 c 5 + 186 318 l 5 + 218 318 l 5 + 212 246 l 5 + 245 246 283 246 313 235 c 132 + 367 215 415 170 415 100 c 4 + 415 84 411 70 402 57 c 4 + 393 44 382 33 370 28 c 6 + 350 20 l 5 + 327 17 l 5 + 305 19 286 25 272 38 c 4 + 258 51 251 69 246 89 c 5 + 246 127 291 169 325 169 c 4 + 337 169 344 172 344 179 c 4 + 344 185 338 191 329 197 c 4 + 310 210 282 221 250 221 c 4 + 240 221 230 220 218 216 c 5 + 218 -215 l 5 + 233 -218 230 -219 248 -219 c 4 + 305 -219 348 -168 369 -126 c 5 + 386 -87 l 5 + 389 -74 391 -62 391 -52 c 5 + 417 -52 l 5 + 411 -122 389 -173 351 -204 c 132 + 313 -235 269 -251 218 -251 c 5 + 218 -319 l 5 + 188 -319 l 5 + 188 -247 l 5 + 131 -237 66 -193 35 -138 c 132 + 28 -126 22 -112 16 -96 c 4 + 5 -67 0 -35 0 -0 c 4 +EndSplineSet +EndChar + +StartChar: uniE08A +Encoding: 57482 57482 43 +Width: 422 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +340 179 m 5 + 331 203 284 220 251 220 c 4 + 205 220 170 192 151 162 c 4 + 134 134 126 84 126 12 c 4 + 126 -53 128 -99 134 -123 c 4 + 142 -154 152 -172 174 -190 c 4 + 194 -207 217 -215 244 -215 c 4 + 298 -215 336 -179 359 -140 c 132 + 373 -115 382 -86 387 -52 c 5 + 414 -52 l 5 + 414 -115 390 -157 356 -193 c 4 + 321 -231 274 -249 216 -249 c 4 + 171 -249 133 -236 101 -210 c 4 + 44 -165 0 -80 0 16 c 4 + 0 75 33 143 68 179 c 132 + 104 216 165 251 228 251 c 4 + 264 251 321 230 349 211 c 132 + 360 203 372 194 382 181 c 4 + 401 158 409 133 409 105 c 4 + 409 54 374 17 323 17 c 4 + 280 17 247 44 247 85 c 4 + 247 111 254 120 268 136 c 4 + 283 153 300 163 326 168 c 4 + 333 170 340 175 340 179 c 5 +EndSplineSet +EndChar + +StartChar: uniE4E5 +Encoding: 58597 58597 44 +Width: 324 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +107 292 m 4 + 94 316 77 341 55 363 c 132 + 54 364 55 365 55 366 c 6 + 53 368 l 5 + 56 371 57 372 59 372 c 4 + 71 372 85 365 99 352 c 132 + 113 339 143 312 188 271 c 4 + 214 247 216 242 234 224 c 132 + 238 220 242 215 244 210 c 5 + 250 202 252 194 252 183 c 4 + 252 164 240 143 216 122 c 4 + 188 99 167 84 155 49 c 132 + 151 38 148 22 145 -1 c 5 + 158 -44 179 -84 204 -122 c 4 + 235 -169 263 -201 305 -251 c 5 + 297 -251 279 -244 251 -231 c 6 + 189 -202 l 5 + 168 -196 l 5 + 145 -195 l 5 + 120 -195 100 -205 85 -225 c 5 + 81 -239 l 5 + 80 -251 l 5 + 80 -284 100 -307 119 -329 c 132 + 127 -338 136 -347 145 -355 c 4 + 162 -370 172 -379 173 -385 c 5 + 170 -388 l 5 + 159 -383 151 -378 145 -373 c 5 + 136 -370 108 -352 100 -347 c 4 + 76 -333 55 -315 37 -296 c 4 + 18 -275 0 -252 -0 -225 c 4 + 0 -162 27 -130 80 -130 c 4 + 121 -130 166 -148 216 -182 c 5 + 197 -156 179 -134 161 -116 c 4 + 138 -93 113 -72 88 -51 c 4 + 60 -28 41 -11 30 2 c 132 + 19 15 13 28 12 41 c 5 + 87 105 125 166 125 224 c 4 + 125 251 118 272 107 292 c 4 +EndSplineSet +EndChar + +StartChar: uniE4E6 +Encoding: 58598 58598 45 +Width: 290 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 123 m 5 + 7 157 33 179 69 183 c 5 + 98 180 112 174 122 154 c 132 + 126 146 129 139 132 132 c 5 + 132 111 131 107 121 97 c 5 + 116 89 103 83 81 77 c 5 + 93 74 l 5 + 108 73 l 5 + 152 73 205 99 230 129 c 132 + 240 140 248 155 254 171 c 5 + 261 172 269 173 276 174 c 5 + 136 -250 l 5 + 100 -250 l 5 + 211 80 l 5 + 201 74 184 68 158 64 c 6 + 106 56 l 5 + 96 56 l 5 + 76 57 l 6 + 75 57 68 60 55 63 c 4 + 18 72 0 91 0 123 c 5 +EndSplineSet +EndChar + +StartChar: uniE4E7 +Encoding: 58599 58599 46 +Width: 376 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +133 -111 m 5 + 117 -73 112 -68 69 -60 c 5 + 32 -64 9 -85 1 -120 c 5 + 1 -152 19 -172 56 -178 c 5 + 64 -184 78 -188 99 -188 c 4 + 130 -188 161 -181 181 -168 c 5 + 73 -492 l 5 + 110 -492 l 5 + 182 -272 253 -53 325 167 c 5 + 321 167 l 5 + 311 165 l 5 + 304 164 l 5 + 289 129 277 112 245 93 c 132 + 219 78 189 66 157 64 c 4 + 146 64 137 66 131 70 c 5 + 160 73 187 95 182 126 c 5 + 167 161 163 168 118 174 c 5 + 80 170 58 151 50 116 c 5 + 50 84 68 64 105 57 c 5 + 112 52 127 49 150 49 c 4 + 198 49 226 56 262 74 c 5 + 196 -123 l 5 + 175 -146 146 -170 106 -170 c 4 + 99 -170 91 -169 81 -166 c 5 + 112 -161 133 -144 133 -111 c 5 +EndSplineSet +EndChar + +StartChar: uniE4E8 +Encoding: 58600 58600 47 +Width: 466 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +148 179 m 4 + 111 179 88 155 80 121 c 5 + 80 89 98 69 134 60 c 5 + 146 54 162 51 180 51 c 4 + 213 51 239 60 261 72 c 5 + 200 -115 l 6 + 197 -121 188 -129 170 -141 c 4 + 148 -156 127 -163 109 -163 c 4 + 99 -163 90 -162 84 -159 c 5 + 108 -153 124 -144 131 -133 c 4 + 134 -128 135 -118 135 -104 c 5 + 128 -84 120 -70 110 -64 c 4 + 105 -61 92 -58 72 -54 c 5 + 35 -58 12 -77 4 -112 c 5 + 4 -150 24 -165 59 -173 c 5 + 71 -179 89 -182 111 -182 c 4 + 141 -182 165 -176 182 -165 c 5 + 200 -115 l 5 + 77 -485 l 5 + 114 -485 l 5 + 402 404 l 5 + 398 405 l 5 + 380 403 l 5 + 368 354 326 326 279 311 c 132 + 263 306 248 303 234 303 c 4 + 223 303 215 305 210 309 c 5 + 244 317 261 327 261 364 c 5 + 253 392 233 413 200 413 c 4 + 161 413 137 387 128 354 c 5 + 128 321 147 302 184 295 c 5 + 190 292 197 290 207 289 c 134 + 235 287 l 5 + 250 287 l 134 + 256 287 267 291 285 295 c 4 + 307 300 328 301 340 312 c 5 + 274 114 l 5 + 257 94 221 69 186 69 c 4 + 178 69 170 71 162 74 c 5 + 185 80 197 87 201 92 c 4 + 207 101 211 111 211 122 c 4 + 211 155 182 179 148 179 c 4 +EndSplineSet +EndChar + +StartChar: uniE4E9 +Encoding: 58601 58601 48 +Width: 553 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +191 -247 m 5 + 252 -63 l 5 + 191 -247 l 5 +273 652 m 4 + 240 652 207 627 207 594 c 4 + 207 562 225 542 261 534 c 5 + 272 527 288 526 306 526 c 4 + 337 526 399 540 418 550 c 5 + 356 359 l 5 + 332 334 306 309 265 309 c 4 + 257 309 250 310 242 312 c 5 + 275 323 290 330 290 367 c 5 + 277 405 271 412 226 417 c 5 + 190 413 167 394 157 359 c 5 + 157 325 176 305 213 298 c 5 + 222 294 236 291 254 291 c 4 + 282 291 310 297 338 309 c 5 + 277 122 l 5 + 253 98 227 78 188 76 c 4 + 179 76 171 76 163 79 c 5 + 186 87 202 95 208 104 c 4 + 212 109 213 119 213 134 c 5 + 201 171 191 177 150 185 c 5 + 111 180 82 160 82 125 c 4 + 82 94 101 76 135 67 c 4 + 150 63 163 58 184 58 c 4 + 219 58 236 63 262 77 c 5 + 199 -112 l 5 + 169 -143 139 -158 109 -158 c 4 + 102 -158 94 -156 86 -153 c 5 + 121 -142 137 -136 137 -97 c 5 + 124 -61 114 -56 73 -48 c 5 + 34 -52 5 -72 5 -109 c 4 + 5 -143 30 -161 60 -167 c 5 + 69 -172 83 -174 103 -174 c 4 + 140 -174 160 -169 187 -155 c 5 + 149 -261 115 -371 79 -479 c 5 + 113 -479 l 5 + 160 -340 206 -202 252 -63 c 4 + 329 173 405 410 483 645 c 5 + 476 646 l 5 + 469 642 l 5 + 463 642 l 5 + 449 610 428 585 400 569 c 132 + 372 553 343 544 315 543 c 5 + 301 544 l 5 + 299 545 297 546 295 546 c 132 + 293 546 291 547 288 548 c 5 + 325 556 337 566 338 605 c 5 + 329 637 313 652 273 652 c 4 +EndSplineSet +EndChar + +StartChar: uniE4EA +Encoding: 58602 58602 49 +Width: 663 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +379 567 m 5 + 408 572 431 589 431 621 c 4 + 431 657 400 674 365 677 c 5 + 326 671 302 650 294 614 c 5 + 294 582 313 562 350 553 c 5 + 364 546 372 546 394 546 c 4 + 431 546 487 559 513 570 c 5 + 448 372 l 5 + 424 345 397 320 356 320 c 4 + 347 320 338 321 327 325 c 5 + 365 333 381 342 381 382 c 5 + 368 418 355 427 315 435 c 5 + 276 428 252 407 244 373 c 5 + 244 341 263 320 301 311 c 5 + 319 304 l 6 + 324 303 336 303 352 303 c 4 + 391 303 409 307 431 323 c 5 + 367 129 l 5 + 350 107 310 80 273 79 c 4 + 265 79 256 81 248 84 c 5 + 284 91 301 104 301 142 c 5 + 288 180 279 185 236 193 c 5 + 194 188 176 168 165 132 c 5 + 165 100 184 79 222 70 c 5 + 231 66 258 63 271 62 c 4 + 308 62 327 67 350 83 c 5 + 288 -114 l 5 + 261 -140 235 -160 195 -162 c 4 + 186 -162 176 -158 169 -156 c 5 + 204 -147 222 -138 222 -99 c 5 + 207 -61 202 -52 156 -47 c 5 + 118 -52 96 -75 88 -110 c 5 + 88 -142 106 -162 142 -170 c 5 + 155 -177 171 -179 194 -179 c 4 + 226 -179 251 -171 272 -157 c 5 + 207 -353 l 5 + 183 -379 156 -399 116 -401 c 4 + 106 -401 98 -401 91 -398 c 5 + 127 -386 142 -380 144 -341 c 5 + 134 -303 118 -294 77 -288 c 5 + 38 -294 15 -315 7 -350 c 5 + 7 -383 26 -404 65 -412 c 5 + 82 -418 l 6 + 84 -419 90 -418 100 -418 c 4 + 134 -418 171 -412 193 -399 c 5 + 156 -510 120 -622 84 -734 c 5 + 119 -734 l 5 + 245 -350 372 34 497 419 c 5 + 579 666 l 5 + 573 666 l 5 + 564 664 l 5 + 556 664 l 5 + 547 630 523 606 495 590 c 4 + 463 572 434 562 406 562 c 4 + 394 562 392 564 379 567 c 5 +EndSplineSet +EndChar + +StartChar: uniE880 +Encoding: 59520 59520 50 +Width: 243 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +166 326 m 4 + 213 326 243 283 243 236 c 4 + 243 124 175 0 79 0 c 4 + 29 0 0 43 0 93 c 4 + 0 145 14 195 43 242 c 4 + 71 288 104 326 166 326 c 4 +191 268 m 4 + 191 289 181 302 166 307 c 5 + 133 307 105 271 81 200 c 4 + 62 143 52 96 52 57 c 5 + 54 43 l 5 + 57 38 57 35 61 31 c 4 + 66 24 72 19 81 19 c 4 + 111 19 143 53 163 126 c 6 + 184 204 l 5 + 189 225 191 247 191 268 c 4 +EndSplineSet +EndChar + +StartChar: uniE881 +Encoding: 59521 59521 51 +Width: 207 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +207 311 m 5 + 122 36 l 5 + 118 30 129 25 135 23 c 5 + 153 21 l 5 + 164 21 l 5 + 158 0 l 5 + 0 0 l 5 + 6 21 l 5 + 21 21 l 6 + 28 21 35 23 42 26 c 5 + 51 27 58 34 62 46 c 6 + 117 222 l 5 + 46 166 l 5 + 36 176 l 5 + 145 311 l 5 + 207 311 l 5 +EndSplineSet +EndChar + +StartChar: uniE882 +Encoding: 59522 59522 52 +Width: 260 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +166 311 m 4 + 226 311 260 290 260 231 c 4 + 260 204 248 180 220 167 c 6 + 150 135 l 5 + 113 125 81 105 54 75 c 5 + 75 75 l 5 + 101 73 l 5 + 113 67 l 5 + 127 61 141 56 155 50 c 4 + 161 47 168 46 176 46 c 5 + 191 50 l 5 + 202 58 l 5 + 207 63 213 71 221 84 c 5 + 238 75 l 5 + 222 47 l 6 + 220 43 206 19 202 16 c 5 + 183 -5 164 -15 145 -15 c 6 + 135 -15 l 5 + 122 -9 110 -3 99 5 c 6 + 84 16 l 5 + 72 23 61 26 52 26 c 5 + 42 23 33 18 28 9 c 6 + 23 0 l 5 + 0 0 l 5 + 0 27 6 51 20 72 c 4 + 27 82 34 88 39 93 c 6 + 67 118 l 5 + 87 129 107 140 126 151 c 5 + 145 160 l 6 + 161 167 174 178 184 190 c 4 + 196 205 203 220 203 235 c 5 + 204 247 l 5 + 204 260 200 271 192 278 c 5 + 186 287 177 292 164 292 c 4 + 135 292 118 277 112 248 c 5 + 115 236 l 5 + 117 220 l 5 + 117 200 109 191 92 191 c 4 + 78 191 66 204 66 219 c 4 + 66 267 118 311 166 311 c 4 +EndSplineSet +EndChar + +StartChar: uniE883 +Encoding: 59523 59523 53 +Width: 255 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +161 326 m 4 + 213 326 255 309 255 258 c 4 + 255 208 215 182 173 164 c 5 + 199 143 212 122 212 100 c 4 + 212 48 156 0 94 0 c 6 + 82 0 l 6 + 42 0 0 23 0 56 c 4 + 0 86 12 105 37 105 c 4 + 54 105 68 89 71 74 c 5 + 71 69 67 62 60 53 c 5 + 53 48 47 43 47 32 c 5 + 58 23 l 5 + 75 19 l 5 + 96 19 115 31 131 56 c 4 + 144 77 150 101 150 126 c 5 + 141 156 122 161 84 161 c 5 + 90 184 l 5 + 124 184 150 188 167 197 c 4 + 187 208 197 232 197 267 c 4 + 197 295 185 305 158 307 c 5 + 138 304 l 5 + 130 301 126 295 126 288 c 5 + 128 281 130 277 131 274 c 6 + 135 263 l 5 + 138 253 l 5 + 135 241 l 5 + 130 235 124 230 115 228 c 4 + 97 224 79 238 79 255 c 4 + 79 294 122 326 161 326 c 4 +EndSplineSet +EndChar + +StartChar: uniE884 +Encoding: 59524 59524 54 +Width: 259 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +259 110 m 5 + 253 89 l 5 + 194 89 l 5 + 178 37 l 6 + 175 31 178 26 187 23 c 5 + 221 21 l 5 + 215 0 l 5 + 60 0 l 5 + 66 21 l 5 + 84 22 l 5 + 99 26 l 6 + 108 29 115 37 119 49 c 6 + 132 89 l 5 + 0 89 l 5 + 5 110 l 5 + 17 120 31 132 44 149 c 6 + 77 192 l 6 + 90 210 104 233 117 260 c 4 + 124 277 131 294 138 311 c 5 + 235 311 l 5 + 199 262 l 6 + 186 246 166 228 150 213 c 4 + 114 178 74 146 35 113 c 5 + 143 110 l 5 + 163 182 l 5 + 243 259 l 5 + 248 259 l 5 + 204 110 l 5 + 259 110 l 5 +EndSplineSet +EndChar + +StartChar: uniE885 +Encoding: 59525 59525 55 +Width: 240 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +84 0 m 4 + 35 0 0 18 0 66 c 5 + 1 80 l 5 + 3 85 5 89 8 94 c 5 + 15 101 24 105 35 108 c 5 + 42 108 48 105 54 99 c 5 + 58 90 l 5 + 60 79 l 5 + 56 66 l 5 + 53 61 53 60 48 55 c 5 + 41 39 l 5 + 41 31 44 26 51 23 c 6 + 64 19 l 5 + 79 19 l 6 + 101 19 121 34 138 64 c 4 + 153 91 161 116 161 139 c 5 + 158 152 l 6 + 156 160 145 169 137 172 c 6 + 122 176 l 5 + 105 175 l 5 + 89 172 l 5 + 72 162 l 5 + 49 144 l 5 + 28 144 l 5 + 90 326 l 5 + 99 323 115 320 125 317 c 5 + 158 314 l 5 + 168 314 l 5 + 191 317 l 5 + 240 326 l 5 + 221 299 187 268 151 268 c 6 + 141 268 l 5 + 119 270 l 5 + 110 273 102 277 93 281 c 5 + 57 173 l 5 + 75 185 l 5 + 95 194 l 5 + 117 199 l 5 + 143 202 l 6 + 152 202 162 201 173 197 c 4 + 187 192 187 191 197 180 c 4 + 211 165 219 147 219 122 c 4 + 219 90 206 60 178 35 c 4 + 150 11 118 0 84 0 c 4 +EndSplineSet +EndChar + +StartChar: uniE886 +Encoding: 59526 59526 56 +Width: 214 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +154 326 m 4 + 189 326 211 310 214 277 c 4 + 214 270 213 264 212 261 c 6 + 204 247 l 6 + 200 240 191 235 176 232 c 5 + 163 233 l 5 + 151 240 l 5 + 147 244 144 251 145 260 c 6 + 146 271 l 5 + 154 281 l 5 + 171 297 l 5 + 169 304 162 307 151 307 c 4 + 121 307 98 282 82 233 c 5 + 73 202 l 5 + 67 166 l 5 + 92 187 109 200 150 200 c 4 + 178 200 206 171 206 139 c 4 + 206 74 161 0 88 0 c 4 + 19 0 0 38 0 108 c 6 + 0 126 l 134 + 0 132 1 139 3 146 c 5 + 3 167 5 166 12 185 c 4 + 29 235 57 280 95 305 c 4 + 115 318 134 326 154 326 c 4 +58 58 m 4 + 58 34 63 19 85 19 c 4 + 103 19 120 34 133 66 c 4 + 143 91 149 108 149 138 c 5 + 146 148 l 5 + 140 160 l 5 + 134 167 126 172 114 172 c 4 + 103 172 90 161 77 139 c 5 + 63 99 l 5 + 60 84 58 71 58 58 c 4 +EndSplineSet +EndChar + +StartChar: uniE887 +Encoding: 59527 59527 57 +Width: 243 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +243 311 m 5 + 240 286 233 264 225 244 c 4 + 216 221 197 186 168 139 c 5 + 151 104 l 5 + 138 69 l 5 + 133 50 128 24 128 0 c 5 + 28 0 l 5 + 30 15 38 33 52 54 c 4 + 71 84 109 130 138 159 c 4 + 168 190 191 221 208 263 c 5 + 206 265 l 5 + 190 249 175 239 163 233 c 4 + 156 230 151 228 140 228 c 6 + 132 228 l 5 + 105 244 l 6 + 96 249 86 252 75 252 c 4 + 70 252 63 251 58 246 c 6 + 42 232 l 5 + 35 221 28 207 21 190 c 5 + 0 190 l 5 + 38 311 l 5 + 58 311 l 5 + 53 302 50 295 50 290 c 4 + 50 286 51 283 52 282 c 6 + 61 276 l 5 + 85 296 l 6 + 95 304 109 311 125 311 c 4 + 136 311 154 299 158 290 c 5 + 169 281 180 275 191 276 c 6 + 204 277 l 5 + 213 284 l 6 + 217 288 221 303 224 311 c 5 + 243 311 l 5 +EndSplineSet +EndChar + +StartChar: uniE888 +Encoding: 59528 59528 58 +Width: 274 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +61 247 m 5 + 61 298 118 326 169 326 c 4 + 202 326 221 314 241 299 c 4 + 252 290 260 279 265 268 c 4 + 270 256 274 244 274 231 c 4 + 274 220 270 210 261 199 c 132 + 252 188 234 176 205 162 c 5 + 219 142 l 5 + 229 126 l 6 + 233 118 235 112 236 108 c 6 + 239 89 l 5 + 239 27 181 0 115 0 c 4 + 57 0 0 33 0 87 c 4 + 0 135 48 159 89 175 c 5 + 79 189 74 193 68 210 c 6 + 62 228 l 5 + 61 247 l 5 +192 174 m 5 + 219 190 232 213 236 247 c 4 + 236 254 234 260 232 266 c 4 + 229 273 225 279 220 285 c 4 + 208 299 194 307 176 307 c 4 + 149 307 126 294 126 270 c 4 + 126 249 137 226 160 204 c 6 + 192 174 l 5 +175 62 m 5 + 175 79 166 88 156 104 c 4 + 155 105 153 108 149 112 c 132 + 133 128 117 145 101 162 c 5 + 76 145 l 5 + 58 129 l 5 + 46 108 l 5 + 43 101 42 91 42 80 c 4 + 42 63 50 48 65 35 c 5 + 89 23 l 6 + 96 20 105 19 115 19 c 4 + 136 19 150 24 161 31 c 4 + 170 37 176 45 176 56 c 5 + 175 62 l 5 +EndSplineSet +EndChar + +StartChar: uniE889 +Encoding: 59529 59529 59 +Width: 225 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +131 326 m 4 + 192 326 225 281 225 215 c 4 + 225 190 221 168 214 146 c 4 + 207 124 196 102 182 80 c 4 + 150 32 112 -1 62 -1 c 4 + 30 -1 2 24 0 59 c 5 + 0 67 l 5 + 4 80 13 89 27 89 c 4 + 34 89 40 86 45 81 c 5 + 48 80 51 73 53 62 c 5 + 50 47 39 19 61 19 c 4 + 81 19 101 37 122 73 c 5 + 136 108 l 5 + 141 117 148 142 151 152 c 5 + 127 139 l 5 + 114 131 l 5 + 101 126 93 123 77 123 c 4 + 34 123 8 152 8 195 c 4 + 8 228 19 258 40 285 c 132 + 61 312 92 326 131 326 c 4 +167 264 m 4 + 167 286 158 302 140 307 c 5 + 119 307 102 295 88 271 c 132 + 74 247 67 223 66 200 c 4 + 66 171 72 157 97 152 c 4 + 123 147 151 190 161 224 c 132 + 164 236 166 249 167 264 c 4 +EndSplineSet +EndChar + +StartChar: uniE566 +Encoding: 58726 58726 60 +Width: 240 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +18 208 m 4 + 18 181 35 161 63 161 c 5 + 66 159 l 5 + 79 163 l 5 + 102 172 l 5 + 116 227 l 5 + 99 242 81 249 61 249 c 4 + 35 249 18 232 18 208 c 4 +432 225 m 4 + 432 204 421 189 401 188 c 4 + 386 188 381 198 378 213 c 5 + 381 227 l 5 + 383 238 l 5 + 384 247 l 5 + 380 251 l 5 + 379 250 378 250 377 250 c 4 + 354 237 341 226 330 202 c 6 + 318 175 l 5 + 300 125 287 70 271 18 c 5 + 211 18 l 5 + 269 232 l 5 + 269 239 266 237 264 241 c 5 + 257 241 239 233 213 213 c 6 + 170 180 l 5 + 175 186 l 5 + 196 151 207 118 207 88 c 4 + 207 76 206 67 203 60 c 134 + 197 45 l 134 + 196 42 192 35 185 26 c 4 + 171 8 155 0 136 0 c 4 + 106 0 69 18 69 52 c 4 + 70 53 70 58 72 67 c 6 + 92 151 l 5 + 83 146 71 143 56 143 c 4 + 35 143 27 150 16 162 c 4 + 6 174 0 189 0 209 c 4 + 0 232 6 242 17 254 c 4 + 28 266 42 272 63 272 c 4 + 82 272 102 264 123 247 c 5 + 157 364 l 5 + 220 364 l 5 + 174 206 l 5 + 212 237 l 5 + 244 257 l 5 + 265 267 279 270 306 272 c 4 + 322 272 330 265 330 251 c 5 + 329 241 l 5 + 327 233 325 225 323 217 c 5 + 344 254 367 272 393 272 c 4 + 416 272 432 249 432 225 c 4 +162 167 m 5 + 126 52 l 5 + 125 42 l 6 + 125 32 130 26 141 23 c 5 + 173 41 189 66 189 98 c 4 + 189 118 180 141 162 167 c 5 +EndSplineSet +EndChar + +StartChar: uniE56C +Encoding: 58732 58732 61 +Width: 605 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 21 m 1 + 0 80 l 1 + 129 230 l 1 + 146 240 l 1 + 153 240 157 238 158 234 c 1 + 264 141 l 1 + 281 131 l 1 + 293 137 l 1 + 373 230 l 1 + 391 240 l 1 + 396 240 400 238 403 234 c 1 + 508 141 l 1 + 517 134 l 1 + 525 129 l 1 + 530 130 534 133 537 137 c 2 + 605 217 l 1 + 605 158 l 1 + 477 8 l 1 + 468 1 461 -2 457 -2 c 0 + 454 -2 450 0 447 4 c 1 + 342 98 l 2 + 336 103 329 105 322 105 c 0 + 318 105 315 104 313 102 c 2 + 232 8 l 1 + 225 1 218 -2 213 -2 c 0 + 210 -2 206 0 203 4 c 1 + 98 98 l 2 + 92 104 85 107 78 107 c 0 + 75 107 71 105 68 102 c 2 + 0 21 l 1 +EndSplineSet +EndChar + +StartChar: uniE56D +Encoding: 58733 58733 62 +Width: 587 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 21 m 1 + 0 80 l 1 + 121 223 l 2 + 125 227 129 230 132 232 c 128 + 135 234 139 235 143 236 c 1 + 148 236 156 230 168 219 c 2 + 275 125 l 1 + 275 309 l 1 + 305 309 l 1 + 305 150 l 1 + 363 219 l 2 + 374 232 382 239 386 239 c 1 + 410 223 l 1 + 494 148 l 1 + 525 123 l 1 + 528 124 532 128 538 135 c 2 + 552 150 l 1 + 586 194 l 1 + 586 139 l 1 + 480 14 l 1 + 472 3 464 -2 457 -2 c 1 + 454 -1 452 1 450 2 c 0 + 444 6 438 11 432 16 c 2 + 354 86 l 1 + 340 100 329 107 320 107 c 1 + 315 105 l 1 + 310 100 l 1 + 305 94 l 1 + 305 -90 l 1 + 275 -90 l 1 + 275 59 l 1 + 239 14 l 1 + 229 3 221 -2 215 -2 c 1 + 208 0 l 1 + 198 8 l 1 + 188 16 l 1 + 100 96 l 2 + 93 103 86 107 80 109 c 1 + 77 109 71 105 63 96 c 2 + 0 21 l 1 +EndSplineSet +EndChar + +StartChar: uniE004 +Encoding: 57348 57348 63 +Width: 399 +VWidth: 0 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 0 m 5 + 49 0 97.5 2.26367 135.5 -4.73633 c 5 + 341.5 -99.7363 394 -269 399 -276 c 5 + 399 -277 385 -283 384 -282 c 5 + 296 -128 133 -115 63 -112 c 5 + 62 -112 0 -111 0 -111 c 5 + 0 -74 0 -37 0 0 c 5 +EndSplineSet +EndChar + +StartChar: uniE003 +Encoding: 57347 57347 64 +Width: 399 +VWidth: 0 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 -0 m 5 + 49 -0 97.5 -2.26367 135.5 4.73633 c 5 + 341.5 99.7363 394 269 399 276 c 5 + 399 277 385 283 384 282 c 5 + 296 128 133 115 63 112 c 5 + 62 112 0 111 0 111 c 5 + -0 74 0 37 0 -0 c 5 +EndSplineSet +EndChar + +StartChar: uniE88A +Encoding: 59530 59530 65 +Width: 144 +VWidth: 2048 +Flags: HMW +LayerCount: 2 +Fore +SplineSet +17 87 m 0 + 17 98 20 106 27 113 c 0 + 34 120 43 123 54 123 c 0 + 65 123 73 120 80 113 c 0 + 87 106 91 97 91 87 c 0 + 91 77 87 68 80 60 c 1 + 73 53 63 50 53 50 c 0 + 43 50 34 53 27 60 c 0 + 20 67 17 76 17 87 c 0 +53 207 m 4 + 53 218 57 227 64 234 c 0 + 71 241 81 244 91 244 c 0 + 101 244 110 240 117 233 c 0 + 124 226 127 217 127 207 c 0 + 127 197 123 188 116 181 c 0 + 109 174 100 171 90 171 c 0 + 80 171 71 174 64 181 c 0 + 57 188 53 196 53 207 c 4 +EndSplineSet +EndChar + +StartChar: uniE522 +Encoding: 58658 58658 66 +Width: 232 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +-91 -179 m 1 + -93 -181.667 -93.667 -184 -93 -186 c 128 + -92.333 -188 -88.667 -189.333 -82 -190 c 1 + -63.333 -190 -47.667 -176.333 -35 -149 c 0 + -28.333 -135 -21.667 -119 -15 -101 c 128 + -8.33301 -83 -3.33301 -65.667 0 -49 c 2 + 14 12 l 1 + 58 220 l 1 + 0 220 l 5 + 0 258 l 1 + 70 258 l 1 + 77.333 278.667 83.333 294.333 88 305 c 0 + 95.333 323 102.667 337.667 110 349 c 0 + 130.666 379 152.333 402 175 418 c 128 + 197.667 434 222.667 442 250 442 c 0 + 259.333 442 267 441 273 439 c 128 + 279 437 285.333 431.667 292 423 c 0 + 296.667 416.333 299.667 410 301 404 c 2 + 305 388 l 1 + 305 373.333 304.333 362.666 303 356 c 128 + 301.667 349.333 298 340 292 328 c 0 + 289.333 322 283.333 315 274 307 c 0 + 270 303.667 265.667 301.667 261 301 c 128 + 256.333 300.333 250.667 300.333 244 301 c 1 + 238 302.333 233.667 306 231 312 c 128 + 228.333 318 226.333 324.667 225 332 c 1 + 225 344 227.333 354.667 232 364 c 128 + 236.667 373.333 244 381.333 254 388 c 0 + 261 393 261 393 268 398 c 1 + 268 406.667 262 412 250 414 c 1 + 236.667 415.33 225.333 412.663 216 406 c 128 + 206.667 399.333 197 385 187 363 c 1 + 182.333 351 176.667 333.333 170 310 c 128 + 163.333 286.667 158.667 270 156 260 c 1 + 233 260 l 1 + 233 220 l 1 + 148 220 l 1 + 136 151.333 119 82.667 97 14 c 0 + 79 -41.333 61.667 -85 45 -117 c 0 + 31.667 -143 18 -164 4 -180 c 0 + -20.667 -208.667 -46 -223 -72 -223 c 0 + -96.666 -223 -115.333 -213.333 -128 -194 c 0 + -138 -178.667 -143 -160.667 -143 -140 c 0 + -143 -123.333 -139 -107.333 -131 -92 c 1 + -126.333 -84.667 -120.667 -79 -114 -75 c 128 + -107.333 -71 -100.667 -69 -94 -69 c 0 + -85.333 -69 -78.333 -73 -73 -81 c 128 + -67.667 -89 -64 -96.333 -62 -103 c 128 + -60 -109.667 -59 -115.333 -59 -120 c 0 + -59 -129.333 -61.333 -137.333 -66 -144 c 128 + -70.6641 -150.667 -75.3301 -157.667 -80 -165 c 128 + -84.6641 -172.333 -88.3301 -177 -91 -179 c 1 +EndSplineSet +EndChar + +StartChar: uniE521 +Encoding: 58657 58657 67 +Width: 405 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +337 262 m 0 + 358 262 380 248 380 227 c 2 + 380 220 l 1 + 317 37 l 1 + 317 24 321 17 329 16 c 1 + 337 16 346 21 355 31 c 128 + 364 41 370 47 371 48 c 0 + 375 55 389.633 79.6631 391 83 c 2 + 405 124 l 1 + 428 124 l 1 + 404 61 l 2 + 395.696 39.2031 373 16 360 3 c 128 + 347 -10 331 -17 314 -18 c 0 + 296 -18 280 -13 265 -4 c 1 + 249 11 l 1 + 246 18 244 23 244 28 c 1 + 264 91 288 152 309 214 c 1 + 309 221 304 226 294 227 c 1 + 278 227 263 212 250 182 c 1 + 186 0 l 1 + 115 0 l 1 + 192 214 l 1 + 192 223 186 227 175 227 c 0 + 166 227 158 223 153 216 c 128 + 148 209 141 197 133 182 c 1 + 69 0 l 1 + 0 0 l 1 + 77 210 l 1 + 77 214 l 2 + 77 224 72 226 65 230 c 1 + 40 230 13 183 -1 157 c 0 + -6 148 -13 134 -22 115 c 1 + -44 115 l 1 + -25 154 -4 191 20 222 c 0 + 41 249 67 262 99 262 c 0 + 120 262 130 243 133 221 c 1 + 152 238 167 248 178 253 c 1 + 189 259 202 262 217 262 c 0 + 238 262 249 243 252 221 c 1 + 274 238 301 262 337 262 c 0 +EndSplineSet +EndChar + +StartChar: uniE520 +Encoding: 58656 58656 68 +Width: 306 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +23 124 m 5 + 0 124 l 1 + 22 166.667 42.667 200.333 62 225 c 128 + 81.333 249.667 106.667 262.333 138 263 c 0 + 144 263 150 258.667 156 250 c 1 + 162.667 243.333 166 234.333 166 223 c 1 + 190 237 l 1 + 215 250 l 1 + 227 254.667 239.333 257 252 257 c 0 + 276 257 295.333 247.667 310 229 c 128 + 324.667 210.333 332.333 184.667 333 152 c 0 + 333 138 332 125.333 330 114 c 128 + 328 102.667 324.667 93 320 85 c 128 + 315.333 77 309 68 301 58 c 0 + 287 40 271.333 26 254 16 c 128 + 236.667 6 218.667 1 200 1 c 0 + 191.333 1 180.333 4.33301 167 11 c 0 + 161.667 14.333 156.667 17.667 152 21 c 128 + 147.333 24.333 143 29 139 35 c 1 + 83 -123 l 1 + 80 -127 l 1 + 82.667 -133.667 86.667 -137.333 92 -138 c 1 + 124 -138 l 1 + 124 -167 l 1 + -49 -167 l 1 + -49 -138 l 1 + -28 -138 l 2 + -24 -138 -19.333 -136.333 -14 -133 c 1 + -10 -129 -7 -124.333 -5 -119 c 2 + 114 212 l 1 + 114 218 l 1 + 111 228 l 1 + 105 231 l 1 + 96.333 231 88 227 80 219 c 128 + 72 211 64.333 200.667 57 188 c 1 + 46 171 l 1 + 36 151 l 1 + 23 124 l 5 +197 201 m 0 + 185 180.333 175.333 156.333 168 129 c 1 + 161.333 99 158 78.333 158 67 c 0 + 158 43 165.333 31 180 31 c 0 + 192.667 31 203 33.333 211 38 c 128 + 219 42.667 226 49.333 232 58 c 1 + 242 74.667 247.333 84 248 86 c 0 + 252.667 97.333 256 112 258 130 c 128 + 260 148 261.333 161 262 169 c 0 + 262 176.333 261.333 182.333 260 187 c 128 + 258.667 191.667 256.667 196.334 254 201 c 0 + 248.667 210.333 239.333 215 226 215 c 0 + 212 215 202.333 210.333 197 201 c 0 +EndSplineSet +EndChar + +StartChar: uniE523 +Encoding: 58659 58659 69 +Width: 225 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +194 174 m 0 + 180 174 171 186 171 203 c 1 + 172 214 l 1 + 175 226 l 1 + 175 231 172 233 167 233 c 0 + 154 233 141 223 129 202 c 1 + 113 170 l 1 + 92 116 78 57 60 0 c 1 + 0 0 l 1 + 57 194 l 1 + 57 199 l 2 + 57 210 54 215 49 215 c 0 + 34 215 29 206 19 194 c 0 + 10 183 2 171 -6 158 c 1 + -20 166 l 1 + -14 181 -4 191 8 204 c 0 + 27 223 58 252 91 252 c 0 + 106 252 113 243 113 224 c 0 + 112 217 112 210 111 203 c 1 + 127 227 150 259 185 259 c 0 + 206 259 225 240 225 219 c 0 + 225 189 215 174 194 174 c 0 +EndSplineSet +EndChar + +StartChar: uniE524 +Encoding: 58660 58660 70 +Width: 194 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +81 33 m 2 + 102 33 119 48 121 67 c 0 + 121 74 118 82 113 89 c 0 + 110 94 104 100 94 107 c 0 + 72 120 56 133 47 145 c 128 + 38 157 33 171 32 188 c 0 + 32 238 72 270 119 270 c 1 + 147 267 l 1 + 156 264 164 260 171 254 c 1 + 186 245 194 230 194 211 c 1 + 193 201 l 1 + 187 191 l 2 + 184 186 179 182 170 181 c 1 + 153 181 144 189 141 205 c 1 + 145 224 l 1 + 145 234 131 240 121 242 c 0 + 102 245 89 226 86 206 c 1 + 86 199 90 191 97 184 c 1 + 106 177 115 170 123 163 c 0 + 151 140 166 126 167 123 c 1 + 175 113 179 100 179 84 c 2 + 179 74 l 2 + 179 53 169 35 150 20 c 1 + 134 10 112 2 89 0 c 1 + 42 0 0 26 0 67 c 1 + 1 82 l 1 + 6 95 l 1 + 16 104 l 1 + 29 108 l 1 + 45 108 53 98 53 77 c 0 + 53 64 48 61 45 49 c 1 + 45 41 56 33 68 33 c 130 + 81 33 l 2 +EndSplineSet +EndChar + +StartChar: uniE525 +Encoding: 58661 58661 71 +Width: 260 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +173 115 m 0 + 194 115 207 92 207 67 c 0 + 207 44 199 25 183 9 c 1 + 168 -8 144 -16 110 -16 c 0 + 98 -16 89 -15 83 -12 c 2 + 71 -6 l 1 + 54 4 l 1 + 39 11 30 14 25 14 c 0 + 16 14 6 9 -5 0 c 1 + -36 0 l 1 + -36 16 l 1 + 173 193 l 1 + 109 192 l 1 + 86 189 77 177 65 162 c 1 + 41 162 l 1 + 71 249 l 1 + 260 249 l 1 + 260 217 l 1 + 49 54 l 1 + 62 60 75 63 88 63 c 0 + 102 63 141 45 151 43 c 1 + 160 44 165 51 165 62 c 1 + 152 62 145 70 143 85 c 1 + 143 102 156 115 173 115 c 0 +EndSplineSet +EndChar + +StartChar: uniE650 +Encoding: 58960 58960 72 +Width: 695 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +657 134 m 0 + 657 99.333 644.667 68.333 620 41 c 128 + 595.333 13.667 566.333 0 533 0 c 2 + 519 0 l 1 + 513 8 508.333 13.667 505 17 c 0 + 493.667 29 484 35 476 35 c 0 + 461.333 35 448.667 31.667 438 25 c 1 + 424.667 14.333 414 6 406 0 c 1 + 340 0 l 1 + 300 47 l 1 + 267 0 l 1 + 190 0 l 1 + 184.667 19.333 180.333 33.333 177 42 c 0 + 171 58 162 65.333 150 64 c 0 + 133.333 62 117 52 101 34 c 0 + 91.667 22.667 82 11.333 72 0 c 1 + 38 0 l 1 + 38 29.333 72.333 67 141 113 c 0 + 173.667 135 190 159 190 185 c 0 + 190.002 202.333 179.335 226 158 256 c 128 + 136.667 286 125.667 321.333 125 362 c 0 + 125 376.667 126 392.333 128 409 c 128 + 130 425.667 133.667 446 139 470 c 1 + 137.684 474 135.351 477 132 479 c 128 + 128.667 481 122.667 482 114 482 c 1 + 95.333 476.667 81.333 470.667 72 464 c 0 + 44 442.667 30 410.333 30 367 c 0 + 30 355.667 31.667 346.667 35 340 c 128 + 38.333 333.333 42.667 328.333 48 325 c 1 + 64 320.333 78 334 90 366 c 1 + 93.333 368.667 96.333 371.333 99 374 c 1 + 99.667 372 100 368.333 100 363 c 0 + 100 348.333 96 335 88 323 c 0 + 76.667 307 60 296.667 38 292 c 1 + 29.333 292 21.333 297 14 307 c 0 + 4.66699 320.334 0 338.667 0 362 c 0 + 0 407.333 15 444 45 472 c 128 + 75 500 112.667 514 158 514 c 0 + 210 514 249.667 504 277 484 c 128 + 304.333 464 318.333 436.333 319 401 c 0 + 319 387 316.667 373 312 359 c 1 + 300 338.333 285.333 328 268 328 c 0 + 250 328 232.333 337.333 215 356 c 128 + 197.667 374.667 189 390.333 189 403 c 0 + 189 409 191.333 412.333 196 413 c 1 + 200 401.667 204 393.333 208 388 c 0 + 220 370.667 235.333 362 254 362 c 0 + 268.667 362 278.667 366 284 374 c 128 + 289.333 382 292 392.667 292 406 c 0 + 292 426.667 284.333 442.333 269 453 c 128 + 253.667 463.667 233.667 471.667 209 477 c 0 + 199 479 192.333 480 189 480 c 0 + 185 480 176.333 479 163 477 c 1 + 157.667 461.667 154 446.333 152 431 c 128 + 150 415.667 149 396.667 149 374 c 0 + 149 353.333 156 330.666 170 306 c 1 + 197 261 197 261 224 216 c 1 + 226.667 203.333 228 191 228 179 c 0 + 228 157 219.667 136.667 203 118 c 0 + 194.333 108.667 190 101.333 190 96 c 1 + 199.333 87.333 205.333 76.333 208 63 c 128 + 210.667 49.667 222.667 40.333 244 35 c 1 + 261.333 39.667 273.333 44.667 280 50 c 128 + 286.667 55.333 290 62.333 290 71 c 0 + 290 77.667 286 90.333 278 109 c 0 + 272.667 121.667 269 131.667 267 139 c 1 + 266.333 145 266 149.667 266 153 c 0 + 266 181 274 206.333 290 229 c 128 + 306 251.667 328.333 263 357 263 c 0 + 378.333 263 393 259 401 251 c 128 + 409 243 414.667 227.667 418 205 c 0 + 420.667 183 413.667 163.667 397 147 c 1 + 374.334 126.333 351.667 106 329 86 c 1 + 335 75.333 342 65 350 55 c 0 + 366.667 34.333 383.333 24 400 24 c 0 + 412 24 425 29 439 39 c 0 + 443 42.333 448.667 47.333 456 54 c 1 + 454.667 66 454 76.333 454 85 c 0 + 454 121.667 460.667 153.333 474 180 c 0 + 492.667 218 525 247 571 267 c 1 + 550.333 313.667 518.333 355 475 391 c 1 + 434.333 419.667 393.333 448.333 352 477 c 1 + 381.333 474.332 418.333 459.666 463 433 c 0 + 517.667 401 561.333 362.667 594 318 c 0 + 636 261.333 657 200 657 134 c 0 +379 227 m 1 + 369 227 358.667 226.333 348 225 c 128 + 337.333 223.667 330 218.667 326 210 c 128 + 322 201.333 319.333 193 318 185 c 128 + 316.667 177 316 168.333 316 159 c 2 + 316 139 l 1 + 344 139 362.333 148.333 371 167 c 0 + 376.333 178.333 379 198.333 379 227 c 1 +513 54 m 1 + 519 41.333 529 35 543 35 c 0 + 559 35 573.333 43 586 59 c 128 + 598.667 75 605.333 98.333 606 129 c 0 + 606 154.333 602.667 181 596 209 c 128 + 589.333 237 581 251.333 571 252 c 1 + 549.667 243.333 533 226 521 200 c 128 + 509 174 503 145 503 113 c 0 + 503 89.667 506.333 70 513 54 c 1 +671 50 m 0 + 677.667 50 683.333 47.333 688 42 c 128 + 692.667 36.667 695 30.667 695 24 c 128 + 695 17.333 692.333 11.667 687 7 c 128 + 681.667 2.33301 675.333 -0 668 0 c 0 + 661.333 -0 655.667 2.66699 651 8 c 128 + 646.333 13.333 644 19.667 644 27 c 0 + 644 42.333 653 50 671 50 c 0 +EndSplineSet +EndChar + +StartChar: uniE655 +Encoding: 58965 58965 73 +Width: 507 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +255 288 m 1 + 229 288 210 270 210 245 c 0 + 210 224 234 204 255 203 c 1 + 279 203 296 225 296 247 c 0 + 296 272 279 287 255 288 c 1 +52 374 m 1 + 56 404 81 434 113 434 c 0 + 132 434 145 429 150 420 c 1 + 163 404 166 355 176 331 c 1 + 183 322 193 316 206 314 c 1 + 225 320 l 1 + 236 326 241 332 242 349 c 0 + 242 357 240 364 237 369 c 2 + 223 390 l 1 + 204 411 l 1 + 193 437 l 1 + 193 470 222 492 255 492 c 0 + 288 492 314 465 314 437 c 0 + 314 413 306 407 290 390 c 1 + 272 367 l 1 + 267 359 265 352 264 346 c 1 + 265 341 269 333 269 329 c 1 + 282 317 l 1 + 299 308 l 1 + 323 310 335 334 338 363 c 1 + 338 409 357 432 395 432 c 0 + 425 432 450 407 450 377 c 0 + 450 343 422 322 386 322 c 0 + 351 322 332 309 329 282 c 1 + 335 268 l 2 + 336 265 339 262 343 259 c 0 + 344 257 350 255 360 253 c 1 + 372 255 380 260 387 267 c 1 + 396 271 394 272 406 281 c 2 + 431 299 l 2 + 436 303 444 305 455 305 c 0 + 482 305 506 274 507 247 c 1 + 507 223 489 199 472 189 c 0 + 469 188 461 186 450 185 c 1 + 442 186 430 193 414 206 c 1 + 384 228 l 2 + 379 231 371 233 360 233 c 0 + 351 233 344 231 340 228 c 1 + 329 206 l 1 + 331 191 337 182 346 178 c 2 + 359 173 l 1 + 390 167 l 1 + 409 167 423 162 434 153 c 1 + 445 146 450 133 450 113 c 0 + 450 98 444 84 433 73 c 1 + 422 64 407 58 390 54 c 1 + 377 56 364 64 351 77 c 1 + 342 90 338 109 338 132 c 0 + 338 145 332 156 329 163 c 0 + 323 173 313 178 299 178 c 0 + 277 178 265 160 261 141 c 1 + 264 133 270 125 274 117 c 0 + 279 108 284 100 290 92 c 1 + 299 82 l 1 + 305 70 l 1 + 309 64 310 56 311 46 c 1 + 311 16 280 0 250 0 c 0 + 221 0 196 18 193 46 c 1 + 194 53 199 67 201 71 c 0 + 214 88 227 105 240 121 c 1 + 242 126 244 133 245 144 c 1 + 245 164 235 175 216 178 c 1 + 179 178 169 155 169 118 c 0 + 169 81 150 60 113 54 c 1 + 74 62 63 77 54 115 c 1 + 58 151 84 169 132 169 c 0 + 154 169 175 184 175 206 c 0 + 175 215 172 221 166 225 c 1 + 162 230 156 233 147 233 c 0 + 135 233 119 226 100 212 c 0 + 84 201 71 193 54 187 c 1 + 21 191 1 211 0 247 c 1 + 0 277 22 302 52 302 c 0 + 74 302 89 292 104 280 c 2 + 125 264 l 1 + 147 255 l 1 + 168 260 178 269 178 282 c 0 + 178 309 160 322 123 322 c 0 + 80 322 57 339 52 374 c 1 +EndSplineSet +EndChar + +StartChar: uniE046 +Encoding: 57414 57414 74 +Width: 935 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +51 64 m 1 + 130 349 l 1 + 132 358 l 1 + 133 363 l 1 + 133 371 130.333 377.333 125 382 c 128 + 119.667 386.667 106.333 391 85 395 c 1 + 85 404 l 1 + 237 404 l 2 + 371 404 438 348.667 438 238 c 0 + 438 190 425 147.333 399 110 c 0 + 386.333 92.6667 371 77 353 63 c 128 + 335 49 315 37.3333 293 28 c 0 + 249.667 9.33333 203.667 9.53674e-07 155 0 c 2 + 0 0 l 1 + 0 10 l 1 + 14.6667 10 26.3333 14.6667 35 24 c 0 + 39.6667 28.6667 43.3334 34.3333 46 41 c 128 + 48.6669 47.6667 50.3335 55.3334 51 64 c 1 +200 374 m 1 + 110 51 l 1 + 108 40 l 1 + 110 24.6667 125 17 153 17 c 0 + 193 17 229.667 28.3333 263 51 c 1 + 279.667 61 294.333 72.6667 307 86 c 128 + 319.667 99.3333 330.333 115 339 133 c 1 + 348.333 148.333 355 165.667 359 185 c 128 + 363 204.333 365.333 225.667 366 249 c 1 + 366 294.333 355.667 328.333 335 351 c 128 + 314.333 373.667 282 385 238 385 c 0 + 228.667 385 220.667 384.333 214 383 c 128 + 207.333 381.667 202.667 378.667 200 374 c 1 +890 404 m 1 + 868 279 l 1 + 857 279 l 1 + 857 295 855 309.667 851 323 c 128 + 847 336.333 840.667 348 832 358 c 1 + 813.333 375.333 789.667 384 761 384 c 0 + 742.333 384 725 381 709 375 c 128 + 693 369 678 359 664 345 c 1 + 635.333 320.333 614 288.666 600 250 c 1 + 591.333 230 585.333 212 582 196 c 128 + 578.667 180 576.667 161.667 576 141 c 0 + 576 121 577.667 103.667 581 89 c 128 + 584.333 74.3333 591 60.3333 601 47 c 1 + 617.667 22.3333 643 10 677 10 c 0 + 705 10 731 15.6667 755 27 c 128 + 779 38.3333 802.667 57.3333 826 84 c 1 + 834 74 l 1 + 787.333 10 730.333 -22 663 -22 c 0 + 633 -22 605.333 -14.3333 580 1 c 1 + 570 8.33333 560.333 17.3333 551 28 c 128 + 541.667 38.6667 533 50.6667 525 64 c 1 + 512.333 90 506 118.333 506 149 c 0 + 506.002 191.667 517.335 233 540 273 c 1 + 564 311.667 595.333 344.333 634 371 c 1 + 674 394.333 715.333 406 758 406 c 2 + 776 406 l 2 + 783.333 406 788.333 405.333 791 404 c 1 + 827 397 l 1 + 855 389 l 1 + 880 404 l 1 + 890 404 l 1 +398 33 m 128 + 398 44.3333 400.667 51.6667 406 55 c 1 + 414 63 422 67 430 67 c 128 + 438 67 445 63 451 55 c 1 + 457.667 51 461 43.6667 461 33 c 0 + 461 24.3333 457.667 16.6667 451 10 c 1 + 446.333 3.33333 439.333 0 430 0 c 128 + 420.667 -4.76837e-07 413 2.66667 407 8 c 128 + 401 13.3333 398 21.6667 398 33 c 128 +871 28 m 1 + 871 39.3333 874.333 47 881 51 c 1 + 887 57.6667 894.667 61 904 61 c 0 + 912 61 920 58 928 52 c 1 + 932.667 46 935 38 935 28 c 0 + 935 20 932 13.3333 926 8 c 1 + 920.66 2 913.326 -1 904 -1 c 0 + 894 -1 886.667 2 882 8 c 1 + 876 12.6667 872.333 19.3333 871 28 c 1 +EndSplineSet +EndChar + +StartChar: uniE045 +Encoding: 57413 57413 75 +Width: 860 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +133 363 m 1 + 133 387 115 389 85 395 c 1 + 85 404 l 1 + 237 404 l 2 + 371 404 438 349 438 238 c 0 + 438 190 425 147 399 110 c 1 + 352 45 261 0 155 0 c 2 + 0 0 l 1 + 0 10 l 1 + 32 10 49 33 51 64 c 1 + 130 349 l 1 + 132 358 l 1 + 133 363 l 1 +366 249 m 0 + 366 339 327 385 238 385 c 0 + 221 385 206 384 200 374 c 1 + 110 51 l 1 + 108 40 l 1 + 110 25 125 17 153 17 c 0 + 292 17 365 109 366 249 c 0 +704 384 m 0 + 669 384 640 358 640 323 c 0 + 640 306 645 290 655 276 c 1 + 675 252 681 245 703 226 c 1 + 716 210 739 183 751 167 c 1 + 763 148 769 129 769 108 c 0 + 769 82 760 62 750 43 c 1 + 737 24 721 10 704 1 c 1 + 689 -9 670 -14 645 -14 c 0 + 634 -14 617 -10 594 -1 c 1 + 578 3 562 5 552 10 c 1 + 545 10 540 7 536 1 c 1 + 532 0 529 -5 528 -13 c 1 + 516 -13 l 1 + 537 122 l 1 + 552 122 l 1 + 549 105 l 1 + 549 90 552 79 554 68 c 1 + 558 57 565 47 576 36 c 1 + 591 17 611 8 638 8 c 0 + 662 8 680 16 692 32 c 1 + 708 47 716 66 716 87 c 0 + 716 107 711 123 702 135 c 1 + 690 148 682 160 669 173 c 128 + 664 178 658 184 652 191 c 0 + 630 212 614 231 603 249 c 1 + 592 262 587 280 587 303 c 0 + 587 341 595 356 618 375 c 1 + 637 394 662 404 693 404 c 0 + 717 404 735 402 747 397 c 1 + 758 390 768 387 778 387 c 0 + 785 387 793 393 802 404 c 1 + 815 404 l 1 + 791 285 l 1 + 781 285 l 1 + 781 351 755 384 704 384 c 0 +430 0 m 128 + 410 0 398 12 398 33 c 128 + 398 54 415 67 430 67 c 128 + 438 67 445 63 451 55 c 1 + 458 51 461 44 461 33 c 0 + 461 17 448 0 430 0 c 128 +829 -1 m 0 + 809 -1 797 11 794 28 c 1 + 794 45 811 61 829 61 c 0 + 848 61 860 49 860 28 c 0 + 860 10 845 -1 829 -1 c 0 +EndSplineSet +EndChar + +StartChar: uniE047 +Encoding: 57415 57415 76 +Width: 410 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +108 474 m 4 + 86 474 70 444 70 418 c 4 + 70 364 143 333 210 302 c 5 + 348 507 l 5 + 389 507 l 5 + 243 286 l 5 + 284 265 316 242 339 219 c 4 + 367 190 381 157 381 122 c 4 + 381 54 327 2 257 1 c 4 + 217 1 181 33 181 73 c 4 + 181 95 202 111 224 111 c 4 + 247 111 258 94 263 73 c 4 + 269 50 279 39 294 39 c 4 + 321 39 336 62 336 93 c 4 + 336 106 333 116 328 125 c 4 + 319 142 295 161 256 182 c 5 + 226 197 226 197 196 212 c 5 + 62 4 l 5 + 22 4 l 5 + 163 227 l 5 + 114 250 78 277 54 307 c 4 + 33 334 22 362 22 391 c 4 + 22 438 47 471 76 493 c 132 + 93 506 113 513 134 513 c 4 + 180 513 224 481 225 436 c 4 + 225 414 202 401 180 400 c 4 + 161 400 150 408 145 425 c 6 + 138 448 l 6 + 133 465 123 474 108 474 c 4 +75 192 m 5 + 75 171 59 155 39 154 c 5 + 16 154 2 167 1 189 c 4 + 0 210 15 228 36 228 c 132 + 58 228 74 213 75 192 c 5 +337 322 m 4 + 337 346 353 360 374 360 c 4 + 397 360 411 341 411 323 c 4 + 411 300 394 286 374 286 c 4 + 351 286 337 303 337 322 c 4 +EndSplineSet +EndChar + +StartChar: uniE048 +Encoding: 57416 57416 77 +Width: 536 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +537 233 m 1 + 473 233 l 1 + 473 217 469 193 460 160 c 1 + 446 121 l 1 + 430 90 l 1 + 417 73 400 50 383 37 c 128 + 361 20 326 10 286 0 c 1 + 286 -73 l 1 + 251 -73 l 1 + 251 0 l 1 + 212 6 l 130 + 203 7 196 9 189 12 c 0 + 132 43 100 86 78 160 c 1 + 67 199 l 1 + 65 233 l 1 + 0 233 l 1 + 0 273 l 1 + 65 273 l 1 + 65 307 67 316 77 346 c 1 + 83 370 95 398 107 416 c 1 + 130 446 l 1 + 154 471 l 1 + 175 487 184 494 215 499 c 128 + 227 501 239 503 251 506 c 1 + 251 580 l 1 + 286 580 l 1 + 286 506 l 1 + 307 503 332 502 347 493 c 1 + 360 488 372 480 382 471 c 0 + 398 458 414 439 430 416 c 1 + 443 393 473 309 473 273 c 1 + 537 273 l 1 + 537 233 l 1 +370 273 m 1 + 369 295 l 1 + 367 332 l 2 + 367 349 364 369 358 390 c 1 + 352 425 320 471 286 471 c 1 + 286 273 l 1 + 370 273 l 1 +251 273 m 1 + 251 471 l 1 + 236 471 221 462 205 445 c 1 + 190 426 181 409 178 393 c 0 + 175 375 173 357 170 339 c 1 + 169 303 l 2 + 169 290 168 280 167 273 c 1 + 251 273 l 1 +370 233 m 1 + 286 233 l 1 + 286 37 l 1 + 301 37 317 45 332 61 c 0 + 345 76 354 94 358 115 c 2 + 367 177 l 1 + 370 233 l 1 +251 37 m 1 + 251 233 l 1 + 167 233 l 1 + 167 212 l 1 + 169 175 l 1 + 169 133 182 88 204 61 c 1 + 219 45 235 37 251 37 c 1 +EndSplineSet +EndChar + +StartChar: uniE04B +Encoding: 57419 57419 78 +Width: 477 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +187 643 m 1 + 253 605 l 1 + 253 751 l 1 + 187 788 l 1 + 187 643 l 1 +320 572 m 1 + 349 580 380 608 380 644 c 0 + 380 671 364 698 346 707 c 1 + 282 745 l 1 + 282 597 l 1 + 320 572 l 1 +159 381 m 1 + 159 530 l 1 + 122 552 l 1 + 103 552 94 545 83 533 c 1 + 68 520 61 507 61 496 c 0 + 61 460 79 433 100 418 c 1 + 159 381 l 1 +187 375 m 1 + 253 339 l 1 + 253 483 l 1 + 187 520 l 1 + 187 375 l 1 +320 305 m 1 + 352 310 380 337 380 373 c 0 + 380 402 368 424 344 440 c 1 + 282 476 l 1 + 282 330 l 1 + 320 305 l 1 +159 924 m 1 + 159 962 l 1 + 187 962 l 1 + 187 909 l 1 + 253 874 l 1 + 253 962 l 1 + 282 962 l 1 + 282 863 l 1 + 315 849 341 835 360 822 c 1 + 401 797 439 759 442 696 c 0 + 442 686 440 676 437 667 c 2 + 431 651 l 2 + 426 638 420 626 413 617 c 1 + 407 606 396 595 387 585 c 2 + 356 553 l 1 + 378 541 395 528 407 514 c 1 + 420 501 428 487 432 472 c 1 + 439 459 442 440 442 416 c 0 + 442 360 413 316 356 285 c 1 + 383 266 406 247 423 226 c 128 + 440 205 449 181 450 152 c 0 + 450 111 439 83 420 57 c 1 + 401 28 375 6 343 -10 c 1 + 314 -23 281 -32 244 -34 c 1 + 201 -34 187 -30 149 -18 c 1 + 102 -5 46 27 44 78 c 1 + 46 91 l 1 + 51 116 65 128 88 128 c 2 + 101 128 l 1 + 116 126 134 111 155 84 c 0 + 178 54 193 34 216 19 c 128 + 223 15 242 10 250 7 c 128 + 254 6 259 5 266 6 c 0 + 308 6 339 27 357 51 c 1 + 365 64 369 78 369 91 c 1 + 366 113 l 2 + 365 121 362 129 357 136 c 1 + 340 167 314 184 282 201 c 1 + 282 164 l 1 + 253 164 l 1 + 253 217 l 1 + 187 249 l 1 + 187 164 l 1 + 159 164 l 1 + 159 262 l 1 + 109 288 l 2 + 95 296 66 315 54 326 c 1 + 39 338 26 353 17 370 c 1 + 5 399 l 1 + 3 407 2 412 2 415 c 128 + 2 418 2 423 1 430 c 1 + 3 450 l 1 + 12 488 33 515 56 540 c 1 + 88 572 l 1 + 56 591 33 611 20 630 c 1 + 7 651 1 677 1 708 c 0 + 1 741 9 767 24 786 c 128 + 39 805 61 824 90 842 c 1 + 63 859 41 879 25 902 c 128 + 9 925 1 955 0 992 c 0 + 0 1026 10 1055 29 1078 c 1 + 65 1125 124 1157 201 1158 c 1 + 270 1158 333 1137 370 1103 c 128 + 390 1085 400 1067 400 1049 c 1 + 398 1034 l 1 + 391 1005 376 990 352 990 c 0 + 337 990 325 994 318 1001 c 128 + 308 1011 279 1054 264 1070 c 128 + 257 1077 249 1085 239 1093 c 1 + 222 1104 200 1111 174 1114 c 1 + 143 1114 118 1106 101 1091 c 1 + 86 1076 72 1061 71 1034 c 1 + 72 1029 l 1 + 72 983 123 940 159 924 c 1 +161 649 m 1 + 161 797 l 1 + 124 820 l 1 + 111 818 101 814 94 807 c 1 + 87 797 84 791 79 779 c 2 + 68 749 l 1 + 68 726 67 723 77 709 c 0 + 84 698 92 689 100 684 c 2 + 161 649 l 1 +EndSplineSet +EndChar + +StartChar: uniE500 +Encoding: 58624 58624 79 +Width: 508 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +508 212 m 1 + 146 -212 l 1 + 0 -212 l 1 + 362 212 l 1 + 508 212 l 1 +52 108 m 0 + 52 121.333 56.333 132.667 65 142 c 128 + 73.667 151.333 84.333 156.333 97 157 c 1 + 111 157 122.667 153 132 145 c 128 + 141.333 137 146.333 126 147 112 c 0 + 147 98.667 142.667 87.333 134 78 c 128 + 125.333 68.667 114.667 63.667 102 63 c 1 + 88 63 76.333 67 67 75 c 128 + 57.667 83 52.667 94 52 108 c 0 +361 -111 m 0 + 361 -97.667 365.333 -86.333 374 -77 c 128 + 382.667 -67.667 393.334 -62.667 406 -62 c 1 + 420 -62 431.667 -66 441 -74 c 128 + 450.333 -82 455.333 -93 456 -107 c 0 + 456 -120.333 451.667 -131.667 443 -141 c 128 + 434.333 -150.333 423.667 -155.333 411 -156 c 1 + 397 -156 385.333 -152 376 -144 c 128 + 366.667 -136 361.667 -125 361 -111 c 0 +EndSplineSet +EndChar + +StartChar: uniE220 +Encoding: 57888 57888 80 +Width: 163 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +-163 -124 m 1 + -163 -41 l 1 + 163 125 l 1 + 163 39 l 1 + -163 -124 l 1 +EndSplineSet +EndChar + +StartChar: uniE222 +Encoding: 57890 57890 81 +Width: 162 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +162 175 m 1 + -162 11 l 1 + -162 95 l 1 + 162 258 l 1 + 162 175 l 1 +162 40 m 1 + -162 -124 l 1 + -162 -40 l 1 + 162 124 l 1 + 162 40 l 1 +162 -95 m 1 + -162 -258 l 1 + -162 -175 l 1 + 162 -11 l 1 + 162 -95 l 1 +EndSplineSet +EndChar + +StartChar: uniE223 +Encoding: 57891 57891 82 +Width: 162 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +162 108 m 1 + -162 -56 l 1 + -162 28 l 1 + 162 191 l 1 + 162 108 l 1 +162 -27 m 1 + -162 -191 l 1 + -162 -107 l 1 + 162 57 l 1 + 162 -27 l 1 +162 -162 m 1 + -162 -325 l 1 + -162 -242 l 1 + 162 -78 l 1 + 162 -162 l 1 +162 242 m 1 + -162 78 l 1 + -162 162 l 1 + 162 326 l 1 + 162 242 l 1 +EndSplineSet +EndChar + +StartChar: uniE224 +Encoding: 57892 57892 83 +Width: 162 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +162 41 m 1 + -162 -123 l 1 + -162 -39 l 1 + 162 124 l 1 + 162 41 l 1 +162 -94 m 1 + -162 -258 l 1 + -162 -174 l 1 + 162 -10 l 1 + 162 -94 l 1 +162 -229 m 1 + -162 -392 l 1 + -162 -309 l 1 + 162 -145 l 1 + 162 -229 l 1 +162 310 m 1 + -162 146 l 1 + -162 230 l 1 + 162 393 l 1 + 162 310 l 1 +162 175 m 1 + -162 11 l 1 + -162 95 l 1 + 162 259 l 1 + 162 175 l 1 +EndSplineSet +EndChar + +StartChar: uniE221 +Encoding: 57889 57889 84 +Width: 164 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +-163 -193 m 1 + -163 -110 l 1 + 163 56 l 1 + 163 -30 l 1 + -163 -193 l 1 +-163 -57 m 1 + -163 27 l 1 + 163 193 l 1 + 163 110 l 1 + -163 -57 l 1 +EndSplineSet +EndChar + +StartChar: uniE530 +Encoding: 58672 58672 85 +Width: 692 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +363 -69 m 1 + 386 -69 398 -92 399 -116 c 0 + 399 -124 395 -139 390 -147 c 2 + 380 -162 l 2 + 373 -172 372 -174 367 -183 c 1 + 367 -188 370 -190 377 -190 c 0 + 396 -190 412 -176 425 -148 c 1 + 438 -116 448 -88 458 -51 c 1 + 472 11 485 72 499 134 c 2 + 517 220 l 1 + 377 220 l 1 + 363 131 317 -36 284 -98 c 1 + 269 -129 254 -155 237 -177 c 128 + 220 -199 199 -214 172 -221 c 1 + 154 -223 l 1 + 110 -223 87 -183 87 -136 c 0 + 87 -97 105 -83 132 -69 c 1 + 138 -69 143 -70 146 -73 c 1 + 151 -75 155 -80 159 -84 c 0 + 166 -93 169 -104 169 -118 c 0 + 169 -133 158 -154 137 -183 c 1 + 137 -188 140 -190 146 -190 c 0 + 180 -190 207 -144 228 -51 c 0 + 235 -22 241 8 248 38 c 0 + 261 99 274 159 287 220 c 1 + 146 220 l 1 + 133 135 84 -35 53 -98 c 1 + 20 -170 -17 -211 -57 -221 c 1 + -76 -223 l 1 + -111 -223 -127 -199 -139 -169 c 1 + -144 -136 l 1 + -139 -97 -131 -81 -98 -69 c 1 + -75 -69 -60 -95 -60 -118 c 0 + -60 -126 -62 -134 -66 -141 c 2 + -80 -164 l 1 + -94 -183 l 1 + -94 -188 -91 -190 -84 -190 c 0 + -73 -190 -63 -185 -54 -175 c 1 + -36 -160 -28 -129 -17 -104 c 1 + -2 -51 l 1 + 15 26 32 104 48 182 c 128 + 51 195 54 208 57 220 c 1 + 0 220 l 1 + 0 258 l 1 + 69 258 l 1 + 78 291 92 320 109 347 c 1 + 126 375 147 398 172 417 c 1 + 197 434 225 442 255 442 c 0 + 288 442 304 412 304 376 c 128 + 304 338 285 306 254 300 c 1 + 237 300 227 311 225 332 c 1 + 225 359 242 385 262 394 c 1 + 265 394 267 396 267 400 c 1 + 261 409 l 1 + 256 412 250 414 243 414 c 0 + 220 414 202 398 188 366 c 128 + 174 334 163 299 156 260 c 1 + 300 260 l 1 + 323 344 385 442 485 442 c 0 + 521 442 532 411 534 376 c 1 + 534 358 530 341 521 325 c 1 + 513 313 501 305 484 300 c 1 + 466 300 456 311 454 332 c 1 + 454 361 472 383 491 394 c 1 + 494 394 496 396 496 400 c 1 + 492 410 485 414 473 414 c 0 + 436 414 406 362 385 258 c 1 + 529 258 l 1 + 544 307 568 351 601 390 c 0 + 632 426 670 444 715 444 c 0 + 749 444 764 408 764 374 c 0 + 764 337 745 306 713 300 c 1 + 697 300 688 311 686 332 c 1 + 686 358 704 384 721 394 c 1 + 725 394 727 396 727 400 c 1 + 722 409 716 414 703 414 c 0 + 666 414 636 362 615 258 c 1 + 691 258 l 1 + 691 220 l 1 + 606 220 l 1 + 599 176 591 136 580 99 c 1 + 562 24 541 -42 514 -98 c 1 + 499 -126 483 -153 464 -177 c 1 + 448 -198 428 -213 403 -221 c 1 + 385 -223 l 1 + 350 -223 332 -200 323 -169 c 1 + 319 -159 317 -148 317 -136 c 1 + 321 -99 332 -79 363 -69 c 1 +EndSplineSet +EndChar + +StartChar: uniE52F +Encoding: 58671 58671 86 +Width: 479 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +481 220 m 1 + 398 220 l 1 + 389.333 164.667 375.667 105.667 357 43 c 128 + 338.333 -19.667 321.333 -66.667 306 -98 c 128 + 290.667 -129.333 274 -156 256 -178 c 1 + 240 -199.333 219 -213.666 193 -221 c 1 + 174 -223 l 1 + 152.667 -223 136.667 -214.333 126 -197 c 0 + 122 -191.667 119 -186.667 117 -182 c 128 + 115 -177.334 113 -171.667 111 -165 c 128 + 109 -158.334 108 -148.667 108 -136 c 0 + 108 -117.333 112 -103.333 120 -94 c 128 + 128 -84.667 138.667 -76.333 152 -69 c 1 + 157.333 -69 162 -70 166 -72 c 128 + 170 -74 174.333 -78 179 -84 c 0 + 186.333 -93.333 190 -104.667 190 -118 c 0 + 190 -132.667 179.333 -154.333 158 -183 c 1 + 158 -187.667 161 -190 167 -190 c 0 + 201 -190 228.333 -143.667 249 -51 c 1 + 256 -22 l 1 + 269 38 l 1 + 291 140 l 1 + 308 220 l 1 + 147 220 l 1 + 139 166.667 124.667 106.667 104 40 c 0 + 92 0.666992 83.333 -26 78 -40 c 0 + 70 -61.333 61.667 -80.667 53 -98 c 1 + 20.333 -170 -16.333 -211 -57 -221 c 1 + -75 -223 l 1 + -96.3311 -223 -112.664 -214.333 -124 -197 c 1 + -129.333 -191 -134.333 -181.667 -139 -169 c 1 + -139.667 -163.667 -140.333 -158.667 -141 -154 c 128 + -141.667 -149.333 -142.333 -143.333 -143 -136 c 1 + -141.667 -124.667 -140.333 -115.667 -139 -109 c 128 + -137.667 -102.333 -134.667 -96 -130 -90 c 0 + -123.333 -81.333 -112.333 -74.333 -97 -69 c 1 + -86.3379 -69 -77.6719 -74 -71 -84 c 128 + -64.3428 -94 -60.6758 -105.333 -60 -118 c 0 + -60 -125.333 -60.667 -130.667 -62 -134 c 128 + -63.333 -137.332 -64.333 -139.666 -65 -141 c 2 + -79 -164 l 1 + -94 -183 l 1 + -94 -187.667 -90.667 -190 -84 -190 c 0 + -72.667 -190 -62.333 -185 -53 -175 c 0 + -49.667 -171.667 -46 -167 -42 -161 c 128 + -38 -155 -34 -148 -30 -140 c 1 + -16 -104 l 1 + -1 -51 l 1 + 18 35 l 1 + 40 140 l 1 + 57 220 l 1 + 0 220 l 1 + 0 258 l 1 + 70 258 l 1 + 79.333 289.334 92 318.667 108 346 c 128 + 124 373.333 145.667 397 173 417 c 1 + 197.667 433.667 225.333 442 256 442 c 0 + 271.333 442 283.333 435.667 292 423 c 128 + 300.667 410.333 305 394.666 305 376 c 128 + 305 357.333 300.667 340.666 292 326 c 128 + 283.334 311.332 270.667 302.665 254 300 c 1 + 237.333 300 228 310.667 226 332 c 1 + 226 343.335 229.333 355.668 236 369 c 1 + 242.667 380.335 251.667 388.668 263 394 c 1 + 266.333 396.667 268 398.667 268 400 c 1 + 264.667 404.667 262.333 407.667 261 409 c 0 + 256.333 412.333 250.333 414 243 414 c 0 + 221 414 203 398.333 189 367 c 128 + 175 335.667 164 300 156 260 c 1 + 320 260 l 1 + 333.333 309.333 356.667 352 390 388 c 128 + 423.333 424 462 442 506 442 c 0 + 514 442 521 440.667 527 438 c 128 + 533 435.333 538 430 542 422 c 1 + 544.667 418.667 547.333 413 550 405 c 128 + 552.667 397 554.333 387.333 555 376 c 1 + 555 357.333 550.667 341 542 327 c 128 + 533.333 313 521 304 505 300 c 1 + 487 300 477 310.667 475 332 c 0 + 475 338 476 344 478 350 c 128 + 480 356 482.667 362 486 368 c 128 + 489.333 374 493 379 497 383 c 128 + 501 387 506 390.667 512 394 c 1 + 515.333 396.667 517 398.667 517 400 c 1 + 511 409 l 1 + 506.333 412.333 500.667 414 494 414 c 0 + 456.667 414 427.333 362 406 258 c 1 + 481 258 l 1 + 481 220 l 1 +EndSplineSet +EndChar + +StartChar: uniE531 +Encoding: 58673 58673 87 +Width: 925 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +597 -69 m 0 + 618.386 -69 632 -99.9219 632 -120 c 0 + 632 -140.113 619.398 -151.813 611 -165 c 128 + 606.336 -172.333 602.67 -177 600 -179 c 0 + 594.479 -186.362 598.662 -188.966 609 -190 c 1 + 644.075 -190 663.221 -135.5 676 -101 c 128 + 682.667 -83 687.667 -65.667 691 -49 c 0 + 711.706 39.2939 729.664 130.336 749 220 c 1 + 606 220 l 1 + 599 176 591 136 580 99 c 1 + 562 24 541 -42 514 -98 c 1 + 499 -126 483 -153 464 -177 c 0 + 448 -198 428 -213 403 -221 c 1 + 385 -223 l 1 + 350 -223 332 -200 323 -169 c 1 + 319 -159 317 -148 317 -136 c 1 + 321 -99 332 -79 363 -69 c 1 + 386 -69 398 -92 399 -116 c 0 + 399 -124 395 -139 390 -147 c 2 + 380 -162 l 2 + 373 -172 372 -174 367 -183 c 1 + 367 -188 370 -190 377 -190 c 0 + 396 -190 412 -176 425 -148 c 1 + 438 -116 448 -88 458 -51 c 1 + 472 11 485 72 499 134 c 1 + 517 220 l 1 + 377 220 l 1 + 363 131 317 -36 284 -98 c 1 + 269 -129 254 -155 237 -177 c 128 + 220 -199 199 -214 172 -221 c 1 + 154 -223 l 1 + 110 -223 87 -183 87 -136 c 0 + 87 -97 105 -83 132 -69 c 1 + 138 -69 143 -70 146 -73 c 1 + 160.846 -78.9385 169 -98.0508 169 -118 c 0 + 169 -133 158 -154 137 -183 c 1 + 137 -188 140 -190 146 -190 c 0 + 180 -190 207 -144 228 -51 c 1 + 249.424 37.7559 267.772 129.774 287 220 c 1 + 146 220 l 1 + 133 135 84 -35 53 -98 c 1 + 20 -170 -17 -211 -57 -221 c 1 + -76 -223 l 1 + -111 -223 -127 -199 -139 -169 c 1 + -144 -136 l 1 + -139 -97 -131 -81 -98 -69 c 1 + -75 -69 -60 -95 -60 -118 c 0 + -60 -126 -62 -134 -66 -141 c 2 + -80 -164 l 1 + -94 -183 l 1 + -94 -188 -91 -190 -84 -190 c 0 + -73 -190 -63 -185 -54 -175 c 1 + -36 -160 -28 -129 -17 -104 c 1 + -2 -51 l 1 + 15 26 32 104 48 182 c 128 + 51 195 54 208 57 220 c 1 + 0 220 l 1 + 0 258 l 1 + 69 258 l 1 + 78 291 92 320 109 347 c 0 + 126 375 147 398 172 417 c 1 + 197 434 225 442 255 442 c 0 + 288 442 304 412 304 376 c 128 + 304 338 285 306 254 300 c 1 + 237 300 227 311 225 332 c 1 + 225 359 242 385 262 394 c 1 + 265 394 267 396 267 400 c 1 + 261 409 l 1 + 256 412 250 414 243 414 c 0 + 220 414 202 398 188 366 c 128 + 174 334 163 299 156 260 c 1 + 300 260 l 1 + 323 344 385 442 485 442 c 0 + 521 442 532 411 534 376 c 1 + 534 358 530 341 521 325 c 1 + 513 313 501 305 484 300 c 1 + 466 300 456 311 454 332 c 1 + 454 361 472 383 491 394 c 1 + 494 394 496 396 496 400 c 1 + 492 410 485 414 473 414 c 0 + 436 414 406 362 385 258 c 1 + 529 258 l 1 + 544 307 568 351 601 390 c 0 + 632 426 670 444 715 444 c 0 + 749 444 764 408 764 374 c 0 + 764 337 745 306 713 300 c 1 + 697 300 688 311 686 332 c 1 + 686 358 704 384 721 394 c 1 + 725 394 727 396 727 400 c 1 + 722 409 716 414 703 414 c 0 + 666 414 636 362 615 258 c 1 + 761 258 l 1 + 774.429 295.847 783.957 322.661 801 349 c 0 + 821.666 379 843.333 402 866 418 c 128 + 888.667 434 913.667 442 941 442 c 0 + 969.318 442 986.6 428.326 992 404 c 2 + 996 388 l 1 + 996 354.861 995 351.993 983 328 c 0 + 979.862 320.94 965.617 302.946 952 301 c 128 + 947.333 300.333 941.667 300.333 935 301 c 0 + 922.394 303.801 918.434 318.612 916 332 c 1 + 916 359.28 927.325 376.216 945 388 c 2 + 959 398 l 1 + 959 406.667 953 412 941 414 c 0 + 927.667 415.33 916.333 412.663 907 406 c 128 + 897.667 399.333 888 385 878 363 c 1 + 871.086 345.222 852.1 279.121 847 260 c 1 + 924 260 l 1 + 924 220 l 1 + 839 220 l 1 + 819.986 111.195 778.939 -34.5586 736 -117 c 0 + 712.343 -163.132 671.698 -223 619 -223 c 0 + 574.383 -223 548 -186.317 548 -140 c 0 + 548 -108.178 563.31 -69 597 -69 c 0 +EndSplineSet +EndChar + +StartChar: uniE532 +Encoding: 58674 58674 88 +Width: 1158 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +983 220 m 1 + 939 12 l 1 + 925 -49 l 2 + 921.667 -65.667 916.667 -83 910 -101 c 128 + 903.333 -119 896.667 -135 890 -149 c 0 + 877.333 -176.333 861.667 -190 843 -190 c 1 + 836.333 -189.333 832.667 -188 832 -186 c 128 + 831.333 -184 832 -181.667 834 -179 c 1 + 836.67 -177 840.336 -172.333 845 -165 c 128 + 849.67 -157.667 854.336 -150.667 859 -144 c 128 + 863.667 -137.333 866 -129.333 866 -120 c 0 + 866 -115.333 865 -109.667 863 -103 c 128 + 861 -96.333 857.333 -89 852 -81 c 128 + 846.667 -73 839.667 -69 831 -69 c 0 + 824.333 -69 817.667 -71 811 -75 c 128 + 804.333 -79 798.667 -84.667 794 -92 c 1 + 786 -107.333 782 -123.333 782 -140 c 0 + 782 -160.667 787 -178.667 797 -194 c 0 + 809.667 -213.333 828.334 -223 853 -223 c 0 + 879 -223 904.333 -208.667 929 -180 c 0 + 943 -164 956.667 -143 970 -117 c 0 + 986.67 -85 1004 -41.333 1022 14 c 0 + 1044 82.667 1061 151.333 1073 220 c 1 + 1158 220 l 1 + 1158 260 l 1 + 1081 260 l 1 + 1083.67 270 1088.33 286.667 1095 310 c 128 + 1101.67 333.333 1107.33 351 1112 363 c 1 + 1122 385 1131.67 399.333 1141 406 c 128 + 1150.33 412.663 1161.67 415.33 1175 414 c 1 + 1187 412 1193 406.667 1193 398 c 1 + 1186 393 1186 393 1179 388 c 0 + 1169 381.333 1161.67 373.333 1157 364 c 128 + 1152.33 354.667 1150 344 1150 332 c 1 + 1151.33 324.667 1153.33 318 1156 312 c 128 + 1158.67 306 1163 302.333 1169 301 c 1 + 1175.67 300.333 1181.33 300.333 1186 301 c 128 + 1190.67 301.667 1195 303.667 1199 307 c 0 + 1208.33 315 1214.33 322 1217 328 c 0 + 1223 340 1226.67 349.333 1228 356 c 128 + 1229.33 362.666 1230 373.333 1230 388 c 1 + 1226 404 l 2 + 1224.67 410 1221.67 416.333 1217 423 c 0 + 1210.33 431.667 1204 437 1198 439 c 128 + 1192 441 1184.33 442 1175 442 c 0 + 1147.67 442 1122.67 434 1100 418 c 128 + 1077.33 402 1055.67 379 1035 349 c 0 + 1027.67 337.667 1020.33 323 1013 305 c 0 + 1008.33 294.333 1002.33 278.667 995 258 c 1 + 847 258 l 1 + 852.1 277.121 871.086 345.222 878 363 c 1 + 888 385 897.667 399.333 907 406 c 128 + 916.333 412.663 927.667 415.33 941 414 c 0 + 953 412 959 406.667 959 398 c 1 + 945 388 l 2 + 927.325 376.216 916 359.28 916 332 c 1 + 918.434 318.612 922.394 303.801 935 301 c 0 + 941.667 300.333 947.333 300.333 952 301 c 128 + 965.617 302.946 979.862 320.94 983 328 c 0 + 995 351.993 996 354.861 996 388 c 1 + 992 404 l 2 + 986.6 428.326 969.318 442 941 442 c 0 + 913.667 442 888.667 434 866 418 c 128 + 843.333 402 821.666 379 801 349 c 0 + 783.957 322.661 774.429 295.847 761 258 c 1 + 615 258 l 1 + 636 362 666 414 703 414 c 0 + 716 414 722 409 727 400 c 1 + 727 396 725 394 721 394 c 1 + 704 384 686 358 686 332 c 1 + 688 311 697 300 713 300 c 1 + 745 306 764 337 764 374 c 0 + 764 408 749 444 715 444 c 0 + 670 444 632 426 601 390 c 0 + 568 351 544 307 529 258 c 1 + 385 258 l 1 + 406 362 436 414 473 414 c 0 + 485 414 492 410 496 400 c 1 + 496 396 494 394 491 394 c 1 + 472 383 454 361 454 332 c 1 + 456 311 466 300 484 300 c 1 + 501 305 513 313 521 325 c 1 + 530 341 534 358 534 376 c 1 + 532 411 521 442 485 442 c 0 + 385 442 323 344 300 260 c 1 + 156 260 l 1 + 163 299 174 334 188 366 c 128 + 202 398 220 414 243 414 c 0 + 250 414 256 412 261 409 c 1 + 267 400 l 1 + 267 396 265 394 262 394 c 1 + 242 385 225 359 225 332 c 1 + 227 311 237 300 254 300 c 1 + 285 306 304 338 304 376 c 128 + 304 412 288 442 255 442 c 0 + 225 442 197 434 172 417 c 1 + 147 398 126 375 109 347 c 0 + 92 320 78 291 69 258 c 1 + 0 258 l 1 + 0 220 l 1 + 57 220 l 1 + 54 208 51 195 48 182 c 128 + 32 104 15 26 -2 -51 c 1 + -17 -104 l 1 + -28 -129 -36 -160 -54 -175 c 1 + -63 -185 -73 -190 -84 -190 c 0 + -91 -190 -94 -188 -94 -183 c 1 + -80 -164 l 1 + -66 -141 l 2 + -62 -134 -60 -126 -60 -118 c 0 + -60 -95 -75 -69 -98 -69 c 1 + -131 -81 -139 -97 -144 -136 c 1 + -139 -169 l 1 + -127 -199 -111 -223 -76 -223 c 1 + -57 -221 l 1 + -17 -211 20 -170 53 -98 c 1 + 84 -35 133 135 146 220 c 1 + 287 220 l 1 + 267.772 129.774 249.424 37.7559 228 -51 c 1 + 207 -144 180 -190 146 -190 c 0 + 140 -190 137 -188 137 -183 c 1 + 158 -154 169 -133 169 -118 c 0 + 169 -98.0508 160.846 -78.9385 146 -73 c 1 + 143 -70 138 -69 132 -69 c 1 + 105 -83 87 -97 87 -136 c 0 + 87 -183 110 -223 154 -223 c 1 + 172 -221 l 1 + 199 -214 220 -199 237 -177 c 128 + 254 -155 269 -129 284 -98 c 1 + 317 -36 363 131 377 220 c 1 + 517 220 l 1 + 499 134 l 1 + 485 72 472 11 458 -51 c 1 + 448 -88 438 -116 425 -148 c 1 + 412 -176 396 -190 377 -190 c 0 + 370 -190 367 -188 367 -183 c 1 + 372 -174 373 -172 380 -162 c 2 + 390 -147 l 2 + 395 -139 399 -124 399 -116 c 0 + 398 -92 386 -69 363 -69 c 1 + 332 -79 321 -99 317 -136 c 1 + 317 -148 319 -159 323 -169 c 1 + 332 -200 350 -223 385 -223 c 1 + 403 -221 l 1 + 428 -213 448 -198 464 -177 c 0 + 483 -153 499 -126 514 -98 c 1 + 541 -42 562 24 580 99 c 1 + 591 136 599 176 606 220 c 1 + 749 220 l 1 + 729.664 130.336 711.706 39.2939 691 -49 c 0 + 687.667 -65.667 682.667 -83 676 -101 c 128 + 663.221 -135.5 644.075 -190 609 -190 c 1 + 598.662 -188.966 594.479 -186.362 600 -179 c 0 + 602.67 -177 606.336 -172.333 611 -165 c 128 + 619.398 -151.813 632 -140.113 632 -120 c 0 + 632 -99.9219 618.386 -69 597 -69 c 0 + 563.31 -69 548 -108.178 548 -140 c 0 + 548 -186.317 574.383 -223 619 -223 c 0 + 671.698 -223 712.343 -163.132 736 -117 c 0 + 778.939 -34.5586 819.986 111.195 839 220 c 1 + 983 220 l 1 +EndSplineSet +EndChar + +StartChar: u +Encoding: 117 117 89 +Width: 322 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 265 m 5 + 322 265 l 5 + 322 -2 l 5 + 270 -2 l 5 + 270 189 l 5 + 52 189 l 5 + 52 -2 l 5 + 0 -2 l 5 + 0 265 l 5 +EndSplineSet +EndChar + +StartChar: NameMe.58897 +Encoding: 1114112 -1 90 +Width: 322 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 -2 m 5 + 322 -2 l 5 + 322 265 l 5 + 270 265 l 5 + 270 74 l 5 + 52 74 l 5 + 52 265 l 5 + 0 265 l 5 + 0 -2 l 5 +EndSplineSet +EndChar + +StartChar: NameMe.58898 +Encoding: 1114113 -1 91 +Width: 263 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 418 m 5 + 36 418 l 5 + 130 104 l 5 + 226 418 l 5 + 262 418 l 5 + 130 0 l 5 + 0 418 l 5 +EndSplineSet +EndChar + +StartChar: NameMe.58899 +Encoding: 1114114 -1 92 +Width: 263 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 418 m 5 + 36 418 l 5 + 130 104 l 5 + 226 418 l 5 + 262 418 l 5 + 130 0 l 5 + 0 418 l 5 +EndSplineSet +EndChar + +StartChar: uniE4A0 +Encoding: 58528 58528 93 +Width: 347 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 236 m 5 + 347 117 l 5 + 0 0 l 5 + 0 28 l 5 + 257 117 l 5 + 0 208 l 5 + 0 236 l 5 +EndSplineSet +EndChar + +StartChar: uniE4A1 +Encoding: 58529 58529 94 +Width: 347 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 -236 m 5 + 347 -117 l 5 + 0 0 l 5 + 0 -28 l 5 + 257 -117 l 5 + 0 -208 l 5 + 0 -236 l 5 +EndSplineSet +EndChar + +StartChar: uniE4A8 +Encoding: 58536 58536 95 +Width: 153 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +153 214 m 5 + 116 214 l 5 + 106 210 97.333 200 90 184 c 4 + 86.667 176.667 82 172 76 170 c 5 + 72 171.333 65.333 180 56 196 c 4 + 51.333 204.667 44.667 210.667 36 214 c 5 + 0 214 l 5 + 76 0 l 5 + 153 214 l 5 +EndSplineSet +EndChar + +StartChar: uniE4A9 +Encoding: 58537 58537 96 +Width: 153 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +153 -214 m 1 + 116 -214 l 1 + 106 -210 97.333 -200 90 -184 c 0 + 86.667 -176.667 82 -172 76 -170 c 1 + 72 -171.333 65.333 -180 56 -196 c 0 + 51.333 -204.667 44.667 -210.667 36 -214 c 1 + 0 -214 l 1 + 76 0 l 1 + 153 -214 l 1 +EndSplineSet +EndChar + +StartChar: uniE4AA +Encoding: 58538 58538 97 +Width: 1000 +VWidth: 0 +Flags: HW +LayerCount: 2 +EndChar + +StartChar: uniE4AB +Encoding: 58539 58539 98 +Width: 274 +VWidth: 2048 +Flags: HW +LayerCount: 2 +EndChar + +StartChar: uniE568 +Encoding: 58728 58728 99 +Width: 468 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +468 126 m 4 + 468 195.355 430.486 242.042 362 244 c 4 + 339.333 244 318.333 239 299 229 c 5 + 278.398 216.323 254.209 196.949 235 180 c 5 + 212.439 156.228 189.186 133.147 166 110 c 5 + 150 96 135 85 121 77 c 132 + 107 69 94.667 64.667 84 64 c 4 + 64.2417 64 56.2814 77.5628 47 92 c 5 + 35 118 l 6 + 31.667 127.333 30 133.667 30 137 c 134 + 30 145 l 6 + 30 173.667 43.333 188 70 188 c 5 + 79 186 l 5 + 90 177 l 5 + 97 170 l 5 + 103.447 165.97 111.151 162 121 162 c 4 + 138.333 162 149.333 171.333 154 190 c 5 + 154 224.187 127.229 242.58 96 244 c 5 + 73.1704 244 70.2894 244.34 55 236 c 5 + 22.0184 222.418 0 182.422 0 139 c 4 + 0 88.5491 20.6276 52.237 49 25 c 5 + 67 10.333 85.333 2 104 0 c 5 + 130 0 155 7 179 21 c 4 + 187.667 26.333 193.667 30 197 32 c 6 + 215 47 l 134 + 223.638 54.1975 240.24 69.1328 248 78 c 6 + 313 145 l 5 + 323 154 l 5 + 345 170 l 5 + 358.333 177.333 370.667 181 382 181 c 4 + 419.101 181 437 145.129 437 111 c 4 + 437 83.0401 425.03 56 398 56 c 5 + 391.647 58.1187 387.309 60.7935 381 65 c 6 + 363 78 l 6 + 359.667 80.667 353.667 82 345 82 c 4 + 325.549 82 315.324 64.7595 313 45 c 5 + 313 16.949 341.285 3.28677 371 1 c 5 + 414.494 1 440.733 32.4674 456 63 c 132 + 464.667 80.333 468.667 101.333 468 126 c 4 +EndSplineSet +EndChar + +StartChar: uniE567 +Encoding: 58727 58727 100 +Width: 468 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +468 118 m 4 + 468 48.6445 430.486 1.95801 362 0 c 4 + 339.333 0 318.333 5 299 15 c 5 + 278.397 27.6768 254.209 47.0508 235 64 c 5 + 212.438 87.7725 189.187 110.854 166 134 c 5 + 150 148 135 159 121 167 c 132 + 107 175 94.667 179.333 84 180 c 4 + 64.2422 180 56.2812 166.438 47 152 c 5 + 35 126 l 6 + 31.667 116.667 30 110.333 30 107 c 134 + 30 99 l 6 + 30 70.333 43.333 56 70 56 c 5 + 79 58 l 5 + 90 67 l 5 + 97 74 l 5 + 103.447 78.0293 111.151 82 121 82 c 4 + 138.333 82 149.333 72.667 154 54 c 5 + 154 19.8125 127.229 1.41992 96 0 c 5 + 73.1699 0 70.2891 -0.339844 55 8 c 5 + 22.0186 21.582 0 61.5781 0 105 c 4 + 0 155.451 20.6279 191.763 49 219 c 5 + 67 233.667 85.333 242 104 244 c 5 + 130 244 155 237 179 223 c 4 + 187.667 217.667 193.667 214 197 212 c 6 + 215 197 l 134 + 223.638 189.803 240.24 174.867 248 166 c 6 + 313 99 l 5 + 323 90 l 5 + 345 74 l 5 + 358.333 66.667 370.667 63 382 63 c 4 + 419.102 63 437 98.8711 437 133 c 4 + 437 160.96 425.029 188 398 188 c 5 + 391.646 185.881 387.309 183.206 381 179 c 6 + 363 166 l 6 + 359.667 163.333 353.667 162 345 162 c 4 + 325.549 162 315.324 179.24 313 199 c 5 + 313 227.051 341.285 240.713 371 243 c 5 + 414.493 243 440.732 211.532 456 181 c 132 + 464.667 163.667 468.667 142.667 468 118 c 4 +EndSplineSet +EndChar + +StartChar: uniE56E +Encoding: 58734 58734 101 +Width: 711 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +710 134 m 1 + 601 7 l 2 + 598.333 3.66667 596 1.66667 594 1 c 128 + 591 0 591 0 588 -1 c 1 + 582.649 1 579.316 2.66667 578 4 c 2 + 489 82 l 2 + 484.33 86.6667 478.663 89.3333 472 90 c 1 + 468 88.6667 465.333 87.3333 464 86 c 2 + 398 7 l 1 + 394.667 1.66667 390.333 -1 385 -1 c 1 + 374 4 l 1 + 285 82 l 2 + 279 86.6667 273.667 89.3333 269 90 c 1 + 265 88.6667 262.333 87.3333 261 86 c 2 + 194 7 l 2 + 188.667 1.66667 184 -1 180 -1 c 0 + 178 -1 174.667 0.666667 170 4 c 2 + 82 82 l 2 + 76.6667 86.6667 71 89.3333 65 90 c 1 + 60.3333 88.6667 57.6667 87.3333 57 86 c 2 + 0 18 l 1 + 0 67 l 1 + 108 194 l 1 + 118 198 l 2 + 118.667 198 120 197.667 122 197 c 128 + 124 196.333 128 194 134 190 c 1 + 222 112 l 1 + 232 107 l 1 + 236 107 240.667 109.667 246 115 c 2 + 313 194 l 1 + 316.333 196.667 319 198 321 198 c 0 + 325.667 198 331 195.333 337 190 c 2 + 426 112 l 1 + 437 107 l 1 + 443 108 l 1 + 450 115 l 1 + 517 194 l 1 + 520.333 196.667 522.667 198 524 198 c 0 + 528 196.666 530.667 195.333 532 194 c 2 + 539 188 l 1 + 628 111 l 2 + 631.333 107.667 635 106 639 106 c 128 + 643 106 647.333 108.667 652 114 c 2 + 710 181 l 1 + 710 134 l 1 +EndSplineSet +EndChar + +StartChar: uniE56A +Encoding: 58730 58730 102 +Width: 248 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +126 468 m 4 + 195.355 468 242.042 430.486 244 362 c 4 + 244 339.333 239 318.333 229 299 c 5 + 216.323 278.397 196.949 254.209 180 235 c 5 + 156.228 212.438 133.146 189.187 110 166 c 5 + 96 150 85 135 77 121 c 132 + 69 107 64.667 94.667 64 84 c 4 + 64 64.2422 77.5625 56.2812 92 47 c 5 + 118 35 l 6 + 127.333 31.667 133.667 30 137 30 c 134 + 145 30 l 6 + 173.667 30 188 43.333 188 70 c 5 + 186 79 l 5 + 177 90 l 5 + 170 97 l 5 + 165.971 103.447 162 111.151 162 121 c 4 + 162 138.333 171.333 149.333 190 154 c 5 + 224.188 154 242.58 127.229 244 96 c 5 + 244 73.1699 244.34 70.2891 236 55 c 5 + 222.418 22.0186 182.422 0 139 0 c 4 + 88.5488 0 52.2373 20.6279 25 49 c 5 + 10.333 67 2 85.333 0 104 c 5 + 0 130 7 155 21 179 c 4 + 26.333 187.667 30 193.667 32 197 c 6 + 47 215 l 134 + 54.1973 223.638 69.1328 240.24 78 248 c 6 + 145 313 l 5 + 154 323 l 5 + 170 345 l 5 + 177.333 358.333 181 370.667 181 382 c 4 + 181 419.102 145.129 437 111 437 c 4 + 83.04 437 56 425.029 56 398 c 5 + 58.1191 391.646 60.7939 387.309 65 381 c 6 + 78 363 l 6 + 80.667 359.667 82 353.667 82 345 c 4 + 82 325.549 64.7598 315.324 45 313 c 5 + 16.9492 313 3.28711 341.285 1 371 c 5 + 1 414.493 32.4678 440.732 63 456 c 132 + 80.333 464.667 101.333 468.667 126 468 c 4 +EndSplineSet +EndChar + +StartChar: uniE569 +Encoding: 58729 58729 103 +Width: 248 +VWidth: 2048 +Flags: HW +LayerCount: 2 +EndChar + +StartChar: uniE4AC +Encoding: 58540 58540 104 +Width: 274 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +273 0 m 5 + 214 0 l 5 + 106 180 l 5 + 24 0 l 5 + 0 0 l 5 + 114 265 l 5 + 273 0 l 5 +EndSplineSet +EndChar + +StartChar: uniE4AD +Encoding: 58541 58541 105 +Width: 274 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +273 0 m 5 + 214 0 l 5 + 106 -180 l 5 + 24 0 l 5 + 0 0 l 5 + 114 -265 l 5 + 273 0 l 5 +EndSplineSet +EndChar + +StartChar: uniE56B +Encoding: 58731 58731 106 +Width: 248 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +118 468 m 4 + 48.6445 468 1.95801 430.486 0 362 c 4 + 0 339.333 5 318.333 15 299 c 5 + 27.6768 278.397 47.0508 254.209 64 235 c 5 + 87.7725 212.438 110.854 189.187 134 166 c 5 + 148 150 159 135 167 121 c 132 + 175 107 179.333 94.667 180 84 c 4 + 180 64.2422 166.438 56.2812 152 47 c 5 + 126 35 l 6 + 116.667 31.667 110.333 30 107 30 c 134 + 99 30 l 6 + 70.333 30 56 43.333 56 70 c 5 + 58 79 l 5 + 67 90 l 5 + 74 97 l 5 + 78.0293 103.447 82 111.151 82 121 c 4 + 82 138.333 72.667 149.333 54 154 c 5 + 19.8125 154 1.41992 127.229 0 96 c 5 + 0 73.1699 -0.339844 70.2891 8 55 c 5 + 21.582 22.0186 61.5781 0 105 0 c 4 + 155.451 0 191.763 20.6279 219 49 c 5 + 233.667 67 242 85.333 244 104 c 5 + 244 130 237 155 223 179 c 4 + 217.667 187.667 214 193.667 212 197 c 6 + 197 215 l 134 + 189.803 223.638 174.867 240.24 166 248 c 6 + 99 313 l 5 + 90 323 l 5 + 74 345 l 5 + 66.667 358.333 63 370.667 63 382 c 4 + 63 419.102 98.8711 437 133 437 c 4 + 160.96 437 188 425.029 188 398 c 5 + 185.881 391.646 183.206 387.309 179 381 c 6 + 166 363 l 6 + 163.333 359.667 162 353.667 162 345 c 4 + 162 325.549 179.24 315.324 199 313 c 5 + 227.051 313 240.713 341.285 243 371 c 5 + 243 414.493 211.532 440.732 181 456 c 132 + 163.667 464.667 142.667 468.667 118 468 c 4 +EndSplineSet +EndChar + +StartChar: uniE938 +Encoding: 59704 59704 107 +Width: 312 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +155 194 m 5 + 312 0 l 5 + 155 -192 l 5 + 0 0 l 5 + 155 194 l 5 +EndSplineSet +EndChar + +StartChar: uniE939 +Encoding: 59705 59705 108 +Width: 312 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +155 194 m 5 + 312 0 l 5 + 155 -192 l 5 + 0 0 l 5 + 155 194 l 5 +125 111 m 5 + 68 38 l 5 + 190 -111 l 5 + 246 -40 l 5 + 125 111 l 5 +EndSplineSet +EndChar + +StartChar: uniE93C +Encoding: 59708 59708 109 +Width: 312 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +155 194 m 5 + 312 0 l 5 + 155 -192 l 5 + 0 0 l 5 + 155 194 l 5 +125 111 m 5 + 68 38 l 5 + 190 -111 l 5 + 246 -40 l 5 + 125 111 l 5 +EndSplineSet +EndChar + +StartChar: uniE93D +Encoding: 59709 59709 110 +Width: 312 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +155 194 m 5 + 312 0 l 5 + 155 -192 l 5 + 0 0 l 5 + 155 194 l 5 +EndSplineSet +EndChar +EndChars +EndSplineFont diff --git a/fonts/Leipzig.svg b/fonts/Leipzig.svg index 8f24098d36a..dff789bf908 100644 --- a/fonts/Leipzig.svg +++ b/fonts/Leipzig.svg @@ -1,13 +1,15 @@ -Created by FontForge 20120731 at Sun Aug 16 18:52:26 2015 +Created by FontForge 20120731 at Mon Aug 24 12:43:09 2015 By laurent Created by Etienne Darbellay, Jean-Francois Marti and Laurent Pugin with FontForge 2.0. This font is licensed under the SIL Open Font License \(http://scripts.sil.org/OFL\). +Version 5.2.0 @@ -20,10 +22,10 @@ Created by Etienne Darbellay, Jean-Francois Marti and Laurent Pugin with FontFor ascent="800" descent="-200" x-height="265" - bbox="-163 -893 1245 1317" + bbox="-163 -893 1230 1317" underline-thickness="50" underline-position="-50" - unicode-range="U+0075-E88A" + unicode-range="U+0075-E93D" /> +d="M17 87c0 11 3 19 10 26s16 10 27 10s19 -3 26 -10s11 -16 11 -26s-4 -19 -11 -27c-7 -7 -17 -10 -27 -10s-19 3 -26 10s-10 16 -10 27zM53 207c0 11 4 20 11 27s17 10 27 10s19 -4 26 -11s10 -16 10 -26s-4 -19 -11 -26s-16 -10 -26 -10s-19 3 -26 10s-11 15 -11 26z" /> - +d="M-91 -179c-2 -2.66699 -2.66699 -5 -2 -7s4.33301 -3.33301 11 -4c18.667 0 34.333 13.667 47 41c6.66699 14 13.333 30 20 48s11.667 35.333 15 52l14 61l44 208h-58v38h70c7.33301 20.667 13.333 36.333 18 47c7.33301 18 14.667 32.667 22 44 +c20.666 30 42.333 53 65 69s47.667 24 75 24c9.33301 0 17 -1 23 -3s12.333 -7.33301 19 -16c4.66699 -6.66699 7.66699 -13 9 -19l4 -16c0 -14.667 -0.666992 -25.334 -2 -32c-1.33301 -6.66699 -5 -16 -11 -28c-2.66699 -6 -8.66699 -13 -18 -21 +c-4 -3.33301 -8.33301 -5.33301 -13 -6s-10.333 -0.666992 -17 0c-6 1.33301 -10.333 5 -13 11s-4.66699 12.667 -6 20c0 12 2.33301 22.667 7 32s12 17.333 22 24l14 10c0 8.66699 -6 14 -18 16c-13.333 1.33008 -24.667 -1.33691 -34 -8 +c-9.33301 -6.66699 -19 -21 -29 -43c-4.66699 -12 -10.333 -29.667 -17 -53s-11.333 -40 -14 -50h77v-40h-85c-12 -68.667 -29 -137.333 -51 -206c-18 -55.333 -35.333 -99 -52 -131c-13.333 -26 -27 -47 -41 -63c-24.667 -28.667 -50 -43 -76 -43 +c-24.666 0 -43.333 9.66699 -56 29c-10 15.333 -15 33.333 -15 54c0 16.667 4 32.667 12 48c4.66699 7.33301 10.333 13 17 17s13.333 6 20 6c8.66699 0 15.667 -4 21 -12s9 -15.333 11 -22s3 -12.333 3 -17c0 -9.33301 -2.33301 -17.333 -7 -24 +c-4.66406 -6.66699 -9.33008 -13.667 -14 -21c-4.66406 -7.33301 -8.33008 -12 -11 -14z" /> + - - - - + + + + + + + diff --git a/include/vrv/att.h b/include/vrv/att.h index bf1ef45e8f6..ffd34743c8f 100644 --- a/include/vrv/att.h +++ b/include/vrv/att.h @@ -191,6 +191,9 @@ class Att std::string StemPositionToStr(data_STEMPOSITION data); data_STEMPOSITION StrToStemPosition(std::string value); + std::string SymbolToStr(data_SYMBOL data); + data_SYMBOL StrToSymbol(std::string value); + std::string TempusToStr(data_TEMPUS data); data_TEMPUS StrToTempus(std::string value); diff --git a/include/vrv/attdef.h b/include/vrv/attdef.h index ab17294a02e..dcd70a4338d 100644 --- a/include/vrv/attdef.h +++ b/include/vrv/attdef.h @@ -391,6 +391,16 @@ enum data_PLACE { PLACE_above, PLACE_below }; + +/** + * MEI values for @symbol (no datatype in MEI) + */ +enum data_SYMBOL { + SYMBOL_NONE = 0, + SYMBOL_brace, + SYMBOL_bracket, + SYMBOL_line +}; /** * MEI data.STAFFREL diff --git a/include/vrv/iomei.h b/include/vrv/iomei.h index d19ca00dc15..f92972fe113 100644 --- a/include/vrv/iomei.h +++ b/include/vrv/iomei.h @@ -205,9 +205,7 @@ class MeiOutput: public FileOutputStream /** @name Methods for converting members into MEI attributes. */ ///@{ std::string UuidToMeiStr( Object *element ); - std::string BoolToStr(bool value ); std::string DocTypeToStr(DocType type); - std::string StaffGrpSymbolToStr(StaffGrpSymbol symbol); ///@} @@ -394,9 +392,7 @@ class MeiInput: public FileInputStream */ ///@{ void SetMeiUuid( pugi::xml_node element, Object *object ); - bool StrToBool(std::string value); DocType StrToDocType(std::string type); - StaffGrpSymbol StrToStaffGrpSymbol(std::string sign); /** Extract the uuid for references to uuids with ..#uuid values */ std::string ExtractUuidFragment(std::string refUuid); ///@} diff --git a/include/vrv/scoredef.h b/include/vrv/scoredef.h index 4a1cdd4e0df..e4c290c9637 100644 --- a/include/vrv/scoredef.h +++ b/include/vrv/scoredef.h @@ -194,7 +194,10 @@ class ScoreDef: public ScoreDefElement, public ObjectListInterface * This class represents a MEI staffGrp. * It contains StaffDef objects. */ -class StaffGrp: public Object, public ObjectListInterface +class StaffGrp: public Object, public ObjectListInterface, + public AttLabelsAddl, + public AttStaffgroupingsym, + public AttStaffGrpVis { public: /** @@ -218,22 +221,6 @@ class StaffGrp: public Object, public ObjectListInterface void AddStaffGrp( StaffGrp *staffGrp ); ///@} - /** - * @name Set and get the staffGrp @symbol - */ - ///@{ - StaffGrpSymbol GetSymbol() const { return m_symbol; }; - void SetSymbol( StaffGrpSymbol symbol ) { m_symbol = symbol; }; - ///@} - - /** - * @name Set and get the staffGrp @barthru - */ - ///@{ - bool GetBarthru() const { return m_barthru; }; - void SetBarthru( bool barthru ) { m_barthru = barthru; }; - ///@} - //----------// // Functors // //----------// @@ -250,8 +237,6 @@ class StaffGrp: public Object, public ObjectListInterface public: private: - StaffGrpSymbol m_symbol; - bool m_barthru; }; diff --git a/include/vrv/vrvdef.h b/include/vrv/vrvdef.h index 967580df235..2bd143f42a8 100644 --- a/include/vrv/vrvdef.h +++ b/include/vrv/vrvdef.h @@ -222,14 +222,6 @@ enum EditorialLevel { #define ON 1 #define OFF 0 -// the maximum is 255 (unsigned char) -enum StaffGrpSymbol { - STAFFGRP_NONE = 0, - STAFFGRP_LINE, - STAFFGRP_BRACE, - STAFFGRP_BRACKET -}; - /* This is used for fast clef offset calculation. * It uses 4 bytes with, from right to left * - line diff --git a/libmei/atts_shared.cpp b/libmei/atts_shared.cpp index ec849f617a5..37f32118e4c 100644 --- a/libmei/atts_shared.cpp +++ b/libmei/atts_shared.cpp @@ -5341,13 +5341,13 @@ AttStaffGrpVis::~AttStaffGrpVis() { } void AttStaffGrpVis::ResetStaffGrpVis() { - m_barthru = ""; + m_barthru = BOOLEAN_NONE; } bool AttStaffGrpVis::ReadStaffGrpVis( pugi::xml_node element ) { bool hasAttribute = false; if (element.attribute("barthru")) { - this->SetBarthru(StrToStr(element.attribute("barthru").value())); + this->SetBarthru(StrToBool(element.attribute("barthru").value())); element.remove_attribute("barthru"); hasAttribute = true; } @@ -5357,7 +5357,7 @@ bool AttStaffGrpVis::ReadStaffGrpVis( pugi::xml_node element ) { bool AttStaffGrpVis::WriteStaffGrpVis( pugi::xml_node element ) { bool wroteAttribute = false; if (this->HasBarthru()) { - element.append_attribute("barthru") = StrToStr(this->GetBarthru()).c_str(); + element.append_attribute("barthru") = BoolToStr(this->GetBarthru()).c_str(); wroteAttribute = true; } return wroteAttribute; @@ -5365,7 +5365,7 @@ bool AttStaffGrpVis::WriteStaffGrpVis( pugi::xml_node element ) { bool AttStaffGrpVis::HasBarthru( ) { - return (m_barthru != ""); + return (m_barthru != BOOLEAN_NONE); } @@ -5384,13 +5384,13 @@ AttStaffgroupingsym::~AttStaffgroupingsym() { } void AttStaffgroupingsym::ResetStaffgroupingsym() { - m_symbol = ""; + m_symbol = SYMBOL_NONE; } bool AttStaffgroupingsym::ReadStaffgroupingsym( pugi::xml_node element ) { bool hasAttribute = false; if (element.attribute("symbol")) { - this->SetSymbol(StrToStr(element.attribute("symbol").value())); + this->SetSymbol(StrToSymbol(element.attribute("symbol").value())); element.remove_attribute("symbol"); hasAttribute = true; } @@ -5400,7 +5400,7 @@ bool AttStaffgroupingsym::ReadStaffgroupingsym( pugi::xml_node element ) { bool AttStaffgroupingsym::WriteStaffgroupingsym( pugi::xml_node element ) { bool wroteAttribute = false; if (this->HasSymbol()) { - element.append_attribute("symbol") = StrToStr(this->GetSymbol()).c_str(); + element.append_attribute("symbol") = SymbolToStr(this->GetSymbol()).c_str(); wroteAttribute = true; } return wroteAttribute; @@ -5408,7 +5408,7 @@ bool AttStaffgroupingsym::WriteStaffgroupingsym( pugi::xml_node element ) { bool AttStaffgroupingsym::HasSymbol( ) { - return (m_symbol != ""); + return (m_symbol != SYMBOL_NONE); } @@ -8041,7 +8041,7 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu AttStaffGrpVis *att = dynamic_cast(element); assert( att ); if (attrType == "barthru") { - att->SetBarthru(att->StrToStr(attrValue)); + att->SetBarthru(att->StrToBool(attrValue)); return true; } } @@ -8049,7 +8049,7 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu AttStaffgroupingsym *att = dynamic_cast(element); assert( att ); if (attrType == "symbol") { - att->SetSymbol(att->StrToStr(attrValue)); + att->SetSymbol(att->StrToSymbol(attrValue)); return true; } } @@ -9284,14 +9284,14 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { AttStaffGrpVis *att = dynamic_cast(element); assert( att ); if (att->HasBarthru()) { - attributes->push_back(std::make_pair("barthru", att->StrToStr(att->GetBarthru()))); + attributes->push_back(std::make_pair("barthru", att->BoolToStr(att->GetBarthru()))); } } if (element->HasAttClass( ATT_STAFFGROUPINGSYM ) ) { AttStaffgroupingsym *att = dynamic_cast(element); assert( att ); if (att->HasSymbol()) { - attributes->push_back(std::make_pair("symbol", att->StrToStr(att->GetSymbol()))); + attributes->push_back(std::make_pair("symbol", att->SymbolToStr(att->GetSymbol()))); } } if (element->HasAttClass( ATT_STAFFIDENT ) ) { diff --git a/libmei/atts_shared.h b/libmei/atts_shared.h index 4b92719eb4c..ff8119ece2a 100644 --- a/libmei/atts_shared.h +++ b/libmei/atts_shared.h @@ -4516,8 +4516,8 @@ class AttStaffGrpVis: public Att * to the default value) **/ ///@{ - void SetBarthru(std::string barthru_) { m_barthru = barthru_; }; - std::string GetBarthru() const { return m_barthru; }; + void SetBarthru(data_BOOLEAN barthru_) { m_barthru = barthru_; }; + data_BOOLEAN GetBarthru() const { return m_barthru; }; bool HasBarthru( ); ///@} @@ -4527,7 +4527,7 @@ class AttStaffGrpVis: public Att * Indicates whether bar lines go across the space between staves (true) or are * only drawn across the lines of each staff (false). **/ - std::string m_barthru; + data_BOOLEAN m_barthru; /* include */ }; @@ -4557,15 +4557,15 @@ class AttStaffgroupingsym: public Att * to the default value) **/ ///@{ - void SetSymbol(std::string symbol_) { m_symbol = symbol_; }; - std::string GetSymbol() const { return m_symbol; }; + void SetSymbol(data_SYMBOL symbol_) { m_symbol = symbol_; }; + data_SYMBOL GetSymbol() const { return m_symbol; }; bool HasSymbol( ); ///@} private: /** Specifies the symbol used to group a set of staves. **/ - std::string m_symbol; + data_SYMBOL m_symbol; /* include */ }; diff --git a/src/att.cpp b/src/att.cpp index 107ef5f5c41..6c7c9aa2d93 100644 --- a/src/att.cpp +++ b/src/att.cpp @@ -1005,6 +1005,33 @@ data_STEMPOSITION Att::StrToStemPosition(std::string value) return STEMPOSITION_NONE; } +std::string Att::SymbolToStr(data_SYMBOL data) +{ + std::string value; + switch(data) + { + case SYMBOL_brace : value = "brace"; break; + case SYMBOL_bracket: value = "bracket"; break; + case SYMBOL_line: value = "line"; break; + default: + LogWarning("Unknown symbol '%d'", data); + value = ""; + break; + } + return value; +} + +data_SYMBOL Att::StrToSymbol(std::string value) +{ + if (value == "brace") return SYMBOL_brace; + else if (value == "bracket") return SYMBOL_bracket; + else if (value == "line") return SYMBOL_line; + else { + LogWarning("Unsupported symbol '%s'", value.c_str() ); + } + return SYMBOL_NONE; +} + std::string Att::TieToStr(data_TIE data) { std::string value; diff --git a/src/iomei.cpp b/src/iomei.cpp index 7fba61b9061..c3ebb90e262 100644 --- a/src/iomei.cpp +++ b/src/iomei.cpp @@ -410,12 +410,10 @@ bool MeiOutput::WriteMeiStaffGrp( pugi::xml_node currentNode, StaffGrp *staffGrp assert( staffGrp ); currentNode.append_attribute( "xml:id" ) = UuidToMeiStr( staffGrp ).c_str(); - if ( staffGrp->GetSymbol() != STAFFGRP_NONE ) { - currentNode.append_attribute( "symbol" ) = StaffGrpSymbolToStr( staffGrp->GetSymbol() ).c_str(); - } - if ( staffGrp->GetBarthru() ) { - currentNode.append_attribute( "barthru" ) = BoolToStr( staffGrp->GetBarthru() ).c_str(); - } + + staffGrp->WriteLabelsAddl(currentNode); + staffGrp->WriteStaffgroupingsym(currentNode); + staffGrp->WriteStaffGrpVis(currentNode); return true; } @@ -855,12 +853,6 @@ bool MeiOutput::WriteMeiAnnot( pugi::xml_node currentNode, Annot *annot ) return true; }; - -std::string MeiOutput::BoolToStr(bool value) -{ - if (value) return "true"; - return "false"; -} std::string MeiOutput::DocTypeToStr(DocType type) { @@ -878,21 +870,6 @@ std::string MeiOutput::DocTypeToStr(DocType type) return value; } -std::string MeiOutput::StaffGrpSymbolToStr(StaffGrpSymbol symbol) -{ - std::string value; - switch(symbol) - { case STAFFGRP_LINE : value = "line"; break; - case STAFFGRP_BRACE : value = "brace"; break; - case STAFFGRP_BRACKET : value = "bracket"; break; - default: - LogWarning("Unknown staffGrp @symbol '%d'", symbol); - value = "line"; - break; - } - return value; -} - //---------------------------------------------------------------------------- // MeiInput //---------------------------------------------------------------------------- @@ -1269,12 +1246,9 @@ bool MeiInput::ReadMeiStaffGrp( Object *parent, pugi::xml_node staffGrp ) StaffGrp *vrvStaffGrp = new StaffGrp( ); SetMeiUuid( staffGrp, vrvStaffGrp ); - if ( staffGrp.attribute( "symbol" ) ) { - vrvStaffGrp->SetSymbol( StrToStaffGrpSymbol( staffGrp.attribute( "symbol" ).value() ) ); - } - if ( staffGrp.attribute( "barthru" ) ) { - vrvStaffGrp->SetBarthru( StrToBool( staffGrp.attribute( "barthru" ).value() ) ); - } + vrvStaffGrp->ReadLabelsAddl(staffGrp); + vrvStaffGrp->ReadStaffGrpVis(staffGrp); + vrvStaffGrp->ReadStaffgroupingsym(staffGrp); AddStaffGrp(parent, vrvStaffGrp); @@ -2390,12 +2364,6 @@ void MeiInput::SetMeiUuid( pugi::xml_node element, Object *object ) object->SetUuid( element.attribute( "xml:id" ).value() ); element.remove_attribute("xml:id"); } - -bool MeiInput::StrToBool(std::string value) -{ - if (value == "false") return false; - return true; -} DocType MeiInput::StrToDocType(std::string type) { @@ -2408,18 +2376,6 @@ DocType MeiInput::StrToDocType(std::string type) // default return Raw; } - -StaffGrpSymbol MeiInput::StrToStaffGrpSymbol(std::string symbol) -{ - if (symbol == "line") return STAFFGRP_LINE; - else if (symbol == "brace") return STAFFGRP_BRACE; - else if (symbol == "bracket") return STAFFGRP_BRACKET; - else { - LogWarning("Unknown staffGrp @symbol '%s'", symbol.c_str() ); - } - // default - return STAFFGRP_LINE; -} std::string MeiInput::ExtractUuidFragment(std::string refUuid) { diff --git a/src/scoredef.cpp b/src/scoredef.cpp index 41f52b8d850..3b99e8e586f 100644 --- a/src/scoredef.cpp +++ b/src/scoredef.cpp @@ -343,8 +343,14 @@ void ScoreDef::SetRedrawFlags( bool clef, bool keySig, bool mensur, bool meterSi //---------------------------------------------------------------------------- StaffGrp::StaffGrp() : - Object(), ObjectListInterface() + Object(), ObjectListInterface(), + AttLabelsAddl(), + AttStaffgroupingsym(), + AttStaffGrpVis() { + RegisterAttClass(ATT_LABELSADDL); + RegisterAttClass(ATT_STAFFGROUPINGSYM); + RegisterAttClass(ATT_STAFFGRPVIS); Reset(); } @@ -355,8 +361,9 @@ StaffGrp::~StaffGrp() void StaffGrp::Reset() { Object::Reset(); - m_symbol = STAFFGRP_NONE; - m_barthru = false; + ResetLabelsAddl(); + ResetStaffgroupingsym(); + ResetStaffGrpVis(); } void StaffGrp::AddStaffDef( StaffDef *staffDef ) diff --git a/src/view_page.cpp b/src/view_page.cpp index be067735576..25b1f4e5b4e 100644 --- a/src/view_page.cpp +++ b/src/view_page.cpp @@ -237,17 +237,17 @@ void View::DrawStaffGrp( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp y_bottom -= m_doc->GetDrawingStaffLineWidth(100) / 2; // actually draw the line, the brace or the bracket - if ( topStaffGrp && ( (firstDef != lastDef) || (staffGrp->GetSymbol() != STAFFGRP_NONE) ) ) { + if ( topStaffGrp && ( (firstDef != lastDef) || (staffGrp->GetSymbol() != SYMBOL_NONE) ) ) { DrawVerticalLine( dc , y_top, y_bottom, x, barLineWidth); } // this will need to be changed with the next version of MEI will line means additional thick line - if ( staffGrp->GetSymbol() == STAFFGRP_LINE ) { + if ( staffGrp->GetSymbol() == SYMBOL_line ) { DrawVerticalLine( dc , y_top, y_bottom, x, barLineWidth); } - else if ( staffGrp->GetSymbol() == STAFFGRP_BRACE ) { + else if ( staffGrp->GetSymbol() == SYMBOL_brace ) { DrawBrace ( dc, x, y_top, y_bottom, last->m_drawingStaffSize ); } - else if ( staffGrp->GetSymbol() == STAFFGRP_BRACKET ) { + else if ( staffGrp->GetSymbol() == SYMBOL_bracket ) { DrawBracket( dc, x, y_top, y_bottom, last->m_drawingStaffSize ); x -= 2 * m_doc->GetDrawingBeamWidth(100, false) - m_doc->GetDrawingBeamWhiteWidth(100, false); } @@ -444,8 +444,8 @@ void View::DrawBarlines( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp assert( staffGrp ); assert( barLine ); - if ( !staffGrp->GetBarthru() ) { - // recursively draw the children (staffDef or staffGrp) + if (staffGrp->GetBarthru() != BOOLEAN_true) { + // recursively draw the children (staffDef or staffGrp) - we assume @barthru is false by default int i; StaffGrp *childStaffGrp = NULL; StaffDef *childStaffDef = NULL; From d6ccf0ca7a6c960e9a909ba4f7aa03ec1529d39a Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Mon, 24 Aug 2015 20:35:17 +0200 Subject: [PATCH 083/114] Adding staffGrp label and label.abbr support --- include/vrv/scoredef.h | 1 + include/vrv/view.h | 2 +- src/iomei.cpp | 2 ++ src/scoredef.cpp | 6 ++++-- src/view_page.cpp | 44 ++++++++++++++++++++++++++++++++++++++---- 5 files changed, 48 insertions(+), 7 deletions(-) diff --git a/include/vrv/scoredef.h b/include/vrv/scoredef.h index e4c290c9637..c77c9f3eb33 100644 --- a/include/vrv/scoredef.h +++ b/include/vrv/scoredef.h @@ -195,6 +195,7 @@ class ScoreDef: public ScoreDefElement, public ObjectListInterface * It contains StaffDef objects. */ class StaffGrp: public Object, public ObjectListInterface, + public AttCommon, public AttLabelsAddl, public AttStaffgroupingsym, public AttStaffGrpVis diff --git a/include/vrv/view.h b/include/vrv/view.h index ad895604b00..ee40795fa1c 100644 --- a/include/vrv/view.h +++ b/include/vrv/view.h @@ -145,7 +145,7 @@ class View void DrawSystem( DeviceContext *dc, System *system ); void DrawSystemList( DeviceContext *dc, System *system, const ClassId classId ); void DrawScoreDef( DeviceContext *dc, ScoreDef *scoreDef, Measure *measure, int x, Barline *barLine = NULL ); - void DrawStaffGrp( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp, int x, bool topStaffGrp = false ); + void DrawStaffGrp( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp, int x, bool topStaffGrp = false, bool abbreviations = false ); void DrawStaffDefLabels( DeviceContext *dc, Measure *measure, ScoreDef *scoreDef, bool abbreviations = false ); void DrawBracket ( DeviceContext *dc, int x, int y1, int y2, int staffSize); void DrawBrace ( DeviceContext *dc, int x, int y1, int y2, int staffSize); diff --git a/src/iomei.cpp b/src/iomei.cpp index 40b79824315..00f17d8d718 100644 --- a/src/iomei.cpp +++ b/src/iomei.cpp @@ -416,6 +416,7 @@ bool MeiOutput::WriteMeiStaffGrp( pugi::xml_node currentNode, StaffGrp *staffGrp currentNode.append_attribute( "xml:id" ) = UuidToMeiStr( staffGrp ).c_str(); + staffGrp->WriteCommon(currentNode); staffGrp->WriteLabelsAddl(currentNode); staffGrp->WriteStaffgroupingsym(currentNode); staffGrp->WriteStaffGrpVis(currentNode); @@ -1258,6 +1259,7 @@ bool MeiInput::ReadMeiStaffGrp( Object *parent, pugi::xml_node staffGrp ) StaffGrp *vrvStaffGrp = new StaffGrp( ); SetMeiUuid( staffGrp, vrvStaffGrp ); + vrvStaffGrp->ReadCommon(staffGrp); vrvStaffGrp->ReadLabelsAddl(staffGrp); vrvStaffGrp->ReadStaffGrpVis(staffGrp); vrvStaffGrp->ReadStaffgroupingsym(staffGrp); diff --git a/src/scoredef.cpp b/src/scoredef.cpp index 3b99e8e586f..49c81fbb8b4 100644 --- a/src/scoredef.cpp +++ b/src/scoredef.cpp @@ -342,12 +342,13 @@ void ScoreDef::SetRedrawFlags( bool clef, bool keySig, bool mensur, bool meterSi // StaffGrp //---------------------------------------------------------------------------- -StaffGrp::StaffGrp() : - Object(), ObjectListInterface(), +StaffGrp::StaffGrp() : Object(), ObjectListInterface(), + AttCommon(), AttLabelsAddl(), AttStaffgroupingsym(), AttStaffGrpVis() { + RegisterAttClass(ATT_COMMON); RegisterAttClass(ATT_LABELSADDL); RegisterAttClass(ATT_STAFFGROUPINGSYM); RegisterAttClass(ATT_STAFFGRPVIS); @@ -361,6 +362,7 @@ StaffGrp::~StaffGrp() void StaffGrp::Reset() { Object::Reset(); + ResetCommon(); ResetLabelsAddl(); ResetStaffgroupingsym(); ResetStaffGrpVis(); diff --git a/src/view_page.cpp b/src/view_page.cpp index 2c494b35c23..46cc8bb22b8 100644 --- a/src/view_page.cpp +++ b/src/view_page.cpp @@ -179,7 +179,7 @@ void View::DrawScoreDef( DeviceContext *dc, ScoreDef *scoreDef, Measure *measure if ( barLine == NULL) { // Draw the first staffGrp and from there its children recursively - DrawStaffGrp( dc, measure, staffGrp, x, true ); + DrawStaffGrp( dc, measure, staffGrp, x, true, !scoreDef->DrawLabels() ); DrawStaffDefLabels( dc, measure, scoreDef, !scoreDef->DrawLabels() ); // if this was true (non-abbreviated labels), set it to false for next one @@ -195,12 +195,14 @@ void View::DrawScoreDef( DeviceContext *dc, ScoreDef *scoreDef, Measure *measure return; } -void View::DrawStaffGrp( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp, int x, bool topStaffGrp ) +void View::DrawStaffGrp( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp, int x, bool topStaffGrp, bool abbreviations ) { assert( dc ); assert( measure ); assert( staffGrp ); + int w, h; + ListOfObjects *staffDefs = staffGrp->GetList( staffGrp ); if ( staffDefs->empty() ) { return; @@ -236,6 +238,40 @@ void View::DrawStaffGrp( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp y_top += m_doc->GetDrawingStaffLineWidth(100) / 2; y_bottom -= m_doc->GetDrawingStaffLineWidth(100) / 2; + if (staffGrp->HasLabel()) { + std::string label = staffGrp->GetLabel(); + if ( abbreviations ) { + label = staffGrp->GetLabelAbbr(); + } + + if ( label.length() != 0) { + // HARDCODED + int x_label = x - 4 * m_doc->GetDrawingBeamWidth(100, false); + int y_label = y_bottom - (y_bottom - y_top) / 2 - m_doc->GetDrawingUnit(100); + + dc->SetBrush( m_currentColour, AxSOLID ); + dc->SetFont(m_doc->GetDrawingLyricFont(100)); + + dc->GetTextExtent(label, &w, &h); + + // keep the widest width for the system + System *system = dynamic_cast(measure->GetFirstParent( SYSTEM ) ); + if (!system) { + LogDebug("Staff or System missing in View::DrawStaffDefLabels"); + } + else { + system->SetDrawingLabelsWidth( w ); + } + + dc->StartText( ToDeviceContextX( x_label ), ToDeviceContextY( y_label ), RIGHT ); + dc->DrawText( label ); + dc->EndText( ); + + dc->ResetFont(); + dc->ResetBrush(); + } + } + // actually draw the line, the brace or the bracket if ( topStaffGrp && ( (firstDef != lastDef) || (staffGrp->GetSymbol() != SYMBOL_NONE) ) ) { DrawVerticalLine( dc , y_top, y_bottom, x, barLineWidth); @@ -258,11 +294,10 @@ void View::DrawStaffGrp( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp for (i = 0; i < staffGrp->GetChildCount(); i++) { childStaffGrp = dynamic_cast(staffGrp->GetChild( i )); if ( childStaffGrp ) { - DrawStaffGrp( dc, measure, childStaffGrp, x ); + DrawStaffGrp( dc, measure, childStaffGrp, x, false, abbreviations ); } } } - void View::DrawStaffDefLabels( DeviceContext *dc, Measure *measure, ScoreDef *scoreDef, bool abbreviations ) { @@ -303,6 +338,7 @@ void View::DrawStaffDefLabels( DeviceContext *dc, Measure *measure, ScoreDef *sc continue; } + // HARDCODED int x = system->GetDrawingX() - 3 * m_doc->GetDrawingBeamWidth(100, false); int y = staff->GetDrawingY() - (staffDef->GetLines() * m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) / 2); From 1845e6ea46572eb4c5c37abebf9240208b01f8d1 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Mon, 24 Aug 2015 21:51:44 +0200 Subject: [PATCH 084/114] Adding SMuFL repeat signs --- data/Bravura.xml | 3 + .../E101-noteheadSlashHorizontalEnds.xml | 8 + data/Bravura/E501-repeat2Bars.xml | 8 + data/Bravura/E502-repeat4Bars.xml | 8 + data/Gootville.xml | 3 + .../E101-noteheadSlashHorizontalEnds.xml | 8 + data/Gootville/E501-repeat2Bars.xml | 8 + data/Gootville/E502-repeat4Bars.xml | 8 + data/Leipzig.xml | 3 + .../E101-noteheadSlashHorizontalEnds.xml | 8 + data/Leipzig/E501-repeat2Bars.xml | 8 + data/Leipzig/E502-repeat4Bars.xml | 8 + fonts/Leipzig-5.2.sfd | 180 ++++++++++++++---- fonts/Leipzig.svg | 21 +- fonts/supported.xsl | 6 +- include/vrv/mrpt.h | 48 +++++ include/vrv/smufl.h | 5 +- src/mrpt.cpp | 32 ++++ 18 files changed, 326 insertions(+), 47 deletions(-) create mode 100644 data/Bravura/E101-noteheadSlashHorizontalEnds.xml create mode 100644 data/Bravura/E501-repeat2Bars.xml create mode 100644 data/Bravura/E502-repeat4Bars.xml create mode 100644 data/Gootville/E101-noteheadSlashHorizontalEnds.xml create mode 100644 data/Gootville/E501-repeat2Bars.xml create mode 100644 data/Gootville/E502-repeat4Bars.xml create mode 100644 data/Leipzig/E101-noteheadSlashHorizontalEnds.xml create mode 100644 data/Leipzig/E501-repeat2Bars.xml create mode 100644 data/Leipzig/E502-repeat4Bars.xml create mode 100644 include/vrv/mrpt.h create mode 100644 src/mrpt.cpp diff --git a/data/Bravura.xml b/data/Bravura.xml index 1f5ee4c7ff6..023eb2ac331 100644 --- a/data/Bravura.xml +++ b/data/Bravura.xml @@ -39,6 +39,7 @@ + @@ -73,6 +74,8 @@ + + diff --git a/data/Bravura/E101-noteheadSlashHorizontalEnds.xml b/data/Bravura/E101-noteheadSlashHorizontalEnds.xml new file mode 100644 index 00000000000..f89fe9537e0 --- /dev/null +++ b/data/Bravura/E101-noteheadSlashHorizontalEnds.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/data/Bravura/E501-repeat2Bars.xml b/data/Bravura/E501-repeat2Bars.xml new file mode 100644 index 00000000000..10ca88a9e8d --- /dev/null +++ b/data/Bravura/E501-repeat2Bars.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/data/Bravura/E502-repeat4Bars.xml b/data/Bravura/E502-repeat4Bars.xml new file mode 100644 index 00000000000..91f7f64d70e --- /dev/null +++ b/data/Bravura/E502-repeat4Bars.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/data/Gootville.xml b/data/Gootville.xml index b2347f14f54..0c8dde65e05 100644 --- a/data/Gootville.xml +++ b/data/Gootville.xml @@ -35,6 +35,7 @@ + @@ -69,6 +70,8 @@ + + diff --git a/data/Gootville/E101-noteheadSlashHorizontalEnds.xml b/data/Gootville/E101-noteheadSlashHorizontalEnds.xml new file mode 100644 index 00000000000..bc609737107 --- /dev/null +++ b/data/Gootville/E101-noteheadSlashHorizontalEnds.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/data/Gootville/E501-repeat2Bars.xml b/data/Gootville/E501-repeat2Bars.xml new file mode 100644 index 00000000000..6516778e493 --- /dev/null +++ b/data/Gootville/E501-repeat2Bars.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/data/Gootville/E502-repeat4Bars.xml b/data/Gootville/E502-repeat4Bars.xml new file mode 100644 index 00000000000..52109bfca96 --- /dev/null +++ b/data/Gootville/E502-repeat4Bars.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/data/Leipzig.xml b/data/Leipzig.xml index afb83284d6c..cb4ddb1e41b 100644 --- a/data/Leipzig.xml +++ b/data/Leipzig.xml @@ -104,4 +104,7 @@ + + + diff --git a/data/Leipzig/E101-noteheadSlashHorizontalEnds.xml b/data/Leipzig/E101-noteheadSlashHorizontalEnds.xml new file mode 100644 index 00000000000..61caf7d4d60 --- /dev/null +++ b/data/Leipzig/E101-noteheadSlashHorizontalEnds.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/data/Leipzig/E501-repeat2Bars.xml b/data/Leipzig/E501-repeat2Bars.xml new file mode 100644 index 00000000000..1a61fdfc118 --- /dev/null +++ b/data/Leipzig/E501-repeat2Bars.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/data/Leipzig/E502-repeat4Bars.xml b/data/Leipzig/E502-repeat4Bars.xml new file mode 100644 index 00000000000..43ae90a3719 --- /dev/null +++ b/data/Leipzig/E502-repeat4Bars.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/fonts/Leipzig-5.2.sfd b/fonts/Leipzig-5.2.sfd index cb6fbdc2360..ee21b421f59 100644 --- a/fonts/Leipzig-5.2.sfd +++ b/fonts/Leipzig-5.2.sfd @@ -3,9 +3,9 @@ FontName: Leipzig FullName: Leipzig FamilyName: Leipzig Weight: Regular -Copyright: Created by Etienne Darbellay, Jean-Francois Marti and Laurent Pugin with FontForge 2.0. This font is licensed under the SIL Open Font License \\(http://scripts.sil.org/OFL\\).\nVersion 5.2.0 -UComments: "2014-03-21: Created.+AAoA-Version 5.2 - adding glyphs (dynamics, ornaments, mensural note heads, etc)" -Version: 5.2.0 +Copyright: Created by Etienne Darbellay, Jean-Francois Marti and Laurent Pugin. \nThis font is licensed under the SIL Open Font License \\(http://scripts.sil.org/OFL\\).\nVersion 5.2.1 +UComments: "2014-03-21: Created.+AAoA-Version 5.2.0 - adding glyphs (dynamics, ornaments, mensural note heads, etc)+AAoA-Version 5.2.1 - adding repeats" +Version: 5.2.1 ItalicAngle: 0 UnderlinePosition: -50 UnderlineWidth: 50 @@ -20,7 +20,7 @@ OS2Version: 0 OS2_WeightWidthSlopeOnly: 0 OS2_UseTypoMetrics: 1 CreationTime: 1395388130 -ModificationTime: 1440412960 +ModificationTime: 1440445782 PfmFamily: 17 TTFWeight: 500 TTFWidth: 5 @@ -49,11 +49,11 @@ NameList: Adobe Glyph List DisplaySize: -72 AntiAlias: 1 FitToEm: 1 -WinInfo: 59688 18 9 +WinInfo: 58554 18 9 BeginPrivate: 0 EndPrivate TeXData: 1 0 0 346030 173015 115343 0 1048576 115343 783286 444596 497025 792723 393216 433062 380633 303038 157286 324010 404750 52429 2506097 1059062 262144 -BeginChars: 1114115 111 +BeginChars: 1114115 114 StartChar: uniE0A3 Encoding: 57507 57507 0 @@ -2295,15 +2295,15 @@ Flags: HW LayerCount: 2 Fore SplineSet -198 -133 m 4 - 146.667 -133 102.333 -122.333 65 -101 c 4 - 21.6667 -77 0 -43.3333 0 0 c 132 - -3.8147e-06 43.3333 21.3333 77.3333 64 102 c 5 +198 -133 m 0 + 146.667 -133 102.333 -122.333 65 -101 c 0 + 21.6667 -77 0 -43.3333 0 0 c 128 + -3.8147e-06 43.3333 21.3333 77.3333 64 102 c 1 101.333 122.667 146 133 198 133 c 4 - 250.667 133 296.667 122.333 336 101 c 5 - 382 77 405 43.3333 405 0 c 4 - 405 -46 382 -80.6667 336 -104 c 4 - 299.333 -123.333 253.333 -133 198 -133 c 4 + 250.667 133 296.667 122.333 336 101 c 1 + 382 77 405 43.3333 405 0 c 0 + 405 -46 382 -80.6667 336 -104 c 0 + 299.333 -123.333 253.333 -133 198 -133 c 0 EndSplineSet Validated: 33 EndChar @@ -4302,33 +4302,33 @@ StartChar: uniE500 Encoding: 58624 58624 79 Width: 508 VWidth: 2048 -Flags: HW +Flags: HWO LayerCount: 2 Fore SplineSet -508 212 m 1 - 146 -212 l 1 - 0 -212 l 1 - 362 212 l 1 - 508 212 l 1 -52 108 m 0 - 52 121.333 56.333 132.667 65 142 c 128 - 73.667 151.333 84.333 156.333 97 157 c 1 - 111 157 122.667 153 132 145 c 128 - 141.333 137 146.333 126 147 112 c 0 - 147 98.667 142.667 87.333 134 78 c 128 - 125.333 68.667 114.667 63.667 102 63 c 1 - 88 63 76.333 67 67 75 c 128 - 57.667 83 52.667 94 52 108 c 0 -361 -111 m 0 - 361 -97.667 365.333 -86.333 374 -77 c 128 - 382.667 -67.667 393.334 -62.667 406 -62 c 1 - 420 -62 431.667 -66 441 -74 c 128 - 450.333 -82 455.333 -93 456 -107 c 0 - 456 -120.333 451.667 -131.667 443 -141 c 128 - 434.333 -150.333 423.667 -155.333 411 -156 c 1 - 397 -156 385.333 -152 376 -144 c 128 - 366.667 -136 361.667 -125 361 -111 c 0 +508 212 m 5 + 146 -212 l 5 + 0 -212 l 5 + 362 212 l 5 + 508 212 l 5 +52 108 m 4 + 52 121.333 56.333 132.667 65 142 c 132 + 73.667 151.333 84.333 156.333 97 157 c 5 + 111 157 122.667 153 132 145 c 132 + 141.333 137 146.333 126 147 112 c 4 + 147 98.667 142.667 87.333 134 78 c 132 + 125.333 68.667 114.667 63.667 102 63 c 5 + 88 63 76.333 67 67 75 c 132 + 57.667 83 52.667 94 52 108 c 4 +361 -111 m 4 + 361 -97.667 365.333 -86.333 374 -77 c 132 + 382.667 -67.667 393.334 -62.667 406 -62 c 5 + 420 -62 431.667 -66 441 -74 c 132 + 450.333 -82 455.333 -93 456 -107 c 4 + 456 -120.333 451.667 -131.667 443 -141 c 132 + 434.333 -150.333 423.667 -155.333 411 -156 c 5 + 397 -156 385.333 -152 376 -144 c 132 + 366.667 -136 361.667 -125 361 -111 c 4 EndSplineSet EndChar @@ -5499,5 +5499,109 @@ SplineSet 155 194 l 5 EndSplineSet EndChar + +StartChar: uniE101 +Encoding: 57601 57601 111 +Width: 508 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +508 212 m 5 + 146 -212 l 5 + 0 -212 l 5 + 362 212 l 5 + 508 212 l 5 +EndSplineSet +EndChar + +StartChar: uniE501 +Encoding: 58625 58625 112 +Width: 751 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +750 212 m 1 + 388 -212 l 1 + 242 -212 l 1 + 604 212 l 1 + 750 212 l 1 +508 212 m 1 + 146 -212 l 1 + 0 -212 l 1 + 362 212 l 1 + 508 212 l 1 +52 108 m 0 + 52 121.333 56.333 132.667 65 142 c 128 + 73.667 151.333 84.333 156.333 97 157 c 1 + 111 157 122.667 153 132 145 c 128 + 141.333 137 146.333 126 147 112 c 0 + 147 98.667 142.667 87.333 134 78 c 128 + 125.333 68.667 114.667 63.667 102 63 c 1 + 88 63 76.333 67 67 75 c 128 + 57.667 83 52.667 94 52 108 c 0 +603 -111 m 0 + 603 -97.667 607.333 -86.333 616 -77 c 128 + 624.667 -67.667 635.334 -62.667 648 -62 c 1 + 662 -62 673.667 -66 683 -74 c 128 + 692.333 -82 697.333 -93 698 -107 c 0 + 698 -120.333 693.667 -131.667 685 -141 c 128 + 676.333 -150.333 665.667 -155.333 653 -156 c 1 + 639 -156 627.333 -152 618 -144 c 128 + 608.667 -136 603.667 -125 603 -111 c 0 +EndSplineSet +EndChar + +StartChar: uniE502 +Encoding: 58626 58626 113 +Width: 1234 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +1234 212 m 1 + 872 -212 l 1 + 726 -212 l 1 + 1088 212 l 1 + 1234 212 l 1 +992 212 m 1 + 630 -212 l 1 + 484 -212 l 1 + 846 212 l 1 + 992 212 l 1 +750 212 m 1 + 388 -212 l 1 + 242 -212 l 1 + 604 212 l 1 + 750 212 l 1 +508 212 m 1 + 146 -212 l 1 + 0 -212 l 1 + 362 212 l 1 + 508 212 l 1 +52 108 m 0 + 52 121.333 56.333 132.667 65 142 c 128 + 73.667 151.333 84.333 156.333 97 157 c 1 + 111 157 122.667 153 132 145 c 128 + 141.333 137 146.333 126 147 112 c 0 + 147 98.667 142.667 87.333 134 78 c 128 + 125.333 68.667 114.667 63.667 102 63 c 1 + 88 63 76.333 67 67 75 c 128 + 57.667 83 52.667 94 52 108 c 0 +1087 -111 m 0 + 1087 -97.667 1091.33 -86.333 1100 -77 c 128 + 1108.67 -67.667 1119.33 -62.667 1132 -62 c 1 + 1146 -62 1157.67 -66 1167 -74 c 128 + 1176.33 -82 1181.33 -93 1182 -107 c 0 + 1182 -120.333 1177.67 -131.667 1169 -141 c 128 + 1160.33 -150.333 1149.67 -155.333 1137 -156 c 1 + 1123 -156 1111.33 -152 1102 -144 c 128 + 1092.67 -136 1087.67 -125 1087 -111 c 0 +EndSplineSet +EndChar EndChars EndSplineFont diff --git a/fonts/Leipzig.svg b/fonts/Leipzig.svg index dff789bf908..6babe295953 100644 --- a/fonts/Leipzig.svg +++ b/fonts/Leipzig.svg @@ -2,14 +2,16 @@ -Created by FontForge 20120731 at Mon Aug 24 12:43:09 2015 +Created by FontForge 20120731 at Mon Aug 24 21:49:58 2015 By laurent -Created by Etienne Darbellay, Jean-Francois Marti and Laurent Pugin with FontForge 2.0. This font is licensed under the SIL Open Font License \(http://scripts.sil.org/OFL\). -Version 5.2.0 +Created by Etienne Darbellay, Jean-Francois Marti and Laurent Pugin. +This font is licensed under the SIL Open Font License \(http://scripts.sil.org/OFL\). +Version 5.2.1 @@ -22,7 +24,7 @@ Version 5.2.0 ascent="800" descent="-200" x-height="265" - bbox="-163 -893 1230 1317" + bbox="-163 -893 1234 1317" underline-thickness="50" underline-position="-50" unicode-range="U+0075-E93D" @@ -469,5 +471,14 @@ d="M155 194l157 -194l-157 -192l-155 192zM125 111l-57 -73l122 -149l56 71z" /> d="M155 194l157 -194l-157 -192l-155 192zM125 111l-57 -73l122 -149l56 71z" /> + + + diff --git a/fonts/supported.xsl b/fonts/supported.xsl index 722195364b5..38373b1a7ae 100644 --- a/fonts/supported.xsl +++ b/fonts/supported.xsl @@ -269,7 +269,7 @@ Slash noteheads - + @@ -1197,8 +1197,8 @@ Bar repeats - - + + U+E50F U+E500 diff --git a/include/vrv/mrpt.h b/include/vrv/mrpt.h new file mode 100644 index 00000000000..e7d236f3e0c --- /dev/null +++ b/include/vrv/mrpt.h @@ -0,0 +1,48 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: mrpt.h +// Author: Laurent Pugin +// Created: 2015 +// Copyright (c) Authors and others. All rights reserved. +///////////////////////////////////////////////////////////////////////////// + + +#ifndef __VRV_MRPT_H__ +#define __VRV_MRPT_H__ + +#include "layerelement.h" + +namespace vrv { + +//---------------------------------------------------------------------------- +// MRpt +//---------------------------------------------------------------------------- + +/** + * This class models the MEI + */ +class MRpt: public LayerElement +{ +public: + /** + * @name Constructors, destructors, reset and class name methods + * Reset method reset all attribute classes + */ + ///@{ + MRpt( ); + virtual ~MRpt(); + virtual void Reset(); + virtual std::string GetClassName( ){ return "MRpt"; }; ; + virtual ClassId Is() { return MRPT; }; + ///@} + +private: + +public: + +private: + +}; + +} // namespace vrv + +#endif diff --git a/include/vrv/smufl.h b/include/vrv/smufl.h index 72fdb8ded5f..8cdc759e804 100644 --- a/include/vrv/smufl.h +++ b/include/vrv/smufl.h @@ -57,6 +57,7 @@ enum { SMUFL_E0A3_noteheadHalf = 0xE0A3, SMUFL_E0A4_noteheadBlack = 0xE0A4, SMUFL_E0FA_noteheadWholeFilled = 0xE0FA, + SMUFL_E101_noteheadSlashHorizontalEnds = 0xE101, SMUFL_E220_tremolo1 = 0xE220, SMUFL_E221_tremolo2 = 0xE221, SMUFL_E222_tremolo3 = 0xE222, @@ -91,6 +92,8 @@ enum { SMUFL_E4E9_rest64th = 0xE4E9, SMUFL_E4EA_rest128th = 0xE4EA, SMUFL_E500_repeat1Bar = 0xE500, + SMUFL_E501_repeat2Bars = 0xE501, + SMUFL_E502_repeat4Bars = 0xE502, SMUFL_E520_dynamicPiano = 0xE520, SMUFL_E521_dynamicMezzo = 0xE521, SMUFL_E522_dynamicForte = 0xE522, @@ -129,7 +132,7 @@ enum { }; /** The number of glyphs for verification **/ -#define SMUFL_COUNT 104 +#define SMUFL_COUNT 107 } // vrv namespace diff --git a/src/mrpt.cpp b/src/mrpt.cpp new file mode 100644 index 00000000000..6f8ef9f312b --- /dev/null +++ b/src/mrpt.cpp @@ -0,0 +1,32 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: mrpt.cpp +// Author: Laurent Pugin +// Created: 2015 +// Copyright (c) Authors and others. All rights reserved. +///////////////////////////////////////////////////////////////////////////// + + +#include "mrpt.h" + +namespace vrv { + +//---------------------------------------------------------------------------- +// MRpt +//---------------------------------------------------------------------------- + +MRpt::MRpt( ): + LayerElement("mrpt-") +{ + Reset(); +} + +MRpt::~MRpt() +{ +} + +void MRpt::Reset() +{ + LayerElement::Reset(); +} + +} // namespace vrv From 5c19feef07ee1ffc2b3f578b63cfaaf133a5e628 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Mon, 24 Aug 2015 22:50:10 +0200 Subject: [PATCH 085/114] Changing file names for rpt and term and cleaning makefiles --- Verovio.xcodeproj/project.pbxproj | 20 +++++ emscripten/build.sh | 20 +++-- include/vrv/iomei.h | 12 +++ include/vrv/mrpt.h | 48 ----------- include/vrv/rpt.h | 139 ++++++++++++++++++++++++++++++ include/vrv/trem.h | 18 ++++ include/vrv/vrvdef.h | 4 + java/build.sh | 18 ++-- python/setup.py | 94 ++++++++++---------- src/iomei.cpp | 94 ++++++++++++++++++++ src/mrpt.cpp | 32 ------- src/rpt.cpp | 92 ++++++++++++++++++++ src/trem.cpp | 13 +++ tools/CMakeLists.txt | 18 ++-- 14 files changed, 471 insertions(+), 151 deletions(-) delete mode 100644 include/vrv/mrpt.h create mode 100644 include/vrv/rpt.h create mode 100644 include/vrv/trem.h delete mode 100644 src/mrpt.cpp create mode 100644 src/rpt.cpp create mode 100644 src/trem.cpp diff --git a/Verovio.xcodeproj/project.pbxproj b/Verovio.xcodeproj/project.pbxproj index be215808b1c..1d2968e658a 100644 --- a/Verovio.xcodeproj/project.pbxproj +++ b/Verovio.xcodeproj/project.pbxproj @@ -60,6 +60,12 @@ 4DA80D961A6ACF5D0089802D /* style.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DA80D951A6ACF5D0089802D /* style.cpp */; }; 4DA80D971A6ACF5D0089802D /* style.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DA80D951A6ACF5D0089802D /* style.cpp */; }; 4DB3072F1AC9ED2500EE0982 /* space.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DB3072E1AC9ED2500EE0982 /* space.cpp */; }; + 4DB726C01B8B9F480040231B /* rpt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DB726BF1B8B9F480040231B /* rpt.cpp */; }; + 4DB726C11B8B9F480040231B /* rpt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DB726BF1B8B9F480040231B /* rpt.cpp */; }; + 4DB726C31B8B9F540040231B /* rpt.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DB726C21B8B9F540040231B /* rpt.h */; }; + 4DB726C51B8BB0E80040231B /* trem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DB726C41B8BB0E80040231B /* trem.cpp */; }; + 4DB726C61B8BB0E80040231B /* trem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DB726C41B8BB0E80040231B /* trem.cpp */; }; + 4DB726C81B8BB0F30040231B /* trem.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DB726C71B8BB0F30040231B /* trem.h */; }; 4DC34BA219BC4A71006175CD /* accid.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DC34B9F19BC4A70006175CD /* accid.h */; }; 4DC34BA319BC4A71006175CD /* custos.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DC34BA019BC4A70006175CD /* custos.h */; }; 4DC34BA419BC4A71006175CD /* dot.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DC34BA119BC4A70006175CD /* dot.h */; }; @@ -257,6 +263,10 @@ 4DA80D951A6ACF5D0089802D /* style.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = style.cpp; path = src/style.cpp; sourceTree = ""; }; 4DB3072D1AC9ED1800EE0982 /* space.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = space.h; path = include/vrv/space.h; sourceTree = ""; }; 4DB3072E1AC9ED2500EE0982 /* space.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = space.cpp; path = src/space.cpp; sourceTree = ""; }; + 4DB726BF1B8B9F480040231B /* rpt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = rpt.cpp; path = src/rpt.cpp; sourceTree = ""; }; + 4DB726C21B8B9F540040231B /* rpt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = rpt.h; path = include/vrv/rpt.h; sourceTree = ""; }; + 4DB726C41B8BB0E80040231B /* trem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = trem.cpp; path = src/trem.cpp; sourceTree = ""; }; + 4DB726C71B8BB0F30040231B /* trem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = trem.h; path = include/vrv/trem.h; sourceTree = ""; }; 4DC34B9F19BC4A70006175CD /* accid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = accid.h; path = include/vrv/accid.h; sourceTree = ""; }; 4DC34BA019BC4A70006175CD /* custos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = custos.h; path = include/vrv/custos.h; sourceTree = ""; }; 4DC34BA119BC4A70006175CD /* dot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dot.h; path = include/vrv/dot.h; sourceTree = ""; }; @@ -668,10 +678,14 @@ 1579B3421B15033100B16F5C /* proport.cpp */, 8F086ED1188539540037FD8E /* rest.cpp */, 8F59292818854BF800FE51AD /* rest.h */, + 4DB726BF1B8B9F480040231B /* rpt.cpp */, + 4DB726C21B8B9F540040231B /* rpt.h */, 4DB3072E1AC9ED2500EE0982 /* space.cpp */, 4DB3072D1AC9ED1800EE0982 /* space.h */, 4D9A9C1D19A1DE2000028D93 /* syl.cpp */, 4D9A9C1B199F576100028D93 /* syl.h */, + 4DB726C41B8BB0E80040231B /* trem.cpp */, + 4DB726C71B8BB0F30040231B /* trem.h */, 8F086ED9188539540037FD8E /* tuplet.cpp */, 8F59293018854BF800FE51AD /* tuplet.h */, 4D9A9C18199F561200028D93 /* verse.cpp */, @@ -699,6 +713,7 @@ 8F59293C18854BF800FE51AD /* durationinterface.h in Headers */, 8F59293D18854BF800FE51AD /* toolkit.h in Headers */, 4D1D733C1A1D0390001E08F6 /* smufl.h in Headers */, + 4DB726C81B8BB0F30040231B /* trem.h in Headers */, 8F59293E18854BF800FE51AD /* io.h in Headers */, 8F59293F18854BF800FE51AD /* iodarms.h in Headers */, 8F59294018854BF800FE51AD /* iomei.h in Headers */, @@ -722,6 +737,7 @@ 8F59294F18854BF800FE51AD /* rest.h in Headers */, 4DF289FD1A7545CC00BA9F7D /* timeinterface.h in Headers */, 8F59295018854BF800FE51AD /* scoredef.h in Headers */, + 4DB726C31B8B9F540040231B /* rpt.h in Headers */, 8F59295118854BF800FE51AD /* slur.h in Headers */, 8F59295218854BF800FE51AD /* staff.h in Headers */, 8F59295318854BF800FE51AD /* svgdevicecontext.h in Headers */, @@ -859,6 +875,7 @@ 8F086EF3188539540037FD8E /* layerelement.cpp in Sources */, 8F086EF5188539540037FD8E /* measure.cpp in Sources */, 8F086EF6188539540037FD8E /* mensur.cpp in Sources */, + 4DB726C51B8BB0E80040231B /* trem.cpp in Sources */, 4D798CBD1B8AEDBA007281CA /* drawinginterface.cpp in Sources */, 8F086EF7188539540037FD8E /* multirest.cpp in Sources */, 8F086EF8188539540037FD8E /* note.cpp in Sources */, @@ -882,6 +899,7 @@ 8F086F09188539540037FD8E /* view_graph.cpp in Sources */, 8F086F0A188539540037FD8E /* view_page.cpp in Sources */, 8F086F0B188539540037FD8E /* view_tuplet.cpp in Sources */, + 4DB726C01B8B9F480040231B /* rpt.cpp in Sources */, 2D2A799A1A69812C000A441B /* chord.cpp in Sources */, 8F086F0C188539540037FD8E /* view.cpp in Sources */, 8F086F0D188539540037FD8E /* vrv.cpp in Sources */, @@ -922,6 +940,7 @@ 4D1D73411A1D08DC001E08F6 /* glyph.cpp in Sources */, 8F3DD36418854B390051330C /* view_page.cpp in Sources */, 8F3DD36518854B390051330C /* view_tuplet.cpp in Sources */, + 4DB726C61B8BB0E80040231B /* trem.cpp in Sources */, 8F3DD33C18854B2E0051330C /* barline.cpp in Sources */, 8F3DD33E18854B2E0051330C /* beam.cpp in Sources */, 8F3DD34018854B2E0051330C /* clef.cpp in Sources */, @@ -948,6 +967,7 @@ 8F3DD33618854B250051330C /* staff.cpp in Sources */, 8F3DD33818854B250051330C /* system.cpp in Sources */, 8F3DD32418854B090051330C /* io.cpp in Sources */, + 4DB726C11B8B9F480040231B /* rpt.cpp in Sources */, 8F3DD32618854B090051330C /* iodarms.cpp in Sources */, 4DA60EE51B6307B9006E2DFC /* textdirective.cpp in Sources */, 8F3DD32818854B090051330C /* iomei.cpp in Sources */, diff --git a/emscripten/build.sh b/emscripten/build.sh index 325cad61798..1a8422376d6 100755 --- a/emscripten/build.sh +++ b/emscripten/build.sh @@ -94,7 +94,6 @@ python $EMCC $CHATTY \ -DUSE_EMSCRIPTEN \ $ASM \ ./emscripten_main.cpp \ - $VEROVIO_ROOT/src/vrv.cpp \ $VEROVIO_ROOT/src/accid.cpp \ $VEROVIO_ROOT/src/aligner.cpp \ $VEROVIO_ROOT/src/att.cpp \ @@ -131,15 +130,8 @@ python $EMCC $CHATTY \ $VEROVIO_ROOT/src/pitchinterface.cpp \ $VEROVIO_ROOT/src/positioninterface.cpp \ $VEROVIO_ROOT/src/proport.cpp \ - $VEROVIO_ROOT/src/view.cpp \ - $VEROVIO_ROOT/src/view_beam.cpp \ - $VEROVIO_ROOT/src/view_element.cpp \ - $VEROVIO_ROOT/src/view_floating.cpp \ - $VEROVIO_ROOT/src/view_graph.cpp \ - $VEROVIO_ROOT/src/view_mensural.cpp \ - $VEROVIO_ROOT/src/view_page.cpp \ - $VEROVIO_ROOT/src/view_tuplet.cpp \ $VEROVIO_ROOT/src/rest.cpp \ + $VEROVIO_ROOT/src/rpt.cpp \ $VEROVIO_ROOT/src/scoredef.cpp \ $VEROVIO_ROOT/src/scoredefinterface.cpp \ $VEROVIO_ROOT/src/slur.cpp \ @@ -153,9 +145,19 @@ python $EMCC $CHATTY \ $VEROVIO_ROOT/src/textdirinterface.cpp \ $VEROVIO_ROOT/src/tie.cpp \ $VEROVIO_ROOT/src/timeinterface.cpp \ + $VEROVIO_ROOT/src/trem.cpp \ $VEROVIO_ROOT/src/toolkit.cpp \ $VEROVIO_ROOT/src/tuplet.cpp \ $VEROVIO_ROOT/src/verse.cpp \ + $VEROVIO_ROOT/src/view.cpp \ + $VEROVIO_ROOT/src/view_beam.cpp \ + $VEROVIO_ROOT/src/view_element.cpp \ + $VEROVIO_ROOT/src/view_floating.cpp \ + $VEROVIO_ROOT/src/view_graph.cpp \ + $VEROVIO_ROOT/src/view_mensural.cpp \ + $VEROVIO_ROOT/src/view_page.cpp \ + $VEROVIO_ROOT/src/view_tuplet.cpp \ + $VEROVIO_ROOT/src/vrv.cpp \ $VEROVIO_ROOT/src/pugixml.cpp \ $VEROVIO_ROOT/libmei/atts_cmn.cpp \ $VEROVIO_ROOT/libmei/atts_critapp.cpp \ diff --git a/include/vrv/iomei.h b/include/vrv/iomei.h index d1d748847dc..128d8aa7b1c 100644 --- a/include/vrv/iomei.h +++ b/include/vrv/iomei.h @@ -23,6 +23,7 @@ class Accid; class Annot; class Barline; class Beam; +class BeatRpt; class Chord; class Clef; class Custos; @@ -36,7 +37,10 @@ class Measure; class Mensur; class MeterSig; class MRest; +class MRpt; +class MRpt2; class MultiRest; +class MultiRpt; class Note; class PitchInterface; class PositionInterface; @@ -128,6 +132,7 @@ class MeiOutput: public FileOutputStream void WriteMeiAccid( pugi::xml_node currentNode, Accid *accid ); void WriteMeiBarline( pugi::xml_node currentNode, Barline *barLine ); void WriteMeiBeam( pugi::xml_node currentNode, Beam *beam ); + void WriteMeiBeatRpt( pugi::xml_node currentNode, BeatRpt *beatRpt ); void WriteMeiChord( pugi::xml_node currentNode, Chord *chord ); void WriteMeiClef( pugi::xml_node currentNode, Clef *clef ); void WriteMeiCustos( pugi::xml_node currentNode, Custos *custos ); @@ -136,7 +141,10 @@ class MeiOutput: public FileOutputStream void WriteMeiMensur( pugi::xml_node currentNode, Mensur *mensur ); void WriteMeiMeterSig( pugi::xml_node currentNode, MeterSig *meterSig ); void WriteMeiMRest( pugi::xml_node currentNode, MRest *mRest ); + void WriteMeiMRpt( pugi::xml_node currentNode, MRpt *mRpt ); + void WriteMeiMRpt2( pugi::xml_node currentNode, MRpt2 *mRpt2 ); void WriteMeiMultiRest( pugi::xml_node currentNode, MultiRest *multiRest ); + void WriteMeiMultiRpt( pugi::xml_node currentNode, MultiRpt *multiRpt ); void WriteMeiNote( pugi::xml_node currentNode, Note *note ); void WriteMeiProport( pugi::xml_node currentNode, Proport *proport ); void WriteMeiRest( pugi::xml_node currentNode, Rest *rest ); @@ -291,6 +299,7 @@ class MeiInput: public FileInputStream bool ReadMeiAccid( Object *parent, pugi::xml_node accid ); bool ReadMeiBarline( Object *parent, pugi::xml_node barLine ); bool ReadMeiBeam( Object *parent, pugi::xml_node beam ); + bool ReadMeiBeatRpt( Object *parent, pugi::xml_node beatRpt ); bool ReadMeiChord( Object* parent, pugi::xml_node chord ); bool ReadMeiClef( Object *parent, pugi::xml_node clef ); bool ReadMeiCustos( Object *parent, pugi::xml_node custos ); @@ -299,7 +308,10 @@ class MeiInput: public FileInputStream bool ReadMeiMensur( Object *parent, pugi::xml_node mensur ); bool ReadMeiMeterSig( Object *parent, pugi::xml_node meterSig ); bool ReadMeiMRest( Object *parent, pugi::xml_node mRest ); + bool ReadMeiMRpt( Object *parent, pugi::xml_node mRpt ); + bool ReadMeiMRpt2( Object *parent, pugi::xml_node mRpt2 ); bool ReadMeiMultiRest( Object *parent, pugi::xml_node multiRest ); + bool ReadMeiMultiRpt( Object *parent, pugi::xml_node multiRpt ); bool ReadMeiNote( Object *parent, pugi::xml_node note ); bool ReadMeiProport( Object *parent, pugi::xml_node proport ); bool ReadMeiRest( Object *parent, pugi::xml_node rest ); diff --git a/include/vrv/mrpt.h b/include/vrv/mrpt.h deleted file mode 100644 index e7d236f3e0c..00000000000 --- a/include/vrv/mrpt.h +++ /dev/null @@ -1,48 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: mrpt.h -// Author: Laurent Pugin -// Created: 2015 -// Copyright (c) Authors and others. All rights reserved. -///////////////////////////////////////////////////////////////////////////// - - -#ifndef __VRV_MRPT_H__ -#define __VRV_MRPT_H__ - -#include "layerelement.h" - -namespace vrv { - -//---------------------------------------------------------------------------- -// MRpt -//---------------------------------------------------------------------------- - -/** - * This class models the MEI - */ -class MRpt: public LayerElement -{ -public: - /** - * @name Constructors, destructors, reset and class name methods - * Reset method reset all attribute classes - */ - ///@{ - MRpt( ); - virtual ~MRpt(); - virtual void Reset(); - virtual std::string GetClassName( ){ return "MRpt"; }; ; - virtual ClassId Is() { return MRPT; }; - ///@} - -private: - -public: - -private: - -}; - -} // namespace vrv - -#endif diff --git a/include/vrv/rpt.h b/include/vrv/rpt.h new file mode 100644 index 00000000000..ceed35927fd --- /dev/null +++ b/include/vrv/rpt.h @@ -0,0 +1,139 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: rpt.h +// Author: Laurent Pugin +// Created: 2015 +// Copyright (c) Authors and others. All rights reserved. +///////////////////////////////////////////////////////////////////////////// + + +#ifndef __VRV_RPT_H__ +#define __VRV_RPT_H__ + +#include "layerelement.h" + +namespace vrv { + +//---------------------------------------------------------------------------- +// BeatRpt +//---------------------------------------------------------------------------- + +/** + * This class models the MEI + */ +class BeatRpt: public LayerElement +{ +public: + /** + * @name Constructors, destructors, reset and class name methods + * Reset method reset all attribute classes + */ + ///@{ + BeatRpt( ); + virtual ~BeatRpt(); + virtual void Reset(); + virtual std::string GetClassName( ){ return "BeatRpt"; }; ; + virtual ClassId Is() { return BEAT_RPT; }; + ///@} + +private: + +public: + +private: + +}; + +//---------------------------------------------------------------------------- +// MRpt +//---------------------------------------------------------------------------- + +/** + * This class models the MEI + */ +class MRpt: public LayerElement +{ +public: + /** + * @name Constructors, destructors, reset and class name methods + * Reset method reset all attribute classes + */ + ///@{ + MRpt( ); + virtual ~MRpt(); + virtual void Reset(); + virtual std::string GetClassName( ){ return "MRpt"; }; ; + virtual ClassId Is() { return MRPT; }; + ///@} + +private: + +public: + +private: + +}; + +//---------------------------------------------------------------------------- +// MRpt2 +//---------------------------------------------------------------------------- + +/** + * This class models the MEI + */ +class MRpt2: public LayerElement +{ +public: + /** + * @name Constructors, destructors, reset and class name methods + * Reset method reset all attribute classes + */ + ///@{ + MRpt2( ); + virtual ~MRpt2(); + virtual void Reset(); + virtual std::string GetClassName( ){ return "MRpt2"; }; ; + virtual ClassId Is() { return MRPT2; }; + ///@} + +private: + +public: + +private: + +}; + + +//---------------------------------------------------------------------------- +// MultiRpt +//---------------------------------------------------------------------------- + +/** + * This class models the MEI + */ +class MultiRpt: public LayerElement +{ +public: + /** + * @name Constructors, destructors, reset and class name methods + * Reset method reset all attribute classes + */ + ///@{ + MultiRpt( ); + virtual ~MultiRpt(); + virtual void Reset(); + virtual std::string GetClassName( ){ return "MultiRpt"; }; ; + virtual ClassId Is() { return MULTI_RPT; }; + ///@} + +private: + +public: + +private: + +}; + +} // namespace vrv + +#endif diff --git a/include/vrv/trem.h b/include/vrv/trem.h new file mode 100644 index 00000000000..8349c8c0b6c --- /dev/null +++ b/include/vrv/trem.h @@ -0,0 +1,18 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: trem.h +// Author: Laurent Pugin +// Created: 2015 +// Copyright (c) Authors and others. All rights reserved. +///////////////////////////////////////////////////////////////////////////// + + +#ifndef __VRV_TREM_H__ +#define __VRV_TREM_H__ + +#include "layerelement.h" + +namespace vrv { + +} // namespace vrv + +#endif diff --git a/include/vrv/vrvdef.h b/include/vrv/vrvdef.h index 71871cb47d6..a133ac32830 100644 --- a/include/vrv/vrvdef.h +++ b/include/vrv/vrvdef.h @@ -87,6 +87,7 @@ enum ClassId { BAR_LINE, BAR_LINE_ATTR, BEAM, + BEAT_RPT, CHORD, CLEF, CUSTOS, @@ -95,7 +96,10 @@ enum ClassId { MENSUR, METER_SIG, MREST, + MRPT, + MRPT2, MULTI_REST, + MULTI_RPT, NOTE, PROPORT, REST, diff --git a/java/build.sh b/java/build.sh index 861dff2c4fd..077307caeba 100755 --- a/java/build.sh +++ b/java/build.sh @@ -45,15 +45,8 @@ FILES="../src/accid.cpp \ ../src/pitchinterface.cpp \ ../src/positioninterface.cpp \ ../src/proport.cpp \ - ../src/view.cpp \ - ../src/view_beam.cpp \ - ../src/view_element.cpp \ - ../src/view_floating.cpp \ - ../src/view_graph.cpp \ - ../src/view_mensural.cpp \ - ../src/view_page.cpp \ - ../src/view_tuplet.cpp \ ../src/rest.cpp \ + ../src/rpt.cpp \ ../src/scoredef.cpp \ ../src/scoredefinterface.cpp \ ../src/slur.cpp \ @@ -67,9 +60,18 @@ FILES="../src/accid.cpp \ ../src/textdirinterface.cpp \ ../src/tie.cpp \ ../src/timeinterface.cpp \ + ../src/trem.cpp \ ../src/toolkit.cpp \ ../src/tuplet.cpp \ ../src/verse.cpp \ + ../src/view.cpp \ + ../src/view_beam.cpp \ + ../src/view_element.cpp \ + ../src/view_floating.cpp \ + ../src/view_graph.cpp \ + ../src/view_mensural.cpp \ + ../src/view_page.cpp \ + ../src/view_tuplet.cpp \ ../src/vrv.cpp \ ../src/pugixml.cpp \ ../libmei/atts_shared.cpp \ diff --git a/python/setup.py b/python/setup.py index 57c3534546f..86b5f285d7b 100755 --- a/python/setup.py +++ b/python/setup.py @@ -13,74 +13,76 @@ verovio_module = Extension('_verovio', - sources=['../src/accid.cpp', - '../src/aligner.cpp', - '../src/att.cpp', - '../src/barline.cpp', - '../src/bboxdevicecontext.cpp', - '../src/beam.cpp', - '../src/chord.cpp', - '../src/clef.cpp', - '../src/custos.cpp', - '../src/devicecontext.cpp', - '../src/doc.cpp', + sources=['../src/accid.cpp', + '../src/aligner.cpp', + '../src/att.cpp', + '../src/barline.cpp', + '../src/bboxdevicecontext.cpp', + '../src/beam.cpp', + '../src/chord.cpp', + '../src/clef.cpp', + '../src/custos.cpp', + '../src/devicecontext.cpp', + '../src/doc.cpp', '../src/dot.cpp', '../src/drawinginterface.cpp', '../src/durationinterface.cpp', '../src/editorial.cpp', '../src/floatingelement.cpp', '../src/glyph.cpp', - '../src/io.cpp', - '../src/iodarms.cpp', - '../src/iomei.cpp', - '../src/iopae.cpp', - '../src/iomusxml.cpp', - '../src/keysig.cpp', - '../src/layer.cpp', + '../src/io.cpp', + '../src/iodarms.cpp', + '../src/iomei.cpp', + '../src/iopae.cpp', + '../src/iomusxml.cpp', + '../src/keysig.cpp', + '../src/layer.cpp', '../src/layerelement.cpp', - '../src/mensur.cpp', + '../src/mensur.cpp', '../src/metersig.cpp', '../src/measure.cpp', - '../src/mrest.cpp', - '../src/multirest.cpp', - '../src/note.cpp', - '../src/object.cpp', - '../src/page.cpp', - '../src/pitchinterface.cpp', + '../src/mrest.cpp', + '../src/multirest.cpp', + '../src/note.cpp', + '../src/object.cpp', + '../src/page.cpp', + '../src/pitchinterface.cpp', '../src/positioninterface.cpp', - '../src/proport.cpp', - '../src/view.cpp', - '../src/view_beam.cpp', - '../src/view_element.cpp', - '../src/view_floating.cpp', - '../src/view_graph.cpp', - '../src/view_mensural.cpp', - '../src/view_page.cpp', - '../src/view_tuplet.cpp', + '../src/proport.cpp', '../src/rest.cpp', + '../src/rpt.cpp', '../src/scoredef.cpp', '../src/scoredefinterface.cpp', '../src/slur.cpp', - '../src/space.cpp', + '../src/space.cpp', '../src/staff.cpp', '../src/style.cpp', - '../src/svgdevicecontext.cpp', - '../src/syl.cpp', - '../src/system.cpp', + '../src/svgdevicecontext.cpp', + '../src/syl.cpp', + '../src/system.cpp', '../src/textdirective.cpp', '../src/textdirinterface.cpp', '../src/tie.cpp', '../src/timeinterface.cpp', + '../src/trem.cpp', '../src/toolkit.cpp', - '../src/tuplet.cpp', - '../src/verse.cpp', - '../src/vrv.cpp', - '../src/pugixml.cpp', - '../libmei/atts_shared.cpp', + '../src/tuplet.cpp', + '../src/verse.cpp', + '../src/view.cpp', + '../src/view_beam.cpp', + '../src/view_element.cpp', + '../src/view_floating.cpp', + '../src/view_graph.cpp', + '../src/view_mensural.cpp', + '../src/view_page.cpp', + '../src/view_tuplet.cpp', + '../src/vrv.cpp', + '../src/pugixml.cpp', + '../libmei/atts_shared.cpp', '../libmei/atts_cmn.cpp', - '../libmei/atts_critapp.cpp', - '../libmei/atts_mensural.cpp', - '../libmei/atts_pagebased.cpp', + '../libmei/atts_critapp.cpp', + '../libmei/atts_mensural.cpp', + '../libmei/atts_pagebased.cpp', 'verovio.i'], swig_opts=['-c++'], include_dirs=['/usr/local/include', '../include', '../include/vrv', '../libmei'], diff --git a/src/iomei.cpp b/src/iomei.cpp index 00f17d8d718..3cb26023e89 100644 --- a/src/iomei.cpp +++ b/src/iomei.cpp @@ -32,6 +32,7 @@ #include "page.h" #include "proport.h" #include "rest.h" +#include "rpt.h" #include "slur.h" #include "space.h" #include "staff.h" @@ -39,6 +40,7 @@ #include "system.h" #include "textdirective.h" #include "tie.h" +#include "trem.h" #include "tuplet.h" #include "verse.h" #include "vrv.h" @@ -193,6 +195,10 @@ bool MeiOutput::WriteObject( Object *object ) m_currentNode = m_currentNode.append_child("beam"); WriteMeiBeam( m_currentNode, dynamic_cast(object) ); } + else if (object->Is() == BEAT_RPT) { + m_currentNode = m_currentNode.append_child("beatRpt"); + WriteMeiBeatRpt( m_currentNode, dynamic_cast(object) ); + } else if (object->Is() == CHORD) { m_currentNode = m_currentNode.append_child( "chord" ); WriteMeiChord( m_currentNode, dynamic_cast(object) ); @@ -225,10 +231,22 @@ bool MeiOutput::WriteObject( Object *object ) m_currentNode = m_currentNode.append_child("mRest"); WriteMeiMRest( m_currentNode, dynamic_cast(object) ); } + else if (object->Is() == MRPT) { + m_currentNode = m_currentNode.append_child("mRpt"); + WriteMeiMRpt( m_currentNode, dynamic_cast(object) ); + } + else if (object->Is() == MRPT2) { + m_currentNode = m_currentNode.append_child("mRpt2"); + WriteMeiMRpt2( m_currentNode, dynamic_cast(object) ); + } else if (object->Is() == MULTI_REST) { m_currentNode = m_currentNode.append_child("multiRest"); WriteMeiMultiRest( m_currentNode, dynamic_cast(object) ); } + else if (object->Is() == MULTI_RPT) { + m_currentNode = m_currentNode.append_child("multiRpt"); + WriteMeiMultiRpt( m_currentNode, dynamic_cast(object) ); + } else if (object->Is() == NOTE) { m_currentNode = m_currentNode.append_child("note"); WriteMeiNote( m_currentNode, dynamic_cast(object) ); @@ -550,6 +568,13 @@ void MeiOutput::WriteMeiBeam( pugi::xml_node currentNode, Beam *beam ) WriteLayerElement( currentNode, beam ); return; } + +void MeiOutput::WriteMeiBeatRpt( pugi::xml_node currentNode, BeatRpt *beatRpt ) +{ + assert( beatRpt ); + + WriteLayerElement( currentNode, beatRpt ); +} void MeiOutput::WriteMeiChord( pugi::xml_node currentNode, Chord *chord ) { @@ -631,6 +656,20 @@ void MeiOutput::WriteMeiMRest( pugi::xml_node currentNode, MRest *mRest ) WriteLayerElement( currentNode, mRest ); return; } + +void MeiOutput::WriteMeiMRpt( pugi::xml_node currentNode, MRpt *mRpt ) +{ + assert( mRpt ); + + WriteLayerElement( currentNode, mRpt ); +} + + void MeiOutput::WriteMeiMRpt2( pugi::xml_node currentNode, MRpt2 *mRpt2 ) + { + assert( mRpt2 ); + + WriteLayerElement( currentNode, mRpt2 ); + } void MeiOutput::WriteMeiMultiRest( pugi::xml_node currentNode, MultiRest *multiRest ) { @@ -641,6 +680,13 @@ void MeiOutput::WriteMeiMultiRest( pugi::xml_node currentNode, MultiRest *multiR return; } +void MeiOutput::WriteMeiMultiRpt( pugi::xml_node currentNode, MultiRpt *multiRpt ) +{ + assert( multiRpt ); + + WriteLayerElement( currentNode, multiRpt ); +} + void MeiOutput::WriteMeiNote( pugi::xml_node currentNode, Note *note ) { assert( note ); @@ -1552,6 +1598,9 @@ bool MeiInput::ReadMeiLayerChildren( Object *parent, pugi::xml_node parentNode, else if ( elementName == "beam" ) { success = ReadMeiBeam( parent, xmlElement); } + else if ( elementName == "beatRpt" ) { + success = ReadMeiBeatRpt( parent, xmlElement); + } else if ( elementName == "chord" ) { success = ReadMeiChord( parent, xmlElement); } @@ -1582,9 +1631,18 @@ bool MeiInput::ReadMeiLayerChildren( Object *parent, pugi::xml_node parentNode, else if ( elementName == "mRest" ) { success = ReadMeiMRest( parent, xmlElement ); } + else if ( elementName == "mRpt" ) { + success = ReadMeiMRpt( parent, xmlElement ); + } + else if ( elementName == "mRpt2" ) { + success = ReadMeiMRpt2( parent, xmlElement ); + } else if ( elementName == "multiRest" ) { success = ReadMeiMultiRest( parent, xmlElement ); } + else if ( elementName == "multiRpt" ) { + success = ReadMeiMultiRpt( parent, xmlElement ); + } else if ( elementName == "proport" ) { success = ReadMeiProport( parent, xmlElement ); } @@ -1665,6 +1723,15 @@ bool MeiInput::ReadMeiBeam( Object *parent, pugi::xml_node beam ) return true; } +bool MeiInput::ReadMeiBeatRpt( Object *parent, pugi::xml_node beatRpt ) +{ + BeatRpt *vrvBeatRpt = new BeatRpt(); + ReadLayerElement(beatRpt, vrvBeatRpt); + + AddLayerElement(parent, vrvBeatRpt); + return true; +} + bool MeiInput::ReadMeiChord( Object *parent, pugi::xml_node chord) { Chord *vrvChord = new Chord(); @@ -1767,7 +1834,25 @@ bool MeiInput::ReadMeiMRest( Object *parent, pugi::xml_node mRest ) AddLayerElement(parent, vrvMRest); return true; } + +bool MeiInput::ReadMeiMRpt( Object *parent, pugi::xml_node mRpt ) +{ + MRpt *vrvMRpt = new MRpt(); + ReadLayerElement(mRpt, vrvMRpt); + + AddLayerElement(parent, vrvMRpt); + return true; +} +bool MeiInput::ReadMeiMRpt2( Object *parent, pugi::xml_node mRpt2 ) +{ + MRpt2 *vrvMRpt2 = new MRpt2(); + ReadLayerElement(mRpt2, vrvMRpt2); + + AddLayerElement(parent, vrvMRpt2); + return true; +} + bool MeiInput::ReadMeiMultiRest( Object *parent, pugi::xml_node multiRest ) { MultiRest *vrvMultiRest = new MultiRest( ); @@ -1779,6 +1864,15 @@ bool MeiInput::ReadMeiMultiRest( Object *parent, pugi::xml_node multiRest ) return true; } +bool MeiInput::ReadMeiMultiRpt( Object *parent, pugi::xml_node multiRpt ) +{ + MultiRpt *vrvMultiRpt = new MultiRpt(); + ReadLayerElement(multiRpt, vrvMultiRpt); + + AddLayerElement(parent, vrvMultiRpt); + return true; +} + bool MeiInput::ReadMeiNote( Object *parent, pugi::xml_node note ) { Note *vrvNote = new Note(); diff --git a/src/mrpt.cpp b/src/mrpt.cpp deleted file mode 100644 index 6f8ef9f312b..00000000000 --- a/src/mrpt.cpp +++ /dev/null @@ -1,32 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: mrpt.cpp -// Author: Laurent Pugin -// Created: 2015 -// Copyright (c) Authors and others. All rights reserved. -///////////////////////////////////////////////////////////////////////////// - - -#include "mrpt.h" - -namespace vrv { - -//---------------------------------------------------------------------------- -// MRpt -//---------------------------------------------------------------------------- - -MRpt::MRpt( ): - LayerElement("mrpt-") -{ - Reset(); -} - -MRpt::~MRpt() -{ -} - -void MRpt::Reset() -{ - LayerElement::Reset(); -} - -} // namespace vrv diff --git a/src/rpt.cpp b/src/rpt.cpp new file mode 100644 index 00000000000..cbf09441ae8 --- /dev/null +++ b/src/rpt.cpp @@ -0,0 +1,92 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: rpt.cpp +// Author: Laurent Pugin +// Created: 2015 +// Copyright (c) Authors and others. All rights reserved. +///////////////////////////////////////////////////////////////////////////// + + +#include "rpt.h" + +namespace vrv { + + +//---------------------------------------------------------------------------- +// BeatRpt +//---------------------------------------------------------------------------- + +BeatRpt::BeatRpt( ): +LayerElement("beatrpt-") +{ + Reset(); +} + +BeatRpt::~BeatRpt() +{ +} + +void BeatRpt::Reset() +{ + LayerElement::Reset(); +} + +//---------------------------------------------------------------------------- +// MRpt +//---------------------------------------------------------------------------- + +MRpt::MRpt( ): + LayerElement("mrpt-") +{ + Reset(); +} + +MRpt::~MRpt() +{ +} + +void MRpt::Reset() +{ + LayerElement::Reset(); +} + + +//---------------------------------------------------------------------------- +// MRpt2 +//---------------------------------------------------------------------------- + +MRpt2::MRpt2( ): + LayerElement("mrpt2-") +{ + Reset(); +} + +MRpt2::~MRpt2() +{ +} + +void MRpt2::Reset() +{ + LayerElement::Reset(); +} + + +//---------------------------------------------------------------------------- +// MultiRpt +//---------------------------------------------------------------------------- + +MultiRpt::MultiRpt( ): + LayerElement("multirpt-") +{ + Reset(); +} + +MultiRpt::~MultiRpt() +{ +} + +void MultiRpt::Reset() +{ + LayerElement::Reset(); +} + +} // namespace vrv diff --git a/src/trem.cpp b/src/trem.cpp new file mode 100644 index 00000000000..4f57dad4237 --- /dev/null +++ b/src/trem.cpp @@ -0,0 +1,13 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: trem.cpp +// Author: Laurent Pugin +// Created: 2015 +// Copyright (c) Authors and others. All rights reserved. +///////////////////////////////////////////////////////////////////////////// + + +#include "trem.h" + +namespace vrv { + +} // namespace vrv diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 91789a25359..be6cdbe991b 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -54,15 +54,8 @@ add_executable (verovio ../src/pitchinterface.cpp ../src/positioninterface.cpp ../src/proport.cpp - ../src/view.cpp - ../src/view_beam.cpp - ../src/view_element.cpp - ../src/view_floating.cpp - ../src/view_graph.cpp - ../src/view_mensural.cpp - ../src/view_page.cpp - ../src/view_tuplet.cpp ../src/rest.cpp + ../src/rpt.cpp ../src/scoredef.cpp ../src/scoredefinterface.cpp ../src/slur.cpp @@ -76,9 +69,18 @@ add_executable (verovio ../src/textdirinterface.cpp ../src/tie.cpp ../src/timeinterface.cpp + ../src/trem.cpp ../src/toolkit.cpp ../src/tuplet.cpp ../src/verse.cpp + ../src/view.cpp + ../src/view_beam.cpp + ../src/view_element.cpp + ../src/view_floating.cpp + ../src/view_graph.cpp + ../src/view_mensural.cpp + ../src/view_page.cpp + ../src/view_tuplet.cpp ../src/vrv.cpp ../src/pugixml.cpp #../libmei/atts_analysis.cpp From b877ae6ea3131e8abff3070209bf9c1510048870 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Tue, 25 Aug 2015 07:34:33 +0200 Subject: [PATCH 086/114] Remove debug messasge --- src/system.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system.cpp b/src/system.cpp index 025ba26181a..73c43395f66 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -207,7 +207,7 @@ int System::JustifyX( ArrayPtrVoid *params ) (*ratio) = (double)((*systemFullWidth) - this->GetDrawingLabelsWidth() - this->m_systemLeftMar - this->m_systemRightMar) / ((double)m_drawingTotalWidth - this->GetDrawingLabelsWidth()); - LogDebug("System::JustifyX: *ratio=%lf", (*ratio)); + //LogDebug("System::JustifyX: *ratio=%lf", (*ratio)); if ((*ratio) < 0.8 ) { // Arbitrary value for avoiding over-compressed justification From 2600f0c5ce223b66438927ea7708621317e2b88f Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Tue, 25 Aug 2015 23:05:59 +0200 Subject: [PATCH 087/114] Adding support for mRpt --- data/Leipzig.xml | 6 +- data/Leipzig/E500-repeat1Bar.xml | 2 +- data/Leipzig/E501-repeat2Bars.xml | 2 +- data/Leipzig/E502-repeat4Bars.xml | 2 +- fonts/Leipzig-5.2.sfd | 182 +++++++++++++++--------------- fonts/Leipzig.svg | 14 +-- include/vrv/layer.h | 6 + include/vrv/object.h | 9 ++ include/vrv/rpt.h | 12 ++ include/vrv/scoredefinterface.h | 3 +- include/vrv/staff.h | 6 + include/vrv/view.h | 4 + libmei/atts_shared.cpp | 12 +- libmei/atts_shared.h | 6 +- src/doc.cpp | 29 +++++ src/iomei.cpp | 2 + src/layer.cpp | 15 +++ src/layerelement.cpp | 2 +- src/object.cpp | 2 +- src/rpt.cpp | 31 +++++ src/scoredefinterface.cpp | 5 +- src/staff.cpp | 26 +++++ src/view_element.cpp | 66 +++++++++++ 23 files changed, 327 insertions(+), 117 deletions(-) diff --git a/data/Leipzig.xml b/data/Leipzig.xml index cb4ddb1e41b..ec4c144d9b7 100644 --- a/data/Leipzig.xml +++ b/data/Leipzig.xml @@ -79,7 +79,7 @@ - + @@ -105,6 +105,6 @@ - - + + diff --git a/data/Leipzig/E500-repeat1Bar.xml b/data/Leipzig/E500-repeat1Bar.xml index 70ea3e1ce82..537d9e14db0 100644 --- a/data/Leipzig/E500-repeat1Bar.xml +++ b/data/Leipzig/E500-repeat1Bar.xml @@ -3,6 +3,6 @@ overflow="inherit" horiz-adv-x="508"> - + diff --git a/data/Leipzig/E501-repeat2Bars.xml b/data/Leipzig/E501-repeat2Bars.xml index 1a61fdfc118..04ea5ab7981 100644 --- a/data/Leipzig/E501-repeat2Bars.xml +++ b/data/Leipzig/E501-repeat2Bars.xml @@ -3,6 +3,6 @@ overflow="inherit" horiz-adv-x="751"> - + diff --git a/data/Leipzig/E502-repeat4Bars.xml b/data/Leipzig/E502-repeat4Bars.xml index 43ae90a3719..8245027e5df 100644 --- a/data/Leipzig/E502-repeat4Bars.xml +++ b/data/Leipzig/E502-repeat4Bars.xml @@ -3,6 +3,6 @@ overflow="inherit" horiz-adv-x="1234"> - + diff --git a/fonts/Leipzig-5.2.sfd b/fonts/Leipzig-5.2.sfd index ee21b421f59..800c5a122b6 100644 --- a/fonts/Leipzig-5.2.sfd +++ b/fonts/Leipzig-5.2.sfd @@ -20,7 +20,7 @@ OS2Version: 0 OS2_WeightWidthSlopeOnly: 0 OS2_UseTypoMetrics: 1 CreationTime: 1395388130 -ModificationTime: 1440445782 +ModificationTime: 1440516689 PfmFamily: 17 TTFWeight: 500 TTFWidth: 5 @@ -4306,29 +4306,29 @@ Flags: HWO LayerCount: 2 Fore SplineSet -508 212 m 5 - 146 -212 l 5 - 0 -212 l 5 - 362 212 l 5 - 508 212 l 5 -52 108 m 4 - 52 121.333 56.333 132.667 65 142 c 132 - 73.667 151.333 84.333 156.333 97 157 c 5 - 111 157 122.667 153 132 145 c 132 - 141.333 137 146.333 126 147 112 c 4 - 147 98.667 142.667 87.333 134 78 c 132 - 125.333 68.667 114.667 63.667 102 63 c 5 - 88 63 76.333 67 67 75 c 132 - 57.667 83 52.667 94 52 108 c 4 -361 -111 m 4 - 361 -97.667 365.333 -86.333 374 -77 c 132 - 382.667 -67.667 393.334 -62.667 406 -62 c 5 - 420 -62 431.667 -66 441 -74 c 132 - 450.333 -82 455.333 -93 456 -107 c 4 - 456 -120.333 451.667 -131.667 443 -141 c 132 - 434.333 -150.333 423.667 -155.333 411 -156 c 5 - 397 -156 385.333 -152 376 -144 c 132 - 366.667 -136 361.667 -125 361 -111 c 4 +508 242 m 1 + 146 -242 l 1 + 0 -242 l 1 + 362 242 l 1 + 508 242 l 1 +52 118 m 4 + 52 131.333 56.333 142.667 65 152 c 132 + 73.667 161.333 84.333 166.333 97 167 c 5 + 111 167 122.667 163 132 155 c 132 + 141.333 147 146.333 136 147 122 c 4 + 147 108.667 142.667 97.333 134 88 c 132 + 125.333 78.667 114.667 73.667 102 73 c 5 + 88 73 76.333 77 67 85 c 132 + 57.667 93 52.667 104 52 118 c 4 +361 -121 m 0 + 361 -107.667 365.333 -96.333 374 -87 c 128 + 382.667 -77.667 393.334 -72.667 406 -72 c 1 + 420 -72 431.667 -76 441 -84 c 128 + 450.333 -92 455.333 -103 456 -117 c 0 + 456 -130.333 451.667 -141.667 443 -151 c 128 + 434.333 -160.333 423.667 -165.333 411 -166 c 1 + 397 -166 385.333 -162 376 -154 c 128 + 366.667 -146 361.667 -135 361 -121 c 0 EndSplineSet EndChar @@ -5524,34 +5524,34 @@ Flags: HW LayerCount: 2 Fore SplineSet -750 212 m 1 - 388 -212 l 1 - 242 -212 l 1 - 604 212 l 1 - 750 212 l 1 -508 212 m 1 - 146 -212 l 1 - 0 -212 l 1 - 362 212 l 1 - 508 212 l 1 -52 108 m 0 - 52 121.333 56.333 132.667 65 142 c 128 - 73.667 151.333 84.333 156.333 97 157 c 1 - 111 157 122.667 153 132 145 c 128 - 141.333 137 146.333 126 147 112 c 0 - 147 98.667 142.667 87.333 134 78 c 128 - 125.333 68.667 114.667 63.667 102 63 c 1 - 88 63 76.333 67 67 75 c 128 - 57.667 83 52.667 94 52 108 c 0 -603 -111 m 0 - 603 -97.667 607.333 -86.333 616 -77 c 128 - 624.667 -67.667 635.334 -62.667 648 -62 c 1 - 662 -62 673.667 -66 683 -74 c 128 - 692.333 -82 697.333 -93 698 -107 c 0 - 698 -120.333 693.667 -131.667 685 -141 c 128 - 676.333 -150.333 665.667 -155.333 653 -156 c 1 - 639 -156 627.333 -152 618 -144 c 128 - 608.667 -136 603.667 -125 603 -111 c 0 +750 242 m 1 + 388 -242 l 1 + 242 -242 l 1 + 604 242 l 1 + 750 242 l 1 +508 242 m 1 + 146 -242 l 1 + 0 -242 l 1 + 362 242 l 1 + 508 242 l 1 +52 118 m 4 + 52 131.333 56.333 142.667 65 152 c 132 + 73.667 161.333 84.333 166.333 97 167 c 5 + 111 167 122.667 163 132 155 c 132 + 141.333 147 146.333 136 147 122 c 4 + 147 108.667 142.667 97.333 134 88 c 132 + 125.333 78.667 114.667 73.667 102 73 c 5 + 88 73 76.333 77 67 85 c 132 + 57.667 93 52.667 104 52 118 c 4 +603 -121 m 0 + 603 -107.667 607.333 -96.333 616 -87 c 128 + 624.667 -77.667 635.334 -72.667 648 -72 c 1 + 662 -72 673.667 -76 683 -84 c 128 + 692.333 -92 697.333 -103 698 -117 c 0 + 698 -130.333 693.667 -141.667 685 -151 c 128 + 676.333 -160.333 665.667 -165.333 653 -166 c 1 + 639 -166 627.333 -162 618 -154 c 128 + 608.667 -146 603.667 -135 603 -121 c 0 EndSplineSet EndChar @@ -5559,48 +5559,48 @@ StartChar: uniE502 Encoding: 58626 58626 113 Width: 1234 VWidth: 2048 -Flags: HW +Flags: HWO LayerCount: 2 Fore SplineSet -1234 212 m 1 - 872 -212 l 1 - 726 -212 l 1 - 1088 212 l 1 - 1234 212 l 1 -992 212 m 1 - 630 -212 l 1 - 484 -212 l 1 - 846 212 l 1 - 992 212 l 1 -750 212 m 1 - 388 -212 l 1 - 242 -212 l 1 - 604 212 l 1 - 750 212 l 1 -508 212 m 1 - 146 -212 l 1 - 0 -212 l 1 - 362 212 l 1 - 508 212 l 1 -52 108 m 0 - 52 121.333 56.333 132.667 65 142 c 128 - 73.667 151.333 84.333 156.333 97 157 c 1 - 111 157 122.667 153 132 145 c 128 - 141.333 137 146.333 126 147 112 c 0 - 147 98.667 142.667 87.333 134 78 c 128 - 125.333 68.667 114.667 63.667 102 63 c 1 - 88 63 76.333 67 67 75 c 128 - 57.667 83 52.667 94 52 108 c 0 -1087 -111 m 0 - 1087 -97.667 1091.33 -86.333 1100 -77 c 128 - 1108.67 -67.667 1119.33 -62.667 1132 -62 c 1 - 1146 -62 1157.67 -66 1167 -74 c 128 - 1176.33 -82 1181.33 -93 1182 -107 c 0 - 1182 -120.333 1177.67 -131.667 1169 -141 c 128 - 1160.33 -150.333 1149.67 -155.333 1137 -156 c 1 - 1123 -156 1111.33 -152 1102 -144 c 128 - 1092.67 -136 1087.67 -125 1087 -111 c 0 +1234 242 m 1 + 872 -242 l 5 + 726 -242 l 5 + 1088 242 l 1 + 1234 242 l 1 +992 242 m 1 + 630 -242 l 5 + 484 -242 l 5 + 846 242 l 1 + 992 242 l 1 +750 242 m 1 + 388 -242 l 5 + 242 -242 l 5 + 604 242 l 1 + 750 242 l 1 +508 242 m 1 + 146 -242 l 5 + 0 -242 l 5 + 362 242 l 1 + 508 242 l 1 +52 118 m 0 + 52 131.333 56.333 142.667 65 152 c 128 + 73.667 161.333 84.333 166.333 97 167 c 1 + 111 167 122.667 163 132 155 c 128 + 141.333 147 146.333 136 147 122 c 0 + 147 108.667 142.667 97.333 134 88 c 128 + 125.333 78.667 114.667 73.667 102 73 c 1 + 88 73 76.333 77 67 85 c 128 + 57.667 93 52.667 104 52 118 c 0 +1087 -121 m 0 + 1087 -107.667 1091.33 -96.333 1100 -87 c 128 + 1108.67 -77.667 1119.33 -72.667 1132 -72 c 1 + 1146 -72 1157.67 -76 1167 -84 c 128 + 1176.33 -92 1181.33 -103 1182 -117 c 0 + 1182 -130.333 1177.67 -141.667 1169 -151 c 128 + 1160.33 -160.333 1149.67 -165.333 1137 -166 c 1 + 1123 -166 1111.33 -162 1102 -154 c 128 + 1092.67 -146 1087.67 -135 1087 -121 c 0 EndSplineSet EndChar EndChars diff --git a/fonts/Leipzig.svg b/fonts/Leipzig.svg index 6babe295953..4944797aa0f 100644 --- a/fonts/Leipzig.svg +++ b/fonts/Leipzig.svg @@ -7,7 +7,7 @@ Version 5.2.1 - adding repeats --> -Created by FontForge 20120731 at Mon Aug 24 21:49:58 2015 +Created by FontForge 20120731 at Tue Aug 25 17:31:58 2015 By laurent Created by Etienne Darbellay, Jean-Francois Marti and Laurent Pugin. This font is licensed under the SIL Open Font License \(http://scripts.sil.org/OFL\). @@ -353,8 +353,8 @@ c7 -4 26 -9 34 -12c4 -1 9 -2 16 -1c42 0 73 21 91 45c8 13 12 27 12 40l-3 22c-1 8 c-32 19 -55 39 -68 58c-13 21 -19 47 -19 78c0 33 8 59 23 78s37 38 66 56c-27 17 -49 37 -65 60s-24 53 -25 90c0 34 10 63 29 86c36 47 95 79 172 80c69 0 132 -21 169 -55c20 -18 30 -36 30 -54l-2 -15c-7 -29 -22 -44 -46 -44c-15 0 -27 4 -34 11c-10 10 -39 53 -54 69 c-7 7 -15 15 -25 23c-17 11 -39 18 -65 21c-31 0 -56 -8 -73 -23c-15 -15 -29 -30 -30 -57l1 -5c0 -46 51 -89 87 -105zM161 649v148l-37 23c-13 -2 -23 -6 -30 -13c-7 -10 -10 -16 -15 -28l-11 -30c0 -23 -1 -26 9 -40c7 -11 15 -20 23 -25z" /> +d="M508 242l-362 -484h-146l362 484h146zM52 118c0 13.333 4.33301 24.667 13 34s19.333 14.333 32 15c14 0 25.667 -4 35 -12s14.333 -19 15 -33c0 -13.333 -4.33301 -24.667 -13 -34s-19.333 -14.333 -32 -15c-14 0 -25.667 4 -35 12s-14.333 19 -15 33zM361 -121 +c0 13.333 4.33301 24.667 13 34s19.334 14.333 32 15c14 0 25.667 -4 35 -12s14.333 -19 15 -33c0 -13.333 -4.33301 -24.667 -13 -34s-19.333 -14.333 -32 -15c-14 0 -25.667 4 -35 12s-14.333 19 -15 33z" /> +d="M750 242l-362 -484h-146l362 484h146zM508 242l-362 -484h-146l362 484h146zM52 118c0 13.333 4.33301 24.667 13 34s19.333 14.333 32 15c14 0 25.667 -4 35 -12s14.333 -19 15 -33c0 -13.333 -4.33301 -24.667 -13 -34s-19.333 -14.333 -32 -15c-14 0 -25.667 4 -35 12 +s-14.333 19 -15 33zM603 -121c0 13.333 4.33301 24.667 13 34s19.334 14.333 32 15c14 0 25.667 -4 35 -12s14.333 -19 15 -33c0 -13.333 -4.33301 -24.667 -13 -34s-19.333 -14.333 -32 -15c-14 0 -25.667 4 -35 12s-14.333 19 -15 33z" /> diff --git a/include/vrv/layer.h b/include/vrv/layer.h index 7d336fa38eb..91bb81cde3c 100644 --- a/include/vrv/layer.h +++ b/include/vrv/layer.h @@ -119,6 +119,12 @@ class Layer: public DocObject, public DrawingListInterface, public ObjectListInt */ virtual int SetDrawingXY( ArrayPtrVoid *params ); + /** + * Functor for setting mRpt drawing numbers (if required) + * See implementation and Object::PrepareRpt + */ + virtual int PrepareRpt( ArrayPtrVoid *params ); + private: public: diff --git a/include/vrv/object.h b/include/vrv/object.h index 68b2cf2a2c9..e502b399272 100644 --- a/include/vrv/object.h +++ b/include/vrv/object.h @@ -580,6 +580,15 @@ class Object */ virtual int PrepareLyricsEnd( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; + /** + * Functor for setting mRpt drawing numbers (if required) + * The functor is process by staff/layer using an ArrayOfAttComparisons filter. + * param 0: MRpt **currentMRpt + * param 1: data_BOOLEAN for indicating if the MRpt::m_drawingNumber has to be set or not + * param 2: ScoreDef * doc scoreDef + */ + virtual int PrepareRpt( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; + /** * Goes through all the TimeSpanningInterface element and set them a current to each staff * where require. For Note with DrawingTieAttr, the functor is redireted to the tie object diff --git a/include/vrv/rpt.h b/include/vrv/rpt.h index ceed35927fd..06c2abd98c4 100644 --- a/include/vrv/rpt.h +++ b/include/vrv/rpt.h @@ -64,10 +64,22 @@ class MRpt: public LayerElement virtual std::string GetClassName( ){ return "MRpt"; }; ; virtual ClassId Is() { return MRPT; }; ///@} + + //----------// + // Functors // + //----------// + + /** + * Functor for setting mRpt drawing numbers (if required) + * See implementation and Object::PrepareRpt + */ + virtual int PrepareRpt( ArrayPtrVoid *params ); private: public: + /** measure count */ + int m_drawingMeasureCount; private: diff --git a/include/vrv/scoredefinterface.h b/include/vrv/scoredefinterface.h index add4c245316..c3f32aeded8 100644 --- a/include/vrv/scoredefinterface.h +++ b/include/vrv/scoredefinterface.h @@ -31,7 +31,8 @@ class ScoreDefInterface: public Interface, public AttMensuralLog, public AttMensuralShared, public AttMeterSigDefaultLog, - public AttMeterSigDefaultVis + public AttMeterSigDefaultVis, + public AttMultinummeasures { public: /** diff --git a/include/vrv/staff.h b/include/vrv/staff.h index 8280a17e957..233a73fa815 100644 --- a/include/vrv/staff.h +++ b/include/vrv/staff.h @@ -111,6 +111,12 @@ class Staff: public DocObject, */ virtual int SetDrawingXY( ArrayPtrVoid *params ); + /** + * Functor for setting mRpt drawing numbers (if required) + * See implementation and Object::PrepareRpt + */ + virtual int PrepareRpt( ArrayPtrVoid *params ); + public: /** * Number of lines copied from the staffDef for fast access when drawing diff --git a/include/vrv/view.h b/include/vrv/view.h index ee40795fa1c..e816c9af844 100644 --- a/include/vrv/view.h +++ b/include/vrv/view.h @@ -206,6 +206,7 @@ class View ///@{ void DrawAccid( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure, Accid* prevAccid = NULL ); void DrawBeam(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); + void DrawBeatRpt(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); void DrawBarline( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); void DrawChord( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); void DrawClef( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); @@ -214,8 +215,11 @@ class View void DrawDurationElement( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); void DrawKeySig( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); void DrawMeterSig( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); + void DrawMRpt( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); + void DrawMRpt2( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); void DrawMRest( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); void DrawMultiRest( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); + void DrawMultiRpt( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); void DrawNote( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); void DrawProport( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); void DrawRest( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); diff --git a/libmei/atts_shared.cpp b/libmei/atts_shared.cpp index 37f32118e4c..ee087a62a13 100644 --- a/libmei/atts_shared.cpp +++ b/libmei/atts_shared.cpp @@ -3625,13 +3625,13 @@ AttMultinummeasures::~AttMultinummeasures() { } void AttMultinummeasures::ResetMultinummeasures() { - m_multiNumber = ""; + m_multiNumber = BOOLEAN_NONE; } bool AttMultinummeasures::ReadMultinummeasures( pugi::xml_node element ) { bool hasAttribute = false; if (element.attribute("multi.number")) { - this->SetMultiNumber(StrToStr(element.attribute("multi.number").value())); + this->SetMultiNumber(StrToBool(element.attribute("multi.number").value())); element.remove_attribute("multi.number"); hasAttribute = true; } @@ -3641,7 +3641,7 @@ bool AttMultinummeasures::ReadMultinummeasures( pugi::xml_node element ) { bool AttMultinummeasures::WriteMultinummeasures( pugi::xml_node element ) { bool wroteAttribute = false; if (this->HasMultiNumber()) { - element.append_attribute("multi.number") = StrToStr(this->GetMultiNumber()).c_str(); + element.append_attribute("multi.number") = BoolToStr(this->GetMultiNumber()).c_str(); wroteAttribute = true; } return wroteAttribute; @@ -3649,7 +3649,7 @@ bool AttMultinummeasures::WriteMultinummeasures( pugi::xml_node element ) { bool AttMultinummeasures::HasMultiNumber( ) { - return (m_multiNumber != ""); + return (m_multiNumber != BOOLEAN_NONE); } @@ -7677,7 +7677,7 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu AttMultinummeasures *att = dynamic_cast(element); assert( att ); if (attrType == "multiNumber") { - att->SetMultiNumber(att->StrToStr(attrValue)); + att->SetMultiNumber(att->StrToBool(attrValue)); return true; } } @@ -8984,7 +8984,7 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { AttMultinummeasures *att = dynamic_cast(element); assert( att ); if (att->HasMultiNumber()) { - attributes->push_back(std::make_pair("multiNumber", att->StrToStr(att->GetMultiNumber()))); + attributes->push_back(std::make_pair("multiNumber", att->BoolToStr(att->GetMultiNumber()))); } } if (element->HasAttClass( ATT_NAME ) ) { diff --git a/libmei/atts_shared.h b/libmei/atts_shared.h index ff8119ece2a..9ef1c453438 100644 --- a/libmei/atts_shared.h +++ b/libmei/atts_shared.h @@ -3139,8 +3139,8 @@ class AttMultinummeasures: public Att * to the default value) **/ ///@{ - void SetMultiNumber(std::string multiNumber_) { m_multiNumber = multiNumber_; }; - std::string GetMultiNumber() const { return m_multiNumber; }; + void SetMultiNumber(data_BOOLEAN multiNumber_) { m_multiNumber = multiNumber_; }; + data_BOOLEAN GetMultiNumber() const { return m_multiNumber; }; bool HasMultiNumber( ); ///@} @@ -3150,7 +3150,7 @@ class AttMultinummeasures: public Att * Indicates whether programmatically calculated counts of multiple measures of * rest (mRest) and whole measure repeats (mRpt) in parts should be rendered. **/ - std::string m_multiNumber; + data_BOOLEAN m_multiNumber; /* include */ }; diff --git a/src/doc.cpp b/src/doc.cpp index d4962bb1dd4..58776172c91 100644 --- a/src/doc.cpp +++ b/src/doc.cpp @@ -27,6 +27,7 @@ #include "multirest.h" #include "note.h" #include "page.h" +#include "rpt.h" #include "slur.h" #include "smufl.h" #include "staff.h" @@ -250,6 +251,32 @@ void Doc::PrepareDrawing() LogDebug("%d time spanning elements could not be set as running", timeSpanningElements.size() ); } + // Process by staff for matching mRpt elements and setting the drawing number + MRpt *currentMRpt; + data_BOOLEAN multiNumber; + for (staves = layerTree.child.begin(); staves != layerTree.child.end(); ++staves) { + for (layers = staves->second.child.begin(); layers != staves->second.child.end(); ++layers) { + filters.clear(); + // Create ad comparison object for each type / @n + AttCommonNComparison matchStaff( STAFF, staves->first ); + AttCommonNComparison matchLayer( LAYER, layers->first ); + filters.push_back( &matchStaff ); + filters.push_back( &matchLayer ); + + // The first pass set m_drawingFirstNote and m_drawingLastNote for each syl + // m_drawingLastNote is set only if the syl has a forward connector + currentMRpt = NULL; + // We set multiNumber to NONE for indicated we need to look at the staffDef when reaching the first staff + multiNumber = BOOLEAN_NONE; + ArrayPtrVoid paramsRptAttr; + paramsRptAttr.push_back(¤tMRpt); + paramsRptAttr.push_back(&multiNumber); + paramsRptAttr.push_back(&m_scoreDef); + Functor prepareRpt( &Object::PrepareRpt ); + this->Process( &prepareRpt, ¶msRptAttr, NULL, &filters ); + } + } + /* // Alternate solution with StaffN_LayerN_VerseN_t StaffN_LayerN_VerseN_t::iterator staves; @@ -509,6 +536,7 @@ char Doc::GetLeftMargin( const ClassId classId ) else if (classId == CHORD) return m_style->m_leftMarginChord; else if (classId == CLEF) return m_style->m_leftMarginClef; else if (classId == MREST) return m_style->m_leftMarginMRest; + else if (classId == MRPT) return m_style->m_leftMarginMRest; else if (classId == NOTE) return m_style->m_leftMarginNote; return m_style->m_leftMarginDefault; } @@ -522,6 +550,7 @@ char Doc::GetRightMargin( const ClassId classId ) else if (classId == MENSUR) return m_style->m_rightMarginMensur; else if (classId == METER_SIG) return m_style->m_rightMarginMeterSig; else if (classId == MREST) return m_style->m_rightMarginMRest; + else if (classId == MRPT) return m_style->m_rightMarginMRest; else if (classId == MULTI_REST) return m_style->m_rightMarginMultiRest; return m_style->m_rightMarginDefault; } diff --git a/src/iomei.cpp b/src/iomei.cpp index 3cb26023e89..719fd529212 100644 --- a/src/iomei.cpp +++ b/src/iomei.cpp @@ -811,6 +811,7 @@ void MeiOutput::WriteScoreDefInterface(pugi::xml_node element, ScoreDefInterface interface->WriteMensuralShared(element); interface->WriteMeterSigDefaultLog(element); interface->WriteMeterSigDefaultVis(element); + interface->WriteMultinummeasures(element); } void MeiOutput::WriteTextDirInterface(pugi::xml_node element, TextDirInterface *interface) @@ -2028,6 +2029,7 @@ bool MeiInput::ReadScoreDefInterface(pugi::xml_node element, ScoreDefInterface * interface->ReadMensuralShared(element); interface->ReadMeterSigDefaultLog(element); interface->ReadMeterSigDefaultVis(element); + interface->ReadMultinummeasures(element); return true; } diff --git a/src/layer.cpp b/src/layer.cpp index ab8fdcd4835..4aebe1b3cba 100644 --- a/src/layer.cpp +++ b/src/layer.cpp @@ -21,6 +21,7 @@ #include "mensur.h" #include "metersig.h" #include "note.h" +#include "rpt.h" #include "staff.h" #include "vrv.h" @@ -264,5 +265,19 @@ int Layer::SetDrawingXY( ArrayPtrVoid *params ) return FUNCTOR_CONTINUE; } + +int Layer::PrepareRpt( ArrayPtrVoid *params ) +{ + // param 0: a pointer to the current MRpt pointer + // param 1: a pointer to the data_BOOLEAN indicating if multiNumber (unused) + // param 2: a pointer to the doc scoreDef (unused) + MRpt **currentMRpt = static_cast((*params)[0]); + + // If we have encountered a mRpt before and there is none is this layer, reset it to NULL + if ((*currentMRpt) && !this->FindChildByType(MRPT)) { + (*currentMRpt) = NULL; + } + return FUNCTOR_CONTINUE; +} } // namespace vrv diff --git a/src/layerelement.cpp b/src/layerelement.cpp index e6fa6e0a24f..50b676b1088 100644 --- a/src/layerelement.cpp +++ b/src/layerelement.cpp @@ -250,7 +250,7 @@ int LayerElement::AlignHorizontally( ArrayPtrVoid *params ) type = ALIGNMENT_METERSIG; } } - else if ( (this->Is() == MULTI_REST) || (this->Is() == MREST) ) { + else if ( (this->Is() == MULTI_REST) || (this->Is() == MREST) || (this->Is() == MRPT) ) { type = ALIGNMENT_MULTIREST; } else if ( this->IsGraceNote() ) { diff --git a/src/object.cpp b/src/object.cpp index 631c6a8f7f0..fd9f32fe80c 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -1176,7 +1176,7 @@ int Object::SetBoundingBoxXShift( ArrayPtrVoid *params ) // this should never happen (but can with glyphs not exactly registered at position x=0 in the SMuFL font used if ( negative_offset < 0 ) negative_offset = 0; - if (current->Is() == MREST) { + if ((current->Is() == MREST) || (current->Is() == MRPT)) { // With MRest, the only thing we want to do it keep their with as possible measure with (if only MRest in all staves/layers) int width = current->m_contentBB_x2 + doc->GetRightMargin( current->Is() ) * doc->GetDrawingUnit(100) / PARAM_DENOMINATOR + negative_offset ; // Keep it if more than the current measure width diff --git a/src/rpt.cpp b/src/rpt.cpp index cbf09441ae8..f7841cb90a1 100644 --- a/src/rpt.cpp +++ b/src/rpt.cpp @@ -47,6 +47,8 @@ MRpt::~MRpt() void MRpt::Reset() { LayerElement::Reset(); + + m_drawingMeasureCount = 0; } @@ -88,5 +90,34 @@ void MultiRpt::Reset() { LayerElement::Reset(); } + +//---------------------------------------------------------------------------- +// MRpt functor methods +//---------------------------------------------------------------------------- + +int MRpt::PrepareRpt( ArrayPtrVoid *params ) +{ + // param 0: a pointer to the current MRpt pointer + // param 1: a pointer to the data_BOOLEAN indicating if multiNumber + // param 2: a pointer to the doc scoreDef (unused) + MRpt **currentMRpt = static_cast((*params)[0]); + data_BOOLEAN *multiNumber = static_cast((*params)[1]); + + // If multiNumber is not true, nothing needs to be done + if ((*multiNumber) != BOOLEAN_true) { + return FUNCTOR_CONTINUE; + } + + // If this is the first one, number has to be 2 + if ((*currentMRpt) == NULL) { + this->m_drawingMeasureCount = 2; + } + // Otherwise increment it + else { + this->m_drawingMeasureCount = (*currentMRpt)->m_drawingMeasureCount + 1; + } + (*currentMRpt) = this; + return FUNCTOR_CONTINUE; +} } // namespace vrv diff --git a/src/scoredefinterface.cpp b/src/scoredefinterface.cpp index c8bdc54d42e..8fc03483591 100644 --- a/src/scoredefinterface.cpp +++ b/src/scoredefinterface.cpp @@ -32,7 +32,8 @@ ScoreDefInterface::ScoreDefInterface(): Interface(), AttMensuralShared(), AttMensuralLog(), AttMeterSigDefaultLog(), - AttMeterSigDefaultVis() + AttMeterSigDefaultVis(), + AttMultinummeasures() { RegisterInterfaceAttClass(ATT_CLEFFINGLOG); RegisterInterfaceAttClass(ATT_KEYSIGDEFAULTLOG); @@ -41,6 +42,7 @@ ScoreDefInterface::ScoreDefInterface(): Interface(), RegisterInterfaceAttClass(ATT_MENSURALSHARED); RegisterInterfaceAttClass(ATT_METERSIGDEFAULTLOG); RegisterInterfaceAttClass(ATT_METERSIGDEFAULTVIS); + RegisterInterfaceAttClass(ATT_MULTINUMMEASURES); Reset(); } @@ -57,6 +59,7 @@ void ScoreDefInterface::Reset() ResetMensuralShared(); ResetMeterSigDefaultLog(); ResetMeterSigDefaultVis(); + ResetMultinummeasures(); } } // namespace vrv diff --git a/src/staff.cpp b/src/staff.cpp index 2a9d5f84f8d..a3c22d25568 100644 --- a/src/staff.cpp +++ b/src/staff.cpp @@ -226,5 +226,31 @@ int Staff::SetDrawingXY( ArrayPtrVoid *params ) return FUNCTOR_CONTINUE; } + +int Staff::PrepareRpt( ArrayPtrVoid *params ) +{ + // param 0: a pointer to the current MRpt pointer (unused) + // param 1: a pointer to the data_BOOLEAN indicating if multiNumber + // param 2: a pointer to the doc scoreDef + data_BOOLEAN *multiNumber = static_cast((*params)[1]); + ScoreDef *scoreDef = static_cast((*params)[2]); + + // If multiNumber is set, we already know that nothing needs to be done + // Futhermore, if @multi.number is false, the functor should have stop (see below) + if ((*multiNumber) != BOOLEAN_NONE) { + return FUNCTOR_CONTINUE; + } + + // This is happening only for the first staff element of the staff @n + if (StaffDef *staffDef = scoreDef->GetStaffDef( this->GetN() ) ) { + if ((staffDef->HasMultiNumber()) && (staffDef->GetMultiNumber() == BOOLEAN_false)) { + // Set it just in case, but stopping the functor should do it for this staff @n + (*multiNumber) = BOOLEAN_false; + return FUNCTOR_STOP; + } + } + (*multiNumber) = BOOLEAN_true; + return FUNCTOR_CONTINUE; +} } // namespace vrv diff --git a/src/view_element.cpp b/src/view_element.cpp index 5b8e4732123..8324a40abdc 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -33,6 +33,7 @@ #include "note.h" #include "proport.h" #include "rest.h" +#include "rpt.h" #include "space.h" #include "smufl.h" #include "staff.h" @@ -76,6 +77,9 @@ void View::DrawLayerElement( DeviceContext *dc, LayerElement *element, Layer *la else if (element->Is() == BEAM) { DrawBeam(dc, element, layer, staff, measure); } + else if (element->Is() == BEAT_RPT) { + DrawBeatRpt(dc, element, layer, staff, measure); + } else if (element->Is() == CHORD) { DrawDurationElement(dc, element, layer, staff, measure); } @@ -100,9 +104,18 @@ void View::DrawLayerElement( DeviceContext *dc, LayerElement *element, Layer *la else if (element->Is() == MREST) { DrawMRest(dc, element, layer, staff, measure); } + else if (element->Is() == MRPT) { + DrawMRpt(dc, element, layer, staff, measure); + } + else if (element->Is() == MRPT2) { + DrawMRpt2(dc, element, layer, staff, measure); + } else if (element->Is() == MULTI_REST) { DrawMultiRest(dc, element, layer, staff, measure); } + else if (element->Is() == MULTI_RPT) { + DrawMultiRpt(dc, element, layer, staff, measure); + } else if (element->Is() == NOTE) { DrawDurationElement(dc, element, layer, staff, measure); } @@ -716,6 +729,59 @@ void View::DrawMultiRest(DeviceContext *dc, LayerElement *element, Layer *layer, return; } + +void View::DrawBeatRpt(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure) +{ +} + +void View::DrawMRpt(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure) +{ + assert( dc ); + assert( element ); + assert( layer ); + assert( staff ); + assert( measure ); + + MRpt *mRpt = dynamic_cast(element); + assert( mRpt ); + + dc->StartGraphic( element, "", element->GetUuid() ); + + int x = element->GetDrawingX(); + int xCentered = x + (measure->GetDrawingX() + measure->GetRightBarlineX() - x) / 2; + int xSymbol = xCentered - m_doc->GetGlyphWidth(SMUFL_E500_repeat1Bar, staff->m_drawingStaffSize, false) / 2; + + int y = element->GetDrawingY(); + + y -= staff->m_drawingLines / 2 * m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); + + DrawSmuflCode( dc, xSymbol, y, SMUFL_E500_repeat1Bar, staff->m_drawingStaffSize, false ); + + if (mRpt->m_drawingMeasureCount > 0) { + dc->SetFont( m_doc->GetDrawingSmuflFont( staff->m_drawingStaffSize, false) ); + // calculate the width of the figures + int txt_length = 0; + int txt_height = 0; + std::wstring figures = IntToTupletFigures(mRpt->m_drawingMeasureCount); + dc->GetSmuflTextExtent(figures, &txt_length, &txt_height); + dc->DrawMusicText( figures, ToDeviceContextX(xCentered - txt_length / 2), + ToDeviceContextY(staff->GetDrawingY() + m_doc->GetDrawingUnit(staff->m_drawingStaffSize)) ); + dc->ResetFont(); + } + + dc->EndGraphic(element, this); + + return; + +} + +void View::DrawMRpt2(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure) +{ +} + +void View::DrawMultiRpt(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure) +{ +} void View::DrawLongRest ( DeviceContext *dc, int x, int y, Staff *staff) { From 55560739346e95e1366b690a343ac1cd93dabbae Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Fri, 28 Aug 2015 08:03:47 +0200 Subject: [PATCH 088/114] Adjusting multiRest margin --- include/vrv/style.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/vrv/style.h b/include/vrv/style.h index 2a7fc313e65..daf001da646 100644 --- a/include/vrv/style.h +++ b/include/vrv/style.h @@ -138,7 +138,7 @@ namespace vrv { #define MIN_RIGHT_MARGIN_MREST 0.0 #define MAX_RIGHT_MARGIN_MREST 10.0 -#define DEFAULT_RIGHT_MARGIN_MULTIREST 3.0 +#define DEFAULT_RIGHT_MARGIN_MULTIREST 0.5 #define MIN_RIGHT_MARGIN_MULTIREST 0.0 #define MAX_RIGHT_MARGIN_MULTIREST 10.0 From 1c66531da704d55432cef06bc9c7f1026219f6fd Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Fri, 28 Aug 2015 08:05:17 +0200 Subject: [PATCH 089/114] Fixing measure right and left attribute initialization and 0 key signature drawing --- src/iomei.cpp | 8 -------- src/layer.cpp | 11 ++++++++++- src/measure.cpp | 4 ++++ src/view_floating.cpp | 2 +- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/iomei.cpp b/src/iomei.cpp index 719fd529212..3faa15654e3 100644 --- a/src/iomei.cpp +++ b/src/iomei.cpp @@ -465,10 +465,6 @@ bool MeiOutput::WriteMeiMeasure( pugi::xml_node currentNode, Measure *measure ) currentNode.append_attribute( "xml:id" ) = UuidToMeiStr( measure ).c_str(); measure->WriteCommon(currentNode); - - // here we transfer the barLine object values to @left and @right - measure->SetLeft( measure->GetLeftBarlineType() ); - measure->SetRight( measure->GetRightBarlineType() ); measure->WriteMeasureLog(currentNode); return true; @@ -1390,10 +1386,6 @@ bool MeiInput::ReadMeiMeasure( Object *parent, pugi::xml_node measure ) vrvMeasure->ReadCommon(measure); vrvMeasure->ReadMeasureLog(measure); - // here we transfer the @left and @right values to the barLine objects - vrvMeasure->SetLeftBarlineType( vrvMeasure->GetLeft() ); - vrvMeasure->SetRightBarlineType( vrvMeasure->GetRight() ); - // This could me moved to an AddMeasure method for consistency with AddLayerElement if ( parent->Is() == SYSTEM ) { System *system = dynamic_cast( parent ); diff --git a/src/layer.cpp b/src/layer.cpp index 4aebe1b3cba..ca864c86409 100644 --- a/src/layer.cpp +++ b/src/layer.cpp @@ -98,8 +98,17 @@ void Layer::SetDrawingAndCurrentValues( StaffDef *currentStaffDef ) // Remove any previous value in the Layer this->StaffDefDrawingInterface::Reset(); + // Special case with C-major / A-minor key signature (0) : if key cancellation is false, we are at the beginning + // of a new system, and hence we should not draw it. Maybe this can be improved? + bool drawKeySig = currentStaffDef->DrawKeySig(); + if (currentStaffDef->GetCurrentKeySig() && (currentStaffDef->GetCurrentKeySig()->GetAlterationNumber() == 0)) { + if (currentStaffDef->DrawKeySigCancellation() == false) { + drawKeySig = false; + } + } + this->SetDrawClef( currentStaffDef->DrawClef() ); - this->SetDrawKeySig( currentStaffDef->DrawKeySig() ); + this->SetDrawKeySig( drawKeySig ); // see above this->SetDrawMensur( currentStaffDef->DrawMensur() ); this->SetDrawMeterSig( currentStaffDef->DrawMeterSig() ); this->SetDrawKeySigCancellation( currentStaffDef->DrawKeySigCancellation() ); diff --git a/src/measure.cpp b/src/measure.cpp index 973f4f8f35c..a417658578a 100644 --- a/src/measure.cpp +++ b/src/measure.cpp @@ -150,6 +150,10 @@ int Measure::AlignHorizontally( ArrayPtrVoid *params ) // clear the content of the measureAligner m_measureAligner.Reset(); + // here we transfer the @left and @right values to the barLine objects + this->SetLeftBarlineType( this->GetLeft() ); + this->SetRightBarlineType( this->GetRight() ); + // point to it (*measureAligner) = &m_measureAligner; diff --git a/src/view_floating.cpp b/src/view_floating.cpp index e55f4e44c0b..23964714255 100644 --- a/src/view_floating.cpp +++ b/src/view_floating.cpp @@ -324,7 +324,7 @@ void View::DrawTie( DeviceContext *dc, Tie *tie, int x1, int x2, Staff *staff, } // Finally else { - LogDebug("Slur across an entire system is not supported"); + LogDebug("Tie across an entire system is not supported"); return; } From cefae62518b294e91eddb6700d0f148a8f1175b7 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Fri, 28 Aug 2015 13:56:46 +0200 Subject: [PATCH 090/114] Adding attribute rend to beatRpt and basic rendering (WIP) --- data/Leipzig.xml | 2 +- .../E101-noteheadSlashHorizontalEnds.xml | 2 +- fonts/Leipzig-5.2.sfd | 20 +++++------ fonts/Leipzig.svg | 6 ++-- include/vrv/att.h | 3 ++ include/vrv/attdef.h | 15 ++++++++- include/vrv/rpt.h | 4 ++- libmei/atts_cmn.cpp | 24 +++++++------- libmei/atts_cmn.h | 12 +++---- src/att.cpp | 33 +++++++++++++++++++ src/iomei.cpp | 2 ++ src/rpt.cpp | 5 ++- src/view_element.cpp | 24 ++++++++++++++ 13 files changed, 117 insertions(+), 35 deletions(-) diff --git a/data/Leipzig.xml b/data/Leipzig.xml index ec4c144d9b7..b4908963b42 100644 --- a/data/Leipzig.xml +++ b/data/Leipzig.xml @@ -104,7 +104,7 @@ - + diff --git a/data/Leipzig/E101-noteheadSlashHorizontalEnds.xml b/data/Leipzig/E101-noteheadSlashHorizontalEnds.xml index 61caf7d4d60..4f3764bb968 100644 --- a/data/Leipzig/E101-noteheadSlashHorizontalEnds.xml +++ b/data/Leipzig/E101-noteheadSlashHorizontalEnds.xml @@ -3,6 +3,6 @@ overflow="inherit" horiz-adv-x="508"> - + diff --git a/fonts/Leipzig-5.2.sfd b/fonts/Leipzig-5.2.sfd index 800c5a122b6..5f040880a9a 100644 --- a/fonts/Leipzig-5.2.sfd +++ b/fonts/Leipzig-5.2.sfd @@ -4,7 +4,7 @@ FullName: Leipzig FamilyName: Leipzig Weight: Regular Copyright: Created by Etienne Darbellay, Jean-Francois Marti and Laurent Pugin. \nThis font is licensed under the SIL Open Font License \\(http://scripts.sil.org/OFL\\).\nVersion 5.2.1 -UComments: "2014-03-21: Created.+AAoA-Version 5.2.0 - adding glyphs (dynamics, ornaments, mensural note heads, etc)+AAoA-Version 5.2.1 - adding repeats" +UComments: "2014-03-21: Created.+AAoA-Version 5.2.0 - adding glyphs (dynamics, ornaments, mensural note heads, etc)+AAoA-Version 5.2.1 - adding repeats+AAoA-Version 5.2.2 - fixing size of some glpyhs+AAoA" Version: 5.2.1 ItalicAngle: 0 UnderlinePosition: -50 @@ -20,7 +20,7 @@ OS2Version: 0 OS2_WeightWidthSlopeOnly: 0 OS2_UseTypoMetrics: 1 CreationTime: 1395388130 -ModificationTime: 1440516689 +ModificationTime: 1440762871 PfmFamily: 17 TTFWeight: 500 TTFWidth: 5 @@ -49,7 +49,7 @@ NameList: Adobe Glyph List DisplaySize: -72 AntiAlias: 1 FitToEm: 1 -WinInfo: 58554 18 9 +WinInfo: 57510 18 9 BeginPrivate: 0 EndPrivate TeXData: 1 0 0 346030 173015 115343 0 1048576 115343 783286 444596 497025 792723 393216 433062 380633 303038 157286 324010 404750 52429 2506097 1059062 262144 @@ -5504,15 +5504,15 @@ StartChar: uniE101 Encoding: 57601 57601 111 Width: 508 VWidth: 2048 -Flags: HW +Flags: HWO LayerCount: 2 Fore SplineSet -508 212 m 5 - 146 -212 l 5 - 0 -212 l 5 - 362 212 l 5 - 508 212 l 5 +508 242 m 1 + 146 -242 l 1 + 0 -242 l 1 + 362 242 l 1 + 508 242 l 1 EndSplineSet EndChar @@ -5559,7 +5559,7 @@ StartChar: uniE502 Encoding: 58626 58626 113 Width: 1234 VWidth: 2048 -Flags: HWO +Flags: HW LayerCount: 2 Fore SplineSet diff --git a/fonts/Leipzig.svg b/fonts/Leipzig.svg index 4944797aa0f..49f630b76ff 100644 --- a/fonts/Leipzig.svg +++ b/fonts/Leipzig.svg @@ -4,10 +4,12 @@ 2014-03-21: Created. Version 5.2.0 - adding glyphs (dynamics, ornaments, mensural note heads, etc) Version 5.2.1 - adding repeats +Version 5.2.2 - fixing size of some glpyhs + --> -Created by FontForge 20120731 at Tue Aug 25 17:31:58 2015 +Created by FontForge 20120731 at Fri Aug 28 13:54:39 2015 By laurent Created by Etienne Darbellay, Jean-Francois Marti and Laurent Pugin. This font is licensed under the SIL Open Font License \(http://scripts.sil.org/OFL\). @@ -472,7 +474,7 @@ d="M155 194l157 -194l-157 -192l-155 192zM125 111l-57 -73l122 -149l56 71z" /> +d="M508 242l-362 -484h-146l362 484h146z" /> diff --git a/include/vrv/att.h b/include/vrv/att.h index ffd34743c8f..a12558ddf5d 100644 --- a/include/vrv/att.h +++ b/include/vrv/att.h @@ -110,6 +110,9 @@ class Att std::string BarRenditionToStr(data_BARRENDITION data); data_BARRENDITION StrToBarRendition(std::string value); + std::string BeatrptRendToStr(data_BEATRPT_REND data); + data_BEATRPT_REND StrToBeatrptRend(std::string value); + std::string BoolToStr(data_BOOLEAN data); data_BOOLEAN StrToBool(std::string value); diff --git a/include/vrv/attdef.h b/include/vrv/attdef.h index dcd70a4338d..0f271277c81 100644 --- a/include/vrv/attdef.h +++ b/include/vrv/attdef.h @@ -94,7 +94,7 @@ enum data_ACCIDENTAL_IMPLICIT { }; /** - * MEI data_BARRENDITION + * MEI data.BARRENDITION */ enum data_BARRENDITION { BARRENDITION_NONE = 0, @@ -111,6 +111,19 @@ enum data_BARRENDITION { BARRENDITION_single }; +/** + * MEI data.BEATRPT_REND + */ +enum data_BEATRPT_REND { + BEATRPT_REND_NONE = 0, + BEATRPT_REND_4, + BEATRPT_REND_16, + BEATRPT_REND_32, + BEATRPT_REND_64, + BEATRPT_REND_128, + BEATRPT_REND_mixed +}; + /** * MEI data.BOOEAN */ diff --git a/include/vrv/rpt.h b/include/vrv/rpt.h index 06c2abd98c4..11203207158 100644 --- a/include/vrv/rpt.h +++ b/include/vrv/rpt.h @@ -9,6 +9,7 @@ #ifndef __VRV_RPT_H__ #define __VRV_RPT_H__ +#include "atts_cmn.h" #include "layerelement.h" namespace vrv { @@ -20,7 +21,8 @@ namespace vrv { /** * This class models the MEI */ -class BeatRpt: public LayerElement +class BeatRpt: public LayerElement, + public AttBeatRptVis { public: /** diff --git a/libmei/atts_cmn.cpp b/libmei/atts_cmn.cpp index 76739fd5875..896e883f4c1 100644 --- a/libmei/atts_cmn.cpp +++ b/libmei/atts_cmn.cpp @@ -312,14 +312,14 @@ AttBeamrend::~AttBeamrend() { } void AttBeamrend::ResetBeamrend() { - m_rend = ""; + m_rend = BEATRPT_REND_NONE; m_slopeDbl = 0.0; } bool AttBeamrend::ReadBeamrend( pugi::xml_node element ) { bool hasAttribute = false; if (element.attribute("rend")) { - this->SetRend(StrToStr(element.attribute("rend").value())); + this->SetRend(StrToBeatrptRend(element.attribute("rend").value())); element.remove_attribute("rend"); hasAttribute = true; } @@ -334,7 +334,7 @@ bool AttBeamrend::ReadBeamrend( pugi::xml_node element ) { bool AttBeamrend::WriteBeamrend( pugi::xml_node element ) { bool wroteAttribute = false; if (this->HasRend()) { - element.append_attribute("rend") = StrToStr(this->GetRend()).c_str(); + element.append_attribute("rend") = BeatrptRendToStr(this->GetRend()).c_str(); wroteAttribute = true; } if (this->HasSlope()) { @@ -346,7 +346,7 @@ bool AttBeamrend::WriteBeamrend( pugi::xml_node element ) { bool AttBeamrend::HasRend( ) { - return (m_rend != ""); + return (m_rend != BEATRPT_REND_NONE); } bool AttBeamrend::HasSlope( ) @@ -413,13 +413,13 @@ AttBeatRptVis::~AttBeatRptVis() { } void AttBeatRptVis::ResetBeatRptVis() { - m_rend = ""; + m_rend = BEATRPT_REND_NONE; } bool AttBeatRptVis::ReadBeatRptVis( pugi::xml_node element ) { bool hasAttribute = false; if (element.attribute("rend")) { - this->SetRend(StrToStr(element.attribute("rend").value())); + this->SetRend(StrToBeatrptRend(element.attribute("rend").value())); element.remove_attribute("rend"); hasAttribute = true; } @@ -429,7 +429,7 @@ bool AttBeatRptVis::ReadBeatRptVis( pugi::xml_node element ) { bool AttBeatRptVis::WriteBeatRptVis( pugi::xml_node element ) { bool wroteAttribute = false; if (this->HasRend()) { - element.append_attribute("rend") = StrToStr(this->GetRend()).c_str(); + element.append_attribute("rend") = BeatrptRendToStr(this->GetRend()).c_str(); wroteAttribute = true; } return wroteAttribute; @@ -437,7 +437,7 @@ bool AttBeatRptVis::WriteBeatRptVis( pugi::xml_node element ) { bool AttBeatRptVis::HasRend( ) { - return (m_rend != ""); + return (m_rend != BEATRPT_REND_NONE); } @@ -1813,7 +1813,7 @@ bool Att::SetCmn( Object *element, std::string attrType, std::string attrValue ) AttBeamrend *att = dynamic_cast(element); assert( att ); if (attrType == "rend") { - att->SetRend(att->StrToStr(attrValue)); + att->SetRend(att->StrToBeatrptRend(attrValue)); return true; } if (attrType == "slopeDbl") { @@ -1833,7 +1833,7 @@ bool Att::SetCmn( Object *element, std::string attrType, std::string attrValue ) AttBeatRptVis *att = dynamic_cast(element); assert( att ); if (attrType == "rend") { - att->SetRend(att->StrToStr(attrValue)); + att->SetRend(att->StrToBeatrptRend(attrValue)); return true; } } @@ -2151,7 +2151,7 @@ void Att::GetCmn( Object *element, ArrayOfStrAttr *attributes ) { AttBeamrend *att = dynamic_cast(element); assert( att ); if (att->HasRend()) { - attributes->push_back(std::make_pair("rend", att->StrToStr(att->GetRend()))); + attributes->push_back(std::make_pair("rend", att->BeatrptRendToStr(att->GetRend()))); } if (att->HasSlope()) { attributes->push_back(std::make_pair("slopeDbl", att->DblToStr(att->GetSlope()))); @@ -2168,7 +2168,7 @@ void Att::GetCmn( Object *element, ArrayOfStrAttr *attributes ) { AttBeatRptVis *att = dynamic_cast(element); assert( att ); if (att->HasRend()) { - attributes->push_back(std::make_pair("rend", att->StrToStr(att->GetRend()))); + attributes->push_back(std::make_pair("rend", att->BeatrptRendToStr(att->GetRend()))); } } if (element->HasAttClass( ATT_BENDGES ) ) { diff --git a/libmei/atts_cmn.h b/libmei/atts_cmn.h index 0427fa217e9..231a1640b3f 100644 --- a/libmei/atts_cmn.h +++ b/libmei/atts_cmn.h @@ -295,8 +295,8 @@ class AttBeamrend: public Att * to the default value) **/ ///@{ - void SetRend(std::string rend_) { m_rend = rend_; }; - std::string GetRend() const { return m_rend; }; + void SetRend(data_BEATRPT_REND rend_) { m_rend = rend_; }; + data_BEATRPT_REND GetRend() const { return m_rend; }; bool HasRend( ); // @@ -308,7 +308,7 @@ class AttBeamrend: public Att private: /** Records the appearance and usually the function of the bar line. **/ - std::string m_rend; + data_BEATRPT_REND m_rend; /** Records the slope of the beam. **/ double m_slopeDbl; @@ -383,15 +383,15 @@ class AttBeatRptVis: public Att * to the default value) **/ ///@{ - void SetRend(std::string rend_) { m_rend = rend_; }; - std::string GetRend() const { return m_rend; }; + void SetRend(data_BEATRPT_REND rend_) { m_rend = rend_; }; + data_BEATRPT_REND GetRend() const { return m_rend; }; bool HasRend( ); ///@} private: /** Records the appearance and usually the function of the bar line. **/ - std::string m_rend; + data_BEATRPT_REND m_rend; /* include */ }; diff --git a/src/att.cpp b/src/att.cpp index 6c7c9aa2d93..80668e97bc7 100644 --- a/src/att.cpp +++ b/src/att.cpp @@ -197,6 +197,39 @@ data_BARRENDITION Att::StrToBarRendition(std::string value) } return BARRENDITION_NONE; } + +std::string Att::BeatrptRendToStr(data_BEATRPT_REND data) +{ + std::string value; + switch(data) + { + case BEATRPT_REND_4 : value = "4"; break; + case BEATRPT_REND_16 : value = "16"; break; + case BEATRPT_REND_32 : value = "32"; break; + case BEATRPT_REND_64 : value = "64"; break; + case BEATRPT_REND_128 : value = "128"; break; + case BEATRPT_REND_mixed : value = "mixed"; break; + default: + LogWarning("Unknown mode '%d'", data); + value = ""; + break; + } + return value; +} + +data_BEATRPT_REND Att::StrToBeatrptRend(std::string value) +{ + if (value == "4") return BEATRPT_REND_4; + else if (value == "16") return BEATRPT_REND_16; + else if (value == "32") return BEATRPT_REND_32; + else if (value == "64") return BEATRPT_REND_64; + else if (value == "128") return BEATRPT_REND_128; + else if (value == "mixed") return BEATRPT_REND_mixed; + else { + LogWarning("Unsupported beatrpt rend '%s'", value.c_str() ); + } + return BEATRPT_REND_NONE; +} std::string Att::BoolToStr(data_BOOLEAN data) { diff --git a/src/iomei.cpp b/src/iomei.cpp index 3faa15654e3..eced437fc91 100644 --- a/src/iomei.cpp +++ b/src/iomei.cpp @@ -570,6 +570,7 @@ void MeiOutput::WriteMeiBeatRpt( pugi::xml_node currentNode, BeatRpt *beatRpt ) assert( beatRpt ); WriteLayerElement( currentNode, beatRpt ); + beatRpt->WriteBeatRptVis(currentNode); } void MeiOutput::WriteMeiChord( pugi::xml_node currentNode, Chord *chord ) @@ -1720,6 +1721,7 @@ bool MeiInput::ReadMeiBeatRpt( Object *parent, pugi::xml_node beatRpt ) { BeatRpt *vrvBeatRpt = new BeatRpt(); ReadLayerElement(beatRpt, vrvBeatRpt); + vrvBeatRpt->ReadBeatRptVis(beatRpt); AddLayerElement(parent, vrvBeatRpt); return true; diff --git a/src/rpt.cpp b/src/rpt.cpp index f7841cb90a1..a6edec86d1a 100644 --- a/src/rpt.cpp +++ b/src/rpt.cpp @@ -16,8 +16,10 @@ namespace vrv { //---------------------------------------------------------------------------- BeatRpt::BeatRpt( ): -LayerElement("beatrpt-") + LayerElement("beatrpt-"), + AttBeatRptVis() { + RegisterAttClass(ATT_BEATRPTVIS); Reset(); } @@ -28,6 +30,7 @@ BeatRpt::~BeatRpt() void BeatRpt::Reset() { LayerElement::Reset(); + ResetBeatRptVis(); } //---------------------------------------------------------------------------- diff --git a/src/view_element.cpp b/src/view_element.cpp index 8324a40abdc..72bac26f1dc 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -732,6 +732,30 @@ void View::DrawMultiRest(DeviceContext *dc, LayerElement *element, Layer *layer, void View::DrawBeatRpt(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure) { + assert( dc ); + assert( element ); + assert( layer ); + assert( staff ); + assert( measure ); + + BeatRpt *beatRpt = dynamic_cast(element); + assert( beatRpt ); + + dc->StartGraphic( element, "", element->GetUuid() ); + + int x = element->GetDrawingX(); + int xCentered = x + (measure->GetDrawingX() + measure->GetRightBarlineX() - x) / 2; + int halfWidth = m_doc->GetGlyphWidth(SMUFL_E101_noteheadSlashHorizontalEnds, staff->m_drawingStaffSize, false) / 2; + + int xSymbol = xCentered - halfWidth; + + int y = element->GetDrawingY(); + + y -= staff->m_drawingLines / 2 * m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); + + DrawSmuflCode( dc, xSymbol, y, SMUFL_E101_noteheadSlashHorizontalEnds, staff->m_drawingStaffSize, false ); + + dc->EndGraphic(element, this); } void View::DrawMRpt(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure) From e8c8ca78dff189b51b0de70f63cb920513c661d3 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Fri, 28 Aug 2015 16:25:53 +0200 Subject: [PATCH 091/114] Changing vector access from [] to at() --- src/accid.cpp | 2 +- src/aligner.cpp | 40 +++++----- src/att.cpp | 2 +- src/bboxdevicecontext.cpp | 2 +- src/chord.cpp | 4 +- src/doc.cpp | 4 +- src/dot.cpp | 2 +- src/editorial.cpp | 4 +- src/layer.cpp | 20 ++--- src/layerelement.cpp | 22 +++--- src/measure.cpp | 34 ++++----- src/note.cpp | 10 +-- src/object.cpp | 40 +++++----- src/rpt.cpp | 4 +- src/scoredef.cpp | 22 +++--- src/staff.cpp | 26 +++---- src/syl.cpp | 6 +- src/system.cpp | 42 +++++------ src/timeinterface.cpp | 6 +- src/verse.cpp | 8 +- src/view_beam.cpp | 150 +++++++++++++++++++------------------- src/view_element.cpp | 82 ++++++++++----------- 22 files changed, 266 insertions(+), 266 deletions(-) diff --git a/src/accid.cpp b/src/accid.cpp index 3ac481a50a4..80e693ea762 100644 --- a/src/accid.cpp +++ b/src/accid.cpp @@ -54,7 +54,7 @@ void Accid::Reset() int Accid::PreparePointersByLayer( ArrayPtrVoid *params ) { // param 0: the current Note (not used) - //Note **currentNote = static_cast((*params)[0]); + //Note **currentNote = static_cast((*params).at(0)); Note *note = dynamic_cast( this->GetFirstParent( NOTE, MAX_ACCID_DEPTH ) ); if ( !note ) { diff --git a/src/aligner.cpp b/src/aligner.cpp index b347b7f7b1d..be5055b986e 100644 --- a/src/aligner.cpp +++ b/src/aligner.cpp @@ -226,7 +226,7 @@ void GraceAligner::AlignStack( ) int i; double time = 0.0; for (i = (int)m_noteStack.size(); i > 0; i--) { - Note *note = dynamic_cast( m_noteStack[i-1] ); + Note *note = dynamic_cast( m_noteStack.at(i-1) ); assert( note ); // get the duration of the event double duration = note->LayerElement::GetAlignmentDuration( NULL, NULL, false ); @@ -309,9 +309,9 @@ int StaffAlignment::SetAligmentYPos( ArrayPtrVoid *params ) // param 1: the staff margin // param 2: the staff interline sizes (int[2]) // param 3: the functor to be redirected to SystemAligner (unused) - int *previousStaffHeight = static_cast((*params)[0]); - int *staffMargin = static_cast((*params)[1]); - int *interlineSize = static_cast((*params)[2]); + int *previousStaffHeight = static_cast((*params).at(0)); + int *staffMargin = static_cast((*params).at(1)); + int *interlineSize = static_cast((*params).at(2)); // take into account the number of lyrics if (this->GetVerseCount() > 0) { @@ -335,7 +335,7 @@ int StaffAlignment::IntegrateBoundingBoxYShift( ArrayPtrVoid *params ) { // param 0: the accumulated shift // param 1: the functor to be redirected to the SystemAligner (unused) - int *shift = static_cast((*params)[0]); + int *shift = static_cast((*params).at(0)); // integrates the m_yShift into the m_yRel m_yRel += m_yShift + (*shift); @@ -352,8 +352,8 @@ int MeasureAligner::IntegrateBoundingBoxXShift( ArrayPtrVoid *params ) // param 0: the accumulated shift // param 1: the accumulated justifiable shift // param 2: the functor to be redirected to the MeasureAligner (unused) - int *shift = static_cast((*params)[0]); - int *justifiable_shift = static_cast((*params)[1]); + int *shift = static_cast((*params).at(0)); + int *justifiable_shift = static_cast((*params).at(1)); // We start a new MeasureAligner // Reset the accumulated shift to 0; @@ -394,8 +394,8 @@ int Alignment::IntegrateBoundingBoxXShift( ArrayPtrVoid *params ) // param 0: the accumulated shift // param 1: the accumulated justifiable shift // param 2: the functor to be redirected to the MeasureAligner (unused) - int *shift = static_cast((*params)[0]); - int *justifiable_shift = static_cast((*params)[1]); + int *shift = static_cast((*params).at(0)); + int *justifiable_shift = static_cast((*params).at(1)); // integrates the m_xShift into the m_xRel m_xRel += m_xShift + (*shift); @@ -421,8 +421,8 @@ int MeasureAligner::SetAligmentXPos( ArrayPtrVoid *params ) // param 1: the previous x rel position // param 2: the minimum measure width (unused) // param 3: the functor to be redirected to the MeasureAligner (unused) - double *previousTime = static_cast((*params)[0]); - int *previousXRel = static_cast((*params)[1]); + double *previousTime = static_cast((*params).at(0)); + int *previousXRel = static_cast((*params).at(1)); // We start a new MeasureAligner // Reset the previous time position and x_rel to 0; @@ -454,9 +454,9 @@ int Alignment::SetAligmentXPos( ArrayPtrVoid *params ) // param 1: the previous x rel position // param 2: the minimum measure width // param 3: the functor to be redirected to the MeasureAligner (unused) - double *previousTime = static_cast((*params)[0]); - int *previousXRel = static_cast((*params)[1]); - int *minMeasureWidth = static_cast((*params)[2]); + double *previousTime = static_cast((*params).at(0)); + int *previousXRel = static_cast((*params).at(1)); + int *minMeasureWidth = static_cast((*params).at(2)); int intervalXRel = 0; double intervalTime = (m_time - (*previousTime)); @@ -480,9 +480,9 @@ int MeasureAligner::JustifyX( ArrayPtrVoid *params ) // param 2: the non justifiable margin // param 3: the system full width (without system margins) (unused) // param 4: the functor to be redirected to the MeasureAligner (unused) - double *ratio =static_cast((*params)[0]); - double *measureRatio =static_cast((*params)[1]); - int *margin =static_cast((*params)[2]); + double *ratio =static_cast((*params).at(0)); + double *measureRatio =static_cast((*params).at(1)); + int *margin =static_cast((*params).at(2)); int width = GetRightAlignment()->GetXRel() + GetRightAlignment()->GetMaxWidth(); @@ -506,9 +506,9 @@ int Alignment::JustifyX( ArrayPtrVoid *params ) // param 2: the non justifiable margin // param 3: the system full width (without system margins) (unused) // param 4: the functor to be redirected to the MeasureAligner (unused) - double *ratio =static_cast((*params)[0]); - double *measureRatio =static_cast((*params)[1]); - int *margin =static_cast((*params)[2]); + double *ratio =static_cast((*params).at(0)); + double *measureRatio =static_cast((*params).at(1)); + int *margin =static_cast((*params).at(2)); if (GetType() == ALIGNMENT_MEASURE_START) { return FUNCTOR_CONTINUE; diff --git a/src/att.cpp b/src/att.cpp index 80668e97bc7..096cb22382e 100644 --- a/src/att.cpp +++ b/src/att.cpp @@ -404,7 +404,7 @@ data_DURATION Att::StrToDur(std::string value) else if (value == "256") dur = DURATION_256; else { if ((value.length() > 0) && (value[value.length()-1] == 'p')) { - LogWarning("PPQ duration dur_s are not supported"); + //LogWarning("PPQ duration dur_s are not supported"); // remove it for now } else { LogWarning("Unknown @dur dur '%s'", value.c_str()); diff --git a/src/bboxdevicecontext.cpp b/src/bboxdevicecontext.cpp index 08f18b2682d..b77f07249b2 100644 --- a/src/bboxdevicecontext.cpp +++ b/src/bboxdevicecontext.cpp @@ -376,7 +376,7 @@ void BBoxDeviceContext::UpdateBB(int x1, int y1, int x2, int y2) int i; // Stretch the content BB of the other objects for (i = 0; i < (int)m_objects.size(); i++) { - (m_objects[i])->UpdateContentBB( m_view->ToLogicalX(x1), m_view->ToLogicalY(y1), m_view->ToLogicalX(x2), m_view->ToLogicalY(y2) ); + (m_objects.at(i))->UpdateContentBB( m_view->ToLogicalX(x1), m_view->ToLogicalY(y1), m_view->ToLogicalX(x2), m_view->ToLogicalY(y2) ); } } diff --git a/src/chord.cpp b/src/chord.cpp index 634fe97b500..33cbddf73c7 100644 --- a/src/chord.cpp +++ b/src/chord.cpp @@ -241,7 +241,7 @@ int Chord::PrepareTieAttr( ArrayPtrVoid *params ) { // param 0: std::vector* that holds the current notes with open ties (unused) // param 1: Chord** currentChord for the current chord if in a chord - Chord **currentChord = static_cast((*params)[1]); + Chord **currentChord = static_cast((*params).at(1)); assert(!(*currentChord)); (*currentChord) = this; @@ -253,7 +253,7 @@ int Chord::PrepareTieAttrEnd( ArrayPtrVoid *params ) { // param 0: std::vector* that holds the current notes with open ties (unused) // param 1: Chord** currentChord for the current chord if in a chord - Chord **currentChord = static_cast((*params)[1]); + Chord **currentChord = static_cast((*params).at(1)); assert((*currentChord)); (*currentChord) = NULL; diff --git a/src/doc.cpp b/src/doc.cpp index 58776172c91..1b8ba958db4 100644 --- a/src/doc.cpp +++ b/src/doc.cpp @@ -709,8 +709,8 @@ int Doc::PrepareLyricsEnd( ArrayPtrVoid *params ) { // param 0: the current Syl // param 1: the last Note - Syl **currentSyl = static_cast((*params)[0]); - Note **lastNote = static_cast((*params)[1]); + Syl **currentSyl = static_cast((*params).at(0)); + Note **lastNote = static_cast((*params).at(1)); if ( (*currentSyl) && (*lastNote) ) { (*currentSyl)->SetEnd(*lastNote); diff --git a/src/dot.cpp b/src/dot.cpp index b2277db0195..945a6d18137 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -47,7 +47,7 @@ void Dot::Reset() int Dot::PreparePointersByLayer( ArrayPtrVoid *params ) { // param 0: the current Note - Note **currentNote = static_cast((*params)[0]); + Note **currentNote = static_cast((*params).at(0)); m_drawingNote = (*currentNote); diff --git a/src/editorial.cpp b/src/editorial.cpp index e40062771d7..aec177a4de2 100644 --- a/src/editorial.cpp +++ b/src/editorial.cpp @@ -256,8 +256,8 @@ int EditorialElement::CastOffSystems( ArrayPtrVoid *params ) // param 2: a pointer to the current system // param 3: the cummulated shift (m_drawingXRel of the first measure of the current system) (unused) // param 4: the system width (unused) - System *contentSystem = static_cast((*params)[0]); - System **currentSystem = static_cast((*params)[2]); + System *contentSystem = static_cast((*params).at(0)); + System **currentSystem = static_cast((*params).at(2)); // Since the functor returns FUNCTOR_SIBLINGS we should never go lower than the system children assert( dynamic_cast(this->m_parent)); diff --git a/src/layer.cpp b/src/layer.cpp index ca864c86409..1a012f94bc8 100644 --- a/src/layer.cpp +++ b/src/layer.cpp @@ -175,9 +175,9 @@ int Layer::AlignHorizontally( ArrayPtrVoid *params ) // param 1: the time // param 2: the current Mensur // param 3: the current MeterSig - double *time = static_cast((*params)[1]); - Mensur **currentMensur = static_cast((*params)[2]); - MeterSig **currentMeterSig = static_cast((*params)[3]); + double *time = static_cast((*params).at(1)); + Mensur **currentMensur = static_cast((*params).at(2)); + MeterSig **currentMeterSig = static_cast((*params).at(3)); // we need to call it because we are overriding Object::AlignHorizontally this->ResetHorizontalAlignment(); @@ -210,7 +210,7 @@ int Layer::AlignHorizontallyEnd( ArrayPtrVoid *params ) // param 1: the time (unused) // param 2: the current Mensur (unused) // param 3: the current MeterSig (unused) - MeasureAligner **measureAligner = static_cast((*params)[0]); + MeasureAligner **measureAligner = static_cast((*params).at(0)); int i; for(i = 0; i < (int)(*measureAligner)->m_children.size(); i++) { @@ -227,9 +227,9 @@ int Layer::PrepareProcessingLists( ArrayPtrVoid *params ) { // param 0: the IntTree* for staff/layer/verse (unused) // param 1: the IntTree* for staff/layer - IntTree *tree = static_cast((*params)[1]); + IntTree *tree = static_cast((*params).at(1)); // Alternate solution with StaffN_LayerN_VerseN_t - //StaffN_LayerN_VerseN_t *tree = static_cast((*params)[0]); + //StaffN_LayerN_VerseN_t *tree = static_cast((*params).at(0)); Staff *staff = dynamic_cast( this->GetFirstParent( STAFF ) ); assert( staff ); @@ -247,9 +247,9 @@ int Layer::SetDrawingXY( ArrayPtrVoid *params ) // param 4: a pointer to the current layer // param 5: a pointer to the view (unused) // param 6: a bool indicating if we are processing layer elements or not - Measure **currentMeasure = static_cast((*params)[2]); - Layer **currentLayer = static_cast((*params)[4]); - bool *processLayerElements = static_cast((*params)[6]); + Measure **currentMeasure = static_cast((*params).at(2)); + Layer **currentLayer = static_cast((*params).at(4)); + bool *processLayerElements = static_cast((*params).at(6)); (*currentLayer) = this; @@ -280,7 +280,7 @@ int Layer::PrepareRpt( ArrayPtrVoid *params ) // param 0: a pointer to the current MRpt pointer // param 1: a pointer to the data_BOOLEAN indicating if multiNumber (unused) // param 2: a pointer to the doc scoreDef (unused) - MRpt **currentMRpt = static_cast((*params)[0]); + MRpt **currentMRpt = static_cast((*params).at(0)); // If we have encountered a mRpt before and there is none is this layer, reset it to NULL if ((*currentMRpt) && !this->FindChildByType(MRPT)) { diff --git a/src/layerelement.cpp b/src/layerelement.cpp index 50b676b1088..d4eaf4e6e2c 100644 --- a/src/layerelement.cpp +++ b/src/layerelement.cpp @@ -192,10 +192,10 @@ int LayerElement::AlignHorizontally( ArrayPtrVoid *params ) // param 1: the time // param 2: the current Mensur // param 3: the current MeterSig (unused) - MeasureAligner **measureAligner = static_cast((*params)[0]); - double *time = static_cast((*params)[1]); - Mensur **currentMensur = static_cast((*params)[2]); - MeterSig **currentMeterSig = static_cast((*params)[3]); + MeasureAligner **measureAligner = static_cast((*params).at(0)); + double *time = static_cast((*params).at(1)); + Mensur **currentMensur = static_cast((*params).at(2)); + MeterSig **currentMeterSig = static_cast((*params).at(3)); // we need to call it because we are overriding Object::AlignHorizontally this->ResetHorizontalAlignment(); @@ -288,7 +288,7 @@ int LayerElement::PrepareTimeSpanning( ArrayPtrVoid *params ) { // param 0: std::vector* that holds the current elements to match // param 1: bool* fillList for indicating whether the elements have to be stack or not (unused) - std::vector *elements = static_cast*>((*params)[0]); + std::vector *elements = static_cast*>((*params).at(0)); std::vector::iterator iter = elements->begin(); while ( iter != elements->end()) { @@ -314,12 +314,12 @@ int LayerElement::SetDrawingXY( ArrayPtrVoid *params ) // param 4: a pointer to the current layer // param 5: a pointer to the view // param 6: a bool indicating if we are processing layer elements or not - Doc *doc = static_cast((*params)[0]); - Measure **currentMeasure = static_cast((*params)[2]); - Staff **currentStaff = static_cast((*params)[3]); - Layer **currentLayer = static_cast((*params)[4]); - View *view = static_cast((*params)[5]); - bool *processLayerElements = static_cast((*params)[6]); + Doc *doc = static_cast((*params).at(0)); + Measure **currentMeasure = static_cast((*params).at(2)); + Staff **currentStaff = static_cast((*params).at(3)); + Layer **currentLayer = static_cast((*params).at(4)); + View *view = static_cast((*params).at(5)); + bool *processLayerElements = static_cast((*params).at(6)); // First pass, only set the X position if ((*processLayerElements)==false) { diff --git a/src/measure.cpp b/src/measure.cpp index a417658578a..0d640bfc513 100644 --- a/src/measure.cpp +++ b/src/measure.cpp @@ -142,7 +142,7 @@ int Measure::AlignHorizontally( ArrayPtrVoid *params ) // param 1: the time (unused) // param 2: the current Mensur (unused) // param 3: the current MeterSig (unused) - MeasureAligner **measureAligner = static_cast((*params)[0]); + MeasureAligner **measureAligner = static_cast((*params).at(0)); // we need to call it because we are overriding Object::AlignHorizontally this->ResetHorizontalAlignment(); @@ -177,7 +177,7 @@ int Measure::AlignVertically( ArrayPtrVoid *params ) { // param 0: the systemAligner (unused) // param 1: the staffNb - int *staffNb = static_cast((*params)[1]); + int *staffNb = static_cast((*params).at(1)); // we need to call it because we are overriding Object::AlignVertically this->ResetVerticalAlignment(); @@ -191,7 +191,7 @@ int Measure::AlignVertically( ArrayPtrVoid *params ) int Measure::IntegrateBoundingBoxGraceXShift( ArrayPtrVoid *params ) { // param 0: the functor to be redirected to Aligner - Functor *integrateBoundingBoxGraceXShift = static_cast((*params)[0]); + Functor *integrateBoundingBoxGraceXShift = static_cast((*params).at(0)); m_measureAligner.Process( integrateBoundingBoxGraceXShift, params ); @@ -203,7 +203,7 @@ int Measure::IntegrateBoundingBoxXShift( ArrayPtrVoid *params ) // param 0: the cumulated shift (unused) // param 1: the cumulated justifiable shift (unused) // param 2: the functor to be redirected to Aligner - Functor *integrateBoundingBoxShift = static_cast((*params)[2]); + Functor *integrateBoundingBoxShift = static_cast((*params).at(2)); m_measureAligner.Process( integrateBoundingBoxShift, params ); @@ -216,7 +216,7 @@ int Measure::SetAligmentXPos( ArrayPtrVoid *params ) // param 1: the previous x rel position (unused) // param 2: the minimum measure width (unused) // param 3: the functor to be redirected to Aligner - Functor *setAligmnentPosX = static_cast((*params)[3]); + Functor *setAligmnentPosX = static_cast((*params).at(3)); m_measureAligner.Process( setAligmnentPosX, params); @@ -230,8 +230,8 @@ int Measure::JustifyX( ArrayPtrVoid *params ) // param 2: the non justifiable margin (unused) // param 3: the system full width (without system margins) (unused) // param 4: the functor to be redirected to the MeasureAligner - double *ratio = static_cast((*params)[0]); - Functor *justifyX = static_cast((*params)[4]); + double *ratio = static_cast((*params).at(0)); + Functor *justifyX = static_cast((*params).at(4)); this->m_drawingXRel = ceil((*ratio) * (double)this->m_drawingXRel); @@ -244,7 +244,7 @@ int Measure::JustifyX( ArrayPtrVoid *params ) int Measure::AlignMeasures( ArrayPtrVoid *params ) { // param 0: the cumulated shift - int *shift = static_cast((*params)[0]); + int *shift = static_cast((*params).at(0)); this->m_drawingXRel = (*shift); @@ -268,11 +268,11 @@ int Measure::CastOffSystems( ArrayPtrVoid *params ) // param 2: a pointer to the current system // param 3: the cummulated shift (m_drawingXRel of the first measure of the current system) // param 4: the system width - System *contentSystem = static_cast((*params)[0]); - Page *page = static_cast((*params)[1]); - System **currentSystem = static_cast((*params)[2]); - int *shift = static_cast((*params)[3]); - int *systemWidth = static_cast((*params)[4]); + System *contentSystem = static_cast((*params).at(0)); + Page *page = static_cast((*params).at(1)); + System **currentSystem = static_cast((*params).at(2)); + int *shift = static_cast((*params).at(3)); + int *systemWidth = static_cast((*params).at(4)); if ( ( (*currentSystem)->GetChildCount() > 0 ) && ( this->m_drawingXRel + this->GetWidth() - (*shift) > (*systemWidth) ) ) { (*currentSystem) = new System(); @@ -300,10 +300,10 @@ int Measure::SetDrawingXY( ArrayPtrVoid *params ) // param 4: a pointer to the current layer (unused) // param 5: a pointer to the view (unused) // param 6: a bool indicating if we are processing layer elements or not - Doc *doc = static_cast((*params)[0]); - System **currentSystem = static_cast((*params)[1]); - Measure **currentMeasure = static_cast((*params)[2]); - bool *processLayerElements = static_cast((*params)[6]); + Doc *doc = static_cast((*params).at(0)); + System **currentSystem = static_cast((*params).at(1)); + Measure **currentMeasure = static_cast((*params).at(2)); + bool *processLayerElements = static_cast((*params).at(6)); (*currentMeasure) = this; diff --git a/src/note.cpp b/src/note.cpp index d6cabaa991e..d11a5e0b179 100644 --- a/src/note.cpp +++ b/src/note.cpp @@ -187,8 +187,8 @@ int Note::PrepareTieAttr( ArrayPtrVoid *params ) { // param 0: std::vector* that holds the current notes with open ties // param 1: Chord** currentChord for the current chord if in a chord - std::vector *currentNotes = static_cast*>((*params)[0]); - Chord **currentChord = static_cast((*params)[1]); + std::vector *currentNotes = static_cast*>((*params).at(0)); + Chord **currentChord = static_cast((*params).at(1)); AttTiepresent *check = this; if ((*currentChord)) { @@ -239,8 +239,8 @@ int Note::PrepareLyrics( ArrayPtrVoid *params ) // param 0: the current Syl (unused) // param 1: the last Note // param 2: the last but one Note - Note **lastNote = static_cast((*params)[1]); - Note **lastButOneNote = static_cast((*params)[2]); + Note **lastNote = static_cast((*params).at(1)); + Note **lastButOneNote = static_cast((*params).at(2)); (*lastButOneNote) = (*lastNote); (*lastNote) = this; @@ -251,7 +251,7 @@ int Note::PrepareLyrics( ArrayPtrVoid *params ) int Note::PreparePointersByLayer( ArrayPtrVoid *params ) { // param 0: the current Note - Note **currentNote = static_cast((*params)[0]); + Note **currentNote = static_cast((*params).at(0)); this->ResetDrawingAccid(); if (this->GetAccid() != ACCIDENTAL_EXPLICIT_NONE) { diff --git a/src/object.cpp b/src/object.cpp index fd9f32fe80c..010b6688aad 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -851,7 +851,7 @@ void Functor::Call( Object *ptr, ArrayPtrVoid *params ) int Object::AddLayerElementToFlatList( ArrayPtrVoid *params ) { // param 0: the ListOfObjects - ListOfObjects **list = static_cast((*params)[0]); + ListOfObjects **list = static_cast((*params).at(0)); //if ( dynamic_cast(this ) ) { (*list)->push_back( this ); //} @@ -862,8 +862,8 @@ int Object::FindByUuid( ArrayPtrVoid *params ) { // param 0: the uuid we are looking for // param 1: the pointer to pointer to the Object - std::string *uuid = static_cast((*params)[0]); - Object **element = static_cast((*params)[1]); + std::string *uuid = static_cast((*params).at(0)); + Object **element = static_cast((*params).at(1)); if ( (*element) ) { // this should not happen, but just in case @@ -883,8 +883,8 @@ int Object::FindByAttComparison( ArrayPtrVoid *params ) { // param 0: the type we are looking for // param 1: the pointer to pointer to the Object - AttComparison *test = static_cast((*params)[0]); - Object **element = static_cast((*params)[1]); + AttComparison *test = static_cast((*params).at(0)); + Object **element = static_cast((*params).at(1)); if ( (*element) ) { // this should not happen, but just in case @@ -906,8 +906,8 @@ int Object::SetCurrentScoreDef( ArrayPtrVoid *params ) { // param 0: the current scoreDef - ScoreDef *currentScoreDef = static_cast((*params)[0]); - StaffDef **currentStaffDef = static_cast((*params)[1]); + ScoreDef *currentScoreDef = static_cast((*params).at(0)); + StaffDef **currentStaffDef = static_cast((*params).at(1)); assert( currentScoreDef ); @@ -1031,8 +1031,8 @@ int Object::SetBoundingBoxGraceXShift( ArrayPtrVoid *params ) { // param 0: the minimu position (i.e., the width of the previous element) // param 1: the Doc - int *min_pos = static_cast((*params)[0]); - Doc *doc = static_cast((*params)[1]); + int *min_pos = static_cast((*params).at(0)); + Doc *doc = static_cast((*params).at(1)); // starting an new layer if (this->Is() == LAYER) { @@ -1089,9 +1089,9 @@ int Object::SetBoundingBoxXShift( ArrayPtrVoid *params ) // param 0: the minimu position (i.e., the width of the previous element) // param 1: the maximum width in the current measure // param 2: the Doc - int *min_pos = static_cast((*params)[0]); - int *measure_width = static_cast((*params)[1]); - Doc *doc = static_cast((*params)[2]); + int *min_pos = static_cast((*params).at(0)); + int *measure_width = static_cast((*params).at(1)); + Doc *doc = static_cast((*params).at(2)); // starting a new measure if (this->Is() == MEASURE) { @@ -1223,8 +1223,8 @@ int Object::SetBoundingBoxXShiftEnd( ArrayPtrVoid *params ) { // param 0: the minimu position (i.e., the width of the previous element) // param 1: the maximum width in the current measure - int *min_pos = static_cast((*params)[0]); - int *measure_width = static_cast((*params)[1]); + int *min_pos = static_cast((*params).at(0)); + int *measure_width = static_cast((*params).at(1)); // ending a measure if (this->Is() == MEASURE) { @@ -1256,8 +1256,8 @@ int Object::SetBoundingBoxYShift( ArrayPtrVoid *params ) { // param 0: the position of the previous staff // param 1: the maximum height in the current system - int *min_pos = static_cast((*params)[0]); - int *system_height = static_cast((*params)[1]); + int *min_pos = static_cast((*params).at(0)); + int *system_height = static_cast((*params).at(1)); // starting a new system if (this->Is() == SYSTEM) { @@ -1315,8 +1315,8 @@ int Object::SetBoundingBoxYShiftEnd( ArrayPtrVoid *params ) { // param 0: the position of the previous staff // param 1: the maximum height in the current system - int *min_pos = static_cast((*params)[0]); - int *system_height = static_cast((*params)[1]); + int *min_pos = static_cast((*params).at(0)); + int *system_height = static_cast((*params).at(1)); // ending a measure if (this->Is() == MEASURE) { @@ -1336,7 +1336,7 @@ int Object::SetBoundingBoxYShiftEnd( ArrayPtrVoid *params ) int Object::Save( ArrayPtrVoid *params ) { // param 0: output stream - FileOutputStream *output = static_cast((*params)[0]); + FileOutputStream *output = static_cast((*params).at(0)); if (!output->WriteObject( this )) { return FUNCTOR_STOP; } @@ -1347,7 +1347,7 @@ int Object::Save( ArrayPtrVoid *params ) int Object::SaveEnd( ArrayPtrVoid *params ) { // param 0: output stream - FileOutputStream *output = static_cast((*params)[0]); + FileOutputStream *output = static_cast((*params).at(0)); if (!output->WriteObjectEnd( this )) { return FUNCTOR_STOP; } diff --git a/src/rpt.cpp b/src/rpt.cpp index a6edec86d1a..55b2a72774a 100644 --- a/src/rpt.cpp +++ b/src/rpt.cpp @@ -103,8 +103,8 @@ int MRpt::PrepareRpt( ArrayPtrVoid *params ) // param 0: a pointer to the current MRpt pointer // param 1: a pointer to the data_BOOLEAN indicating if multiNumber // param 2: a pointer to the doc scoreDef (unused) - MRpt **currentMRpt = static_cast((*params)[0]); - data_BOOLEAN *multiNumber = static_cast((*params)[1]); + MRpt **currentMRpt = static_cast((*params).at(0)); + data_BOOLEAN *multiNumber = static_cast((*params).at(1)); // If multiNumber is not true, nothing needs to be done if ((*multiNumber) != BOOLEAN_true) { diff --git a/src/scoredef.cpp b/src/scoredef.cpp index 49c81fbb8b4..aa2ddf25914 100644 --- a/src/scoredef.cpp +++ b/src/scoredef.cpp @@ -441,8 +441,8 @@ int ScoreDef::CastOffSystems( ArrayPtrVoid *params ) // param 2: a pointer to the current system // param 3: the cummulated shift (m_drawingXRel of the first measure of the current system) (unused) // param 4: the system width (unused) - System *contentSystem = static_cast((*params)[0]); - System **currentSystem = static_cast((*params)[2]); + System *contentSystem = static_cast((*params).at(0)); + System **currentSystem = static_cast((*params).at(2)); // Since the functor returns FUNCTOR_SIBLINGS we should never go lower than the system children assert( dynamic_cast(this->m_parent)); @@ -467,10 +467,10 @@ int StaffDef::ReplaceDrawingValuesInStaffDef( ArrayPtrVoid *params ) // param 1: KeySig pointer (NULL if none) // param 2: Mensur pointer (NULL if none) // param 3: MeterSig pointer (NULL if none) - Clef *clef = static_cast((*params)[0]); - KeySig *keySig = static_cast((*params)[1]); - Mensur *mensur = static_cast((*params)[2]); - MeterSig *meterSig = static_cast((*params)[3]); + Clef *clef = static_cast((*params).at(0)); + KeySig *keySig = static_cast((*params).at(1)); + Mensur *mensur = static_cast((*params).at(2)); + MeterSig *meterSig = static_cast((*params).at(3)); if (clef) { this->SetCurrentClef(new Clef(*clef)); @@ -495,11 +495,11 @@ int StaffDef::SetStaffDefRedrawFlags( ArrayPtrVoid *params ) // param 2: bool mensur flag // param 3: bool meterSig flag // param 4: bool keySig cancellation flag - bool *clef = static_cast((*params)[0]); - bool *keysig = static_cast((*params)[1]); - bool *mensur = static_cast((*params)[2]); - bool *meterSig = static_cast((*params)[3]); - bool *keySigCancellation = static_cast((*params)[4]); + bool *clef = static_cast((*params).at(0)); + bool *keysig = static_cast((*params).at(1)); + bool *mensur = static_cast((*params).at(2)); + bool *meterSig = static_cast((*params).at(3)); + bool *keySigCancellation = static_cast((*params).at(4)); if ( (*clef) ) { this->SetDrawClef( true ); diff --git a/src/staff.cpp b/src/staff.cpp index a3c22d25568..7d8eb1394a4 100644 --- a/src/staff.cpp +++ b/src/staff.cpp @@ -81,9 +81,9 @@ bool Staff::GetPosOnPage( ArrayPtrVoid *params ) // param 0: the Staff we are looking for // param 1: the position on the page (int) // param 2; the success flag (bool) - Staff *staff = static_cast((*params)[0]); - int *position = static_cast((*params)[1]); - bool *success = static_cast((*params)[2]); + Staff *staff = static_cast((*params).at(0)); + int *position = static_cast((*params).at(1)); + bool *success = static_cast((*params).at(2)); if ( (*success) ) { return true; @@ -115,8 +115,8 @@ int Staff::AlignVertically( ArrayPtrVoid *params ) { // param 0: the systemAligner // param 1: the staffNb - SystemAligner **systemAligner = static_cast((*params)[0]); - int *staffNb = static_cast((*params)[1]); + SystemAligner **systemAligner = static_cast((*params).at(0)); + int *staffNb = static_cast((*params).at(1)); // we need to call it because we are overriding Object::AlignVertically this->ResetVerticalAlignment(); @@ -138,7 +138,7 @@ int Staff::AlignVertically( ArrayPtrVoid *params ) int Staff::FillStaffCurrentTimeSpanning( ArrayPtrVoid *params ) { // param 0: the current Syl - std::vector *elements = static_cast*>((*params)[0]); + std::vector *elements = static_cast*>((*params).at(0)); std::vector::iterator iter = elements->begin(); while ( iter != elements->end()) { @@ -168,7 +168,7 @@ int Staff::FillStaffCurrentLyrics( ArrayPtrVoid *params ) { // param 0: the current Syl // param 1: the last Note - Syl **currentSyl = static_cast((*params)[0]); + Syl **currentSyl = static_cast((*params).at(0)); if ((*currentSyl)) { // We have a running syl started in a previous measure @@ -201,10 +201,10 @@ int Staff::SetDrawingXY( ArrayPtrVoid *params ) // param 4: a pointer to the current layer (unused) // param 5: a pointer to the view (unused) // param 6: a bool indicating if we are processing layer elements or not - Doc *doc = static_cast((*params)[0]); - System **currentSystem = static_cast((*params)[1]); - Staff **currentStaff = static_cast((*params)[3]); - bool *processLayerElements = static_cast((*params)[6]); + Doc *doc = static_cast((*params).at(0)); + System **currentSystem = static_cast((*params).at(1)); + Staff **currentStaff = static_cast((*params).at(3)); + bool *processLayerElements = static_cast((*params).at(6)); (*currentStaff) = this; @@ -232,8 +232,8 @@ int Staff::PrepareRpt( ArrayPtrVoid *params ) // param 0: a pointer to the current MRpt pointer (unused) // param 1: a pointer to the data_BOOLEAN indicating if multiNumber // param 2: a pointer to the doc scoreDef - data_BOOLEAN *multiNumber = static_cast((*params)[1]); - ScoreDef *scoreDef = static_cast((*params)[2]); + data_BOOLEAN *multiNumber = static_cast((*params).at(1)); + ScoreDef *scoreDef = static_cast((*params).at(2)); // If multiNumber is set, we already know that nothing needs to be done // Futhermore, if @multi.number is false, the functor should have stop (see below) diff --git a/src/syl.cpp b/src/syl.cpp index 9cf9cd23c1c..ee2d2739b42 100644 --- a/src/syl.cpp +++ b/src/syl.cpp @@ -59,9 +59,9 @@ int Syl::PrepareLyrics( ArrayPtrVoid *params ) // param 0: the current Syl // param 1: the last Note // param 2: the last but one Note - Syl **currentSyl = static_cast((*params)[0]); - Note **lastNote = static_cast((*params)[1]); - Note **lastButOneNote = static_cast((*params)[2]); + Syl **currentSyl = static_cast((*params).at(0)); + Note **lastNote = static_cast((*params).at(1)); + Note **lastButOneNote = static_cast((*params).at(2)); Verse *verse = dynamic_cast( this->GetFirstParent( VERSE, MAX_NOTE_DEPTH ) ); if ( verse ) { diff --git a/src/system.cpp b/src/system.cpp index 73c43395f66..399b520405e 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -110,7 +110,7 @@ int System::AlignVertically( ArrayPtrVoid *params ) { // param 0: the systemAligner // param 1: the staffNb (unused) - SystemAligner **systemAligner = static_cast((*params)[0]); + SystemAligner **systemAligner = static_cast((*params).at(0)); // we need to call it because we are overriding Object::AlignVertically this->ResetVerticalAlignment(); @@ -130,8 +130,8 @@ int System::SetAligmentYPos( ArrayPtrVoid *params ) // param 1: the staff margin (unused) // param 2: the staff interline sizes (int[2]) (unused) // param 2: the functor to be redirected to SystemAligner - int *previousStaffHeight = static_cast((*params)[0]); - Functor *setAligmnentPosY = static_cast((*params)[3]); + int *previousStaffHeight = static_cast((*params).at(0)); + Functor *setAligmnentPosY = static_cast((*params).at(3)); (*previousStaffHeight) = 0; @@ -145,8 +145,8 @@ int System::IntegrateBoundingBoxYShift( ArrayPtrVoid *params ) { // param 0: the cumulated shift // param 1: the functor to be redirected to SystemAligner - int *shift = static_cast((*params)[0]); - Functor *integrateBoundingBoxYShift = static_cast((*params)[1]); + int *shift = static_cast((*params).at(0)); + Functor *integrateBoundingBoxYShift = static_cast((*params).at(1)); (*shift) = 0; m_systemAligner.Process( integrateBoundingBoxYShift, params); @@ -157,7 +157,7 @@ int System::IntegrateBoundingBoxYShift( ArrayPtrVoid *params ) int System::AlignMeasures( ArrayPtrVoid *params ) { // param 0: the cumulated shift - int *shift = static_cast((*params)[0]); + int *shift = static_cast((*params).at(0)); m_drawingXRel = this->m_systemLeftMar + this->GetDrawingLabelsWidth(); (*shift) = 0; @@ -168,7 +168,7 @@ int System::AlignMeasures( ArrayPtrVoid *params ) int System::AlignMeasuresEnd( ArrayPtrVoid *params ) { // param 0: the cumulated shift - int *shift = static_cast((*params)[0]); + int *shift = static_cast((*params).at(0)); m_drawingTotalWidth = (*shift) + this->GetDrawingLabelsWidth(); @@ -179,8 +179,8 @@ int System::AlignSystems( ArrayPtrVoid *params ) { // param 0: the cumulated shift // param 1: the system margin - int *shift = static_cast((*params)[0]); - int *systemMargin = static_cast((*params)[1]); + int *shift = static_cast((*params).at(0)); + int *systemMargin = static_cast((*params).at(1)); this->m_drawingYRel = (*shift); @@ -199,8 +199,8 @@ int System::JustifyX( ArrayPtrVoid *params ) // param 2: the non justifiable margin (unused) // param 3: the system full width (without system margins) // param 4: the functor to be redirected to the MeasureAligner - double *ratio = static_cast((*params)[0]); - int *systemFullWidth = static_cast((*params)[3]); + double *ratio = static_cast((*params).at(0)); + int *systemFullWidth = static_cast((*params).at(3)); assert( m_parent ); assert( m_parent->m_parent ); @@ -229,7 +229,7 @@ int System::JustifyX( ArrayPtrVoid *params ) int System::SetBoundingBoxYShiftEnd( ArrayPtrVoid *params ) { // param 0: the height of the previous staff - int *system_height = static_cast((*params)[1]); + int *system_height = static_cast((*params).at(1)); m_systemAligner.GetBottomAlignment()->SetYShift( (*system_height) ); @@ -244,11 +244,11 @@ int System::CastOffPages( ArrayPtrVoid *params ) // param 2: a pointer to the current page // param 3: the cummulated shift (m_drawingYRel of the first system of the current page) // param 4: the page height - Page *contentPage = static_cast((*params)[0]); - Doc *doc = static_cast((*params)[1]); - Page **currentPage = static_cast((*params)[2]); - int *shift = static_cast((*params)[3]); - int *pageHeight = static_cast((*params)[4]); + Page *contentPage = static_cast((*params).at(0)); + Doc *doc = static_cast((*params).at(1)); + Page **currentPage = static_cast((*params).at(2)); + int *shift = static_cast((*params).at(3)); + int *pageHeight = static_cast((*params).at(4)); if ( ( (*currentPage)->GetChildCount() > 0 ) && ( this->m_drawingYRel - this->GetHeight() - (*shift) < 0 )) { //(*pageHeight) ) ) { (*currentPage) = new Page(); @@ -269,7 +269,7 @@ int System::CastOffPages( ArrayPtrVoid *params ) int System::UnCastOff( ArrayPtrVoid *params ) { // param 0: a pointer to the system we are adding system to - System *currentSystem = static_cast((*params)[0]); + System *currentSystem = static_cast((*params).at(0)); // Just move all the content of the system to the continous one (parameter) // Use the MoveChildren method that move the and relinquishes them @@ -289,9 +289,9 @@ int System::SetDrawingXY( ArrayPtrVoid *params ) // param 4: a pointer to the current layer // param 5: a pointer to the view (unused) // param 6: a bool indicating if we are processing layer elements or not - Doc *doc = static_cast((*params)[0]); - System **currentSystem = static_cast((*params)[1]); - bool *processLayerElements = static_cast((*params)[6]); + Doc *doc = static_cast((*params).at(0)); + System **currentSystem = static_cast((*params).at(1)); + bool *processLayerElements = static_cast((*params).at(6)); (*currentSystem) = this; diff --git a/src/timeinterface.cpp b/src/timeinterface.cpp index 12c083b450a..750dd86a091 100644 --- a/src/timeinterface.cpp +++ b/src/timeinterface.cpp @@ -107,8 +107,8 @@ int TimeSpanningInterface::InterfacePrepareTimeSpanning( ArrayPtrVoid *params, D { // param 0: std::vector* that holds the current elements to match // param 1: bool* fillList for indicating whether the elements have to be stack or not - std::vector *elements = static_cast*>((*params)[0]); - bool *fillList = static_cast((*params)[1]); + std::vector *elements = static_cast*>((*params).at(0)); + bool *fillList = static_cast((*params).at(1)); if ((*fillList)==false) { return FUNCTOR_CONTINUE; @@ -123,7 +123,7 @@ int TimeSpanningInterface::InterfacePrepareTimeSpanning( ArrayPtrVoid *params, D int TimeSpanningInterface::InterfaceFillStaffCurrentTimeSpanning( ArrayPtrVoid *params, DocObject *object ) { // param 0: std::vector* of the current running TimeSpanningInterface elements - std::vector *elements = static_cast*>((*params)[0]); + std::vector *elements = static_cast*>((*params).at(0)); if (this->HasStartAndEnd()) { if ( GetStart()->GetFirstParent( STAFF ) != GetEnd()->GetFirstParent( STAFF ) ) { diff --git a/src/verse.cpp b/src/verse.cpp index e1f2045becd..b56599ab15f 100644 --- a/src/verse.cpp +++ b/src/verse.cpp @@ -60,8 +60,8 @@ int Verse::AlignVertically( ArrayPtrVoid *params ) { // param 0: the systemAligner // param 1: the staffNb - SystemAligner **systemAligner = static_cast((*params)[0]); - int *staffNb = static_cast((*params)[1]); + SystemAligner **systemAligner = static_cast((*params).at(0)); + int *staffNb = static_cast((*params).at(1)); // we need to call it because we are overriding Object::AlignVertically this->ResetVerticalAlignment(); @@ -81,9 +81,9 @@ int Verse::PrepareProcessingLists( ArrayPtrVoid *params ) { // param 0: the IntTree* for staff/layer/verse // param 1: the IntTree* for staff/layer (unused) - IntTree *tree = static_cast((*params)[0]); + IntTree *tree = static_cast((*params).at(0)); // Alternate solution with StaffN_LayerN_VerseN_t - //StaffN_LayerN_VerseN_t *tree = static_cast((*params)[0]); + //StaffN_LayerN_VerseN_t *tree = static_cast((*params).at(0)); Staff *staff = dynamic_cast( this->GetFirstParent( STAFF ) ); Layer *layer = dynamic_cast( this->GetFirstParent( LAYER ) ); diff --git a/src/view_beam.cpp b/src/view_beam.cpp index fe7bc16b224..bf7b2998da5 100644 --- a/src/view_beam.cpp +++ b/src/view_beam.cpp @@ -136,17 +136,17 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta // Can it happen? With rests? if (currentDur > DUR_4) { - (*beamElementCoords)[elementCount]->m_element = current; - current->m_beamElementCoord = (*beamElementCoords)[elementCount]; - (*beamElementCoords)[elementCount]->m_x = current->GetDrawingX(); - (*beamElementCoords)[elementCount]->m_dur = currentDur; + (*beamElementCoords).at(elementCount)->m_element = current; + current->m_beamElementCoord = (*beamElementCoords).at(elementCount); + (*beamElementCoords).at(elementCount)->m_x = current->GetDrawingX(); + (*beamElementCoords).at(elementCount)->m_dur = currentDur; // Look at beam breaks - (*beamElementCoords)[elementCount]->m_breaksec = 0; + (*beamElementCoords).at(elementCount)->m_breaksec = 0; AttBeamsecondary *beamsecondary = dynamic_cast(current); if ( elementCount && beamsecondary && beamsecondary->HasBreaksec()) { if (!changingDur) changingDur = ON; - (*beamElementCoords)[elementCount]->m_breaksec = beamsecondary->GetBreaksec(); + (*beamElementCoords).at(elementCount)->m_breaksec = beamsecondary->GetBreaksec(); } // Skip rests @@ -200,31 +200,31 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta for (i = 0; i < elementCount; i++) { - if ((*beamElementCoords)[i]->m_element->Is() == CHORD) { - Chord *chord = dynamic_cast((*beamElementCoords)[i]->m_element); + if ((*beamElementCoords).at(i)->m_element->Is() == CHORD) { + Chord *chord = dynamic_cast((*beamElementCoords).at(i)->m_element); assert( chord ); chord->GetYExtremes(&yMax, &yMin); - (*beamElementCoords)[i]->m_yTop = yMax; - (*beamElementCoords)[i]->m_yBottom = yMin; + (*beamElementCoords).at(i)->m_yTop = yMax; + (*beamElementCoords).at(i)->m_yBottom = yMin; - avgY += (*beamElementCoords)[i]->m_y + ((yMax - yMin) / 2); + avgY += (*beamElementCoords).at(i)->m_y + ((yMax - yMin) / 2); // highest and lowest value; high= std::max(yMax, high); low = std::min(yMin, low); } else { - (*beamElementCoords)[i]->m_y = (*beamElementCoords)[i]->m_element->GetDrawingY(); + (*beamElementCoords).at(i)->m_y = (*beamElementCoords).at(i)->m_element->GetDrawingY(); // highest and lowest value; - high= std::max((*beamElementCoords)[i]->m_y, high); - low = std::min((*beamElementCoords)[i]->m_y, low); + high= std::max((*beamElementCoords).at(i)->m_y, high); + low = std::min((*beamElementCoords).at(i)->m_y, low); - curY = (*beamElementCoords)[i]->m_element->GetDrawingY(); - (*beamElementCoords)[i]->m_y = curY; - (*beamElementCoords)[i]->m_yTop = curY; - (*beamElementCoords)[i]->m_yBottom = curY; - avgY += (*beamElementCoords)[i]->m_y; + curY = (*beamElementCoords).at(i)->m_element->GetDrawingY(); + (*beamElementCoords).at(i)->m_y = curY; + (*beamElementCoords).at(i)->m_yTop = curY; + (*beamElementCoords).at(i)->m_yBottom = curY; + avgY += (*beamElementCoords).at(i)->m_y; } } @@ -247,18 +247,18 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta if (stemDir == STEMDIRECTION_up) { //set stem direction for all the notes for (i = 0; i < elementCount; i++) { - (*beamElementCoords)[i]->m_y = (*beamElementCoords)[i]->m_yTop; + (*beamElementCoords).at(i)->m_y = (*beamElementCoords).at(i)->m_yTop; } } else { for (i = 0; i < elementCount; i++) { - (*beamElementCoords)[i]->m_y = (*beamElementCoords)[i]->m_yBottom; + (*beamElementCoords).at(i)->m_y = (*beamElementCoords).at(i)->m_yBottom; } } // We look only at the last note for checking if cuesized. Somehow arbitrarily - beamWidthBlack = m_doc->GetDrawingBeamWidth(staff->m_drawingStaffSize, (*beamElementCoords)[last]->m_element->IsCueSize()); - beamWidthWhite = m_doc->GetDrawingBeamWhiteWidth(staff->m_drawingStaffSize, (*beamElementCoords)[last]->m_element->IsCueSize()); + beamWidthBlack = m_doc->GetDrawingBeamWidth(staff->m_drawingStaffSize, (*beamElementCoords).at(last)->m_element->IsCueSize()); + beamWidthWhite = m_doc->GetDrawingBeamWhiteWidth(staff->m_drawingStaffSize, (*beamElementCoords).at(last)->m_element->IsCueSize()); beamWidth = beamWidthBlack + beamWidthWhite; @@ -269,7 +269,7 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta verticalShift = ((shortestDur-DUR_8)*(beamWidth)); //if the beam has smaller-size notes - if ((*beamElementCoords)[last]->m_element->IsCueSize()) { + if ((*beamElementCoords).at(last)->m_element->IsCueSize()) { verticalShift += m_doc->GetDrawingUnit(staff->m_drawingStaffSize)*5; } else { @@ -288,21 +288,21 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta for (i=0; im_element->Is() == NOTE ) { - ((Note*)(*beamElementCoords)[i]->m_element)->SetDrawingStemDir( stemDir ); + if ( (*beamElementCoords).at(i)->m_element->Is() == NOTE ) { + ((Note*)(*beamElementCoords).at(i)->m_element)->SetDrawingStemDir( stemDir ); } - else if ( (*beamElementCoords)[i]->m_element->Is() == CHORD ) { - ((Chord*)(*beamElementCoords)[i]->m_element)->SetDrawingStemDir(stemDir); + else if ( (*beamElementCoords).at(i)->m_element->Is() == CHORD ) { + ((Chord*)(*beamElementCoords).at(i)->m_element)->SetDrawingStemDir(stemDir); } - (*beamElementCoords)[i]->m_yBeam = (*beamElementCoords)[i]->m_y + verticalShift; - (*beamElementCoords)[i]->m_x += dx[(*beamElementCoords)[i]->m_element->IsCueSize()]; + (*beamElementCoords).at(i)->m_yBeam = (*beamElementCoords).at(i)->m_y + verticalShift; + (*beamElementCoords).at(i)->m_x += dx[(*beamElementCoords).at(i)->m_element->IsCueSize()]; - s_y += (*beamElementCoords)[i]->m_yBeam; - s_y2 += (*beamElementCoords)[i]->m_yBeam * (*beamElementCoords)[i]->m_yBeam; - s_x += (*beamElementCoords)[i]->m_x; - s_x2 += (*beamElementCoords)[i]->m_x * (*beamElementCoords)[i]->m_x; - s_xy += (*beamElementCoords)[i]->m_x * (*beamElementCoords)[i]->m_yBeam; + s_y += (*beamElementCoords).at(i)->m_yBeam; + s_y2 += (*beamElementCoords).at(i)->m_yBeam * (*beamElementCoords).at(i)->m_yBeam; + s_x += (*beamElementCoords).at(i)->m_x; + s_x2 += (*beamElementCoords).at(i)->m_x * (*beamElementCoords).at(i)->m_x; + s_xy += (*beamElementCoords).at(i)->m_x * (*beamElementCoords).at(i)->m_yBeam; } y1 = elementCount * s_xy - s_x * s_y; @@ -334,8 +334,8 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta double oldYPos; //holds y position before calculation to determine if beam needs extra height double expectedY; for ( i=0; im_yBeam; - expectedY = startingY + verticalBoost + beamSlope * (*beamElementCoords)[i]->m_x; + oldYPos = (*beamElementCoords).at(i)->m_yBeam; + expectedY = startingY + verticalBoost + beamSlope * (*beamElementCoords).at(i)->m_x; //if the stem is not long enough, add extra stem length needed to all members of the beam if ((stemDir == STEMDIRECTION_up && (oldYPos > expectedY)) || (stemDir == STEMDIRECTION_down && (oldYPos < expectedY))) { @@ -345,23 +345,23 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta for (i=0; im_yBeam = startingY + verticalBoost + beamSlope * (*beamElementCoords)[i]->m_x; + (*beamElementCoords).at(i)->m_yBeam = startingY + verticalBoost + beamSlope * (*beamElementCoords).at(i)->m_x; } for (i=0; im_yBeam - m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize); - fy2 = (*beamElementCoords)[i]->m_yBottom + m_doc->GetDrawingUnit(staff->m_drawingStaffSize)/4; + fy1 = (*beamElementCoords).at(i)->m_yBeam - m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize); + fy2 = (*beamElementCoords).at(i)->m_yBottom + m_doc->GetDrawingUnit(staff->m_drawingStaffSize)/4; } else { - fy1 = (*beamElementCoords)[i]->m_yBeam + m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize); - fy2 = (*beamElementCoords)[i]->m_yTop - m_doc->GetDrawingUnit(staff->m_drawingStaffSize)/4; + fy1 = (*beamElementCoords).at(i)->m_yBeam + m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize); + fy2 = (*beamElementCoords).at(i)->m_yTop - m_doc->GetDrawingUnit(staff->m_drawingStaffSize)/4; } // All notes and chords, including notes within chords, get their stem value stored - LayerElement *el = (*beamElementCoords)[i]->m_element; - el->m_drawingStemStart.x = el->m_drawingStemEnd.x = (*beamElementCoords)[i]->m_x; + LayerElement *el = (*beamElementCoords).at(i)->m_element; + el->m_drawingStemStart.x = el->m_drawingStemEnd.x = (*beamElementCoords).at(i)->m_x; el->m_drawingStemStart.y = fy2; el->m_drawingStemEnd.y = fy1; el->m_drawingStemDir = stemDir; @@ -378,7 +378,7 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta for (i=0; im_element; + LayerElement *el = (*beamElementCoords).at(i)->m_element; if( ( (el->Is() == NOTE) && !dynamic_cast(el)->IsChordTone()) || (el->Is() == CHORD) ) { DrawVerticalLine (dc, el->m_drawingStemStart.y, el->m_drawingStemEnd.y, el->m_drawingStemStart.x, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize)); } @@ -390,17 +390,17 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta fullBars = !changingDur ? (shortestDur - DUR_4) : 1; // Adjust the x position of the first and last element for taking into account the stem width - (*beamElementCoords)[0]->m_x -= (m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize)) / 2; - (*beamElementCoords)[last]->m_x += (m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize)) / 2; + (*beamElementCoords).at(0)->m_x -= (m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize)) / 2; + (*beamElementCoords).at(last)->m_x += (m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize)) / 2; // Shift direction shiftY = (stemDir == STEMDIRECTION_down) ? 1.0 : -1.0; - fy1 = (*beamElementCoords)[0]->m_yBeam; - fy2 = (*beamElementCoords)[last]->m_yBeam; + fy1 = (*beamElementCoords).at(0)->m_yBeam; + fy2 = (*beamElementCoords).at(last)->m_yBeam; - fx1 = (*beamElementCoords)[0]->m_x; - fx2 = (*beamElementCoords)[last]->m_x; + fx1 = (*beamElementCoords).at(0)->m_x; + fx2 = (*beamElementCoords).at(last)->m_x; s_y = shiftY; s_y2 = shiftY; @@ -451,23 +451,23 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta // all but the last one for (i = 0; i < elementCount - 1; i++) { - bool breakSec = (((*beamElementCoords)[i]->m_breaksec) && (testDur - DUR_8 >= (*beamElementCoords)[i]->m_breaksec)); - (*beamElementCoords)[i]->m_partialFlags[testDur-DUR_8] = PARTIAL_NONE; + bool breakSec = (((*beamElementCoords).at(i)->m_breaksec) && (testDur - DUR_8 >= (*beamElementCoords).at(i)->m_breaksec)); + (*beamElementCoords).at(i)->m_partialFlags[testDur-DUR_8] = PARTIAL_NONE; // partial is needed - if ((*beamElementCoords)[i]->m_dur >= (char)testDur) { + if ((*beamElementCoords).at(i)->m_dur >= (char)testDur) { // and for the next one too, but no break - through - if (((*beamElementCoords)[i+1]->m_dur >= (char)testDur) && !breakSec) { - (*beamElementCoords)[i]->m_partialFlags[testDur-DUR_8] = PARTIAL_THROUGH; + if (((*beamElementCoords).at(i+1)->m_dur >= (char)testDur) && !breakSec) { + (*beamElementCoords).at(i)->m_partialFlags[testDur-DUR_8] = PARTIAL_THROUGH; } // not needed for the next one or break else { // we are starting a beam or after a beam break - put it right if (start) { - (*beamElementCoords)[i]->m_partialFlags[testDur-DUR_8] = PARTIAL_RIGHT; + (*beamElementCoords).at(i)->m_partialFlags[testDur-DUR_8] = PARTIAL_RIGHT; } // or the previous one had no partial - put it left - else if ((*beamElementCoords)[i-1]->m_dur < (char)testDur) { - (*beamElementCoords)[i]->m_partialFlags[testDur-DUR_8] = PARTIAL_LEFT; + else if ((*beamElementCoords).at(i-1)->m_dur < (char)testDur) { + (*beamElementCoords).at(i)->m_partialFlags[testDur-DUR_8] = PARTIAL_LEFT; } } } @@ -480,39 +480,39 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta } } // last one - (*beamElementCoords)[i]->m_partialFlags[testDur-DUR_8] = PARTIAL_NONE; + (*beamElementCoords).at(i)->m_partialFlags[testDur-DUR_8] = PARTIAL_NONE; // partial is needed - if ((*beamElementCoords)[i]->m_dur >= (char)testDur) { + if ((*beamElementCoords).at(i)->m_dur >= (char)testDur) { // and the previous one had no partial - put it left - if ((*beamElementCoords)[i-1]->m_dur < (char)testDur) { - (*beamElementCoords)[i]->m_partialFlags[testDur-DUR_8] = PARTIAL_LEFT; + if ((*beamElementCoords).at(i-1)->m_dur < (char)testDur) { + (*beamElementCoords).at(i)->m_partialFlags[testDur-DUR_8] = PARTIAL_LEFT; } } // draw them for (i=0; im_partialFlags[testDur-DUR_8] == PARTIAL_THROUGH) { + if ((*beamElementCoords).at(i)->m_partialFlags[testDur-DUR_8] == PARTIAL_THROUGH) { // through should never be set on the last one assert( i < elementCount - 1); if (i >= elementCount - 1) continue; // assert for debug and skip otherwise - fy1 = (*beamElementCoords)[i]->m_yBeam + barY; - fy2 = (*beamElementCoords)[i+1]->m_yBeam + barY; + fy1 = (*beamElementCoords).at(i)->m_yBeam + barY; + fy2 = (*beamElementCoords).at(i+1)->m_yBeam + barY; polygonHeight = beamWidthBlack * shiftY; - DrawObliquePolygon (dc, (*beamElementCoords)[i]->m_x, fy1,(*beamElementCoords)[i+1]->m_x, fy2, polygonHeight); + DrawObliquePolygon (dc, (*beamElementCoords).at(i)->m_x, fy1,(*beamElementCoords).at(i+1)->m_x, fy2, polygonHeight); } - else if ((*beamElementCoords)[i]->m_partialFlags[testDur-DUR_8] == PARTIAL_RIGHT) { - fy1 = (*beamElementCoords)[i]->m_yBeam + barY; - int x2 = (*beamElementCoords)[i]->m_x + m_doc->GetDrawingLedgerLineLength(staff->m_drawingStaffSize, false); + else if ((*beamElementCoords).at(i)->m_partialFlags[testDur-DUR_8] == PARTIAL_RIGHT) { + fy1 = (*beamElementCoords).at(i)->m_yBeam + barY; + int x2 = (*beamElementCoords).at(i)->m_x + m_doc->GetDrawingLedgerLineLength(staff->m_drawingStaffSize, false); fy2 = startingY + verticalBoost + barY + beamSlope * x2; polygonHeight= beamWidthBlack*shiftY; - DrawObliquePolygon (dc, (*beamElementCoords)[i]->m_x, fy1, x2, fy2, polygonHeight); + DrawObliquePolygon (dc, (*beamElementCoords).at(i)->m_x, fy1, x2, fy2, polygonHeight); } - else if ((*beamElementCoords)[i]->m_partialFlags[testDur-DUR_8] == PARTIAL_LEFT) { - fy2 = (*beamElementCoords)[i]->m_yBeam + barY; - int x1 = (*beamElementCoords)[i]->m_x - m_doc->GetDrawingLedgerLineLength(staff->m_drawingStaffSize, false); + else if ((*beamElementCoords).at(i)->m_partialFlags[testDur-DUR_8] == PARTIAL_LEFT) { + fy2 = (*beamElementCoords).at(i)->m_yBeam + barY; + int x1 = (*beamElementCoords).at(i)->m_x - m_doc->GetDrawingLedgerLineLength(staff->m_drawingStaffSize, false); fy1 = startingY + verticalBoost + barY + beamSlope * x1; polygonHeight = beamWidthBlack*shiftY; - DrawObliquePolygon (dc, x1, fy1, (*beamElementCoords)[i]->m_x, fy2, polygonHeight); + DrawObliquePolygon (dc, x1, fy1, (*beamElementCoords).at(i)->m_x, fy2, polygonHeight); } } diff --git a/src/view_element.cpp b/src/view_element.cpp index 72bac26f1dc..d71491d331d 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -393,8 +393,8 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St inChord->m_drawingLedgerLines[staff] = legerLines; } int idx = doubleLengthLedger + aboveStaff * 2; // 2x2 array - std::vector *legerLines = &inChord->m_drawingLedgerLines[staff]; - (*legerLines)[idx] = ledgermax(numLines, (*legerLines)[idx]); + std::vector *legerLines = &inChord->m_drawingLedgerLines.at(staff); + (*legerLines).at(idx) = ledgermax(numLines, (*legerLines).at(idx)); } //we do want to go ahead and draw if it's not in a chord else { @@ -1113,7 +1113,7 @@ void View::DrawChord( DeviceContext *dc, LayerElement *element, Layer *layer, St //iterate through the list of notes with accidentals for(idx = 0; idx < size; idx++) { - Accid *curAccid = noteList[idx]->m_drawingAccid; + Accid *curAccid = noteList.at(idx)->m_drawingAccid; //if the note does not need to be moved, save a new cluster start position if (CalculateAccidX(staff, curAccid, chord, false)) @@ -1129,17 +1129,17 @@ void View::DrawChord( DeviceContext *dc, LayerElement *element, Layer *layer, St for(idx = 0; idx < accidSize; idx++) { //set fwIdx to the start of the cluster - fwIdx = accidClusterStarts[idx]; + fwIdx = accidClusterStarts.at(idx); //if this is the last cluster, set bwIdx to the last note in the chord if (idx == accidSize - 1) bwIdx = size - 1; //otherwise, set bwIdx to one before the beginning of the next cluster - else bwIdx = accidClusterStarts[idx + 1] - 1; + else bwIdx = accidClusterStarts.at(idx + 1) - 1; //if it's even, this will catch the overlap; if it's odd, there's an if in the middle there while (fwIdx <= bwIdx) { - Accid *accidFwd = noteList[fwIdx]->m_drawingAccid; - Accid *accidBwd = noteList[bwIdx]->m_drawingAccid; + Accid *accidFwd = noteList.at(fwIdx)->m_drawingAccid; + Accid *accidBwd = noteList.at(bwIdx)->m_drawingAccid; //if the top note has an accidental, draw it and update prevAccid accidFwd->SetDrawingX(xAccid); @@ -1170,20 +1170,20 @@ void View::DrawChord( DeviceContext *dc, LayerElement *element, Layer *layer, St std::vector *legerLines = &(*iter).second; //if there are double-length lines, we only need to draw single-length after they've been drawn - (*legerLines)[0] -= (*legerLines)[1]; - (*legerLines)[2] -= (*legerLines)[3]; + (*legerLines).at(0) -= (*legerLines).at(1); + (*legerLines).at(2) -= (*legerLines).at(3); //double-length lines below the staff - DrawLedgerLines(dc, chord, (*iter).first, false, true, 0, (*legerLines)[1]); + DrawLedgerLines(dc, chord, (*iter).first, false, true, 0, (*legerLines).at(1)); //remainder single-length lines below the staff - DrawLedgerLines(dc, chord, (*iter).first, false, false, (*legerLines)[1], (*legerLines)[0]); + DrawLedgerLines(dc, chord, (*iter).first, false, false, (*legerLines).at(1), (*legerLines).at(0)); //double-length lines above the staff - DrawLedgerLines(dc, chord, (*iter).first, true, true, 0, (*legerLines)[3]); + DrawLedgerLines(dc, chord, (*iter).first, true, true, 0, (*legerLines).at(3)); //remainder single-length lines above the staff - DrawLedgerLines(dc, chord, (*iter).first, true, false, (*legerLines)[3], (*legerLines)[2]); + DrawLedgerLines(dc, chord, (*iter).first, true, false, (*legerLines).at(3), (*legerLines).at(2)); } @@ -1397,13 +1397,13 @@ bool View::CalculateAccidX(Staff *staff, Accid *accid, Chord *chord, bool adjust accidBot = accidTop + (accidHeightDiff * FLAT_BOTTOM_HEIGHT_MULTIPLIER); assert(accidBot < accidSpaceSize); while (currentX < xLength) { - if (accidSpace->at(accidTop + (ACCID_HEIGHT * FLAT_CORNER_HEIGHT_IGNORE))[currentX - accidWidthDiff]) currentX += 1; + if (accidSpace->at(accidTop + (ACCID_HEIGHT * FLAT_CORNER_HEIGHT_IGNORE)).at(currentX - accidWidthDiff)) currentX += 1; // just in case else if (currentX - accidWidthDiff + (ACCID_WIDTH * FLAT_CORNER_WIDTH_IGNORE) >= xLength ) break; - else if (accidSpace->at(accidTop)[currentX - accidWidthDiff + (ACCID_WIDTH * FLAT_CORNER_WIDTH_IGNORE)]) currentX += 1; - else if (accidSpace->at(accidBot)[currentX - accidWidthDiff]) currentX += 1; - else if (accidSpace->at(accidTop)[currentX]) currentX += 1; - else if (accidSpace->at(accidBot)[currentX]) currentX += 1; + else if (accidSpace->at(accidTop).at(currentX - accidWidthDiff + (ACCID_WIDTH * FLAT_CORNER_WIDTH_IGNORE))) currentX += 1; + else if (accidSpace->at(accidBot).at(currentX - accidWidthDiff)) currentX += 1; + else if (accidSpace->at(accidTop).at(currentX)) currentX += 1; + else if (accidSpace->at(accidBot).at(currentX)) currentX += 1; else break; }; } @@ -1414,15 +1414,15 @@ bool View::CalculateAccidX(Staff *staff, Accid *accid, Chord *chord, bool adjust //Midpoint needs to be checked for non-flats as there's a chance that a natural/sharp could completely overlap a flat int accidMid = accidTop + (accidBot - accidTop) / 2; while (currentX < xLength) { - if (accidSpace->at(accidTop + (ACCID_HEIGHT * NATURAL_CORNER_HEIGHT_IGNORE))[currentX - accidWidthDiff]) currentX += 1; + if (accidSpace->at(accidTop + (ACCID_HEIGHT * NATURAL_CORNER_HEIGHT_IGNORE)).at(currentX - accidWidthDiff)) currentX += 1; // just in case else if (currentX - accidWidthDiff + (ACCID_WIDTH * NATURAL_CORNER_WIDTH_IGNORE) >= xLength ) break; - else if (accidSpace->at(accidTop)[currentX - accidWidthDiff + (ACCID_WIDTH * NATURAL_CORNER_WIDTH_IGNORE)]) currentX += 1; - else if (accidSpace->at(accidMid)[currentX - accidWidthDiff]) currentX += 1; - else if (accidSpace->at(accidBot)[currentX - accidWidthDiff]) currentX += 1; - else if (accidSpace->at(accidTop)[currentX]) currentX += 1; - else if (accidSpace->at(accidMid)[currentX]) currentX += 1; - else if (accidSpace->at(accidBot)[currentX]) currentX += 1; + else if (accidSpace->at(accidTop).at(currentX - accidWidthDiff + (ACCID_WIDTH * NATURAL_CORNER_WIDTH_IGNORE))) currentX += 1; + else if (accidSpace->at(accidMid).at(currentX - accidWidthDiff)) currentX += 1; + else if (accidSpace->at(accidBot).at(currentX - accidWidthDiff)) currentX += 1; + else if (accidSpace->at(accidTop).at(currentX)) currentX += 1; + else if (accidSpace->at(accidMid).at(currentX)) currentX += 1; + else if (accidSpace->at(accidBot).at(currentX)) currentX += 1; else break; }; } @@ -1432,12 +1432,12 @@ bool View::CalculateAccidX(Staff *staff, Accid *accid, Chord *chord, bool adjust //Midpoint needs to be checked for non-flats as there's a chance that a natural/sharp could completely overlap a flat int accidMid = accidTop + (accidBot - accidTop) / 2; while (currentX < xLength) { - if (accidSpace->at(accidTop)[currentX - accidWidthDiff]) currentX += 1; - else if (accidSpace->at(accidMid)[currentX - accidWidthDiff]) currentX += 1; - else if (accidSpace->at(accidBot)[currentX - accidWidthDiff]) currentX += 1; - else if (accidSpace->at(accidTop)[currentX]) currentX += 1; - else if (accidSpace->at(accidMid)[currentX]) currentX += 1; - else if (accidSpace->at(accidBot)[currentX]) currentX += 1; + if (accidSpace->at(accidTop).at(currentX - accidWidthDiff)) currentX += 1; + else if (accidSpace->at(accidMid).at(currentX - accidWidthDiff)) currentX += 1; + else if (accidSpace->at(accidBot).at(currentX - accidWidthDiff)) currentX += 1; + else if (accidSpace->at(accidTop).at(currentX)) currentX += 1; + else if (accidSpace->at(accidMid).at(currentX)) currentX += 1; + else if (accidSpace->at(accidBot).at(currentX)) currentX += 1; else break; }; } @@ -1449,12 +1449,12 @@ bool View::CalculateAccidX(Staff *staff, Accid *accid, Chord *chord, bool adjust int accidMid = accidTop + (accidBot - accidTop) / 2; assert(accidMid < accidSpaceSize); while (currentX < xLength) { - if (accidSpace->at(accidTop)[currentX - accidWidthDiff]) currentX += 1; - else if (accidSpace->at(accidMid)[currentX - accidWidthDiff]) currentX += 1; - else if (accidSpace->at(accidBot)[currentX - accidWidthDiff]) currentX += 1; - else if (accidSpace->at(accidTop)[currentX]) currentX += 1; - else if (accidSpace->at(accidMid)[currentX]) currentX += 1; - else if (accidSpace->at(accidBot)[currentX]) currentX += 1; + if (accidSpace->at(accidTop).at(currentX - accidWidthDiff)) currentX += 1; + else if (accidSpace->at(accidMid).at(currentX - accidWidthDiff)) currentX += 1; + else if (accidSpace->at(accidBot).at(currentX - accidWidthDiff)) currentX += 1; + else if (accidSpace->at(accidTop).at(currentX)) currentX += 1; + else if (accidSpace->at(accidMid).at(currentX)) currentX += 1; + else if (accidSpace->at(accidBot).at(currentX)) currentX += 1; else break; }; } @@ -1466,7 +1466,7 @@ bool View::CalculateAccidX(Staff *staff, Accid *accid, Chord *chord, bool adjust int yComp = accidTop - alignmentThreshold; assert(yComp < accidSpaceSize); assert(yComp >= 0); - if((accidSpace->at(yComp)[currentX + 1] == false) && (accidSpace->at(yComp)[currentX] == true)) currentX += 1; + if((accidSpace->at(yComp).at(currentX + 1) == false) && (accidSpace->at(yComp).at(currentX) == true)) currentX += 1; } //If the accidental is lined up with the one below it, move it left by a halfunit to avoid visual confusion @@ -1476,7 +1476,7 @@ bool View::CalculateAccidX(Staff *staff, Accid *accid, Chord *chord, bool adjust int yComp = accidBot; assert(yComp < accidSpaceSize); assert(yComp >= 0); - if((accidSpace->at(yComp)[currentX + 1] == false) && (accidSpace->at(yComp)[currentX] == true)) currentX += 1; + if((accidSpace->at(yComp).at(currentX + 1) == false) && (accidSpace->at(yComp).at(currentX) == true)) currentX += 1; } //Just to make sure. @@ -1933,9 +1933,9 @@ void View::DrawFermata(DeviceContext *dc, LayerElement *element, Staff *staff) // This works as above, only we check that the note head is not // UNDER the staff - if ((element->GetDrawingY()) > (staff->GetDrawingY() - m_doc->m_drawingStaffSize[staff->m_drawingStaffSize])) + if ((element->GetDrawingY()) > (staff->GetDrawingY() - m_doc->m_drawingStaffSize.at(staff->m_drawingStaffSize))) // notehead in staff, set under - y = staff->GetDrawingY() - m_doc->m_drawingStaffSize[staff->m_drawingStaffSize] - m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); + y = staff->GetDrawingY() - m_doc->m_drawingStaffSize.at(staff->m_drawingStaffSize) - m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); else // notehead under staff, set under notehead y = (element->GetDrawingY()) - m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); From c6677a9e70a32d1e1310a547e6d91992f19d87dc Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sat, 29 Aug 2015 02:03:19 +0200 Subject: [PATCH 092/114] Basic mRpt rendering --- include/vrv/rpt.h | 7 +++++++ include/vrv/style.h | 15 +++++++++++++-- src/doc.cpp | 2 ++ src/layerelement.cpp | 8 ++++++++ src/rpt.cpp | 10 ++++++++++ src/style.cpp | 2 ++ src/view_element.cpp | 4 +--- 7 files changed, 43 insertions(+), 5 deletions(-) diff --git a/include/vrv/rpt.h b/include/vrv/rpt.h index 11203207158..a976846d754 100644 --- a/include/vrv/rpt.h +++ b/include/vrv/rpt.h @@ -37,6 +37,13 @@ class BeatRpt: public LayerElement, virtual ClassId Is() { return BEAT_RPT; }; ///@} + /** + * Returns the duration (in double) for the element. + * Careful: this method is not overriding LayerElement::GetAlignmentDuration since + * LayerElement and DurationInterface have no inheritance link. + */ + virtual double GetAlignmentDuration( int meterUnit ); + private: public: diff --git a/include/vrv/style.h b/include/vrv/style.h index daf001da646..138656baf35 100644 --- a/include/vrv/style.h +++ b/include/vrv/style.h @@ -88,6 +88,10 @@ namespace vrv { #define MIN_LEFT_MARGIN_BARLINE_ATTR -10.0 #define MAX_LEFT_MARGIN_BARLINE_ATTR 10.0 +#define DEFAULT_LEFT_MARGIN_BEATRPT 3.0 +#define MIN_LEFT_MARGIN_BEATRPT -10.0 +#define MAX_LEFT_MARGIN_BEATRPTD 10.0 + #define DEFAULT_LEFT_MARGIN_CHORD 1.0 #define MIN_LEFT_MARGIN_CHORD -10.0 #define MAX_LEFT_MARGIN_CHORD 10.0 @@ -118,6 +122,10 @@ namespace vrv { #define MIN_RIGHT_MARGIN_BARLINE_ATTR 0.0 #define MAX_RIGHT_MARGIN_BARLINE_ATTR 10.0 +#define DEFAULT_RIGHT_MARGIN_BEATRPT 2.0 +#define MIN_RIGHT_MARGIN_BEATRPT 0.0 +#define MAX_RIGHT_MARGIN_BEATRPT 10.0 + #define DEFAULT_RIGHT_MARGIN_CLEF 2.0 #define MIN_RIGHT_MARGIN_CLEF 0.0 #define MAX_RIGHT_MARGIN_CLEF 10.0 @@ -211,6 +219,7 @@ class Style /** The layout left margin by element */ char m_leftMarginBarline; char m_leftMarginBarlineAttr; + char m_leftMarginBeatRpt; char m_leftMarginChord; char m_leftMarginClef; char m_leftMarginMRest; @@ -219,14 +228,16 @@ class Style char m_leftMarginDefault; /** The layout right margin by element */ + char m_rightMarginBarline; + char m_rightMarginBarlineAttr; + char m_rightMarginBeatRpt; char m_rightMarginClef; char m_rightMarginKeySig; char m_rightMarginMensur; char m_rightMarginMeterSig; - char m_rightMarginBarline; - char m_rightMarginBarlineAttr; char m_rightMarginMRest; char m_rightMarginMultiRest; + /** The default right margin */ char m_rightMarginDefault; diff --git a/src/doc.cpp b/src/doc.cpp index 1b8ba958db4..07bada8eebd 100644 --- a/src/doc.cpp +++ b/src/doc.cpp @@ -533,6 +533,7 @@ char Doc::GetLeftMargin( const ClassId classId ) { if (classId == BAR_LINE) return m_style->m_leftMarginBarline; else if (classId == BAR_LINE_ATTR) return m_style->m_leftMarginBarlineAttr; + else if (classId == BEAT_RPT) return m_style->m_leftMarginBeatRpt; else if (classId == CHORD) return m_style->m_leftMarginChord; else if (classId == CLEF) return m_style->m_leftMarginClef; else if (classId == MREST) return m_style->m_leftMarginMRest; @@ -545,6 +546,7 @@ char Doc::GetRightMargin( const ClassId classId ) { if (classId == BAR_LINE) return m_style->m_rightMarginBarline; else if (classId == BAR_LINE_ATTR) return m_style->m_rightMarginBarlineAttr; + else if (classId == BEAT_RPT) return m_style->m_rightMarginBeatRpt; else if (classId == CLEF) return m_style->m_rightMarginClef; else if (classId == KEY_SIG) return m_style->m_rightMarginKeySig; else if (classId == MENSUR) return m_style->m_rightMarginMensur; diff --git a/src/layerelement.cpp b/src/layerelement.cpp index d4eaf4e6e2c..3b8d8dd9551 100644 --- a/src/layerelement.cpp +++ b/src/layerelement.cpp @@ -32,6 +32,7 @@ #include "multirest.h" #include "note.h" #include "rest.h" +#include "rpt.h" #include "space.h" #include "staff.h" #include "syl.h" @@ -169,6 +170,13 @@ double LayerElement::GetAlignmentDuration( Mensur *mensur, MeterSig *meterSig, b if (duration->IsMensural()) return duration->GetAlignmentMensuralDuration( num, numbase, mensur ); else return duration->GetAlignmentDuration( num, numbase ); } + else if (this->Is() == BEAT_RPT) { + BeatRpt *beatRpt = dynamic_cast(this); + assert(beatRpt); + int meterUnit = 4; + if (meterSig) meterSig->GetUnit(); + return beatRpt->GetAlignmentDuration(meterUnit); + } else { return 0.0; } diff --git a/src/rpt.cpp b/src/rpt.cpp index 55b2a72774a..b6bb35d1f43 100644 --- a/src/rpt.cpp +++ b/src/rpt.cpp @@ -8,6 +8,11 @@ #include "rpt.h" +//---------------------------------------------------------------------------- + +#include +#include + namespace vrv { @@ -32,6 +37,11 @@ void BeatRpt::Reset() LayerElement::Reset(); ResetBeatRptVis(); } + +double BeatRpt::GetAlignmentDuration( int meterUnit ) +{ + return DUR_MAX / meterUnit; +} //---------------------------------------------------------------------------- // MRpt diff --git a/src/style.cpp b/src/style.cpp index 8fc021dd0d5..264f905f394 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -54,6 +54,7 @@ Style::Style() /** The layout right margin by element */ m_rightMarginBarline = DEFAULT_RIGHT_MARGIN_BARLINE * DEFINITON_FACTOR; m_rightMarginBarlineAttr = DEFAULT_RIGHT_MARGIN_BARLINE_ATTR * DEFINITON_FACTOR; + m_rightMarginBeatRpt = DEFAULT_RIGHT_MARGIN_BEATRPT * DEFINITON_FACTOR; m_rightMarginClef = DEFAULT_RIGHT_MARGIN_CLEF * DEFINITON_FACTOR; m_rightMarginKeySig = DEFAULT_RIGHT_MARGIN_KEYSIG * DEFINITON_FACTOR; m_rightMarginMensur = DEFAULT_RIGHT_MARGIN_MENSUR * DEFINITON_FACTOR; @@ -66,6 +67,7 @@ Style::Style() /** The layout left margin by element */ m_leftMarginBarline = DEFAULT_LEFT_MARGIN_BARLINE * DEFINITON_FACTOR; m_leftMarginBarlineAttr = DEFAULT_LEFT_MARGIN_BARLINE_ATTR * DEFINITON_FACTOR; + m_leftMarginBeatRpt = DEFAULT_LEFT_MARGIN_BEATRPT * DEFINITON_FACTOR; m_leftMarginChord = DEFAULT_LEFT_MARGIN_CHORD * DEFINITON_FACTOR; m_leftMarginClef = DEFAULT_LEFT_MARGIN_CLEF * DEFINITON_FACTOR; m_leftMarginMRest = DEFAULT_LEFT_MARGIN_MREST * DEFINITON_FACTOR; diff --git a/src/view_element.cpp b/src/view_element.cpp index d71491d331d..f168cc59304 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -744,10 +744,8 @@ void View::DrawBeatRpt(DeviceContext *dc, LayerElement *element, Layer *layer, S dc->StartGraphic( element, "", element->GetUuid() ); int x = element->GetDrawingX(); - int xCentered = x + (measure->GetDrawingX() + measure->GetRightBarlineX() - x) / 2; int halfWidth = m_doc->GetGlyphWidth(SMUFL_E101_noteheadSlashHorizontalEnds, staff->m_drawingStaffSize, false) / 2; - - int xSymbol = xCentered - halfWidth; + int xSymbol = x; // - halfWidth; int y = element->GetDrawingY(); From 8ef7fa8240def2c17822c51f845bf45588c6ccf2 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sat, 29 Aug 2015 10:57:14 +0200 Subject: [PATCH 093/114] Finalizing beatRpt support --- include/vrv/attdef.h | 1 + include/vrv/style.h | 2 +- src/att.cpp | 2 ++ src/view_element.cpp | 23 +++++++++++++++-------- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/include/vrv/attdef.h b/include/vrv/attdef.h index 0f271277c81..85238119c3a 100644 --- a/include/vrv/attdef.h +++ b/include/vrv/attdef.h @@ -117,6 +117,7 @@ enum data_BARRENDITION { enum data_BEATRPT_REND { BEATRPT_REND_NONE = 0, BEATRPT_REND_4, + BEATRPT_REND_8, BEATRPT_REND_16, BEATRPT_REND_32, BEATRPT_REND_64, diff --git a/include/vrv/style.h b/include/vrv/style.h index 138656baf35..b967c9008f0 100644 --- a/include/vrv/style.h +++ b/include/vrv/style.h @@ -88,7 +88,7 @@ namespace vrv { #define MIN_LEFT_MARGIN_BARLINE_ATTR -10.0 #define MAX_LEFT_MARGIN_BARLINE_ATTR 10.0 -#define DEFAULT_LEFT_MARGIN_BEATRPT 3.0 +#define DEFAULT_LEFT_MARGIN_BEATRPT 2.0 #define MIN_LEFT_MARGIN_BEATRPT -10.0 #define MAX_LEFT_MARGIN_BEATRPTD 10.0 diff --git a/src/att.cpp b/src/att.cpp index 096cb22382e..ad2e74ba0fb 100644 --- a/src/att.cpp +++ b/src/att.cpp @@ -204,6 +204,7 @@ std::string Att::BeatrptRendToStr(data_BEATRPT_REND data) switch(data) { case BEATRPT_REND_4 : value = "4"; break; + case BEATRPT_REND_8 : value = "8"; break; case BEATRPT_REND_16 : value = "16"; break; case BEATRPT_REND_32 : value = "32"; break; case BEATRPT_REND_64 : value = "64"; break; @@ -220,6 +221,7 @@ std::string Att::BeatrptRendToStr(data_BEATRPT_REND data) data_BEATRPT_REND Att::StrToBeatrptRend(std::string value) { if (value == "4") return BEATRPT_REND_4; + else if (value == "8") return BEATRPT_REND_8; else if (value == "16") return BEATRPT_REND_16; else if (value == "32") return BEATRPT_REND_32; else if (value == "64") return BEATRPT_REND_64; diff --git a/src/view_element.cpp b/src/view_element.cpp index f168cc59304..900e553e2f1 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -744,16 +744,25 @@ void View::DrawBeatRpt(DeviceContext *dc, LayerElement *element, Layer *layer, S dc->StartGraphic( element, "", element->GetUuid() ); int x = element->GetDrawingX(); - int halfWidth = m_doc->GetGlyphWidth(SMUFL_E101_noteheadSlashHorizontalEnds, staff->m_drawingStaffSize, false) / 2; - int xSymbol = x; // - halfWidth; - + int xSymbol = x; int y = element->GetDrawingY(); - y -= staff->m_drawingLines / 2 * m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); - DrawSmuflCode( dc, xSymbol, y, SMUFL_E101_noteheadSlashHorizontalEnds, staff->m_drawingStaffSize, false ); + if (beatRpt->GetRend() == BEATRPT_REND_mixed) { + DrawSmuflCode( dc, xSymbol, y, SMUFL_E501_repeat2Bars, staff->m_drawingStaffSize, false ); + } + else { + DrawSmuflCode( dc, xSymbol, y, SMUFL_E101_noteheadSlashHorizontalEnds, staff->m_drawingStaffSize, false ); + int additionalSlash = beatRpt->GetRend() - BEATRPT_REND_8; + int halfWidth = m_doc->GetGlyphWidth(SMUFL_E101_noteheadSlashHorizontalEnds, staff->m_drawingStaffSize, false) / 2; + int i; + for (i = 0; i < additionalSlash; i++) { + xSymbol += halfWidth; + DrawSmuflCode( dc, xSymbol, y, SMUFL_E101_noteheadSlashHorizontalEnds, staff->m_drawingStaffSize, false ); + } + } - dc->EndGraphic(element, this); + dc->EndGraphic(element, this); } void View::DrawMRpt(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure) @@ -772,9 +781,7 @@ void View::DrawMRpt(DeviceContext *dc, LayerElement *element, Layer *layer, Staf int x = element->GetDrawingX(); int xCentered = x + (measure->GetDrawingX() + measure->GetRightBarlineX() - x) / 2; int xSymbol = xCentered - m_doc->GetGlyphWidth(SMUFL_E500_repeat1Bar, staff->m_drawingStaffSize, false) / 2; - int y = element->GetDrawingY(); - y -= staff->m_drawingLines / 2 * m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); DrawSmuflCode( dc, xSymbol, y, SMUFL_E500_repeat1Bar, staff->m_drawingStaffSize, false ); From 1ca36e59dce27e8670c3377b251d00eddf68da16 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Mon, 31 Aug 2015 07:45:45 +0200 Subject: [PATCH 094/114] Adding multiRpt and MRpt2 support --- include/vrv/rpt.h | 3 +- include/vrv/view.h | 1 + src/iomei.cpp | 2 + src/layerelement.cpp | 3 +- src/object.cpp | 4 +- src/rpt.cpp | 5 +- src/view_element.cpp | 107 ++++++++++++++++++++++++------------------- 7 files changed, 72 insertions(+), 53 deletions(-) diff --git a/include/vrv/rpt.h b/include/vrv/rpt.h index a976846d754..c4dda5cd151 100644 --- a/include/vrv/rpt.h +++ b/include/vrv/rpt.h @@ -132,7 +132,8 @@ class MRpt2: public LayerElement /** * This class models the MEI */ -class MultiRpt: public LayerElement +class MultiRpt: public LayerElement, + public AttNumbered { public: /** diff --git a/include/vrv/view.h b/include/vrv/view.h index e816c9af844..8426d5ebc9f 100644 --- a/include/vrv/view.h +++ b/include/vrv/view.h @@ -243,6 +243,7 @@ class View void DrawLedgerLines ( DeviceContext *dc, LayerElement *element, Staff *staff, bool aboveStaff, bool doubleLength, int skip, int n); void DrawLongRest ( DeviceContext *dc, int x, int y, Staff *staff); void DrawMeterSigFigures( DeviceContext *dc, int x, int y, int num, int numBase, Staff *staff); + void DrawMRptPart(DeviceContext *dc, int x, wchar_t smulfCode, int num, bool line, Staff *staff, Measure *measure ); void DrawQuarterRest ( DeviceContext *dc, int x, int y, int valeur, unsigned char dots, bool cueSize, Staff *staff); void DrawStem( DeviceContext *dc, LayerElement *object, Staff *staff, data_STEMDIRECTION dir, int radius, int xn, int originY, int heightY = 0); void DrawTrill(DeviceContext *dc, LayerElement *element, Staff *staff ); diff --git a/src/iomei.cpp b/src/iomei.cpp index eced437fc91..d27108cbd55 100644 --- a/src/iomei.cpp +++ b/src/iomei.cpp @@ -682,6 +682,7 @@ void MeiOutput::WriteMeiMultiRpt( pugi::xml_node currentNode, MultiRpt *multiRpt assert( multiRpt ); WriteLayerElement( currentNode, multiRpt ); + multiRpt->WriteNumbered(currentNode); } void MeiOutput::WriteMeiNote( pugi::xml_node currentNode, Note *note ) @@ -1863,6 +1864,7 @@ bool MeiInput::ReadMeiMultiRpt( Object *parent, pugi::xml_node multiRpt ) { MultiRpt *vrvMultiRpt = new MultiRpt(); ReadLayerElement(multiRpt, vrvMultiRpt); + vrvMultiRpt->ReadNumbered(multiRpt); AddLayerElement(parent, vrvMultiRpt); return true; diff --git a/src/layerelement.cpp b/src/layerelement.cpp index 3b8d8dd9551..0f1dcee7311 100644 --- a/src/layerelement.cpp +++ b/src/layerelement.cpp @@ -258,7 +258,8 @@ int LayerElement::AlignHorizontally( ArrayPtrVoid *params ) type = ALIGNMENT_METERSIG; } } - else if ( (this->Is() == MULTI_REST) || (this->Is() == MREST) || (this->Is() == MRPT) ) { + else if ( (this->Is() == MULTI_REST) || (this->Is() == MREST) || (this->Is() == MRPT) + || (this->Is() == MRPT2) || (this->Is() == MULTI_RPT) ) { type = ALIGNMENT_MULTIREST; } else if ( this->IsGraceNote() ) { diff --git a/src/object.cpp b/src/object.cpp index 010b6688aad..b727aea9aa4 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -1176,8 +1176,8 @@ int Object::SetBoundingBoxXShift( ArrayPtrVoid *params ) // this should never happen (but can with glyphs not exactly registered at position x=0 in the SMuFL font used if ( negative_offset < 0 ) negative_offset = 0; - if ((current->Is() == MREST) || (current->Is() == MRPT)) { - // With MRest, the only thing we want to do it keep their with as possible measure with (if only MRest in all staves/layers) + if ((current->Is() == MREST) || (current->Is() == MRPT) || (this->Is() == MRPT2) || (this->Is() == MULTI_RPT)) { + // With MRest, MRpt, etc., the only thing we want to do it keep their with as possible measure with (if only MRest in all staves/layers) int width = current->m_contentBB_x2 + doc->GetRightMargin( current->Is() ) * doc->GetDrawingUnit(100) / PARAM_DENOMINATOR + negative_offset ; // Keep it if more than the current measure width (*measure_width) = std::max( (*measure_width), width ); diff --git a/src/rpt.cpp b/src/rpt.cpp index b6bb35d1f43..d1bfbaa99fd 100644 --- a/src/rpt.cpp +++ b/src/rpt.cpp @@ -90,8 +90,10 @@ void MRpt2::Reset() //---------------------------------------------------------------------------- MultiRpt::MultiRpt( ): - LayerElement("multirpt-") + LayerElement("multirpt-"), + AttNumbered() { + RegisterAttClass(ATT_NUMBERED); Reset(); } @@ -102,6 +104,7 @@ MultiRpt::~MultiRpt() void MultiRpt::Reset() { LayerElement::Reset(); + ResetNumbered(); } //---------------------------------------------------------------------------- diff --git a/src/view_element.cpp b/src/view_element.cpp index 900e553e2f1..39a94df76cd 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -168,8 +168,6 @@ void View::DrawDurationElement( DeviceContext *dc, LayerElement *element, Layer DrawRest( dc, element, layer, staff, measure ); dc->EndGraphic(element, this ); } - - return; } void View::DrawTuplet(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure) @@ -445,8 +443,6 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St if (note->m_embellishment == EMB_TRILL) { DrawTrill(dc, element, staff); } - - return; } void View::DrawStem( DeviceContext *dc, LayerElement *object, Staff *staff, data_STEMDIRECTION dir, int radius, int xn, int originY, int heightY) @@ -535,7 +531,6 @@ void View::DrawStem( DeviceContext *dc, LayerElement *object, Staff *staff, data if ( drawingCueSize && ( dynamic_cast(object)->GetGrace() == GRACE_acc ) ) { DrawAcciaccaturaSlash(dc, object); } - } //skips "skip" lines before drawing "n" ledger lines @@ -633,8 +628,6 @@ void View::DrawRest ( DeviceContext *dc, LayerElement *element, Layer *layer, St if(rest->GetFermata() != PLACE_NONE) { DrawFermata(dc, element, staff); } - - return; } void View::DrawMRest(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure) @@ -661,9 +654,6 @@ void View::DrawMRest(DeviceContext *dc, LayerElement *element, Layer *layer, Sta DrawWholeRest ( dc, xCentered, y, DUR_1, 0, false, staff ); dc->EndGraphic(element, this); - - return; - } /** This function draws multi-measure rests **/ @@ -725,9 +715,6 @@ void View::DrawMultiRest(DeviceContext *dc, LayerElement *element, Layer *layer, dc->ResetFont(); dc->EndGraphic(element, this); - - return; - } void View::DrawBeatRpt(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure) @@ -778,38 +765,74 @@ void View::DrawMRpt(DeviceContext *dc, LayerElement *element, Layer *layer, Staf dc->StartGraphic( element, "", element->GetUuid() ); - int x = element->GetDrawingX(); + DrawMRptPart(dc, element->GetDrawingX(), SMUFL_E500_repeat1Bar, mRpt->m_drawingMeasureCount, false, staff, measure ); + + dc->EndGraphic(element, this); +} + +void View::DrawMRpt2(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure) +{ + assert( dc ); + assert( element ); + assert( layer ); + assert( staff ); + assert( measure ); + + MRpt2 *mRpt2 = dynamic_cast(element); + assert( mRpt2 ); + + dc->StartGraphic( element, "", element->GetUuid() ); + + DrawMRptPart(dc, element->GetDrawingX(), SMUFL_E501_repeat2Bars, 2, true, staff, measure ); + + dc->EndGraphic(element, this); +} + +void View::DrawMultiRpt(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure) +{ + assert( dc ); + assert( element ); + assert( layer ); + assert( staff ); + assert( measure ); + + MultiRpt *multiRpt = dynamic_cast(element); + assert( multiRpt ); + + dc->StartGraphic( element, "", element->GetUuid() ); + + DrawMRptPart(dc, element->GetDrawingX(), SMUFL_E501_repeat2Bars, multiRpt->GetNum(), true, staff, measure ); + + dc->EndGraphic(element, this); + + return; +} + +void View::DrawMRptPart(DeviceContext *dc, int x, wchar_t smuflCode, int num, bool line, Staff *staff, Measure *measure ) +{ int xCentered = x + (measure->GetDrawingX() + measure->GetRightBarlineX() - x) / 2; - int xSymbol = xCentered - m_doc->GetGlyphWidth(SMUFL_E500_repeat1Bar, staff->m_drawingStaffSize, false) / 2; - int y = element->GetDrawingY(); - y -= staff->m_drawingLines / 2 * m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); + int xSymbol = xCentered - m_doc->GetGlyphWidth(smuflCode, staff->m_drawingStaffSize, false) / 2; + int y = staff->GetDrawingY(); + int ySymbol = y - staff->m_drawingLines / 2 * m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); - DrawSmuflCode( dc, xSymbol, y, SMUFL_E500_repeat1Bar, staff->m_drawingStaffSize, false ); + DrawSmuflCode( dc, xSymbol, ySymbol, smuflCode, staff->m_drawingStaffSize, false ); + + if (line) { + DrawVerticalLine( dc, y, y - m_doc->GetDrawingStaffSize(staff->m_drawingStaffSize), + xCentered, m_doc->GetDrawingBarLineWidth(staff->m_drawingStaffSize)); + } - if (mRpt->m_drawingMeasureCount > 0) { + if (num > 0) { dc->SetFont( m_doc->GetDrawingSmuflFont( staff->m_drawingStaffSize, false) ); // calculate the width of the figures int txt_length = 0; int txt_height = 0; - std::wstring figures = IntToTupletFigures(mRpt->m_drawingMeasureCount); + std::wstring figures = IntToTupletFigures(num); dc->GetSmuflTextExtent(figures, &txt_length, &txt_height); dc->DrawMusicText( figures, ToDeviceContextX(xCentered - txt_length / 2), ToDeviceContextY(staff->GetDrawingY() + m_doc->GetDrawingUnit(staff->m_drawingStaffSize)) ); dc->ResetFont(); } - - dc->EndGraphic(element, this); - - return; - -} - -void View::DrawMRpt2(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure) -{ -} - -void View::DrawMultiRpt(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure) -{ } void View::DrawLongRest ( DeviceContext *dc, int x, int y, Staff *staff) @@ -826,7 +849,6 @@ void View::DrawLongRest ( DeviceContext *dc, int x, int y, Staff *staff) y2 = y1 + m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize)*2; DrawFullRectangle( dc, x1, y2, x2, y1); - return; } @@ -850,7 +872,6 @@ void View::DrawBreveRest ( DeviceContext *dc, int x, int y, Staff *staff) DrawHorizontalLine ( dc, x1, x2, y2, 1); DrawHorizontalLine ( dc, x1, x2, y1, 1); - return; } void View::DrawWholeRest ( DeviceContext *dc, int x, int y, int valeur, unsigned char dots, bool cueSize, Staff *staff) @@ -887,8 +908,9 @@ void View::DrawWholeRest ( DeviceContext *dc, int x, int y, int valeur, unsigned if (y > (int)staff->GetDrawingY() || y < staff->GetDrawingY() - m_doc->GetDrawingStaffSize(staff->m_drawingStaffSize)) DrawHorizontalLine ( dc, x1, x2, y1, m_doc->GetDrawingStaffLineWidth(staff->m_drawingStaffSize)); - if (dots) + if (dots) { DrawDots( dc, (x2 + m_doc->GetDrawingUnit(staff->m_drawingStaffSize)), y2, dots, staff); + } } @@ -898,11 +920,9 @@ void View::DrawQuarterRest ( DeviceContext *dc, int x, int y, int valeur, unsign DrawSmuflCode( dc, x, y2, SMUFL_E4E5_restQuarter + (valeur-DUR_4), staff->m_drawingStaffSize, cueSize ); if (dots) - { if (valeur < DUR_16) - y += m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); + { if (valeur < DUR_16) y += m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); DrawDots( dc, (x + 2 * m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize)), y, dots, staff); } - return; } bool View::IsOnStaffLine ( int y, Staff *staff) @@ -948,7 +968,6 @@ void View::PrepareChordDots ( DeviceContext *dc, Chord *chord, int x, int y, uns //if it's not, add it to the dots list and go back to DrawChord dotsList->push_back(y); - return; } void View::DrawDots ( DeviceContext *dc, int x, int y, unsigned char dots, Staff *staff) @@ -961,7 +980,6 @@ void View::DrawDots ( DeviceContext *dc, int x, int y, unsigned char dots, Staff DrawDot ( dc, x, y, staff->m_drawingStaffSize ); x += std::max (6, 2 * m_doc->GetDrawingUnit(staff->m_drawingStaffSize)); } - return; } void View::DrawBarline( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ) @@ -1316,8 +1334,6 @@ void View::DrawMeterSigFigures( DeviceContext *dc, int x, int y, int num, int nu } dc->ResetFont(); - - return; } void View::DrawMeterSig( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ) @@ -1350,7 +1366,6 @@ void View::DrawMeterSig( DeviceContext *dc, LayerElement *element, Layer *layer, } dc->EndGraphic(element, this ); - } bool View::CalculateAccidX(Staff *staff, Accid *accid, Chord *chord, bool adjustHorizontally) @@ -1654,7 +1669,6 @@ void View::DrawCustos( DeviceContext *dc, LayerElement *element, Layer *layer, S DrawSmuflCode( dc, x, y, 35, staff->m_drawingStaffSize, false ); dc->EndGraphic(element, this ); - } void View::DrawDot( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ) @@ -1684,7 +1698,6 @@ void View::DrawDot( DeviceContext *dc, LayerElement *element, Layer *layer, Staf DrawDots( dc, x, y, 1, staff ); dc->EndGraphic(element, this ); - } @@ -1779,7 +1792,6 @@ void View::DrawSyl( DeviceContext *dc, LayerElement *element, Layer *layer, Staf } dc->EndGraphic(syl, this ); - } void View::DrawVerse( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ) @@ -1856,7 +1868,6 @@ void View::DrawKeySig( DeviceContext *dc, LayerElement *element, Layer *layer, S } dc->EndGraphic(element, this ); - } void View::DrawAcciaccaturaSlash(DeviceContext *dc, LayerElement *element) From 9af69073d4e0e89767b3174697d985f5fa1472e9 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Mon, 31 Aug 2015 08:20:04 +0200 Subject: [PATCH 095/114] Adjusting spacing --- include/vrv/style.h | 20 ++++++++++++++++++++ src/doc.cpp | 4 ++++ src/style.cpp | 4 ++++ 3 files changed, 28 insertions(+) diff --git a/include/vrv/style.h b/include/vrv/style.h index b967c9008f0..a4b10aa33d4 100644 --- a/include/vrv/style.h +++ b/include/vrv/style.h @@ -104,6 +104,14 @@ namespace vrv { #define MIN_LEFT_MARGIN_MREST -10.0 #define MAX_LEFT_MARGIN_MREST 10.0 +#define DEFAULT_LEFT_MARGIN_MRPT2 6.0 +#define MIN_LEFT_MARGIN_MRPT2 -10.0 +#define MAX_LEFT_MARGIN_MRPT2 10.0 + +#define DEFAULT_LEFT_MARGIN_MULTIRPT 6.0 +#define MIN_LEFT_MARGIN_MULTIRPT -10.0 +#define MAX_LEFT_MARGIN_MULTIRPT 10.0 + #define DEFAULT_LEFT_MARGIN_NOTE 1.0 #define MIN_LEFT_MARGIN_NOTE -10.0 #define MAX_LEFT_MARGIN_NOTE 10.0 @@ -146,10 +154,18 @@ namespace vrv { #define MIN_RIGHT_MARGIN_MREST 0.0 #define MAX_RIGHT_MARGIN_MREST 10.0 +#define DEFAULT_RIGHT_MARGIN_MRPT2 6.0 +#define MIN_RIGHT_MARGIN_MRPT2 -10.0 +#define MAX_RIGHT_MARGIN_MRPT2 10.0 + #define DEFAULT_RIGHT_MARGIN_MULTIREST 0.5 #define MIN_RIGHT_MARGIN_MULTIREST 0.0 #define MAX_RIGHT_MARGIN_MULTIREST 10.0 +#define DEFAULT_RIGHT_MARGIN_MULTIRPT 6.0 +#define MIN_RIGHT_MARGIN_MULTIRPT -10.0 +#define MAX_RIGHT_MARGIN_MULTIRPT 10.0 + #define DEFAULT_RIGHT_MARGIN_DEFAULT 1.0 #define MIN_RIGHT_MARGIN_DEFAULT 0.0 #define MAX_RIGHT_MARGIN_DEFAULT 10.0 @@ -223,6 +239,8 @@ class Style char m_leftMarginChord; char m_leftMarginClef; char m_leftMarginMRest; + char m_leftMarginMRpt2; + char m_leftMarginMultiRpt; char m_leftMarginNote; /** The default left margin */ char m_leftMarginDefault; @@ -236,7 +254,9 @@ class Style char m_rightMarginMensur; char m_rightMarginMeterSig; char m_rightMarginMRest; + char m_rightMarginMRpt2; char m_rightMarginMultiRest; + char m_rightMarginMultiRpt; /** The default right margin */ char m_rightMarginDefault; diff --git a/src/doc.cpp b/src/doc.cpp index 07bada8eebd..21a011effa8 100644 --- a/src/doc.cpp +++ b/src/doc.cpp @@ -538,6 +538,8 @@ char Doc::GetLeftMargin( const ClassId classId ) else if (classId == CLEF) return m_style->m_leftMarginClef; else if (classId == MREST) return m_style->m_leftMarginMRest; else if (classId == MRPT) return m_style->m_leftMarginMRest; + else if (classId == MRPT2) return m_style->m_leftMarginMRpt2; + else if (classId == MULTI_RPT) return m_style->m_leftMarginMultiRpt; else if (classId == NOTE) return m_style->m_leftMarginNote; return m_style->m_leftMarginDefault; } @@ -553,7 +555,9 @@ char Doc::GetRightMargin( const ClassId classId ) else if (classId == METER_SIG) return m_style->m_rightMarginMeterSig; else if (classId == MREST) return m_style->m_rightMarginMRest; else if (classId == MRPT) return m_style->m_rightMarginMRest; + else if (classId == MRPT2) return m_style->m_rightMarginMRpt2; else if (classId == MULTI_REST) return m_style->m_rightMarginMultiRest; + else if (classId == MULTI_RPT) return m_style->m_rightMarginMultiRpt; return m_style->m_rightMarginDefault; } diff --git a/src/style.cpp b/src/style.cpp index 264f905f394..e581e697274 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -60,7 +60,9 @@ Style::Style() m_rightMarginMensur = DEFAULT_RIGHT_MARGIN_MENSUR * DEFINITON_FACTOR; m_rightMarginMeterSig = DEFAULT_RIGHT_MARGIN_METERSIG * DEFINITON_FACTOR; m_rightMarginMRest = DEFAULT_RIGHT_MARGIN_MREST * DEFINITON_FACTOR; + m_rightMarginMRpt2 = DEFAULT_RIGHT_MARGIN_MRPT2 * DEFINITON_FACTOR; m_rightMarginMultiRest = DEFAULT_RIGHT_MARGIN_MULTIREST * DEFINITON_FACTOR; + m_rightMarginMultiRpt = DEFAULT_RIGHT_MARGIN_MULTIRPT * DEFINITON_FACTOR; /** The default right margin */ m_rightMarginDefault = DEFAULT_RIGHT_MARGIN_DEFAULT * DEFINITON_FACTOR; @@ -71,6 +73,8 @@ Style::Style() m_leftMarginChord = DEFAULT_LEFT_MARGIN_CHORD * DEFINITON_FACTOR; m_leftMarginClef = DEFAULT_LEFT_MARGIN_CLEF * DEFINITON_FACTOR; m_leftMarginMRest = DEFAULT_LEFT_MARGIN_MREST * DEFINITON_FACTOR; + m_leftMarginMRpt2 = DEFAULT_LEFT_MARGIN_MRPT2 * DEFINITON_FACTOR; + m_leftMarginMultiRpt = DEFAULT_LEFT_MARGIN_MULTIRPT * DEFINITON_FACTOR; m_leftMarginNote = DEFAULT_LEFT_MARGIN_NOTE * DEFINITON_FACTOR; /** The default left margin */ m_leftMarginDefault = DEFAULT_LEFT_MARGIN_DEFAULT * DEFINITON_FACTOR; From fb76b5bb4a8b1e8215ef3b06abbeaa362f42b8aa Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Mon, 31 Aug 2015 21:26:42 +0200 Subject: [PATCH 096/114] Setting hardcoded parameter for alignment calculation to non mensural This needs to be changed as a global parameter --- src/aligner.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/aligner.cpp b/src/aligner.cpp index be5055b986e..4110640eb25 100644 --- a/src/aligner.cpp +++ b/src/aligner.cpp @@ -441,10 +441,12 @@ between symbols. */ int Alignment::HorizontalSpaceForDuration(double intervalTime, bool isMensural) { int intervalXRel = 0; - if (isMensural) + if (isMensural) { intervalXRel = 20; // ??EXPERIMENTAL! A very small value => space as tightly as possible - else + } + else { intervalXRel = pow( intervalTime, 0.60 ) * 2.5; // 2.5 is an arbitrary value; so is 0.60 + } return intervalXRel; } @@ -460,7 +462,8 @@ int Alignment::SetAligmentXPos( ArrayPtrVoid *params ) int intervalXRel = 0; double intervalTime = (m_time - (*previousTime)); - if ( intervalTime > 0.0 ) intervalXRel = HorizontalSpaceForDuration(intervalTime, true); // ??2ND PARAM = IS MENSURAL! + // HARDCODED parameter for HorizontalSpaceForDuration + if ( intervalTime > 0.0 ) intervalXRel = HorizontalSpaceForDuration(intervalTime, false); m_xRel = (*previousXRel) + (intervalXRel) * DEFINITON_FACTOR; (*previousTime) = m_time; From 4024fb346e68731f4806aeba84ab08b4d7cda07c Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Wed, 2 Sep 2015 08:33:08 +0200 Subject: [PATCH 097/114] Fixing measure calculation with with scoreDef change --- src/aligner.cpp | 12 ++++++++---- src/object.cpp | 8 +++++--- src/view_element.cpp | 10 +++++----- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/aligner.cpp b/src/aligner.cpp index 4110640eb25..f9d670f6eef 100644 --- a/src/aligner.cpp +++ b/src/aligner.cpp @@ -401,12 +401,16 @@ int Alignment::IntegrateBoundingBoxXShift( ArrayPtrVoid *params ) m_xRel += m_xShift + (*shift); // cumulate the shift value and the width (*shift) += m_xShift; - - if ((GetType() > ALIGNMENT_METERSIG_ATTR) && ((*justifiable_shift) < 0)) { + + if ((GetType() <= ALIGNMENT_METERSIG_ATTR) && ((*justifiable_shift) < 0)) { + MeasureAligner *aligner = dynamic_cast(m_parent); + assert( aligner ); + aligner->SetNonJustifiableMargin(this->m_xRel + this->m_maxWidth); + } + else if ((GetType() > ALIGNMENT_METERSIG_ATTR) && ((*justifiable_shift) < 0)) { MeasureAligner *aligner = dynamic_cast(m_parent); assert( aligner ); - aligner->SetNonJustifiableMargin(m_xRel); - (*justifiable_shift) = m_xRel; + (*justifiable_shift) = aligner->GetNonJustifiableMargin(); } // reset member to 0 diff --git a/src/object.cpp b/src/object.cpp index b727aea9aa4..aed10794ad0 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -1176,15 +1176,17 @@ int Object::SetBoundingBoxXShift( ArrayPtrVoid *params ) // this should never happen (but can with glyphs not exactly registered at position x=0 in the SMuFL font used if ( negative_offset < 0 ) negative_offset = 0; + if ((current->Is() == MREST) || (current->Is() == MRPT) || (this->Is() == MRPT2) || (this->Is() == MULTI_RPT)) { - // With MRest, MRpt, etc., the only thing we want to do it keep their with as possible measure with (if only MRest in all staves/layers) + // With MRest, MRpt, etc., the only thing we want to do is to keep their with as possible measure with (if only MRest in all staves/layers) int width = current->m_contentBB_x2 + doc->GetRightMargin( current->Is() ) * doc->GetDrawingUnit(100) / PARAM_DENOMINATOR + negative_offset ; // Keep it if more than the current measure width - (*measure_width) = std::max( (*measure_width), width ); - (*min_pos) = 0; + (*measure_width) = std::max( (*measure_width), (*min_pos) + width ); return FUNCTOR_CONTINUE; } + + // with a grace note, also take into account the full with of the group given by the GraceAligner if (current->GetAlignment()->HasGraceAligner()) { negative_offset += current->GetAlignment()->GetGraceAligner()->GetWidth(); diff --git a/src/view_element.cpp b/src/view_element.cpp index 39a94df76cd..686b3e910b3 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -642,10 +642,8 @@ void View::DrawMRest(DeviceContext *dc, LayerElement *element, Layer *layer, Sta dc->StartGraphic( element, "", element->GetUuid() ); - //LogMessage("Measure %d - X %d - RightX %d;", measure->GetIdx(), element->m_drawingX, measure->GetRightBarlineX() ); - - int x = element->GetDrawingX(); - int xCentered = x + (measure->GetDrawingX() + measure->GetRightBarlineX() - x) / 2; + int width = measure->GetRightBarlineX() - measure->GetNonJustifiableLeftMargin(); + int xCentered = measure->GetDrawingX() + measure->GetNonJustifiableLeftMargin() + (width / 2); int y = element->GetDrawingY(); // move it down according to the number of line in the staff @@ -810,7 +808,9 @@ void View::DrawMultiRpt(DeviceContext *dc, LayerElement *element, Layer *layer, void View::DrawMRptPart(DeviceContext *dc, int x, wchar_t smuflCode, int num, bool line, Staff *staff, Measure *measure ) { - int xCentered = x + (measure->GetDrawingX() + measure->GetRightBarlineX() - x) / 2; + int width = measure->GetRightBarlineX() - measure->GetNonJustifiableLeftMargin(); + int xCentered = measure->GetDrawingX() + measure->GetNonJustifiableLeftMargin() + (width / 2); + int xSymbol = xCentered - m_doc->GetGlyphWidth(smuflCode, staff->m_drawingStaffSize, false) / 2; int y = staff->GetDrawingY(); int ySymbol = y - staff->m_drawingLines / 2 * m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); From 930676dd2c89fbb89925e14daac2507f78d17029 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Wed, 2 Sep 2015 14:03:43 +0200 Subject: [PATCH 098/114] Improving spacing --- include/vrv/doc.h | 1 + include/vrv/measure.h | 5 ++ include/vrv/style.h | 124 +++++++++++++++--------------------------- src/doc.cpp | 18 +++++- src/object.cpp | 12 ++-- src/style.cpp | 37 ++++++++----- 6 files changed, 93 insertions(+), 104 deletions(-) diff --git a/include/vrv/doc.h b/include/vrv/doc.h index 1b7bec84790..ed9629a79b1 100644 --- a/include/vrv/doc.h +++ b/include/vrv/doc.h @@ -127,6 +127,7 @@ class Doc: public Object ///@{ char GetLeftMargin( const ClassId classId ); char GetRightMargin( const ClassId classId ); + char GetLeftPosition( ); ///@} /* diff --git a/include/vrv/measure.h b/include/vrv/measure.h index 8ff0ea5b7ff..509d49becfa 100644 --- a/include/vrv/measure.h +++ b/include/vrv/measure.h @@ -92,6 +92,11 @@ class Measure: public DocObject, ///@} int GetXRel( ); + + /** + * Return the non justifiable with for the measure + */ + int GetNonJustifiableLeftMargin() { return m_measureAligner.GetNonJustifiableMargin(); } /** * Return the X rel position of the right barLine (without its width) diff --git a/include/vrv/style.h b/include/vrv/style.h index a4b10aa33d4..a0f1f5f7190 100644 --- a/include/vrv/style.h +++ b/include/vrv/style.h @@ -74,101 +74,54 @@ namespace vrv { #define MIN_LYRIC_SIZE 2.0 #define MAX_LYRIC_SIZE 8.0 -#define DEFAULT_MEASURE_WIDTH 3.0 +#define DEFAULT_MEASURE_WIDTH 8.0 #define MIN_MEASURE_WIDTH 1.0 #define MAX_MEASURE_WIDTH 30.0 -/** Left margins */ +/** The default position at the beginning of a measure */ +#define DEFAULT_LEFT_POSITION 1.3 -#define DEFAULT_LEFT_MARGIN_BARLINE 0.5 -#define MIN_LEFT_MARGIN_BARLINE -10.0 -#define MAX_LEFT_MARGIN_BARLINE 10.0 +/** Left margins */ -#define DEFAULT_LEFT_MARGIN_BARLINE_ATTR 2.5 -#define MIN_LEFT_MARGIN_BARLINE_ATTR -10.0 -#define MAX_LEFT_MARGIN_BARLINE_ATTR 10.0 +#define DEFAULT_LEFT_MARGIN_DEFAULT 0.0 +#define MIN_LEFT_MARGIN_DEFAULT -10.0 +#define MAX_LEFT_MARGIN_DEFAULT 10.0 +#define DEFAULT_LEFT_MARGIN_BARLINE DEFAULT_LEFT_MARGIN_DEFAULT +#define DEFAULT_LEFT_MARGIN_BARLINE_ATTR 2.0 #define DEFAULT_LEFT_MARGIN_BEATRPT 2.0 -#define MIN_LEFT_MARGIN_BEATRPT -10.0 -#define MAX_LEFT_MARGIN_BEATRPTD 10.0 - #define DEFAULT_LEFT_MARGIN_CHORD 1.0 -#define MIN_LEFT_MARGIN_CHORD -10.0 -#define MAX_LEFT_MARGIN_CHORD 10.0 - -#define DEFAULT_LEFT_MARGIN_CLEF -2.0 -#define MIN_LEFT_MARGIN_CLEF -10.0 -#define MAX_LEFT_MARGIN_CLEF 10.0 - -#define DEFAULT_LEFT_MARGIN_MREST 3.0 -#define MIN_LEFT_MARGIN_MREST -10.0 -#define MAX_LEFT_MARGIN_MREST 10.0 - -#define DEFAULT_LEFT_MARGIN_MRPT2 6.0 -#define MIN_LEFT_MARGIN_MRPT2 -10.0 -#define MAX_LEFT_MARGIN_MRPT2 10.0 - -#define DEFAULT_LEFT_MARGIN_MULTIRPT 6.0 -#define MIN_LEFT_MARGIN_MULTIRPT -10.0 -#define MAX_LEFT_MARGIN_MULTIRPT 10.0 - +#define DEFAULT_LEFT_MARGIN_CLEF DEFAULT_LEFT_MARGIN_DEFAULT +#define DEFAULT_LEFT_MARGIN_KEYSIG DEFAULT_LEFT_MARGIN_DEFAULT +#define DEFAULT_LEFT_MARGIN_MENSUR DEFAULT_LEFT_MARGIN_DEFAULT +#define DEFAULT_LEFT_MARGIN_METERSIG DEFAULT_LEFT_MARGIN_DEFAULT +#define DEFAULT_LEFT_MARGIN_MREST DEFAULT_LEFT_MARGIN_DEFAULT +#define DEFAULT_LEFT_MARGIN_MRPT2 DEFAULT_LEFT_MARGIN_DEFAULT +#define DEFAULT_LEFT_MARGIN_MULTIREST DEFAULT_LEFT_MARGIN_DEFAULT +#define DEFAULT_LEFT_MARGIN_MULTIRPT DEFAULT_LEFT_MARGIN_DEFAULT #define DEFAULT_LEFT_MARGIN_NOTE 1.0 -#define MIN_LEFT_MARGIN_NOTE -10.0 -#define MAX_LEFT_MARGIN_NOTE 10.0 - -#define DEFAULT_LEFT_MARGIN_DEFAULT 0.0 -#define MIN_LEFT_MARGIN_DEFAULT -10.0 -#define MAX_LEFT_MARGIN_DEFAULT 10.0 +#define DEFAULT_LEFT_MARGIN_REST 1.0 /** Right margins */ + +#define DEFAULT_RIGHT_MARGIN_DEFAULT 1.0 +#define MIN_RIGHT_MARGIN_DEFAULT 0.0 +#define MAX_RIGHT_MARGIN_DEFAULT 10.0 -#define DEFAULT_RIGHT_MARGIN_BARLINE 3.0 -#define MIN_RIGHT_MARGIN_BARLINE 0.0 -#define MAX_RIGHT_MARGIN_BARLINE 10.0 - +#define DEFAULT_RIGHT_MARGIN_BARLINE 2.0 #define DEFAULT_RIGHT_MARGIN_BARLINE_ATTR 0.0 -#define MIN_RIGHT_MARGIN_BARLINE_ATTR 0.0 -#define MAX_RIGHT_MARGIN_BARLINE_ATTR 10.0 - -#define DEFAULT_RIGHT_MARGIN_BEATRPT 2.0 -#define MIN_RIGHT_MARGIN_BEATRPT 0.0 -#define MAX_RIGHT_MARGIN_BEATRPT 10.0 - +#define DEFAULT_RIGHT_MARGIN_BEATRPT DEFAULT_RIGHT_MARGIN_DEFAULT +#define DEFAULT_RIGHT_MARGIN_CHORD 0.0 #define DEFAULT_RIGHT_MARGIN_CLEF 2.0 -#define MIN_RIGHT_MARGIN_CLEF 0.0 -#define MAX_RIGHT_MARGIN_CLEF 10.0 - #define DEFAULT_RIGHT_MARGIN_KEYSIG 2.5 -#define MIN_RIGHT_MARGIN_KEYSIG 0.0 -#define MAX_RIGHT_MARGIN_KEYSIG 10.0 - -#define DEFAULT_RIGHT_MARGIN_MENSUR 3.0 -#define MIN_RIGHT_MARGIN_MENSUR 0.0 -#define MAX_RIGHT_MARGIN_MENSUR 10.0 - -#define DEFAULT_RIGHT_MARGIN_METERSIG 3.0 -#define MIN_RIGHT_MARGIN_METERSIG 0.0 -#define MAX_RIGHT_MARGIN_METERSIG 10.0 - -#define DEFAULT_RIGHT_MARGIN_MREST 3.0 -#define MIN_RIGHT_MARGIN_MREST 0.0 -#define MAX_RIGHT_MARGIN_MREST 10.0 - -#define DEFAULT_RIGHT_MARGIN_MRPT2 6.0 -#define MIN_RIGHT_MARGIN_MRPT2 -10.0 -#define MAX_RIGHT_MARGIN_MRPT2 10.0 - -#define DEFAULT_RIGHT_MARGIN_MULTIREST 0.5 -#define MIN_RIGHT_MARGIN_MULTIREST 0.0 -#define MAX_RIGHT_MARGIN_MULTIREST 10.0 - -#define DEFAULT_RIGHT_MARGIN_MULTIRPT 6.0 -#define MIN_RIGHT_MARGIN_MULTIRPT -10.0 -#define MAX_RIGHT_MARGIN_MULTIRPT 10.0 - -#define DEFAULT_RIGHT_MARGIN_DEFAULT 1.0 -#define MIN_RIGHT_MARGIN_DEFAULT 0.0 -#define MAX_RIGHT_MARGIN_DEFAULT 10.0 +#define DEFAULT_RIGHT_MARGIN_MENSUR 2.5 +#define DEFAULT_RIGHT_MARGIN_METERSIG 2.0 +#define DEFAULT_RIGHT_MARGIN_MREST DEFAULT_RIGHT_MARGIN_DEFAULT +#define DEFAULT_RIGHT_MARGIN_MRPT2 8.0 +#define DEFAULT_RIGHT_MARGIN_MULTIREST DEFAULT_RIGHT_MARGIN_DEFAULT //0.5 +#define DEFAULT_RIGHT_MARGIN_MULTIRPT 8.0 +#define DEFAULT_RIGHT_MARGIN_NOTE 0.0 +#define DEFAULT_RIGHT_MARGIN_REST 0.0 //---------------------------------------------------------------------------- // Style @@ -232,16 +185,24 @@ class Style /** The lyrics size (in units / PARAM_DENOMINATOR) */ int m_lyricSize; + /** The left position */ + char m_leftPosition; + /** The layout left margin by element */ char m_leftMarginBarline; char m_leftMarginBarlineAttr; char m_leftMarginBeatRpt; char m_leftMarginChord; char m_leftMarginClef; + char m_leftMarginKeySig; + char m_leftMarginMensur; + char m_leftMarginMeterSig; char m_leftMarginMRest; char m_leftMarginMRpt2; + char m_leftMarginMultiRest; char m_leftMarginMultiRpt; char m_leftMarginNote; + char m_leftMarginRest; /** The default left margin */ char m_leftMarginDefault; @@ -249,6 +210,7 @@ class Style char m_rightMarginBarline; char m_rightMarginBarlineAttr; char m_rightMarginBeatRpt; + char m_rightMarginChord; char m_rightMarginClef; char m_rightMarginKeySig; char m_rightMarginMensur; @@ -257,6 +219,8 @@ class Style char m_rightMarginMRpt2; char m_rightMarginMultiRest; char m_rightMarginMultiRpt; + char m_rightMarginNote; + char m_rightMarginRest; /** The default right margin */ char m_rightMarginDefault; diff --git a/src/doc.cpp b/src/doc.cpp index 21a011effa8..7a50fb6200b 100644 --- a/src/doc.cpp +++ b/src/doc.cpp @@ -523,7 +523,8 @@ FontInfo *Doc::GetDrawingSmuflFont( int staffSize, bool graceSize ) m_drawingSmuflFont.SetPointSize( value ); return &m_drawingSmuflFont; } - FontInfo *Doc::GetDrawingLyricFont( int staffSize ) + +FontInfo *Doc::GetDrawingLyricFont( int staffSize ) { m_drawingLyricFont.SetPointSize( m_drawingLyricFontSize * staffSize / 100 ); return &m_drawingLyricFont; @@ -536,11 +537,15 @@ char Doc::GetLeftMargin( const ClassId classId ) else if (classId == BEAT_RPT) return m_style->m_leftMarginBeatRpt; else if (classId == CHORD) return m_style->m_leftMarginChord; else if (classId == CLEF) return m_style->m_leftMarginClef; + else if (classId == KEY_SIG) return m_style->m_leftMarginKeySig; + else if (classId == MENSUR) return m_style->m_leftMarginMensur; + else if (classId == METER_SIG) return m_style->m_leftMarginMeterSig; else if (classId == MREST) return m_style->m_leftMarginMRest; - else if (classId == MRPT) return m_style->m_leftMarginMRest; else if (classId == MRPT2) return m_style->m_leftMarginMRpt2; + else if (classId == MULTI_REST) return m_style->m_leftMarginMultiRest; else if (classId == MULTI_RPT) return m_style->m_leftMarginMultiRpt; else if (classId == NOTE) return m_style->m_leftMarginNote; + else if (classId == REST) return m_style->m_leftMarginRest; return m_style->m_leftMarginDefault; } @@ -549,17 +554,24 @@ char Doc::GetRightMargin( const ClassId classId ) if (classId == BAR_LINE) return m_style->m_rightMarginBarline; else if (classId == BAR_LINE_ATTR) return m_style->m_rightMarginBarlineAttr; else if (classId == BEAT_RPT) return m_style->m_rightMarginBeatRpt; + else if (classId == CHORD) return m_style->m_rightMarginChord; else if (classId == CLEF) return m_style->m_rightMarginClef; else if (classId == KEY_SIG) return m_style->m_rightMarginKeySig; else if (classId == MENSUR) return m_style->m_rightMarginMensur; else if (classId == METER_SIG) return m_style->m_rightMarginMeterSig; else if (classId == MREST) return m_style->m_rightMarginMRest; - else if (classId == MRPT) return m_style->m_rightMarginMRest; else if (classId == MRPT2) return m_style->m_rightMarginMRpt2; else if (classId == MULTI_REST) return m_style->m_rightMarginMultiRest; else if (classId == MULTI_RPT) return m_style->m_rightMarginMultiRpt; + else if (classId == NOTE) return m_style->m_rightMarginNote; + else if (classId == REST) return m_style->m_rightMarginRest; return m_style->m_rightMarginDefault; } + +char Doc::GetLeftPosition( ) +{ + return m_style->m_leftPosition; +} void Doc:: SetPageHeight( int pageHeight ) { diff --git a/src/object.cpp b/src/object.cpp index aed10794ad0..333662afdeb 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -1058,8 +1058,8 @@ int Object::SetBoundingBoxGraceXShift( ArrayPtrVoid *params ) // the negative offset it the part of the bounding box that overflows on the left // |____x_____| // ---- = negative offset - //int negative_offset = - (note->m_contentBB_x1) + (doc->GetLeftMargin(&typeid(*note)) * doc->GetDrawingUnit(100) / PARAM_DENOMINATOR); - int negative_offset = - note->m_contentBB_x1; + int negative_offset = - (note->m_contentBB_x1) + (doc->GetLeftMargin(NOTE) * doc->GetDrawingUnit(100) / PARAM_DENOMINATOR); + if ( (*min_pos) > 0 ) { //(*min_pos) += (doc->GetLeftMargin(&typeid(*note)) * doc->GetDrawingUnit(100) / PARAM_DENOMINATOR); } @@ -1075,7 +1075,7 @@ int Object::SetBoundingBoxGraceXShift( ArrayPtrVoid *params ) } // the next minimal position if given by the right side of the bounding box + the spacing of the element - (*min_pos) = note->GetGraceAlignment()->GetXRel() + note->m_contentBB_x2 + doc->GetRightMargin( NOTE ) * doc->GetDrawingUnit(100) / PARAM_DENOMINATOR; + (*min_pos) = note->GetGraceAlignment()->GetXRel() + note->m_contentBB_x2 + doc->GetRightMargin(NOTE) * doc->GetDrawingUnit(100) / PARAM_DENOMINATOR; //(*min_pos) = note->GetGraceAlignment()->GetXRel() + note->m_contentBB_x2; //note->GetGraceAlignment()->SetMaxWidth( note->m_contentBB_x2 + doc->GetRightMargin(&typeid(*note)) * doc->GetDrawingUnit(100) / PARAM_DENOMINATOR ); note->GetGraceAlignment()->SetMaxWidth( note->m_contentBB_x2 ); @@ -1110,8 +1110,7 @@ int Object::SetBoundingBoxXShift( ArrayPtrVoid *params ) if (this->Is() == LAYER) { Layer *current_layer = dynamic_cast(this); assert( current_layer ); - // reset it as the minimum position to the step (HARDCODED) - (*min_pos) = 30 * doc->GetDrawingUnit(100) / 10; + (*min_pos) = doc->GetLeftPosition() * doc->GetDrawingUnit(100) / PARAM_DENOMINATOR; // set scoreDef attr if (current_layer->GetDrawingClef()) { current_layer->GetDrawingClef()->SetBoundingBoxXShift( params ); @@ -1176,7 +1175,6 @@ int Object::SetBoundingBoxXShift( ArrayPtrVoid *params ) // this should never happen (but can with glyphs not exactly registered at position x=0 in the SMuFL font used if ( negative_offset < 0 ) negative_offset = 0; - if ((current->Is() == MREST) || (current->Is() == MRPT) || (this->Is() == MRPT2) || (this->Is() == MULTI_RPT)) { // With MRest, MRpt, etc., the only thing we want to do is to keep their with as possible measure with (if only MRest in all staves/layers) int width = current->m_contentBB_x2 + doc->GetRightMargin( current->Is() ) * doc->GetDrawingUnit(100) / PARAM_DENOMINATOR + negative_offset ; @@ -1185,8 +1183,6 @@ int Object::SetBoundingBoxXShift( ArrayPtrVoid *params ) return FUNCTOR_CONTINUE; } - - // with a grace note, also take into account the full with of the group given by the GraceAligner if (current->GetAlignment()->HasGraceAligner()) { negative_offset += current->GetAlignment()->GetGraceAligner()->GetWidth(); diff --git a/src/style.cpp b/src/style.cpp index e581e697274..85051cafbfd 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -51,10 +51,32 @@ Style::Style() m_minMeasureWidth = (short)(DEFAULT_MEASURE_WIDTH * PARAM_DENOMINATOR); + /** The left spacing */ + m_leftPosition = DEFAULT_LEFT_POSITION * DEFINITON_FACTOR; + + /** The layout left margin by element */ + m_leftMarginBarline = DEFAULT_LEFT_MARGIN_BARLINE * DEFINITON_FACTOR; + m_leftMarginBarlineAttr = DEFAULT_LEFT_MARGIN_BARLINE_ATTR * DEFINITON_FACTOR; + m_leftMarginBeatRpt = DEFAULT_LEFT_MARGIN_BEATRPT * DEFINITON_FACTOR; + m_leftMarginChord = DEFAULT_LEFT_MARGIN_CHORD * DEFINITON_FACTOR; + m_leftMarginClef = DEFAULT_LEFT_MARGIN_CLEF * DEFINITON_FACTOR; + m_leftMarginKeySig = DEFAULT_LEFT_MARGIN_KEYSIG * DEFINITON_FACTOR; + m_leftMarginMensur = DEFAULT_LEFT_MARGIN_MENSUR * DEFINITON_FACTOR; + m_leftMarginMeterSig = DEFAULT_LEFT_MARGIN_METERSIG * DEFINITON_FACTOR; + m_leftMarginMRest = DEFAULT_LEFT_MARGIN_MREST * DEFINITON_FACTOR; + m_leftMarginMRpt2 = DEFAULT_LEFT_MARGIN_MRPT2 * DEFINITON_FACTOR; + m_leftMarginMultiRest = DEFAULT_LEFT_MARGIN_MULTIREST * DEFINITON_FACTOR; + m_leftMarginMultiRpt = DEFAULT_LEFT_MARGIN_MULTIRPT * DEFINITON_FACTOR; + m_leftMarginNote = DEFAULT_LEFT_MARGIN_NOTE * DEFINITON_FACTOR; + m_leftMarginRest = DEFAULT_LEFT_MARGIN_REST * DEFINITON_FACTOR; + /** The default left margin */ + m_leftMarginDefault = DEFAULT_LEFT_MARGIN_DEFAULT * DEFINITON_FACTOR; + /** The layout right margin by element */ m_rightMarginBarline = DEFAULT_RIGHT_MARGIN_BARLINE * DEFINITON_FACTOR; m_rightMarginBarlineAttr = DEFAULT_RIGHT_MARGIN_BARLINE_ATTR * DEFINITON_FACTOR; m_rightMarginBeatRpt = DEFAULT_RIGHT_MARGIN_BEATRPT * DEFINITON_FACTOR; + m_rightMarginChord = DEFAULT_RIGHT_MARGIN_CHORD * DEFINITON_FACTOR; m_rightMarginClef = DEFAULT_RIGHT_MARGIN_CLEF * DEFINITON_FACTOR; m_rightMarginKeySig = DEFAULT_RIGHT_MARGIN_KEYSIG * DEFINITON_FACTOR; m_rightMarginMensur = DEFAULT_RIGHT_MARGIN_MENSUR * DEFINITON_FACTOR; @@ -63,21 +85,10 @@ Style::Style() m_rightMarginMRpt2 = DEFAULT_RIGHT_MARGIN_MRPT2 * DEFINITON_FACTOR; m_rightMarginMultiRest = DEFAULT_RIGHT_MARGIN_MULTIREST * DEFINITON_FACTOR; m_rightMarginMultiRpt = DEFAULT_RIGHT_MARGIN_MULTIRPT * DEFINITON_FACTOR; + m_rightMarginNote = DEFAULT_RIGHT_MARGIN_NOTE * DEFINITON_FACTOR; + m_rightMarginRest = DEFAULT_RIGHT_MARGIN_REST * DEFINITON_FACTOR; /** The default right margin */ m_rightMarginDefault = DEFAULT_RIGHT_MARGIN_DEFAULT * DEFINITON_FACTOR; - - /** The layout left margin by element */ - m_leftMarginBarline = DEFAULT_LEFT_MARGIN_BARLINE * DEFINITON_FACTOR; - m_leftMarginBarlineAttr = DEFAULT_LEFT_MARGIN_BARLINE_ATTR * DEFINITON_FACTOR; - m_leftMarginBeatRpt = DEFAULT_LEFT_MARGIN_BEATRPT * DEFINITON_FACTOR; - m_leftMarginChord = DEFAULT_LEFT_MARGIN_CHORD * DEFINITON_FACTOR; - m_leftMarginClef = DEFAULT_LEFT_MARGIN_CLEF * DEFINITON_FACTOR; - m_leftMarginMRest = DEFAULT_LEFT_MARGIN_MREST * DEFINITON_FACTOR; - m_leftMarginMRpt2 = DEFAULT_LEFT_MARGIN_MRPT2 * DEFINITON_FACTOR; - m_leftMarginMultiRpt = DEFAULT_LEFT_MARGIN_MULTIRPT * DEFINITON_FACTOR; - m_leftMarginNote = DEFAULT_LEFT_MARGIN_NOTE * DEFINITON_FACTOR; - /** The default left margin */ - m_leftMarginDefault = DEFAULT_LEFT_MARGIN_DEFAULT * DEFINITON_FACTOR; } Style::~Style() From fb0d87e4fd640a72e47552667e4cd7d14e85334c Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Wed, 2 Sep 2015 14:17:31 +0200 Subject: [PATCH 099/114] Adjusting multiRest --- include/vrv/style.h | 2 +- src/view_element.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/vrv/style.h b/include/vrv/style.h index a0f1f5f7190..2290c25d031 100644 --- a/include/vrv/style.h +++ b/include/vrv/style.h @@ -97,7 +97,7 @@ namespace vrv { #define DEFAULT_LEFT_MARGIN_METERSIG DEFAULT_LEFT_MARGIN_DEFAULT #define DEFAULT_LEFT_MARGIN_MREST DEFAULT_LEFT_MARGIN_DEFAULT #define DEFAULT_LEFT_MARGIN_MRPT2 DEFAULT_LEFT_MARGIN_DEFAULT -#define DEFAULT_LEFT_MARGIN_MULTIREST DEFAULT_LEFT_MARGIN_DEFAULT +#define DEFAULT_LEFT_MARGIN_MULTIREST 2.0 #define DEFAULT_LEFT_MARGIN_MULTIRPT DEFAULT_LEFT_MARGIN_DEFAULT #define DEFAULT_LEFT_MARGIN_NOTE 1.0 #define DEFAULT_LEFT_MARGIN_REST 1.0 diff --git a/src/view_element.cpp b/src/view_element.cpp index 686b3e910b3..6967faec63f 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -709,7 +709,7 @@ void View::DrawMultiRest(DeviceContext *dc, LayerElement *element, Layer *layer, dc->SetFont(m_doc->GetDrawingSmuflFont(staff->m_drawingStaffSize, false)); dc->GetSmuflTextExtent( wtext, &w, &h); start_offset = (x2 - x1 - w) / 2; // calculate offset to center text - DrawSmuflString(dc, x1 + start_offset, staff->GetDrawingY() + 5, wtext, false); + DrawSmuflString(dc, x1 + start_offset, staff->GetDrawingY() + 3 * m_doc->GetDrawingUnit(staff->m_drawingStaffSize), wtext, false); dc->ResetFont(); dc->EndGraphic(element, this); From 849a01501c293a8994f9387e95f0f10aa27958ae Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Wed, 2 Sep 2015 17:45:14 +0200 Subject: [PATCH 100/114] Drawing key.sig cancellation --- include/vrv/style.h | 4 ++-- src/view_element.cpp | 28 +++++++++++++++++++++------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/include/vrv/style.h b/include/vrv/style.h index 2290c25d031..f44a30f5a96 100644 --- a/include/vrv/style.h +++ b/include/vrv/style.h @@ -113,8 +113,8 @@ namespace vrv { #define DEFAULT_RIGHT_MARGIN_BEATRPT DEFAULT_RIGHT_MARGIN_DEFAULT #define DEFAULT_RIGHT_MARGIN_CHORD 0.0 #define DEFAULT_RIGHT_MARGIN_CLEF 2.0 -#define DEFAULT_RIGHT_MARGIN_KEYSIG 2.5 -#define DEFAULT_RIGHT_MARGIN_MENSUR 2.5 +#define DEFAULT_RIGHT_MARGIN_KEYSIG 2.0 +#define DEFAULT_RIGHT_MARGIN_MENSUR 2.0 #define DEFAULT_RIGHT_MARGIN_METERSIG 2.0 #define DEFAULT_RIGHT_MARGIN_MREST DEFAULT_RIGHT_MARGIN_DEFAULT #define DEFAULT_RIGHT_MARGIN_MRPT2 8.0 diff --git a/src/view_element.cpp b/src/view_element.cpp index 6967faec63f..356666ef54d 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -1845,13 +1845,27 @@ void View::DrawKeySig( DeviceContext *dc, LayerElement *element, Layer *layer, S // Show cancellation if C major (0) or if any cancellation and show cancellation (showchange) is true (false by default) if ( (keySig->GetAlterationNumber() == 0) || (layer->DrawKeySigCancellation() && keySig->m_drawingShowchange) ) { - for (i = 0; i < keySig->m_drawingCancelAccidCount; i++) { - data_PITCHNAME pitch = KeySig::GetAlterationAt( keySig->m_drawingCancelAccidType, i); - y = staff->GetDrawingY() + CalculatePitchPosY( staff, pitch, layer->GetClefOffset( element ), - KeySig::GetOctave( keySig->m_drawingCancelAccidType, pitch, c->GetClefId()));; - - DrawSmuflCode ( dc, x, y, SMUFL_E261_accidentalNatural, staff->m_drawingStaffSize, false ); - x += step; + // The type of alteration is different (f/s or f/n or s/n) - cancel all accid in the normal order + if (keySig->GetAlterationType() != keySig->m_drawingCancelAccidType) { + for (i = 0; i < keySig->m_drawingCancelAccidCount; i++) { + data_PITCHNAME pitch = KeySig::GetAlterationAt( keySig->m_drawingCancelAccidType, i); + y = staff->GetDrawingY() + CalculatePitchPosY( staff, pitch, layer->GetClefOffset( element ), + KeySig::GetOctave( keySig->m_drawingCancelAccidType, pitch, c->GetClefId()));; + + DrawSmuflCode ( dc, x, y, SMUFL_E261_accidentalNatural, staff->m_drawingStaffSize, false ); + x += step; + } + } + // Cancel some of them if more accid before + else if (keySig->GetAlterationNumber() < keySig->m_drawingCancelAccidCount) { + for (i = keySig->GetAlterationNumber(); i < keySig->m_drawingCancelAccidCount; i++) { + data_PITCHNAME pitch = KeySig::GetAlterationAt( keySig->m_drawingCancelAccidType, i); + y = staff->GetDrawingY() + CalculatePitchPosY( staff, pitch, layer->GetClefOffset( element ), + KeySig::GetOctave( keySig->m_drawingCancelAccidType, pitch, c->GetClefId()));; + + DrawSmuflCode ( dc, x, y, SMUFL_E261_accidentalNatural, staff->m_drawingStaffSize, false ); + x += step; + } } } From d4bb3aef2e12cf5d49b2a359f64179672890a2ea Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Thu, 3 Sep 2015 09:55:52 +0200 Subject: [PATCH 101/114] Improvement of the alignment - Adding HasToBeAligned method to LayerElement - Measure width for full measure element (mRest, etc.) Making classId consistent (removing intermediate _) --- Verovio.xcodeproj/project.pbxproj | 2 +- include/vrv/accid.h | 3 ++ include/vrv/aligner.h | 3 +- include/vrv/barline.h | 9 +++-- include/vrv/chord.h | 3 ++ include/vrv/clef.h | 3 ++ include/vrv/custos.h | 3 ++ include/vrv/dot.h | 2 + include/vrv/keysig.h | 5 ++- include/vrv/layerelement.h | 6 +++ include/vrv/mensur.h | 3 ++ include/vrv/metersig.h | 5 ++- include/vrv/multirest.h | 2 +- include/vrv/note.h | 3 ++ include/vrv/object.h | 4 +- include/vrv/proport.h | 3 ++ include/vrv/rest.h | 3 ++ include/vrv/rpt.h | 4 +- include/vrv/scoredef.h | 12 +++--- include/vrv/scoredefinterface.h | 4 +- include/vrv/style.h | 10 ++--- include/vrv/vrvdef.h | 28 ++++++------- src/aligner.cpp | 25 ++++++------ src/doc.cpp | 28 ++++++------- src/iomei.cpp | 24 +++++------ src/layerelement.cpp | 16 ++++---- src/measure.cpp | 10 ++--- src/object.cpp | 66 ++++++++++++++++--------------- src/page.cpp | 4 +- src/view_element.cpp | 36 ++++++++++------- src/view_page.cpp | 4 +- 31 files changed, 196 insertions(+), 137 deletions(-) diff --git a/Verovio.xcodeproj/project.pbxproj b/Verovio.xcodeproj/project.pbxproj index 1d2968e658a..b33f69a4ac4 100644 --- a/Verovio.xcodeproj/project.pbxproj +++ b/Verovio.xcodeproj/project.pbxproj @@ -674,8 +674,8 @@ 8F59292218854BF800FE51AD /* multirest.h */, 8F086ECC188539540037FD8E /* note.cpp */, 8F59292318854BF800FE51AD /* note.h */, - 1579B3411B15031D00B16F5C /* proport.h */, 1579B3421B15033100B16F5C /* proport.cpp */, + 1579B3411B15031D00B16F5C /* proport.h */, 8F086ED1188539540037FD8E /* rest.cpp */, 8F59292818854BF800FE51AD /* rest.h */, 4DB726BF1B8B9F480040231B /* rpt.cpp */, diff --git a/include/vrv/accid.h b/include/vrv/accid.h index 82d03e9b821..f75e782b7e2 100644 --- a/include/vrv/accid.h +++ b/include/vrv/accid.h @@ -35,6 +35,9 @@ class Accid: public LayerElement, public PositionInterface, virtual ClassId Is() { return ACCID; }; ///@} + /** Override the method since alignment is required */ + virtual bool HasToBeAligned() { return true; }; + //----------// // Functors // diff --git a/include/vrv/aligner.h b/include/vrv/aligner.h index 6d90368442f..8ff753aa9da 100644 --- a/include/vrv/aligner.h +++ b/include/vrv/aligner.h @@ -41,7 +41,8 @@ enum AlignmentType { ALIGNMENT_DOT, ALIGNMENT_GRACENOTE, ALIGNMENT_CONTAINER, - ALIGNMENT_MULTIREST, + ALIGNMENT_FULLMEASURE, + ALIGNMENT_FULLMEASURE2, ALIGNMENT_DEFAULT, ALIGNMENT_MEASURE_END }; diff --git a/include/vrv/barline.h b/include/vrv/barline.h index 7767a24cf9e..12d66971ce6 100644 --- a/include/vrv/barline.h +++ b/include/vrv/barline.h @@ -35,8 +35,11 @@ class Barline: public LayerElement, virtual void Reset(); virtual Object* Clone() { return new Barline(*this); }; virtual std::string GetClassName( ) { return "Barline"; }; - virtual ClassId Is() { return BAR_LINE; }; - ///@} + virtual ClassId Is() { return BARLINE; }; + ///@} + + /** Override the method since alignment is required */ + virtual bool HasToBeAligned() { return true; }; /** * Use to set the alignment for the Measure Barline members. @@ -77,7 +80,7 @@ class BarlineAttr: public Barline virtual ~BarlineAttr(); virtual Object* Clone() { return new BarlineAttr(*this); }; virtual std::string GetClassName( ) { return "BarlineAttr"; }; - virtual ClassId Is() { return BAR_LINE_ATTR; }; + virtual ClassId Is() { return BARLINE_ATTR; }; ///@} }; diff --git a/include/vrv/chord.h b/include/vrv/chord.h index 8d0c09676a2..52d8fde85b6 100644 --- a/include/vrv/chord.h +++ b/include/vrv/chord.h @@ -47,6 +47,9 @@ class Chord: public LayerElement, public ObjectListInterface, public DurationInt virtual ClassId Is() { return CHORD; }; ///@} + /** Override the method since alignment is required */ + virtual bool HasToBeAligned() { return true; }; + /** * Add an element (only note supported) to a chord. */ diff --git a/include/vrv/clef.h b/include/vrv/clef.h index efb5e6d16bc..0dfd1154c63 100644 --- a/include/vrv/clef.h +++ b/include/vrv/clef.h @@ -44,6 +44,9 @@ class Clef: public LayerElement, virtual ClassId Is() { return CLEF; }; ///@} + /** Override the method since alignment is required */ + virtual bool HasToBeAligned() { return true; }; + /** * Return the offset of the clef */ diff --git a/include/vrv/custos.h b/include/vrv/custos.h index fca15aaff87..da7c2cf38bd 100644 --- a/include/vrv/custos.h +++ b/include/vrv/custos.h @@ -33,6 +33,9 @@ class Custos: public LayerElement, public PositionInterface virtual ClassId Is() { return CUSTOS; }; ///@} + /** Override the method since alignment is required */ + virtual bool HasToBeAligned() { return true; }; + protected: private: diff --git a/include/vrv/dot.h b/include/vrv/dot.h index 10d4f6f9e47..726911adbad 100644 --- a/include/vrv/dot.h +++ b/include/vrv/dot.h @@ -35,6 +35,8 @@ class Dot: public LayerElement, public PositionInterface virtual ClassId Is() { return DOT; }; ///@} + /** Override the method since alignment is required */ + virtual bool HasToBeAligned() { return true; }; //----------// // Functors // diff --git a/include/vrv/keysig.h b/include/vrv/keysig.h index 545640d2441..52dd081c825 100644 --- a/include/vrv/keysig.h +++ b/include/vrv/keysig.h @@ -50,7 +50,10 @@ class KeySig: public LayerElement, virtual void Reset(); virtual Object* Clone() { return new KeySig(*this); }; virtual std::string GetClassName( ) { return "KeySig"; }; - virtual ClassId Is() { return KEY_SIG; }; + virtual ClassId Is() { return KEYSIG; }; + + /** Override the method since alignment is required */ + virtual bool HasToBeAligned() { return true; }; /* Alteration number getter/setter */ int GetAlterationNumber() { return m_alterationNumber; }; diff --git a/include/vrv/layerelement.h b/include/vrv/layerelement.h index cc90f050e33..ca67c3ef097 100644 --- a/include/vrv/layerelement.h +++ b/include/vrv/layerelement.h @@ -79,6 +79,8 @@ class LayerElement: public DocObject bool IsGraceNote(); /** Returns true if the element is a note or a note child and the note has a @grace */ bool IsCueSize(); + /** Return true if the element has to be aligned horizontally */ + virtual bool HasToBeAligned() { return false; }; ///@} /** @@ -87,8 +89,12 @@ class LayerElement: public DocObject */ data_STEMDIRECTION GetDrawingStemDir(); + /** + * Alignment getter + */ Alignment *GetAlignment() { return m_alignment; }; + int GetXRel(); /** diff --git a/include/vrv/mensur.h b/include/vrv/mensur.h index c7fe359b7ea..0ae0d33dc02 100644 --- a/include/vrv/mensur.h +++ b/include/vrv/mensur.h @@ -47,6 +47,9 @@ class Mensur: public LayerElement, virtual Object* Clone() { return new Mensur(*this); }; ///@} + /** Override the method since alignment is required */ + virtual bool HasToBeAligned() { return true; }; + private: public: diff --git a/include/vrv/metersig.h b/include/vrv/metersig.h index 8d95f60420e..88bd09edb79 100644 --- a/include/vrv/metersig.h +++ b/include/vrv/metersig.h @@ -38,9 +38,12 @@ class MeterSig: public LayerElement, virtual ~MeterSig(); virtual void Reset(); virtual std::string GetClassName( ) { return "MeterSig"; }; - virtual ClassId Is() { return METER_SIG; }; + virtual ClassId Is() { return METERSIG; }; virtual Object* Clone() { return new MeterSig(*this); }; ///@} + + /** Override the method since alignment is required */ + virtual bool HasToBeAligned() { return true; }; private: diff --git a/include/vrv/multirest.h b/include/vrv/multirest.h index e81c6d58c34..79712ed5570 100644 --- a/include/vrv/multirest.h +++ b/include/vrv/multirest.h @@ -35,7 +35,7 @@ class MultiRest: public LayerElement, virtual ~MultiRest(); virtual void Reset(); virtual std::string GetClassName( ) { return "MultiRest"; }; - virtual ClassId Is() { return MULTI_REST; }; + virtual ClassId Is() { return MULTIREST; }; ///@} private: diff --git a/include/vrv/note.h b/include/vrv/note.h index dabff061db3..3b473cc706b 100644 --- a/include/vrv/note.h +++ b/include/vrv/note.h @@ -62,6 +62,9 @@ class Note: public LayerElement, public DurationInterface, public PitchInterface virtual ClassId Is() { return NOTE; }; ///@} + /** Override the method since alignment is required */ + virtual bool HasToBeAligned() { return true; }; + /** * Add an element (a verse or an accid) to a note. * Only Verse and Accid elements will be actually added to the note. diff --git a/include/vrv/object.h b/include/vrv/object.h index e502b399272..94ab598d00d 100644 --- a/include/vrv/object.h +++ b/include/vrv/object.h @@ -85,7 +85,7 @@ class Object bool IsEditorialElement() { return (this->Is() > EDITORIAL_ELEMENT && this->Is() < EDITORIAL_ELEMENT_max); }; bool IsLayerElement() { return (this->Is() > LAYER_ELEMENT && this->Is() < LAYER_ELEMENT_max); }; bool IsFloatingElement() { return (this->Is() > FLOATING_ELEMENT && this->Is() < FLOATING_ELEMENT_max); }; - bool IsScoreDefElement() { return (this->Is() > SCORE_DEF_ELEMENT && this->Is() < SCORE_DEF_ELEMENT_max); }; + bool IsScoreDefElement() { return (this->Is() > SCOREDEF_ELEMENT && this->Is() < SCOREDEF_ELEMENT_max); }; ///@} /** @@ -725,6 +725,8 @@ class DocObject: public Object bool HasContentBB(); bool HasSelfBB(); void ResetBB(); + void SetEmptyBB(); + bool HasEmptyBB(); /** * @name Get and set the X and Y drawing position diff --git a/include/vrv/proport.h b/include/vrv/proport.h index 2c7cf5b651a..b9b198ecef4 100755 --- a/include/vrv/proport.h +++ b/include/vrv/proport.h @@ -38,6 +38,9 @@ class Proport: public LayerElement, virtual Object* Clone() { return new Proport(*this); }; ///@} + /** Override the method since alignment is required */ + virtual bool HasToBeAligned() { return true; }; + private: public: diff --git a/include/vrv/rest.h b/include/vrv/rest.h index 2210fd6e79e..30eea5a7664 100644 --- a/include/vrv/rest.h +++ b/include/vrv/rest.h @@ -37,6 +37,9 @@ class Rest: public LayerElement, public DurationInterface, public PositionInterf virtual ClassId Is() { return REST; }; ///@} + /** Override the method since alignment is required */ + virtual bool HasToBeAligned() { return true; }; + private: public: diff --git a/include/vrv/rpt.h b/include/vrv/rpt.h index c4dda5cd151..409161c341b 100644 --- a/include/vrv/rpt.h +++ b/include/vrv/rpt.h @@ -34,7 +34,7 @@ class BeatRpt: public LayerElement, virtual ~BeatRpt(); virtual void Reset(); virtual std::string GetClassName( ){ return "BeatRpt"; }; ; - virtual ClassId Is() { return BEAT_RPT; }; + virtual ClassId Is() { return BEATRPT; }; ///@} /** @@ -145,7 +145,7 @@ class MultiRpt: public LayerElement, virtual ~MultiRpt(); virtual void Reset(); virtual std::string GetClassName( ){ return "MultiRpt"; }; ; - virtual ClassId Is() { return MULTI_RPT; }; + virtual ClassId Is() { return MULTIRPT; }; ///@} private: diff --git a/include/vrv/scoredef.h b/include/vrv/scoredef.h index c77c9f3eb33..c2c6533213c 100644 --- a/include/vrv/scoredef.h +++ b/include/vrv/scoredef.h @@ -6,8 +6,8 @@ ///////////////////////////////////////////////////////////////////////////// -#ifndef __VRV_SCORE_DEF_H__ -#define __VRV_SCORE_DEF_H__ +#ifndef __VRV_SCOREDEF_H__ +#define __VRV_SCOREDEF_H__ #include "atts_shared.h" #include "drawinginterface.h" @@ -45,7 +45,7 @@ class ScoreDefElement: public Object, public ScoreDefInterface ScoreDefElement(std::string classid); virtual ~ScoreDefElement(); virtual void Reset(); - virtual ClassId Is() { return SCORE_DEF_ELEMENT; }; + virtual ClassId Is() { return SCOREDEF_ELEMENT; }; ///@} /** @@ -121,7 +121,7 @@ class ScoreDef: public ScoreDefElement, public ObjectListInterface virtual ~ScoreDef(); virtual void Reset(); virtual std::string GetClassName( ) { return "ScoreDef"; }; - virtual ClassId Is() { return SCORE_DEF; }; + virtual ClassId Is() { return SCOREDEF; }; ///@} void AddStaffGrp( StaffGrp *staffGrp ); @@ -211,7 +211,7 @@ class StaffGrp: public Object, public ObjectListInterface, virtual Object* Clone() { return new StaffGrp(*this); }; virtual void Reset(); virtual std::string GetClassName( ) { return "StaffGrp"; }; - virtual ClassId Is() { return STAFF_GRP; }; + virtual ClassId Is() { return STAFFGRP; }; ///@} /** @@ -266,7 +266,7 @@ class StaffDef: public ScoreDefElement, public StaffDefDrawingInterface, virtual Object* Clone() { return new StaffDef(*this); }; virtual void Reset(); virtual std::string GetClassName( ) { return "StaffDef"; }; - virtual ClassId Is() { return STAFF_DEF; }; + virtual ClassId Is() { return STAFFDEF; }; ///@} //----------// diff --git a/include/vrv/scoredefinterface.h b/include/vrv/scoredefinterface.h index c3f32aeded8..9ebade95047 100644 --- a/include/vrv/scoredefinterface.h +++ b/include/vrv/scoredefinterface.h @@ -6,8 +6,8 @@ ///////////////////////////////////////////////////////////////////////////// -#ifndef __VRV_SCORE_DEF_INTERFACE_H__ -#define __VRV_SCORE_DEF_INTERFACE_H__ +#ifndef __VRV_SCOREDEF_INTERFACE_H__ +#define __VRV_SCOREDEF_INTERFACE_H__ #include "atts_mensural.h" #include "atts_shared.h" diff --git a/include/vrv/style.h b/include/vrv/style.h index f44a30f5a96..8663f30d107 100644 --- a/include/vrv/style.h +++ b/include/vrv/style.h @@ -74,7 +74,7 @@ namespace vrv { #define MIN_LYRIC_SIZE 2.0 #define MAX_LYRIC_SIZE 8.0 -#define DEFAULT_MEASURE_WIDTH 8.0 +#define DEFAULT_MEASURE_WIDTH 12.0 #define MIN_MEASURE_WIDTH 1.0 #define MAX_MEASURE_WIDTH 30.0 @@ -97,7 +97,7 @@ namespace vrv { #define DEFAULT_LEFT_MARGIN_METERSIG DEFAULT_LEFT_MARGIN_DEFAULT #define DEFAULT_LEFT_MARGIN_MREST DEFAULT_LEFT_MARGIN_DEFAULT #define DEFAULT_LEFT_MARGIN_MRPT2 DEFAULT_LEFT_MARGIN_DEFAULT -#define DEFAULT_LEFT_MARGIN_MULTIREST 2.0 +#define DEFAULT_LEFT_MARGIN_MULTIREST DEFAULT_RIGHT_MARGIN_DEFAULT #define DEFAULT_LEFT_MARGIN_MULTIRPT DEFAULT_LEFT_MARGIN_DEFAULT #define DEFAULT_LEFT_MARGIN_NOTE 1.0 #define DEFAULT_LEFT_MARGIN_REST 1.0 @@ -117,9 +117,9 @@ namespace vrv { #define DEFAULT_RIGHT_MARGIN_MENSUR 2.0 #define DEFAULT_RIGHT_MARGIN_METERSIG 2.0 #define DEFAULT_RIGHT_MARGIN_MREST DEFAULT_RIGHT_MARGIN_DEFAULT -#define DEFAULT_RIGHT_MARGIN_MRPT2 8.0 -#define DEFAULT_RIGHT_MARGIN_MULTIREST DEFAULT_RIGHT_MARGIN_DEFAULT //0.5 -#define DEFAULT_RIGHT_MARGIN_MULTIRPT 8.0 +#define DEFAULT_RIGHT_MARGIN_MRPT2 DEFAULT_RIGHT_MARGIN_DEFAULT +#define DEFAULT_RIGHT_MARGIN_MULTIREST DEFAULT_RIGHT_MARGIN_DEFAULT +#define DEFAULT_RIGHT_MARGIN_MULTIRPT DEFAULT_RIGHT_MARGIN_DEFAULT #define DEFAULT_RIGHT_MARGIN_NOTE 0.0 #define DEFAULT_RIGHT_MARGIN_REST 0.0 diff --git a/include/vrv/vrvdef.h b/include/vrv/vrvdef.h index a133ac32830..5622d063e3f 100644 --- a/include/vrv/vrvdef.h +++ b/include/vrv/vrvdef.h @@ -60,16 +60,16 @@ enum ClassId { DOC, DOC_OBJECT, GRACE_ALIGNER, - KEY_SIG_ATTR, + KEYSIG_ATTR, LAYER, MEASURE, MEASURE_ALIGNER, MENSUR_ATTR, - METER_SIG_ATTR, + METERSIG_ATTR, PAGE, STAFF, STAFF_ALIGNMENT, - STAFF_GRP, + STAFFGRP, SYSTEM, SYSTEM_ALIGNER, SYSTEM_ALIGNMENT, @@ -84,22 +84,22 @@ enum ClassId { // Ids for LayerElement child classes LAYER_ELEMENT, ACCID, - BAR_LINE, - BAR_LINE_ATTR, + BARLINE, + BARLINE_ATTR, BEAM, - BEAT_RPT, + BEATRPT, CHORD, CLEF, CUSTOS, DOT, - KEY_SIG, + KEYSIG, MENSUR, - METER_SIG, + METERSIG, MREST, MRPT, MRPT2, - MULTI_REST, - MULTI_RPT, + MULTIREST, + MULTIRPT, NOTE, PROPORT, REST, @@ -115,10 +115,10 @@ enum ClassId { TIE, FLOATING_ELEMENT_max, // Ids for ScoreDefElement child classes - SCORE_DEF_ELEMENT, - SCORE_DEF, - STAFF_DEF, - SCORE_DEF_ELEMENT_max, + SCOREDEF_ELEMENT, + SCOREDEF, + STAFFDEF, + SCOREDEF_ELEMENT_max, // UNSPECIFIED }; diff --git a/src/aligner.cpp b/src/aligner.cpp index f9d670f6eef..3b3f941de58 100644 --- a/src/aligner.cpp +++ b/src/aligner.cpp @@ -351,7 +351,8 @@ int MeasureAligner::IntegrateBoundingBoxXShift( ArrayPtrVoid *params ) { // param 0: the accumulated shift // param 1: the accumulated justifiable shift - // param 2: the functor to be redirected to the MeasureAligner (unused) + // param 2: the minimum measure with (unused) + // param 3: the functor to be redirected to the MeasureAligner (unused) int *shift = static_cast((*params).at(0)); int *justifiable_shift = static_cast((*params).at(1)); @@ -393,9 +394,11 @@ int Alignment::IntegrateBoundingBoxXShift( ArrayPtrVoid *params ) { // param 0: the accumulated shift // param 1: the accumulated justifiable shift - // param 2: the functor to be redirected to the MeasureAligner (unused) + // param 2: the minimum measure with + // param 3: the functor to be redirected to the MeasureAligner (unused) int *shift = static_cast((*params).at(0)); int *justifiable_shift = static_cast((*params).at(1)); + int *minMeasureWidth = static_cast((*params).at(2)); // integrates the m_xShift into the m_xRel m_xRel += m_xShift + (*shift); @@ -413,6 +416,13 @@ int Alignment::IntegrateBoundingBoxXShift( ArrayPtrVoid *params ) (*justifiable_shift) = aligner->GetNonJustifiableMargin(); } + if (GetType() == ALIGNMENT_FULLMEASURE2) { + (*minMeasureWidth) *= 2; + } + else if (GetType() == ALIGNMENT_MEASURE_END) { + m_xRel = std::max( m_xRel, (*minMeasureWidth) + (*justifiable_shift) ); + } + // reset member to 0 m_xShift = 0; @@ -423,8 +433,7 @@ int MeasureAligner::SetAligmentXPos( ArrayPtrVoid *params ) { // param 0: the previous time position // param 1: the previous x rel position - // param 2: the minimum measure width (unused) - // param 3: the functor to be redirected to the MeasureAligner (unused) + // param 2: the functor to be redirected to the MeasureAligner (unused) double *previousTime = static_cast((*params).at(0)); int *previousXRel = static_cast((*params).at(1)); @@ -458,11 +467,9 @@ int Alignment::SetAligmentXPos( ArrayPtrVoid *params ) { // param 0: the previous time position // param 1: the previous x rel position - // param 2: the minimum measure width - // param 3: the functor to be redirected to the MeasureAligner (unused) + // param 2: the functor to be redirected to the MeasureAligner (unused) double *previousTime = static_cast((*params).at(0)); int *previousXRel = static_cast((*params).at(1)); - int *minMeasureWidth = static_cast((*params).at(2)); int intervalXRel = 0; double intervalTime = (m_time - (*previousTime)); @@ -473,10 +480,6 @@ int Alignment::SetAligmentXPos( ArrayPtrVoid *params ) (*previousTime) = m_time; (*previousXRel) = m_xRel; - if (this->GetType() == ALIGNMENT_MEASURE_END) { - m_xRel = std::max( m_xRel, (*minMeasureWidth) ); - } - return FUNCTOR_CONTINUE; } diff --git a/src/doc.cpp b/src/doc.cpp index 7a50fb6200b..ebaba373dc6 100644 --- a/src/doc.cpp +++ b/src/doc.cpp @@ -532,18 +532,18 @@ FontInfo *Doc::GetDrawingLyricFont( int staffSize ) char Doc::GetLeftMargin( const ClassId classId ) { - if (classId == BAR_LINE) return m_style->m_leftMarginBarline; - else if (classId == BAR_LINE_ATTR) return m_style->m_leftMarginBarlineAttr; - else if (classId == BEAT_RPT) return m_style->m_leftMarginBeatRpt; + if (classId == BARLINE) return m_style->m_leftMarginBarline; + else if (classId == BARLINE_ATTR) return m_style->m_leftMarginBarlineAttr; + else if (classId == BEATRPT) return m_style->m_leftMarginBeatRpt; else if (classId == CHORD) return m_style->m_leftMarginChord; else if (classId == CLEF) return m_style->m_leftMarginClef; - else if (classId == KEY_SIG) return m_style->m_leftMarginKeySig; + else if (classId == KEYSIG) return m_style->m_leftMarginKeySig; else if (classId == MENSUR) return m_style->m_leftMarginMensur; - else if (classId == METER_SIG) return m_style->m_leftMarginMeterSig; + else if (classId == METERSIG) return m_style->m_leftMarginMeterSig; else if (classId == MREST) return m_style->m_leftMarginMRest; else if (classId == MRPT2) return m_style->m_leftMarginMRpt2; - else if (classId == MULTI_REST) return m_style->m_leftMarginMultiRest; - else if (classId == MULTI_RPT) return m_style->m_leftMarginMultiRpt; + else if (classId == MULTIREST) return m_style->m_leftMarginMultiRest; + else if (classId == MULTIRPT) return m_style->m_leftMarginMultiRpt; else if (classId == NOTE) return m_style->m_leftMarginNote; else if (classId == REST) return m_style->m_leftMarginRest; return m_style->m_leftMarginDefault; @@ -551,18 +551,18 @@ char Doc::GetLeftMargin( const ClassId classId ) char Doc::GetRightMargin( const ClassId classId ) { - if (classId == BAR_LINE) return m_style->m_rightMarginBarline; - else if (classId == BAR_LINE_ATTR) return m_style->m_rightMarginBarlineAttr; - else if (classId == BEAT_RPT) return m_style->m_rightMarginBeatRpt; + if (classId == BARLINE) return m_style->m_rightMarginBarline; + else if (classId == BARLINE_ATTR) return m_style->m_rightMarginBarlineAttr; + else if (classId == BEATRPT) return m_style->m_rightMarginBeatRpt; else if (classId == CHORD) return m_style->m_rightMarginChord; else if (classId == CLEF) return m_style->m_rightMarginClef; - else if (classId == KEY_SIG) return m_style->m_rightMarginKeySig; + else if (classId == KEYSIG) return m_style->m_rightMarginKeySig; else if (classId == MENSUR) return m_style->m_rightMarginMensur; - else if (classId == METER_SIG) return m_style->m_rightMarginMeterSig; + else if (classId == METERSIG) return m_style->m_rightMarginMeterSig; else if (classId == MREST) return m_style->m_rightMarginMRest; else if (classId == MRPT2) return m_style->m_rightMarginMRpt2; - else if (classId == MULTI_REST) return m_style->m_rightMarginMultiRest; - else if (classId == MULTI_RPT) return m_style->m_rightMarginMultiRpt; + else if (classId == MULTIREST) return m_style->m_rightMarginMultiRest; + else if (classId == MULTIRPT) return m_style->m_rightMarginMultiRpt; else if (classId == NOTE) return m_style->m_rightMarginNote; else if (classId == REST) return m_style->m_rightMarginRest; return m_style->m_rightMarginDefault; diff --git a/src/iomei.cpp b/src/iomei.cpp index d27108cbd55..e13ead29fc5 100644 --- a/src/iomei.cpp +++ b/src/iomei.cpp @@ -143,15 +143,15 @@ bool MeiOutput::WriteObject( Object *object ) } // Here we could add a element (but not for the first system of the page?) } - else if (object->Is() == SCORE_DEF) { + else if (object->Is() == SCOREDEF) { m_currentNode = m_currentNode.append_child("scoreDef"); WriteMeiScoreDef( m_currentNode, dynamic_cast(object) ); } - else if (object->Is() == STAFF_GRP) { + else if (object->Is() == STAFFGRP) { m_currentNode = m_currentNode.append_child("staffGrp"); WriteMeiStaffGrp( m_currentNode, dynamic_cast(object) ); } - else if (object->Is() == STAFF_DEF) { + else if (object->Is() == STAFFDEF) { m_currentNode = m_currentNode.append_child("staffDef"); WriteMeiStaffDef( m_currentNode, dynamic_cast(object) ); } @@ -187,7 +187,7 @@ bool MeiOutput::WriteObject( Object *object ) m_currentNode = m_currentNode.append_child("accid"); WriteMeiAccid( m_currentNode, dynamic_cast(object) ); } - else if (object->Is() == BAR_LINE) { + else if (object->Is() == BARLINE) { m_currentNode = m_currentNode.append_child( "barLine" ); WriteMeiBarline( m_currentNode, dynamic_cast(object) ); } @@ -195,7 +195,7 @@ bool MeiOutput::WriteObject( Object *object ) m_currentNode = m_currentNode.append_child("beam"); WriteMeiBeam( m_currentNode, dynamic_cast(object) ); } - else if (object->Is() == BEAT_RPT) { + else if (object->Is() == BEATRPT) { m_currentNode = m_currentNode.append_child("beatRpt"); WriteMeiBeatRpt( m_currentNode, dynamic_cast(object) ); } @@ -215,7 +215,7 @@ bool MeiOutput::WriteObject( Object *object ) m_currentNode = m_currentNode.append_child( "dot" ); WriteMeiDot( m_currentNode, dynamic_cast(object) ); } - else if (object->Is() == KEY_SIG) { + else if (object->Is() == KEYSIG) { m_currentNode = m_currentNode.append_child("keySig"); WriteMeiKeySig( m_currentNode, dynamic_cast(object) ); } @@ -223,7 +223,7 @@ bool MeiOutput::WriteObject( Object *object ) m_currentNode = m_currentNode.append_child("mensur"); WriteMeiMensur( m_currentNode, dynamic_cast(object) ); } - else if (object->Is() == METER_SIG) { + else if (object->Is() == METERSIG) { m_currentNode = m_currentNode.append_child("meterSig"); WriteMeiMeterSig( m_currentNode, dynamic_cast(object) ); } @@ -239,11 +239,11 @@ bool MeiOutput::WriteObject( Object *object ) m_currentNode = m_currentNode.append_child("mRpt2"); WriteMeiMRpt2( m_currentNode, dynamic_cast(object) ); } - else if (object->Is() == MULTI_REST) { + else if (object->Is() == MULTIREST) { m_currentNode = m_currentNode.append_child("multiRest"); WriteMeiMultiRest( m_currentNode, dynamic_cast(object) ); } - else if (object->Is() == MULTI_RPT) { + else if (object->Is() == MULTIRPT) { m_currentNode = m_currentNode.append_child("multiRpt"); WriteMeiMultiRpt( m_currentNode, dynamic_cast(object) ); } @@ -1366,7 +1366,7 @@ bool MeiInput::ReadMeiStaffDef( Object *parent, pugi::xml_node staffDef ) ReadScoreDefInterface(staffDef, vrvStaffDef); // This could me moved to an AddMeasure method for consistency with AddLayerElement - if ( parent->Is() == STAFF_GRP ) { + if ( parent->Is() == STAFFGRP ) { StaffGrp *staffGrp = dynamic_cast( parent ); assert( staffGrp ); staffGrp->AddStaffDef(vrvStaffDef); @@ -2270,10 +2270,10 @@ void MeiInput::AddStaffGrp(Object *parent, StaffGrp *staffGrp ) assert( element ); element->AddStaffGrp( staffGrp ); } - else if ( parent->Is() == SCORE_DEF ) { + else if ( parent->Is() == SCOREDEF ) { dynamic_cast( parent )->AddStaffGrp( staffGrp ); } - else if ( parent->Is() == STAFF_GRP ) { + else if ( parent->Is() == STAFFGRP ) { dynamic_cast( parent )->AddStaffGrp( staffGrp ); } else { diff --git a/src/layerelement.cpp b/src/layerelement.cpp index 0f1dcee7311..88872881680 100644 --- a/src/layerelement.cpp +++ b/src/layerelement.cpp @@ -170,7 +170,7 @@ double LayerElement::GetAlignmentDuration( Mensur *mensur, MeterSig *meterSig, b if (duration->IsMensural()) return duration->GetAlignmentMensuralDuration( num, numbase, mensur ); else return duration->GetAlignmentDuration( num, numbase ); } - else if (this->Is() == BEAT_RPT) { + else if (this->Is() == BEATRPT) { BeatRpt *beatRpt = dynamic_cast(this); assert(beatRpt); int meterUnit = 4; @@ -217,7 +217,7 @@ int LayerElement::AlignHorizontally( ArrayPtrVoid *params ) } AlignmentType type = ALIGNMENT_DEFAULT; - if (this->Is() == BAR_LINE) { + if (this->Is() == BARLINE) { type = ALIGNMENT_BARLINE; } else if ( this->Is() == CLEF ) { @@ -228,7 +228,7 @@ int LayerElement::AlignHorizontally( ArrayPtrVoid *params ) type = ALIGNMENT_CLEF; } } - else if (this->Is() == KEY_SIG) { + else if (this->Is() == KEYSIG) { if ( this->GetScoreOrStaffDefAttr() ) { type = ALIGNMENT_KEYSIG_ATTR; } @@ -247,7 +247,7 @@ int LayerElement::AlignHorizontally( ArrayPtrVoid *params ) type = ALIGNMENT_MENSUR; } } - else if (this->Is() == METER_SIG) { + else if (this->Is() == METERSIG) { if ( this->GetScoreOrStaffDefAttr() ) { type = ALIGNMENT_METERSIG_ATTR; } @@ -258,9 +258,11 @@ int LayerElement::AlignHorizontally( ArrayPtrVoid *params ) type = ALIGNMENT_METERSIG; } } - else if ( (this->Is() == MULTI_REST) || (this->Is() == MREST) || (this->Is() == MRPT) - || (this->Is() == MRPT2) || (this->Is() == MULTI_RPT) ) { - type = ALIGNMENT_MULTIREST; + else if ( (this->Is() == MULTIREST) || (this->Is() == MREST) || (this->Is() == MRPT) ) { + type = ALIGNMENT_FULLMEASURE; + } + else if ( (this->Is() == MRPT2) || (this->Is() == MULTIRPT) ) { + type = ALIGNMENT_FULLMEASURE2; } else if ( this->IsGraceNote() ) { type = ALIGNMENT_GRACENOTE; diff --git a/src/measure.cpp b/src/measure.cpp index 0d640bfc513..adfd8281ab4 100644 --- a/src/measure.cpp +++ b/src/measure.cpp @@ -202,8 +202,9 @@ int Measure::IntegrateBoundingBoxXShift( ArrayPtrVoid *params ) { // param 0: the cumulated shift (unused) // param 1: the cumulated justifiable shift (unused) - // param 2: the functor to be redirected to Aligner - Functor *integrateBoundingBoxShift = static_cast((*params).at(2)); + // param 2: the minimum measure with (unused) + // param 3: the functor to be redirected to Aligner + Functor *integrateBoundingBoxShift = static_cast((*params).at(3)); m_measureAligner.Process( integrateBoundingBoxShift, params ); @@ -214,9 +215,8 @@ int Measure::SetAligmentXPos( ArrayPtrVoid *params ) { // param 0: the previous time position (unused) // param 1: the previous x rel position (unused) - // param 2: the minimum measure width (unused) - // param 3: the functor to be redirected to Aligner - Functor *setAligmnentPosX = static_cast((*params).at(3)); + // param 2: the functor to be redirected to Aligner + Functor *setAligmnentPosX = static_cast((*params).at(2)); m_measureAligner.Process( setAligmnentPosX, params); diff --git a/src/object.cpp b/src/object.cpp index 333662afdeb..eb336829dd1 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -693,12 +693,30 @@ void DocObject::ResetBB() m_selfBB_y1 = 0xFFFFFFF; m_selfBB_x2 = -0xFFFFFFF; m_selfBB_y2 = -0xFFFFFFF; - //m_drawingX = 0; - //m_drawingY = 0; m_updatedBB = false; } +void DocObject::SetEmptyBB() +{ + m_contentBB_x1 = 0; + m_contentBB_y1 = 0; + m_contentBB_x2 = 0; + m_contentBB_y2 = 0; + m_selfBB_x1 = 0; + m_selfBB_y1 = 0; + m_selfBB_x2 = 0; + m_selfBB_y2 = 0; + + m_updatedBB = true; +} + + +bool DocObject::HasEmptyBB() +{ + return ( m_updatedBB && (m_contentBB_x1 == 0) && (m_contentBB_y1 == 0) && (m_contentBB_x2 == 0) && (m_contentBB_y2 == 0) ); +} + bool DocObject::HasContentBB() { return ( (m_contentBB_x1 != 0xFFFF) && (m_contentBB_y1 != 0xFFFF) && (m_contentBB_x2 != -0xFFFF) && (m_contentBB_y2 != -0xFFFF) ); @@ -938,7 +956,7 @@ int Object::SetCurrentScoreDef( ArrayPtrVoid *params ) } // starting a new scoreDef - if (this->Is() == SCORE_DEF) { + if (this->Is() == SCOREDEF) { ScoreDef *scoreDef= dynamic_cast(this); assert( scoreDef ); // Replace the current scoreDef with the new one, including its content (staffDef) @@ -947,7 +965,7 @@ int Object::SetCurrentScoreDef( ArrayPtrVoid *params ) } // starting a new staffDef - if (this->Is() == STAFF_DEF) { + if (this->Is() == STAFFDEF) { StaffDef *staffDef= dynamic_cast(this); assert( staffDef ); currentScoreDef->ReplaceDrawingValues(staffDef); @@ -990,7 +1008,7 @@ int Object::SetCurrentScoreDef( ArrayPtrVoid *params ) } // starting a new keysig - if (this->Is() == KEY_SIG) { + if (this->Is() == KEYSIG) { KeySig *keysig = dynamic_cast(this); assert( keysig ); assert( *currentStaffDef ); @@ -1136,29 +1154,19 @@ int Object::SetBoundingBoxXShift( ArrayPtrVoid *params ) // we should have processed aligned before assert( current->GetAlignment() ); - - if ( !current->HasUpdatedBB() ) { - // if nothing was drawn, do not take it into account - return FUNCTOR_CONTINUE; - } - if (current->Is() == BEAM) { + if ( !current->HasToBeAligned() ) { + // if nothing to do with this type of account return FUNCTOR_CONTINUE; } - if ( (current->Is() == NOTE) && current->GetFirstParent( CHORD, MAX_CHORD_DEPTH ) ) { - return FUNCTOR_CONTINUE; - } - - if (current->Is() == TIE) { - return FUNCTOR_CONTINUE; - } - - if (current->Is() == TUPLET) { + if ( !current->HasUpdatedBB() ) { + // if nothing was drawn, do not take it into account + assert( false ); // quite drastic but this should never happen. If nothing has to be drawn then the BB should be set to empty with DocObject::SetEmptyBB() return FUNCTOR_CONTINUE; } - if ( (current->Is() == VERSE) || (current->Is() == SYL) ) { + if ( (current->Is() == NOTE) && current->GetFirstParent( CHORD, MAX_CHORD_DEPTH ) ) { return FUNCTOR_CONTINUE; } @@ -1174,15 +1182,7 @@ int Object::SetBoundingBoxXShift( ArrayPtrVoid *params ) // this should never happen (but can with glyphs not exactly registered at position x=0 in the SMuFL font used if ( negative_offset < 0 ) negative_offset = 0; - - if ((current->Is() == MREST) || (current->Is() == MRPT) || (this->Is() == MRPT2) || (this->Is() == MULTI_RPT)) { - // With MRest, MRpt, etc., the only thing we want to do is to keep their with as possible measure with (if only MRest in all staves/layers) - int width = current->m_contentBB_x2 + doc->GetRightMargin( current->Is() ) * doc->GetDrawingUnit(100) / PARAM_DENOMINATOR + negative_offset ; - // Keep it if more than the current measure width - (*measure_width) = std::max( (*measure_width), (*min_pos) + width ); - return FUNCTOR_CONTINUE; - } - + // with a grace note, also take into account the full with of the group given by the GraceAligner if (current->GetAlignment()->HasGraceAligner()) { negative_offset += current->GetAlignment()->GetGraceAligner()->GetWidth(); @@ -1211,8 +1211,10 @@ int Object::SetBoundingBoxXShift( ArrayPtrVoid *params ) } // the next minimal position if given by the right side of the bounding box + the spacing of the element - (*min_pos) = current->GetAlignment()->GetXRel() + current->m_contentBB_x2 + doc->GetRightMargin( current->Is() ) * doc->GetDrawingUnit(100) / PARAM_DENOMINATOR; - current->GetAlignment()->SetMaxWidth( current->m_contentBB_x2 + doc->GetRightMargin( current->Is() ) * doc->GetDrawingUnit(100) / PARAM_DENOMINATOR ); + int width = current->m_contentBB_x2; + if (!current->HasEmptyBB()) width += doc->GetRightMargin( current->Is() ) * doc->GetDrawingUnit(100) / PARAM_DENOMINATOR; + (*min_pos) = current->GetAlignment()->GetXRel() + width; + current->GetAlignment()->SetMaxWidth( width ); return FUNCTOR_CONTINUE; } diff --git a/src/page.cpp b/src/page.cpp index 52ba21cbd49..b66c94cc6c9 100644 --- a/src/page.cpp +++ b/src/page.cpp @@ -117,10 +117,8 @@ void Page::LayOutHorizontally( ) params.clear(); double previousTime = 0.0; int previousXRel = 0; - int minMeasureWidth = doc->m_drawingMinMeasureWidth; params.push_back( &previousTime ); params.push_back( &previousXRel ); - params.push_back( &minMeasureWidth ); Functor setAlignmentX( &Object::SetAligmentXPos ); // Special case: because we redirect the functor, pass is a parameter to itself (!) params.push_back( &setAlignmentX ); @@ -168,8 +166,10 @@ void Page::LayOutHorizontally( ) params.clear(); int shift = 0; int justifiable_shift = 0; + int minMeasureWidth = doc->m_drawingMinMeasureWidth; params.push_back( &shift ); params.push_back( &justifiable_shift ); + params.push_back( &minMeasureWidth ); Functor integrateBoundingBoxXShift( &Object::IntegrateBoundingBoxXShift ); // special case: because we redirect the functor, pass is a parameter to itself (!) params.push_back( &integrateBoundingBoxXShift ); diff --git a/src/view_element.cpp b/src/view_element.cpp index 356666ef54d..ad7c75f85a2 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -71,13 +71,13 @@ void View::DrawLayerElement( DeviceContext *dc, LayerElement *element, Layer *la if (element->Is() == ACCID) { DrawAccid(dc, element, layer, staff, measure); } - else if (element->Is() == BAR_LINE) { + else if (element->Is() == BARLINE) { DrawBarline(dc, element, layer, staff, measure); } else if (element->Is() == BEAM) { DrawBeam(dc, element, layer, staff, measure); } - else if (element->Is() == BEAT_RPT) { + else if (element->Is() == BEATRPT) { DrawBeatRpt(dc, element, layer, staff, measure); } else if (element->Is() == CHORD) { @@ -92,13 +92,13 @@ void View::DrawLayerElement( DeviceContext *dc, LayerElement *element, Layer *la else if (element->Is() == DOT) { DrawDot(dc, element, layer, staff, measure); } - else if (element->Is() == KEY_SIG) { + else if (element->Is() == KEYSIG) { DrawKeySig(dc, element, layer, staff, measure); } else if (element->Is() == MENSUR) { DrawMensur(dc, element, layer, staff, measure); } - else if (element->Is() == METER_SIG) { + else if (element->Is() == METERSIG) { DrawMeterSig(dc, element, layer, staff, measure); } else if (element->Is() == MREST) { @@ -110,10 +110,10 @@ void View::DrawLayerElement( DeviceContext *dc, LayerElement *element, Layer *la else if (element->Is() == MRPT2) { DrawMRpt2(dc, element, layer, staff, measure); } - else if (element->Is() == MULTI_REST) { + else if (element->Is() == MULTIREST) { DrawMultiRest(dc, element, layer, staff, measure); } - else if (element->Is() == MULTI_RPT) { + else if (element->Is() == MULTIRPT) { DrawMultiRpt(dc, element, layer, staff, measure); } else if (element->Is() == NOTE) { @@ -613,7 +613,7 @@ void View::DrawRest ( DeviceContext *dc, LayerElement *element, Layer *layer, St if (drawingDur > DUR_2) { - x -= m_doc->GetGlyphWidth(SMUFL_E0A3_noteheadHalf, staff->m_drawingStaffSize, drawingCueSize); + //x -= m_doc->GetGlyphWidth(SMUFL_E0A3_noteheadHalf, staff->m_drawingStaffSize, drawingCueSize); } switch (drawingDur) @@ -670,23 +670,23 @@ void View::DrawMultiRest(DeviceContext *dc, LayerElement *element, Layer *layer, dc->StartGraphic( element, "", element->GetUuid() ); - int x = element->GetDrawingX(); + int width = measure->GetRightBarlineX() - measure->GetNonJustifiableLeftMargin(); + int xCentered = measure->GetDrawingX() + measure->GetNonJustifiableLeftMargin() + (width / 2); + // We do not support more than three chars - if (multirest->GetNum() > 999) - multirest->SetNum(999); + if (multirest->GetNum() > 999) multirest->SetNum(999); // This is 1/2 the length of th black rectangle - length = (m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 5); + length = width - 2 * m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); // Position centered in third line - // it would be m_drawingDoubleUnit * 6.5, or m_drawingDoubleUnit / 2 * 13 y1 = staff->GetDrawingY() - (m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) / 2) * 5; y2 = y1 + m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); // a is the central point, claculate x and x2 - x1 = x - length; - x2 = x + length; + x1 = xCentered - length / 2; + x2 = xCentered + length / 2; // Draw the base rect // make it 8 pixels smaller than the interline space @@ -1829,11 +1829,19 @@ void View::DrawKeySig( DeviceContext *dc, LayerElement *element, Layer *layer, S Clef *c = layer->GetClef(element); if (!c) { + keySig->SetEmptyBB(); return; } // hidden key signature if (!keySig->m_drawingShow) { + keySig->SetEmptyBB(); + return; + } + + // C major (0) key sig and no cancellation + else if ((keySig->GetAlterationNumber() == 0) && (keySig->m_drawingCancelAccidCount == 0)) { + keySig->SetEmptyBB(); return; } diff --git a/src/view_page.cpp b/src/view_page.cpp index 46cc8bb22b8..5969b2b2873 100644 --- a/src/view_page.cpp +++ b/src/view_page.cpp @@ -172,7 +172,7 @@ void View::DrawScoreDef( DeviceContext *dc, ScoreDef *scoreDef, Measure *measure // we need at least one measure to be able to draw the groups - we need access to the staff elements, assert( measure ); - StaffGrp *staffGrp = dynamic_cast(scoreDef->FindChildByType( STAFF_GRP ) ); + StaffGrp *staffGrp = dynamic_cast(scoreDef->FindChildByType( STAFFGRP ) ); if ( !staffGrp ) { return; } @@ -961,7 +961,7 @@ void View::DrawSystemChildren( DeviceContext *dc, Object *parent, System *system DrawSystemEditorialElement( dc , dynamic_cast(current), system ); } // scoreDef are not drawn directly, but anything else should not be possible - else if (current->Is() == SCORE_DEF) { + else if (current->Is() == SCOREDEF) { // nothing to do, then // ScoreDef *scoreDef = dynamic_cast(current); // assert( scoreDef ); From fda7455e04deead4e4a5d8a0a2497b61334d9ab4 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Thu, 3 Sep 2015 10:05:57 +0200 Subject: [PATCH 102/114] MRest with 2 measures --- src/view_element.cpp | 62 ++++++++++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/src/view_element.cpp b/src/view_element.cpp index ad7c75f85a2..65c1372f2dc 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -663,8 +663,8 @@ void View::DrawMultiRest(DeviceContext *dc, LayerElement *element, Layer *layer, assert( staff ); assert( measure ); - MultiRest *multirest = dynamic_cast(element); - assert( multirest ); + MultiRest *multiRest = dynamic_cast(element); + assert( multiRest ); int x1, x2, y1, y2, length; @@ -675,36 +675,48 @@ void View::DrawMultiRest(DeviceContext *dc, LayerElement *element, Layer *layer, // We do not support more than three chars - if (multirest->GetNum() > 999) multirest->SetNum(999); + int num = std::min( multiRest->GetNum(), 999); - // This is 1/2 the length of th black rectangle - length = width - 2 * m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); - - // Position centered in third line - y1 = staff->GetDrawingY() - (m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) / 2) * 5; - y2 = y1 + m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); - - // a is the central point, claculate x and x2 - x1 = xCentered - length / 2; - x2 = xCentered + length / 2; - - // Draw the base rect - // make it 8 pixels smaller than the interline space - // these are the two 4 substracted and added - DrawFullRectangle(dc, x1, y2 - 4, x2, y1 + 4); - - //Draw the to lines at beginning and end - // make it 8 pixesl longers, and 4 pixels width - int border = m_doc->GetDrawingUnit(staff->m_drawingStaffSize); - DrawVerticalLine(dc, y1 - border, y2 + border, x1, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) * 2); - DrawVerticalLine(dc, y1 - border, y2 + border, x2, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) * 2); + if (num > 2 ) { + // This is 1/2 the length of th black rectangle + length = width - 2 * m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); + + // a is the central point, claculate x and x2 + x1 = xCentered - length / 2; + x2 = xCentered + length / 2; + + // Position centered in third line + y1 = staff->GetDrawingY() - (m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) / 2) * 5; + y2 = y1 + m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); + + // Draw the base rect + // make it 8 pixels smaller than the interline space + // these are the two 4 substracted and added + DrawFullRectangle(dc, x1, y2, x2, y1); + + //Draw the to lines at beginning and end + // make it 8 pixesl longers, and 4 pixels width + int border = m_doc->GetDrawingUnit(staff->m_drawingStaffSize); + DrawVerticalLine(dc, y1 - border, y2 + border, x1, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) * 2); + DrawVerticalLine(dc, y1 - border, y2 + border, x2, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) * 2); + } + else { + // Draw the base rect + x1 = xCentered - m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) / 3; + x2 = xCentered + m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) / 3 ; + + // Position centered in third line + y1 = staff->GetDrawingY() - (m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) / 2) * 4; + y2 = y1 + m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); + DrawFullRectangle(dc, x1, y2 - 4, x2, y1 + 4); + } // Draw the text above int w, h; int start_offset = 0; // offset from x to center text // convert to string - std::wstring wtext = IntToTimeSigFigures(multirest->GetNum()); + std::wstring wtext = IntToTimeSigFigures(num); dc->SetFont(m_doc->GetDrawingSmuflFont(staff->m_drawingStaffSize, false)); dc->GetSmuflTextExtent( wtext, &w, &h); From 1cfe07804dbfd6a65dbdfae9e20f911329277763 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Fri, 4 Sep 2015 14:34:54 +0200 Subject: [PATCH 103/114] Supporting @tie on notes within /chords --- src/doc.cpp | 2 -- src/note.cpp | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/doc.cpp b/src/doc.cpp index ebaba373dc6..a7cdff9e098 100644 --- a/src/doc.cpp +++ b/src/doc.cpp @@ -164,8 +164,6 @@ void Doc::PrepareDrawing() filters.push_back( &matchStaff ); filters.push_back( &matchLayer ); - // The first pass set m_drawingFirstNote and m_drawingLastNote for each syl - // m_drawingLastNote is set only if the syl has a forward connector currentChord = NULL; currentNotes.clear(); ArrayPtrVoid paramsTieAttr; diff --git a/src/note.cpp b/src/note.cpp index d11a5e0b179..7d00ed8b90e 100644 --- a/src/note.cpp +++ b/src/note.cpp @@ -191,7 +191,8 @@ int Note::PrepareTieAttr( ArrayPtrVoid *params ) Chord **currentChord = static_cast((*params).at(1)); AttTiepresent *check = this; - if ((*currentChord)) { + // Use the parent chord if there is no @tie on the note + if (!this->HasTie() && (*currentChord)) { check = (*currentChord); } assert(check); From 0a23b1bfd85a0ace4c2183aa59558c8ce4d6cd54 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Fri, 4 Sep 2015 22:56:56 +0200 Subject: [PATCH 104/114] Improving ties in chords --- include/vrv/doc.h | 15 +++++++++- include/vrv/note.h | 2 ++ include/vrv/style.h | 19 +++++++++++-- include/vrv/view.h | 5 ++-- src/doc.cpp | 1 - src/note.cpp | 15 ++++++++++ src/style.cpp | 8 ++++++ src/view_floating.cpp | 66 +++++++++++++++++++++++++------------------ src/view_graph.cpp | 53 ++++++++++++++++++++++++++++++---- 9 files changed, 145 insertions(+), 39 deletions(-) diff --git a/include/vrv/doc.h b/include/vrv/doc.h index ed9629a79b1..0c7f71fc767 100644 --- a/include/vrv/doc.h +++ b/include/vrv/doc.h @@ -11,12 +11,12 @@ #include "devicecontextbase.h" #include "scoredef.h" +#include "style.h" namespace vrv { class FontInfo; class Page; -class Style; enum DocType { Raw = 0, @@ -109,6 +109,19 @@ class Doc: public Object void SetSpacingStaff( short spacingStaff ); void SetSpacingSystem( short spacingSystem ); ///@} + + /** + * @name Getters for tie and slur parameters + */ + ///@{ + char GetTieMinHeight() { return m_style->m_minTieHeight; }; + char GetTieMaxHeight() { return m_style->m_maxTieHeight; }; + char GetTieThickness() { return m_style->m_tieThickness; }; + char GetSlurMinHeight() { return m_style->m_minSlurHeight; }; + char GetSlurMaxHeight() { return m_style->m_maxSlurHeight; }; + char GetSlurThickness() { return m_style->m_slurThickness; }; + ///@} + /** * @name Getters for the page dimensions and margins diff --git a/include/vrv/note.h b/include/vrv/note.h index 3b473cc706b..b9a77d87880 100644 --- a/include/vrv/note.h +++ b/include/vrv/note.h @@ -99,6 +99,8 @@ class Note: public LayerElement, public DurationInterface, public PitchInterface Chord* IsChordTone( ); int GetDrawingDur( ); bool IsClusterExtreme( ); //used to find if is the highest or lowest note in a cluster + /** Return 0 if the note id the middle note, -1 if below it and 1 if above */ + int PositionInChord(); ///@} /** diff --git a/include/vrv/style.h b/include/vrv/style.h index 8663f30d107..a3da4161562 100644 --- a/include/vrv/style.h +++ b/include/vrv/style.h @@ -51,9 +51,6 @@ namespace vrv { #define MIN_STEM_WIDTH 1.0 #define MAX_STEM_WIDTH 5.0 -#define MIN_TIE_HEIGHT 20 -#define MIN_TIE_THICKNESS 6 - //---------------------------------------------------------------------------- // Default scaling (%) and spacing (units) values //---------------------------------------------------------------------------- @@ -78,6 +75,14 @@ namespace vrv { #define MIN_MEASURE_WIDTH 1.0 #define MAX_MEASURE_WIDTH 30.0 +#define DEFAULT_MIN_TIE_HEIGHT 1.5 +#define DEFAULT_MAX_TIE_HEIGHT 3.0 +#define DEFAULT_TIE_THICKNESS 0.8 + +#define DEFAULT_MIN_SLUR_HEIGHT 1.5 +#define DEFAULT_MAX_SLUR_HEIGHT 3.0 +#define DEFAULT_SLUR_THICKNESS 0.8 + /** The default position at the beginning of a measure */ #define DEFAULT_LEFT_POSITION 1.3 @@ -185,6 +190,14 @@ class Style /** The lyrics size (in units / PARAM_DENOMINATOR) */ int m_lyricSize; + /** ties and slurs */ + char m_minTieHeight; + char m_maxTieHeight; + char m_tieThickness; + char m_minSlurHeight; + char m_maxSlurHeight; + char m_slurThickness; + /** The left position */ char m_leftPosition; diff --git a/include/vrv/view.h b/include/vrv/view.h index 8426d5ebc9f..eb20d27ddcd 100644 --- a/include/vrv/view.h +++ b/include/vrv/view.h @@ -311,8 +311,9 @@ class View void DrawVerticalLine ( DeviceContext *dc, int y1, int y2, int x1, int nbr); void DrawHorizontalLine ( DeviceContext *dc, int x1, int x2, int y1, int nbr); void DrawSmuflCode ( DeviceContext *dc, int x, int y, wchar_t code, int staffSize, bool dimin ); - void DrawTieOrSlurBezier(DeviceContext *dc, int x, int y, int x1, int y1, bool direction); - void DrawPartFullRectangle( DeviceContext *dc, int x1, int y1, int x2, int y2, int fillSection); + void DrawSlurBezier(DeviceContext *dc, int x, int y, int x1, int y1, bool direction, int staffSize); + void DrawTieBezier(DeviceContext *dc, int x, int y, int x1, int y1, bool direction, int staffSzie); + void DrawPartFullRectangle( DeviceContext *dc, int x1, int y1, int x2, int y2, int fillSection); void DrawSmuflString ( DeviceContext *dc, int x, int y, std::wstring s, bool center, int staffSize = 100); void DrawLyricString ( DeviceContext *dc, int x, int y, std::wstring s, int staffSize = 100); void DrawFullRectangle( DeviceContext *dc, int x1, int y1, int x2, int y2); diff --git a/src/doc.cpp b/src/doc.cpp index a7cdff9e098..45a3b999f9c 100644 --- a/src/doc.cpp +++ b/src/doc.cpp @@ -31,7 +31,6 @@ #include "slur.h" #include "smufl.h" #include "staff.h" -#include "style.h" #include "syl.h" #include "system.h" #include "verse.h" diff --git a/src/note.cpp b/src/note.cpp index 7d00ed8b90e..c9866268bf6 100644 --- a/src/note.cpp +++ b/src/note.cpp @@ -164,6 +164,21 @@ bool Note::IsClusterExtreme() else return false; } + +int Note::PositionInChord() +{ + Chord* chordParent = dynamic_cast(this->GetFirstParent( CHORD, MAX_CHORD_DEPTH)); + // This method should be called only if the note is part of a chord + assert( chordParent ); + int size = (int)chordParent->GetList(chordParent)->size(); + int position = chordParent->GetListIndex(this); + assert( position != -1 ); + // this is the middle (only if odd) + if ((size % 2) && (position == (size - 1 ) / 2)) return 0; + if (position < (size / 2)) return -1; + return 1; +} + data_STEMDIRECTION Note::CalcDrawingStemDir() { Chord* chordParent = dynamic_cast(this->GetFirstParent( CHORD, MAX_CHORD_DEPTH)); diff --git a/src/style.cpp b/src/style.cpp index 85051cafbfd..538d9067479 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -51,6 +51,14 @@ Style::Style() m_minMeasureWidth = (short)(DEFAULT_MEASURE_WIDTH * PARAM_DENOMINATOR); + /** ties and slurs */ + m_minTieHeight = DEFAULT_MIN_TIE_HEIGHT * PARAM_DENOMINATOR; + m_maxTieHeight = DEFAULT_MAX_TIE_HEIGHT * PARAM_DENOMINATOR; + m_tieThickness = DEFAULT_TIE_THICKNESS * PARAM_DENOMINATOR; + m_minSlurHeight = DEFAULT_MIN_SLUR_HEIGHT * PARAM_DENOMINATOR; + m_maxSlurHeight = DEFAULT_MAX_SLUR_HEIGHT * PARAM_DENOMINATOR;; + m_slurThickness = DEFAULT_SLUR_THICKNESS * PARAM_DENOMINATOR; + /** The left spacing */ m_leftPosition = DEFAULT_LEFT_POSITION * DEFINITON_FACTOR; diff --git a/src/view_floating.cpp b/src/view_floating.cpp index 23964714255..861eab3a69c 100644 --- a/src/view_floating.cpp +++ b/src/view_floating.cpp @@ -227,7 +227,6 @@ void View::DrawSlur( DeviceContext *dc, Slur *slur, int x1, int x2, Staff *staff else if ( spanningType == SPANNING_END ) { y1 = element2->GetDrawingY(); y2 = y1; - x2 = element2->GetDrawingX(); noteStemDir = element2->GetDrawingStemDir(); } // Finally @@ -264,7 +263,7 @@ void View::DrawSlur( DeviceContext *dc, Slur *slur, int x1, int x2, Staff *staff if ( graphic ) dc->ResumeGraphic(graphic, graphic->GetUuid()); else dc->StartGraphic(slur, "spanning-slur", ""); dc->DeactivateGraphic(); - DrawTieOrSlurBezier(dc, x1, y1, x2, y2, !up); + DrawSlurBezier(dc, x1, y1, x2, y2, !up, staff->m_drawingStaffSize); dc->ReactivateGraphic(); if ( graphic ) dc->EndResumedGraphic(graphic, this); @@ -278,23 +277,25 @@ void View::DrawTie( DeviceContext *dc, Tie *tie, int x1, int x2, Staff *staff, assert( tie ); assert( staff ); - LayerElement *element1 = NULL; - LayerElement *element2 = NULL; + Note *note1 = NULL; + Note *note2 = NULL; bool up = true; data_STEMDIRECTION noteStemDir = STEMDIRECTION_NONE; int y1, y2; - element1 = tie->GetStart(); - element2 = tie->GetEnd(); + /************** parent layers **************/ - if ( !element1 || !element2 ) { + note1 = dynamic_cast(tie->GetStart()); + note2 = dynamic_cast(tie->GetEnd()); + + if ( !note1 || !note2 ) { // no note, obviously nothing to do... return; } - Layer* layer1 = dynamic_cast(element1->GetFirstParent( LAYER ) ); - Layer* layer2 = dynamic_cast(element2->GetFirstParent( LAYER ) ); + Layer* layer1 = dynamic_cast(note1->GetFirstParent( LAYER ) ); + Layer* layer2 = dynamic_cast(note2->GetFirstParent( LAYER ) ); assert( layer1 && layer2 ); if ( layer1->GetN() != layer2->GetN() ) { @@ -303,24 +304,26 @@ void View::DrawTie( DeviceContext *dc, Tie *tie, int x1, int x2, Staff *staff, //the normal case if ( spanningType == SPANNING_START_END ) { - y1 = element1->GetDrawingY(); - y2 = element2->GetDrawingY(); - noteStemDir = element1->GetDrawingStemDir(); + y1 = note1->GetDrawingY(); + y2 = note2->GetDrawingY(); + x1 += m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 3 / 2; + x2 -= m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 3 / 2; + noteStemDir = note1->GetDrawingStemDir(); } // This is the case when the tie is split over two system of two pages. // In this case, we are now drawing its beginning to the end of the measure (i.e., the last aligner) else if ( spanningType == SPANNING_START ) { - y1 = element1->GetDrawingY(); + y1 = note1->GetDrawingY(); y2 = y1; - noteStemDir = element1->GetDrawingStemDir(); + x1 += m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 3 / 2; + noteStemDir = note1->GetDrawingStemDir(); } // Now this is the case when the tie is split but we are drawing the end of it else if ( spanningType == SPANNING_END ) { - y1 = element2->GetDrawingY(); + y1 = note2->GetDrawingY(); y2 = y1; - x2 = element2->GetDrawingX(); - noteStemDir = element2->GetDrawingStemDir(); - + x2 -= m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 3 / 2; + noteStemDir = note2->GetDrawingStemDir(); } // Finally else { @@ -328,10 +331,20 @@ void View::DrawTie( DeviceContext *dc, Tie *tie, int x1, int x2, Staff *staff, return; } - //layer direction trumps note direction + /************** direction: **************/ + + // first should be the tie @curvedir + // then layer direction trumps note direction if (layer1 && layer1->GetDrawingStemDir() != STEMDIRECTION_NONE){ up = layer1->GetDrawingStemDir() == STEMDIRECTION_up ? true : false; } + // the look if in a chord + else if (note1->IsChordTone()) { + if (note1->PositionInChord() < 0) up = false; + else if (note1->PositionInChord() > 0) up = true; + // away from the stem if odd number (center note) + else up = (noteStemDir != STEMDIRECTION_up); + } else if (noteStemDir == STEMDIRECTION_up) { up = false; } @@ -341,22 +354,21 @@ void View::DrawTie( DeviceContext *dc, Tie *tie, int x1, int x2, Staff *staff, up = (y1 > center) ? true : false; } - // FIXME, take in account elements that can be netween notes, eg keys time etc - // 20 height nice with 70, not nice with 50 - // Also remove HARDCODED values! + /************** points **************/ + if (up) { - y1 += m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 1.6; - y2 += m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 1.6; + y1 += m_doc->GetDrawingUnit(staff->m_drawingStaffSize) / 2; + y2 += m_doc->GetDrawingUnit(staff->m_drawingStaffSize) / 2; } else { - y1 -= m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 1.6; - y2 -= m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 1.6; + y1 -= m_doc->GetDrawingUnit(staff->m_drawingStaffSize) / 2; + y2 -= m_doc->GetDrawingUnit(staff->m_drawingStaffSize) / 2; } if ( graphic ) dc->ResumeGraphic(graphic, graphic->GetUuid()); else dc->StartGraphic(tie, "spanning-tie", ""); dc->DeactivateGraphic(); - DrawTieOrSlurBezier(dc, x1, y1, x2, y2, !up); + DrawTieBezier(dc, x1, y1, x2, y2, !up, staff->m_drawingStaffSize); dc->ReactivateGraphic(); if ( graphic ) dc->EndResumedGraphic(graphic, this); diff --git a/src/view_graph.cpp b/src/view_graph.cpp index 58d4c7e240b..c9d80cc0048 100755 --- a/src/view_graph.cpp +++ b/src/view_graph.cpp @@ -114,7 +114,6 @@ void View::DrawObliquePolygon ( DeviceContext *dc, int x1, int y1, int x2, int y } - void View::DrawDot ( DeviceContext *dc, int x, int y, int staffSize ) { int r = std::max( ToDeviceContextX( m_doc->GetDrawingDoubleUnit( staffSize ) / 5 ), 2 ); @@ -203,13 +202,57 @@ void View::DrawLyricString ( DeviceContext *dc, int x, int y, std::wstring s, in dc->EndText( ); } -void View::DrawTieOrSlurBezier(DeviceContext *dc, int x, int y, int x1, int y1, bool direction) +void View::DrawTieBezier(DeviceContext *dc, int x, int y, int x1, int y1, bool direction, int staffSize) { assert( dc ); - int height = std::max( MIN_TIE_HEIGHT * DEFINITON_FACTOR, std::min( 5 * m_doc->GetDrawingDoubleUnit( 100 ) / 3, abs( x1 - x ) / 4 ) ); + int height = std::max( m_doc->GetTieMinHeight() * m_doc->GetDrawingUnit(staffSize) / DEFINITON_FACTOR, abs( x1 - x ) / 4 ); + height = std::min( m_doc->GetTieMaxHeight() * m_doc->GetDrawingUnit(staffSize) / DEFINITON_FACTOR, height ); + int thickness = m_doc->GetDrawingUnit(staffSize) * m_doc->GetTieThickness() / DEFINITON_FACTOR ; + + int one, two; // control points at 1/4 and 3/4 of total lenght + int bez1[6], bez2[6]; // filled array with control points and end point + + int top_y, top_y_fill; // Y for control points in both beziers + + one = (x1 - x) / 4; // point at 1/4 + two = (x1 - x) / 4 * 3; // point at 3/4 + + if (direction) { + // tie goes up + top_y = std::min(y, y1) - height; + // the second bezier in internal + top_y_fill = top_y + thickness; + } else { + //tie goes down + top_y = std::max(y, y1) + height; + // second bezier is internal as above + top_y_fill = top_y - thickness; + } + + // Points for first bez, they go from xy to x1y1 + bez1[0] = ToDeviceContextX(x + one); bez1[1] = ToDeviceContextY(top_y); + bez1[2] = ToDeviceContextX(x + two); bez1[3] = ToDeviceContextY(top_y); + bez1[4] = ToDeviceContextX(x1); bez1[5] = ToDeviceContextY(y1); + + // second bez. goes back + bez2[0] = ToDeviceContextX(x + two); bez2[1] = ToDeviceContextY(top_y_fill); + bez2[2] = ToDeviceContextX(x + one); bez2[3] = ToDeviceContextY(top_y_fill); + bez2[4] = ToDeviceContextX(x); bez2[5] = ToDeviceContextY(y); + + // Actually draw it + dc->SetPen( m_currentColour, std::max( 1, m_doc->GetDrawingStemWidth(staffSize) / 2 ), AxSOLID ); + dc->DrawComplexBezierPath(ToDeviceContextX(x), ToDeviceContextY(y), bez1, bez2); + dc->ResetPen(); +} + +void View::DrawSlurBezier(DeviceContext *dc, int x, int y, int x1, int y1, bool direction, int staffSize) +{ + assert( dc ); - int thickness = std::max( m_doc->GetDrawingDoubleUnit(100) / 3, MIN_TIE_THICKNESS * DEFINITON_FACTOR ); + int height = std::max( m_doc->GetSlurMinHeight() * m_doc->GetDrawingUnit(staffSize) / DEFINITON_FACTOR, abs( x1 - x ) / 4 ); + height = std::min( m_doc->GetSlurMaxHeight() * m_doc->GetDrawingUnit(staffSize) / DEFINITON_FACTOR, height ); + int thickness = m_doc->GetDrawingUnit(staffSize) * m_doc->GetSlurThickness() / DEFINITON_FACTOR ; int one, two; // control points at 1/4 and 3/4 of total lenght int bez1[6], bez2[6]; // filled array with control points and end point @@ -242,7 +285,7 @@ void View::DrawTieOrSlurBezier(DeviceContext *dc, int x, int y, int x1, int y1, bez2[4] = ToDeviceContextX(x); bez2[5] = ToDeviceContextY(y); // Actually draw it - dc->SetPen( m_currentColour, std::max( 1, m_doc->GetDrawingStemWidth(100) / 2 ), AxSOLID ); + dc->SetPen( m_currentColour, std::max( 1, m_doc->GetDrawingStemWidth(staffSize) / 2 ), AxSOLID ); dc->DrawComplexBezierPath(ToDeviceContextX(x), ToDeviceContextY(y), bez1, bez2); dc->ResetPen(); } From 71495cd8dae4cfe7b9fbf1a6563d097fe28baad3 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sun, 6 Sep 2015 16:32:04 +0200 Subject: [PATCH 105/114] Improving ties and adding support for curvedir and bulge attributes --- include/vrv/doc.h | 2 - include/vrv/style.h | 8 +--- include/vrv/tie.h | 3 +- include/vrv/view.h | 2 +- libmei/atts_shared.cpp | 12 +++--- libmei/atts_shared.h | 6 +-- src/iomei.cpp | 1 + src/style.cpp | 2 - src/tie.cpp | 6 ++- src/view_element.cpp | 2 +- src/view_floating.cpp | 84 +++++++++++++++++++++++++++++++++++++----- src/view_graph.cpp | 42 +++++---------------- 12 files changed, 105 insertions(+), 65 deletions(-) diff --git a/include/vrv/doc.h b/include/vrv/doc.h index 0c7f71fc767..56279613ff2 100644 --- a/include/vrv/doc.h +++ b/include/vrv/doc.h @@ -114,8 +114,6 @@ class Doc: public Object * @name Getters for tie and slur parameters */ ///@{ - char GetTieMinHeight() { return m_style->m_minTieHeight; }; - char GetTieMaxHeight() { return m_style->m_maxTieHeight; }; char GetTieThickness() { return m_style->m_tieThickness; }; char GetSlurMinHeight() { return m_style->m_minSlurHeight; }; char GetSlurMaxHeight() { return m_style->m_maxSlurHeight; }; diff --git a/include/vrv/style.h b/include/vrv/style.h index a3da4161562..a69cbc53a61 100644 --- a/include/vrv/style.h +++ b/include/vrv/style.h @@ -74,10 +74,8 @@ namespace vrv { #define DEFAULT_MEASURE_WIDTH 12.0 #define MIN_MEASURE_WIDTH 1.0 #define MAX_MEASURE_WIDTH 30.0 - -#define DEFAULT_MIN_TIE_HEIGHT 1.5 -#define DEFAULT_MAX_TIE_HEIGHT 3.0 -#define DEFAULT_TIE_THICKNESS 0.8 + +#define DEFAULT_TIE_THICKNESS 0.6 #define DEFAULT_MIN_SLUR_HEIGHT 1.5 #define DEFAULT_MAX_SLUR_HEIGHT 3.0 @@ -191,8 +189,6 @@ class Style int m_lyricSize; /** ties and slurs */ - char m_minTieHeight; - char m_maxTieHeight; char m_tieThickness; char m_minSlurHeight; char m_maxSlurHeight; diff --git a/include/vrv/tie.h b/include/vrv/tie.h index 5789e03f882..ab4d4af7321 100644 --- a/include/vrv/tie.h +++ b/include/vrv/tie.h @@ -20,7 +20,8 @@ namespace vrv { // NOTE tie NOTE tie etc //---------------------------------------------------------------------------- -class Tie: public FloatingElement, public TimeSpanningInterface +class Tie: public FloatingElement, public TimeSpanningInterface, + public AttCurvature { public: /** diff --git a/include/vrv/view.h b/include/vrv/view.h index eb20d27ddcd..b802a2689ca 100644 --- a/include/vrv/view.h +++ b/include/vrv/view.h @@ -311,8 +311,8 @@ class View void DrawVerticalLine ( DeviceContext *dc, int y1, int y2, int x1, int nbr); void DrawHorizontalLine ( DeviceContext *dc, int x1, int x2, int y1, int nbr); void DrawSmuflCode ( DeviceContext *dc, int x, int y, wchar_t code, int staffSize, bool dimin ); + void DrawThickBezierCurve(DeviceContext *dc, Point p1, Point p2, Point c1, Point c2, int thickness, int staffSize); void DrawSlurBezier(DeviceContext *dc, int x, int y, int x1, int y1, bool direction, int staffSize); - void DrawTieBezier(DeviceContext *dc, int x, int y, int x1, int y1, bool direction, int staffSzie); void DrawPartFullRectangle( DeviceContext *dc, int x1, int y1, int x2, int y2, int fillSection); void DrawSmuflString ( DeviceContext *dc, int x, int y, std::wstring s, bool center, int staffSize = 100); void DrawLyricString ( DeviceContext *dc, int x, int y, std::wstring s, int staffSize = 100); diff --git a/libmei/atts_shared.cpp b/libmei/atts_shared.cpp index ee087a62a13..6e6794db2d7 100644 --- a/libmei/atts_shared.cpp +++ b/libmei/atts_shared.cpp @@ -1267,7 +1267,7 @@ AttCurvature::~AttCurvature() { void AttCurvature::ResetCurvature() { m_bezier = ""; - m_bulge = ""; + m_bulge = 0.0; m_curvedir = CURVEDIR_NONE; } @@ -1279,7 +1279,7 @@ bool AttCurvature::ReadCurvature( pugi::xml_node element ) { hasAttribute = true; } if (element.attribute("bulge")) { - this->SetBulge(StrToStr(element.attribute("bulge").value())); + this->SetBulge(StrToDbl(element.attribute("bulge").value())); element.remove_attribute("bulge"); hasAttribute = true; } @@ -1298,7 +1298,7 @@ bool AttCurvature::WriteCurvature( pugi::xml_node element ) { wroteAttribute = true; } if (this->HasBulge()) { - element.append_attribute("bulge") = StrToStr(this->GetBulge()).c_str(); + element.append_attribute("bulge") = DblToStr(this->GetBulge()).c_str(); wroteAttribute = true; } if (this->HasCurvedir()) { @@ -1315,7 +1315,7 @@ bool AttCurvature::HasBezier( ) bool AttCurvature::HasBulge( ) { - return (m_bulge != ""); + return (m_bulge != 0.0); } bool AttCurvature::HasCurvedir( ) @@ -7201,7 +7201,7 @@ bool Att::SetShared( Object *element, std::string attrType, std::string attrValu return true; } if (attrType == "bulge") { - att->SetBulge(att->StrToStr(attrValue)); + att->SetBulge(att->StrToDbl(attrValue)); return true; } if (attrType == "curvedir") { @@ -8584,7 +8584,7 @@ void Att::GetShared( Object *element, ArrayOfStrAttr *attributes ) { attributes->push_back(std::make_pair("bezier", att->StrToStr(att->GetBezier()))); } if (att->HasBulge()) { - attributes->push_back(std::make_pair("bulge", att->StrToStr(att->GetBulge()))); + attributes->push_back(std::make_pair("bulge", att->DblToStr(att->GetBulge()))); } if (att->HasCurvedir()) { attributes->push_back(std::make_pair("curvedir", att->CurvedirToStr(att->GetCurvedir()))); diff --git a/libmei/atts_shared.h b/libmei/atts_shared.h index 9ef1c453438..56368613edd 100644 --- a/libmei/atts_shared.h +++ b/libmei/atts_shared.h @@ -1118,8 +1118,8 @@ class AttCurvature: public Att bool HasBezier( ); // - void SetBulge(std::string bulge_) { m_bulge = bulge_; }; - std::string GetBulge() const { return m_bulge; }; + void SetBulge(double bulge_) { m_bulge = bulge_; }; + double GetBulge() const { return m_bulge; }; bool HasBulge( ); // @@ -1141,7 +1141,7 @@ class AttCurvature: public Att * The bulge attribute must contain one or more decimal values expressed in inter- * line units. **/ - std::string m_bulge; + double m_bulge; /** Describes a curve with a generic term indicating the direction of curvature. **/ data_CURVEDIR m_curvedir; diff --git a/src/iomei.cpp b/src/iomei.cpp index e13ead29fc5..70dc8db90f4 100644 --- a/src/iomei.cpp +++ b/src/iomei.cpp @@ -1452,6 +1452,7 @@ bool MeiInput::ReadMeiTie( Object *parent, pugi::xml_node tie ) Tie *vrvTie = new Tie(); SetMeiUuid(tie, vrvTie); + vrvTie->ReadCurvature(tie); ReadTimeSpanningInterface(tie, vrvTie); AddFloatingElement(parent, vrvTie); diff --git a/src/style.cpp b/src/style.cpp index 538d9067479..c7ea4c1f1bf 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -52,8 +52,6 @@ Style::Style() m_minMeasureWidth = (short)(DEFAULT_MEASURE_WIDTH * PARAM_DENOMINATOR); /** ties and slurs */ - m_minTieHeight = DEFAULT_MIN_TIE_HEIGHT * PARAM_DENOMINATOR; - m_maxTieHeight = DEFAULT_MAX_TIE_HEIGHT * PARAM_DENOMINATOR; m_tieThickness = DEFAULT_TIE_THICKNESS * PARAM_DENOMINATOR; m_minSlurHeight = DEFAULT_MIN_SLUR_HEIGHT * PARAM_DENOMINATOR; m_maxSlurHeight = DEFAULT_MAX_SLUR_HEIGHT * PARAM_DENOMINATOR;; diff --git a/src/tie.cpp b/src/tie.cpp index cd167867345..3bdc1ae6f0f 100644 --- a/src/tie.cpp +++ b/src/tie.cpp @@ -21,8 +21,11 @@ namespace vrv { //---------------------------------------------------------------------------- Tie::Tie(): - FloatingElement("tie-"), TimeSpanningInterface() + FloatingElement("tie-"), TimeSpanningInterface(), + AttCurvature() { + RegisterAttClass(ATT_CURVATURE); + RegisterInterface( TimeSpanningInterface::GetAttClasses(), TimeSpanningInterface::IsInterface() ); Reset(); @@ -37,6 +40,7 @@ void Tie::Reset() { FloatingElement::Reset(); TimeSpanningInterface::Reset(); + ResetCurvature(); } } // namespace vrv \ No newline at end of file diff --git a/src/view_element.cpp b/src/view_element.cpp index 65c1372f2dc..fe54df6709d 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -990,7 +990,7 @@ void View::DrawDots ( DeviceContext *dc, int x, int y, unsigned char dots, Staff } for (i = 0; i < dots; i++) { DrawDot ( dc, x, y, staff->m_drawingStaffSize ); - x += std::max (6, 2 * m_doc->GetDrawingUnit(staff->m_drawingStaffSize)); + x += m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); } } diff --git a/src/view_floating.cpp b/src/view_floating.cpp index 861eab3a69c..e8b8f14c060 100644 --- a/src/view_floating.cpp +++ b/src/view_floating.cpp @@ -263,6 +263,7 @@ void View::DrawSlur( DeviceContext *dc, Slur *slur, int x1, int x2, Staff *staff if ( graphic ) dc->ResumeGraphic(graphic, graphic->GetUuid()); else dc->StartGraphic(slur, "spanning-slur", ""); dc->DeactivateGraphic(); + // Should be change and use DrawThickBezierCurve DrawSlurBezier(dc, x1, y1, x2, y2, !up, staff->m_drawingStaffSize); dc->ReactivateGraphic(); @@ -294,6 +295,8 @@ void View::DrawTie( DeviceContext *dc, Tie *tie, int x1, int x2, Staff *staff, return; } + Chord *chordParent1 = note1->IsChordTone(); + Layer* layer1 = dynamic_cast(note1->GetFirstParent( LAYER ) ); Layer* layer2 = dynamic_cast(note2->GetFirstParent( LAYER ) ); assert( layer1 && layer2 ); @@ -302,12 +305,26 @@ void View::DrawTie( DeviceContext *dc, Tie *tie, int x1, int x2, Staff *staff, LogWarning("Ties between different layers may not be fully supported."); } - //the normal case + /************** x positions **************/ + + bool isShortTie = false; + // shortTie correction cannot be applied for chords + if (!chordParent1 && (x2 - x1 < 3 * m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize))) isShortTie = true; + + // the normal case if ( spanningType == SPANNING_START_END ) { y1 = note1->GetDrawingY(); y2 = note2->GetDrawingY(); - x1 += m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 3 / 2; - x2 -= m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 3 / 2; + if (!isShortTie) { + x1 += m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 3 / 2; + x2 -= m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 3 / 2; + if (note1->HasDots()) { + x1 += m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) * note1->GetDots(); + } + else if (chordParent1 && chordParent1->HasDots()) { + x1 += m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) * chordParent1->GetDots(); + } + } noteStemDir = note1->GetDrawingStemDir(); } // This is the case when the tie is split over two system of two pages. @@ -315,14 +332,18 @@ void View::DrawTie( DeviceContext *dc, Tie *tie, int x1, int x2, Staff *staff, else if ( spanningType == SPANNING_START ) { y1 = note1->GetDrawingY(); y2 = y1; - x1 += m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 3 / 2; + if (!isShortTie) { + x1 += m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 3 / 2; + } noteStemDir = note1->GetDrawingStemDir(); } // Now this is the case when the tie is split but we are drawing the end of it else if ( spanningType == SPANNING_END ) { y1 = note2->GetDrawingY(); y2 = y1; - x2 -= m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 3 / 2; + if (!isShortTie) { + x2 -= m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 3 / 2; + } noteStemDir = note2->GetDrawingStemDir(); } // Finally @@ -331,11 +352,14 @@ void View::DrawTie( DeviceContext *dc, Tie *tie, int x1, int x2, Staff *staff, return; } - /************** direction: **************/ + /************** direction **************/ // first should be the tie @curvedir + if (tie->HasCurvedir()) { + up = (tie->GetCurvedir() == CURVEDIR_above) ? true : false; + } // then layer direction trumps note direction - if (layer1 && layer1->GetDrawingStemDir() != STEMDIRECTION_NONE){ + else if (layer1 && layer1->GetDrawingStemDir() != STEMDIRECTION_NONE){ up = layer1->GetDrawingStemDir() == STEMDIRECTION_up ? true : false; } // the look if in a chord @@ -354,23 +378,63 @@ void View::DrawTie( DeviceContext *dc, Tie *tie, int x1, int x2, Staff *staff, up = (y1 > center) ? true : false; } - /************** points **************/ + /************** y position **************/ if (up) { y1 += m_doc->GetDrawingUnit(staff->m_drawingStaffSize) / 2; y2 += m_doc->GetDrawingUnit(staff->m_drawingStaffSize) / 2; + if (isShortTie) { + y1 += m_doc->GetDrawingUnit(staff->m_drawingStaffSize); + y2 += m_doc->GetDrawingUnit(staff->m_drawingStaffSize); + } } else { y1 -= m_doc->GetDrawingUnit(staff->m_drawingStaffSize) / 2; y2 -= m_doc->GetDrawingUnit(staff->m_drawingStaffSize) / 2; + if (isShortTie) { + y1 -= m_doc->GetDrawingUnit(staff->m_drawingStaffSize); + y2 -= m_doc->GetDrawingUnit(staff->m_drawingStaffSize); + } + + } + + /************** bezier points **************/ + + // the 'height' of the bezier + int height; + if (tie->HasBulge()){ + height = m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * tie->GetBulge(); + } + else { + height = m_doc->GetDrawingUnit(staff->m_drawingStaffSize); + // if the space between the to points is more than two staff height, increase the height + if (x2 - x1 > 2 * m_doc->GetDrawingStaffSize(staff->m_drawingStaffSize)) { + height += m_doc->GetDrawingUnit(staff->m_drawingStaffSize); + } + } + int thickness = m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * m_doc->GetTieThickness() / DEFINITON_FACTOR ; + + // control points + Point c1, c2; + + height = height * 4 / 3; + + c1.x = x1 + (x2 - x1) / 4; // point at 1/4 + c2.x = x1 + (x2 - x1) / 4 * 3; // point at 3/4 + + if (up) { + c1.y = y1 + height; + c2.y = y2 + height; + } else { + c1.y = y1 - height; + c2.y = y2 - height; } if ( graphic ) dc->ResumeGraphic(graphic, graphic->GetUuid()); else dc->StartGraphic(tie, "spanning-tie", ""); dc->DeactivateGraphic(); - DrawTieBezier(dc, x1, y1, x2, y2, !up, staff->m_drawingStaffSize); + DrawThickBezierCurve(dc, Point(x1, y1), Point(x2, y2), c1, c2, thickness, staff->m_drawingStaffSize ); dc->ReactivateGraphic(); - if ( graphic ) dc->EndResumedGraphic(graphic, this); else dc->EndGraphic(tie, this); } diff --git a/src/view_graph.cpp b/src/view_graph.cpp index c9d80cc0048..97877902065 100755 --- a/src/view_graph.cpp +++ b/src/view_graph.cpp @@ -201,51 +201,29 @@ void View::DrawLyricString ( DeviceContext *dc, int x, int y, std::wstring s, in dc->EndText( ); } - -void View::DrawTieBezier(DeviceContext *dc, int x, int y, int x1, int y1, bool direction, int staffSize) + +void View::DrawThickBezierCurve(DeviceContext *dc, Point p1, Point p2, Point c1, Point c2, int thickness, int staffSize) { assert( dc ); - int height = std::max( m_doc->GetTieMinHeight() * m_doc->GetDrawingUnit(staffSize) / DEFINITON_FACTOR, abs( x1 - x ) / 4 ); - height = std::min( m_doc->GetTieMaxHeight() * m_doc->GetDrawingUnit(staffSize) / DEFINITON_FACTOR, height ); - int thickness = m_doc->GetDrawingUnit(staffSize) * m_doc->GetTieThickness() / DEFINITON_FACTOR ; - - int one, two; // control points at 1/4 and 3/4 of total lenght int bez1[6], bez2[6]; // filled array with control points and end point - int top_y, top_y_fill; // Y for control points in both beziers - - one = (x1 - x) / 4; // point at 1/4 - two = (x1 - x) / 4 * 3; // point at 3/4 - - if (direction) { - // tie goes up - top_y = std::min(y, y1) - height; - // the second bezier in internal - top_y_fill = top_y + thickness; - } else { - //tie goes down - top_y = std::max(y, y1) + height; - // second bezier is internal as above - top_y_fill = top_y - thickness; - } - // Points for first bez, they go from xy to x1y1 - bez1[0] = ToDeviceContextX(x + one); bez1[1] = ToDeviceContextY(top_y); - bez1[2] = ToDeviceContextX(x + two); bez1[3] = ToDeviceContextY(top_y); - bez1[4] = ToDeviceContextX(x1); bez1[5] = ToDeviceContextY(y1); + bez1[0] = ToDeviceContextX(c1.x); bez1[1] = ToDeviceContextY(c1.y + thickness / 2); + bez1[2] = ToDeviceContextX(c2.x); bez1[3] = ToDeviceContextY(c2.y + thickness / 2); + bez1[4] = ToDeviceContextX(p2.x); bez1[5] = ToDeviceContextY(p2.y); // second bez. goes back - bez2[0] = ToDeviceContextX(x + two); bez2[1] = ToDeviceContextY(top_y_fill); - bez2[2] = ToDeviceContextX(x + one); bez2[3] = ToDeviceContextY(top_y_fill); - bez2[4] = ToDeviceContextX(x); bez2[5] = ToDeviceContextY(y); + bez2[0] = ToDeviceContextX(c2.x); bez2[1] = ToDeviceContextY(c1.y - thickness / 2); + bez2[2] = ToDeviceContextX(c1.x); bez2[3] = ToDeviceContextY(c2.y - thickness / 2); + bez2[4] = ToDeviceContextX(p1.x); bez2[5] = ToDeviceContextY(p1.y); // Actually draw it dc->SetPen( m_currentColour, std::max( 1, m_doc->GetDrawingStemWidth(staffSize) / 2 ), AxSOLID ); - dc->DrawComplexBezierPath(ToDeviceContextX(x), ToDeviceContextY(y), bez1, bez2); + dc->DrawComplexBezierPath(ToDeviceContextX(p1.x), ToDeviceContextY(p1.y), bez1, bez2); dc->ResetPen(); } - + void View::DrawSlurBezier(DeviceContext *dc, int x, int y, int x1, int y1, bool direction, int staffSize) { assert( dc ); From 019b9a27181494a281162a22ced5d74ea5b5a122 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sun, 6 Sep 2015 16:32:23 +0200 Subject: [PATCH 106/114] Various fixes --- include/vrv/rpt.h | 3 +++ src/view_element.cpp | 5 +++++ src/view_page.cpp | 7 +++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/include/vrv/rpt.h b/include/vrv/rpt.h index 409161c341b..54163056d18 100644 --- a/include/vrv/rpt.h +++ b/include/vrv/rpt.h @@ -37,6 +37,9 @@ class BeatRpt: public LayerElement, virtual ClassId Is() { return BEATRPT; }; ///@} + /** Override the method since alignment is required */ + virtual bool HasToBeAligned() { return true; }; + /** * Returns the duration (in double) for the element. * Careful: this method is not overriding LayerElement::GetAlignmentDuration since diff --git a/src/view_element.cpp b/src/view_element.cpp index fe54df6709d..d8fd4fa0bf7 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -1005,6 +1005,11 @@ void View::DrawBarline( DeviceContext *dc, LayerElement *element, Layer *layer, Barline *barLine = dynamic_cast(element); assert( barLine ); + if (barLine->GetRend() == BARRENDITION_invis) { + barLine->SetEmptyBB(); + return; + } + dc->StartGraphic( element, "", element->GetUuid() ); int y = staff->GetDrawingY(); diff --git a/src/view_page.cpp b/src/view_page.cpp index 5969b2b2873..72655ecd9c2 100644 --- a/src/view_page.cpp +++ b/src/view_page.cpp @@ -177,7 +177,7 @@ void View::DrawScoreDef( DeviceContext *dc, ScoreDef *scoreDef, Measure *measure return; } - if ( barLine == NULL) { + if (barLine == NULL) { // Draw the first staffGrp and from there its children recursively DrawStaffGrp( dc, measure, staffGrp, x, true, !scoreDef->DrawLabels() ); @@ -185,7 +185,7 @@ void View::DrawScoreDef( DeviceContext *dc, ScoreDef *scoreDef, Measure *measure // if this was true (non-abbreviated labels), set it to false for next one scoreDef->SetDrawLabels( false ); } - else{ + else { barLine->SetDrawingX( x ); dc->StartGraphic( barLine, "", barLine->GetUuid() ); DrawBarlines( dc, measure, staffGrp, barLine ); @@ -607,6 +607,9 @@ void View::DrawBarline( DeviceContext *dc, int y_top, int y_bottom, Barline *bar DrawVerticalLine( dc , y_top, y_bottom, x1, barLineWidth); DrawVerticalLine( dc , y_top, y_bottom, x, m_doc->GetDrawingBeamWidth(100, false)); } + else { + barLine->SetEmptyBB(); + } } From 76c62c83ea5837dc0a3816905948d721166229dc Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sun, 6 Sep 2015 16:59:49 +0200 Subject: [PATCH 107/114] Fixing margin for labels --- src/view_page.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/view_page.cpp b/src/view_page.cpp index 72655ecd9c2..17d309f961a 100644 --- a/src/view_page.cpp +++ b/src/view_page.cpp @@ -246,7 +246,8 @@ void View::DrawStaffGrp( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp if ( label.length() != 0) { // HARDCODED - int x_label = x - 4 * m_doc->GetDrawingBeamWidth(100, false); + int space = 4 * m_doc->GetDrawingBeamWidth(100, false); + int x_label = x - space; int y_label = y_bottom - (y_bottom - y_top) / 2 - m_doc->GetDrawingUnit(100); dc->SetBrush( m_currentColour, AxSOLID ); @@ -260,7 +261,7 @@ void View::DrawStaffGrp( DeviceContext *dc, Measure *measure, StaffGrp *staffGrp LogDebug("Staff or System missing in View::DrawStaffDefLabels"); } else { - system->SetDrawingLabelsWidth( w ); + system->SetDrawingLabelsWidth( w + space ); } dc->StartText( ToDeviceContextX( x_label ), ToDeviceContextY( y_label ), RIGHT ); @@ -339,7 +340,8 @@ void View::DrawStaffDefLabels( DeviceContext *dc, Measure *measure, ScoreDef *sc } // HARDCODED - int x = system->GetDrawingX() - 3 * m_doc->GetDrawingBeamWidth(100, false); + int space = 3 * m_doc->GetDrawingBeamWidth(100, false); + int x = system->GetDrawingX() - space; int y = staff->GetDrawingY() - (staffDef->GetLines() * m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) / 2); dc->SetBrush( m_currentColour, AxSOLID ); @@ -347,7 +349,7 @@ void View::DrawStaffDefLabels( DeviceContext *dc, Measure *measure, ScoreDef *sc // keep the widest width for the system dc->GetTextExtent( label, &w, &h); - system->SetDrawingLabelsWidth( w ); + system->SetDrawingLabelsWidth( w + space ); dc->StartText( ToDeviceContextX( x ), ToDeviceContextY( y ), RIGHT ); dc->DrawText( label ); From 73375ed7414c5b0e945c5294ed2b4034d3cfc861 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sun, 6 Sep 2015 17:07:49 +0200 Subject: [PATCH 108/114] Fixing converter error messages --- src/att.cpp | 120 +++++++++++++++++++++++++------------------------- src/iomei.cpp | 1 - 2 files changed, 60 insertions(+), 61 deletions(-) diff --git a/src/att.cpp b/src/att.cpp index ad2e74ba0fb..d0b7e7d06ea 100644 --- a/src/att.cpp +++ b/src/att.cpp @@ -84,7 +84,7 @@ std::string Att::AccidentalExplicitToStr(data_ACCIDENTAL_EXPLICIT data) case ACCIDENTAL_EXPLICIT_nu : value = "nu"; break; case ACCIDENTAL_EXPLICIT_nd : value = "nd"; break; default: - LogWarning("Unknown mode '%d'", data); + LogWarning("Unknown accidental explicit '%d'", data); value = ""; break; } @@ -111,7 +111,7 @@ data_ACCIDENTAL_EXPLICIT Att::StrToAccidentalExplicit(std::string value) else if (value == "nu") return ACCIDENTAL_EXPLICIT_nu; else if (value == "nd") return ACCIDENTAL_EXPLICIT_nd; else { - LogWarning("Unsupported pitch name '%s'", value.c_str() ); + LogWarning("Unsupported accidental explicit '%s'", value.c_str() ); } return ACCIDENTAL_EXPLICIT_NONE; } @@ -131,7 +131,7 @@ std::string Att::AccidentalImplicitToStr(data_ACCIDENTAL_IMPLICIT data) case ACCIDENTAL_IMPLICIT_fu : value = "fu"; break; case ACCIDENTAL_IMPLICIT_fd : value = "fd"; break; default: - LogWarning("Unknown mode '%d'", data); + LogWarning("Unknown accidental implicit '%d'", data); value = ""; break; } @@ -150,7 +150,7 @@ data_ACCIDENTAL_IMPLICIT Att::StrToAccidentalImplicit(std::string value) else if (value == "fu") return ACCIDENTAL_IMPLICIT_fu; else if (value == "fd") return ACCIDENTAL_IMPLICIT_fd; else { - LogWarning("Unsupported pitch name '%s'", value.c_str() ); + LogWarning("Unsupported accidental implicit '%s'", value.c_str() ); } return ACCIDENTAL_IMPLICIT_NONE; } @@ -172,7 +172,7 @@ std::string Att::BarRenditionToStr(data_BARRENDITION data) case BARRENDITION_rptend : value = "rptend"; break; case BARRENDITION_single : value = "single"; break; default: - LogWarning("Unknown mode '%d'", data); + LogWarning("Unknown bar rendition '%d'", data); value = ""; break; } @@ -193,7 +193,7 @@ data_BARRENDITION Att::StrToBarRendition(std::string value) else if (value == "rptend") return BARRENDITION_rptend; else if (value == "single") return BARRENDITION_single; else { - LogWarning("Unsupported pitch name '%s'", value.c_str() ); + LogWarning("Unsupported bar rendition '%s'", value.c_str() ); } return BARRENDITION_NONE; } @@ -211,7 +211,7 @@ std::string Att::BeatrptRendToStr(data_BEATRPT_REND data) case BEATRPT_REND_128 : value = "128"; break; case BEATRPT_REND_mixed : value = "mixed"; break; default: - LogWarning("Unknown mode '%d'", data); + LogWarning("Unknown beatrpt rend '%d'", data); value = ""; break; } @@ -241,7 +241,7 @@ std::string Att::BoolToStr(data_BOOLEAN data) case BOOLEAN_true : value = "true"; break; case BOOLEAN_false : value = "false"; break; default: - LogWarning("Unknown mode '%d'", data); + LogWarning("Unknown bool '%d'", data); value = ""; break; } @@ -253,7 +253,7 @@ data_BOOLEAN Att::StrToBool(std::string value) if (value == "true") return BOOLEAN_true; else if (value == "false") return BOOLEAN_false; else { - LogWarning("Unsupported pitch name '%s'", value.c_str() ); + LogWarning("Unsupported bool '%s'", value.c_str() ); } return BOOLEAN_NONE; } @@ -286,7 +286,7 @@ data_CLEFSHAPE Att::StrToClefShape( std::string value ) else if ( value == "perc" ) data = CLEFSHAPE_perc; else { - LogWarning("Unsupported clef with @shape '%s'", value.c_str()); + LogWarning("Unsupported clef shape '%s'", value.c_str()); } return data; } @@ -305,7 +305,7 @@ std::string Att::ConToStr(data_CON data) case CON_i : value = "i"; break; case CON_b : value = "b"; break; default: - LogWarning("Unknown mode '%d'", data); + LogWarning("Unknown con '%d'", data); value = ""; break; } @@ -323,7 +323,7 @@ data_CON Att::StrToCon(std::string value) else if (value == "i") return CON_i; else if (value == "b") return CON_b; else { - LogWarning("Unsupported pitch name '%s'", value.c_str() ); + LogWarning("Unsupported con '%s'", value.c_str() ); } return CON_NONE; } @@ -376,7 +376,7 @@ std::string Att::DurToStr(data_DURATION data) else if (data == DURATION_128) value = "128"; else if (data == DURATION_256) value = "256"; else { - LogWarning("Unknown duration '%d'", data); + LogWarning("Unknown dur '%d'", data); value = "4"; } return value; @@ -409,7 +409,7 @@ data_DURATION Att::StrToDur(std::string value) //LogWarning("PPQ duration dur_s are not supported"); // remove it for now } else { - LogWarning("Unknown @dur dur '%s'", value.c_str()); + LogWarning("Unknown dur '%s'", value.c_str()); } dur = DURATION_NONE; } @@ -425,7 +425,7 @@ std::string Att::FontstyleToStr(data_FONTSTYLE data) case FONTSTYLE_normal : value = "normal"; break; case FONTSTYLE_oblique : value = "oblique"; break; default: - LogWarning("Unknown mode '%d'", data); + LogWarning("Unknown fontstyle '%d'", data); value = ""; break; } @@ -438,7 +438,7 @@ data_FONTSTYLE Att::StrToFontstyle(std::string value) else if (value == "normal") return FONTSTYLE_normal; else if (value == "oblique") return FONTSTYLE_oblique; else { - LogWarning("Unsupported pitch name '%s'", value.c_str() ); + LogWarning("Unsupported fontstyle '%s'", value.c_str() ); } return FONTSTYLE_NONE; } @@ -451,7 +451,7 @@ std::string Att::FontweightToStr(data_FONTWEIGHT data) case FONTWEIGHT_bold : value = "bold"; break; case FONTWEIGHT_normal : value = "normal"; break; default: - LogWarning("Unknown mode '%d'", data); + LogWarning("Unknown fontweight '%d'", data); value = ""; break; } @@ -463,7 +463,7 @@ data_FONTWEIGHT Att::StrToFontweight(std::string value) if (value == "bold") return FONTWEIGHT_bold; else if (value == "normal") return FONTWEIGHT_normal; else { - LogWarning("Unsupported pitch name '%s'", value.c_str() ); + LogWarning("Unsupported fontweight '%s'", value.c_str() ); } return FONTWEIGHT_NONE; } @@ -476,7 +476,7 @@ std::string Att::FuncToStr(data_FUNC data) case FUNC_caution : value = "caution"; break; // case FUNC_edit : value = "edit"; break; // default: - LogWarning("Unknown Func '%d'", data); + LogWarning("Unknown func '%d'", data); value = ""; break; } @@ -488,7 +488,7 @@ data_FUNC Att::StrToFunc(std::string value) if (value == "caution") return FUNC_caution; // else if (value == "edit") return FUNC_edit; // else { - LogWarning("Unknown Func '%s'", value.c_str() ); + LogWarning("Unknown func '%s'", value.c_str() ); } return FUNC_NONE; } @@ -502,7 +502,7 @@ std::string Att::GraceToStr(data_GRACE data) case GRACE_unacc : value = "unacc"; break; case GRACE_unknown : value = "unknown"; break; default: - LogWarning("Unknown mode '%d'", data); + LogWarning("Unknown grace '%d'", data); value = ""; break; } @@ -515,7 +515,7 @@ data_GRACE Att::StrToGrace(std::string value) else if (value == "unacc") return GRACE_unacc; else if (value == "unknown") return GRACE_unknown; else { - LogWarning("Unsupported pitch name '%s'", value.c_str() ); + LogWarning("Unsupported grace '%s'", value.c_str() ); } return GRACE_NONE; } @@ -542,7 +542,7 @@ std::string Att::KeySignatureToStr(data_KEYSIGNATURE data) case KEYSIGNATURE_7s : value = "7s"; break; case KEYSIGNATURE_mixed : value = "mixed"; break; default: - LogWarning("Unknown mode '%d'", data); + LogWarning("Unknown key signature '%d'", data); value = ""; break; } @@ -568,7 +568,7 @@ data_KEYSIGNATURE Att::StrToKeySignature(std::string value) else if (value == "7s") return KEYSIGNATURE_7s; else if (value == "mixed") return KEYSIGNATURE_mixed; else { - LogWarning("Unsupported pitch name '%s'", value.c_str() ); + LogWarning("Unsupported key signature '%s'", value.c_str() ); } return KEYSIGNATURE_NONE; } @@ -584,7 +584,7 @@ std::string Att::LayerschemeToStr(data_LAYERSCHEME data) case LAYERSCHEME_3o : value = "3o"; break; case LAYERSCHEME_3f : value = "3f"; break; default: - LogWarning("Unknown mode '%d'", data); + LogWarning("Unknown layerscheme '%d'", data); value = ""; break; } @@ -599,7 +599,7 @@ data_LAYERSCHEME Att::StrToLayerscheme(std::string value) else if (value == "3o") return LAYERSCHEME_3o; else if (value == "3f") return LAYERSCHEME_3f; else { - LogWarning("Unsupported pitch name '%s'", value.c_str() ); + LogWarning("Unsupported layerscheme '%s'", value.c_str() ); } return LAYERSCHEME_NONE; } @@ -612,7 +612,7 @@ std::string Att::LigatureToStr(data_LIGATURE data) case LIGATURE_recta : value = "recta"; break; case LIGATURE_obliqua : value = "obliqua"; break; default: - LogWarning("Unknown mode '%d'", data); + LogWarning("Unknown ligature '%d'", data); value = ""; break; } @@ -624,7 +624,7 @@ data_LIGATURE Att::StrToLigature(std::string value) if (value == "recta") return LIGATURE_recta; else if (value == "obliqua") return LIGATURE_obliqua; else { - LogWarning("Unsupported pitch name '%s'", value.c_str() ); + LogWarning("Unsupported ligature '%s'", value.c_str() ); } return LIGATURE_NONE; } @@ -663,7 +663,7 @@ std::string Att::MeterSignToStr(data_METERSIGN data) case METERSIGN_common : value = "common"; break; case METERSIGN_cut : value = "cut"; break; default: - LogWarning("Unknown meterSig sym '%d'", data); + LogWarning("Unknown meter sign '%d'", data); value = ""; break; } @@ -727,7 +727,7 @@ std::string Att::ModusmaiorToStr(data_MODUSMAIOR data) case MODUSMAIOR_2 : value = "2"; break; case MODUSMAIOR_3 : value = "3"; break; default: - LogWarning("Unknown mode '%d'", data); + LogWarning("Unknown modusmaior '%d'", data); value = ""; break; } @@ -739,7 +739,7 @@ data_MODUSMAIOR Att::StrToModusmaior(std::string value) if (value == "2") return MODUSMAIOR_2; else if (value == "3") return MODUSMAIOR_3; else { - LogWarning("Unsupported mode '%s'", value.c_str() ); + LogWarning("Unsupported modusmaior '%s'", value.c_str() ); } // default return MODUSMAIOR_NONE; @@ -753,7 +753,7 @@ std::string Att::ModusminorToStr(data_MODUSMINOR data) case MODUSMINOR_2 : value = "2"; break; case MODUSMINOR_3 : value = "3"; break; default: - LogWarning("Unknown mode '%d'", data); + LogWarning("Unknown modusmaior '%d'", data); value = ""; break; } @@ -765,7 +765,7 @@ data_MODUSMINOR Att::StrToModusminor(std::string value) if (value == "2") return MODUSMINOR_2; else if (value == "3") return MODUSMINOR_3; else { - LogWarning("Unsupported mode '%s'", value.c_str() ); + LogWarning("Unsupported modusmaior '%s'", value.c_str() ); } // default return MODUSMINOR_NONE; @@ -853,7 +853,7 @@ std::string Att::OrientationToStr(data_ORIENTATION data) case ORIENTATION_90CW : value = "90CW"; break; case ORIENTATION_90CCW : value = "90CCW"; break; default: - LogWarning("Unknown mode '%d'", data); + LogWarning("Unknown orientation '%d'", data); value = ""; break; } @@ -866,7 +866,7 @@ data_ORIENTATION Att::StrToOrientation(std::string value) else if (value == "90CW") return ORIENTATION_90CW; else if (value == "90CCW") return ORIENTATION_90CCW; else { - LogWarning("Unsupported pitch name '%s'", value.c_str() ); + LogWarning("Unsupported orientation '%s'", value.c_str() ); } return ORIENTATION_NONE; } @@ -884,7 +884,7 @@ std::string Att::PitchNameToStr(data_PITCHNAME data) case PITCHNAME_a : value = "a"; break; case PITCHNAME_b : value = "b"; break; default: - LogWarning("Unknown mode '%d'", data); + LogWarning("Unknown pitch name '%d'", data); value = ""; break; } @@ -941,7 +941,7 @@ std::string Att::ProlatioToStr(data_PROLATIO data) case PROLATIO_2 : value = "2"; break; case PROLATIO_3 : value = "3"; break; default: - LogWarning("Unknown mode '%d'", data); + LogWarning("Unknown prolatio '%d'", data); value = ""; break; } @@ -953,7 +953,7 @@ data_PROLATIO Att::StrToProlatio(std::string value) if (value == "2") return PROLATIO_2; else if (value == "3") return PROLATIO_3; else { - LogWarning("Unsupported mode '%s'", value.c_str() ); + LogWarning("Unsupported prolatio '%s'", value.c_str() ); } // default return PROLATIO_NONE; @@ -968,7 +968,7 @@ std::string Att::StaffRelToStr( data_STAFFREL data ) case STAFFREL_below : value = "below"; break; case STAFFREL_within : value = "within"; break; default: - LogWarning("Unknown staffrel '%d'", data); + LogWarning("Unknown staff rel '%d'", data); value = ""; break; } @@ -981,7 +981,7 @@ data_STAFFREL Att::StrToStaffRel(std::string value) else if (value == "above") return STAFFREL_above; else if (value == "within") return STAFFREL_within; else { - LogWarning("Unsupported staffrel '%s'", value.c_str() ); + LogWarning("Unsupported staff rel '%s'", value.c_str() ); } // default return STAFFREL_NONE; @@ -996,7 +996,7 @@ std::string Att::StemDirectionToStr(data_STEMDIRECTION data) case STEMDIRECTION_up : value = "up"; break; case STEMDIRECTION_down : value = "down"; break; default: - LogWarning("Unknown mode '%d'", data); + LogWarning("Unknown stem direction '%d'", data); value = ""; break; } @@ -1008,7 +1008,7 @@ data_STEMDIRECTION Att::StrToStemDirection(std::string value) if (value == "up") return STEMDIRECTION_up; else if (value == "down") return STEMDIRECTION_down; else { - LogWarning("Unsupported pitch name '%s'", value.c_str() ); + LogWarning("Unsupported stem direction '%s'", value.c_str() ); } return STEMDIRECTION_NONE; } @@ -1022,7 +1022,7 @@ std::string Att::StemPositionToStr(data_STEMPOSITION data) case STEMPOSITION_right : value = "right"; break; case STEMPOSITION_center : value = "center"; break; default: - LogWarning("Unknown mode '%d'", data); + LogWarning("Unknown stem position '%d'", data); value = ""; break; } @@ -1035,7 +1035,7 @@ data_STEMPOSITION Att::StrToStemPosition(std::string value) else if (value == "right") return STEMPOSITION_right; else if (value == "center") return STEMPOSITION_center; else { - LogWarning("Unsupported pitch name '%s'", value.c_str() ); + LogWarning("Unsupported stem position '%s'", value.c_str() ); } return STEMPOSITION_NONE; } @@ -1076,13 +1076,24 @@ std::string Att::TieToStr(data_TIE data) case TIE_m : value = "m"; break; case TIE_t : value = "t"; break; default: - LogWarning("Unknown mode '%d'", data); + LogWarning("Unknown tie '%d'", data); value = ""; break; } return value; } +data_TIE Att::StrToTie(std::string value) +{ + if (value == "i") return TIE_i; + else if (value == "m") return TIE_m; + else if (value == "t") return TIE_t; + else { + LogWarning("Unsupported tie '%s'", value.c_str() ); + } + return TIE_NONE; +} + std::string Att::TempusToStr(data_TEMPUS data) { std::string value; @@ -1091,7 +1102,7 @@ std::string Att::TempusToStr(data_TEMPUS data) case TEMPUS_2 : value = "2"; break; case TEMPUS_3 : value = "3"; break; default: - LogWarning("Unknown mode '%d'", data); + LogWarning("Unknown tempus '%d'", data); value = ""; break; } @@ -1103,23 +1114,12 @@ data_TEMPUS Att::StrToTempus(std::string value) if (value == "2") return TEMPUS_2; else if (value == "3") return TEMPUS_3; else { - LogWarning("Unsupported mode '%s'", value.c_str() ); + LogWarning("Unsupported tempus '%s'", value.c_str() ); } // default return TEMPUS_NONE; } -data_TIE Att::StrToTie(std::string value) -{ - if (value == "i") return TIE_i; - else if (value == "m") return TIE_m; - else if (value == "t") return TIE_t; - else { - LogWarning("Unsupported pitch name '%s'", value.c_str() ); - } - return TIE_NONE; -} - std::string Att::Tstamp2ToStr(typedef_TSTAMP2 data) { return "0m0.0"; @@ -1139,7 +1139,7 @@ std::string Att::WordPosToStr(data_WORDPOS data) case WORDPOS_m : value = "m"; break; case WORDPOS_t : value = "t"; break; default: - LogWarning("Unknown mode '%d'", data); + LogWarning("Unknown word pos '%d'", data); value = ""; break; } @@ -1152,7 +1152,7 @@ data_WORDPOS Att::StrToWordPos(std::string value) else if (value == "m") return WORDPOS_m; else if (value == "t") return WORDPOS_t; else { - LogWarning("Unsupported pitch name '%s'", value.c_str() ); + LogWarning("Unsupported word pos '%s'", value.c_str() ); } return WORDPOS_NONE; } diff --git a/src/iomei.cpp b/src/iomei.cpp index 70dc8db90f4..04becf40643 100644 --- a/src/iomei.cpp +++ b/src/iomei.cpp @@ -1466,7 +1466,6 @@ bool MeiInput::ReadMeiSlur( Object *parent, pugi::xml_node slur ) SetMeiUuid(slur, vrvSlur); vrvSlur->ReadCurvature(slur); - ReadTimeSpanningInterface(slur, vrvSlur); AddFloatingElement(parent, vrvSlur); From 1e6a0c0dcd36cea69971a66bcb6c7b7674bf4884 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Sun, 6 Sep 2015 19:03:20 +0200 Subject: [PATCH 109/114] Symmetric slurs (WIP) --- include/vrv/view.h | 5 ++ src/view.cpp | 19 +++++++ src/view_floating.cpp | 122 +++++++++++++++++++++++++++++++----------- src/view_graph.cpp | 4 +- src/view_page.cpp | 23 -------- 5 files changed, 117 insertions(+), 56 deletions(-) diff --git a/include/vrv/view.h b/include/vrv/view.h index b802a2689ca..6cdc701f4d8 100644 --- a/include/vrv/view.h +++ b/include/vrv/view.h @@ -355,6 +355,11 @@ class View */ static void SwapPoints (Point *x1, Point *x2); + /** + * Calculate the position of a point after a rotation of rot_alpha around the center + */ + static Point CalcPositionAfterRotation( Point point , float rot_alpha, Point center); + /** * Swap values passed as reference. * This is useful for example when switching to the device context world. diff --git a/src/view.cpp b/src/view.cpp index ee1d3dcab43..00bada98310 100644 --- a/src/view.cpp +++ b/src/view.cpp @@ -11,6 +11,7 @@ //---------------------------------------------------------------------------- #include +#include #include //---------------------------------------------------------------------------- @@ -171,5 +172,23 @@ std::wstring View::IntToSmuflFigures(unsigned short number, int offset) return str; } +Point View::CalcPositionAfterRotation( Point point , float rot_alpha, Point center) +{ + float s = sin(rot_alpha); + float c = cos(rot_alpha); + + // translate point back to origin: + point.x -= center.x; + point.y -= center.y; + + // rotate point + float xnew = point.x * c - point.y * s; + float ynew = point.x * s + point.y * c; + + // translate point back: + point.x = xnew + center.x; + point.y = ynew + center.y; + return point; +} } // namespace vrv diff --git a/src/view_floating.cpp b/src/view_floating.cpp index e8b8f14c060..69e60ebc096 100644 --- a/src/view_floating.cpp +++ b/src/view_floating.cpp @@ -12,6 +12,7 @@ #include #include +#include //---------------------------------------------------------------------------- @@ -184,61 +185,77 @@ void View::DrawSlur( DeviceContext *dc, Slur *slur, int x1, int x2, Staff *staff assert( slur ); assert( staff ); - LayerElement *element1 = NULL; - LayerElement *element2 = NULL; + Note *note1 = NULL; + Note *note2 = NULL; bool up = true; data_STEMDIRECTION noteStemDir = STEMDIRECTION_NONE; int y1, y2; - element1 = slur->GetStart(); - element2 = slur->GetEnd(); + /************** parent layers **************/ + + note1 = dynamic_cast(slur->GetStart()); + note2 = dynamic_cast(slur->GetEnd()); - if ( !element1 || !element2 ) { + if ( !note1 || !note2 ) { // no note, obviously nothing to do... return; } - Layer* layer1 = dynamic_cast(element1->GetFirstParent( LAYER ) ); - Layer* layer2 = dynamic_cast(element2->GetFirstParent( LAYER ) ); + Chord *chordParent1 = note1->IsChordTone(); + + Layer* layer1 = dynamic_cast(note1->GetFirstParent( LAYER ) ); + Layer* layer2 = dynamic_cast(note2->GetFirstParent( LAYER ) ); assert( layer1 && layer2 ); if ( layer1->GetN() != layer2->GetN() ) { - LogWarning("Slur between different layers may not be fully supported."); + LogWarning("Ties between different layers may not be fully supported."); } - //the normal case + /************** x positions **************/ + + // the normal case if ( spanningType == SPANNING_START_END ) { - // Copied from DrawNote - // We could use the stamDir information - // but then we have to take in account (1) beams (2) stemmed and non stemmed notes tied together - y1 = element1->GetDrawingY(); - y2 = element2->GetDrawingY(); - noteStemDir = element1->GetDrawingStemDir(); + y1 = note1->GetDrawingY(); + y2 = note2->GetDrawingY(); + noteStemDir = note1->GetDrawingStemDir(); } // This is the case when the tie is split over two system of two pages. // In this case, we are now drawing its beginning to the end of the measure (i.e., the last aligner) else if ( spanningType == SPANNING_START ) { - y1 = element1->GetDrawingY(); + y1 = note1->GetDrawingY(); y2 = y1; - noteStemDir = element1->GetDrawingStemDir(); + noteStemDir = note1->GetDrawingStemDir(); } // Now this is the case when the tie is split but we are drawing the end of it else if ( spanningType == SPANNING_END ) { - y1 = element2->GetDrawingY(); + y1 = note2->GetDrawingY(); y2 = y1; - noteStemDir = element2->GetDrawingStemDir(); + noteStemDir = note2->GetDrawingStemDir(); } // Finally else { - LogDebug("Slur across an entire system is not supported"); + LogDebug("Tie across an entire system is not supported"); return; } - //layer direction trumps note direction - if (layer1 && layer1->GetDrawingStemDir() != STEMDIRECTION_NONE){ + /************** direction **************/ + + // first should be the tie @curvedir + if (slur->HasCurvedir()) { + up = (slur->GetCurvedir() == CURVEDIR_above) ? true : false; + } + // then layer direction trumps note direction + else if (layer1 && layer1->GetDrawingStemDir() != STEMDIRECTION_NONE){ up = layer1->GetDrawingStemDir() == STEMDIRECTION_up ? true : false; } + // the look if in a chord + else if (note1->IsChordTone()) { + if (note1->PositionInChord() < 0) up = false; + else if (note1->PositionInChord() > 0) up = true; + // away from the stem if odd number (center note) + else up = (noteStemDir != STEMDIRECTION_up); + } else if (noteStemDir == STEMDIRECTION_up) { up = false; } @@ -247,24 +264,66 @@ void View::DrawSlur( DeviceContext *dc, Slur *slur, int x1, int x2, Staff *staff int center = staff->GetDrawingY() - m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) * 2; up = (y1 > center) ? true : false; } + + /************** y position **************/ - // FIXME, take in account elements that can be netween notes, eg keys time etc - // 20 height nice with 70, not nice with 50 - // Also remove HARDCODED values! if (up) { - y1 += m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 1.6; - y2 += m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 1.6; + y1 += 2 * m_doc->GetDrawingUnit(staff->m_drawingStaffSize); + y2 += 2 * m_doc->GetDrawingUnit(staff->m_drawingStaffSize); } else { - y1 -= m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 1.6; - y2 -= m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 1.6; + y1 -= 2 * m_doc->GetDrawingUnit(staff->m_drawingStaffSize); + y2 -= 2 * m_doc->GetDrawingUnit(staff->m_drawingStaffSize); + } + + /************** bezier points **************/ + + float slurAngle = atan2(y2 - y1, x2 - x1); + Point center = Point(x1, y1); + Point rotatedP2 = View::CalcPositionAfterRotation(Point(x2, y2), -slurAngle, center); + //LogDebug("P1 %d %d, P2 %d %d, Angle %f, Pres %d %d", x1, y1, x2, y2, slurAnge, rotadedP2.x, rotatedP2.y); + + + + // the 'height' of the bezier + int height; + if (slur->HasBulge()){ + height = m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * slur->GetBulge(); } + else { + height = m_doc->GetDrawingUnit(staff->m_drawingStaffSize); + // if the space between the to points is more than two staff height, increase the height + if (x2 - x1 > 2 * m_doc->GetDrawingStaffSize(staff->m_drawingStaffSize)) { + height += m_doc->GetDrawingUnit(staff->m_drawingStaffSize); + } + } + int thickness = m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * m_doc->GetSlurThickness() / DEFINITON_FACTOR ; + + // control points + Point rotatecC1, rotatedC2; + + // the height of the control points + height = height * 4 / 3; + + rotatecC1.x = x1 + (rotatedP2.x - x1) / 4; // point at 1/4 + rotatedC2.x = x1 + (rotatedP2.x - x1) / 4 * 3; // point at 3/4 + + if (up) { + rotatecC1.y = y1 + height; + rotatedC2.y = rotatedP2.y + height; + } else { + rotatecC1.y = y1 - height; + rotatedC2.y = rotatedP2.y - height; + } + + Point actualP2 = View::CalcPositionAfterRotation(rotatedP2, slurAngle, center); + Point actualC1 = View::CalcPositionAfterRotation(rotatecC1, slurAngle, center); + Point actualC2 = View::CalcPositionAfterRotation(rotatedC2, slurAngle, center); if ( graphic ) dc->ResumeGraphic(graphic, graphic->GetUuid()); else dc->StartGraphic(slur, "spanning-slur", ""); dc->DeactivateGraphic(); - // Should be change and use DrawThickBezierCurve - DrawSlurBezier(dc, x1, y1, x2, y2, !up, staff->m_drawingStaffSize); + DrawThickBezierCurve(dc, center, actualP2, actualC1, actualC2, thickness, staff->m_drawingStaffSize ); dc->ReactivateGraphic(); if ( graphic ) dc->EndResumedGraphic(graphic, this); @@ -417,6 +476,7 @@ void View::DrawTie( DeviceContext *dc, Tie *tie, int x1, int x2, Staff *staff, // control points Point c1, c2; + // the height of the control points height = height * 4 / 3; c1.x = x1 + (x2 - x1) / 4; // point at 1/4 diff --git a/src/view_graph.cpp b/src/view_graph.cpp index 97877902065..d20b3f14fa7 100755 --- a/src/view_graph.cpp +++ b/src/view_graph.cpp @@ -214,8 +214,8 @@ void View::DrawThickBezierCurve(DeviceContext *dc, Point p1, Point p2, Point c1, bez1[4] = ToDeviceContextX(p2.x); bez1[5] = ToDeviceContextY(p2.y); // second bez. goes back - bez2[0] = ToDeviceContextX(c2.x); bez2[1] = ToDeviceContextY(c1.y - thickness / 2); - bez2[2] = ToDeviceContextX(c1.x); bez2[3] = ToDeviceContextY(c2.y - thickness / 2); + bez2[0] = ToDeviceContextX(c2.x); bez2[1] = ToDeviceContextY(c2.y - thickness / 2); + bez2[2] = ToDeviceContextX(c1.x); bez2[3] = ToDeviceContextY(c1.y - thickness / 2); bez2[4] = ToDeviceContextX(p1.x); bez2[5] = ToDeviceContextY(p1.y); // Actually draw it diff --git a/src/view_page.cpp b/src/view_page.cpp index 17d309f961a..3577573fa87 100644 --- a/src/view_page.cpp +++ b/src/view_page.cpp @@ -11,7 +11,6 @@ //---------------------------------------------------------------------------- #include -#include //---------------------------------------------------------------------------- @@ -861,28 +860,6 @@ int View::CalculatePitchCode ( Layer *layer, int y_n, int x_pos, int *octave ) return (code); } -Point CalcPositionAfterRotation( Point point , float rot_alpha, Point center) -{ - int distCenterX = (point.x - center.x); - int distCenterY = (point.y - center.y); - // pythagore, distance entre le point d'origine et le centre - int distCenter = (int)sqrt( pow( (double)distCenterX, 2 ) + pow( (double)distCenterY, 2 ) ); - - // angle d'origine entre l'axe x et la droite passant par le point et le centre - float alpha = atan ( (float)distCenterX / (float)(distCenterY) ); - - Point new_p = center; - int new_distCenterX, new_distCenterY; - - new_distCenterX = ( (int)( sin( alpha - rot_alpha ) * distCenter ) ); - new_p.x += new_distCenterX; - - new_distCenterY = ( (int)( cos( alpha - rot_alpha ) * distCenter ) ); - new_p.y += new_distCenterY; - - return new_p; -} - void View::DrawLayer( DeviceContext *dc, Layer *layer, Staff *staff, Measure *measure) { assert( dc ); From 319ae90ade1af41570649b488a651498f0c304f6 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Tue, 8 Sep 2015 14:15:08 +0200 Subject: [PATCH 110/114] Adjusting slur hight (WIP) --- include/vrv/layerelement.h | 2 + include/vrv/object.h | 5 ++ include/vrv/style.h | 11 ++- include/vrv/view.h | 16 +++- src/layerelement.cpp | 19 +++++ src/view.cpp | 22 +++++- src/view_floating.cpp | 145 +++++++++++++++++++++++++------------ src/view_graph.cpp | 44 ----------- 8 files changed, 166 insertions(+), 98 deletions(-) diff --git a/include/vrv/layerelement.h b/include/vrv/layerelement.h index ca67c3ef097..404d9fe9bba 100644 --- a/include/vrv/layerelement.h +++ b/include/vrv/layerelement.h @@ -121,6 +121,8 @@ class LayerElement: public DocObject */ virtual int SetDrawingXY( ArrayPtrVoid *params ); + virtual int TimeSpanningLayerElements( ArrayPtrVoid *params ); + private: public: diff --git a/include/vrv/object.h b/include/vrv/object.h index 94ab598d00d..4e024446516 100644 --- a/include/vrv/object.h +++ b/include/vrv/object.h @@ -647,6 +647,11 @@ class Object ///@} + /** + * + */ + virtual int TimeSpanningLayerElements( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; + protected: /** * Clear the children vector and delete all the objects. diff --git a/include/vrv/style.h b/include/vrv/style.h index a69cbc53a61..bcfb903bdda 100644 --- a/include/vrv/style.h +++ b/include/vrv/style.h @@ -77,9 +77,9 @@ namespace vrv { #define DEFAULT_TIE_THICKNESS 0.6 -#define DEFAULT_MIN_SLUR_HEIGHT 1.5 +#define DEFAULT_MIN_SLUR_HEIGHT 1.2 #define DEFAULT_MAX_SLUR_HEIGHT 3.0 -#define DEFAULT_SLUR_THICKNESS 0.8 +#define DEFAULT_SLUR_THICKNESS 0.7 /** The default position at the beginning of a measure */ #define DEFAULT_LEFT_POSITION 1.3 @@ -135,7 +135,12 @@ namespace vrv { // the space between each lyric line in units #define TEMP_STYLE_LYIRC_LINE_SPACE 5.0 * PARAM_DENOMINATOR - + +// the maximum angle of a slur +#define TEMP_STYLE_MAX_SLUR_SLOPE (30 * M_PI / 180) +#define TEMP_STYLE_SLUR_HEIGHT_FACTOR 8 // high value means flatter slurs +#define TEMP_STYLE_SLUR_CONTROL_POINT_FACTOR 5 // higher value means more curved at the end + /** * This class contains the document default environment variables. diff --git a/include/vrv/view.h b/include/vrv/view.h index 6cdc701f4d8..6dd27289cdb 100644 --- a/include/vrv/view.h +++ b/include/vrv/view.h @@ -157,7 +157,6 @@ class View void DrawStaffLines( DeviceContext *dc, Staff *staff, Measure *measure, System *system ); void DrawLayer( DeviceContext *dc, Layer *layer, Staff *staff, Measure *measure ); void DrawLayerList( DeviceContext *dc, Layer *layer, Staff *staff, Measure *measure, const ClassId classId ); - void DrawSlur( DeviceContext *dc, Layer *layer, int x1, int y1, int x2, int y2, bool up, int height = -1); ///@} /** @@ -312,7 +311,6 @@ class View void DrawHorizontalLine ( DeviceContext *dc, int x1, int x2, int y1, int nbr); void DrawSmuflCode ( DeviceContext *dc, int x, int y, wchar_t code, int staffSize, bool dimin ); void DrawThickBezierCurve(DeviceContext *dc, Point p1, Point p2, Point c1, Point c2, int thickness, int staffSize); - void DrawSlurBezier(DeviceContext *dc, int x, int y, int x1, int y1, bool direction, int staffSize); void DrawPartFullRectangle( DeviceContext *dc, int x1, int y1, int x2, int y2, int fillSection); void DrawSmuflString ( DeviceContext *dc, int x, int y, std::wstring s, bool center, int staffSize = 100); void DrawLyricString ( DeviceContext *dc, int x, int y, std::wstring s, int staffSize = 100); @@ -334,6 +332,8 @@ class View int GetSylY( Syl* syl, Staff *staff ); ///@} + void AdjustSlurPosition(Slur *slur, Staff *staff, int layerN, bool up, Point points[]); + /** * @name Used for calculating clustered information/dot position */ @@ -358,7 +358,13 @@ class View /** * Calculate the position of a point after a rotation of rot_alpha around the center */ - static Point CalcPositionAfterRotation( Point point , float rot_alpha, Point center); + static Point CalcPositionAfterRotation(Point point , float rot_alpha, Point center); + + /** + * Calculate the position of a point after a rotation of rot_alpha around the center + */ + static int CalcBezierAtPosition(Point bezier[], int x); + /** * Swap values passed as reference. @@ -401,7 +407,9 @@ class View ScoreDef m_drawingScoreDef; private: - + /** buffer for De-Casteljau algorithm */ + static int s_deCasteljau[4][4]; + /** @name Internal values for storing temporary values for ligatures */ ///@{ static int s_drawingLigX[2], s_drawingLigY[2]; diff --git a/src/layerelement.cpp b/src/layerelement.cpp index 88872881680..34e288bf4e8 100644 --- a/src/layerelement.cpp +++ b/src/layerelement.cpp @@ -422,4 +422,23 @@ int LayerElement::SetDrawingXY( ArrayPtrVoid *params ) return FUNCTOR_CONTINUE; } +int LayerElement::TimeSpanningLayerElements( ArrayPtrVoid *params ) +{ + // param 0: a pointer to the vector of LayerElement pointer to fill + // param 1: the minimum position + // param 2: the maximum position + std::vector *spanningContent = static_cast*>((*params).at(0)); + int *min_pos = static_cast((*params).at(1)); + int *max_pos = static_cast((*params).at(2)); + + if (this->GetDrawingX() >= (*min_pos) && this->GetDrawingX() <= (*max_pos)) { + if (this->Is() == NOTE) spanningContent->push_back(this); + } + else if (this->GetDrawingX() > (*max_pos) ) { + return FUNCTOR_STOP; + } + + return FUNCTOR_CONTINUE; +} + } // namespace vrv diff --git a/src/view.cpp b/src/view.cpp index 00bada98310..576c5951ea1 100644 --- a/src/view.cpp +++ b/src/view.cpp @@ -20,6 +20,8 @@ #include "page.h" namespace vrv { + +int View::s_deCasteljau[4][4]; //---------------------------------------------------------------------------- // View @@ -190,5 +192,23 @@ Point View::CalcPositionAfterRotation( Point point , float rot_alpha, Point cent point.y = ynew + center.y; return point; } - + +int View::CalcBezierAtPosition(Point bezier[], int x) +{ + int i, j; + double t = 0.0; + // avoid division by 0 + if (bezier[3].x != bezier[0].x) t = (double)(x - bezier[0].x) / (double)(bezier[3].x - bezier[0].x) ; + t = std::min(1.0, std::max(0.0, t)); + int n = 4; + + for(i = 0; i < n; i++) View::s_deCasteljau[0][i] = bezier[i].y; + for(j = 1; j < n; j++) { + for(int i = 0; i < 4 - j; i++) { + View::s_deCasteljau[j][i] = View::s_deCasteljau[j-1][i] * (1-t) + View::s_deCasteljau[j-1][i+1] * t; + } + } + return View::s_deCasteljau[n-1][0]; +} + } // namespace vrv diff --git a/src/view_floating.cpp b/src/view_floating.cpp index 69e60ebc096..62c261f7278 100644 --- a/src/view_floating.cpp +++ b/src/view_floating.cpp @@ -16,36 +16,22 @@ //---------------------------------------------------------------------------- -//#include "accid.h" #include "att_comparison.h" -//#include "beam.h" -//#include "chord.h" -//#include "custos.h" +#include "bboxdevicecontext.h" #include "devicecontext.h" #include "doc.h" -//#include "dot.h" #include "floatingelement.h" -//#include "keysig.h" #include "layer.h" #include "layerelement.h" #include "measure.h" -//#include "mensur.h" -//#include "metersig.h" -//#include "mrest.h" -//#include "multirest.h" #include "note.h" -//#include "rest.h" #include "slur.h" -//#include "space.h" -//#include "smufl.h" #include "staff.h" #include "style.h" #include "syl.h" #include "system.h" #include "tie.h" #include "timeinterface.h" -//#include "tuplet.h" -//#include "verse.h" #include "vrv.h" namespace vrv { @@ -202,14 +188,12 @@ void View::DrawSlur( DeviceContext *dc, Slur *slur, int x1, int x2, Staff *staff return; } - Chord *chordParent1 = note1->IsChordTone(); - Layer* layer1 = dynamic_cast(note1->GetFirstParent( LAYER ) ); Layer* layer2 = dynamic_cast(note2->GetFirstParent( LAYER ) ); assert( layer1 && layer2 ); if ( layer1->GetN() != layer2->GetN() ) { - LogWarning("Ties between different layers may not be fully supported."); + LogWarning("Slurs between different layers may not be fully supported."); } /************** x positions **************/ @@ -233,10 +217,11 @@ void View::DrawSlur( DeviceContext *dc, Slur *slur, int x1, int x2, Staff *staff y2 = y1; noteStemDir = note2->GetDrawingStemDir(); } - // Finally + // Finally, slur accross an entire system; use the staff position and up else { - LogDebug("Tie across an entire system is not supported"); - return; + y1 = staff->GetDrawingY(); + y2 = y1; + noteStemDir = STEMDIRECTION_down; } /************** direction **************/ @@ -276,14 +261,51 @@ void View::DrawSlur( DeviceContext *dc, Slur *slur, int x1, int x2, Staff *staff y2 -= 2 * m_doc->GetDrawingUnit(staff->m_drawingStaffSize); } - /************** bezier points **************/ + Point points[4]; + points[0] = Point(x1, y1); + points[1] = Point(x2, y2); - float slurAngle = atan2(y2 - y1, x2 - x1); - Point center = Point(x1, y1); - Point rotatedP2 = View::CalcPositionAfterRotation(Point(x2, y2), -slurAngle, center); - //LogDebug("P1 %d %d, P2 %d %d, Angle %f, Pres %d %d", x1, y1, x2, y2, slurAnge, rotadedP2.x, rotatedP2.y); + AdjustSlurPosition(slur, staff, layer1->GetN(), up, points); + + int thickness = m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * m_doc->GetSlurThickness() / DEFINITON_FACTOR ; + + if ( graphic ) dc->ResumeGraphic(graphic, graphic->GetUuid()); + else dc->StartGraphic(slur, "spanning-slur", ""); + dc->DeactivateGraphic(); + DrawThickBezierCurve(dc, points[0], points[1], points[2], points[3], thickness, staff->m_drawingStaffSize ); + dc->ReactivateGraphic(); + + if ( graphic ) dc->EndResumedGraphic(graphic, this); + else dc->EndGraphic(slur, this); +} + +void View::AdjustSlurPosition(Slur *slur, Staff *staff, int layerN, bool up, Point points[]) +{ + // For readability makes them p1 and p2 + Point *p1 = &points[0]; + Point *p2 = &points[1]; + + /************** angle **************/ + float slurAngle = atan2(p2->y - p1->y, p2->x - p1->x); + // the slope of the slur is high and needs to be corrected + if (fabs(slurAngle) > TEMP_STYLE_MAX_SLUR_SLOPE) { + int side = (p2->x - p1->x) * sin(TEMP_STYLE_MAX_SLUR_SLOPE) / sin(M_PI / 2 - TEMP_STYLE_MAX_SLUR_SLOPE); + if (p2->y > p1->y) { + p1->y = p2->y - side; + slurAngle = TEMP_STYLE_MAX_SLUR_SLOPE; + } + else { + p2->y = p1->y - side; + slurAngle = -TEMP_STYLE_MAX_SLUR_SLOPE; + } + } + + Point rotatedP2 = View::CalcPositionAfterRotation(*p2, -slurAngle, *p1); + //LogDebug("P1 %d %d, P2 %d %d, Angle %f, Pres %d %d", x1, y1, x2, y2, slurAnge, rotadedP2.x, rotatedP2.y); + + /************** height **************/ // the 'height' of the bezier int height; @@ -291,13 +313,11 @@ void View::DrawSlur( DeviceContext *dc, Slur *slur, int x1, int x2, Staff *staff height = m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * slur->GetBulge(); } else { - height = m_doc->GetDrawingUnit(staff->m_drawingStaffSize); - // if the space between the to points is more than two staff height, increase the height - if (x2 - x1 > 2 * m_doc->GetDrawingStaffSize(staff->m_drawingStaffSize)) { - height += m_doc->GetDrawingUnit(staff->m_drawingStaffSize); - } + //height = m_doc->GetDrawingUnit(staff->m_drawingStaffSize); + int dist = abs( p2->x - p1->x ); + height = std::max( m_doc->GetSlurMinHeight() * m_doc->GetDrawingUnit(staff->m_drawingStaffSize) / DEFINITON_FACTOR, dist / TEMP_STYLE_SLUR_HEIGHT_FACTOR); + height = std::min( m_doc->GetSlurMaxHeight() * m_doc->GetDrawingUnit(staff->m_drawingStaffSize) / DEFINITON_FACTOR, height ); } - int thickness = m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * m_doc->GetSlurThickness() / DEFINITON_FACTOR ; // control points Point rotatecC1, rotatedC2; @@ -305,29 +325,62 @@ void View::DrawSlur( DeviceContext *dc, Slur *slur, int x1, int x2, Staff *staff // the height of the control points height = height * 4 / 3; - rotatecC1.x = x1 + (rotatedP2.x - x1) / 4; // point at 1/4 - rotatedC2.x = x1 + (rotatedP2.x - x1) / 4 * 3; // point at 3/4 + int cPos = std::min((rotatedP2.x - p1->x) / TEMP_STYLE_SLUR_CONTROL_POINT_FACTOR, m_doc->GetDrawingStaffSize(staff->m_drawingStaffSize)); + rotatecC1.x = p1->x + cPos; // point at 1/4 + rotatedC2.x = p2->x - cPos;; // point at 3/4 if (up) { - rotatecC1.y = y1 + height; + rotatecC1.y = p1->y + height; rotatedC2.y = rotatedP2.y + height; } else { - rotatecC1.y = y1 - height; + rotatecC1.y = p1->y - height; rotatedC2.y = rotatedP2.y - height; } - Point actualP2 = View::CalcPositionAfterRotation(rotatedP2, slurAngle, center); - Point actualC1 = View::CalcPositionAfterRotation(rotatecC1, slurAngle, center); - Point actualC2 = View::CalcPositionAfterRotation(rotatedC2, slurAngle, center); + points[1] = View::CalcPositionAfterRotation(rotatedP2, slurAngle, *p1); + points[2] = View::CalcPositionAfterRotation(rotatecC1, slurAngle, *p1); + points[3] = View::CalcPositionAfterRotation(rotatedC2, slurAngle, *p1); + + + + System *system = dynamic_cast(staff->GetFirstParent(SYSTEM)); + assert(system); + std::vectorspanningContent; + ArrayPtrVoid params; + params.push_back(&spanningContent); + params.push_back(&p1->x); + params.push_back(&p2->x); + std::vector filters; + // Create ad comparison object for each type / @n + // For now we only look at one layer (assumed layer1 == layer2) + AttCommonNComparison matchStaff( STAFF, staff->GetN() ); + AttCommonNComparison matchLayer( LAYER, layerN ); + filters.push_back( &matchStaff ); + filters.push_back( &matchLayer ); + + //paramsTieAttr.push_back( ¤tNotes ); + //paramsTieAttr.push_back( ¤tChord ); + Functor timeSpanningLayerElements( &Object::TimeSpanningLayerElements ); + //LogDebug("*** %d - %d", note1->GetDrawingX(), note2->GetDrawingX() ) ; + system->Process( &timeSpanningLayerElements, ¶ms, NULL, &filters ); + if (spanningContent.size() > 12) LogDebug("### %d %s", spanningContent.size(), slur->GetUuid().c_str()); + + /* + Point bezier[4]; + bezier[0].x = 100; + bezier[1].x = 200; + bezier[2].x = 300; + bezier[3].x = 400; + bezier[0].y = 000; + bezier[1].y = 100; + bezier[2].y = 100; + bezier[3].y = 000; + + int p = View::CalcBezierAtPosition(bezier, 24550); + p; + */ - if ( graphic ) dc->ResumeGraphic(graphic, graphic->GetUuid()); - else dc->StartGraphic(slur, "spanning-slur", ""); - dc->DeactivateGraphic(); - DrawThickBezierCurve(dc, center, actualP2, actualC1, actualC2, thickness, staff->m_drawingStaffSize ); - dc->ReactivateGraphic(); - if ( graphic ) dc->EndResumedGraphic(graphic, this); - else dc->EndGraphic(slur, this); } void View::DrawTie( DeviceContext *dc, Tie *tie, int x1, int x2, Staff *staff, diff --git a/src/view_graph.cpp b/src/view_graph.cpp index d20b3f14fa7..3ab4dcd1472 100755 --- a/src/view_graph.cpp +++ b/src/view_graph.cpp @@ -224,48 +224,4 @@ void View::DrawThickBezierCurve(DeviceContext *dc, Point p1, Point p2, Point c1, dc->ResetPen(); } -void View::DrawSlurBezier(DeviceContext *dc, int x, int y, int x1, int y1, bool direction, int staffSize) -{ - assert( dc ); - - int height = std::max( m_doc->GetSlurMinHeight() * m_doc->GetDrawingUnit(staffSize) / DEFINITON_FACTOR, abs( x1 - x ) / 4 ); - height = std::min( m_doc->GetSlurMaxHeight() * m_doc->GetDrawingUnit(staffSize) / DEFINITON_FACTOR, height ); - int thickness = m_doc->GetDrawingUnit(staffSize) * m_doc->GetSlurThickness() / DEFINITON_FACTOR ; - - int one, two; // control points at 1/4 and 3/4 of total lenght - int bez1[6], bez2[6]; // filled array with control points and end point - - int top_y, top_y_fill; // Y for control points in both beziers - - one = (x1 - x) / 4; // point at 1/4 - two = (x1 - x) / 4 * 3; // point at 3/4 - - if (direction) { - // tie goes up - top_y = std::min(y, y1) - height; - // the second bezier in internal - top_y_fill = top_y + thickness; - } else { - //tie goes down - top_y = std::max(y, y1) + height; - // second bezier is internal as above - top_y_fill = top_y - thickness; - } - - // Points for first bez, they go from xy to x1y1 - bez1[0] = ToDeviceContextX(x + one); bez1[1] = ToDeviceContextY(top_y); - bez1[2] = ToDeviceContextX(x + two); bez1[3] = ToDeviceContextY(top_y); - bez1[4] = ToDeviceContextX(x1); bez1[5] = ToDeviceContextY(y1); - - // second bez. goes back - bez2[0] = ToDeviceContextX(x + two); bez2[1] = ToDeviceContextY(top_y_fill); - bez2[2] = ToDeviceContextX(x + one); bez2[3] = ToDeviceContextY(top_y_fill); - bez2[4] = ToDeviceContextX(x); bez2[5] = ToDeviceContextY(y); - - // Actually draw it - dc->SetPen( m_currentColour, std::max( 1, m_doc->GetDrawingStemWidth(staffSize) / 2 ), AxSOLID ); - dc->DrawComplexBezierPath(ToDeviceContextX(x), ToDeviceContextY(y), bez1, bez2); - dc->ResetPen(); -} - } // namespace vrv From 915cd8663a4d01890c4de8632dbb4f1216827552 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Wed, 9 Sep 2015 00:24:02 +0200 Subject: [PATCH 111/114] Improving moved slurs --- include/vrv/style.h | 6 +++--- include/vrv/view.h | 4 ++-- src/view_floating.cpp | 38 +++++++++++++++++++++----------------- src/view_graph.cpp | 27 ++++++++++++++++++++++----- 4 files changed, 48 insertions(+), 27 deletions(-) diff --git a/include/vrv/style.h b/include/vrv/style.h index bcfb903bdda..842d0e190b0 100644 --- a/include/vrv/style.h +++ b/include/vrv/style.h @@ -75,11 +75,11 @@ namespace vrv { #define MIN_MEASURE_WIDTH 1.0 #define MAX_MEASURE_WIDTH 30.0 -#define DEFAULT_TIE_THICKNESS 0.6 +#define DEFAULT_TIE_THICKNESS 0.5 #define DEFAULT_MIN_SLUR_HEIGHT 1.2 #define DEFAULT_MAX_SLUR_HEIGHT 3.0 -#define DEFAULT_SLUR_THICKNESS 0.7 +#define DEFAULT_SLUR_THICKNESS 0.6 /** The default position at the beginning of a measure */ #define DEFAULT_LEFT_POSITION 1.3 @@ -137,7 +137,7 @@ namespace vrv { #define TEMP_STYLE_LYIRC_LINE_SPACE 5.0 * PARAM_DENOMINATOR // the maximum angle of a slur -#define TEMP_STYLE_MAX_SLUR_SLOPE (30 * M_PI / 180) +#define TEMP_STYLE_MAX_SLUR_SLOPE (45 * M_PI / 180) #define TEMP_STYLE_SLUR_HEIGHT_FACTOR 8 // high value means flatter slurs #define TEMP_STYLE_SLUR_CONTROL_POINT_FACTOR 5 // higher value means more curved at the end diff --git a/include/vrv/view.h b/include/vrv/view.h index 6dd27289cdb..a9274b296da 100644 --- a/include/vrv/view.h +++ b/include/vrv/view.h @@ -310,7 +310,7 @@ class View void DrawVerticalLine ( DeviceContext *dc, int y1, int y2, int x1, int nbr); void DrawHorizontalLine ( DeviceContext *dc, int x1, int x2, int y1, int nbr); void DrawSmuflCode ( DeviceContext *dc, int x, int y, wchar_t code, int staffSize, bool dimin ); - void DrawThickBezierCurve(DeviceContext *dc, Point p1, Point p2, Point c1, Point c2, int thickness, int staffSize); + void DrawThickBezierCurve(DeviceContext *dc, Point p1, Point p2, Point c1, Point c2, int thickness, int staffSize, float angle = 0.0); void DrawPartFullRectangle( DeviceContext *dc, int x1, int y1, int x2, int y2, int fillSection); void DrawSmuflString ( DeviceContext *dc, int x, int y, std::wstring s, bool center, int staffSize = 100); void DrawLyricString ( DeviceContext *dc, int x, int y, std::wstring s, int staffSize = 100); @@ -332,7 +332,7 @@ class View int GetSylY( Syl* syl, Staff *staff ); ///@} - void AdjustSlurPosition(Slur *slur, Staff *staff, int layerN, bool up, Point points[]); + float AdjustSlurPosition(Slur *slur, Staff *staff, int layerN, bool up, Point points[]); /** * @name Used for calculating clustered information/dot position diff --git a/src/view_floating.cpp b/src/view_floating.cpp index 62c261f7278..8a5d11791d2 100644 --- a/src/view_floating.cpp +++ b/src/view_floating.cpp @@ -265,21 +265,21 @@ void View::DrawSlur( DeviceContext *dc, Slur *slur, int x1, int x2, Staff *staff points[0] = Point(x1, y1); points[1] = Point(x2, y2); - AdjustSlurPosition(slur, staff, layer1->GetN(), up, points); + float angle = AdjustSlurPosition(slur, staff, layer1->GetN(), up, points); int thickness = m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * m_doc->GetSlurThickness() / DEFINITON_FACTOR ; if ( graphic ) dc->ResumeGraphic(graphic, graphic->GetUuid()); else dc->StartGraphic(slur, "spanning-slur", ""); dc->DeactivateGraphic(); - DrawThickBezierCurve(dc, points[0], points[1], points[2], points[3], thickness, staff->m_drawingStaffSize ); + DrawThickBezierCurve(dc, points[0], points[1], points[2], points[3], thickness, staff->m_drawingStaffSize, angle); dc->ReactivateGraphic(); if ( graphic ) dc->EndResumedGraphic(graphic, this); else dc->EndGraphic(slur, this); } -void View::AdjustSlurPosition(Slur *slur, Staff *staff, int layerN, bool up, Point points[]) +float View::AdjustSlurPosition(Slur *slur, Staff *staff, int layerN, bool up, Point points[]) { // For readability makes them p1 and p2 Point *p1 = &points[0]; @@ -293,11 +293,13 @@ void View::AdjustSlurPosition(Slur *slur, Staff *staff, int layerN, bool up, Po if (fabs(slurAngle) > TEMP_STYLE_MAX_SLUR_SLOPE) { int side = (p2->x - p1->x) * sin(TEMP_STYLE_MAX_SLUR_SLOPE) / sin(M_PI / 2 - TEMP_STYLE_MAX_SLUR_SLOPE); if (p2->y > p1->y) { - p1->y = p2->y - side; + if (up) p1->y = p2->y - side; + else p2->y = p1->y + side; slurAngle = TEMP_STYLE_MAX_SLUR_SLOPE; } else { - p2->y = p1->y - side; + if (up) p2->y = p1->y - side; + else p1->y = p2->y + side; slurAngle = -TEMP_STYLE_MAX_SLUR_SLOPE; } } @@ -313,21 +315,22 @@ void View::AdjustSlurPosition(Slur *slur, Staff *staff, int layerN, bool up, Po height = m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * slur->GetBulge(); } else { - //height = m_doc->GetDrawingUnit(staff->m_drawingStaffSize); int dist = abs( p2->x - p1->x ); height = std::max( m_doc->GetSlurMinHeight() * m_doc->GetDrawingUnit(staff->m_drawingStaffSize) / DEFINITON_FACTOR, dist / TEMP_STYLE_SLUR_HEIGHT_FACTOR); height = std::min( m_doc->GetSlurMaxHeight() * m_doc->GetDrawingUnit(staff->m_drawingStaffSize) / DEFINITON_FACTOR, height ); } - // control points - Point rotatecC1, rotatedC2; - // the height of the control points height = height * 4 / 3; + /************** rotation **************/ + + // control points + Point rotatecC1, rotatedC2; + int cPos = std::min((rotatedP2.x - p1->x) / TEMP_STYLE_SLUR_CONTROL_POINT_FACTOR, m_doc->GetDrawingStaffSize(staff->m_drawingStaffSize)); rotatecC1.x = p1->x + cPos; // point at 1/4 - rotatedC2.x = p2->x - cPos;; // point at 3/4 + rotatedC2.x = rotatedP2.x - cPos;; // point at 3/4 if (up) { rotatecC1.y = p1->y + height; @@ -337,10 +340,7 @@ void View::AdjustSlurPosition(Slur *slur, Staff *staff, int layerN, bool up, Po rotatedC2.y = rotatedP2.y - height; } - points[1] = View::CalcPositionAfterRotation(rotatedP2, slurAngle, *p1); - points[2] = View::CalcPositionAfterRotation(rotatecC1, slurAngle, *p1); - points[3] = View::CalcPositionAfterRotation(rotatedC2, slurAngle, *p1); - + /************** content **************/ System *system = dynamic_cast(staff->GetFirstParent(SYSTEM)); @@ -358,13 +358,17 @@ void View::AdjustSlurPosition(Slur *slur, Staff *staff, int layerN, bool up, Po filters.push_back( &matchStaff ); filters.push_back( &matchLayer ); - //paramsTieAttr.push_back( ¤tNotes ); - //paramsTieAttr.push_back( ¤tChord ); Functor timeSpanningLayerElements( &Object::TimeSpanningLayerElements ); //LogDebug("*** %d - %d", note1->GetDrawingX(), note2->GetDrawingX() ) ; system->Process( &timeSpanningLayerElements, ¶ms, NULL, &filters ); if (spanningContent.size() > 12) LogDebug("### %d %s", spanningContent.size(), slur->GetUuid().c_str()); + + points[1] = View::CalcPositionAfterRotation(rotatedP2, slurAngle, *p1); + points[2] = View::CalcPositionAfterRotation(rotatecC1, slurAngle, *p1); + points[3] = View::CalcPositionAfterRotation(rotatedC2, slurAngle, *p1); + + /* Point bezier[4]; bezier[0].x = 100; @@ -380,7 +384,7 @@ void View::AdjustSlurPosition(Slur *slur, Staff *staff, int layerN, bool up, Po p; */ - + return slurAngle; } void View::DrawTie( DeviceContext *dc, Tie *tie, int x1, int x2, Staff *staff, diff --git a/src/view_graph.cpp b/src/view_graph.cpp index 3ab4dcd1472..72fffd73ce6 100755 --- a/src/view_graph.cpp +++ b/src/view_graph.cpp @@ -202,20 +202,37 @@ void View::DrawLyricString ( DeviceContext *dc, int x, int y, std::wstring s, in dc->EndText( ); } -void View::DrawThickBezierCurve(DeviceContext *dc, Point p1, Point p2, Point c1, Point c2, int thickness, int staffSize) +void View::DrawThickBezierCurve(DeviceContext *dc, Point p1, Point p2, Point c1, Point c2, int thickness, int staffSize, float angle) { assert( dc ); int bez1[6], bez2[6]; // filled array with control points and end point + Point c1Rotated = c1; + Point c2Rotated = c2; + c1Rotated.y += thickness / 2; + c2Rotated.y += thickness / 2; + if (angle != 0.0) { + c1Rotated = CalcPositionAfterRotation(c1Rotated, angle, c1); + c2Rotated = CalcPositionAfterRotation(c2Rotated, angle, c2); + } // Points for first bez, they go from xy to x1y1 - bez1[0] = ToDeviceContextX(c1.x); bez1[1] = ToDeviceContextY(c1.y + thickness / 2); - bez1[2] = ToDeviceContextX(c2.x); bez1[3] = ToDeviceContextY(c2.y + thickness / 2); + bez1[0] = ToDeviceContextX(c1Rotated.x); bez1[1] = ToDeviceContextY(c1Rotated.y); + bez1[2] = ToDeviceContextX(c2Rotated.x); bez1[3] = ToDeviceContextY(c2Rotated.y); bez1[4] = ToDeviceContextX(p2.x); bez1[5] = ToDeviceContextY(p2.y); + c1Rotated = c1; + c2Rotated = c2; + c1Rotated.y -= thickness / 2; + c2Rotated.y -= thickness / 2; + if (angle != 0.0) { + c1Rotated = CalcPositionAfterRotation(c1Rotated, angle, c1); + c2Rotated = CalcPositionAfterRotation(c2Rotated, angle, c2); + } + // second bez. goes back - bez2[0] = ToDeviceContextX(c2.x); bez2[1] = ToDeviceContextY(c2.y - thickness / 2); - bez2[2] = ToDeviceContextX(c1.x); bez2[3] = ToDeviceContextY(c1.y - thickness / 2); + bez2[0] = ToDeviceContextX(c2Rotated.x); bez2[1] = ToDeviceContextY(c2Rotated.y); + bez2[2] = ToDeviceContextX(c1Rotated.x); bez2[3] = ToDeviceContextY(c1Rotated.y); bez2[4] = ToDeviceContextX(p1.x); bez2[5] = ToDeviceContextY(p1.y); // Actually draw it From e2140f30af9910722870708d8012217829482fb3 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Wed, 9 Sep 2015 21:08:25 +0200 Subject: [PATCH 112/114] Adjusting slur begin and end position --- fonts/Leipzig-5.2.sfd | 112 ++++++++++++++++++------------------- include/vrv/beam.h | 8 +++ include/vrv/chord.h | 8 +++ include/vrv/layerelement.h | 3 + include/vrv/note.h | 7 +-- src/beam.cpp | 24 +++++++- src/chord.cpp | 14 ++++- src/layerelement.cpp | 6 ++ src/note.cpp | 15 ----- src/view_beam.cpp | 13 +++++ src/view_floating.cpp | 108 ++++++++++++++++++++++++++++------- 11 files changed, 219 insertions(+), 99 deletions(-) diff --git a/fonts/Leipzig-5.2.sfd b/fonts/Leipzig-5.2.sfd index 5f040880a9a..cb0a093145f 100644 --- a/fonts/Leipzig-5.2.sfd +++ b/fonts/Leipzig-5.2.sfd @@ -20,7 +20,7 @@ OS2Version: 0 OS2_WeightWidthSlopeOnly: 0 OS2_UseTypoMetrics: 1 CreationTime: 1395388130 -ModificationTime: 1440762871 +ModificationTime: 1441821822 PfmFamily: 17 TTFWeight: 500 TTFWidth: 5 @@ -49,7 +49,7 @@ NameList: Adobe Glyph List DisplaySize: -72 AntiAlias: 1 FitToEm: 1 -WinInfo: 57510 18 9 +WinInfo: 59490 18 9 BeginPrivate: 0 EndPrivate TeXData: 1 0 0 346030 173015 115343 0 1048576 115343 783286 444596 497025 792723 393216 433062 380633 303038 157286 324010 404750 52429 2506097 1059062 262144 @@ -3387,58 +3387,58 @@ Flags: HW LayerCount: 2 Fore SplineSet --91 -179 m 1 - -93 -181.667 -93.667 -184 -93 -186 c 128 - -92.333 -188 -88.667 -189.333 -82 -190 c 1 - -63.333 -190 -47.667 -176.333 -35 -149 c 0 - -28.333 -135 -21.667 -119 -15 -101 c 128 - -8.33301 -83 -3.33301 -65.667 0 -49 c 2 - 14 12 l 1 - 58 220 l 1 - 0 220 l 5 - 0 258 l 1 - 70 258 l 1 - 77.333 278.667 83.333 294.333 88 305 c 0 - 95.333 323 102.667 337.667 110 349 c 0 - 130.666 379 152.333 402 175 418 c 128 - 197.667 434 222.667 442 250 442 c 0 - 259.333 442 267 441 273 439 c 128 - 279 437 285.333 431.667 292 423 c 0 - 296.667 416.333 299.667 410 301 404 c 2 - 305 388 l 1 - 305 373.333 304.333 362.666 303 356 c 128 - 301.667 349.333 298 340 292 328 c 0 - 289.333 322 283.333 315 274 307 c 0 - 270 303.667 265.667 301.667 261 301 c 128 - 256.333 300.333 250.667 300.333 244 301 c 1 - 238 302.333 233.667 306 231 312 c 128 - 228.333 318 226.333 324.667 225 332 c 1 - 225 344 227.333 354.667 232 364 c 128 - 236.667 373.333 244 381.333 254 388 c 0 - 261 393 261 393 268 398 c 1 - 268 406.667 262 412 250 414 c 1 - 236.667 415.33 225.333 412.663 216 406 c 128 - 206.667 399.333 197 385 187 363 c 1 - 182.333 351 176.667 333.333 170 310 c 128 - 163.333 286.667 158.667 270 156 260 c 1 - 233 260 l 1 - 233 220 l 1 - 148 220 l 1 - 136 151.333 119 82.667 97 14 c 0 - 79 -41.333 61.667 -85 45 -117 c 0 - 31.667 -143 18 -164 4 -180 c 0 - -20.667 -208.667 -46 -223 -72 -223 c 0 - -96.666 -223 -115.333 -213.333 -128 -194 c 0 - -138 -178.667 -143 -160.667 -143 -140 c 0 - -143 -123.333 -139 -107.333 -131 -92 c 1 - -126.333 -84.667 -120.667 -79 -114 -75 c 128 - -107.333 -71 -100.667 -69 -94 -69 c 0 - -85.333 -69 -78.333 -73 -73 -81 c 128 - -67.667 -89 -64 -96.333 -62 -103 c 128 - -60 -109.667 -59 -115.333 -59 -120 c 0 - -59 -129.333 -61.333 -137.333 -66 -144 c 128 - -70.6641 -150.667 -75.3301 -157.667 -80 -165 c 128 - -84.6641 -172.333 -88.3301 -177 -91 -179 c 1 +-90 -179 m 5 + -92 -181.667 -92.667 -184 -92 -186 c 132 + -91.333 -188 -87.667 -189.333 -81 -190 c 5 + -62.333 -190 -46.667 -176.333 -34 -149 c 4 + -27.333 -135 -20.667 -119 -14 -101 c 132 + -7.33301 -83 -2.33301 -65.667 1 -49 c 6 + 15 12 l 5 + 59 220 l 5 + 1 220 l 5 + 1 258 l 5 + 71 258 l 5 + 78.333 278.667 84.333 294.333 89 305 c 4 + 96.333 323 103.667 337.667 111 349 c 4 + 131.666 379 153.333 402 176 418 c 132 + 198.667 434 223.667 442 251 442 c 4 + 260.333 442 268 441 274 439 c 132 + 280 437 286.333 431.667 293 423 c 4 + 297.667 416.333 300.667 410 302 404 c 6 + 306 388 l 5 + 306 373.333 305.333 362.666 304 356 c 132 + 302.667 349.333 299 340 293 328 c 4 + 290.333 322 284.333 315 275 307 c 4 + 271 303.667 266.667 301.667 262 301 c 132 + 257.333 300.333 251.667 300.333 245 301 c 5 + 239 302.333 234.667 306 232 312 c 132 + 229.333 318 227.333 324.667 226 332 c 5 + 226 344 228.333 354.667 233 364 c 132 + 237.667 373.333 245 381.333 255 388 c 4 + 262 393 262 393 269 398 c 5 + 269 406.667 263 412 251 414 c 5 + 237.667 415.33 226.333 412.663 217 406 c 132 + 207.667 399.333 198 385 188 363 c 5 + 183.333 351 177.667 333.333 171 310 c 132 + 164.333 286.667 159.667 270 157 260 c 5 + 234 260 l 5 + 234 220 l 5 + 149 220 l 5 + 137 151.333 120 82.667 98 14 c 4 + 80 -41.333 62.667 -85 46 -117 c 4 + 32.667 -143 19 -164 5 -180 c 4 + -19.667 -208.667 -45 -223 -71 -223 c 4 + -95.666 -223 -114.333 -213.333 -127 -194 c 4 + -137 -178.667 -142 -160.667 -142 -140 c 4 + -142 -123.333 -138 -107.333 -130 -92 c 5 + -125.333 -84.667 -119.667 -79 -113 -75 c 132 + -106.333 -71 -99.667 -69 -93 -69 c 4 + -84.333 -69 -77.333 -73 -72 -81 c 132 + -66.667 -89 -63 -96.333 -61 -103 c 132 + -59 -109.667 -58 -115.333 -58 -120 c 4 + -58 -129.333 -60.333 -137.333 -65 -144 c 132 + -69.6641 -150.667 -74.3301 -157.667 -79 -165 c 132 + -83.6641 -172.333 -87.3301 -177 -90 -179 c 5 EndSplineSet EndChar @@ -4302,7 +4302,7 @@ StartChar: uniE500 Encoding: 58624 58624 79 Width: 508 VWidth: 2048 -Flags: HWO +Flags: HW LayerCount: 2 Fore SplineSet @@ -5504,7 +5504,7 @@ StartChar: uniE101 Encoding: 57601 57601 111 Width: 508 VWidth: 2048 -Flags: HWO +Flags: HW LayerCount: 2 Fore SplineSet diff --git a/include/vrv/beam.h b/include/vrv/beam.h index 3ca901d4954..b7c1efb2c75 100644 --- a/include/vrv/beam.h +++ b/include/vrv/beam.h @@ -51,6 +51,14 @@ class Beam: public LayerElement, public ObjectListInterface, public DrawingListI */ void AddLayerElement(LayerElement *element); + /** + * Return information about the position in the beam + */ + ///@{ + bool IsFirstInBeam(LayerElement *element); + bool IsLastInBeam(LayerElement *element); + ///@} + /** * @name Set and get the stem direction of the beam. */ diff --git a/include/vrv/chord.h b/include/vrv/chord.h index 52d8fde85b6..8769df47468 100644 --- a/include/vrv/chord.h +++ b/include/vrv/chord.h @@ -64,6 +64,14 @@ class Chord: public LayerElement, public ObjectListInterface, public DurationInt */ void ResetAccidList(); + /** + * Return information about the position in the chord + */ + ///@{ + /** Return 0 if the note id the middle note, -1 if below it and 1 if above */ + int PositionInChord(Note *note); + ///@} + /** * Prepares a 2D grid of booleans to track where accidentals are placed. * Further documentation in chord.cpp comments. diff --git a/include/vrv/layerelement.h b/include/vrv/layerelement.h index 404d9fe9bba..89005691c1b 100644 --- a/include/vrv/layerelement.h +++ b/include/vrv/layerelement.h @@ -15,6 +15,7 @@ namespace vrv { class Alignment; +class Beam; class BeamElementCoord; class Layer; class Mensur; @@ -81,6 +82,8 @@ class LayerElement: public DocObject bool IsCueSize(); /** Return true if the element has to be aligned horizontally */ virtual bool HasToBeAligned() { return false; }; + /** Returns the beam parent if in beam */ + Beam *IsInBeam(); ///@} /** diff --git a/include/vrv/note.h b/include/vrv/note.h index b9a77d87880..98e8174b83e 100644 --- a/include/vrv/note.h +++ b/include/vrv/note.h @@ -92,17 +92,14 @@ class Note: public LayerElement, public DurationInterface, public PitchInterface ///@} /** - * Overriding functions to return information from chord parent if - * note is direct child of a chord. + * Overriding functions to return information from chord parent if any */ ///@{ Chord* IsChordTone( ); int GetDrawingDur( ); bool IsClusterExtreme( ); //used to find if is the highest or lowest note in a cluster - /** Return 0 if the note id the middle note, -1 if below it and 1 if above */ - int PositionInChord(); ///@} - + /** * @name Set and get the stem direction of the note. */ diff --git a/src/beam.cpp b/src/beam.cpp index 0567399f781..281e2dace49 100644 --- a/src/beam.cpp +++ b/src/beam.cpp @@ -98,7 +98,29 @@ void Beam::FilterList( ListOfObjects *childList ) InitCoords( childList ); } - + +bool Beam::IsFirstInBeam(LayerElement *element) +{ + this->GetList(this); + int position = this->GetListIndex(element); + // This method should be called only if the note is part of a beam + assert( position != -1 ); + // this is this first one + if (position == 0) return true; + return false; +} + +bool Beam::IsLastInBeam(LayerElement *element) +{ + int size = (int)this->GetList(this)->size(); + int position = this->GetListIndex(element); + // This method should be called only if the note is part of a beam + assert( position != -1 ); + // this is the last one + if (position == (size - 1)) return true; + return false; +} + void Beam::InitCoords( ListOfObjects *childList ) { ClearCoords(); diff --git a/src/chord.cpp b/src/chord.cpp index 33cbddf73c7..dc91a5c8490 100644 --- a/src/chord.cpp +++ b/src/chord.cpp @@ -165,7 +165,19 @@ void Chord::ResetAccidList() } } } - + +int Chord::PositionInChord(Note *note) +{ + int size = (int)this->GetList(this)->size(); + int position = this->GetListIndex(note); + assert( position != -1 ); + // this is the middle (only if odd) + if ((size % 2) && (position == (size - 1 ) / 2)) return 0; + if (position < (size / 2)) return -1; + return 1; +} + + /** * Creates a 2D grid of width (# of accidentals + 1) * 4 and of height (highest accid - lowest accid) / (half a drawing unit) */ diff --git a/src/layerelement.cpp b/src/layerelement.cpp index 34e288bf4e8..063820b1024 100644 --- a/src/layerelement.cpp +++ b/src/layerelement.cpp @@ -107,6 +107,12 @@ bool LayerElement::IsGraceNote() Note *note = dynamic_cast(this); return (note && note->HasGrace()); } + +Beam* LayerElement::IsInBeam() +{ + if ((this->Is() != NOTE) || (this->Is() == CHORD)) return NULL; + return dynamic_cast(this->GetFirstParent( BEAM, MAX_BEAM_DEPTH) ); +} data_STEMDIRECTION LayerElement::GetDrawingStemDir() { diff --git a/src/note.cpp b/src/note.cpp index c9866268bf6..b8455e70cbd 100644 --- a/src/note.cpp +++ b/src/note.cpp @@ -163,21 +163,6 @@ bool Note::IsClusterExtreme() if (this == cluster->at(cluster->size() - 1)) return true; else return false; } - - -int Note::PositionInChord() -{ - Chord* chordParent = dynamic_cast(this->GetFirstParent( CHORD, MAX_CHORD_DEPTH)); - // This method should be called only if the note is part of a chord - assert( chordParent ); - int size = (int)chordParent->GetList(chordParent)->size(); - int position = chordParent->GetListIndex(this); - assert( position != -1 ); - // this is the middle (only if odd) - if ((size % 2) && (position == (size - 1 ) / 2)) return 0; - if (position < (size / 2)) return -1; - return 1; -} data_STEMDIRECTION Note::CalcDrawingStemDir() { diff --git a/src/view_beam.cpp b/src/view_beam.cpp index bf7b2998da5..9c7e871fc4c 100644 --- a/src/view_beam.cpp +++ b/src/view_beam.cpp @@ -365,6 +365,19 @@ void View::DrawBeam( DeviceContext *dc, LayerElement *element, Layer *layer, Sta el->m_drawingStemStart.y = fy2; el->m_drawingStemEnd.y = fy1; el->m_drawingStemDir = stemDir; + + if ( (*beamElementCoords).at(i)->m_element->Is() == CHORD ) { + Chord *chord = (Chord*)(*beamElementCoords).at(i)->m_element; + for (ListOfObjects::iterator it = chord->GetList(chord)->begin(); it != chord->GetList(chord)->end(); it++) + { + Note *note = dynamic_cast(*it); + assert(note); + note->m_drawingStemStart.x = el->m_drawingStemEnd.x = (*beamElementCoords).at(i)->m_x; + note->m_drawingStemStart.y = fy2; + note->m_drawingStemEnd.y = fy1; + note->SetDrawingStemDir(stemDir); + } + } } diff --git a/src/view_floating.cpp b/src/view_floating.cpp index 8a5d11791d2..f9636a6688c 100644 --- a/src/view_floating.cpp +++ b/src/view_floating.cpp @@ -171,8 +171,13 @@ void View::DrawSlur( DeviceContext *dc, Slur *slur, int x1, int x2, Staff *staff assert( slur ); assert( staff ); - Note *note1 = NULL; - Note *note2 = NULL; + LayerElement *start = NULL; + LayerElement *end = NULL; + Beam *parentBeam = NULL; + Chord *startParentChord = NULL; + Chord *endParentChord = NULL; + Note *startNote = NULL; + Note *endNote = NULL; bool up = true; data_STEMDIRECTION noteStemDir = STEMDIRECTION_NONE; @@ -180,42 +185,53 @@ void View::DrawSlur( DeviceContext *dc, Slur *slur, int x1, int x2, Staff *staff /************** parent layers **************/ - note1 = dynamic_cast(slur->GetStart()); - note2 = dynamic_cast(slur->GetEnd()); + start = dynamic_cast(slur->GetStart()); + end = dynamic_cast(slur->GetEnd()); - if ( !note1 || !note2 ) { + if ( !start || !end ) { // no note, obviously nothing to do... return; } - Layer* layer1 = dynamic_cast(note1->GetFirstParent( LAYER ) ); - Layer* layer2 = dynamic_cast(note2->GetFirstParent( LAYER ) ); + if (start->Is() == NOTE) { + startNote = dynamic_cast(start); + assert(startNote); + startParentChord = startNote->IsChordTone(); + } + if (end->Is() == NOTE) { + endNote = dynamic_cast(end); + assert(endNote); + endParentChord = endNote->IsChordTone(); + } + + Layer* layer1 = dynamic_cast(start->GetFirstParent( LAYER ) ); + Layer* layer2 = dynamic_cast(end->GetFirstParent( LAYER ) ); assert( layer1 && layer2 ); if ( layer1->GetN() != layer2->GetN() ) { LogWarning("Slurs between different layers may not be fully supported."); } - /************** x positions **************/ + /************** y positions **************/ // the normal case if ( spanningType == SPANNING_START_END ) { - y1 = note1->GetDrawingY(); - y2 = note2->GetDrawingY(); - noteStemDir = note1->GetDrawingStemDir(); + y1 = start->GetDrawingY(); + y2 = end->GetDrawingY(); + noteStemDir = start->GetDrawingStemDir(); } // This is the case when the tie is split over two system of two pages. // In this case, we are now drawing its beginning to the end of the measure (i.e., the last aligner) else if ( spanningType == SPANNING_START ) { - y1 = note1->GetDrawingY(); + y1 = start->GetDrawingY(); y2 = y1; - noteStemDir = note1->GetDrawingStemDir(); + noteStemDir = start->GetDrawingStemDir(); } // Now this is the case when the tie is split but we are drawing the end of it else if ( spanningType == SPANNING_END ) { - y1 = note2->GetDrawingY(); + y1 = end->GetDrawingY(); y2 = y1; - noteStemDir = note2->GetDrawingStemDir(); + noteStemDir = end->GetDrawingStemDir(); } // Finally, slur accross an entire system; use the staff position and up else { @@ -235,9 +251,9 @@ void View::DrawSlur( DeviceContext *dc, Slur *slur, int x1, int x2, Staff *staff up = layer1->GetDrawingStemDir() == STEMDIRECTION_up ? true : false; } // the look if in a chord - else if (note1->IsChordTone()) { - if (note1->PositionInChord() < 0) up = false; - else if (note1->PositionInChord() > 0) up = true; + else if (startParentChord) { + if (startParentChord->PositionInChord(startNote) < 0) up = false; + else if (startParentChord->PositionInChord(startNote) > 0) up = true; // away from the stem if odd number (center note) else up = (noteStemDir != STEMDIRECTION_up); } @@ -249,6 +265,55 @@ void View::DrawSlur( DeviceContext *dc, Slur *slur, int x1, int x2, Staff *staff int center = staff->GetDrawingY() - m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) * 2; up = (y1 > center) ? true : false; } + + /************** adjusting y position **************/ + + if ((spanningType == SPANNING_START_END) || (spanningType == SPANNING_START)) { + if (up) { + if (noteStemDir == STEMDIRECTION_down) y1 = start->GetDrawingY(); + else if ((parentBeam = start->IsInBeam()) && !parentBeam->IsLastInBeam(start)) { + y1 = start->m_drawingStemEnd.y; + } + else { + x1 += m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 3 / 2; + y1 = start->GetDrawingY() + m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 2; + } + } + else { + if (noteStemDir == STEMDIRECTION_up) y1 = start->GetDrawingY(); + else if ((parentBeam = start->IsInBeam()) && !parentBeam->IsLastInBeam(start)) { + y1 = start->m_drawingStemEnd.y; + } + else { + //x1 += m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 3 / 2; + y1 = start->GetDrawingY() + m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 2; + } + } + } + if ((spanningType == SPANNING_START_END) || (spanningType == SPANNING_END)) { + data_STEMDIRECTION endStemDir = end->GetDrawingStemDir(); + if (up) { + if (endStemDir == STEMDIRECTION_down) y2 = end->GetDrawingY(); + else if ((parentBeam = end->IsInBeam()) && !parentBeam->IsLastInBeam(end)) { + y2 = end->m_drawingStemEnd.y; + } + else { + //x1 += m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 3 / 2; + y2 = end->GetDrawingY() + m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 2; + } + } + else { + if (endStemDir == STEMDIRECTION_up) y2 = end->GetDrawingY(); + else if ((parentBeam = end->IsInBeam()) && !parentBeam->IsLastInBeam(end)) { + y2 = end->m_drawingStemEnd.y; + } + else { + x2 -= m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 2; + y2 = end->GetDrawingY() - m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 2; + } + } + } + /************** y position **************/ @@ -396,6 +461,7 @@ void View::DrawTie( DeviceContext *dc, Tie *tie, int x1, int x2, Staff *staff, Note *note1 = NULL; Note *note2 = NULL; + Chord *parentChord = NULL; bool up = true; data_STEMDIRECTION noteStemDir = STEMDIRECTION_NONE; @@ -479,9 +545,9 @@ void View::DrawTie( DeviceContext *dc, Tie *tie, int x1, int x2, Staff *staff, up = layer1->GetDrawingStemDir() == STEMDIRECTION_up ? true : false; } // the look if in a chord - else if (note1->IsChordTone()) { - if (note1->PositionInChord() < 0) up = false; - else if (note1->PositionInChord() > 0) up = true; + else if (parentChord) { + if (parentChord->PositionInChord(note1) < 0) up = false; + else if (parentChord->PositionInChord(note1) > 0) up = true; // away from the stem if odd number (center note) else up = (noteStemDir != STEMDIRECTION_up); } From e24478dc40dc88931d055f57625a52727a5ba2a3 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Wed, 9 Sep 2015 22:22:16 +0200 Subject: [PATCH 113/114] Chords and beam position --- src/view_floating.cpp | 57 +++++++++++++++++++++++++++++++++---------- 1 file changed, 44 insertions(+), 13 deletions(-) diff --git a/src/view_floating.cpp b/src/view_floating.cpp index f9636a6688c..7ef3eb4bb98 100644 --- a/src/view_floating.cpp +++ b/src/view_floating.cpp @@ -178,6 +178,8 @@ void View::DrawSlur( DeviceContext *dc, Slur *slur, int x1, int x2, Staff *staff Chord *endParentChord = NULL; Note *startNote = NULL; Note *endNote = NULL; + Chord *startChord = NULL; + Chord *endChord = NULL; bool up = true; data_STEMDIRECTION noteStemDir = STEMDIRECTION_NONE; @@ -198,11 +200,19 @@ void View::DrawSlur( DeviceContext *dc, Slur *slur, int x1, int x2, Staff *staff assert(startNote); startParentChord = startNote->IsChordTone(); } + else if (start->Is() == CHORD) { + startChord = dynamic_cast(start); + assert(startChord); + } if (end->Is() == NOTE) { endNote = dynamic_cast(end); assert(endNote); endParentChord = endNote->IsChordTone(); } + else if (end->Is() == CHORD) { + endChord = dynamic_cast(end); + assert(endChord); + } Layer* layer1 = dynamic_cast(start->GetFirstParent( LAYER ) ); Layer* layer2 = dynamic_cast(end->GetFirstParent( LAYER ) ); @@ -216,25 +226,20 @@ void View::DrawSlur( DeviceContext *dc, Slur *slur, int x1, int x2, Staff *staff // the normal case if ( spanningType == SPANNING_START_END ) { - y1 = start->GetDrawingY(); - y2 = end->GetDrawingY(); noteStemDir = start->GetDrawingStemDir(); } // This is the case when the tie is split over two system of two pages. // In this case, we are now drawing its beginning to the end of the measure (i.e., the last aligner) else if ( spanningType == SPANNING_START ) { - y1 = start->GetDrawingY(); - y2 = y1; noteStemDir = start->GetDrawingStemDir(); } // Now this is the case when the tie is split but we are drawing the end of it else if ( spanningType == SPANNING_END ) { - y1 = end->GetDrawingY(); - y2 = y1; noteStemDir = end->GetDrawingStemDir(); } - // Finally, slur accross an entire system; use the staff position and up + // Finally, slur accross an entire system; use the staff position and up (see below) else { + // To be adjusted y1 = staff->GetDrawingY(); y2 = y1; noteStemDir = STEMDIRECTION_down; @@ -268,52 +273,79 @@ void View::DrawSlur( DeviceContext *dc, Slur *slur, int x1, int x2, Staff *staff /************** adjusting y position **************/ + int yChordMax, yChordMin; if ((spanningType == SPANNING_START_END) || (spanningType == SPANNING_START)) { + // first get the min max of the chord (if any) + if (startParentChord) startParentChord->GetYExtremes(&yChordMax, &yChordMin); + else if (startChord) startChord->GetYExtremes(&yChordMax, &yChordMin); + // slur is up if (up) { + // P(^) if (noteStemDir == STEMDIRECTION_down) y1 = start->GetDrawingY(); - else if ((parentBeam = start->IsInBeam()) && !parentBeam->IsLastInBeam(start)) { + // d(^)d + else if ((parentBeam = start->IsInBeam()) && !parentBeam->IsLastInBeam(start)) { y1 = start->m_drawingStemEnd.y; } + // d(^) else { x1 += m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 3 / 2; - y1 = start->GetDrawingY() + m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 2; + if (startChord || startParentChord) y1 = yChordMin + m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 2; + else y1 = start->GetDrawingY() + m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 2; } } + // slur is down else { + // d(_) if (noteStemDir == STEMDIRECTION_up) y1 = start->GetDrawingY(); + // P(_)P else if ((parentBeam = start->IsInBeam()) && !parentBeam->IsLastInBeam(start)) { y1 = start->m_drawingStemEnd.y; } + // P(_) else { //x1 += m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 3 / 2; y1 = start->GetDrawingY() + m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 2; + if (startChord || startParentChord) y1 = yChordMin + m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 2; + else y1 = start->GetDrawingY() + m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 2; } } } if ((spanningType == SPANNING_START_END) || (spanningType == SPANNING_END)) { + // get the min max of the chord if any + if (endParentChord) endParentChord->GetYExtremes(&yChordMax, &yChordMin); + else if (endChord) endChord->GetYExtremes(&yChordMax, &yChordMin); + // get the stem direction of the end data_STEMDIRECTION endStemDir = end->GetDrawingStemDir(); + // slur is up if (up) { + // (^)P if (endStemDir == STEMDIRECTION_down) y2 = end->GetDrawingY(); + // d(^)d else if ((parentBeam = end->IsInBeam()) && !parentBeam->IsLastInBeam(end)) { y2 = end->m_drawingStemEnd.y; } + // (^)d else { //x1 += m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 3 / 2; - y2 = end->GetDrawingY() + m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 2; + if (endChord || endParentChord) y2 = yChordMin + m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 2; + else y2 = end->GetDrawingY() + m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 2; } } else { + // (_)d if (endStemDir == STEMDIRECTION_up) y2 = end->GetDrawingY(); + // P(_)P else if ((parentBeam = end->IsInBeam()) && !parentBeam->IsLastInBeam(end)) { y2 = end->m_drawingStemEnd.y; } + // (_)P else { x2 -= m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 2; - y2 = end->GetDrawingY() - m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 2; + if (endChord || endParentChord) y2 = yChordMin + m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 2; + else y2 = end->GetDrawingY() - m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 2; } } } - /************** y position **************/ @@ -577,7 +609,6 @@ void View::DrawTie( DeviceContext *dc, Tie *tie, int x1, int x2, Staff *staff, y1 -= m_doc->GetDrawingUnit(staff->m_drawingStaffSize); y2 -= m_doc->GetDrawingUnit(staff->m_drawingStaffSize); } - } /************** bezier points **************/ From e4bb4414c92cfe8f1a573543a80b2d5270789d53 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Thu, 17 Sep 2015 22:51:39 +0200 Subject: [PATCH 114/114] Update vrvdef.h --- include/vrv/vrvdef.h | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/include/vrv/vrvdef.h b/include/vrv/vrvdef.h index 5622d063e3f..673cd540300 100644 --- a/include/vrv/vrvdef.h +++ b/include/vrv/vrvdef.h @@ -21,6 +21,20 @@ namespace vrv { +//---------------------------------------------------------------------------- +// Version +//---------------------------------------------------------------------------- + +#define VERSION_MAJOR 0 +#define VERSION_MINOR 9 +#define VERSION_REVISION 9 +// Adds "-dev" in the version number - should be set to false for releases +#define VERSION_DEV false + +//---------------------------------------------------------------------------- +// Typedefs +//---------------------------------------------------------------------------- + class AttComparison; class BeamElementCoord; class Note; @@ -144,12 +158,6 @@ enum InterfaceId { #define DEFINITON_FACTOR 10 #define PARAM_DENOMINATOR 10 -#define VERSION_MAJOR 0 -#define VERSION_MINOR 9 -#define VERSION_REVISION 9 -// Adds "-dev" in the version number - should be set to false for releases -#define VERSION_DEV true - #define is_in(x,a,b) (((x) >= std::min((a),(b))) && ((x) <= std::max((a),(b)))) /** @@ -270,4 +278,4 @@ enum ClefId { } // namespace vrv -#endif // __VRV_DEF_H__ \ No newline at end of file +#endif // __VRV_DEF_H__