diff --git a/Verovio.xcodeproj/project.pbxproj b/Verovio.xcodeproj/project.pbxproj index b33f69a4ac4..2f9edee28b0 100644 --- a/Verovio.xcodeproj/project.pbxproj +++ b/Verovio.xcodeproj/project.pbxproj @@ -313,7 +313,7 @@ 4DF28A041A754DF000BA9F7D /* floatingelement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = floatingelement.cpp; path = src/floatingelement.cpp; sourceTree = ""; }; 4DF2AF7D1A62F6A50016F869 /* drawinginterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = drawinginterface.h; path = include/vrv/drawinginterface.h; 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 = ""; }; + 8F086EB6188539540037FD8E /* aligner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = aligner.cpp; path = src/aligner.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; 8F086EB8188539540037FD8E /* barline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = barline.cpp; path = src/barline.cpp; sourceTree = ""; }; 8F086EB9188539540037FD8E /* bboxdevicecontext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = bboxdevicecontext.cpp; path = src/bboxdevicecontext.cpp; sourceTree = ""; }; 8F086EBA188539540037FD8E /* beam.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = beam.cpp; path = src/beam.cpp; sourceTree = ""; }; @@ -330,12 +330,12 @@ 8F086EC5188539540037FD8E /* keysig.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = keysig.cpp; path = src/keysig.cpp; sourceTree = ""; }; 8F086EC6188539540037FD8E /* layer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = layer.cpp; path = src/layer.cpp; sourceTree = ""; }; 8F086EC7188539540037FD8E /* layerelement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = layerelement.cpp; path = src/layerelement.cpp; sourceTree = ""; }; - 8F086EC9188539540037FD8E /* measure.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = measure.cpp; path = src/measure.cpp; sourceTree = ""; }; + 8F086EC9188539540037FD8E /* measure.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = measure.cpp; path = src/measure.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; 8F086ECA188539540037FD8E /* mensur.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mensur.cpp; path = src/mensur.cpp; sourceTree = ""; }; 8F086ECB188539540037FD8E /* multirest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = multirest.cpp; path = src/multirest.cpp; sourceTree = ""; }; 8F086ECC188539540037FD8E /* note.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = note.cpp; path = src/note.cpp; sourceTree = ""; }; 8F086ECD188539540037FD8E /* object.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = object.cpp; path = src/object.cpp; sourceTree = ""; }; - 8F086ECE188539540037FD8E /* page.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = page.cpp; path = src/page.cpp; sourceTree = ""; }; + 8F086ECE188539540037FD8E /* page.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = page.cpp; path = src/page.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; 8F086ECF188539540037FD8E /* pitchinterface.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = pitchinterface.cpp; path = src/pitchinterface.cpp; sourceTree = ""; }; 8F086ED0188539540037FD8E /* positioninterface.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = positioninterface.cpp; path = src/positioninterface.cpp; sourceTree = ""; }; 8F086ED1188539540037FD8E /* rest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = rest.cpp; path = src/rest.cpp; sourceTree = ""; }; @@ -354,7 +354,7 @@ 8F086EE0188539540037FD8E /* view.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = view.cpp; path = src/view.cpp; sourceTree = ""; }; 8F086EE1188539540037FD8E /* vrv.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = vrv.cpp; path = src/vrv.cpp; sourceTree = ""; }; 8F086F4D18853CA90037FD8E /* liblibverovio.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = liblibverovio.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; - 8F59290D18854BF800FE51AD /* aligner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = aligner.h; path = include/vrv/aligner.h; sourceTree = ""; }; + 8F59290D18854BF800FE51AD /* aligner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = aligner.h; path = include/vrv/aligner.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 8F59290F18854BF800FE51AD /* barline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = barline.h; path = include/vrv/barline.h; sourceTree = ""; }; 8F59291018854BF800FE51AD /* bboxdevicecontext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = bboxdevicecontext.h; path = include/vrv/bboxdevicecontext.h; sourceTree = ""; }; 8F59291118854BF800FE51AD /* beam.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = beam.h; path = include/vrv/beam.h; sourceTree = ""; }; @@ -371,11 +371,11 @@ 8F59291C18854BF800FE51AD /* keysig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = keysig.h; path = include/vrv/keysig.h; sourceTree = ""; }; 8F59291D18854BF800FE51AD /* layer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = layer.h; path = include/vrv/layer.h; sourceTree = ""; }; 8F59291E18854BF800FE51AD /* layerelement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = layerelement.h; path = include/vrv/layerelement.h; sourceTree = ""; }; - 8F59292018854BF800FE51AD /* measure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = measure.h; path = include/vrv/measure.h; sourceTree = ""; }; + 8F59292018854BF800FE51AD /* measure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = measure.h; path = include/vrv/measure.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 8F59292118854BF800FE51AD /* mensur.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mensur.h; path = include/vrv/mensur.h; sourceTree = ""; }; 8F59292218854BF800FE51AD /* multirest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = multirest.h; path = include/vrv/multirest.h; sourceTree = ""; }; 8F59292318854BF800FE51AD /* note.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = note.h; path = include/vrv/note.h; sourceTree = ""; }; - 8F59292418854BF800FE51AD /* object.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = object.h; path = include/vrv/object.h; sourceTree = ""; }; + 8F59292418854BF800FE51AD /* object.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = object.h; path = include/vrv/object.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 8F59292518854BF800FE51AD /* page.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = page.h; path = include/vrv/page.h; sourceTree = ""; }; 8F59292618854BF800FE51AD /* pitchinterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pitchinterface.h; path = include/vrv/pitchinterface.h; sourceTree = ""; }; 8F59292718854BF800FE51AD /* positioninterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = positioninterface.h; path = include/vrv/positioninterface.h; sourceTree = ""; }; diff --git a/data/Bravura.xml b/data/Bravura.xml index 023eb2ac331..0b139bb697d 100644 --- a/data/Bravura.xml +++ b/data/Bravura.xml @@ -103,6 +103,9 @@ + + + diff --git a/data/Bravura/E901-mensuralGclefPetrucci.xml b/data/Bravura/E901-mensuralGclefPetrucci.xml new file mode 100644 index 00000000000..72026ec8be3 --- /dev/null +++ b/data/Bravura/E901-mensuralGclefPetrucci.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/data/Bravura/E904-mensuralFclefPetrucci.xml b/data/Bravura/E904-mensuralFclefPetrucci.xml new file mode 100644 index 00000000000..f5ee6368076 --- /dev/null +++ b/data/Bravura/E904-mensuralFclefPetrucci.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/data/Bravura/E909-mensuralCclefPetrucciPosMiddle.xml b/data/Bravura/E909-mensuralCclefPetrucciPosMiddle.xml new file mode 100644 index 00000000000..ea11f5ace3e --- /dev/null +++ b/data/Bravura/E909-mensuralCclefPetrucciPosMiddle.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/data/Gootville.xml b/data/Gootville.xml index 0c8dde65e05..262bbd1de2b 100644 --- a/data/Gootville.xml +++ b/data/Gootville.xml @@ -103,6 +103,9 @@ + + + diff --git a/data/Gootville/E901-mensuralGclefPetrucci.xml b/data/Gootville/E901-mensuralGclefPetrucci.xml new file mode 100644 index 00000000000..b11f8f63c1c --- /dev/null +++ b/data/Gootville/E901-mensuralGclefPetrucci.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/data/Gootville/E904-mensuralFclefPetrucci.xml b/data/Gootville/E904-mensuralFclefPetrucci.xml new file mode 100644 index 00000000000..36a690e8ae2 --- /dev/null +++ b/data/Gootville/E904-mensuralFclefPetrucci.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/data/Gootville/E909-mensuralCclefPetrucciPosMiddle.xml b/data/Gootville/E909-mensuralCclefPetrucciPosMiddle.xml new file mode 100644 index 00000000000..d1574e34255 --- /dev/null +++ b/data/Gootville/E909-mensuralCclefPetrucciPosMiddle.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/data/Leipzig.xml b/data/Leipzig.xml index b4908963b42..3d1540bbeb8 100644 --- a/data/Leipzig.xml +++ b/data/Leipzig.xml @@ -107,4 +107,7 @@ + + + diff --git a/data/Leipzig/E4A8-articStaccatissimoWedgeAbove.xml b/data/Leipzig/E4A8-articStaccatissimoWedgeAbove.xml index 67247e91415..2e4eb2534ae 100644 --- a/data/Leipzig/E4A8-articStaccatissimoWedgeAbove.xml +++ b/data/Leipzig/E4A8-articStaccatissimoWedgeAbove.xml @@ -3,6 +3,6 @@ overflow="inherit" horiz-adv-x="153"> - + diff --git a/data/Leipzig/E4A9-articStaccatissimoWedgeBelow.xml b/data/Leipzig/E4A9-articStaccatissimoWedgeBelow.xml index 939e754fa81..20cd3c2010a 100644 --- a/data/Leipzig/E4A9-articStaccatissimoWedgeBelow.xml +++ b/data/Leipzig/E4A9-articStaccatissimoWedgeBelow.xml @@ -3,6 +3,6 @@ overflow="inherit" horiz-adv-x="153"> - + diff --git a/data/Leipzig/E500-repeat1Bar.xml b/data/Leipzig/E500-repeat1Bar.xml index 537d9e14db0..10ad368c74f 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 04ea5ab7981..1f1f45be1ee 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 8245027e5df..2c508da2ced 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/data/Leipzig/E521-dynamicMezzo.xml b/data/Leipzig/E521-dynamicMezzo.xml index 00ae427e3d4..00430b7d11e 100644 --- a/data/Leipzig/E521-dynamicMezzo.xml +++ b/data/Leipzig/E521-dynamicMezzo.xml @@ -3,6 +3,6 @@ overflow="inherit" horiz-adv-x="405"> - + diff --git a/data/Leipzig/E522-dynamicForte.xml b/data/Leipzig/E522-dynamicForte.xml index a285762bd96..bc40b716211 100644 --- a/data/Leipzig/E522-dynamicForte.xml +++ b/data/Leipzig/E522-dynamicForte.xml @@ -3,6 +3,6 @@ overflow="inherit" horiz-adv-x="232"> - + diff --git a/data/Leipzig/E52F-dynamicFF.xml b/data/Leipzig/E52F-dynamicFF.xml index 606acdbe7c0..c1c14b906e1 100644 --- a/data/Leipzig/E52F-dynamicFF.xml +++ b/data/Leipzig/E52F-dynamicFF.xml @@ -3,6 +3,6 @@ overflow="inherit" horiz-adv-x="479"> - + diff --git a/data/Leipzig/E531-dynamicFFFF.xml b/data/Leipzig/E531-dynamicFFFF.xml index b769b0d2966..9a614b8b5d3 100644 --- a/data/Leipzig/E531-dynamicFFFF.xml +++ b/data/Leipzig/E531-dynamicFFFF.xml @@ -3,6 +3,6 @@ overflow="inherit" horiz-adv-x="925"> - + diff --git a/data/Leipzig/E532-dynamicFFFFF.xml b/data/Leipzig/E532-dynamicFFFFF.xml index cce0a5e65ff..a89b39938eb 100644 --- a/data/Leipzig/E532-dynamicFFFFF.xml +++ b/data/Leipzig/E532-dynamicFFFFF.xml @@ -3,6 +3,6 @@ overflow="inherit" horiz-adv-x="1158"> - + diff --git a/data/Leipzig/E567-ornamentTurn.xml b/data/Leipzig/E567-ornamentTurn.xml index 409fcfa968c..8fc2883485e 100644 --- a/data/Leipzig/E567-ornamentTurn.xml +++ b/data/Leipzig/E567-ornamentTurn.xml @@ -3,6 +3,6 @@ overflow="inherit" horiz-adv-x="468"> - + diff --git a/data/Leipzig/E568-ornamentTurnInverted.xml b/data/Leipzig/E568-ornamentTurnInverted.xml index 6f6550210fb..fbd88327cf2 100644 --- a/data/Leipzig/E568-ornamentTurnInverted.xml +++ b/data/Leipzig/E568-ornamentTurnInverted.xml @@ -3,6 +3,6 @@ overflow="inherit" horiz-adv-x="468"> - + diff --git a/data/Leipzig/E56A-ornamentTurnUp.xml b/data/Leipzig/E56A-ornamentTurnUp.xml index 5080ed5688a..0757374e0f7 100644 --- a/data/Leipzig/E56A-ornamentTurnUp.xml +++ b/data/Leipzig/E56A-ornamentTurnUp.xml @@ -3,6 +3,6 @@ overflow="inherit" horiz-adv-x="248"> - + diff --git a/data/Leipzig/E56B-ornamentTurnUpS.xml b/data/Leipzig/E56B-ornamentTurnUpS.xml index 2e7912f4e19..01b3c36be21 100644 --- a/data/Leipzig/E56B-ornamentTurnUpS.xml +++ b/data/Leipzig/E56B-ornamentTurnUpS.xml @@ -3,6 +3,6 @@ overflow="inherit" horiz-adv-x="248"> - + diff --git a/data/Leipzig/E56E-ornamentTremblement.xml b/data/Leipzig/E56E-ornamentTremblement.xml index 3665869dfe4..93b0ffb1499 100644 --- a/data/Leipzig/E56E-ornamentTremblement.xml +++ b/data/Leipzig/E56E-ornamentTremblement.xml @@ -3,6 +3,6 @@ overflow="inherit" horiz-adv-x="711"> - + diff --git a/data/Leipzig/E901-mensuralGclefPetrucci.xml b/data/Leipzig/E901-mensuralGclefPetrucci.xml new file mode 100644 index 00000000000..d9d8c956684 --- /dev/null +++ b/data/Leipzig/E901-mensuralGclefPetrucci.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/data/Leipzig/E904-mensuralFclefPetrucci.xml b/data/Leipzig/E904-mensuralFclefPetrucci.xml new file mode 100644 index 00000000000..00ae58f9e5f --- /dev/null +++ b/data/Leipzig/E904-mensuralFclefPetrucci.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/data/Leipzig/E909-mensuralCclefPetrucciPosMiddle.xml b/data/Leipzig/E909-mensuralCclefPetrucciPosMiddle.xml new file mode 100644 index 00000000000..87ec6d99729 --- /dev/null +++ b/data/Leipzig/E909-mensuralCclefPetrucciPosMiddle.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/fonts/Leipzig-5.2.sfd b/fonts/Leipzig-5.2.sfd index cb0a093145f..467efa0d2eb 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+AAoA-Version 5.2.2 - fixing size of some glpyhs+AAoA" +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.3 - adding mensural clefs" Version: 5.2.1 ItalicAngle: 0 UnderlinePosition: -50 @@ -20,7 +20,7 @@ OS2Version: 0 OS2_WeightWidthSlopeOnly: 0 OS2_UseTypoMetrics: 1 CreationTime: 1395388130 -ModificationTime: 1441821822 +ModificationTime: 1442493779 PfmFamily: 17 TTFWeight: 500 TTFWidth: 5 @@ -49,11 +49,11 @@ NameList: Adobe Glyph List DisplaySize: -72 AntiAlias: 1 FitToEm: 1 -WinInfo: 59490 18 9 +WinInfo: 59580 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 114 +BeginChars: 1114115 117 StartChar: uniE0A3 Encoding: 57507 57507 0 @@ -3387,58 +3387,58 @@ Flags: HW LayerCount: 2 Fore SplineSet --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 +-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 @@ -5603,5 +5603,232 @@ SplineSet 1092.67 -146 1087.67 -135 1087 -121 c 0 EndSplineSet EndChar + +StartChar: uniE901 +Encoding: 59649 59649 114 +Width: 596 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +183 747 m 4 + 196.334 754.333 210.667 758.333 226 759 c 132 + 241.334 759.667 255.667 757.667 269 753 c 132 + 282.333 748.333 293.333 740.333 302 729 c 132 + 310.667 717.661 316.333 705.328 319 692 c 4 + 321.667 676 317.333 656 306 632 c 132 + 294.667 608 281 590 265 578 c 4 + 256.333 571.333 250.333 565.333 247 560 c 132 + 243.667 554.667 241.667 548 241 540 c 4 + 241 534.667 242 530 244 526 c 132 + 246 522 248.333 519.333 251 518 c 132 + 253.667 516.663 258.667 511.996 266 504 c 132 + 273.335 496 280.668 487 288 477 c 4 + 301.333 460.332 309.333 447.666 312 439 c 132 + 314.667 430.333 317.333 414.333 320 391 c 5 + 322 360.333 321.333 338.666 318 326 c 132 + 314.667 313.333 305.333 298.666 290 282 c 4 + 281.332 272 275.665 263.667 273 257 c 132 + 270.333 250.333 269 243.667 269 237 c 5 + 270.333 224.333 277.333 215.333 290 210 c 132 + 302.667 204.667 324.667 202 356 202 c 4 + 378 202 393.333 203 402 205 c 4 + 410.667 206.333 419.667 210 429 216 c 6 + 449 230 l 5 + 437 213 l 6 + 429 201.667 426.333 190.333 429 179 c 6 + 432 162 l 5 + 296 162 l 6 + 263.333 162 238.333 161.667 221 161 c 132 + 203.667 160.333 187.333 159.667 172 159 c 132 + 156.667 158.333 144.667 156 136 152 c 132 + 127.332 148 119.666 144 113 140 c 132 + 106.332 136 98.666 129.333 90 120 c 5 + 68.667 100 54.667 74.333 48 43 c 132 + 41.333 11.667 42.333 -20 51 -52 c 4 + 55.667 -69.333 64.334 -85.333 77 -100 c 132 + 89.667 -114.667 104.333 -126.667 121 -136 c 132 + 137.667 -145.333 156 -153 176 -159 c 132 + 196 -165 216.333 -167 237 -165 c 132 + 257.667 -163 277.333 -158.333 296 -151 c 4 + 316.667 -142.334 331.333 -131.667 340 -119 c 132 + 348.667 -106.333 354.667 -87 358 -61 c 4 + 360 -43 360.333 -29.667 359 -21 c 132 + 357.667 -12.333 354 -1.33301 348 12 c 4 + 340 28 330.333 40.667 319 50 c 132 + 307.667 59.333 298 62.667 290 60 c 4 + 286 58 283.667 54.667 283 50 c 132 + 282.333 45.333 282.333 37.667 283 27 c 5 + 285.667 9.66699 283.333 -8.33301 276 -27 c 132 + 268.667 -45.667 258.667 -59.333 246 -68 c 132 + 233.333 -76.667 220 -81 206 -81 c 4 + 194 -81 178.667 -76 160 -66 c 132 + 141.333 -56 128.333 -44 121 -30 c 4 + 109 -6 108.333 17.667 119 41 c 132 + 129.667 64.333 149.333 82.667 178 96 c 4 + 194 104 210 108 226 108 c 132 + 242 108 264.667 104.667 294 98 c 4 + 320.667 92 341 83 355 71 c 132 + 369 59 381 39.333 391 12 c 4 + 396.333 -1.33301 399.333 -12 400 -20 c 132 + 400.658 -28 399.325 -41 396 -59 c 132 + 392.667 -77 389 -89.667 385 -97 c 132 + 381 -104.333 373.667 -112.667 363 -122 c 4 + 346.333 -136.667 326.333 -149.667 303 -161 c 4 + 287 -169 274 -173.667 264 -175 c 132 + 254 -176.331 236 -176.664 210 -176 c 5 + 158.667 -173.333 116.667 -163 84 -145 c 132 + 51.333 -127 25.333 -99 6 -61 c 4 + -5.33301 -38.333 -11.333 -17.333 -12 2 c 132 + -12.667 21.333 -8 44.333 2 71 c 4 + 15.333 106.333 31.333 133 50 151 c 132 + 68.667 169 96 183.667 132 195 c 4 + 148.667 200.333 166.333 208.333 185 219 c 132 + 203.667 229.667 217 240 225 250 c 5 + 235 260.667 247 278 261 302 c 4 + 271 318.667 277 331 279 339 c 132 + 281 347 281.333 362.333 280 385 c 4 + 278 415.667 271.667 439 261 455 c 4 + 251.667 469 239.333 481.333 224 492 c 132 + 208.667 502.667 195 508 183 508 c 132 + 171 508 157 498.667 141 480 c 132 + 125 461.333 114 442.333 108 423 c 4 + 104 408.333 102.667 395.333 104 384 c 4 + 105.333 368.667 110.333 350 119 328 c 4 + 119.667 325.333 119 321.333 117 316 c 132 + 115 310.667 112.333 305.667 109 301 c 4 + 100.332 291 92.332 287.667 85 291 c 132 + 77.666 294.333 68.333 306 57 326 c 4 + 40.333 354.667 37.667 383.667 49 413 c 4 + 53 423 65 437.667 85 457 c 132 + 105 476.333 122.333 490 137 498 c 4 + 143.667 502 148.333 506.333 151 511 c 132 + 153.667 515.667 155 522.333 155 531 c 4 + 155 545.671 153 554.338 149 557 c 4 + 143 560.333 136 572.667 128 594 c 132 + 120 615.333 115.667 632 115 644 c 5 + 115 666.667 120.333 686.334 131 703 c 132 + 141.667 719.67 159 734.336 183 747 c 4 +277 715 m 4 + 268.333 723.667 255.333 728.667 238 730 c 132 + 220.667 731.333 204.667 729.667 190 725 c 5 + 178.667 719.667 169.333 711.667 162 701 c 132 + 154.667 690.333 150.667 679 150 667 c 132 + 149.333 655 150 643 152 631 c 132 + 154 619 159.333 608.667 168 600 c 132 + 176.667 591.333 187 586 199 584 c 4 + 216.334 580.685 230.667 581.351 242 586 c 132 + 253.333 590.667 264.333 600.667 275 616 c 4 + 283.667 628 289 637.333 291 644 c 132 + 293 650.672 293.333 660.338 292 673 c 4 + 291.319 681.667 289.653 690 287 698 c 132 + 284.333 706 281 711.667 277 715 c 4 +233 59 m 4 + 225.667 64.333 214 67.333 198 68 c 132 + 182 68.667 170.667 67.333 164 64 c 5 + 157.333 59.333 152 51.333 148 40 c 132 + 144 28.667 142 16 142 2 c 4 + 142 -9.33301 143.333 -18 146 -24 c 4 + 146.667 -26.667 152 -33.667 162 -45 c 4 + 170.667 -55 182.667 -61.333 198 -64 c 4 + 210.667 -66 222 -63.667 232 -57 c 132 + 242 -50.333 248.667 -40.333 252 -27 c 4 + 255.333 -13 255 3.33301 251 22 c 132 + 247 40.667 241 53 233 59 c 4 +EndSplineSet +EndChar + +StartChar: uniE904 +Encoding: 59652 59652 115 +Width: 677 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +337 -808 m 1 + 312 -808 l 1 + 312 -115 l 1 + 25 -115 l 1 + 25 -208 l 1 + 0 -208 l 1 + 0 209 l 1 + 25 209 l 1 + 25 123 l 1 + 312 123 l 1 + 312 209 l 1 + 337 209 l 1 + 337 -808 l 1 +312 -50 m 1 + 312 58 l 1 + 25 58 l 1 + 25 -50 l 1 + 312 -50 l 1 +518 -290 m 1 + 548 -280 l 1 + 548 -883 l 1 + 518 -883 l 1 + 518 -290 l 1 +535 325 m 1 + 677 147 l 1 + 535 -31 l 1 + 391 147 l 1 + 535 325 l 1 +508 249 m 1 + 454 182 l 1 + 566 44 l 1 + 618 110 l 1 + 508 249 l 1 +535 37 m 1 + 677 -141 l 1 + 535 -319 l 1 + 391 -141 l 1 + 535 37 l 1 +508 -39 m 1 + 454 -106 l 1 + 566 -244 l 1 + 618 -178 l 1 + 508 -39 l 1 +EndSplineSet +EndChar + +StartChar: uniE909 +Encoding: 59657 59657 116 +Width: 309 +VWidth: 2048 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 595 m 1 + 28 595 l 1 + 28 353 l 1 + 280 353 l 1 + 280 595 l 1 + 309 595 l 1 + 309 64 l 1 + 28 64 l 1 + 28 -64 l 1 + 309 -64 l 1 + 309 -602 l 1 + 280 -602 l 1 + 280 -355 l 1 + 28 -355 l 1 + 28 -602 l 1 + 0 -602 l 1 + 0 595 l 1 +280 255 m 1 + 28 255 l 1 + 28 164 l 1 + 280 164 l 1 + 280 255 l 1 +280 -172 m 1 + 28 -172 l 1 + 28 -263 l 1 + 280 -263 l 1 + 280 -172 l 1 +EndSplineSet +EndChar EndChars EndSplineFont diff --git a/fonts/Leipzig.svg b/fonts/Leipzig.svg index 49f630b76ff..71ab0f2ac33 100644 --- a/fonts/Leipzig.svg +++ b/fonts/Leipzig.svg @@ -5,11 +5,11 @@ 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 - +Version 5.2.3 - adding mensural clefs --> -Created by FontForge 20120731 at Fri Aug 28 13:54:39 2015 +Created by FontForge 20120731 at Thu Sep 17 14:43:38 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\). @@ -279,14 +279,14 @@ d="M0 -0c49 0 97.5 -2.26367 135.5 4.73633c206 95 258.5 264.264 263.5 271.264c0 1 +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.66701 12.667 -6 20c0 12 2.33299 22.667 7 32s12 17.333 22 24l14 10c0 8.66699 -6 14 -18 16c-13.333 1.32999 -24.667 -1.33701 -34 -8 +c-9.33299 -6.66699 -19 -21 -29 -43c-4.66701 -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.66701 -56 29c-10 15.333 -15 33.333 -15 54c0 16.667 4 32.667 12 48c4.667 7.333 10.333 13 17 17s13.333 6 20 6c8.667 0 15.667 -4 21 -12s9 -15.333 11 -22s3 -12.333 3 -17c0 -9.33299 -2.333 -17.333 -7 -24 +c-4.6641 -6.66701 -9.3301 -13.667 -14 -21c-4.6641 -7.33299 -8.3301 -12 -11 -14z" /> +d="M508 242l-362 -484h-146l362 484h146zM52 118c0 13.333 4.333 24.667 13 34s19.333 14.333 32 15c14 0 25.667 -4 35 -12c9.33299 -8 14.333 -19 15 -33c0 -13.333 -4.33299 -24.667 -13 -34c-8.667 -9.333 -19.333 -14.333 -32 -15c-14 0 -25.667 4 -35 12 +s-14.333 19 -15 33zM361 -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" /> +d="M481 220h-83c-8.66699 -55.333 -22.333 -114.333 -41 -177s-35.667 -109.667 -51 -141c-15.333 -31.333 -32 -58 -50 -80c-16 -21.333 -37 -35.666 -63 -43l-19 -2c-21.333 0 -37.333 8.66701 -48 26c-4 5.33299 -7 10.333 -9 15c-2 4.666 -4 10.333 -6 17 +c-2 6.666 -3 16.333 -3 29c0 18.667 4 32.667 12 42s18.667 17.667 32 25c5.33299 0 10 -1 14 -3s8.33299 -6 13 -12c7.33299 -9.333 11 -20.667 11 -34c0 -14.667 -10.667 -36.333 -32 -65c0 -4.66701 3 -7 9 -7c34 0 61.333 46.333 82 139l7 29l13 60l22 102l17 80h-161 +c-8 -53.333 -22.333 -113.333 -43 -180c-12 -39.333 -20.667 -66 -26 -80c-8 -21.333 -16.333 -40.667 -25 -58c-32.667 -72 -69.333 -113 -110 -123l-18 -2c-21.3311 0 -37.664 8.66701 -49 26c-5.33299 6 -10.333 15.333 -15 28c-0.667007 5.33299 -1.33299 10.333 -2 15 +s-1.33299 10.667 -2 18c1.33299 11.333 2.66701 20.333 4 27s4.33299 13 9 19c6.667 8.667 17.667 15.667 33 21c10.6621 0 19.3281 -5 26 -15c6.6572 -10 10.3242 -21.333 11 -34c0 -7.333 -0.667 -12.667 -2 -16c-1.333 -3.332 -2.333 -5.666 -3 -7l-14 -23l-15 -19 +c0 -4.66701 3.333 -7 10 -7c11.333 0 21.667 5 31 15c3.333 3.33299 7 8 11 14s8 13 12 21l14 36l15 53l19 86l22 105l17 80h-57v38h70c9.333 31.334 22 60.667 38 88s37.667 51 65 71c24.667 16.667 52.333 25 83 25c15.333 0 27.333 -6.33301 36 -19s13 -28.334 13 -47 +c0 -18.667 -4.33301 -35.334 -13 -50c-8.66599 -14.668 -21.333 -23.335 -38 -26c-16.667 0 -26 10.667 -28 32c0 11.335 3.33299 23.668 10 37c6.66701 11.335 15.667 19.668 27 25c3.33301 2.66699 5 4.66699 5 6c-3.33301 4.66699 -5.66699 7.66699 -7 9 +c-4.66699 3.33301 -10.667 5 -18 5c-22 0 -40 -15.667 -54 -47s-25 -67 -33 -107h164c13.333 49.333 36.667 92 70 128s72 54 116 54c8 0 15 -1.33301 21 -4s11 -8 15 -16c2.66699 -3.33301 5.33301 -9 8 -17s4.33301 -17.667 5 -29c0 -18.667 -4.33301 -35 -13 -49 +s-21 -23 -37 -27c-18 0 -28 10.667 -30 32c0 6 1 12 3 18s4.66699 12 8 18s7 11 11 15s9 7.66699 15 11c3.33301 2.66699 5 4.66699 5 6l-6 9c-4.66699 3.33301 -10.333 5 -17 5c-37.333 0 -66.667 -52 -88 -156h75v-38z" /> +d="M597 -69c21.386 0 35 -30.9219 35 -51c0 -20.113 -12.602 -31.813 -21 -45c-4.664 -7.33299 -8.33002 -12 -11 -14c-5.521 -7.362 -1.33801 -9.966 9 -11c35.075 0 54.221 54.5 67 89c6.66699 18 11.667 35.333 15 52c20.706 88.2939 38.664 179.336 58 269h-143 +c-7 -44 -15 -84 -26 -121c-18 -75 -39 -141 -66 -197c-15 -28 -31 -55 -50 -79c-16 -21 -36 -36 -61 -44l-18 -2c-35 0 -53 23 -62 54c-4 10 -6 21 -6 33c4 37 15 57 46 67c23 0 35 -23 36 -47c0 -8 -4 -23 -9 -31l-10 -15c-7 -10 -8 -12 -13 -21c0 -5 3 -7 10 -7 +c19 0 35 14 48 42c13 32 23 60 33 97c14 62 27 123 41 185l18 86h-140c-14 -89 -60 -256 -93 -318c-15 -31 -30 -57 -47 -79s-38 -37 -65 -44l-18 -2c-44 0 -67 40 -67 87c0 39 18 53 45 67c6 0 11 -1 14 -4c14.846 -5.9385 23 -25.0508 23 -45c0 -15 -11 -36 -32 -65 +c0 -5 3 -7 9 -7c34 0 61 46 82 139c21.424 88.7559 39.772 180.774 59 271h-141c-13 -85 -62 -255 -93 -318c-33 -72 -70 -113 -110 -123l-19 -2c-35 0 -51 24 -63 54l-5 33c5 39 13 55 46 67c23 0 38 -26 38 -49c0 -8 -2 -16 -6 -23l-14 -23l-14 -19c0 -5 3 -7 10 -7 +c11 0 21 5 30 15c18 15 26 46 37 71l15 53c17 77 34 155 50 233c3 13 6 26 9 38h-57v38h69c9 33 23 62 40 89c17 28 38 51 63 70c25 17 53 25 83 25c33 0 49 -30 49 -66c0 -38 -19 -70 -50 -76c-17 0 -27 11 -29 32c0 27 17 53 37 62c3 0 5 2 5 6l-6 9c-5 3 -11 5 -18 5 +c-23 0 -41 -16 -55 -48s-25 -67 -32 -106h144c23 84 85 182 185 182c36 0 47 -31 49 -66c0 -18 -4 -35 -13 -51c-8 -12 -20 -20 -37 -25c-18 0 -28 11 -30 32c0 29 18 51 37 62c3 0 5 2 5 6c-4 10 -11 14 -23 14c-37 0 -67 -52 -88 -156h144c15 49 39 93 72 132 +c31 36 69 54 114 54c34 0 49 -36 49 -70c0 -37 -19 -68 -51 -74c-16 0 -25 11 -27 32c0 26 18 52 35 62c4 0 6 2 6 6c-5 9 -11 14 -24 14c-37 0 -67 -52 -88 -156h146c13.429 37.847 22.957 64.661 40 91c20.666 30 42.333 53 65 69s47.667 24 75 24 +c28.318 0 45.6 -13.674 51 -38l4 -16c0 -33.139 -1 -36.007 -13 -60c-3.138 -7.06 -17.383 -25.054 -31 -27c-4.66699 -0.666992 -10.333 -0.666992 -17 0c-12.606 2.80099 -16.566 17.612 -19 31c0 27.28 11.325 44.216 29 56l14 10c0 8.66699 -6 14 -18 16 +c-13.333 1.32999 -24.667 -1.33701 -34 -8c-9.33301 -6.66699 -19 -21 -29 -43c-6.914 -17.778 -25.9 -83.879 -31 -103h77v-40h-85c-19.014 -108.805 -60.061 -254.559 -103 -337c-23.657 -46.132 -64.302 -106 -117 -106c-44.617 0 -71 36.683 -71 83 +c0 31.822 15.31 71 49 71z" /> +d="M983 220l-44 -208l-14 -61c-3.33301 -16.667 -8.33301 -34 -15 -52s-13.333 -34 -20 -48c-12.667 -27.333 -28.333 -41 -47 -41c-6.66699 0.667007 -10.333 2 -11 4s0 4.33299 2 7c2.66998 2 6.336 6.66701 11 14c4.66998 7.33299 9.336 14.333 14 21 +c4.66699 6.66701 7 14.667 7 24c0 4.667 -1 10.333 -3 17s-5.66699 14 -11 22s-12.333 12 -21 12c-6.66699 0 -13.333 -2 -20 -6s-12.333 -9.667 -17 -17c-8 -15.333 -12 -31.333 -12 -48c0 -20.667 5 -38.667 15 -54c12.667 -19.333 31.334 -29 56 -29 +c26 0 51.333 14.333 76 43c14 16 27.667 37 41 63c16.67 32 34 75.667 52 131c22 68.667 39 137.333 51 206h85v40h-77c2.67004 10 7.32996 26.667 14 50s12.33 41 17 53c10 22 19.67 36.333 29 43c9.32996 6.66299 20.67 9.32999 34 8c12 -2 18 -7.33301 18 -16l-14 -10 +c-10 -6.66699 -17.33 -14.667 -22 -24s-7 -20 -7 -32c1.32996 -7.33301 3.32996 -14 6 -20s7 -9.66699 13 -11c6.67004 -0.666992 12.33 -0.666992 17 0s9 2.66699 13 6c9.32996 8 15.33 15 18 21c6 12 9.67004 21.333 11 28c1.32996 6.66599 2 17.333 2 32l-4 16 +c-1.32996 6 -4.32996 12.333 -9 19c-6.67004 8.66699 -13 14 -19 16s-13.67 3 -23 3c-27.33 0 -52.33 -8 -75 -24s-44.33 -39 -65 -69c-7.32996 -11.333 -14.67 -26 -22 -44c-4.66998 -10.667 -10.67 -26.333 -18 -47h-148c5.09998 19.121 24.086 87.222 31 105 +c10 22 19.667 36.333 29 43c9.33301 6.66299 20.667 9.32999 34 8c12 -2 18 -7.33301 18 -16l-14 -10c-17.675 -11.784 -29 -28.72 -29 -56c2.43402 -13.388 6.39398 -28.199 19 -31c6.66699 -0.666992 12.333 -0.666992 17 0c13.617 1.94601 27.862 19.94 31 27 +c12 23.993 13 26.861 13 60l-4 16c-5.40002 24.326 -22.682 38 -51 38c-27.333 0 -52.333 -8 -75 -24s-44.334 -39 -65 -69c-17.043 -26.339 -26.571 -53.153 -40 -91h-146c21 104 51 156 88 156c13 0 19 -5 24 -14c0 -4 -2 -6 -6 -6c-17 -10 -35 -36 -35 -62 +c2 -21 11 -32 27 -32c32 6 51 37 51 74c0 34 -15 70 -49 70c-45 0 -83 -18 -114 -54c-33 -39 -57 -83 -72 -132h-144c21 104 51 156 88 156c12 0 19 -4 23 -14c0 -4 -2 -6 -5 -6c-19 -11 -37 -33 -37 -62c2 -21 12 -32 30 -32c17 5 29 13 37 25c9 16 13 33 13 51 +c-2 35 -13 66 -49 66c-100 0 -162 -98 -185 -182h-144c7 39 18 74 32 106s32 48 55 48c7 0 13 -2 18 -5l6 -9c0 -4 -2 -6 -5 -6c-20 -9 -37 -35 -37 -62c2 -21 12 -32 29 -32c31 6 50 38 50 76c0 36 -16 66 -49 66c-30 0 -58 -8 -83 -25c-25 -19 -46 -42 -63 -70 +c-17 -27 -31 -56 -40 -89h-69v-38h57c-3 -12 -6 -25 -9 -38c-16 -78 -33 -156 -50 -233l-15 -53c-11 -25 -19 -56 -37 -71c-9 -10 -19 -15 -30 -15c-7 0 -10 2 -10 7l14 19l14 23c4 7 6 15 6 23c0 23 -15 49 -38 49c-33 -12 -41 -28 -46 -67l5 -33c12 -30 28 -54 63 -54 +l19 2c40 10 77 51 110 123c31 63 80 233 93 318h141c-19.228 -90.226 -37.576 -182.244 -59 -271c-21 -93 -48 -139 -82 -139c-6 0 -9 2 -9 7c21 29 32 50 32 65c0 19.9492 -8.15401 39.0615 -23 45c-3 3 -8 4 -14 4c-27 -14 -45 -28 -45 -67c0 -47 23 -87 67 -87l18 2 +c27 7 48 22 65 44s32 48 47 79c33 62 79 229 93 318h140l-18 -86c-14 -62 -27 -123 -41 -185c-10 -37 -20 -65 -33 -97c-13 -28 -29 -42 -48 -42c-7 0 -10 2 -10 7c5 9 6 11 13 21l10 15c5 8 9 23 9 31c-1 24 -13 47 -36 47c-31 -10 -42 -30 -46 -67c0 -12 2 -23 6 -33 +c9 -31 27 -54 62 -54l18 2c25 8 45 23 61 44c19 24 35 51 50 79c27 56 48 122 66 197c11 37 19 77 26 121h143c-19.336 -89.664 -37.294 -180.706 -58 -269c-3.33301 -16.667 -8.33301 -34 -15 -52c-12.779 -34.5 -31.925 -89 -67 -89c-10.338 1.034 -14.521 3.638 -9 11 +c2.66998 2 6.336 6.66701 11 14c8.39801 13.187 21 24.887 21 45c0 20.0781 -13.614 51 -35 51c-33.69 0 -49 -39.178 -49 -71c0 -46.317 26.383 -83 71 -83c52.698 0 93.343 59.868 117 106c42.939 82.4414 83.986 228.195 103 337h144z" /> +d="M153 214h-37c-10 -4 -18.667 -14 -26 -30c-3.333 -7.33299 -8 -12 -14 -14c-4 1.33299 -10.667 10 -20 26c-4.667 8.66701 -11.333 14.667 -20 18h-36l76 -214z" /> +d="M153 -214h-37c-10 4 -18.667 14 -26 30c-3.333 7.33299 -8 12 -14 14c-4 -1.33299 -10.667 -10 -20 -26c-4.667 -8.66701 -11.333 -14.667 -20 -18h-36l76 214z" /> +d="M468 126c0 69.355 -37.514 116.042 -106 118c-22.667 0 -43.667 -5 -63 -15c-20.602 -12.677 -44.791 -32.051 -64 -49c-22.561 -23.772 -45.814 -46.853 -69 -70c-16 -14 -31 -25 -45 -33s-26.333 -12.333 -37 -13c-19.7583 0 -27.7186 13.5628 -37 28l-12 26 +c-3.333 9.333 -5 15.667 -5 19v8c0 28.667 13.333 43 40 43l9 -2l11 -9l7 -7c6.447 -4.03 14.151 -8 24 -8c17.333 0 28.333 9.33299 33 28c0 34.187 -26.771 52.58 -58 54c-22.8296 0 -25.7106 0.339996 -41 -8c-32.9816 -13.582 -55 -53.578 -55 -97 +c0 -50.4509 20.6276 -86.763 49 -114c18 -14.667 36.333 -23 55 -25c26 0 51 7 75 21c8.66701 5.333 14.667 9 18 11l18 15c8.638 7.1975 25.24 22.1328 33 31l65 67l10 9l22 16c13.333 7.33299 25.667 11 37 11c37.101 0 55 -35.871 55 -70c0 -27.9599 -11.97 -55 -39 -55 +c-6.353 2.1187 -10.691 4.7935 -17 9l-18 13c-3.33301 2.667 -9.33301 4 -18 4c-19.451 0 -29.676 -17.2405 -32 -37c0 -28.051 28.285 -41.7132 58 -44c43.494 0 69.733 31.4674 85 62c8.66699 17.333 12.667 38.333 12 63z" /> +d="M468 118c0 -69.3555 -37.514 -116.042 -106 -118c-22.667 0 -43.667 5 -63 15c-20.603 12.6768 -44.791 32.0508 -64 49c-22.562 23.7725 -45.813 46.854 -69 70c-16 14 -31 25 -45 33s-26.333 12.333 -37 13c-19.7578 0 -27.7188 -13.562 -37 -28l-12 -26 +c-3.333 -9.333 -5 -15.667 -5 -19v-8c0 -28.667 13.333 -43 40 -43l9 2l11 9l7 7c6.447 4.0293 14.151 8 24 8c17.333 0 28.333 -9.333 33 -28c0 -34.1875 -26.771 -52.5801 -58 -54c-22.8301 0 -25.7109 -0.339844 -41 8c-32.9814 13.582 -55 53.5781 -55 97 +c0 50.451 20.6279 86.763 49 114c18 14.667 36.333 23 55 25c26 0 51 -7 75 -21c8.66701 -5.33299 14.667 -9 18 -11l18 -15c8.638 -7.19701 25.24 -22.133 33 -31l65 -67l10 -9l22 -16c13.333 -7.333 25.667 -11 37 -11c37.102 0 55 35.8711 55 70 +c0 27.96 -11.971 55 -39 55c-6.354 -2.119 -10.691 -4.79401 -17 -9l-18 -13c-3.33301 -2.66701 -9.33301 -4 -18 -4c-19.451 0 -29.676 17.24 -32 37c0 28.051 28.285 41.713 58 44c43.493 0 69.732 -31.468 85 -62c8.66699 -17.333 12.667 -38.333 12 -63z" /> +d="M710 134l-109 -127c-2.66699 -3.33333 -5 -5.33333 -7 -6l-6 -2c-5.35101 2 -8.68402 3.66667 -10 5l-89 78c-4.67001 4.6667 -10.337 7.3333 -17 8c-4 -1.3333 -6.66699 -2.6667 -8 -4l-66 -79c-3.33301 -5.33333 -7.66699 -8 -13 -8l-11 5l-89 78 +c-6 4.6667 -11.333 7.3333 -16 8c-4 -1.3333 -6.66699 -2.6667 -8 -4l-67 -79c-5.33299 -5.33333 -10 -8 -14 -8c-2 0 -5.33299 1.66667 -10 5l-88 78c-5.3333 4.6667 -11 7.3333 -17 8c-4.6667 -1.3333 -7.3333 -2.6667 -8 -4l-57 -68v49l108 127l10 4 +c0.667 0 2 -0.332993 4 -1s6 -3 12 -7l88 -78l10 -5c4 0 8.66701 2.667 14 8l67 79c3.33301 2.66701 6 4 8 4c4.66699 0 10 -2.66701 16 -8l89 -78l11 -5l6 1l7 7l67 79c3.33301 2.66701 5.66699 4 7 4c4 -1.334 6.66699 -2.66701 8 -4l7 -6l89 -77 +c3.33301 -3.333 7 -5 11 -5s8.33301 2.667 13 8l58 67v-47z" /> +d="M126 468c69.355 0 116.042 -37.514 118 -106c0 -22.667 -5 -43.667 -15 -63c-12.677 -20.603 -32.051 -44.791 -49 -64c-23.772 -22.562 -46.854 -45.813 -70 -69c-14 -16 -25 -31 -33 -45s-12.333 -26.333 -13 -37c0 -19.7578 13.5625 -27.7188 28 -37l26 -12 +c9.333 -3.333 15.667 -5 19 -5h8c28.667 0 43 13.333 43 40l-2 9l-9 11l-7 7c-4.02901 6.447 -8 14.151 -8 24c0 17.333 9.33299 28.333 28 33c34.188 0 52.58 -26.771 54 -58c0 -22.8301 0.339996 -25.7109 -8 -41c-13.582 -32.9814 -53.578 -55 -97 -55 +c-50.4512 0 -86.7627 20.6279 -114 49c-14.667 18 -23 36.333 -25 55c0 26 7 51 21 75c5.333 8.66701 9 14.667 11 18l15 18c7.1973 8.638 22.1328 25.24 31 33l67 65l9 10l16 22c7.33299 13.333 11 25.667 11 37c0 37.102 -35.871 55 -70 55c-27.96 0 -55 -11.971 -55 -39 +c2.1191 -6.354 4.7939 -10.691 9 -17l13 -18c2.667 -3.33301 4 -9.33301 4 -18c0 -19.451 -17.2402 -29.676 -37 -32c-28.0508 0 -41.7129 28.285 -44 58c0 43.493 31.4678 69.732 62 85c17.333 8.66699 38.333 12.667 63 12z" /> +d="M118 468c-69.3555 0 -116.042 -37.514 -118 -106c0 -22.667 5 -43.667 15 -63c12.6768 -20.603 32.0508 -44.791 49 -64c23.7725 -22.562 46.854 -45.813 70 -69c14 -16 25 -31 33 -45s12.333 -26.333 13 -37c0 -19.7578 -13.562 -27.7188 -28 -37l-26 -12 +c-9.333 -3.333 -15.667 -5 -19 -5h-8c-28.667 0 -43 13.333 -43 40l2 9l9 11l7 7c4.0293 6.447 8 14.151 8 24c0 17.333 -9.333 28.333 -28 33c-34.1875 0 -52.5801 -26.771 -54 -58c0 -22.8301 -0.339844 -25.7109 8 -41c13.582 -32.9814 53.5781 -55 97 -55 +c50.451 0 86.763 20.6279 114 49c14.667 18 23 36.333 25 55c0 26 -7 51 -21 75c-5.33299 8.66701 -9 14.667 -11 18l-15 18c-7.19701 8.638 -22.133 25.24 -31 33l-67 65l-9 10l-16 22c-7.333 13.333 -11 25.667 -11 37c0 37.102 35.8711 55 70 55 +c27.96 0 55 -11.971 55 -39c-2.119 -6.354 -4.79401 -10.691 -9 -17l-13 -18c-2.66701 -3.33301 -4 -9.33301 -4 -18c0 -19.451 17.24 -29.676 37 -32c28.051 0 41.713 28.285 44 58c0 43.493 -31.468 69.732 -62 85c-17.333 8.66699 -38.333 12.667 -63 12z" /> +d="M750 242l-362 -484h-146l362 484h146zM508 242l-362 -484h-146l362 484h146zM52 118c0 13.333 4.333 24.667 13 34s19.333 14.333 32 15c14 0 25.667 -4 35 -12c9.33299 -8 14.333 -19 15 -33c0 -13.333 -4.33299 -24.667 -13 -34c-8.667 -9.333 -19.333 -14.333 -32 -15 +c-14 0 -25.667 4 -35 12s-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" /> +d="M1234 242l-362 -484h-146l362 484h146zM992 242l-362 -484h-146l362 484h146zM750 242l-362 -484h-146l362 484h146zM508 242l-362 -484h-146l362 484h146zM52 118c0 13.333 4.333 24.667 13 34s19.333 14.333 32 15c14 0 25.667 -4 35 -12c9.33299 -8 14.333 -19 15 -33 +c0 -13.333 -4.33299 -24.667 -13 -34c-8.667 -9.333 -19.333 -14.333 -32 -15c-14 0 -25.667 4 -35 12s-14.333 19 -15 33zM1087 -121c0 13.333 4.32996 24.667 13 34s19.33 14.333 32 15c14 0 25.67 -4 35 -12s14.33 -19 15 -33c0 -13.333 -4.32996 -24.667 -13 -34 +s-19.33 -14.333 -32 -15c-14 0 -25.67 4 -35 12s-14.33 19 -15 33z" /> + + + diff --git a/fonts/supported.xsl b/fonts/supported.xsl index 38373b1a7ae..6a07aa094ab 100644 --- a/fonts/supported.xsl +++ b/fonts/supported.xsl @@ -2124,15 +2124,15 @@ Medieval and Renaissance clefs - + - + - + U+E90F diff --git a/include/vrv/aligner.h b/include/vrv/aligner.h index 8ff753aa9da..65f7dd026fa 100644 --- a/include/vrv/aligner.h +++ b/include/vrv/aligner.h @@ -21,8 +21,8 @@ class SystemAligner; /** * Alignment types for aligning types together. - * For example, we align notes and rests (default) together, clef separately, etc. - * The container is a generic alignment for tuplet, chords, beams, etc.; we needs + * For example, we align notes and rests (default) together, clefs separately, etc. + * The container is a generic alignment for tuplet, chords, beams, etc.; we need * this to avoid notes aligning to it */ enum AlignmentType { @@ -226,13 +226,13 @@ class Alignment: public Object virtual int IntegrateBoundingBoxXShift( ArrayPtrVoid *params ); - virtual int HorizontalSpaceForDuration(double intervalTime, bool isMensural); + virtual int HorizontalSpaceForDuration(double intervalTime, int maxActualDur, double spacingLinear, double spacingNonLinear); /** * Set the position of the Alignment. * Looks at the time different with the previous Alignment. */ - virtual int SetAligmentXPos( ArrayPtrVoid *params ); + virtual int SetAlignmentXPos( ArrayPtrVoid *params ); /** * Justify the X positions @@ -247,7 +247,7 @@ class Alignment: public Object private: /** * Stores the position relative to the measure. - * This is instanciated the Object::SetAligmentXPos functor. + * This is instanciated by the Object::SetAlignmentXPos functor. * It takes into account a non-linear according to the time interval with * the previous Alignement */ @@ -255,7 +255,7 @@ class Alignment: public Object /** * Stores temporally the maximum amount we need to shift the element pointing to it for * avoiding collisions. This is set in Object::SetBoundingBoxXShift and then - * integrated for all aligment in Aligment::IntegrateBoundingBoxXShift. + * integrated for all alignment in Alignment::IntegrateBoundingBoxXShift. */ int m_xShift; /** @@ -271,15 +271,15 @@ class Alignment: public Object double m_time; /** * Defines the type of alignment (see the AlignmentType enum). - * We have different types because we want events occuring at the same - * time to be alignnemt separately. Example: the clef needs to be aligned - * togeter, but key signature together and then the notes, even if all - * of them occur at time 0. + * We have different types because we want some events occuring at the same + * time to be aligned separately. Examples: the clefs needs to be aligned + * together, key signatures together, and then the notes, even if all of them + * occur at time 0. */ AlignmentType m_type; /** * A pointer to a GraceAligner if any. - * The Algnment owns it. + * The Alignment owns it. */ GraceAligner *m_graceAligner; @@ -350,7 +350,7 @@ class MeasureAligner: public Object * 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 SetAlignmentXPos( ArrayPtrVoid *params ); /** * Justify the X positions diff --git a/include/vrv/att.h b/include/vrv/att.h index a12558ddf5d..a803c40f5d6 100644 --- a/include/vrv/att.h +++ b/include/vrv/att.h @@ -191,6 +191,9 @@ class Att std::string StemDirectionToStr(data_STEMDIRECTION data); data_STEMDIRECTION StrToStemDirection(std::string value); + std::string StemModifierToStr(data_STEMMODIFIER data); + data_STEMMODIFIER StrToStemModifier(std::string value); + std::string StemPositionToStr(data_STEMPOSITION data); data_STEMPOSITION StrToStemPosition(std::string value); diff --git a/include/vrv/att_comparison.h b/include/vrv/att_comparison.h index 300324dd2c2..feb26bf3dbf 100644 --- a/include/vrv/att_comparison.h +++ b/include/vrv/att_comparison.h @@ -9,13 +9,23 @@ #define __VRV_ATT_COMPARISON_H__ #include "atts_shared.h" +#include "durationinterface.h" +#include "object.h" namespace vrv { +enum DurExtreme { + LONGEST = 0, + SHORTEST +}; + //---------------------------------------------------------------------------- // AttCommonNComparison //---------------------------------------------------------------------------- +/** + * This class evaluates if the object is of a certain ClassId and has a @n of value n. + */ class AttCommonNComparison: public AttComparison { @@ -43,6 +53,51 @@ class AttCommonNComparison: public AttComparison }; +//---------------------------------------------------------------------------- +// AttDurExtreme +//---------------------------------------------------------------------------- + +/** + * This class evaluates if the object the extreme duration so far + * The object has to have a DurationInterface and to have a @dur. + * The class can look for LONGEST or SHORTEST duration (Constructor) + */ +class AttDurExtreme: public AttComparison +{ + +public: + AttDurExtreme(DurExtreme extremeType): + AttComparison(OBJECT) + { + m_extremeType = extremeType; + if (m_extremeType == LONGEST) m_extremeDur = -VRV_UNSET; + else m_extremeDur = VRV_UNSET; + }; + + virtual bool operator() (Object *object) + { + if (!object->HasInterface(INTERFACE_DURATION)) return false; + DurationInterface *interface = dynamic_cast(object); + assert( interface ); + if (interface->HasDur()) { + if ((m_extremeType == LONGEST) && (interface->GetActualDur() < m_extremeDur)) { + m_extremeDur = interface->GetActualDur(); + return true; + } + else if ((m_extremeType == SHORTEST) && (interface->GetActualDur() > m_extremeDur)) { + m_extremeDur = interface->GetActualDur(); + return true; + } + } + return false; + } + +private: + int m_extremeDur; + DurExtreme m_extremeType; + +}; + } // namespace vrv #endif diff --git a/include/vrv/attdef.h b/include/vrv/attdef.h index 85238119c3a..8c213e43bf6 100644 --- a/include/vrv/attdef.h +++ b/include/vrv/attdef.h @@ -445,6 +445,21 @@ enum data_STEMPOSITION { STEMPOSITION_center }; +/** + * MEI data.STEMPOSITION + */ +enum data_STEMMODIFIER { + STEMMODIFIER_NONE = 0, + STEMMODIFIER_1slash, + STEMMODIFIER_2slash, + STEMMODIFIER_3slash, + STEMMODIFIER_4slash, + STEMMODIFIER_5slash, + STEMMODIFIER_6slash, + STEMMODIFIER_sprech, + STEMMODIFIER_z, +}; + /** * MEI data.TEMPUS * NONE is -3 for perfect value (abs) by default diff --git a/include/vrv/beam.h b/include/vrv/beam.h index b7c1efb2c75..4fe189f5256 100644 --- a/include/vrv/beam.h +++ b/include/vrv/beam.h @@ -59,13 +59,6 @@ class Beam: public LayerElement, public ObjectListInterface, public DrawingListI bool IsLastInBeam(LayerElement *element); ///@} - /** - * @name Set and get the stem direction of the beam. - */ - ///@{ - void SetDrawingStemDir( data_STEMDIRECTION stemDirection ) { m_drawingStemDir = stemDirection; }; - data_STEMDIRECTION GetDrawingStemDir() { return m_drawingStemDir; }; - /** * */ @@ -95,10 +88,6 @@ class Beam: public LayerElement, public ObjectListInterface, public DrawingListI public: private: - /** - * The drawing stem direction of the beam - **/ - data_STEMDIRECTION m_drawingStemDir; /** * An array of the coordinates for each element **/ @@ -110,7 +99,6 @@ class Beam: public LayerElement, public ObjectListInterface, public DrawingListI // BeamElementCoord //---------------------------------------------------------------------------- - class BeamElementCoord { public: @@ -131,8 +119,44 @@ class BeamElementCoord char m_partialFlags[MAX_DURATION_PARTIALS]; LayerElement *m_element; }; + +//---------------------------------------------------------------------------- +// BeamParams +//---------------------------------------------------------------------------- + +/** + * Class for storing drawing parameters when calculating beams. + * See View::DrawBeam and View::CalcBeam + */ +class BeamParams +{ +public: + /** + * @name Constructors, destructors, and other standard methods + */ + ///@{ + BeamParams() {}; + virtual ~BeamParams() {}; + + // values to be set before calling CalcBeam + bool m_changingDur; + bool m_beamHasChord; + bool m_hasMultipleStemDir; + bool m_cueSize; + int m_shortestDur; + data_STEMDIRECTION m_stemDir; + + // values set by CalcBeam + int m_beamWidth; + int m_beamWidthBlack; + int m_beamWidthWhite; + double m_startingY; // the initial position of the beam + double m_beamSlope; // the slope of the beam + double m_verticalBoost; //extra height to ensure the beam clears all the noteheads +}; + } // namespace vrv #endif diff --git a/include/vrv/chord.h b/include/vrv/chord.h index 8769df47468..23a7b7dbc28 100644 --- a/include/vrv/chord.h +++ b/include/vrv/chord.h @@ -10,6 +10,7 @@ #define __VRV_CHORD_H__ #include "atts_shared.h" +#include "drawinginterface.h" #include "durationinterface.h" #include "layerelement.h" @@ -29,9 +30,10 @@ namespace vrv { * It contains notes. */ -class Chord: public LayerElement, public ObjectListInterface, public DurationInterface, +class Chord: public LayerElement, public ObjectListInterface, public StemmedDrawingInterface, public DurationInterface, public AttCommon, public AttStemmed, + public AttStemmedCmn, public AttTiepresent { public: @@ -79,11 +81,13 @@ class Chord: public LayerElement, public ObjectListInterface, public DurationInt void ResetAccidSpace(int fullUnit); /** - * @name Set and get the stem direction of the chord. + * @name Set and get the stem direction and stem positions + * The methods are overriding the interface because we want to apply it to child notes */ ///@{ - void SetDrawingStemDir( data_STEMDIRECTION stemDirection ) { m_drawingStemDir = stemDirection; }; - data_STEMDIRECTION GetDrawingStemDir() { return m_drawingStemDir; }; + virtual void SetDrawingStemDir(data_STEMDIRECTION stemDir); + virtual void SetDrawingStemStart(Point stemStart); + virtual void SetDrawingStemEnd(Point stemEnd); ///@} //----------// @@ -106,9 +110,6 @@ class Chord: public LayerElement, public ObjectListInterface, public DurationInt */ void ClearClusters(); -private: - data_STEMDIRECTION m_drawingStemDir; - public: std::list m_clusters; diff --git a/include/vrv/doc.h b/include/vrv/doc.h index 56279613ff2..4c0740b69a1 100644 --- a/include/vrv/doc.h +++ b/include/vrv/doc.h @@ -130,9 +130,9 @@ class Doc: public Object ///@} /** - * @name Getters for the object margins (left and right) - * The margin are given in x / PARAM_DENOMINATOR * UNIT - * With PARAM_DENOMINATOR == 10, a margin of 25 is 2.5 UNIT + * @name Getters for the object margins (left and right). + * The margins are given in x / PARAM_DENOMINATOR * UNIT + * With PARAM_DENOMINATOR == 10, a margin of 25 is 2.5 UNIT. * These should eventually be set at parameters. */ ///@{ @@ -143,16 +143,36 @@ class Doc: public Object /* * @name Setter and getter for the justification (x-axis) flag. - * Justification is enabled by default. It need to be disable - * for drawing all the document on one single system. + * Justification is enabled by default. It needs to be disabled + * for drawing the entire document on one single system. */ ///@{ void SetJustificationX( bool drawingJustifyX ) { m_drawingJustifyX = drawingJustifyX; }; bool GetJustificationX( ) { return m_drawingJustifyX; }; ///@} + /* + * @name Setter and getter for the duration-based-spacing flag. + * Spacing by duration is always used with CMN, and it's enabled by default. + * It should be disabled (so we get "even" note spacing) for mensural notation. + */ + ///@{ + void SetEvenSpacing( bool drawingEvenSpacing ) { m_drawingEvenSpacing = drawingEvenSpacing; }; + bool GetEvenSpacing( ) { return m_drawingEvenSpacing; }; + ///@} + + /* + * @name Setter and getter linear and non linear spacing parameters + */ + ///@{ + void SetSpacingLinear( double drawingSpacingLinear ) { m_drawingSpacingLinear = drawingSpacingLinear; }; + double GetSpacingLinear( ) { return m_drawingSpacingLinear; }; + void SetSpacingNonLinear( double drawingSpacingNonLinear ) { m_drawingSpacingNonLinear = drawingSpacingNonLinear; }; + double GetSpacingNonLinear( ) { return m_drawingSpacingNonLinear; }; + ///@} + /** - * Set the initial scoreDef of each page + * Set the initial scoreDef of each page. * This is necessary for integrating changes that occur within a page. * It uses the MusObject::SetPageScoreDef functor method for parsing the file. * This will be done only if m_currentScoreDefDone is false or force is true. @@ -262,6 +282,12 @@ class Doc: public Object float m_drawingBeamMaxSlope; /** flag for disabling justification */ bool m_drawingJustifyX; + /** flag for disabling spacing by duration */ + bool m_drawingEvenSpacing; + /** value of the linear spacing factor */ + double m_drawingSpacingLinear; + /** value of the non linear spacing factor */ + double m_drawingSpacingNonLinear; /** minimum measure width */ int m_drawingMinMeasureWidth; @@ -317,14 +343,14 @@ class Doc: public Object FontInfo m_drawingLyricFont; /** - * A flag for indicating whether the currentScoreDef has been set or not + * A flag to indicate whether the currentScoreDef has been set or not. * If yes, SetCurrentScoreDef will not parse the document (again) unless * the force parameter is set. */ bool m_currentScoreDefDone; /** - * A flag for indicating if the drawing preparation has been done. If yes, + * A flag to indicate if the drawing preparation has been done. If yes, * drawing preparation will be reset before being done again. */ bool m_drawingPreparationDone; diff --git a/include/vrv/dot.h b/include/vrv/dot.h index 726911adbad..770d04e615d 100644 --- a/include/vrv/dot.h +++ b/include/vrv/dot.h @@ -50,7 +50,7 @@ class Dot: public LayerElement, public PositionInterface /** * Reset the drawing values before calling PrepareDrawing after changes. */ - virtual int ResetDarwing( ArrayPtrVoid *params ); + virtual int ResetDrawing( ArrayPtrVoid *params ); protected: diff --git a/include/vrv/drawinginterface.h b/include/vrv/drawinginterface.h index 445b164e80d..bf10ac23f7d 100644 --- a/include/vrv/drawinginterface.h +++ b/include/vrv/drawinginterface.h @@ -9,6 +9,7 @@ #ifndef __VRV_DRAWING_INTERFACE_H__ #define __VRV_DRAWING_INTERFACE_H__ +#include "devicecontextbase.h" #include "vrvdef.h" namespace vrv { @@ -167,6 +168,53 @@ class StaffDefDrawingInterface }; + +//---------------------------------------------------------------------------- +// StemmedDrawingInterface +//---------------------------------------------------------------------------- + +/** + * This class is an interface for MEI stemmed element. + * It stores stem drawing values for notes and chords. + */ +class StemmedDrawingInterface +{ +public: + /** + * @name Constructors, destructors, and other standard methods + */ + ///@{ + StemmedDrawingInterface(); + virtual ~StemmedDrawingInterface(); + virtual void Reset(); + ///@} + + /** + * @name Set and get the stem direction and stem positions + * The methods are virtual because they need to be overriden for Chords. + */ + ///@{ + virtual void SetDrawingStemDir(data_STEMDIRECTION stemDir); + virtual data_STEMDIRECTION GetDrawingStemDir(); + virtual void SetDrawingStemStart(Point stemStart); + virtual Point GetDrawingStemStart(); + virtual void SetDrawingStemEnd(Point stemEnd); + virtual Point GetDrawingStemEnd(); + ///@} + +protected: + /** + * 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 + /** + * Stem direction as drawn + */ + data_STEMDIRECTION m_drawingStemDir; + +}; + } // namespace vrv #endif diff --git a/include/vrv/durationinterface.h b/include/vrv/durationinterface.h index 2d178e8bd55..c6ef15bec68 100644 --- a/include/vrv/durationinterface.h +++ b/include/vrv/durationinterface.h @@ -61,22 +61,15 @@ class DurationInterface: public Interface, */ virtual double GetAlignmentMensuralDuration( int num, int numbase, Mensur *currentMensur ); - /** - * Look if the note or rest is in a beam. - * Look for the fist beam parent and check is the note is in is content list. - * Looking in the content list is necessary for grace notes or imbricated beams. - */ - bool IsInBeam( Object *noteOrRest ); - /** * Return true if the note or rest is the first of a beam. */ - bool IsFirstInBeam( Object *noteOrRest ); + bool IsFirstInBeam( LayerElement *noteOrRest ); /** * Return true if the note or rest is the last of a beam. */ - bool IsLastInBeam( Object *noteOrRest ); + bool IsLastInBeam( LayerElement *noteOrRest ); /** diff --git a/include/vrv/editorial.h b/include/vrv/editorial.h index 585a7132e7a..1124cacf155 100644 --- a/include/vrv/editorial.h +++ b/include/vrv/editorial.h @@ -242,6 +242,7 @@ class Annot: public EditorialElement, virtual ~Annot(); virtual void Reset(); virtual std::string GetClassName( ) { return "Annot"; }; + virtual ClassId Is() { return ANNOT; }; ///@} protected: diff --git a/include/vrv/floatingelement.h b/include/vrv/floatingelement.h index f8ee26d4f10..a3191d2f33f 100644 --- a/include/vrv/floatingelement.h +++ b/include/vrv/floatingelement.h @@ -53,7 +53,7 @@ class FloatingElement: public DocObject /** * Reset the drawing values before calling PrepareDrawing after changes. */ - virtual int ResetDarwing( ArrayPtrVoid *params ); + virtual int ResetDrawing( ArrayPtrVoid *params ); ///@} private: diff --git a/include/vrv/iomei.h b/include/vrv/iomei.h index 128d8aa7b1c..04490cf472b 100644 --- a/include/vrv/iomei.h +++ b/include/vrv/iomei.h @@ -24,12 +24,14 @@ class Annot; class Barline; class Beam; class BeatRpt; +class BTrem; class Chord; class Clef; class Custos; class Dot; class DurationInterface; class FloatingElement; +class FTrem; class Layer; class LayerElement; class Lem; @@ -133,10 +135,12 @@ class MeiOutput: public FileOutputStream 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 WriteMeiBTrem( pugi::xml_node currentNode, BTrem *bTrem ); void WriteMeiChord( pugi::xml_node currentNode, Chord *chord ); void WriteMeiClef( pugi::xml_node currentNode, Clef *clef ); void WriteMeiCustos( pugi::xml_node currentNode, Custos *custos ); void WriteMeiDot( pugi::xml_node currentNode, Dot *dot ); + void WriteMeiFTrem( pugi::xml_node currentNode, FTrem *fTrem ); void WriteMeiKeySig( pugi::xml_node currentNode, KeySig *keySig ); void WriteMeiMensur( pugi::xml_node currentNode, Mensur *mensur ); void WriteMeiMeterSig( pugi::xml_node currentNode, MeterSig *meterSig ); @@ -300,10 +304,12 @@ class MeiInput: public FileInputStream 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 ReadMeiBTrem( Object *parent, pugi::xml_node bTrem ); bool ReadMeiChord( Object* parent, pugi::xml_node chord ); bool ReadMeiClef( Object *parent, pugi::xml_node clef ); bool ReadMeiCustos( Object *parent, pugi::xml_node custos ); bool ReadMeiDot( Object *parent, pugi::xml_node dot ); + bool ReadMeiFTrem( Object *parent, pugi::xml_node fTrem ); bool ReadMeiKeySig( Object *parent, pugi::xml_node keySig ); bool ReadMeiMensur( Object *parent, pugi::xml_node mensur ); bool ReadMeiMeterSig( Object *parent, pugi::xml_node meterSig ); diff --git a/include/vrv/iomusxml.h b/include/vrv/iomusxml.h index b55cd84afa5..9670d97a1da 100644 --- a/include/vrv/iomusxml.h +++ b/include/vrv/iomusxml.h @@ -1,7 +1,7 @@ ///////////////////////////////////////////////////////////////////////////// // Name: iomusxml.h -// Author: Rodolfo Zitellini -// Created: 10/08/2012 +// Author: Laurent Pugin +// Created: 22/09/2015 // Copyright (c) Authors and others. All rights reserved. ///////////////////////////////////////////////////////////////////////////// @@ -9,84 +9,203 @@ #ifndef __VRV_IOMUSXML_H__ #define __VRV_IOMUSXML_H__ +#include +#include + +//---------------------------------------------------------------------------- + +#include "attdef.h" #include "io.h" #include "pugixml.hpp" +#include "vrvdef.h" namespace vrv { -class Barline; -class Beam; -class Clef; -class Doc; +class FloatingElement; class Layer; class LayerElement; -class MeterSig; -class MRest; -class MultiRest; -class Note; -class Page; -class Rest; -class Staff; +class Measure; +class Slur; +class StaffGrp; class System; -class Tuplet; +class Tie; +///class Tuplet; + +//---------------------------------------------------------------------------- +// namespace for local MusicXml classes +//---------------------------------------------------------------------------- + +namespace musicxml { +class OpenTie +{ +public: + OpenTie(int staffN, int layerN, data_PITCHNAME pname, char oct) { + m_staffN = staffN; + m_layerN = layerN; + m_pname = pname; + m_oct = oct; + } + + int m_staffN; + int m_layerN; + data_PITCHNAME m_pname; + char m_oct; +}; + +class OpenSlur +{ +public: + OpenSlur(int staffN, int layerN, int number) { + m_staffN = staffN; + m_layerN = layerN; + m_number = number; + } + + int m_staffN; + int m_layerN; + int m_number; +}; + +} // namespace musicxml //---------------------------------------------------------------------------- -// This class is not up-to-date +// MusicXmlInput //---------------------------------------------------------------------------- -class XMLOutput: public FileOutputStream +class MusicXmlInput: public FileInputStream { public: // constructors and destructors - XMLOutput( Doc *doc, std::string filename ); - virtual ~XMLOutput(); + MusicXmlInput(Doc *doc, std::string filename); + virtual ~MusicXmlInput(); - virtual bool ExportFile( ); + virtual bool ImportFile( ); + virtual bool ImportString(std::string musicxml); private: + /** + * Top level method called from ImportFile or ImportString + */ + bool ReadMusicXml(pugi::xml_node root); + + /** + * @name Top level methods for reading MusicXml part and measure elements. + */ + ///@{ + bool ReadMusicXmlPart(pugi::xml_node node, System *system, int nbStaves, int staffOffset); + bool ReadMusicXmlMeasure(pugi::xml_node node, Measure *measure, int nbStaves, int staffOffset); + ///@} + + /** + * Methods for reading the first MusicXml attributes element as MEI staffDef. + * Returns the number of staves in the part. + */ + int ReadMusicXmlPartAttributesAsStaffDef(pugi::xml_node node, StaffGrp *staffGrp, int staffOffset); + + /** + * @name Methods for reading the content of a MusicXml measure. + */ + ///@{ + void ReadMusicXmlAttributes(pugi::xml_node, Measure *measure, int measureNb); + void ReadMusicXmlBackup(pugi::xml_node, Measure *measure, int measureNb); + void ReadMusicXmlBarline(pugi::xml_node, Measure *measure, int measureNb); + void ReadMusicXmlForward(pugi::xml_node, Measure *measure, int measureNb); + void ReadMusicXmlNote(pugi::xml_node, Measure *measure, int measureNb); + ///@} + + /** + * Add a Measure to the system. + * If the measure i already exists if will move all the its content. + * The measure can contain only staves. Other elements must be stacked on m_floatingElements. + */ + void AddMeasure(System *system, Measure *measure, int i); + + /** + * Add a Layer element to the layer or to the LayerElement at the top of m_elementStack. + */ + void AddLayerElement(Layer *layer, LayerElement *element); + + /** + * Returns the appropriate layer for a node looking at its MusicXml staff and voice elements. + */ + Layer *SelectLayer(pugi::xml_node node, Measure *measure); + + /** + * Returns the appropriate first layer of a staff. + */ + Layer *SelectLayer(int staffNb, Measure *measure); + + /** + * Returns the layer with @n=layerNb on the staff. + * Creates lhe layer if not found. + */ + Layer *SelectLayer(int layerNb, Staff *staff); + + /** + * Remove the last ClassId element on top of m_elementStack. + * For example, when closing a beam, we need to remove it from the stack, but it is not + * necessary the top one (for example we can have an opened chord there). + */ + void RemoveLastFromStack(ClassId classId); + + /** + * @name Helper methods for checking presence of values of attributes or elements + */ + ///@{ + bool HasAttributeWithValue(pugi::xml_node node, std::string attribute, std::string value); + bool IsElement(pugi::xml_node node, std::string name); + bool HasContentWithValue(pugi::xml_node node, std::string value); + bool HasContent(pugi::xml_node); + ///@} - virtual bool WriteDoc( Doc *doc ); - // logical - bool WriteStaff( Staff *staff ); - bool WriteLayer( Layer *layer ); - bool WriteLayerElement( LayerElement *element ); - // layout - bool WriteLayout( Doc *layout ); - bool WritePage( Page *page ); - bool WriteSystem( System *system ); - bool WriteLaidOutStaff( Staff *laidOutStaff ); - bool WriteLaidOutLayer( Layer *laidOutLayer ); - bool WriteLaidOutLayerElement( LayerElement *laidOutLayerElement ); - - void WriteClef(LayerElement *element); - void WriteKey(LayerElement *element); - void WriteTime(LayerElement *element); - void WriteNoteOrRest(LayerElement *element); - void WriteMultiMeasureRest(Rest *r); - void CreateAttributes(); - void SetTie(pugi::xml_node xml_note, bool last); - void CreateRestsForMultiMeasure(); + /** + * @name Helper methods for retrieving attribute values or element content + */ + ///@{ + std::string GetAttributeValue(pugi::xml_node node, std::string attribute); + std::string GetContent(pugi::xml_node node); + std::string GetContentOfChild(pugi::xml_node node, std::string child); + ///@} + + /** + * @name Methods for openning and closing tie and slurs. + * Openned ties and slurs are stacks together with a musicxml::OpenTie + * and musicxml::OpenSlur objects. + * For now: only slur starting and ending on the same staff/voice are + * supported + */ + ///@{ + void OpenTie(Staff *staff, Layer *layer, Note *note, Tie *tie); + void CloseTie(Staff *staff, Layer *layer, Note *note, bool isClosingTie); + void OpenSlur(Staff *staff, Layer *layer, int number, LayerElement *element, Slur *slur); + void CloseSlur(Staff *staff, Layer *layer, int number, LayerElement *element); + + /** + * @name Methods for converting MusicXML string values to MEI attributes. + */ + ///@{ + data_ACCIDENTAL_EXPLICIT ConvertAccidentalToAccid(std::string value); + data_ACCIDENTAL_EXPLICIT ConvertAlterToAccid(std::string value); + data_DURATION ConvertTypeToDur(std::string value); + data_PITCHNAME ConvertStepToPitchName(std::string value); + ///@} private: + /** The filename */ std::string m_filename; + /** The stack for piling open LayerElements (beams, tuplets, chords, etc.) */ + std::vector m_elementStack; + /** The stack for open slurs */ + std::vector > m_slurStack; + /** The stack for open ties */ + std::vector > m_tieStack; - pugi::xml_node m_xml_score; - pugi::xml_node m_xml_part; - pugi::xml_node m_xml_measure; - pugi::xml_node m_xml_attributes; - pugi::xml_node m_xml_measure_style; - pugi::xml_node m_xml_last_note; - pugi::xml_document m_xml_doc; - pugi::xml_node m_xml_current_clef; - - MeterSig *m_current_time; - Beam *m_current_beam; - bool m_in_beam; - bool m_tied; - int m_multimeasure_rests; - - int m_measure_count; + /** + * The stack of floating elements (tie, slur, etc.) to be added at the + * end of each measure + */ + std::vector > m_floatingElements; }; } // namespace vrv { diff --git a/include/vrv/iopae.h b/include/vrv/iopae.h index 2445cf88c83..4a66a0afc10 100644 --- a/include/vrv/iopae.h +++ b/include/vrv/iopae.h @@ -31,11 +31,17 @@ class Tie; class Tuplet; class KeySig; class Barline; + +//---------------------------------------------------------------------------- +// namespace for local Plain and Easy classes +//---------------------------------------------------------------------------- +namespace pae { + +class Note { -class NoteObject { public: - NoteObject(const NoteObject &old) { // for STL vector + Note(const pae::Note &old) { // for STL vector //mnote = old.mnote; //mrest = old.mrest; tie = old.tie; @@ -43,6 +49,7 @@ class NoteObject { appoggiatura = old.appoggiatura; fermata = old.fermata; trill = old.trill; + chord = old.chord; octave = old.octave; beam = old.beam; @@ -59,10 +66,10 @@ class NoteObject { tuplet_notes = old.tuplet_notes; tuplet_note = old.tuplet_note; } - NoteObject(void) { clear(); }; + Note(void) { clear(); }; void clear(void) { appoggiatura = 0; - acciaccatura = fermata = trill = false; + acciaccatura = fermata = trill = chord = false; tie = 0; octave = 4; @@ -81,7 +88,7 @@ class NoteObject { key = NULL; }; - NoteObject& operator=(const NoteObject& d){ // for STL vector + Note& operator=(const Note& d){ // for STL vector //mnote = d.mnote; //mrest = d.mrest; tie = d.tie; @@ -89,6 +96,7 @@ class NoteObject { appoggiatura = d.appoggiatura; fermata = d.fermata; trill = d.trill; + chord = d.chord; octave = d.octave; beam = d.beam; @@ -120,6 +128,7 @@ class NoteObject { int appoggiatura; bool fermata; bool trill; + bool chord; char octave; unsigned char beam; @@ -132,14 +141,14 @@ class NoteObject { Clef *clef; MeterSig *meter; KeySig *key; - }; -class MeasureObject { +class Measure { + public: - MeasureObject(const MeasureObject& d){ // for STL vector + Measure(const Measure& d){ // for STL vector clef = d.clef; meter = d.meter; notes = d.notes; @@ -153,9 +162,9 @@ class MeasureObject { abbreviation_offset = d.abbreviation_offset; wholerest = d.wholerest; } - MeasureObject(void) { clear(); }; + Measure(void) { clear(); }; - MeasureObject& operator=(const MeasureObject& d){ // for STL vector + Measure& operator=(const Measure& d){ // for STL vector clef = d.clef; meter = d.meter; notes = d.notes; @@ -191,7 +200,7 @@ class MeasureObject { MeterSig *meter; KeySig *key; - std::vector notes; + std::vector notes; std::vector durations; std::vector dots; // use the same offset as durations, they are used in parallel @@ -200,17 +209,8 @@ class MeasureObject { int abbreviation_offset; int wholerest; // number of whole rests to process }; - - -////////////////////////////////////////////////////////////////////////// - - - - - - - - + +} // namespace pae //---------------------------------------------------------------------------- // PaeInput @@ -241,22 +241,22 @@ class PaeInput: public FileInputStream int getBarline (const char *incipit, data_BARRENDITION *output, int index ); int getAccidental (const char* incipit, data_ACCIDENTAL_EXPLICIT *accident, int index = 0); int getOctave (const char* incipit, char *octave, int index = 0 ); - int getDurations (const char* incipit, MeasureObject *measure, int index = 0); + int getDurations (const char* incipit, pae::Measure *measure, int index = 0); int getDuration (const char* incipit, data_DURATION *duration, int *dot, int index ); - int getTupletFermata (const char* incipit, NoteObject *note, int index = 0); - int getTupletFermataEnd (const char* incipit, NoteObject *note, int index = 0); - int getGraceNote (const char* incipit, NoteObject *note, int index = 0); + int getTupletFermata (const char* incipit, pae::Note *note, int index = 0); + int getTupletFermataEnd (const char* incipit, pae::Note *note, int index = 0); + int getGraceNote (const char* incipit, pae::Note *note, int index = 0); int getWholeRest (const char* incipit, int *wholerest, int index ); - int getAbbreviation (const char* incipit, MeasureObject *measure, int index = 0 ); - int getNote (const char* incipit, NoteObject *note, MeasureObject *measure, int index = 0 ); + int getAbbreviation (const char* incipit, pae::Measure *measure, int index = 0 ); + int getNote (const char* incipit, pae::Note *note, pae::Measure *measure, int index = 0 ); data_PITCHNAME getPitch (char c_note ); // output functions void addLayerElement (LayerElement *element); - void parseNote (NoteObject note); + void parseNote (pae::Note *note); void popContainer (); - void convertMeasure (MeasureObject *measure); + void convertMeasure (pae::Measure *measure); void pushContainer (LayerElement *container); @@ -273,6 +273,7 @@ class PaeInput: public FileInputStream Measure *m_measure; Layer *m_layer; Note *m_last_tied_note; + bool m_is_in_chord; std::vector m_nested_objects; }; diff --git a/include/vrv/layerelement.h b/include/vrv/layerelement.h index 89005691c1b..3556e49cfe2 100644 --- a/include/vrv/layerelement.h +++ b/include/vrv/layerelement.h @@ -9,7 +9,6 @@ #ifndef __VRV_LAYER_ELEMENT_H__ #define __VRV_LAYER_ELEMENT_H__ -#include "devicecontextbase.h" #include "object.h" namespace vrv { @@ -76,21 +75,29 @@ class LayerElement: public DocObject * @name Child type checkers. */ ///@{ - /** Returns true if the element is a grace note */ + /** Return 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 */ + /** Return true if the element is a note or a note child and the note has a @grace */ bool IsCueSize(); + /** Return true if the element is a note or a chord within a fTrem */ + bool IsInFTrem(); /** Return true if the element has to be aligned horizontally */ virtual bool HasToBeAligned() { return false; }; - /** Returns the beam parent if in beam */ + /** + * Return the beam parent if in beam + * Look if the note or rest is in a beam. + * Look for the fist beam parent and check is the note is in is content list. + * Looking in the content list is necessary for grace notes or imbricated beams. + */ Beam *IsInBeam(); ///@} /** - * Returns the drawing stem direction if the element is a note or a chord. - * (Could one day go in a drawing stem interface) + * Returns the drawing top and bottom taking into accound stem, etc. + * We pass the doc as parameter in order to have access to the current drawing parameters. */ - data_STEMDIRECTION GetDrawingStemDir(); + int GetDrawingTop(Doc* doc, int staffSize); + int GetDrawingBottom(Doc* doc, int staffSize); /** * Alignment getter @@ -131,15 +138,6 @@ class LayerElement: public DocObject public: /** Absolute position X. This is used for facsimile (transcription) encoding */ int m_xAbs; - /** - * 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 - /** - * Stem direction as drawn - */ - data_STEMDIRECTION m_drawingStemDir; /** * This store a pointer to the corresponding BeamElementCoord(currentDur > DUR_4) */ diff --git a/include/vrv/measure.h b/include/vrv/measure.h index 509d49becfa..d8be18c4a05 100644 --- a/include/vrv/measure.h +++ b/include/vrv/measure.h @@ -144,7 +144,7 @@ class Measure: public DocObject, * Set the position of the Alignment. * Special case that redirects the functor to the MeasureAligner. */ - virtual int SetAligmentXPos( ArrayPtrVoid *params ); + virtual int SetAlignmentXPos( ArrayPtrVoid *params ); /** * Align the measures by adjusting the m_drawingXRel position looking at the MeasureAligner. diff --git a/include/vrv/note.h b/include/vrv/note.h index 98e8174b83e..f05e5872ade 100644 --- a/include/vrv/note.h +++ b/include/vrv/note.h @@ -42,11 +42,12 @@ typedef std::vector ChordCluster; #define EMB_TRILL 1 #define EMB_MORDENT 2 -class Note: public LayerElement, public DurationInterface, public PitchInterface, +class Note: public LayerElement, public StemmedDrawingInterface, public DurationInterface, public PitchInterface, public AttColoration, public AttGraced, public AttNoteLogMensural, public AttStemmed, + public AttStemmedCmn, public AttTiepresent { public: @@ -99,19 +100,6 @@ class Note: public LayerElement, public DurationInterface, public PitchInterface int GetDrawingDur( ); bool IsClusterExtreme( ); //used to find if is the highest or lowest note in a cluster ///@} - - /** - * @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. @@ -145,7 +133,7 @@ class Note: public LayerElement, public DurationInterface, public PitchInterface /** * Reset the drawing values before calling PrepareDrawing after changes. */ - virtual int ResetDarwing( ArrayPtrVoid *params ); + virtual int ResetDrawing( ArrayPtrVoid *params ); private: @@ -180,9 +168,6 @@ class Note: public LayerElement, public DurationInterface, public PitchInterface * An alignment for grace notes */ Alignment *m_graceAlignment; - /** drawing stem direction */ - data_STEMDIRECTION m_drawingStemDir; - }; } // namespace vrv diff --git a/include/vrv/object.h b/include/vrv/object.h index 4e024446516..22a916d9fe8 100644 --- a/include/vrv/object.h +++ b/include/vrv/object.h @@ -237,6 +237,13 @@ class Object Object *FindChildByAttComparison( AttComparison *attComparison, int deepness = UNLIMITED_DEPTH, bool direction = FORWARD ); + /** + * Return the element matching the extreme value with an AttComparison functor + * Deepness allow to limit the depth search (EditorialElements are not count) + */ + Object *FindChildExtremeByAttComparison( AttComparison *attComparison, + int deepness = UNLIMITED_DEPTH, bool direction = FORWARD ); + /** * Give up ownership of the child at the idx position (NULL if not found) * This is a method to used only in very particular case where the child @@ -265,25 +272,6 @@ class Object */ Object *GetLastParentNot( const ClassId classId, int maxSteps = -1 ); - /** - * Return the first of the specified type. - */ - 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 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 ClassId classId = UNSPECIFIED ); - /** * Fill the list of all the children LayerElement. * This is used for navigating in a Layer (See Layer::GetPrevious and Layer::GetNext). @@ -364,6 +352,14 @@ class Object * param 1: the pointer to pointer to the Object retrieved (if found). */ virtual int FindByAttComparison( ArrayPtrVoid *params ); + + /** + * Find a Object with the extreme value 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 FindExtremeByAttComparison( ArrayPtrVoid *params ); + /** * Save the content of and object by calling the appropriate FileOutputStream method @@ -421,9 +417,9 @@ class Object /** * Set the position of the Alignment. - * Looks at the time different with the previous Alignment. + * Looks at the time difference from the previous Alignment. */ - virtual int SetAligmentXPos( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; + virtual int SetAlignmentXPos( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; /** * Lay out the X positions of the grace notes looking that the bounding boxes. @@ -599,7 +595,7 @@ class Object /** * Reset the drawing values before calling PrepareDrawing after changes. */ - virtual int ResetDarwing( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; + virtual int ResetDrawing( ArrayPtrVoid *params ) { return FUNCTOR_CONTINUE; }; /** * Set the drawing position (m_drawingX and m_drawingY) values for objects @@ -673,9 +669,6 @@ class Object std::string m_uuid; std::string m_classid; std::wstring m_text; - - /** A pointer to the parent doc for accessing environment variables when drawing */ - Doc *m_doc; private: diff --git a/include/vrv/rpt.h b/include/vrv/rpt.h index 54163056d18..5b5ef387a30 100644 --- a/include/vrv/rpt.h +++ b/include/vrv/rpt.h @@ -10,6 +10,7 @@ #define __VRV_RPT_H__ #include "atts_cmn.h" +#include "atts_shared.h" #include "layerelement.h" namespace vrv { @@ -55,6 +56,85 @@ class BeatRpt: public LayerElement, }; +//---------------------------------------------------------------------------- +// BTrem +//---------------------------------------------------------------------------- + +/** + * This class models the MEI + */ +class BTrem: public LayerElement +{ +public: + /** + * @name Constructors, destructors, reset and class name methods + * Reset method reset all attribute classes + */ + ///@{ + BTrem( ); + virtual ~BTrem(); + virtual void Reset(); + virtual std::string GetClassName( ){ return "BTrem"; }; ; + virtual ClassId Is() { return BTREM; }; + ///@} + + /** + * Add an element (a note or a chord) to a fTrem. + * Only Note or Chord elements will be actually added to the fTrem. + */ + void AddLayerElement(LayerElement *element); + +private: + +public: + +private: + +}; + +//---------------------------------------------------------------------------- +// FTrem +//---------------------------------------------------------------------------- + +/** + * This class models the MEI + */ +class FTrem: public LayerElement, public ObjectListInterface, + public AttSlashcount +{ +public: + /** + * @name Constructors, destructors, reset and class name methods + * Reset method reset all attribute classes + */ + ///@{ + FTrem( ); + virtual ~FTrem(); + virtual void Reset(); + virtual std::string GetClassName( ){ return "FTrem"; }; ; + virtual ClassId Is() { return FTREM; }; + ///@} + + /** + * Add an element (a note or a chord) to a fTrem. + * Only Note or Chord elements will be actually added to the fTrem. + */ + void AddLayerElement(LayerElement *element); + +private: + +protected: + /** + * Filter the list for a specific fTrem; + */ + virtual void FilterList( ListOfObjects *childList ); + +public: + +private: + +}; + //---------------------------------------------------------------------------- // MRpt //---------------------------------------------------------------------------- diff --git a/include/vrv/scoredef.h b/include/vrv/scoredef.h index c2c6533213c..d48f73deeb4 100644 --- a/include/vrv/scoredef.h +++ b/include/vrv/scoredef.h @@ -157,6 +157,14 @@ class ScoreDef: public ScoreDefElement, public ObjectListInterface void SetDrawLabels( bool drawLabels ) { m_drawLabels = drawLabels; }; ///@} + /** + * @name Set and get the scoreDef drawing width. + */ + ///@{ + int GetDrawingWidth() const { return m_drawingWidth; }; + void SetDrawingWidth( int drawingWidth ); + ///@} + //----------// // Functors // //----------// @@ -182,6 +190,8 @@ class ScoreDef: public ScoreDefElement, public ObjectListInterface private: /** Flags for indicating whether lables needs to be drawn or not */ bool m_drawLabels; + /** Store the drawing width (clef and key sig) of the scoreDef */ + int m_drawingWidth; }; diff --git a/include/vrv/smufl.h b/include/vrv/smufl.h index 8cdc759e804..7a0f6b8e1f1 100644 --- a/include/vrv/smufl.h +++ b/include/vrv/smufl.h @@ -125,6 +125,9 @@ enum { SMUFL_E888_tuplet8 = 0xE888, SMUFL_E889_tuplet9 = 0xE889, SMUFL_E88A_tupletColon = 0xE88A, + SMUFL_E901_mensuralGclefPetrucci = 0xE901, + SMUFL_E904_mensuralFclefPetrucci = 0xE904, + SMUFL_E909_mensuralCclefPetrucciPosMiddle = 0xE909, SMUFL_E938_mensuralNoteheadSemibrevisBlack = 0xE938, SMUFL_E939_mensuralNoteheadSemibrevisVoid = 0xE939, SMUFL_E93C_mensuralNoteheadMinimaWhite = 0xE93C, @@ -132,7 +135,7 @@ enum { }; /** The number of glyphs for verification **/ -#define SMUFL_COUNT 107 +#define SMUFL_COUNT 110 } // vrv namespace diff --git a/include/vrv/staff.h b/include/vrv/staff.h index 233a73fa815..4b9f33e21a0 100644 --- a/include/vrv/staff.h +++ b/include/vrv/staff.h @@ -104,7 +104,7 @@ class Staff: public DocObject, /** * Reset the drawing values before calling PrepareDrawing after changes. */ - virtual int ResetDarwing( ArrayPtrVoid *params ); + virtual int ResetDrawing( ArrayPtrVoid *params ); /** * Set the drawing position (m_drawingX and m_drawingY) values for objects diff --git a/include/vrv/style.h b/include/vrv/style.h index 842d0e190b0..c82c15bd574 100644 --- a/include/vrv/style.h +++ b/include/vrv/style.h @@ -50,6 +50,14 @@ namespace vrv { #define DEFAULT_STEM_WITDH 2.0 #define MIN_STEM_WIDTH 1.0 #define MAX_STEM_WIDTH 5.0 + +#define DEFAULT_SPACING_LINEAR 0.3 +#define MIN_SPACING_LINEAR 0.0 +#define MAX_SPACING_LINEAR 1.0 + +#define DEFAULT_SPACING_NON_LINEAR 0.6 +#define MIN_SPACING_NON_LINEAR 0.0 +#define MAX_SPACING_NON_LINEAR 1.0 //---------------------------------------------------------------------------- // Default scaling (%) and spacing (units) values @@ -136,11 +144,27 @@ namespace vrv { // the space between each lyric line in units #define TEMP_STYLE_LYIRC_LINE_SPACE 5.0 * PARAM_DENOMINATOR +// the key signature spacing factor +#define TEMP_STYLE_KEYSIG_STEP 1.3 + // the maximum angle of a slur -#define TEMP_STYLE_MAX_SLUR_SLOPE (45 * M_PI / 180) +#define TEMP_STYLE_SLUR_MAX_SLOPE (45 * M_PI / 180) +#define TEMP_STYLE_SLUR_CURVE_FACTOR 5 // a factor for allow more (0) or less (100) curved slurs #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 +/* Style parameters for mensural notation */ +// Ratio of mensural notehead size to CMN notehead size for the same staff size +#define MNOTEHEAD_SIZE_FACTOR 0.90 +// Size of mensuration sign circle relative to space between staff lines +#define MSIGN_CIRCLE_DIAM 1.7 +// Vertical position of center of mensuration sign as distance below top of the staff +#define MSIGN_STAFFLINES_BELOW_TOP 2.0 +// Size of dot inside mensuration signs relative to space between staff lines +#define MSIGN_DOT_DIAM 0.5 +// Relative size of figures in proportions +#define PROPRT_SIZE_FACTOR 0.50 + /** * This class contains the document default environment variables. diff --git a/include/vrv/syl.h b/include/vrv/syl.h index a7f4c392ff7..055f50269cd 100644 --- a/include/vrv/syl.h +++ b/include/vrv/syl.h @@ -63,7 +63,7 @@ class Syl: public LayerElement, public TimeSpanningInterface, /** * Reset the drawing values before calling PrepareDrawing after changes. */ - virtual int ResetDarwing( ArrayPtrVoid *params ); + virtual int ResetDrawing( ArrayPtrVoid *params ); private: diff --git a/include/vrv/system.h b/include/vrv/system.h index 568dc5bdcfa..8755b495581 100644 --- a/include/vrv/system.h +++ b/include/vrv/system.h @@ -61,11 +61,13 @@ class System: public DocObject, public DrawingListInterface ///@} /** - * @name Set and get the labels drawing width. + * @name Set and get the labels drawing width (normal and abbreviated) */ ///@{ int GetDrawingLabelsWidth() const { return m_drawingLabelsWidth; }; void SetDrawingLabelsWidth( int width ); + int GetDrawingAbbrLabelsWidth() const { return m_drawingAbbrLabelsWidth; }; + void SetDrawingAbbrLabelsWidth( int width ); ///@} /** @@ -157,7 +159,7 @@ class System: public DocObject, public DrawingListInterface int m_systemLeftMar; /** System right margin (MEI scoredef@system.rightmar). Saved if != 0 */ int m_systemRightMar; - /** + /** * The Y absolute position of the staff for facsimile (transcription) encodings. * This is the top left corner of the system. */ @@ -182,6 +184,8 @@ class System: public DocObject, public DrawingListInterface * It is used internally when calculating the layout andd it is not stored in the file. */ int m_drawingLabelsWidth; + /** The width used by the abbreviated labels */ + int m_drawingAbbrLabelsWidth; /** * @name The total width of the system. * It is computed during the layout processed and used for calculating the justification ratio. diff --git a/include/vrv/toolkit.h b/include/vrv/toolkit.h index debac7e3094..a84bcf485f2 100644 --- a/include/vrv/toolkit.h +++ b/include/vrv/toolkit.h @@ -24,11 +24,12 @@ namespace vrv { -typedef enum _file_formats { - mei_file = 0, - pae_file, - darms_file -} ConvertFileFormat; +typedef enum { + MEI = 0, + PAE, + DARMS, + MUSICXML +} FileFormat; //---------------------------------------------------------------------------- @@ -188,6 +189,23 @@ class Toolkit int GetSpacingSystem() { return m_spacingSystem; }; ///@} + /** + * @name Space notes equally and close together (normally for mensural notation) + */ + ///@{ + bool SetSpacingLinear( float spacingLinear ); + float GetSpacingLinear() { return m_spacingLinear; }; + ///@} + + /** + * @name Space notes equally and close together (normally for mensural notation) + */ + ///@{ + bool SetSpacingNonLinear( float spacingNonLinear ); + float GetSpacingNonLinear() { return m_spacingNonLinear; }; + ///@} + + /** * @name Ignore all encoded layout information (if any) * and output one single page with one single system @@ -214,6 +232,14 @@ class Toolkit int GetAdjustPageHeight() { return m_adjustPageHeight; }; ///@} + /** + * @name Space notes equally and close together (normally for mensural notation) + */ + ///@{ + void SetEvenNoteSpacing( bool even ) { m_evenNoteSpacing = even; }; + int GetEvenNoteSpacing() { return m_evenNoteSpacing; }; + ///@} + /** * @name Do not justify the system (for debugging purposes) */ @@ -231,12 +257,12 @@ class Toolkit ///@} /** - * @name Get the input file format (defined as ConvertFileFormat) - * The SetFormat with ConvertFileFormat does not perform any validation + * @name Get the input file format (defined as FileFormat) + * The SetFormat with FileFormat does not perform any validation */ ///@{ bool SetFormat( std::string const &informat ); - void SetFormat( ConvertFileFormat format ) { m_format = format; }; + void SetFormat( FileFormat format ) { m_format = format; }; int GetFormat() { return m_format; }; ///@} @@ -265,7 +291,7 @@ class Toolkit /** * @name Get the pages for a loaded file - * The SetFormat with ConvertFileFormat does not perform any validation + * The SetFormat with FileFormat does not perform any validation */ ///@{ int GetPageCount( ); @@ -303,7 +329,7 @@ class Toolkit Doc m_doc; View m_view; int m_scale; - ConvertFileFormat m_format; + FileFormat m_format; int m_pageHeight; int m_pageWidth; @@ -318,6 +344,9 @@ class Toolkit bool m_adjustPageHeight; std::string m_rdgXPathQuery; bool m_scoreBasedMei; + bool m_evenNoteSpacing; + float m_spacingLinear; + float m_spacingNonLinear; // for debugging bool m_noJustification; bool m_showBoundingBoxes; diff --git a/include/vrv/view.h b/include/vrv/view.h index a9274b296da..4c7a16d9c4c 100644 --- a/include/vrv/view.h +++ b/include/vrv/view.h @@ -17,6 +17,7 @@ namespace vrv { class Accid; class Beam; +class BeamParams; class Barline; class Chord; class DeviceContext; @@ -204,9 +205,9 @@ 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 DrawBeatRpt(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); + void DrawBTrem(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 ); void DrawCustos( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); @@ -214,13 +215,12 @@ 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 DrawMRest( 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 ); void DrawSpace( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); void DrawSyl( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); @@ -236,24 +236,34 @@ class View */ ///@{ void DrawAcciaccaturaSlash(DeviceContext *dc, LayerElement *element); - void DrawBreveRest ( DeviceContext *dc, int x, int y, Staff *staff ); - void DrawDots ( DeviceContext *dc, int x, int y, unsigned char dots, Staff *staff ); - void DrawFermata(DeviceContext *dc, LayerElement *element, Staff *staff); - 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 DrawDots( DeviceContext *dc, int x, int y, unsigned char dots, Staff *staff ); + void DrawFermata(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff); + void DrawLedgerLines( DeviceContext *dc, LayerElement *element, Staff *staff, bool aboveStaff, bool doubleLength, int skip, int n); 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 DrawRestBreve( DeviceContext *dc, int x, int y, Staff *staff ); + void DrawRestLong( DeviceContext *dc, int x, int y, Staff *staff); + void DrawRestQuarter( DeviceContext *dc, int x, int y, int valeur, unsigned char dots, bool cueSize, Staff *staff); + void DrawRestWhole( 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, bool cueSize, Staff *staff); + ///@} + + /** + * @name Method for drawing Beam and FTrem. + * Defined in view_beam.cpp + */ + ///@{ + void DrawBeam(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); + void DrawFTrem(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); + void CalcBeam(Layer *layer, Staff *staff, const ArrayOfBeamElementCoords *beamElementCoords, int elementCount, BeamParams *params); ///@} /** * @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 + * Defined in view_floating.cpp */ ///@{ void DrawFloatingElement( DeviceContext *dc, FloatingElement *element, Measure *measure, System *system ); @@ -278,6 +288,7 @@ class View ///@{ void DrawMensur( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); void DrawMensuralNote ( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); + void DrawProport( DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff, Measure *measure ); /** * @name Methods for drawing parts of mensural LayerElement child classes. @@ -292,10 +303,11 @@ class View void DrawMaximaToBrevis( DeviceContext *dc, int y, LayerElement *element, Layer *layer, Staff *staff ); void DrawLigature( DeviceContext *dc, int y, LayerElement *element, Layer *layer, Staff *staff ); void CalculateLigaturePosX ( LayerElement *element, Layer *layer, Staff *staff); + void DrawProportFigures( DeviceContext *dc, int x, int y, int num, int numBase, Staff *staff); ///@} - + /** - * @name Method for drawing Beam. + * @name Method for drawing Tuplet. * Called from the the layer postponed drawing list. * Defined in view_tuplet.cpp */ @@ -319,6 +331,12 @@ class View void DrawDot ( DeviceContext *dc, int x, int y, int staffSize ); ///@} + /** + * Calculate the ScoreDef width by taking into account its widest key signature + * This is used in justifiation for anticipating the width of initial scoreDefs that are not drawn in the un-casted system + */ + void SetScoreDefDrawingWidth(DeviceContext *dc, ScoreDef *scoreDef); + private: /** * @name Internal methods used for calculating tuplets @@ -332,7 +350,18 @@ class View int GetSylY( Syl* syl, Staff *staff ); ///@} - float AdjustSlurPosition(Slur *slur, Staff *staff, int layerN, bool up, Point points[]); + /** + * @name Internal methods used for calculating slurs + */ + float AdjustSlur(Slur *slur, Staff *staff, int layerN, bool up, Point points[]); + int AdjustSlurCurve(Slur *slur, ArrayOfLayerElementPointPairs *spanningPoints, Point *p1, Point *p2, Point *c1, Point *c2, + bool up, float angle, bool posRatio = true ); + void AdjustSlurPosition(Slur *slur, ArrayOfLayerElementPointPairs *spanningPoints, Point *p1, Point *p2, Point *c1, Point *c2, + bool up, float *angle, bool forceBothSides ); + float GetAdjustedSlurAngle(Point *p1, Point *p2, bool up); + void GetControlPoints(Point *p1, Point *p2, Point *c1, Point *c2, bool up, int height, int staffSize); + void GetSpanningPointPositions( ArrayOfLayerElementPointPairs *spanningPoints, Point p1, float angle, bool up, int staffSize); + ///@} /** * @name Used for calculating clustered information/dot position diff --git a/include/vrv/vrvdef.h b/include/vrv/vrvdef.h index 673cd540300..0d833c2ec32 100644 --- a/include/vrv/vrvdef.h +++ b/include/vrv/vrvdef.h @@ -27,7 +27,7 @@ namespace vrv { #define VERSION_MAJOR 0 #define VERSION_MINOR 9 -#define VERSION_REVISION 9 +#define VERSION_REVISION 10 // Adds "-dev" in the version number - should be set to false for releases #define VERSION_DEV false @@ -37,8 +37,10 @@ namespace vrv { class AttComparison; class BeamElementCoord; +class LayerElement; class Note; class Object; +class Point; class Staff; typedef std::vector ArrayOfObjects; @@ -54,6 +56,8 @@ typedef std::vector ChordCluster; typedef std::vector ArrayOfBeamElementCoords; typedef std::map > MapOfLedgerLineFlags; + +typedef std::vector > ArrayOfLayerElementPointPairs; //---------------------------------------------------------------------------- // Object defines @@ -102,10 +106,12 @@ enum ClassId { BARLINE_ATTR, BEAM, BEATRPT, + BTREM, CHORD, CLEF, CUSTOS, DOT, + FTREM, KEYSIG, MENSUR, METERSIG, @@ -187,6 +193,9 @@ enum FunctorCode { /** Define the maximum levels between a beam and its notes **/ #define MAX_CHORD_DEPTH -1 +/** Define the maximum levels between a fTrem and its notes **/ +#define MAX_FTREM_DEPTH -1 + /** Define the maximum levels between a tuplet and its notes **/ #define MAX_TUPLET_DEPTH -1 diff --git a/libmei/atts_cmn.cpp b/libmei/atts_cmn.cpp index 896e883f4c1..e286f5f718b 100644 --- a/libmei/atts_cmn.cpp +++ b/libmei/atts_cmn.cpp @@ -1537,14 +1537,14 @@ AttStemmedCmn::~AttStemmedCmn() { } void AttStemmedCmn::ResetStemmedCmn() { - m_stemMod = ""; + m_stemMod = STEMMODIFIER_NONE; m_stemWith = ""; } bool AttStemmedCmn::ReadStemmedCmn( pugi::xml_node element ) { bool hasAttribute = false; if (element.attribute("stem.mod")) { - this->SetStemMod(StrToStr(element.attribute("stem.mod").value())); + this->SetStemMod(StrToStemModifier(element.attribute("stem.mod").value())); element.remove_attribute("stem.mod"); hasAttribute = true; } @@ -1559,7 +1559,7 @@ bool AttStemmedCmn::ReadStemmedCmn( pugi::xml_node element ) { bool AttStemmedCmn::WriteStemmedCmn( pugi::xml_node element ) { bool wroteAttribute = false; if (this->HasStemMod()) { - element.append_attribute("stem.mod") = StrToStr(this->GetStemMod()).c_str(); + element.append_attribute("stem.mod") = StemModifierToStr(this->GetStemMod()).c_str(); wroteAttribute = true; } if (this->HasStemWith()) { @@ -1571,7 +1571,7 @@ bool AttStemmedCmn::WriteStemmedCmn( pugi::xml_node element ) { bool AttStemmedCmn::HasStemMod( ) { - return (m_stemMod != ""); + return (m_stemMod != STEMMODIFIER_NONE); } bool AttStemmedCmn::HasStemWith( ) @@ -2053,7 +2053,7 @@ bool Att::SetCmn( Object *element, std::string attrType, std::string attrValue ) AttStemmedCmn *att = dynamic_cast(element); assert( att ); if (attrType == "stemMod") { - att->SetStemMod(att->StrToStr(attrValue)); + att->SetStemMod(att->StrToStemModifier(attrValue)); return true; } if (attrType == "stemWith") { @@ -2356,7 +2356,7 @@ void Att::GetCmn( Object *element, ArrayOfStrAttr *attributes ) { AttStemmedCmn *att = dynamic_cast(element); assert( att ); if (att->HasStemMod()) { - attributes->push_back(std::make_pair("stemMod", att->StrToStr(att->GetStemMod()))); + attributes->push_back(std::make_pair("stemMod", att->StemModifierToStr(att->GetStemMod()))); } if (att->HasStemWith()) { attributes->push_back(std::make_pair("stemWith", att->StrToStr(att->GetStemWith()))); diff --git a/libmei/atts_cmn.h b/libmei/atts_cmn.h index 231a1640b3f..b365457df81 100644 --- a/libmei/atts_cmn.h +++ b/libmei/atts_cmn.h @@ -1351,8 +1351,8 @@ class AttStemmedCmn: public Att * to the default value) **/ ///@{ - void SetStemMod(std::string stemMod_) { m_stemMod = stemMod_; }; - std::string GetStemMod() const { return m_stemMod; }; + void SetStemMod(data_STEMMODIFIER stemMod_) { m_stemMod = stemMod_; }; + data_STEMMODIFIER GetStemMod() const { return m_stemMod; }; bool HasStemMod( ); // @@ -1367,7 +1367,7 @@ class AttStemmedCmn: public Att * Encodes any stem "modifiers"; that is, symbols rendered on the stem, such as * tremolo or Sprechstimme indicators. **/ - std::string m_stemMod; + data_STEMMODIFIER m_stemMod; /** * Contains an indication of which staff a note or chord that logically belongs to * the current staff should be visually placed on; that is, the one above or the diff --git a/src/aligner.cpp b/src/aligner.cpp index 3b3f941de58..c85667f69ee 100644 --- a/src/aligner.cpp +++ b/src/aligner.cpp @@ -15,6 +15,7 @@ //---------------------------------------------------------------------------- +#include "doc.h" #include "note.h" #include "style.h" #include "vrv.h" @@ -352,13 +353,15 @@ int MeasureAligner::IntegrateBoundingBoxXShift( ArrayPtrVoid *params ) // param 0: the accumulated shift // param 1: the accumulated justifiable shift // param 2: the minimum measure with (unused) - // param 3: the functor to be redirected to the MeasureAligner (unused) + // param 3: the doc for accessing drawing parameters + // param 4: the functor to be redirected to the MeasureAligner (unused) int *shift = static_cast((*params).at(0)); int *justifiable_shift = static_cast((*params).at(1)); + Doc *doc = static_cast((*params).at(3)); // We start a new MeasureAligner // Reset the accumulated shift to 0; - (*shift) = 0; + (*shift) = doc->GetLeftPosition() * doc->GetDrawingUnit(100) / PARAM_DENOMINATOR;; (*justifiable_shift) = -1; return FUNCTOR_CONTINUE; @@ -429,11 +432,13 @@ int Alignment::IntegrateBoundingBoxXShift( ArrayPtrVoid *params ) return FUNCTOR_CONTINUE; } -int MeasureAligner::SetAligmentXPos( ArrayPtrVoid *params ) +int MeasureAligner::SetAlignmentXPos( ArrayPtrVoid *params ) { // param 0: the previous time position // param 1: the previous x rel position - // param 2: the functor to be redirected to the MeasureAligner (unused) + // param 2: duration of the longest note (unused) + // param 3: the doc (unused) + // param 4: the functor to be redirected to the MeasureAligner (unused) double *previousTime = static_cast((*params).at(0)); int *previousXRel = static_cast((*params).at(1)); @@ -446,36 +451,43 @@ int MeasureAligner::SetAligmentXPos( ArrayPtrVoid *params ) } -/* 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::HorizontalSpaceForDuration(double intervalTime, bool isMensural) +/* Compute "ideal" horizontal space to allow for a given time interval, ignoring the need +to keep consecutive symbols from overlapping or nearly overlapping: we assume spacing +will be increased as necessary later to avoid that. For modern notation (CMN), ideal space +is a function of time interval. + +The power function we currently use is isn't quite right; see _Behind Bars_, p. 39. We also +need more flexibility: for example, for some purposes, spacing propoortional to duration is +desirable. The best solution is probably to get ideal spacing from a user-definable table. */ + +int Alignment::HorizontalSpaceForDuration(double intervalTime, int maxActualDur, double spacingLinear, double spacingNonLinear) { - 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 - } + /* If the longest duration interval in the score is longer than semibreve, adjust spacing so + that interval gets the space a semibreve would ordinarily get. (maxActualDur is in our + internal code format: cf. attdef.h). ??TO BE DONE */ + if (maxActualDur < DUR_1) intervalTime /= pow(2.0, DUR_1 - maxActualDur); + int intervalXRel = pow( intervalTime, spacingNonLinear ) * pow( spacingLinear * 5.0, 2 ); return intervalXRel; } -int Alignment::SetAligmentXPos( ArrayPtrVoid *params ) +int Alignment::SetAlignmentXPos( ArrayPtrVoid *params ) { // param 0: the previous time position // param 1: the previous x rel position - // param 2: the functor to be redirected to the MeasureAligner (unused) + // param 2: duration of the longest note + // param 3: the doc (unused) + // param 4: the functor to be redirected to the MeasureAligner (unused) double *previousTime = static_cast((*params).at(0)); int *previousXRel = static_cast((*params).at(1)); + int *maxActualDur = static_cast((*params).at(2)); + Doc *doc = static_cast((*params).at(3)); int intervalXRel = 0; double intervalTime = (m_time - (*previousTime)); - // HARDCODED parameter for HorizontalSpaceForDuration - if ( intervalTime > 0.0 ) intervalXRel = HorizontalSpaceForDuration(intervalTime, false); - + if ( intervalTime > 0.0 ) { + intervalXRel = HorizontalSpaceForDuration(intervalTime, *maxActualDur, doc->GetSpacingLinear(), doc->GetSpacingNonLinear()); + //LogDebug("SetAlignmentXPos: intervalTime=%.2f intervalXRel=%d", intervalTime, intervalXRel); + } m_xRel = (*previousXRel) + (intervalXRel) * DEFINITON_FACTOR; (*previousTime) = m_time; (*previousXRel) = m_xRel; diff --git a/src/att.cpp b/src/att.cpp index d0b7e7d06ea..ab0d19e947f 100644 --- a/src/att.cpp +++ b/src/att.cpp @@ -1011,6 +1011,43 @@ data_STEMDIRECTION Att::StrToStemDirection(std::string value) LogWarning("Unsupported stem direction '%s'", value.c_str() ); } return STEMDIRECTION_NONE; +} + +std::string Att::StemModifierToStr(data_STEMMODIFIER data) +{ + std::string value; + switch(data) + { + case STEMMODIFIER_1slash : value = "1slash"; break; + case STEMMODIFIER_2slash : value = "2slash"; break; + case STEMMODIFIER_3slash : value = "3slash"; break; + case STEMMODIFIER_4slash : value = "4slash"; break; + case STEMMODIFIER_5slash : value = "5slash"; break; + case STEMMODIFIER_6slash : value = "6slash"; break; + case STEMMODIFIER_sprech : value = "sprech"; break; + case STEMMODIFIER_z : value = "z"; break; + default: + LogWarning("Unknown mode '%d'", data); + value = ""; + break; + } + return value; +} + +data_STEMMODIFIER Att::StrToStemModifier(std::string value) +{ + if (value == "1slash") return STEMMODIFIER_1slash; + else if (value == "2slash") return STEMMODIFIER_2slash; + else if (value == "3slash") return STEMMODIFIER_3slash; + else if (value == "4slash") return STEMMODIFIER_4slash; + else if (value == "5slash") return STEMMODIFIER_5slash; + else if (value == "6slash") return STEMMODIFIER_6slash; + else if (value == "sprech") return STEMMODIFIER_sprech; + else if (value == "z") return STEMMODIFIER_z; + else { + LogWarning("Unsupported pitch name '%s'", value.c_str() ); + } + return STEMMODIFIER_NONE; } std::string Att::StemPositionToStr(data_STEMPOSITION data) diff --git a/src/beam.cpp b/src/beam.cpp index 281e2dace49..37add6e0f47 100644 --- a/src/beam.cpp +++ b/src/beam.cpp @@ -26,8 +26,6 @@ Beam::Beam(): LayerElement("beam-"), ObjectListInterface() { Reset(); - - m_drawingStemDir = STEMDIRECTION_NONE; } diff --git a/src/chord.cpp b/src/chord.cpp index dc91a5c8490..f093c786aec 100644 --- a/src/chord.cpp +++ b/src/chord.cpp @@ -23,13 +23,15 @@ namespace vrv { //---------------------------------------------------------------------------- Chord::Chord( ): - LayerElement("chord-"), ObjectListInterface(), DurationInterface(), + LayerElement("chord-"), StemmedDrawingInterface(), ObjectListInterface(), DurationInterface(), AttCommon(), AttStemmed(), + AttStemmedCmn(), AttTiepresent() { RegisterAttClass(ATT_COMMON); RegisterAttClass(ATT_STEMMED); + RegisterAttClass(ATT_STEMMEDCMN); RegisterAttClass(ATT_TIEPRESENT); RegisterInterface( DurationInterface::GetAttClasses(), DurationInterface::IsInterface() ); @@ -48,10 +50,12 @@ Chord::~Chord() void Chord::Reset() { ClearClusters(); - DocObject::Reset(); + LayerElement::Reset(); + StemmedDrawingInterface::Reset(); DurationInterface::Reset(); ResetCommon(); ResetStemmed(); + ResetStemmedCmn(); ResetTiepresent(); } @@ -244,6 +248,39 @@ void Chord::GetYExtremes(int *yMax, int *yMin) } } } + +void Chord::SetDrawingStemDir(data_STEMDIRECTION stemDir) +{ + m_drawingStemDir = stemDir; + ListOfObjects* childList = this->GetList(this); //make sure it's initialized + for (ListOfObjects::iterator it = childList->begin(); it != childList->end(); it++) { + Note *note = dynamic_cast(*it); + if (!note) continue; + note->SetDrawingStemDir(stemDir); + } +} + +void Chord::SetDrawingStemStart(Point stemStart) +{ + m_drawingStemStart = stemStart; + ListOfObjects* childList = this->GetList(this); //make sure it's initialized + for (ListOfObjects::iterator it = childList->begin(); it != childList->end(); it++) { + Note *note = dynamic_cast(*it); + if (!note) continue; + note->SetDrawingStemStart(stemStart); + } +} + +void Chord::SetDrawingStemEnd(Point stemEnd) +{ + m_drawingStemEnd = stemEnd; + ListOfObjects* childList = this->GetList(this); //make sure it's initialized + for (ListOfObjects::iterator it = childList->begin(); it != childList->end(); it++) { + Note *note = dynamic_cast(*it); + if (!note) continue; + note->SetDrawingStemEnd(stemEnd); + } +} //---------------------------------------------------------------------------- // Functors methods diff --git a/src/doc.cpp b/src/doc.cpp index 45a3b999f9c..04e98099446 100644 --- a/src/doc.cpp +++ b/src/doc.cpp @@ -66,11 +66,15 @@ void Doc::Reset( DocType type ) m_pageLeftMar = 0; m_pageTopMar = 0; + m_drawingSpacingLinear = DEFAULT_SPACING_LINEAR; + m_drawingSpacingNonLinear = DEFAULT_SPACING_NON_LINEAR; + m_spacingStaff = m_style->m_spacingStaff; m_spacingSystem = m_style->m_spacingSystem; m_drawingPage = NULL; m_drawingJustifyX = true; + m_drawingEvenSpacing = false; m_currentScoreDefDone = false; m_drawingPreparationDone = false; @@ -98,7 +102,7 @@ void Doc::PrepareDrawing() ArrayPtrVoid params; if (m_drawingPreparationDone) { - Functor resetDrawing( &Object::ResetDarwing ); + Functor resetDrawing( &Object::ResetDrawing ); this->Process( &resetDrawing, ¶ms ); } @@ -343,15 +347,18 @@ void Doc::CastOff( ) System *currentSystem = new System(); contentPage->AddSystem( currentSystem ); - int shift = 0; + int shift = -contentSystem->GetDrawingLabelsWidth(); int systemFullWidth = this->m_drawingPageWidth - this->m_drawingPageLeftMar - this->m_drawingPageRightMar - currentSystem->m_systemLeftMar - currentSystem->m_systemRightMar; + // The width of the initial scoreDef is stored in the page scoreDef + int scoreDefWidth = contentPage->m_drawingScoreDef.GetDrawingWidth() + contentSystem->GetDrawingAbbrLabelsWidth(); ArrayPtrVoid params; params.push_back( contentSystem ); params.push_back( contentPage ); params.push_back( ¤tSystem ); params.push_back( &shift ); params.push_back( &systemFullWidth ); + params.push_back( &scoreDefWidth ); Functor castOffSystems( &Object::CastOffSystems ); contentSystem->Process( &castOffSystems, ¶ms ); delete contentSystem; diff --git a/src/dot.cpp b/src/dot.cpp index 945a6d18137..e2961bee70c 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -54,7 +54,7 @@ int Dot::PreparePointersByLayer( ArrayPtrVoid *params ) return FUNCTOR_CONTINUE; } -int Dot::ResetDarwing( ArrayPtrVoid *params ) +int Dot::ResetDrawing( ArrayPtrVoid *params ) { this->m_drawingNote = NULL; return FUNCTOR_CONTINUE; diff --git a/src/drawinginterface.cpp b/src/drawinginterface.cpp index 7bde16d591f..ce60f01a819 100644 --- a/src/drawinginterface.cpp +++ b/src/drawinginterface.cpp @@ -175,4 +175,56 @@ StaffDefDrawingInterface& StaffDefDrawingInterface::operator=( const StaffDefDra return *this; } + +//---------------------------------------------------------------------------- +// StemmedDrawingInterface +//---------------------------------------------------------------------------- + +StemmedDrawingInterface::StemmedDrawingInterface() +{ + Reset(); +} + +StemmedDrawingInterface::~StemmedDrawingInterface() +{ +} + +void StemmedDrawingInterface::Reset() +{ + m_drawingStemDir = STEMDIRECTION_NONE; + m_drawingStemStart = Point(0, 0); + m_drawingStemEnd = Point(0, 0); +} + +void StemmedDrawingInterface::SetDrawingStemDir(data_STEMDIRECTION stemDir) +{ + m_drawingStemDir = stemDir; +} + +data_STEMDIRECTION StemmedDrawingInterface::GetDrawingStemDir() +{ + return m_drawingStemDir; +} + +void StemmedDrawingInterface::SetDrawingStemStart(Point stemStart) +{ + m_drawingStemStart = stemStart; +} + +Point StemmedDrawingInterface::GetDrawingStemStart() +{ + return m_drawingStemStart; +} + +void StemmedDrawingInterface::SetDrawingStemEnd(Point stemEnd) +{ + m_drawingStemEnd = stemEnd; +} + +Point StemmedDrawingInterface::GetDrawingStemEnd() +{ + return m_drawingStemEnd; +} + + } // namespace vrv diff --git a/src/durationinterface.cpp b/src/durationinterface.cpp index 7a7b6ab3ca4..96553d32339 100644 --- a/src/durationinterface.cpp +++ b/src/durationinterface.cpp @@ -109,16 +109,7 @@ double DurationInterface::GetAlignmentMensuralDuration( int num, int numbase, Me return duration; } -bool DurationInterface::IsInBeam( Object *noteOrRest ) -{ - Object *beam = noteOrRest->GetFirstParent( BEAM, MAX_BEAM_DEPTH ); - if ( !beam ) { - return false; - } - return true; -} - -bool DurationInterface::IsFirstInBeam( Object *noteOrRest ) +bool DurationInterface::IsFirstInBeam( LayerElement *noteOrRest ) { Beam *beam = dynamic_cast( noteOrRest->GetFirstParent( BEAM, MAX_BEAM_DEPTH ) ); if ( !beam ) { @@ -132,7 +123,7 @@ bool DurationInterface::IsFirstInBeam( Object *noteOrRest ) return false; } -bool DurationInterface::IsLastInBeam( Object *noteOrRest ) +bool DurationInterface::IsLastInBeam( LayerElement *noteOrRest ) { Beam *beam = dynamic_cast( noteOrRest->GetFirstParent( BEAM, MAX_BEAM_DEPTH ) ); if ( !beam ) { diff --git a/src/editorial.cpp b/src/editorial.cpp index aec177a4de2..e13badf9688 100644 --- a/src/editorial.cpp +++ b/src/editorial.cpp @@ -256,6 +256,7 @@ 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) + // param 5: the current scoreDef width (unused) System *contentSystem = static_cast((*params).at(0)); System **currentSystem = static_cast((*params).at(2)); diff --git a/src/floatingelement.cpp b/src/floatingelement.cpp index d017485241d..bd0515ba410 100644 --- a/src/floatingelement.cpp +++ b/src/floatingelement.cpp @@ -70,7 +70,7 @@ int FloatingElement::FillStaffCurrentTimeSpanning( ArrayPtrVoid *params ) return FUNCTOR_CONTINUE; } -int FloatingElement::ResetDarwing( ArrayPtrVoid *params ) +int FloatingElement::ResetDrawing( ArrayPtrVoid *params ) { // Pass it to the pseudo functor of the interface if (this->HasInterface(INTERFACE_TIME_SPANNING)) { diff --git a/src/iomei.cpp b/src/iomei.cpp index 04becf40643..e33d6dc2278 100644 --- a/src/iomei.cpp +++ b/src/iomei.cpp @@ -70,6 +70,24 @@ bool MeiOutput::ExportFile( ) pugi::xml_document meiDoc; if ( m_page < 0 ) { + pugi::xml_node decl = meiDoc.prepend_child(pugi::node_declaration); + decl.append_attribute("version") = "1.0"; + decl.append_attribute("encoding") = "UTF-8"; + + // schema processing instruction + decl = meiDoc.append_child(pugi::node_declaration); + decl.set_name("xml-model"); + decl.append_attribute("href") = "http://music-encoding.org/schema/2.1.1/mei-all.rng"; + decl.append_attribute("type") = "application/xml"; + decl.append_attribute("schematypens") = "http://relaxng.org/ns/structure/1.0"; + + // schematron processing instruction + decl = meiDoc.append_child(pugi::node_declaration); + decl.set_name("xml-model"); + decl.append_attribute("href") = "http://music-encoding.org/schema/2.1.1/mei-all.rng"; + decl.append_attribute("type") = "application/xml"; + decl.append_attribute("schematypens") = "http://purl.oclc.org/dsdl/schematron"; + m_mei = meiDoc.append_child("mei"); m_mei.append_attribute( "xmlns" ) = "http://www.music-encoding.org/ns/mei"; m_mei.append_attribute( "meiversion" ) = "2013"; @@ -199,6 +217,10 @@ bool MeiOutput::WriteObject( Object *object ) m_currentNode = m_currentNode.append_child("beatRpt"); WriteMeiBeatRpt( m_currentNode, dynamic_cast(object) ); } + else if (object->Is() == BTREM) { + m_currentNode = m_currentNode.append_child("bTrem"); + WriteMeiBTrem( m_currentNode, dynamic_cast(object) ); + } else if (object->Is() == CHORD) { m_currentNode = m_currentNode.append_child( "chord" ); WriteMeiChord( m_currentNode, dynamic_cast(object) ); @@ -215,6 +237,10 @@ bool MeiOutput::WriteObject( Object *object ) m_currentNode = m_currentNode.append_child( "dot" ); WriteMeiDot( m_currentNode, dynamic_cast(object) ); } + else if (object->Is() == FTREM) { + m_currentNode = m_currentNode.append_child("fTrem"); + WriteMeiFTrem( m_currentNode, dynamic_cast(object) ); + } else if (object->Is() == KEYSIG) { m_currentNode = m_currentNode.append_child("keySig"); WriteMeiKeySig( m_currentNode, dynamic_cast(object) ); @@ -327,7 +353,7 @@ std::string MeiOutput::UuidToMeiStr( Object *element ) //LogDebug("uuid: %s", out.c_str()); return out; } - + bool MeiOutput::WriteMeiDoc( Doc *doc ) { assert( doc ); @@ -337,27 +363,31 @@ bool MeiOutput::WriteMeiDoc( Doc *doc ) pugi::xml_node meiHead = m_mei.append_child("meiHead"); - for (pugi::xml_node child = m_doc->m_header.first_child(); child; child = child.next_sibling()) - { - meiHead.append_copy(child); + if (m_doc->m_header.first_child()) { + for (pugi::xml_node child = m_doc->m_header.first_child(); child; child = child.next_sibling()) + { + meiHead.append_copy(child); + } + } + else { + pugi::xml_node fileDesc = meiHead.append_child("fileDesc"); + pugi::xml_node titleStmt = fileDesc.append_child("titleStmt"); + titleStmt.append_child("title"); + pugi::xml_node pubStmt = fileDesc.append_child("pubStmt"); + pugi::xml_node date = pubStmt.append_child("date"); + + pugi::xml_node encodingDesc = meiHead.append_child("encodingDesc"); + pugi::xml_node projectDesc = encodingDesc.append_child("projectDesc"); + pugi::xml_node p1 = projectDesc.append_child("p"); + p1.append_child(pugi::node_pcdata).set_value( StringFormat( "Encoded with Verovio version %s", GetVersion().c_str() ).c_str() ); + + // date + time_t t = time(0); // get time now + struct tm *now = localtime(&t); + std::string dateStr = StringFormat("%d-%02d-%02d %02d:%02d:%02d", now->tm_year + 1900, now->tm_mon + 1, + now->tm_mday, now->tm_hour, now->tm_min, now->tm_sec); + date.append_child(pugi::node_pcdata).set_value(dateStr.c_str()); } - - /* - pugi::xml_node fileDesc = meiHead.append_child("fileDesc"); - pugi::xml_node titleStmt = fileDesc.append_child("titleStmt"); - titleStmt.append_child("title"); - pugi::xml_node pubStmt = fileDesc.append_child("pubStmt"); - pugi::xml_node date = pubStmt.append_child("date"); - - pugi::xml_node encodingDesc = meiHead.append_child("encodingDesc"); - pugi::xml_node projectDesc = encodingDesc.append_child("projectDesc"); - pugi::xml_node p1 = projectDesc.append_child("p"); - p1.append_child(pugi::node_pcdata).set_value( StringFormat( "Encoded with Verovio version %s", GetVersion().c_str() ).c_str() ); - - // date - time_t now = time(0); - date.append_child(pugi::node_pcdata).set_value( ctime( &now ) ); - */ // ---- music ---- @@ -573,6 +603,13 @@ void MeiOutput::WriteMeiBeatRpt( pugi::xml_node currentNode, BeatRpt *beatRpt ) beatRpt->WriteBeatRptVis(currentNode); } +void MeiOutput::WriteMeiBTrem( pugi::xml_node currentNode, BTrem *bTrem ) +{ + assert( bTrem ); + + WriteLayerElement( currentNode, bTrem ); +} + void MeiOutput::WriteMeiChord( pugi::xml_node currentNode, Chord *chord ) { assert( chord ); @@ -581,6 +618,7 @@ void MeiOutput::WriteMeiChord( pugi::xml_node currentNode, Chord *chord ) WriteDurationInterface( currentNode, chord); chord->WriteCommon(currentNode); chord->WriteStemmed(currentNode); + chord->WriteStemmedCmn(currentNode); chord->WriteTiepresent(currentNode); return; @@ -612,6 +650,14 @@ void MeiOutput::WriteMeiDot( pugi::xml_node currentNode, Dot *dot ) WriteLayerElement( currentNode, dot ); WritePositionInterface(currentNode, dot); } + +void MeiOutput::WriteMeiFTrem( pugi::xml_node currentNode, FTrem *fTrem ) +{ + assert( fTrem ); + + WriteLayerElement( currentNode, fTrem ); + fTrem->WriteSlashcount(currentNode); +} void MeiOutput::WriteMeiKeySig( pugi::xml_node currentNode, KeySig *keySig ) { @@ -696,6 +742,7 @@ void MeiOutput::WriteMeiNote( pugi::xml_node currentNode, Note *note ) note->WriteGraced(currentNode); note->WriteNoteLogMensural(currentNode); note->WriteStemmed(currentNode); + note->WriteStemmedCmn(currentNode); note->WriteTiepresent(currentNode); return; @@ -996,6 +1043,20 @@ bool MeiInput::IsAllowed(std::string element, Object *filterParent) else if ( element == "supplied" ) { return true; } + // filter for bTrem + else if (filterParent->Is() == BTREM) + { + if ( element == "chord" ) return true; + else if ( element == "note" ) return true; + else return false; + } + // filter for fTrem + else if (filterParent->Is() == FTREM) + { + if ( element == "chord" ) return true; + else if ( element == "note" ) return true; + else return false; + } // filter for notes else if (filterParent->Is() == NOTE) { @@ -1596,6 +1657,9 @@ bool MeiInput::ReadMeiLayerChildren( Object *parent, pugi::xml_node parentNode, else if ( elementName == "beatRpt" ) { success = ReadMeiBeatRpt( parent, xmlElement); } + else if ( elementName == "bTrem" ) { + success = ReadMeiBTrem( parent, xmlElement ); + } else if ( elementName == "chord" ) { success = ReadMeiChord( parent, xmlElement); } @@ -1608,6 +1672,9 @@ bool MeiInput::ReadMeiLayerChildren( Object *parent, pugi::xml_node parentNode, else if ( elementName == "dot" ) { success = ReadMeiDot( parent, xmlElement ); } + else if ( elementName == "fTrem" ) { + success = ReadMeiFTrem( parent, xmlElement ); + } else if ( elementName == "keySig" ) { success = ReadMeiKeySig( parent, xmlElement ); } @@ -1728,6 +1795,16 @@ bool MeiInput::ReadMeiBeatRpt( Object *parent, pugi::xml_node beatRpt ) return true; } +bool MeiInput::ReadMeiBTrem( Object *parent, pugi::xml_node bTrem ) +{ + BTrem *vrvBTrem = new BTrem(); + ReadLayerElement(bTrem, vrvBTrem); + + AddLayerElement(parent, vrvBTrem); + + return ReadMeiLayerChildren(vrvBTrem, bTrem, vrvBTrem); +} + bool MeiInput::ReadMeiChord( Object *parent, pugi::xml_node chord) { Chord *vrvChord = new Chord(); @@ -1736,6 +1813,7 @@ bool MeiInput::ReadMeiChord( Object *parent, pugi::xml_node chord) ReadDurationInterface(chord, vrvChord); vrvChord->ReadCommon(chord); vrvChord->ReadStemmed(chord); + vrvChord->ReadStemmedCmn(chord); vrvChord->ReadTiepresent(chord); AddLayerElement(parent, vrvChord); @@ -1780,6 +1858,18 @@ bool MeiInput::ReadMeiDot( Object *parent, pugi::xml_node dot ) return true; } + +bool MeiInput::ReadMeiFTrem( Object *parent, pugi::xml_node fTrem ) +{ + FTrem *vrvFTrem = new FTrem(); + ReadLayerElement(fTrem, vrvFTrem); + + vrvFTrem->ReadSlashcount(fTrem); + + AddLayerElement(parent, vrvFTrem); + + return ReadMeiLayerChildren(vrvFTrem, fTrem, vrvFTrem); +} bool MeiInput::ReadMeiKeySig( Object *parent, pugi::xml_node keySig ) { @@ -1881,6 +1971,7 @@ bool MeiInput::ReadMeiNote( Object *parent, pugi::xml_node note ) vrvNote->ReadGraced(note); vrvNote->ReadNoteLogMensural(note); vrvNote->ReadStemmed(note); + vrvNote->ReadStemmedCmn(note); vrvNote->ReadTiepresent(note); AddLayerElement(parent, vrvNote); @@ -2294,6 +2385,17 @@ void MeiInput::AddLayerElement( Object *parent, LayerElement *element ) assert( layer ); layer->AddLayerElement( element ); } + // LayerElements + else if ( parent->Is() == BEAM ) { + Beam * beam = dynamic_cast( parent ); + assert( beam ); + beam->AddLayerElement( element ); + } + else if ( parent->Is() == BTREM ) { + BTrem *bTrem = dynamic_cast( parent ); + assert( bTrem ); + bTrem->AddLayerElement( element ); + } else if ( parent->Is() == CHORD ) { Chord *chord = dynamic_cast( parent ); assert( chord ); @@ -2304,10 +2406,10 @@ void MeiInput::AddLayerElement( Object *parent, LayerElement *element ) assert( note ); note->AddLayerElement( element ); } - else if ( parent->Is() == BEAM ) { - Beam * beam = dynamic_cast( parent ); - assert( beam ); - beam->AddLayerElement( element ); + else if ( parent->Is() == FTREM ) { + FTrem *fTrem = dynamic_cast( parent ); + assert( fTrem ); + fTrem->AddLayerElement( element ); } else if ( parent->Is() == TUPLET ) { Tuplet *tuplet = dynamic_cast( parent ); diff --git a/src/iomusxml.cpp b/src/iomusxml.cpp index 436ac0096f0..42b618dc0ee 100644 --- a/src/iomusxml.cpp +++ b/src/iomusxml.cpp @@ -1,7 +1,7 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: musiomusxml.cpp -// Author: Rodolfo Zitellini -// Created: 10/08/2012 +// Name: iomusxml.cpp +// Author: Laurent Pugin +// Created: 22/09/2015 // Copyright (c) Authors and others. All rights reserved. ///////////////////////////////////////////////////////////////////////////// @@ -10,657 +10,923 @@ //---------------------------------------------------------------------------- +#include #include //---------------------------------------------------------------------------- +#include "att_comparison.h" #include "beam.h" -#include "clef.h" +#include "chord.h" #include "doc.h" -#include "keysig.h" -#include "mensur.h" -#include "metersig.h" +#include "layer.h" +#include "measure.h" #include "note.h" +#include "mrest.h" +#include "page.h" #include "rest.h" +#include "slur.h" +#include "staff.h" +#include "syl.h" +#include "system.h" #include "tie.h" +#include "tuplet.h" +#include "verse.h" #include "vrv.h" namespace vrv { //---------------------------------------------------------------------------- -// XMLOutput +// MusicXmlInput //---------------------------------------------------------------------------- -XMLOutput::XMLOutput( Doc *doc, std::string filename ) : -// This is pretty bad. We open a bad fileoutputstream as we don't use it -FileOutputStream( doc ) +MusicXmlInput::MusicXmlInput(Doc *doc, std::string filename) : + FileInputStream(doc) { m_filename = filename; - m_measure_count = 0; -/* m_xml_attributes = NULL; - m_xml_current_clef = NULL; - m_xml_measure_style = NULL; - m_xml_last_note = NULL; -*/ - - m_current_time = NULL; - m_current_beam = NULL; - m_in_beam = false; - m_tied = false; - m_multimeasure_rests = 0; } -XMLOutput::~XMLOutput() +MusicXmlInput::~MusicXmlInput() { } - -bool XMLOutput::ExportFile( ) -{ - /* - // do this or finale will barf, versione 3.0 for now - TiXmlUnknown *unk = new TiXmlUnknown; - //unk->SetValue("!DOCTYPE score-partwise PUBLIC \"-//Recordare//DTD MusicXML 3.0 Partwise//EN\" \"http://www.musicxml.org/dtds/partwise.dtd\""); - unk->SetValue("!DOCTYPE score-timewise PUBLIC \"-//Recordare//DTD MusicXML 2.0 Timewise//EN\" \"http://www.musicxml.org/dtds/timewise.dtd\""); - m_xml_doc->LinkEndChild(unk); - */ - - // this starts the call of all the functors - m_doc->Save( this ); - - m_xml_doc.save_file( m_filename.c_str() ); - return true; +bool MusicXmlInput::ImportFile() +{ + try { + m_doc->Reset(Raw); + pugi::xml_document xmlDoc; + pugi::xml_parse_result result = xmlDoc.load_file(m_filename.c_str()); + if (!result) + { + return false; + } + pugi::xml_node root = xmlDoc.first_child(); + return ReadMusicXml(root); + } + catch(char * str) { + LogError("%s", str); + return false; + } } -bool XMLOutput::WriteDoc( Doc *doc ) +bool MusicXmlInput::ImportString(const std::string musicxml) { - LogDebug("Doc"); + try { + m_doc->Reset( Raw ); + pugi::xml_document xmlDoc; + xmlDoc.load(musicxml.c_str()); + pugi::xml_node root = xmlDoc.first_child(); + return ReadMusicXml(root); + } + catch(char * str) { + LogError("%s", str); + return false; + } +} + +////////////////////////////////////////////////////////////////////////////// +// XML helpers - // Write the partwise declaration - // the MusicXML "score-partwise" does not map to our MusScore +bool MusicXmlInput::HasAttributeWithValue(pugi::xml_node node, std::string attribute, std::string value) +{ + assert(node); - m_xml_score = m_xml_doc.append_child("score-timewise"); + if (GetAttributeValue(node, attribute) == value) { + return true; + } + return false; +} + +bool MusicXmlInput::IsElement(pugi::xml_node node, std::string name) +{ + assert(node); - // hardcode a voice for noew - pugi::xml_node plist = m_xml_score.append_child("part-list"); - pugi::xml_node spart = plist.append_child("score-part"); - spart.append_attribute("id") = "P1"; + if (std::string(node.name()) == name) { + return true; + } + return false; +} - pugi::xml_node pname = spart.append_child("part-name"); - pname.append_child(pugi::node_pcdata).set_value("Example Music"); +bool MusicXmlInput::HasContentWithValue(pugi::xml_node node, std::string value) +{ + assert(node); - /* - spart->LinkEndChild(pname); - plist->LinkEndChild(spart); + if (GetContent(node) == value) { + return true; + } + return false; +} - m_xml_score->LinkEndChild(plist); - m_xml_doc->LinkEndChild(m_xml_score); - */ +bool MusicXmlInput::HasContent(pugi::xml_node node) +{ + assert(node); - return true; + return (node.text()); } - - -/* -bool XMLOutput::WriteMeasure( Measure *measure ) -//bool XMLOutput::WriteMeiMeasure( Measure *meiMeasure, Measure *measure ) + +std::string MusicXmlInput::GetAttributeValue(pugi::xml_node node, std::string attribute) { - std::string num; - - // Create multimeasure rests - if (m_multimeasure_rests > 0 ) - CreateRestsForMultiMeasure(); + assert(node); - m_measure_count++; - num << m_measure_count; - LogDebug("Measure %i", m_measure_count); + if (node.attribute(attribute.c_str())) { + return std::string(node.attribute(attribute.c_str()).value()); + } + return ""; +} - // go on and create this measure - m_xml_measure = new TiXmlElement("measure"); - m_xml_measure->SetAttribute("number", num); - m_xml_score->LinkEndChild(m_xml_measure); +std::string MusicXmlInput::GetContent(pugi::xml_node node) +{ + assert(node); - - // reset clef - m_xml_current_clef = NULL; + if (node.text()) { + return std::string(node.text().as_string()); + } + return ""; +} - //m_xml_part->LinkEndChild(m_xml_measure); +std::string MusicXmlInput::GetContentOfChild(pugi::xml_node node, std::string child) +{ + pugi::xpath_node childNode = node.select_single_node(child.c_str()); + if (childNode && HasContent(childNode.node())) { + return GetContent(childNode.node()); + } + return ""; + } - return true; +void MusicXmlInput::AddMeasure(System *system, Measure *measure, int i) +{ + assert(system); + assert(i >= 0); + + // we just need to add a measure + if (i == system->GetChildCount()) { + system->AddMeasure(measure); + } + // otherwise copy the content to the corresponding existing measure + else if (system->GetChildCount() > i) { + Measure *existingMeasure = dynamic_cast(system->m_children[i]); + assert(existingMeasure); + ArrayOfObjects::iterator sIter = measure->m_children.begin(); + for (sIter = measure->m_children.begin(); sIter != measure->m_children.end(); sIter++) { + Staff *staff = dynamic_cast( measure->Relinquish( (*sIter)->GetIdx()) ); + assert(staff); + existingMeasure->AddStaff(staff); + } + } + // there is a gap, this should not happen + else { + LogWarning("measures should be added in the right order"); + } } -*/ // ax2.3 - -bool XMLOutput::WriteStaff( Staff *staff ) -//bool XMLOutput::WriteMeiStaff( Staff *meiStaff, Staff *staff ) + +void MusicXmlInput::AddLayerElement(Layer *layer, LayerElement *element) { - LogDebug("Staff"); + assert(layer); + assert(element); - m_xml_part = m_xml_measure.append_child("part"); - m_xml_part.append_attribute("id") = "P1"; - - // in first measure set the divisions value in - if (m_measure_count == 1) { - m_xml_attributes = m_xml_part.append_child("attributes"); - pugi::xml_node divisions = m_xml_attributes.append_child("divisions"); - //TiXmlText *divval = new TiXmlText("4"); // no more than sixteenths for now - divisions.append_child(pugi::node_pcdata).set_value("4"); - /* - divisions->LinkEndChild(divval); - m_xml_attributes->LinkEndChild(divisions); - m_xml_part->LinkEndChild(m_xml_attributes); - */ + if (m_elementStack.empty()) { + layer->AddLayerElement(element); + } + else if (m_elementStack.back()->Is() == BEAM) { + Beam *beam = dynamic_cast(m_elementStack.back()); + assert(beam); + beam->AddLayerElement(element); + } + else if (m_elementStack.back()->Is() == CHORD) { + Chord *chord = dynamic_cast(m_elementStack.back()); + assert(chord); + chord->AddLayerElement(element); } + else if (m_elementStack.back()->Is() == TUPLET) { + Tuplet *tuplet = dynamic_cast(m_elementStack.back()); + assert(tuplet); + tuplet->AddLayerElement(element); + } + +} - return true; +Layer *MusicXmlInput::SelectLayer(pugi::xml_node node, vrv::Measure *measure) +{ + int staffNb = 1; + std::string staffNbStr = GetContentOfChild(node, "staff"); + if (!staffNbStr.empty()) { + staffNb = atoi(staffNbStr.c_str()); + } + if ((staffNb < 1) || (staffNb > measure->m_children.size())) { + LogWarning("Staff %d cannot be found", staffNb); + staffNb = 1; + } + staffNb--; + Staff *staff = dynamic_cast(measure->m_children.at(staffNb)); + assert(staff); + // Now look for the layer with the correpsonding voice + int layerNb = 1; + std::string layerNbStr = GetContentOfChild(node, "voice"); + if (!layerNbStr.empty()) { + layerNb = atoi(layerNbStr.c_str()); + } + if (layerNb < 1) { + LogWarning("Staff %d cannot be found", staffNb); + layerNb = 1; + } + return SelectLayer(layerNb, staff); } -bool XMLOutput::WriteLayer( Layer *layer ) -//bool XMLOutput::WriteMeiLayer( Layer *meiLayer, Layer *layer ) + +Layer *MusicXmlInput::SelectLayer(int staffNb, vrv::Measure *measure) { - LogDebug("Layer"); - return true; + staffNb--; + Staff *staff = dynamic_cast(measure->m_children.at(staffNb)); + assert(staff); + // layer -1 means the first one + return SelectLayer(-1, staff); } - -bool XMLOutput::WriteLayerElement( LayerElement *element ) + +Layer *MusicXmlInput::SelectLayer(int layerNb, Staff *staff) { - LogDebug("Layer Elem"); - - if (dynamic_cast(element)) { - WriteClef(element); - } else if (dynamic_cast(element)) { - WriteKey(element); - } else if (dynamic_cast(element)) { - WriteTime(element); - } else if (dynamic_cast(element) || dynamic_cast(element)) { - WriteNoteOrRest(element); - } else if (dynamic_cast(element)) { - m_current_beam = dynamic_cast(element); - } else if (dynamic_cast(element)) { - // add tie to last note - // continuation of ties is made with a and - // in the same note - SetTie(m_xml_last_note, false); - } - - // LogDebug("---- %s", element->GetClassName().c_str()); + Layer *layer = NULL; + // no layer specified, return the first one (if any) + if (layerNb == -1) { + if (staff->m_children.size() > 0) { + layer = dynamic_cast(staff->m_children.at(0)); + } + // otherwise set @n to 1 + layerNb = 1; + } + else { + AttCommonNComparison comparisonLayer(LAYER, layerNb); + layer = dynamic_cast(staff->FindChildByAttComparison(&comparisonLayer, 1)); + } + if (layer) return layer; + // else add it + // add at least one layer + layer = new Layer(); + layer->SetN(layerNb); + staff->AddLayer(layer); + return layer; +} - return true; - } - - - - -bool XMLOutput::WriteLayout( Doc *layout ) +void MusicXmlInput::RemoveLastFromStack(ClassId classId) { - LogDebug("Layout"); - return true; + std::vector::reverse_iterator riter; + for (riter = m_elementStack.rbegin(); riter != m_elementStack.rend(); riter++) { + if ((*riter)->Is() == classId) { + m_elementStack.erase((riter+1).base()); + return; + } + } } - -bool XMLOutput::WritePage( Page *page ) + +////////////////////////////////////////////////////////////////////////////// +// Tie and slurs stack management + +void MusicXmlInput::OpenTie(Staff *staff, Layer *layer, Note *note, Tie *tie) { - LogDebug("Page"); - return true; + tie->SetStartid(note->GetUuid()); + musicxml::OpenTie openTie(staff->GetN(), layer->GetN(), note->GetPname(), note->GetOct()); + m_tieStack.push_back(std::make_pair(tie, openTie)); } - -bool XMLOutput::WriteSystem( System *system ) + +void MusicXmlInput::CloseTie(Staff *staff, Layer *layer, Note *note, bool isClosingTie) { - LogDebug("System"); - return true; + std::vector >::iterator iter; + for (iter = m_tieStack.begin(); iter != m_tieStack.end(); iter++) { + if ((iter->second.m_staffN == staff->GetN()) && (iter->second.m_layerN == layer->GetN()) && + (iter->second.m_pname == note->GetPname()) && iter->second.m_oct == note->GetOct()) { + iter->first->SetEndid(note->GetUuid()); + m_tieStack.erase(iter); + if (!isClosingTie) { + LogWarning("Closing tie for note '%s' even thought tie /tie@[type='stop'] is missing in the MusicXML", note->GetUuid().c_str()); + } + return; + } + } } - -bool XMLOutput::WriteLaidOutStaff( Staff *laidOutStaff ) + +void MusicXmlInput::OpenSlur(Staff *staff, Layer *layer, int number, LayerElement *element, Slur *slur) { - LogDebug("Laid staff"); - return true; + slur->SetStartid(element->GetUuid()); + musicxml::OpenSlur openSlur(staff->GetN(), layer->GetN(), number); + m_slurStack.push_back(std::make_pair(slur, openSlur)); } -bool XMLOutput::WriteLaidOutLayer( Layer *laidOutLayer ) -{ LogDebug("Laid layer"); - return true; +void MusicXmlInput::CloseSlur(Staff *staff, Layer *layer, int number, LayerElement *element) +{ + std::vector >::iterator iter; + for (iter = m_slurStack.begin(); iter != m_slurStack.end(); iter++) { + if ((iter->second.m_staffN == staff->GetN()) && (iter->second.m_layerN == layer->GetN()) && + (iter->second.m_number == number)) { + iter->first->SetEndid(element->GetUuid()); + m_slurStack.erase(iter); + return; + } + } + LogWarning("Closing slur for element '%s' could not be matched", element->GetUuid().c_str()); } + +////////////////////////////////////////////////////////////////////////////// +// Parsing methods -bool XMLOutput::WriteLaidOutLayerElement( LayerElement *laidOutLayerElement ) +bool MusicXmlInput::ReadMusicXml(pugi::xml_node root) { - LogDebug("Laid Layer Elem"); + assert(root); + + std::vector m_staffGrpStack; + StaffGrp *staffGrp = new StaffGrp(); + m_doc->m_scoreDef.AddStaffGrp(staffGrp); + m_staffGrpStack.push_back(staffGrp); + + int staffOffset = 0; + Page *page = new Page(); + System *system = new System(); + + pugi::xpath_node_set partListChildren = root.select_nodes("/score-partwise/part-list/*"); + for (pugi::xpath_node_set::const_iterator it = partListChildren.begin(); it != partListChildren.end(); ++it) + { + pugi::xpath_node xpathNode = *it; + if (IsElement(xpathNode.node(), "part-group")) { + if (HasAttributeWithValue(xpathNode.node(), "type", "start")) { + StaffGrp *staffGrp = new StaffGrp(); + // read the group-symbol (MEI @symbol) + std::string groupGymbol = GetContentOfChild(xpathNode.node(), "group-symbol"); + if (groupGymbol == "bracket") staffGrp->SetSymbol(SYMBOL_bracket); + else if (groupGymbol == "brace") staffGrp->SetSymbol(SYMBOL_brace); + else if (groupGymbol == "line") staffGrp->SetSymbol(SYMBOL_line); + // now stack it + m_staffGrpStack.back()->AddStaffGrp(staffGrp); + m_staffGrpStack.push_back(staffGrp); + } + // this is the end of a part-group - we assume each opened part-group to be closed + else { + m_staffGrpStack.pop_back(); + } + } + else if (IsElement(xpathNode.node(), "score-part")) { + // get the attributes element of the first measure of the part + std::string partId = xpathNode.node().attribute("id").as_string(); + std::string xpath = StringFormat("/score-partwise/part[@id='%s']/measure[@number='1']", partId.c_str()); + pugi::xpath_node partFirstMeasureAttributes = root.select_single_node(xpath.c_str()); + if (!partFirstMeasureAttributes) { + LogWarning("Could not find the 'attributes' element in the first measure of part '%s'", partId.c_str()); + continue; + } + std::string partName = GetContentOfChild(xpathNode.node(), "part-name"); + // create the staffDef(s) + StaffGrp *partStaffGrp = new StaffGrp(); + int nbStaves = ReadMusicXmlPartAttributesAsStaffDef(partFirstMeasureAttributes.node(), partStaffGrp, staffOffset); + // if we have more than one staff in the part we create a new staffGrp + if (nbStaves > 1) { + partStaffGrp->SetLabel(partName); + partStaffGrp->SetSymbol(SYMBOL_brace); + partStaffGrp->SetBarthru(BOOLEAN_true); + m_staffGrpStack.back()->AddStaffGrp(partStaffGrp); + } + else { + StaffDef *staffDef = dynamic_cast(partStaffGrp->FindChildByType(STAFFDEF)); + if (staffDef) { + staffDef->SetLabel(partName); + } + m_staffGrpStack.back()->MoveChildren(partStaffGrp); + delete partStaffGrp; + } + + // find the part and read it + xpath = StringFormat("/score-partwise/part[@id='%s']", partId.c_str()); + pugi::xpath_node part = root.select_single_node(xpath.c_str()); + if (!part) { + LogWarning("Could not find the part '%s'", partId.c_str()); + continue; + } + ReadMusicXmlPart(part.node(), system, nbStaves, staffOffset); + // increment the staffOffset for reading the next part + staffOffset += nbStaves; + } + } + // here we could check that we have that there is only one staffGrp left in m_staffGrpStack + + Measure *measure = NULL; + std::vector >::iterator iter; + for(iter = m_floatingElements.begin(); iter != m_floatingElements.end(); iter++) { + if (!measure || (measure->GetN() != iter->first)) { + AttCommonNComparison comparisonMeasure(MEASURE, iter->first); + measure = dynamic_cast(system->FindChildByAttComparison(&comparisonMeasure, 1)); + } + if (!measure) { + LogWarning("Element '%s' could not be added to measure '%d'", + iter->second->GetClassName().c_str(), iter->first); + continue; + } + measure->AddFloatingElement(iter->second); + } + + //assert(m_tieStack.empty()); + + page->AddSystem( system ); + m_doc->AddPage( page ); + return true; } - - -void XMLOutput::WriteClef(LayerElement *element) { - std::string sign, line; - - // Create the attributes elem - // or use existing one, all the attribute changes - // go in the same - CreateAttributes(); - - //Clef *clef = dynamic_cast(element); - - /* - switch (clef->m_clefId) { - case SOL1: sign = "G"; line = "1"; break; - case SOL2: sign = "G"; line = "2"; break; - case UT1: sign = "C"; line = "1"; break; - case UT2: sign = "C"; line = "2"; break; - case UT3: sign = "C"; line = "3"; break; - case UT4: sign = "C"; line = "4"; break; - case UT5: sign = "C"; line = "5"; break; - case FA3: sign = "F"; line = "3"; break; - case FA4: sign = "F"; line = "4"; break; - case FA5: sign = "F"; line = "5"; break; - default: break; - } - */ - - //Create the element - pugi::xml_node xclef = m_xml_attributes.append_child("clef"); - - // Create the element and link to it it's text - pugi::xml_node xsign = xclef.append_child("sign"); - xsign.append_child(pugi::node_pcdata).set_value(sign.c_str()); - //TiXmlText *xsignt = new TiXmlText(sign.c_str()); - //xsign->LinkEndChild(xsignt); - // Insert it into the - //xclef->LinkEndChild(xsign); - - // Create the element and link to it it's text - pugi::xml_node xline = xclef.append_child("line"); - xline.append_child(pugi::node_pcdata).set_value(line.c_str()); - //TiXmlText *xlinet = new TiXmlText(line.c_str()); - //xline->LinkEndChild(xlinet); - // Insert it into the - //xclef->LinkEndChild(xline); - - // place clef into - //m_xml_attributes->LinkEndChild(xclef); - m_xml_current_clef = xclef; -} - -void XMLOutput::WriteKey(LayerElement *element) { - KeySig* key = dynamic_cast(element); - - // Check for attrib element as above - // or use existing one, all the attribute changes - // go in the same - CreateAttributes(); - - // create tompost elem - pugi::xml_node xkey = m_xml_attributes.append_child("key"); - - // Convert the number of alterations to string - std::stringstream n_alter; - if (key->GetAlterationType() == ACCIDENTAL_EXPLICIT_f) - // flats are negative numbers - n_alter << -key->GetAlterationNumber(); - else - n_alter << key->GetAlterationNumber(); - - //create node with the number of alterations - pugi::xml_node xfifths = xkey.append_child("fifths"); - xfifths.append_child(pugi::node_pcdata).set_value(n_alter.str().c_str()); - //TiXmlText *xftxt = new TiXmlText(n_alter.str().c_str()); - //xfifths->LinkEndChild(xftxt); - // add it to the key elem - //xkey->LinkEndChild(xfifths); - - //I dont know what musicxml does with the tag - //bmaybe it is just to annoy programmers using tinyxml - //finale sets this always to major - pugi::xml_node mode = xkey.append_child("mode"); - mode.append_child(pugi::node_pcdata).set_value("major"); - //TiXmlText *major = new TiXmlText("major"); - //mode->LinkEndChild(major); - // add it to the key elem - //xkey->LinkEndChild(mode); - - // Obviously the order in which and