From f515c0e542892124a1fa88fafe916edaac9f86e4 Mon Sep 17 00:00:00 2001 From: Axel Berndt Date: Fri, 27 Nov 2020 08:51:35 +0100 Subject: [PATCH] v0.8.19 - Added new class `meico.mpm.elements.metadata.Comment` and incorporated it in all classes that handle MPM metadata comment elements. - In class `meico.mpm.elements.metadata.Metadata` some new methods have been added: `removeAuthor()` and `removeComment()`. - Enhancement in method `meico.mpm.Mpm.addPerformance()` to cancel if the input `Performance` object is null. It also got a `boolean` return value to indicate the success of the action. - The same has been added to method `meico.mpm.elements.Performance.addPart()`. It returns `false` also if the part is already in the performance. - The same has been added to methods `meico.mpm.elements.metadata.Metadata.addAuthor()`, `addComment()` and `addRelatedResource()`. Instead of an index they return `-1`. - Bugfixes in methods `meico.mpm.elements.metadata.Author.setId()` and `removeAuthor()`. - Classes `meico.mpm.elements.Part`, `Performance` have been extended to provide access also to the element's `xml:id`. - New methods `clear()` and `renameStyleDef()` in class `meico.mpm.elements.Header` to remove all content of from the respective MPM element. - New method `clear()` in class `meico.mpm.elements.Dated` to remove all content of from the respective MPM element. - Bugfix in method `meico.mpm.elements.Header.removeStyleType()`, `removeStyleDef()`, `addStyleType()`. - Lots of enhancement and refactoring of all classes in packages `meico.mpm.elements.styles` and `meico.mpm.elements.styles.defs`. - Correction of `rubatoDef` factory method `meico.mpm.elements.styles.defs.RubatoDef.createRubatoDef(String name)` to `createRubatoDef(String name, double frameLength)`. A `rubatoDef` without a `frameLangth` is invalid. Hence the factory could never create a `rubatoDef`. This is fixed. - Refactoring of method `meico.mpm.elements.styles.defs.AccentuationPatternDef.getSize()` to `size()` to follow the convention used in all other classes. - Added another method `addAccentuation()` to class `meico.mpm.elements.styles.defs.AccentuationPatternDef` that supports input of an `id` string. --- docs/allclasses-frame.html | 5 +- docs/allclasses-noframe.html | 5 +- docs/constant-values.html | 6 +- docs/deprecated-list.html | 4 +- docs/help-doc.html | 4 +- docs/index-files/index-1.html | 40 +-- docs/index-files/index-10.html | 4 +- docs/index-files/index-11.html | 4 +- docs/index-files/index-12.html | 4 +- docs/index-files/index-13.html | 8 +- docs/index-files/index-14.html | 4 +- docs/index-files/index-15.html | 4 +- docs/index-files/index-16.html | 10 +- docs/index-files/index-17.html | 4 +- docs/index-files/index-18.html | 36 ++- docs/index-files/index-19.html | 50 ++-- docs/index-files/index-2.html | 4 +- docs/index-files/index-20.html | 8 +- docs/index-files/index-21.html | 4 +- docs/index-files/index-22.html | 4 +- docs/index-files/index-23.html | 4 +- docs/index-files/index-24.html | 4 +- docs/index-files/index-3.html | 80 +++++- docs/index-files/index-4.html | 8 +- docs/index-files/index-5.html | 4 +- docs/index-files/index-6.html | 4 +- docs/index-files/index-7.html | 78 +++--- docs/index-files/index-8.html | 4 +- docs/index-files/index-9.html | 34 ++- docs/index.html | 2 +- docs/meico/Meico.html | 4 +- docs/meico/audio/Audio.html | 4 +- docs/meico/audio/AudioPlayer.html | 4 +- docs/meico/audio/class-use/Audio.html | 4 +- docs/meico/audio/class-use/AudioPlayer.html | 4 +- docs/meico/audio/package-frame.html | 4 +- docs/meico/audio/package-summary.html | 4 +- docs/meico/audio/package-tree.html | 4 +- docs/meico/audio/package-use.html | 4 +- docs/meico/class-use/Meico.html | 4 +- docs/meico/mei/Helper.html | 4 +- docs/meico/mei/Mei.html | 4 +- docs/meico/mei/class-use/Helper.html | 4 +- docs/meico/mei/class-use/Mei.html | 4 +- docs/meico/mei/package-frame.html | 4 +- docs/meico/mei/package-summary.html | 4 +- docs/meico/mei/package-tree.html | 4 +- docs/meico/mei/package-use.html | 4 +- docs/meico/midi/EventMaker.html | 4 +- docs/meico/midi/InstrumentsDictionary.html | 4 +- docs/meico/midi/Midi.html | 4 +- docs/meico/midi/Midi2AudioRenderer.html | 4 +- docs/meico/midi/Midi2MsmConverter.html | 4 +- docs/meico/midi/MidiPlayer.html | 4 +- .../midi/UnsupportedSoundbankException.html | 4 +- docs/meico/midi/class-use/EventMaker.html | 4 +- .../midi/class-use/InstrumentsDictionary.html | 4 +- docs/meico/midi/class-use/Midi.html | 4 +- .../midi/class-use/Midi2AudioRenderer.html | 4 +- .../midi/class-use/Midi2MsmConverter.html | 4 +- docs/meico/midi/class-use/MidiPlayer.html | 4 +- .../UnsupportedSoundbankException.html | 4 +- docs/meico/midi/legacy/Event.html | 4 +- docs/meico/midi/legacy/MidiOld.html | 4 +- docs/meico/midi/legacy/TrackOld.html | 4 +- docs/meico/midi/legacy/class-use/Event.html | 4 +- docs/meico/midi/legacy/class-use/MidiOld.html | 4 +- .../meico/midi/legacy/class-use/TrackOld.html | 4 +- docs/meico/midi/legacy/package-frame.html | 4 +- docs/meico/midi/legacy/package-summary.html | 4 +- docs/meico/midi/legacy/package-tree.html | 4 +- docs/meico/midi/legacy/package-use.html | 4 +- docs/meico/midi/package-frame.html | 4 +- docs/meico/midi/package-summary.html | 4 +- docs/meico/midi/package-tree.html | 4 +- docs/meico/midi/package-use.html | 4 +- docs/meico/mpm/Mpm.html | 30 ++- docs/meico/mpm/class-use/Mpm.html | 6 +- docs/meico/mpm/elements/Dated.html | 38 ++- docs/meico/mpm/elements/Global.html | 4 +- docs/meico/mpm/elements/Header.html | 70 +++++- docs/meico/mpm/elements/Part.html | 126 ++++++++-- docs/meico/mpm/elements/Performance.html | 158 ++++++++++-- docs/meico/mpm/elements/class-use/Dated.html | 12 +- docs/meico/mpm/elements/class-use/Global.html | 22 +- docs/meico/mpm/elements/class-use/Header.html | 12 +- docs/meico/mpm/elements/class-use/Part.html | 22 +- .../mpm/elements/class-use/Performance.html | 21 +- .../mpm/elements/maps/ArticulationMap.html | 4 +- .../mpm/elements/maps/AsynchronyMap.html | 4 +- docs/meico/mpm/elements/maps/DynamicsMap.html | 4 +- docs/meico/mpm/elements/maps/GenericMap.html | 4 +- .../mpm/elements/maps/ImprecisionMap.html | 4 +- .../maps/MetricalAccentuationMap.html | 4 +- .../mpm/elements/maps/OrnamentationMap.html | 4 +- docs/meico/mpm/elements/maps/RubatoMap.html | 4 +- docs/meico/mpm/elements/maps/TempoMap.html | 4 +- .../maps/class-use/ArticulationMap.html | 4 +- .../maps/class-use/AsynchronyMap.html | 4 +- .../elements/maps/class-use/DynamicsMap.html | 4 +- .../elements/maps/class-use/GenericMap.html | 4 +- .../maps/class-use/ImprecisionMap.html | 4 +- .../class-use/MetricalAccentuationMap.html | 4 +- .../maps/class-use/OrnamentationMap.html | 4 +- .../elements/maps/class-use/RubatoMap.html | 4 +- .../mpm/elements/maps/class-use/TempoMap.html | 4 +- .../elements/maps/data/ArticulationData.html | 4 +- .../elements/maps/data/DistributionData.html | 4 +- .../mpm/elements/maps/data/DynamicsData.html | 4 +- .../maps/data/MetricalAccentuationData.html | 4 +- .../mpm/elements/maps/data/RubatoData.html | 4 +- .../mpm/elements/maps/data/TempoData.html | 4 +- .../maps/data/class-use/ArticulationData.html | 4 +- .../maps/data/class-use/DistributionData.html | 4 +- .../maps/data/class-use/DynamicsData.html | 4 +- .../class-use/MetricalAccentuationData.html | 4 +- .../maps/data/class-use/RubatoData.html | 4 +- .../maps/data/class-use/TempoData.html | 4 +- .../mpm/elements/maps/data/package-frame.html | 4 +- .../elements/maps/data/package-summary.html | 4 +- .../mpm/elements/maps/data/package-tree.html | 4 +- .../mpm/elements/maps/data/package-use.html | 4 +- .../mpm/elements/maps/package-frame.html | 4 +- .../mpm/elements/maps/package-summary.html | 4 +- .../meico/mpm/elements/maps/package-tree.html | 4 +- docs/meico/mpm/elements/maps/package-use.html | 4 +- docs/meico/mpm/elements/metadata/Author.html | 12 +- .../meico/mpm/elements/metadata/Metadata.html | 153 ++++++++---- .../elements/metadata/RelatedResource.html | 4 +- .../elements/metadata/class-use/Author.html | 25 +- .../elements/metadata/class-use/Metadata.html | 21 +- .../metadata/class-use/RelatedResource.html | 68 ++++- .../mpm/elements/metadata/package-frame.html | 5 +- .../elements/metadata/package-summary.html | 12 +- .../mpm/elements/metadata/package-tree.html | 5 +- .../mpm/elements/metadata/package-use.html | 21 +- docs/meico/mpm/elements/package-frame.html | 4 +- docs/meico/mpm/elements/package-summary.html | 4 +- docs/meico/mpm/elements/package-tree.html | 4 +- docs/meico/mpm/elements/package-use.html | 4 +- .../elements/styles/ArticulationStyle.html | 199 ++++----------- .../mpm/elements/styles/DynamicsStyle.html | 203 ++++----------- .../mpm/elements/styles/GenericStyle.html | 234 +++++++++++++++++- .../styles/MetricalAccentuationStyle.html | 199 ++++----------- .../mpm/elements/styles/RubatoStyle.html | 199 ++++----------- .../meico/mpm/elements/styles/TempoStyle.html | 203 ++++----------- .../styles/class-use/ArticulationStyle.html | 11 +- .../styles/class-use/DynamicsStyle.html | 11 +- .../styles/class-use/GenericStyle.html | 19 +- .../class-use/MetricalAccentuationStyle.html | 11 +- .../styles/class-use/RubatoStyle.html | 11 +- .../elements/styles/class-use/TempoStyle.html | 11 +- .../mpm/elements/styles/defs/AbstractDef.html | 91 ++++++- .../styles/defs/AccentuationPatternDef.html | 115 +++++++-- .../elements/styles/defs/ArticulationDef.html | 10 +- .../mpm/elements/styles/defs/DynamicsDef.html | 10 +- .../mpm/elements/styles/defs/RubatoDef.html | 27 +- .../mpm/elements/styles/defs/TempoDef.html | 10 +- .../styles/defs/class-use/AbstractDef.html | 28 ++- .../class-use/AccentuationPatternDef.html | 79 +----- .../defs/class-use/ArticulationDef.html | 71 +----- .../styles/defs/class-use/DynamicsDef.html | 71 +----- .../styles/defs/class-use/RubatoDef.html | 74 +----- .../styles/defs/class-use/TempoDef.html | 71 +----- .../elements/styles/defs/package-frame.html | 4 +- .../elements/styles/defs/package-summary.html | 4 +- .../elements/styles/defs/package-tree.html | 4 +- .../mpm/elements/styles/defs/package-use.html | 28 +-- .../mpm/elements/styles/package-frame.html | 4 +- .../mpm/elements/styles/package-summary.html | 6 +- .../mpm/elements/styles/package-tree.html | 6 +- .../mpm/elements/styles/package-use.html | 4 +- docs/meico/mpm/package-frame.html | 4 +- docs/meico/mpm/package-summary.html | 4 +- docs/meico/mpm/package-tree.html | 4 +- docs/meico/mpm/package-use.html | 4 +- docs/meico/msm/AbstractMsm.html | 4 +- docs/meico/msm/Goto.html | 4 +- docs/meico/msm/Msm.html | 4 +- docs/meico/msm/class-use/AbstractMsm.html | 4 +- docs/meico/msm/class-use/Goto.html | 4 +- docs/meico/msm/class-use/Msm.html | 4 +- docs/meico/msm/package-frame.html | 4 +- docs/meico/msm/package-summary.html | 4 +- docs/meico/msm/package-tree.html | 4 +- docs/meico/msm/package-use.html | 4 +- docs/meico/musicxml/MusicXml.html | 4 +- docs/meico/musicxml/class-use/MusicXml.html | 4 +- docs/meico/musicxml/package-frame.html | 4 +- docs/meico/musicxml/package-summary.html | 4 +- docs/meico/musicxml/package-tree.html | 4 +- docs/meico/musicxml/package-use.html | 4 +- docs/meico/package-frame.html | 4 +- docs/meico/package-summary.html | 4 +- docs/meico/package-tree.html | 4 +- docs/meico/package-use.html | 4 +- docs/meico/pitches/FeatureElement.html | 4 +- docs/meico/pitches/FeatureVector.html | 4 +- docs/meico/pitches/Key.html | 4 +- docs/meico/pitches/Pitches.html | 4 +- .../pitches/class-use/FeatureElement.html | 4 +- .../pitches/class-use/FeatureVector.html | 4 +- docs/meico/pitches/class-use/Key.html | 4 +- docs/meico/pitches/class-use/Pitches.html | 4 +- docs/meico/pitches/package-frame.html | 4 +- docs/meico/pitches/package-summary.html | 4 +- docs/meico/pitches/package-tree.html | 4 +- docs/meico/pitches/package-use.html | 4 +- docs/meico/supplementary/KeyValue.html | 4 +- .../supplementary/RandomNumberProvider.html | 4 +- .../supplementary/class-use/KeyValue.html | 4 +- .../class-use/RandomNumberProvider.html | 4 +- docs/meico/supplementary/package-frame.html | 4 +- docs/meico/supplementary/package-summary.html | 4 +- docs/meico/supplementary/package-tree.html | 4 +- docs/meico/supplementary/package-use.html | 4 +- docs/meico/svg/Svg.html | 4 +- docs/meico/svg/SvgCollection.html | 4 +- docs/meico/svg/class-use/Svg.html | 4 +- docs/meico/svg/class-use/SvgCollection.html | 4 +- docs/meico/svg/package-frame.html | 4 +- docs/meico/svg/package-summary.html | 4 +- docs/meico/svg/package-tree.html | 4 +- docs/meico/svg/package-use.html | 4 +- docs/meico/xml/AbstractXmlSubtree.html | 6 +- docs/meico/xml/XmlBase.html | 4 +- .../xml/class-use/AbstractXmlSubtree.html | 14 +- docs/meico/xml/class-use/XmlBase.html | 4 +- docs/meico/xml/package-frame.html | 4 +- docs/meico/xml/package-summary.html | 4 +- docs/meico/xml/package-tree.html | 4 +- docs/meico/xml/package-use.html | 4 +- docs/overview-frame.html | 4 +- docs/overview-summary.html | 4 +- docs/overview-tree.html | 7 +- docs/serialized-form.html | 4 +- history.md | 19 +- src/meico/Meico.java | 2 +- src/meico/mei/Helper.java | 11 +- src/meico/mei/Mei.java | 36 ++- src/meico/mpm/Mpm.java | 24 +- src/meico/mpm/elements/Dated.java | 12 +- src/meico/mpm/elements/Header.java | 67 +++-- src/meico/mpm/elements/Part.java | 57 +++++ src/meico/mpm/elements/Performance.java | 88 ++++++- .../mpm/elements/maps/ArticulationMap.java | 6 +- src/meico/mpm/elements/maps/DynamicsMap.java | 7 +- src/meico/mpm/elements/maps/GenericMap.java | 4 + .../maps/MetricalAccentuationMap.java | 7 +- src/meico/mpm/elements/maps/RubatoMap.java | 7 +- src/meico/mpm/elements/maps/TempoMap.java | 4 +- src/meico/mpm/elements/metadata/Author.java | 6 +- src/meico/mpm/elements/metadata/Comment.java | 132 ++++++++++ src/meico/mpm/elements/metadata/Metadata.java | 85 ++++--- .../elements/styles/ArticulationStyle.java | 86 ++----- .../mpm/elements/styles/DynamicsStyle.java | 90 ++----- .../mpm/elements/styles/GenericStyle.java | 128 +++++++++- .../styles/MetricalAccentuationStyle.java | 86 ++----- .../mpm/elements/styles/RubatoStyle.java | 86 ++----- src/meico/mpm/elements/styles/TempoStyle.java | 90 ++----- .../mpm/elements/styles/defs/AbstractDef.java | 52 +++- .../styles/defs/AccentuationPatternDef.java | 53 +++- .../elements/styles/defs/ArticulationDef.java | 9 +- .../mpm/elements/styles/defs/DynamicsDef.java | 17 +- .../mpm/elements/styles/defs/RubatoDef.java | 17 +- .../mpm/elements/styles/defs/TempoDef.java | 7 +- src/meico/msm/Msm.java | 12 +- src/meico/xml/XmlBase.java | 1 + 268 files changed, 2802 insertions(+), 2438 deletions(-) create mode 100644 src/meico/mpm/elements/metadata/Comment.java diff --git a/docs/allclasses-frame.html b/docs/allclasses-frame.html index 8c3d23f4..c02c199f 100644 --- a/docs/allclasses-frame.html +++ b/docs/allclasses-frame.html @@ -2,9 +2,9 @@ - + All Classes - + @@ -24,6 +24,7 @@

All Classes

  • Audio
  • AudioPlayer
  • Author
  • +
  • Comment
  • Dated
  • DistributionData
  • DynamicsData
  • diff --git a/docs/allclasses-noframe.html b/docs/allclasses-noframe.html index 56c94ada..5b7c5b9a 100644 --- a/docs/allclasses-noframe.html +++ b/docs/allclasses-noframe.html @@ -2,9 +2,9 @@ - + All Classes - + @@ -24,6 +24,7 @@

    All Classes

  • Audio
  • AudioPlayer
  • Author
  • +
  • Comment
  • Dated
  • DistributionData
  • DynamicsData
  • diff --git a/docs/constant-values.html b/docs/constant-values.html index ff819ca9..1ec5d75c 100644 --- a/docs/constant-values.html +++ b/docs/constant-values.html @@ -2,9 +2,9 @@ - + Constant Field Values - + @@ -95,7 +95,7 @@

    meico.*

    public static final java.lang.String version -"0.8.17" +"0.8.19" diff --git a/docs/deprecated-list.html b/docs/deprecated-list.html index 75164022..2a1e27f4 100644 --- a/docs/deprecated-list.html +++ b/docs/deprecated-list.html @@ -2,9 +2,9 @@ - + Deprecated List - + diff --git a/docs/help-doc.html b/docs/help-doc.html index 598f3d02..eedbb656 100644 --- a/docs/help-doc.html +++ b/docs/help-doc.html @@ -2,9 +2,9 @@ - + API Help - + diff --git a/docs/index-files/index-1.html b/docs/index-files/index-1.html index 116e2e1a..40a8c137 100644 --- a/docs/index-files/index-1.html +++ b/docs/index-files/index-1.html @@ -2,9 +2,9 @@ - + A-Index - + @@ -170,8 +170,6 @@

    A

    accentuationPatternDefName - Variable in class meico.mpm.elements.maps.data.MetricalAccentuationData
     
    -
    accentuationPatternDefs - Variable in class meico.mpm.elements.styles.MetricalAccentuationStyle
    -
     
    accentuations - Variable in class meico.mpm.elements.styles.defs.AccentuationPatternDef
     
    accid - Variable in class meico.mei.Helper
    @@ -209,6 +207,10 @@

    A

    create and add an accentuation to this accentuationPatternDef
    +
    addAccentuation(double, double, double, double, String) - Method in class meico.mpm.elements.styles.defs.AccentuationPatternDef
    +
    +
    create and add an accentuation to this accentuationPatternDef
    +
    addAccentuation(Element) - Method in class meico.mpm.elements.styles.defs.AccentuationPatternDef
    add a given xml representation of an MPM accentuation element to this accentuationPatternDef
    @@ -229,10 +231,6 @@

    A

    add an accentuationPattern element to the map
    -
    addAccentuationPatternDef(AccentuationPatternDef) - Method in class meico.mpm.elements.styles.MetricalAccentuationStyle
    -
    -
    add or (if a AccentuationPatternDef with this name is already existent) replace the AccentuationPatternDef
    -
    addAccentuationToArrayList(double[], Element) - Method in class meico.mpm.elements.styles.defs.AccentuationPatternDef
    add the accentuation at the right beat position (the xml can be unsorted, this.accentuations should be sorted)
    @@ -249,10 +247,6 @@

    A

    add an articulation element to the articulationMap
    -
    addArticulationDef(ArticulationDef) - Method in class meico.mpm.elements.styles.ArticulationStyle
    -
    -
    add or (if a articulationDef with this name is already existent) replace the articulationDef
    -
    addArticulationToMap(double, String, String, String, ArticulationMap, ArticulationStyle) - Method in class meico.mei.Mei
    a helper method to insert an articulation in MPM's articulationMap and styleDef
    @@ -265,10 +259,14 @@

    A

    add an author to the metadata
    -
    addComment(String) - Method in class meico.mpm.elements.metadata.Metadata
    +
    addComment(Comment) - Method in class meico.mpm.elements.metadata.Metadata
    add a comment to the metadata
    +
    addDef(E) - Method in class meico.mpm.elements.styles.GenericStyle
    +
    +
    add or (if a def with this name is already existent) replace the def
    +
    addDistribution(DistributionData) - Method in class meico.mpm.elements.maps.ImprecisionMap
    add a distribution element to the imprecisionMap
    @@ -357,10 +355,6 @@

    A

    add a dynamics element to the dynamicsMap
    -
    addDynamicsDef(DynamicsDef) - Method in class meico.mpm.elements.styles.DynamicsStyle
    -
    -
    add or (if a DynamicsDef with this name is already existent) replace the DynamicsDef
    -
    addDynamicsToMpm(DynamicsData, DynamicsMap, Attribute, Attribute) - Method in class meico.mei.Mei
    a helper method to add a dynamics instruction to an MPM dynamicsMap
    @@ -404,7 +398,7 @@

    A

    Add the specified map to the dated environment.
    -
    addMetadata(Author, String) - Method in class meico.mpm.Mpm
    +
    addMetadata(Author, Comment, Collection<RelatedResource>) - Method in class meico.mpm.Mpm
    add metadata to the MPM
    @@ -458,10 +452,6 @@

    A

    add a rubato element to the map
    -
    addRubatoDef(RubatoDef) - Method in class meico.mpm.elements.styles.RubatoStyle
    -
    -
    add or (if a rubatoDef with this name is already existent) replace the rubatoDef
    -
    addSlurId(Element, Element) - Method in class meico.mei.Helper
    a helper method to make the code of method checkSlurs() a bit more compact
    @@ -508,10 +498,6 @@

    A

    add a tempo element to the map
    -
    addTempoDef(TempoDef) - Method in class meico.mpm.elements.styles.TempoStyle
    -
    -
    add or (if a TempoDef with this name is already existent) replace the TempoDef
    -
    addTempoToMpm(TempoData, TempoMap, Attribute, Attribute) - Method in class meico.mei.Mei
    a helper method to add a tempo instruction to an MPM tempoMap
    @@ -573,8 +559,6 @@

    A

    articulationDefName - Variable in class meico.mpm.elements.maps.data.ArticulationData
     
    -
    articulationDefs - Variable in class meico.mpm.elements.styles.ArticulationStyle
    -
     
    ArticulationMap - Class in meico.mpm.elements.maps
    This class interfaces MPM's articulationMaps
    diff --git a/docs/index-files/index-10.html b/docs/index-files/index-10.html index 5bb45cf9..9a3efa93 100644 --- a/docs/index-files/index-10.html +++ b/docs/index-files/index-10.html @@ -2,9 +2,9 @@ - + J-Index - + diff --git a/docs/index-files/index-11.html b/docs/index-files/index-11.html index 41896d67..7c9d25d3 100644 --- a/docs/index-files/index-11.html +++ b/docs/index-files/index-11.html @@ -2,9 +2,9 @@ - + K-Index - + diff --git a/docs/index-files/index-12.html b/docs/index-files/index-12.html index 57c9d8c3..fb686902 100644 --- a/docs/index-files/index-12.html +++ b/docs/index-files/index-12.html @@ -2,9 +2,9 @@ - + L-Index - + diff --git a/docs/index-files/index-13.html b/docs/index-files/index-13.html index 730121a7..f7d7d0cd 100644 --- a/docs/index-files/index-13.html +++ b/docs/index-files/index-13.html @@ -2,9 +2,9 @@ - + M-Index - + @@ -347,7 +347,7 @@

    M

    this constructor instantiates the Metadata object from an existing xml source handed over as XOM Element
    -
    Metadata(Author, String) - Constructor for class meico.mpm.elements.metadata.Metadata
    +
    Metadata(Author, Comment, Collection<RelatedResource>) - Constructor for class meico.mpm.elements.metadata.Metadata
    this constructor creates a new Metadata object from an author and/or comment
    @@ -499,7 +499,7 @@

    M

    Mpm() - Constructor for class meico.mpm.Mpm
    -
    constructor
    +
    Constructor.
    Mpm(Document) - Constructor for class meico.mpm.Mpm
    diff --git a/docs/index-files/index-14.html b/docs/index-files/index-14.html index 9a920d37..c7725187 100644 --- a/docs/index-files/index-14.html +++ b/docs/index-files/index-14.html @@ -2,9 +2,9 @@ - + N-Index - + diff --git a/docs/index-files/index-15.html b/docs/index-files/index-15.html index 748c9637..12577fab 100644 --- a/docs/index-files/index-15.html +++ b/docs/index-files/index-15.html @@ -2,9 +2,9 @@ - + O-Index - + diff --git a/docs/index-files/index-16.html b/docs/index-files/index-16.html index 875f6bff..2c0d1533 100644 --- a/docs/index-files/index-16.html +++ b/docs/index-files/index-16.html @@ -2,9 +2,9 @@ - + P-Index - + @@ -130,6 +130,10 @@

    P

    parse the author element and set the according class variables
    +
    parseData(Element) - Method in class meico.mpm.elements.metadata.Comment
    +
    +
    parse the comment element and set the according class variables
    +
    parseData(Element) - Method in class meico.mpm.elements.metadata.Metadata
    parse the xml and set the class variables
    @@ -150,6 +154,8 @@

    P

    set the data of this object, this parses the xml element and generates the according data structure
    +
    parseData(Element) - Method in class meico.mpm.elements.styles.defs.AbstractDef
    +
     
    parseData(Element) - Method in class meico.mpm.elements.styles.defs.AccentuationPatternDef
    set the data of this object, this parses the xml element and generates the according data structure
    diff --git a/docs/index-files/index-17.html b/docs/index-files/index-17.html index 21ef2d43..65534c80 100644 --- a/docs/index-files/index-17.html +++ b/docs/index-files/index-17.html @@ -2,9 +2,9 @@ - + Q-Index - + diff --git a/docs/index-files/index-18.html b/docs/index-files/index-18.html index a18084a5..79880faf 100644 --- a/docs/index-files/index-18.html +++ b/docs/index-files/index-18.html @@ -2,9 +2,9 @@ - + R-Index - + @@ -125,10 +125,6 @@

    R

    remove an accentuation from this accentuationPatternDef
    -
    removeAccentuationPatternDef(String) - Method in class meico.mpm.elements.styles.MetricalAccentuationStyle
    -
    -
    remove the specified AccentuationPatternDef from this styleDef
    -
    removeAllAttributes(String) - Method in class meico.xml.XmlBase
    remove all attributes with the specified name from the xml tree
    @@ -137,21 +133,25 @@

    R

    remove all elements with the specified local name from the xml tree
    -
    removeArticulationDef(String) - Method in class meico.mpm.elements.styles.ArticulationStyle
    -
    -
    remove the specified articulationDef from this styleDef
    -
    removeAuthor(String) - Method in class meico.mpm.elements.metadata.Metadata
    remove all authors with the specified name from the metadata
    +
    removeAuthor(Author) - Method in class meico.mpm.elements.metadata.Metadata
    +
    +
    remove the specified author from the metadata
    +
    removeComment(int) - Method in class meico.mpm.elements.metadata.Metadata
    remove the comment at index i
    -
    removeDynamicsDef(String) - Method in class meico.mpm.elements.styles.DynamicsStyle
    +
    removeComment(Comment) - Method in class meico.mpm.elements.metadata.Metadata
    -
    remove the specified DynamicsDef from this styleDef
    +
    remove the specified comment from the metadata
    +
    +
    removeDef(String) - Method in class meico.mpm.elements.styles.GenericStyle
    +
    +
    remove the specified def from this styleDef
    removeElement(int) - Method in class meico.mpm.elements.maps.GenericMap
    @@ -212,10 +212,6 @@

    R

    this method is not part of the mei.exportMsm() cleanup procedure as some applications may still need the rests; others who don't, can call this method to remove all rest elements and get a purged msm
    -
    removeRubatoDef(String) - Method in class meico.mpm.elements.styles.RubatoStyle
    -
    -
    remove the specified rubatoDef from this styleDef
    -
    removeStyleDef(String, String) - Method in class meico.mpm.elements.Header
    remove the specified styleDef from the specified collection of styleDefs (style type)
    @@ -232,9 +228,9 @@

    R

    remove an SVG from the collection
    -
    removeTempoDef(String) - Method in class meico.mpm.elements.styles.TempoStyle
    +
    renameStyleDef(String, String, String) - Method in class meico.mpm.elements.Header
    -
    remove the specified TempoDef from this styleDef
    +
    Rename a styleDef.
    renderArticulationToMap_millisecondModifiers(GenericMap) - Method in class meico.mpm.elements.maps.ArticulationMap
    @@ -382,7 +378,7 @@

    R

    This class interfaces MPM rubatoDef elements.
    -
    RubatoDef(String) - Constructor for class meico.mpm.elements.styles.defs.RubatoDef
    +
    RubatoDef(String, double) - Constructor for class meico.mpm.elements.styles.defs.RubatoDef
    constructor, creates an empty rubatoDef
    @@ -394,8 +390,6 @@

    R

    contructor to create a RubatoDef instance from the xml
    -
    rubatoDefs - Variable in class meico.mpm.elements.styles.RubatoStyle
    -
     
    rubatoDefString - Variable in class meico.mpm.elements.maps.data.RubatoData
     
    RubatoMap - Class in meico.mpm.elements.maps
    diff --git a/docs/index-files/index-19.html b/docs/index-files/index-19.html index 262aa0cd..41cc4675 100644 --- a/docs/index-files/index-19.html +++ b/docs/index-files/index-19.html @@ -2,9 +2,9 @@ - + S-Index - + @@ -229,6 +229,26 @@

    S

    set the author's id
    +
    setId(String) - Method in class meico.mpm.elements.metadata.Comment
    +
    +
    set the comment's id
    +
    +
    setId(String) - Method in class meico.mpm.elements.Part
    +
    +
    set the part's id
    +
    +
    setId(String) - Method in class meico.mpm.elements.Performance
    +
    +
    set the performance's id
    +
    +
    setId(String) - Method in class meico.mpm.elements.styles.defs.AbstractDef
    +
    +
    set the part's id
    +
    +
    setId(String) - Method in class meico.mpm.elements.styles.GenericStyle
    +
    +
    set the id
    +
    setInitialValue(double) - Method in class meico.supplementary.RandomNumberProvider
    This method reinitializes the random number series with a specific first value.
    @@ -276,7 +296,7 @@

    S

    setName(String) - Method in class meico.mpm.elements.metadata.Author
    -
    the the author's name
    +
    set the author's name
    setName(String) - Method in class meico.mpm.elements.Part
    @@ -358,6 +378,10 @@

    S

    a sequencer setter
    +
    setText(String) - Method in class meico.mpm.elements.metadata.Comment
    +
    +
    set the comment's text
    +
    setTickPosition(long) - Method in class meico.midi.MidiPlayer
    a setter for the playback position
    @@ -428,25 +452,13 @@

    S

    get the number of parts in this performance
    -
    size() - Method in class meico.mpm.elements.styles.ArticulationStyle
    -
    -
    get the number of articulationDefs in this styleDef
    -
    -
    size() - Method in class meico.mpm.elements.styles.DynamicsStyle
    -
    -
    get the number of dynamicsDefs in this styleDef
    -
    -
    size() - Method in class meico.mpm.elements.styles.MetricalAccentuationStyle
    -
    -
    get the number of AccentuationPatternDefs in this styleDef
    -
    -
    size() - Method in class meico.mpm.elements.styles.RubatoStyle
    +
    size() - Method in class meico.mpm.elements.styles.defs.AccentuationPatternDef
    -
    get the number of rubatoDefs in this styleDef
    +
    get the count of accentuations in this accentuation pattern
    -
    size() - Method in class meico.mpm.elements.styles.TempoStyle
    +
    size() - Method in class meico.mpm.elements.styles.GenericStyle
    -
    get the number of tempoDefs in this styleDef
    +
    get the number of defs in this styleDef
    size() - Method in class meico.mpm.Mpm
    diff --git a/docs/index-files/index-2.html b/docs/index-files/index-2.html index 3a1d8202..35b1df70 100644 --- a/docs/index-files/index-2.html +++ b/docs/index-files/index-2.html @@ -2,9 +2,9 @@ - + B-Index - + diff --git a/docs/index-files/index-20.html b/docs/index-files/index-20.html index 5cba82b5..a46b114d 100644 --- a/docs/index-files/index-20.html +++ b/docs/index-files/index-20.html @@ -2,9 +2,9 @@ - + T-Index - + @@ -102,8 +102,6 @@

    T

    contructor to create a TempoDef instance from the xml
    -
    tempoDefs - Variable in class meico.mpm.elements.styles.TempoStyle
    -
     
    TempoMap - Class in meico.mpm.elements.maps
    This class interfaces MPM's tempoMaps
    @@ -128,6 +126,8 @@

    T

    this constructor generates the object from xml input
    +
    text - Variable in class meico.mpm.elements.metadata.Comment
    +
     
    THIRTY_SECOND_NOTES_PER_QUARTER - Static variable in class meico.midi.EventMaker
     
    TICKS_PER_METER_CLICK - Static variable in class meico.midi.EventMaker
    diff --git a/docs/index-files/index-21.html b/docs/index-files/index-21.html index 36126835..82c68875 100644 --- a/docs/index-files/index-21.html +++ b/docs/index-files/index-21.html @@ -2,9 +2,9 @@ - + U-Index - + diff --git a/docs/index-files/index-22.html b/docs/index-files/index-22.html index 2eb11669..b4cd79c2 100644 --- a/docs/index-files/index-22.html +++ b/docs/index-files/index-22.html @@ -2,9 +2,9 @@ - + V-Index - + diff --git a/docs/index-files/index-23.html b/docs/index-files/index-23.html index 2538e887..e4e6e814 100644 --- a/docs/index-files/index-23.html +++ b/docs/index-files/index-23.html @@ -2,9 +2,9 @@ - + W-Index - + diff --git a/docs/index-files/index-24.html b/docs/index-files/index-24.html index b6bd0474..11280fb9 100644 --- a/docs/index-files/index-24.html +++ b/docs/index-files/index-24.html @@ -2,9 +2,9 @@ - + X-Index - + diff --git a/docs/index-files/index-3.html b/docs/index-files/index-3.html index f33bfdf6..f33931b6 100644 --- a/docs/index-files/index-3.html +++ b/docs/index-files/index-3.html @@ -2,9 +2,9 @@ - + C-Index - + @@ -874,6 +874,14 @@

    C

    this method removes multiple entries of note ids and, hence, reduces memory consumption
    +
    clear() - Method in class meico.mpm.elements.Dated
    +
    +
    remove all maps from dated
    +
    +
    clear() - Method in class meico.mpm.elements.Header
    +
    +
    remove all style collections of the header
    +
    clearFromType(short) - Method in class meico.midi.legacy.TrackOld
    Deprecated.
    @@ -923,6 +931,14 @@

    C

    closes all activity of this MidiPlayer
    +
    Comment - Class in meico.mpm.elements.metadata
    +
    +
    This class interfaces the comment element of MPM.
    +
    +
    Comment(Element) - Constructor for class meico.mpm.elements.metadata.Comment
    +
    +
    this constructor instantiates the Comment object from an existing xml source handed over as XOM Element
    +
    comments - Variable in class meico.mpm.elements.metadata.Metadata
     
    compensatingTriangleDistribution() - Method in class meico.supplementary.RandomNumberProvider
    @@ -1056,6 +1072,10 @@

    C

    AcctentuationPatternDef factory
    +
    createAccentuationPatternDef(String, double, String) - Static method in class meico.mpm.elements.styles.defs.AccentuationPatternDef
    +
    +
    AcctentuationPatternDef factory
    +
    createAccentuationPatternDef(Element) - Static method in class meico.mpm.elements.styles.defs.AccentuationPatternDef
    AcctentuationPatternDef factory
    @@ -1080,6 +1100,10 @@

    C

    ArticulationStyle factory
    +
    createArticulationStyle(String, String) - Static method in class meico.mpm.elements.styles.ArticulationStyle
    +
    +
    ArticulationStyle factory
    +
    createArticulationStyle(Element) - Static method in class meico.mpm.elements.styles.ArticulationStyle
    ArticulationStyle factory
    @@ -1104,6 +1128,14 @@

    C

    this creates a channel prefix event, it indicates that all subsequent meta messages go to this channel
    +
    createComment(Element) - Static method in class meico.mpm.elements.metadata.Comment
    +
    +
    comment factory
    +
    +
    createComment(String, String) - Static method in class meico.mpm.elements.metadata.Comment
    +
    +
    This factory generates a comment object from raw data.
    +
    createControlChange(int, long, int, int) - Static method in class meico.midi.EventMaker
    create a control change event
    @@ -1148,6 +1180,10 @@

    C

    DynamicsStyle factory
    +
    createDynamicsStyle(String, String) - Static method in class meico.mpm.elements.styles.DynamicsStyle
    +
    +
    DynamicsStyle factory
    +
    createDynamicsStyle(Element) - Static method in class meico.mpm.elements.styles.DynamicsStyle
    DynamicsStyle factory
    @@ -1164,6 +1200,10 @@

    C

    GenericStyle factory
    +
    createGenericStyle(String, String) - Static method in class meico.mpm.elements.styles.GenericStyle
    +
    +
    GenericStyle factory
    +
    createGenericStyle(Element) - Static method in class meico.mpm.elements.styles.GenericStyle
    GenericStyle factory
    @@ -1212,11 +1252,15 @@

    C

    this factory generates a Metadata object from a comment
    -
    createMetadata(String) - Static method in class meico.mpm.elements.metadata.Metadata
    +
    createMetadata(Comment) - Static method in class meico.mpm.elements.metadata.Metadata
    this factory generates a Metadata object from an author
    -
    createMetadata(Author, String) - Static method in class meico.mpm.elements.metadata.Metadata
    +
    createMetadata(Collection<RelatedResource>) - Static method in class meico.mpm.elements.metadata.Metadata
    +
    +
    this factory generates a Metadata object from a collection of related resources
    +
    +
    createMetadata(Author, Comment, Collection<RelatedResource>) - Static method in class meico.mpm.elements.metadata.Metadata
    this factory generates a Metadata object from an author and/or comment
    @@ -1232,6 +1276,10 @@

    C

    MetricalAccentuationStyle factory
    +
    createMetricalAccentuationStyle(String, String) - Static method in class meico.mpm.elements.styles.MetricalAccentuationStyle
    +
    +
    MetricalAccentuationStyle factory
    +
    createMetricalAccentuationStyle(Element) - Static method in class meico.mpm.elements.styles.MetricalAccentuationStyle
    MetricalAccentuationStyle factory
    @@ -1242,7 +1290,7 @@

    C

    createMpm() - Static method in class meico.mpm.Mpm
    -
    an Mpm factory
    +
    An Mpm factory.
    createMsm(String, String, int) - Static method in class meico.msm.Msm
    @@ -1268,6 +1316,10 @@

    C

    part factory
    +
    createPart(String, int, int, int, String) - Static method in class meico.mpm.elements.Part
    +
    +
    part factory
    +
    createPart(Element) - Static method in class meico.mpm.elements.Part
    part factory
    @@ -1276,6 +1328,14 @@

    C

    performance factory
    +
    createPerformance(String, int) - Static method in class meico.mpm.elements.Performance
    +
    +
    performance factory
    +
    +
    createPerformance(String, int, String) - Static method in class meico.mpm.elements.Performance
    +
    +
    performance factory
    +
    createPerformance(Element) - Static method in class meico.mpm.elements.Performance
    performance factory
    @@ -1320,7 +1380,7 @@

    C

    This factory generates a RelatedResource object from raw data.
    -
    createRubatoDef(String) - Static method in class meico.mpm.elements.styles.defs.RubatoDef
    +
    createRubatoDef(String, double) - Static method in class meico.mpm.elements.styles.defs.RubatoDef
    RubatoDef factory
    @@ -1344,6 +1404,10 @@

    C

    RubatoStyle factory
    +
    createRubatoStyle(String, String) - Static method in class meico.mpm.elements.styles.RubatoStyle
    +
    +
    RubatoStyle factory
    +
    createRubatoStyle(Element) - Static method in class meico.mpm.elements.styles.RubatoStyle
    RubatoStyle factory
    @@ -1372,6 +1436,10 @@

    C

    TempoStyle factory
    +
    createTempoStyle(String, String) - Static method in class meico.mpm.elements.styles.TempoStyle
    +
    +
    TempoStyle factory
    +
    createTempoStyle(Element) - Static method in class meico.mpm.elements.styles.TempoStyle
    TempoStyle factory
    diff --git a/docs/index-files/index-4.html b/docs/index-files/index-4.html index 378a21a1..8998f98c 100644 --- a/docs/index-files/index-4.html +++ b/docs/index-files/index-4.html @@ -2,9 +2,9 @@ - + D-Index - + @@ -120,6 +120,8 @@

    D

     
    DefaultNames - Static variable in class meico.midi.InstrumentsDictionary
     
    +
    defs - Variable in class meico.mpm.elements.styles.GenericStyle
    +
     
    degreeOfCorrelation - Variable in class meico.mpm.elements.maps.data.DistributionData
     
    degreeOfCorrelation - Variable in class meico.supplementary.RandomNumberProvider
    @@ -201,8 +203,6 @@

    D

    contructor to create a DynamicsDef instance from xml
    -
    dynamicsDefs - Variable in class meico.mpm.elements.styles.DynamicsStyle
    -
     
    dynamicsDefString - Variable in class meico.mpm.elements.maps.data.DynamicsData
     
    DynamicsMap - Class in meico.mpm.elements.maps
    diff --git a/docs/index-files/index-5.html b/docs/index-files/index-5.html index 4bdb04f6..493f45c1 100644 --- a/docs/index-files/index-5.html +++ b/docs/index-files/index-5.html @@ -2,9 +2,9 @@ - + E-Index - + diff --git a/docs/index-files/index-6.html b/docs/index-files/index-6.html index 5ad9c298..2b0a8f25 100644 --- a/docs/index-files/index-6.html +++ b/docs/index-files/index-6.html @@ -2,9 +2,9 @@ - + F-Index - + diff --git a/docs/index-files/index-7.html b/docs/index-files/index-7.html index e1fa0b22..1cc5b155 100644 --- a/docs/index-files/index-7.html +++ b/docs/index-files/index-7.html @@ -2,9 +2,9 @@ - + G-Index - + @@ -101,7 +101,7 @@

    G

    constructor, generates an instance from xml code
    -
    GenericStyle - Class in meico.mpm.elements.styles
    +
    GenericStyle<E extends AbstractDef> - Class in meico.mpm.elements.styles
    This class interfaces MPM styleDef elements.
    @@ -141,33 +141,21 @@

    G

    access the accentuation at the specified index
    -
    getAccentuationPatternDef(String) - Method in class meico.mpm.elements.styles.MetricalAccentuationStyle
    -
    -
    retrieve a specific AccentuationPatternDef
    -
    getAccentuationXml(int) - Method in class meico.mpm.elements.styles.defs.AccentuationPatternDef
    access the accentuation element
    -
    getAllAccentuationPatternDefs() - Method in class meico.mpm.elements.styles.MetricalAccentuationStyle
    -
    -
    access the whole HashMap with (name, AccentuationPatternDef) pairs
    -
    getAllAccentuations() - Method in class meico.mpm.elements.styles.defs.AccentuationPatternDef
    access the accentuation pattern
    -
    getAllArticulationDefs() - Method in class meico.mpm.elements.styles.ArticulationStyle
    -
    -
    access the whole HashMap with (name, ArticulationDef) pairs
    -
    getAllChildElements(String, Element) - Static method in class meico.mei.Helper
    this method is an alternative to XOM's getChildElements(String name) which sometimes doesn't seem to work
    -
    getAllDynamicsDefs() - Method in class meico.mpm.elements.styles.DynamicsStyle
    +
    getAllDefs() - Method in class meico.mpm.elements.styles.GenericStyle
    -
    access the whole HashMap with (name, DynamicsDef) pairs
    +
    access the whole HashMap with (name, ...Def) pairs
    getAllElements() - Method in class meico.mpm.elements.maps.GenericMap
    @@ -193,10 +181,6 @@

    G

    this returns all performances in this mpm as an ArrayList
    -
    getAllRubatoDefs() - Method in class meico.mpm.elements.styles.RubatoStyle
    -
    -
    access the whole HashMap with (name, RubatoDef) pairs
    -
    getAllStyleDefs(String) - Method in class meico.mpm.elements.Header
    access all style definitions of the specified type
    @@ -205,10 +189,6 @@

    G

    access all style types and their subsequent style definitions
    -
    getAllTempoDefs() - Method in class meico.mpm.elements.styles.TempoStyle
    -
    -
    access the whole HashMap with (name, TempoDef) pairs
    -
    getArticulationDataAt(double) - Method in class meico.mpm.elements.maps.ArticulationMap
    collect all data that is needed to compute the articulation at the specified date
    @@ -217,10 +197,6 @@

    G

    This collects all data of the articulation at the specified map position.
    -
    getArticulationDef(String) - Method in class meico.mpm.elements.styles.ArticulationStyle
    -
    -
    retrieve a specific articulationDef
    -
    getAsString(boolean) - Method in class meico.pitches.Pitches
    returns the json string
    @@ -309,6 +285,10 @@

    G

    this method works directly with the parameter t to specify a point on the Bézier curve and returns a tuplet [date, volume]
    +
    getDef(String) - Method in class meico.mpm.elements.styles.GenericStyle
    +
    +
    retrieve a specific def
    +
    getDefaultTempo(String) - Static method in class meico.mpm.elements.styles.defs.TempoDef
    a convenient getter for some default tempo descriptor strings, @@ -362,10 +342,6 @@

    G

    this collects the dynamics data of a specific element of this dynamicsMap, given via the index
    -
    getDynamicsDef(String) - Method in class meico.mpm.elements.styles.DynamicsStyle
    -
    -
    retrieve a specific DynamicsDef
    -
    getEarlyEnd() - Method in class meico.mpm.elements.styles.defs.RubatoDef
    access earlyEnd attribute
    @@ -578,6 +554,26 @@

    G

    get the author's id
    +
    getId() - Method in class meico.mpm.elements.metadata.Comment
    +
    +
    get the comment's id
    +
    +
    getId() - Method in class meico.mpm.elements.Part
    +
    +
    get the part's id
    +
    +
    getId() - Method in class meico.mpm.elements.Performance
    +
    +
    get the performance's id
    +
    +
    getId() - Method in class meico.mpm.elements.styles.defs.AbstractDef
    +
    +
    get the part's id
    +
    +
    getId() - Method in class meico.mpm.elements.styles.GenericStyle
    +
    +
    get the id
    +
    getInstrumentName(short) - Static method in class meico.midi.InstrumentsDictionary
    given a program change number, return the instrument's name, i.e. the first string that is associated with this pc number in the dictionary
    @@ -884,10 +880,6 @@

    G

    this collects the rubato data of a specific element of this rubatoMap, given via the index
    -
    getRubatoDef(String) - Method in class meico.mpm.elements.styles.RubatoStyle
    -
    -
    retrieve a specific rubatoDef
    -
    getSampleRate() - Method in class meico.audio.Audio
    a getter for the sample rate
    @@ -914,10 +906,6 @@

    G

    a getter for the sequencer object
    -
    getSize() - Method in class meico.mpm.elements.styles.defs.AccentuationPatternDef
    -
    -
    get the count of accentuations in this accentuation pattern
    -
    getSize() - Method in class meico.pitches.FeatureVector
    retrun the getSize of the feature vector
    @@ -986,14 +974,14 @@

    G

    this collects the tempo data of a specific element of this tempoMap, given via the index
    -
    getTempoDef(String) - Method in class meico.mpm.elements.styles.TempoStyle
    -
    -
    retrieve a specific TempoDef
    -
    getTempoMap() - Method in class meico.midi.Midi
    retrieve the tempo map from the MIDI data
    +
    getText() - Method in class meico.mpm.elements.metadata.Comment
    +
    +
    get the comment's text
    +
    getTForDate(double) - Method in class meico.mpm.elements.maps.data.DynamicsData
    compute parameter t of the Bézier curve that corresponds to time position date
    diff --git a/docs/index-files/index-8.html b/docs/index-files/index-8.html index 23c98d12..fd646f79 100644 --- a/docs/index-files/index-8.html +++ b/docs/index-files/index-8.html @@ -2,9 +2,9 @@ - + H-Index - + diff --git a/docs/index-files/index-9.html b/docs/index-files/index-9.html index d6266eea..5d380d11 100644 --- a/docs/index-files/index-9.html +++ b/docs/index-files/index-9.html @@ -2,9 +2,9 @@ - + I-Index - + @@ -76,6 +76,16 @@

    I

    id - Variable in class meico.mpm.elements.metadata.Author
     
    +
    id - Variable in class meico.mpm.elements.metadata.Comment
    +
     
    +
    id - Variable in class meico.mpm.elements.Part
    +
     
    +
    id - Variable in class meico.mpm.elements.Performance
    +
     
    +
    id - Variable in class meico.mpm.elements.styles.defs.AbstractDef
    +
     
    +
    id - Variable in class meico.mpm.elements.styles.GenericStyle
    +
     
    IMPRECISION_MAP - Static variable in class meico.mpm.Mpm
     
    IMPRECISION_MAP_DYNAMICS - Static variable in class meico.mpm.Mpm
    @@ -169,25 +179,9 @@

    I

    Is the map empty?
    -
    isEmpty() - Method in class meico.mpm.elements.styles.ArticulationStyle
    -
    -
    does the styleDef contain articulationDefs?
    -
    -
    isEmpty() - Method in class meico.mpm.elements.styles.DynamicsStyle
    -
    -
    does the styleDef contain dynamicsDefs?
    -
    -
    isEmpty() - Method in class meico.mpm.elements.styles.MetricalAccentuationStyle
    -
    -
    does the styleDef contain AccentuationPatternDefs?
    -
    -
    isEmpty() - Method in class meico.mpm.elements.styles.RubatoStyle
    -
    -
    does the styleDef contain rubatoDefs?
    -
    -
    isEmpty() - Method in class meico.mpm.elements.styles.TempoStyle
    +
    isEmpty() - Method in class meico.mpm.elements.styles.GenericStyle
    -
    does the styleDef contain tempoDefs?
    +
    does the styleDef contain defs?
    isEmpty() - Method in class meico.svg.SvgCollection
    diff --git a/docs/index.html b/docs/index.html index 551c68d5..26162c05 100644 --- a/docs/index.html +++ b/docs/index.html @@ -2,7 +2,7 @@ - + Generated Documentation (Untitled) diff --git a/docs/meico/audio/Audio.html b/docs/meico/audio/Audio.html index 70c5ed68..58307469 100644 --- a/docs/meico/audio/Audio.html +++ b/docs/meico/audio/Audio.html @@ -2,9 +2,9 @@ - + Audio - + diff --git a/docs/meico/audio/AudioPlayer.html b/docs/meico/audio/AudioPlayer.html index 7fd7091a..bfcfb715 100644 --- a/docs/meico/audio/AudioPlayer.html +++ b/docs/meico/audio/AudioPlayer.html @@ -2,9 +2,9 @@ - + AudioPlayer - + diff --git a/docs/meico/audio/class-use/Audio.html b/docs/meico/audio/class-use/Audio.html index a99a325f..18902f9e 100644 --- a/docs/meico/audio/class-use/Audio.html +++ b/docs/meico/audio/class-use/Audio.html @@ -2,9 +2,9 @@ - + Uses of Class meico.audio.Audio - + diff --git a/docs/meico/audio/class-use/AudioPlayer.html b/docs/meico/audio/class-use/AudioPlayer.html index 2f255ece..b61110a3 100644 --- a/docs/meico/audio/class-use/AudioPlayer.html +++ b/docs/meico/audio/class-use/AudioPlayer.html @@ -2,9 +2,9 @@ - + Uses of Class meico.audio.AudioPlayer - + diff --git a/docs/meico/audio/package-frame.html b/docs/meico/audio/package-frame.html index 2bb06ce6..74a001a1 100644 --- a/docs/meico/audio/package-frame.html +++ b/docs/meico/audio/package-frame.html @@ -2,9 +2,9 @@ - + meico.audio - + diff --git a/docs/meico/audio/package-summary.html b/docs/meico/audio/package-summary.html index 71782c24..db4aceac 100644 --- a/docs/meico/audio/package-summary.html +++ b/docs/meico/audio/package-summary.html @@ -2,9 +2,9 @@ - + meico.audio - + diff --git a/docs/meico/audio/package-tree.html b/docs/meico/audio/package-tree.html index d422cf1a..a82b52cb 100644 --- a/docs/meico/audio/package-tree.html +++ b/docs/meico/audio/package-tree.html @@ -2,9 +2,9 @@ - + meico.audio Class Hierarchy - + diff --git a/docs/meico/audio/package-use.html b/docs/meico/audio/package-use.html index 5cb0eb4f..e92425ee 100644 --- a/docs/meico/audio/package-use.html +++ b/docs/meico/audio/package-use.html @@ -2,9 +2,9 @@ - + Uses of Package meico.audio - + diff --git a/docs/meico/class-use/Meico.html b/docs/meico/class-use/Meico.html index 839a4392..c203b1de 100644 --- a/docs/meico/class-use/Meico.html +++ b/docs/meico/class-use/Meico.html @@ -2,9 +2,9 @@ - + Uses of Class meico.Meico - + diff --git a/docs/meico/mei/Helper.html b/docs/meico/mei/Helper.html index ea4f8510..7fb13327 100644 --- a/docs/meico/mei/Helper.html +++ b/docs/meico/mei/Helper.html @@ -2,9 +2,9 @@ - + Helper - + diff --git a/docs/meico/mei/Mei.html b/docs/meico/mei/Mei.html index f3ac9a8a..111c81a1 100644 --- a/docs/meico/mei/Mei.html +++ b/docs/meico/mei/Mei.html @@ -2,9 +2,9 @@ - + Mei - + diff --git a/docs/meico/mei/class-use/Helper.html b/docs/meico/mei/class-use/Helper.html index 6a263f2c..e35d236e 100644 --- a/docs/meico/mei/class-use/Helper.html +++ b/docs/meico/mei/class-use/Helper.html @@ -2,9 +2,9 @@ - + Uses of Class meico.mei.Helper - + diff --git a/docs/meico/mei/class-use/Mei.html b/docs/meico/mei/class-use/Mei.html index dfa45a0f..9f04eceb 100644 --- a/docs/meico/mei/class-use/Mei.html +++ b/docs/meico/mei/class-use/Mei.html @@ -2,9 +2,9 @@ - + Uses of Class meico.mei.Mei - + diff --git a/docs/meico/mei/package-frame.html b/docs/meico/mei/package-frame.html index 238bc53e..de5edd66 100644 --- a/docs/meico/mei/package-frame.html +++ b/docs/meico/mei/package-frame.html @@ -2,9 +2,9 @@ - + meico.mei - + diff --git a/docs/meico/mei/package-summary.html b/docs/meico/mei/package-summary.html index 3a003f48..5b1ed3bb 100644 --- a/docs/meico/mei/package-summary.html +++ b/docs/meico/mei/package-summary.html @@ -2,9 +2,9 @@ - + meico.mei - + diff --git a/docs/meico/mei/package-tree.html b/docs/meico/mei/package-tree.html index a6aeeead..3859eb39 100644 --- a/docs/meico/mei/package-tree.html +++ b/docs/meico/mei/package-tree.html @@ -2,9 +2,9 @@ - + meico.mei Class Hierarchy - + diff --git a/docs/meico/mei/package-use.html b/docs/meico/mei/package-use.html index bdb1a7ab..b1e34cae 100644 --- a/docs/meico/mei/package-use.html +++ b/docs/meico/mei/package-use.html @@ -2,9 +2,9 @@ - + Uses of Package meico.mei - + diff --git a/docs/meico/midi/EventMaker.html b/docs/meico/midi/EventMaker.html index 7af572f7..e8381c7f 100644 --- a/docs/meico/midi/EventMaker.html +++ b/docs/meico/midi/EventMaker.html @@ -2,9 +2,9 @@ - + EventMaker - + diff --git a/docs/meico/midi/InstrumentsDictionary.html b/docs/meico/midi/InstrumentsDictionary.html index c10bbf1e..b1502b63 100644 --- a/docs/meico/midi/InstrumentsDictionary.html +++ b/docs/meico/midi/InstrumentsDictionary.html @@ -2,9 +2,9 @@ - + InstrumentsDictionary - + diff --git a/docs/meico/midi/Midi.html b/docs/meico/midi/Midi.html index b2567d2e..c09807b2 100644 --- a/docs/meico/midi/Midi.html +++ b/docs/meico/midi/Midi.html @@ -2,9 +2,9 @@ - + Midi - + diff --git a/docs/meico/midi/Midi2AudioRenderer.html b/docs/meico/midi/Midi2AudioRenderer.html index b9035512..61155748 100644 --- a/docs/meico/midi/Midi2AudioRenderer.html +++ b/docs/meico/midi/Midi2AudioRenderer.html @@ -2,9 +2,9 @@ - + Midi2AudioRenderer - + diff --git a/docs/meico/midi/Midi2MsmConverter.html b/docs/meico/midi/Midi2MsmConverter.html index 38491adc..12168bf9 100644 --- a/docs/meico/midi/Midi2MsmConverter.html +++ b/docs/meico/midi/Midi2MsmConverter.html @@ -2,9 +2,9 @@ - + Midi2MsmConverter - + diff --git a/docs/meico/midi/MidiPlayer.html b/docs/meico/midi/MidiPlayer.html index d822c422..7e2d570f 100644 --- a/docs/meico/midi/MidiPlayer.html +++ b/docs/meico/midi/MidiPlayer.html @@ -2,9 +2,9 @@ - + MidiPlayer - + diff --git a/docs/meico/midi/UnsupportedSoundbankException.html b/docs/meico/midi/UnsupportedSoundbankException.html index 9fbea0f6..de3adbfb 100644 --- a/docs/meico/midi/UnsupportedSoundbankException.html +++ b/docs/meico/midi/UnsupportedSoundbankException.html @@ -2,9 +2,9 @@ - + UnsupportedSoundbankException - + diff --git a/docs/meico/midi/class-use/EventMaker.html b/docs/meico/midi/class-use/EventMaker.html index 388d22c9..7d8461ec 100644 --- a/docs/meico/midi/class-use/EventMaker.html +++ b/docs/meico/midi/class-use/EventMaker.html @@ -2,9 +2,9 @@ - + Uses of Class meico.midi.EventMaker - + diff --git a/docs/meico/midi/class-use/InstrumentsDictionary.html b/docs/meico/midi/class-use/InstrumentsDictionary.html index 226fdd9e..b7b74026 100644 --- a/docs/meico/midi/class-use/InstrumentsDictionary.html +++ b/docs/meico/midi/class-use/InstrumentsDictionary.html @@ -2,9 +2,9 @@ - + Uses of Class meico.midi.InstrumentsDictionary - + diff --git a/docs/meico/midi/class-use/Midi.html b/docs/meico/midi/class-use/Midi.html index 18872d3e..39db7a18 100644 --- a/docs/meico/midi/class-use/Midi.html +++ b/docs/meico/midi/class-use/Midi.html @@ -2,9 +2,9 @@ - + Uses of Class meico.midi.Midi - + diff --git a/docs/meico/midi/class-use/Midi2AudioRenderer.html b/docs/meico/midi/class-use/Midi2AudioRenderer.html index 0f248232..774361aa 100644 --- a/docs/meico/midi/class-use/Midi2AudioRenderer.html +++ b/docs/meico/midi/class-use/Midi2AudioRenderer.html @@ -2,9 +2,9 @@ - + Uses of Class meico.midi.Midi2AudioRenderer - + diff --git a/docs/meico/midi/class-use/Midi2MsmConverter.html b/docs/meico/midi/class-use/Midi2MsmConverter.html index fd3ecb4b..f947182e 100644 --- a/docs/meico/midi/class-use/Midi2MsmConverter.html +++ b/docs/meico/midi/class-use/Midi2MsmConverter.html @@ -2,9 +2,9 @@ - + Uses of Class meico.midi.Midi2MsmConverter - + diff --git a/docs/meico/midi/class-use/MidiPlayer.html b/docs/meico/midi/class-use/MidiPlayer.html index e980d34f..a3047b31 100644 --- a/docs/meico/midi/class-use/MidiPlayer.html +++ b/docs/meico/midi/class-use/MidiPlayer.html @@ -2,9 +2,9 @@ - + Uses of Class meico.midi.MidiPlayer - + diff --git a/docs/meico/midi/class-use/UnsupportedSoundbankException.html b/docs/meico/midi/class-use/UnsupportedSoundbankException.html index 4df21240..038f1fd3 100644 --- a/docs/meico/midi/class-use/UnsupportedSoundbankException.html +++ b/docs/meico/midi/class-use/UnsupportedSoundbankException.html @@ -2,9 +2,9 @@ - + Uses of Class meico.midi.UnsupportedSoundbankException - + diff --git a/docs/meico/midi/legacy/Event.html b/docs/meico/midi/legacy/Event.html index dffab30d..25c85dfc 100644 --- a/docs/meico/midi/legacy/Event.html +++ b/docs/meico/midi/legacy/Event.html @@ -2,9 +2,9 @@ - + Event - + diff --git a/docs/meico/midi/legacy/MidiOld.html b/docs/meico/midi/legacy/MidiOld.html index d955e670..43eeae7d 100644 --- a/docs/meico/midi/legacy/MidiOld.html +++ b/docs/meico/midi/legacy/MidiOld.html @@ -2,9 +2,9 @@ - + MidiOld - + diff --git a/docs/meico/midi/legacy/TrackOld.html b/docs/meico/midi/legacy/TrackOld.html index 6642bd69..c184a457 100644 --- a/docs/meico/midi/legacy/TrackOld.html +++ b/docs/meico/midi/legacy/TrackOld.html @@ -2,9 +2,9 @@ - + TrackOld - + diff --git a/docs/meico/midi/legacy/class-use/Event.html b/docs/meico/midi/legacy/class-use/Event.html index bd1ea3c7..190ddf1d 100644 --- a/docs/meico/midi/legacy/class-use/Event.html +++ b/docs/meico/midi/legacy/class-use/Event.html @@ -2,9 +2,9 @@ - + Uses of Class meico.midi.legacy.Event - + diff --git a/docs/meico/midi/legacy/class-use/MidiOld.html b/docs/meico/midi/legacy/class-use/MidiOld.html index 418a2fdc..be3570a6 100644 --- a/docs/meico/midi/legacy/class-use/MidiOld.html +++ b/docs/meico/midi/legacy/class-use/MidiOld.html @@ -2,9 +2,9 @@ - + Uses of Class meico.midi.legacy.MidiOld - + diff --git a/docs/meico/midi/legacy/class-use/TrackOld.html b/docs/meico/midi/legacy/class-use/TrackOld.html index fc8f63e8..0deecaab 100644 --- a/docs/meico/midi/legacy/class-use/TrackOld.html +++ b/docs/meico/midi/legacy/class-use/TrackOld.html @@ -2,9 +2,9 @@ - + Uses of Class meico.midi.legacy.TrackOld - + diff --git a/docs/meico/midi/legacy/package-frame.html b/docs/meico/midi/legacy/package-frame.html index 62aa22f0..fe85a186 100644 --- a/docs/meico/midi/legacy/package-frame.html +++ b/docs/meico/midi/legacy/package-frame.html @@ -2,9 +2,9 @@ - + meico.midi.legacy - + diff --git a/docs/meico/midi/legacy/package-summary.html b/docs/meico/midi/legacy/package-summary.html index b9d6e230..4a79847c 100644 --- a/docs/meico/midi/legacy/package-summary.html +++ b/docs/meico/midi/legacy/package-summary.html @@ -2,9 +2,9 @@ - + meico.midi.legacy - + diff --git a/docs/meico/midi/legacy/package-tree.html b/docs/meico/midi/legacy/package-tree.html index d08f896b..0c1f812f 100644 --- a/docs/meico/midi/legacy/package-tree.html +++ b/docs/meico/midi/legacy/package-tree.html @@ -2,9 +2,9 @@ - + meico.midi.legacy Class Hierarchy - + diff --git a/docs/meico/midi/legacy/package-use.html b/docs/meico/midi/legacy/package-use.html index 912e1529..118dfd0b 100644 --- a/docs/meico/midi/legacy/package-use.html +++ b/docs/meico/midi/legacy/package-use.html @@ -2,9 +2,9 @@ - + Uses of Package meico.midi.legacy - + diff --git a/docs/meico/midi/package-frame.html b/docs/meico/midi/package-frame.html index 790486c3..38529481 100644 --- a/docs/meico/midi/package-frame.html +++ b/docs/meico/midi/package-frame.html @@ -2,9 +2,9 @@ - + meico.midi - + diff --git a/docs/meico/midi/package-summary.html b/docs/meico/midi/package-summary.html index 3e90249f..3f4272a5 100644 --- a/docs/meico/midi/package-summary.html +++ b/docs/meico/midi/package-summary.html @@ -2,9 +2,9 @@ - + meico.midi - + diff --git a/docs/meico/midi/package-tree.html b/docs/meico/midi/package-tree.html index 66f73359..3c7172ed 100644 --- a/docs/meico/midi/package-tree.html +++ b/docs/meico/midi/package-tree.html @@ -2,9 +2,9 @@ - + meico.midi Class Hierarchy - + diff --git a/docs/meico/midi/package-use.html b/docs/meico/midi/package-use.html index 7f7896ee..becc6d14 100644 --- a/docs/meico/midi/package-use.html +++ b/docs/meico/midi/package-use.html @@ -2,9 +2,9 @@ - + Uses of Package meico.midi - + diff --git a/docs/meico/mpm/Mpm.html b/docs/meico/mpm/Mpm.html index 01c26890..0ae80e01 100644 --- a/docs/meico/mpm/Mpm.html +++ b/docs/meico/mpm/Mpm.html @@ -2,9 +2,9 @@ - + Mpm - + @@ -251,7 +251,7 @@

    Constructor Summary

    Mpm() -
    constructor
    +
    Constructor.
    @@ -312,13 +312,14 @@

    Method Summary

    boolean -addMetadata(Author author, - java.lang.String comment) +addMetadata(Author author, + Comment comment, + java.util.Collection<RelatedResource> relatedResources)
    add metadata to the MPM
    -void +boolean addPerformance(Performance performance)
    add a performance to this mpm, but caution: if another performance with the same name exists already in this mpm, accessing it via getPerformance(name) will return only the first in the list
    @@ -332,7 +333,7 @@

    Method Summary

    static Mpm createMpm() -
    an Mpm factory
    +
    An Mpm factory.
    @@ -723,7 +724,7 @@

    Constructor Detail

  • Mpm

    public Mpm()
    -
    constructor
    +
    Constructor. Be aware that this is not a valid MPM document until a first Performance has been added!
  • @@ -889,7 +890,7 @@

    Method Detail

  • createMpm

    public static Mpm createMpm()
    -
    an Mpm factory
    +
    An Mpm factory. Be aware that this is not a valid MPM document until a first Performance has been added!
    Returns:
    @@ -919,19 +920,20 @@

    init

  • - + + + + + diff --git a/docs/meico/mpm/elements/Global.html b/docs/meico/mpm/elements/Global.html index b71c5def..079d2a95 100644 --- a/docs/meico/mpm/elements/Global.html +++ b/docs/meico/mpm/elements/Global.html @@ -2,9 +2,9 @@ - + Global - + diff --git a/docs/meico/mpm/elements/Header.html b/docs/meico/mpm/elements/Header.html index fb719e4e..22aef2f0 100644 --- a/docs/meico/mpm/elements/Header.html +++ b/docs/meico/mpm/elements/Header.html @@ -2,9 +2,9 @@ - + Header - + @@ -18,7 +18,7 @@ catch(err) { } //--> -var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":9,"i5":9,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10}; +var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":9,"i6":9,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10}; var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; @@ -214,55 +214,69 @@

    Method Summary

    +void +clear() +
    remove all style collections of the header
    + + + static Header createHeader()
    header factory
    - + static Header createHeader(nu.xom.Element xml)
    header factory
    - + java.util.HashMap<java.lang.String,GenericStyle> getAllStyleDefs(java.lang.String type)
    access all style definitions of the specified type
    - + java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,GenericStyle>> getAllStyleTypes()
    access all style types and their subsequent style definitions
    - + GenericStyle getStyleDef(java.lang.String type, java.lang.String name)
    access the specified styleDef
    - + protected void parseData(nu.xom.Element xml)
    set the data of this object, this parses the xml element and generates the according data structure
    - + void removeStyleDef(java.lang.String type, java.lang.String name)
    remove the specified styleDef from the specified collection of styleDefs (style type)
    - + void removeStyleType(java.lang.String type)
    remove a style type
    + +GenericStyle +renameStyleDef(java.lang.String type, + java.lang.String currentName, + java.lang.String newName) +
    Rename a styleDef.
    + + + + + + @@ -659,7 +717,7 @@

    setGlobal

    - diff --git a/docs/meico/mpm/elements/Performance.html b/docs/meico/mpm/elements/Performance.html index 10250136..d96e53be 100644 --- a/docs/meico/mpm/elements/Performance.html +++ b/docs/meico/mpm/elements/Performance.html @@ -2,9 +2,9 @@ - + Performance - + @@ -18,7 +18,7 @@ catch(err) { } //--> -var methods = {"i0":9,"i1":10,"i2":9,"i3":9,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10}; +var methods = {"i0":9,"i1":10,"i2":9,"i3":9,"i4":9,"i5":9,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10}; var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; @@ -145,13 +145,17 @@

    Field Summary

    private nu.xom.Attribute -name  +id  +private nu.xom.Attribute +name  + + private java.util.ArrayList<Part> parts  - + private int pulsesPerQuarter  @@ -207,7 +211,7 @@

    Method Summary

    -void +boolean addPart(Part part)
    add the part to the performance, caution: if another part with the same number exists already in this performance, getPart(number) will return only the first
    @@ -226,30 +230,51 @@

    Method Summary

    +static Performance +createPerformance(java.lang.String name, + int pulsesPerQuarter) +
    performance factory
    + + + +static Performance +createPerformance(java.lang.String name, + int pulsesPerQuarter, + java.lang.String id) +
    performance factory
    + + + java.util.ArrayList<Part> getAllParts()
    this returns all parts in this performance as an ArrayList
    - + Global getGlobal()
    access the global information of this performance
    - + +java.lang.String +getId() +
    get the performance's id
    + + + java.lang.String getName()
    a getter for the performance's name
    - + Part getPart(int number)
    Access the part with the specified number.
    - + Part getPart(int midiChannel, int midiPort) @@ -257,81 +282,87 @@

    Method Summary

    If there are more than one part with this channel and port (which is bad practise!) - + Part getPart(java.lang.String name)
    Access the part with the specified name.
    - + int getPPQ()
    read the pulses per quarter timing resolution (relevant for to interpret midi.date values)
    - + int getPulsesPerQuarter()
    read the pulses per quarter timing resolution (relevant for to interpret midi.date values)
    - + protected void parseData(nu.xom.Element xml)
    set the data of this performance, this parses the xml element and generates the according data structure
    - + Msm perform(Midi midi)
    this generates an Msm object from the input midi data and adds expression data (such as millisecond dates, durations, and velocity values) to it; performance rendering will keep MIDI compliance
    - + Msm perform(Msm msm)
    this add expression data (such as millisecond dates, durations, and velocity values) to the specified MSM
    - + void removePart(int number)
    remove all parts with the specified number from this performance
    - + void removePart(Part part)
    remove the specified part from this performance
    - + void removePart(java.lang.String name)
    remove all parts with the specified name from this performance
    - + +void +setId(java.lang.String id) +
    set the performance's id
    + + + void setName(java.lang.String name)
    set the performance's name, if the performance is already part of an mpm it should be removed and re-added to make sure that it can be found under the new name
    - + void setPPQ(int ppq)
    Set the pulses per quarter timing resolution attribute.
    - + void setPulsesPerQuarter(int ppq)
    Set the pulses per quarter timing resolution attribute.
    - + int size()
    get the number of parts in this performance
    @@ -396,12 +427,21 @@

    global

    - @@ -467,6 +507,42 @@

    createPerformance

    + + + + + + + + @@ -583,12 +659,14 @@

    getPart

    @@ -767,7 +845,7 @@

    perform

    - diff --git a/docs/meico/mpm/elements/class-use/Dated.html b/docs/meico/mpm/elements/class-use/Dated.html index 1d4cbc25..0b9cf2c9 100644 --- a/docs/meico/mpm/elements/class-use/Dated.html +++ b/docs/meico/mpm/elements/class-use/Dated.html @@ -2,9 +2,9 @@ - + Uses of Class meico.mpm.elements.Dated - + @@ -104,11 +104,11 @@

    Uses of private Dated -Part.dated  +Global.dated  private Dated -Global.dated  +Part.dated  @@ -133,13 +133,13 @@

    Uses of Dated -Part.getDated() +Global.getDated()
    access the dated environment
    Dated -Global.getDated() +Part.getDated()
    access the dated environment
    diff --git a/docs/meico/mpm/elements/class-use/Global.html b/docs/meico/mpm/elements/class-use/Global.html index e8c311af..209d6622 100644 --- a/docs/meico/mpm/elements/class-use/Global.html +++ b/docs/meico/mpm/elements/class-use/Global.html @@ -2,9 +2,9 @@ - + Uses of Class meico.mpm.elements.Global - + @@ -104,15 +104,15 @@

    Uses of private Global -Performance.global  +Dated.global  private Global -Part.global  +Performance.global  private Global -Dated.global  +Part.global  @@ -137,20 +137,20 @@

    Uses of Global -Performance.getGlobal() -
    access the global information of this performance
    +Dated.getGlobal() +
    get this dated's link to the global environment
    Global -Part.getGlobal() -
    access the global environment that this part links to
    +Performance.getGlobal() +
    access the global information of this performance
    Global -Dated.getGlobal() -
    get this dated's link to the global environment
    +Part.getGlobal() +
    access the global environment that this part links to
    diff --git a/docs/meico/mpm/elements/class-use/Header.html b/docs/meico/mpm/elements/class-use/Header.html index 9b64a50e..7214f999 100644 --- a/docs/meico/mpm/elements/class-use/Header.html +++ b/docs/meico/mpm/elements/class-use/Header.html @@ -2,9 +2,9 @@ - + Uses of Class meico.mpm.elements.Header - + @@ -108,11 +108,11 @@

    Uses of private Header -Part.header  +Global.header  private Header -Global.header  +Part.header  @@ -137,13 +137,13 @@

    Uses of Header -Part.getHeader() +Global.getHeader()
    access the header environment
    Header -Global.getHeader() +Part.getHeader()
    access the header environment
    diff --git a/docs/meico/mpm/elements/class-use/Part.html b/docs/meico/mpm/elements/class-use/Part.html index 91f4367e..32196387 100644 --- a/docs/meico/mpm/elements/class-use/Part.html +++ b/docs/meico/mpm/elements/class-use/Part.html @@ -2,9 +2,9 @@ - + Uses of Class meico.mpm.elements.Part - + @@ -144,18 +144,28 @@

    Uses of +static Part +Part.createPart(java.lang.String name, + int number, + int midiChannel, + int midiPort, + java.lang.String id) +
    part factory
    + + + Part Dated.getPart()
    get this dated's link to the local environment
    - + Part Performance.getPart(int number)
    Access the part with the specified number.
    - + Part Performance.getPart(int midiChannel, int midiPort) @@ -163,7 +173,7 @@

    Uses of + Part Performance.getPart(java.lang.String name)
    Access the part with the specified name.
    @@ -194,7 +204,7 @@

    Uses of -void +boolean Performance.addPart(Part part)
    add the part to the performance, caution: if another part with the same number exists already in this performance, getPart(number) will return only the first
    diff --git a/docs/meico/mpm/elements/class-use/Performance.html b/docs/meico/mpm/elements/class-use/Performance.html index 120f2d0e..4bfb7ba0 100644 --- a/docs/meico/mpm/elements/class-use/Performance.html +++ b/docs/meico/mpm/elements/class-use/Performance.html @@ -2,9 +2,9 @@ - + Uses of Class meico.mpm.elements.Performance - + @@ -188,7 +188,7 @@

    Uses of -void +boolean Mpm.addPerformance(Performance performance)
    add a performance to this mpm, but caution: if another performance with the same name exists already in this mpm, accessing it via getPerformance(name) will return only the first in the list
    @@ -225,6 +225,21 @@

    Uses of performance factory + +static Performance +Performance.createPerformance(java.lang.String name, + int pulsesPerQuarter) +
    performance factory
    + + + +static Performance +Performance.createPerformance(java.lang.String name, + int pulsesPerQuarter, + java.lang.String id) +
    performance factory
    + + diff --git a/docs/meico/mpm/elements/maps/ArticulationMap.html b/docs/meico/mpm/elements/maps/ArticulationMap.html index 546bd9bb..fb51725c 100644 --- a/docs/meico/mpm/elements/maps/ArticulationMap.html +++ b/docs/meico/mpm/elements/maps/ArticulationMap.html @@ -2,9 +2,9 @@ - + ArticulationMap - + diff --git a/docs/meico/mpm/elements/maps/AsynchronyMap.html b/docs/meico/mpm/elements/maps/AsynchronyMap.html index bc1cadf4..2ae53cb3 100644 --- a/docs/meico/mpm/elements/maps/AsynchronyMap.html +++ b/docs/meico/mpm/elements/maps/AsynchronyMap.html @@ -2,9 +2,9 @@ - + AsynchronyMap - + diff --git a/docs/meico/mpm/elements/maps/DynamicsMap.html b/docs/meico/mpm/elements/maps/DynamicsMap.html index 759d79d0..8cee6fbc 100644 --- a/docs/meico/mpm/elements/maps/DynamicsMap.html +++ b/docs/meico/mpm/elements/maps/DynamicsMap.html @@ -2,9 +2,9 @@ - + DynamicsMap - + diff --git a/docs/meico/mpm/elements/maps/GenericMap.html b/docs/meico/mpm/elements/maps/GenericMap.html index cc7ff0a5..0972e5cf 100644 --- a/docs/meico/mpm/elements/maps/GenericMap.html +++ b/docs/meico/mpm/elements/maps/GenericMap.html @@ -2,9 +2,9 @@ - + GenericMap - + diff --git a/docs/meico/mpm/elements/maps/ImprecisionMap.html b/docs/meico/mpm/elements/maps/ImprecisionMap.html index dcb04df3..3268e1f0 100644 --- a/docs/meico/mpm/elements/maps/ImprecisionMap.html +++ b/docs/meico/mpm/elements/maps/ImprecisionMap.html @@ -2,9 +2,9 @@ - + ImprecisionMap - + diff --git a/docs/meico/mpm/elements/maps/MetricalAccentuationMap.html b/docs/meico/mpm/elements/maps/MetricalAccentuationMap.html index b4741afc..11a63267 100644 --- a/docs/meico/mpm/elements/maps/MetricalAccentuationMap.html +++ b/docs/meico/mpm/elements/maps/MetricalAccentuationMap.html @@ -2,9 +2,9 @@ - + MetricalAccentuationMap - + diff --git a/docs/meico/mpm/elements/maps/OrnamentationMap.html b/docs/meico/mpm/elements/maps/OrnamentationMap.html index af007152..c6246c0d 100644 --- a/docs/meico/mpm/elements/maps/OrnamentationMap.html +++ b/docs/meico/mpm/elements/maps/OrnamentationMap.html @@ -2,9 +2,9 @@ - + OrnamentationMap - + diff --git a/docs/meico/mpm/elements/maps/RubatoMap.html b/docs/meico/mpm/elements/maps/RubatoMap.html index e0139bf9..288296d3 100644 --- a/docs/meico/mpm/elements/maps/RubatoMap.html +++ b/docs/meico/mpm/elements/maps/RubatoMap.html @@ -2,9 +2,9 @@ - + RubatoMap - + diff --git a/docs/meico/mpm/elements/maps/TempoMap.html b/docs/meico/mpm/elements/maps/TempoMap.html index 9a632417..09958675 100644 --- a/docs/meico/mpm/elements/maps/TempoMap.html +++ b/docs/meico/mpm/elements/maps/TempoMap.html @@ -2,9 +2,9 @@ - + TempoMap - + diff --git a/docs/meico/mpm/elements/maps/class-use/ArticulationMap.html b/docs/meico/mpm/elements/maps/class-use/ArticulationMap.html index ed93ec8f..d892384f 100644 --- a/docs/meico/mpm/elements/maps/class-use/ArticulationMap.html +++ b/docs/meico/mpm/elements/maps/class-use/ArticulationMap.html @@ -2,9 +2,9 @@ - + Uses of Class meico.mpm.elements.maps.ArticulationMap - + diff --git a/docs/meico/mpm/elements/maps/class-use/AsynchronyMap.html b/docs/meico/mpm/elements/maps/class-use/AsynchronyMap.html index fb2b7ca7..60c64fa7 100644 --- a/docs/meico/mpm/elements/maps/class-use/AsynchronyMap.html +++ b/docs/meico/mpm/elements/maps/class-use/AsynchronyMap.html @@ -2,9 +2,9 @@ - + Uses of Class meico.mpm.elements.maps.AsynchronyMap - + diff --git a/docs/meico/mpm/elements/maps/class-use/DynamicsMap.html b/docs/meico/mpm/elements/maps/class-use/DynamicsMap.html index d112f537..5b4c097f 100644 --- a/docs/meico/mpm/elements/maps/class-use/DynamicsMap.html +++ b/docs/meico/mpm/elements/maps/class-use/DynamicsMap.html @@ -2,9 +2,9 @@ - + Uses of Class meico.mpm.elements.maps.DynamicsMap - + diff --git a/docs/meico/mpm/elements/maps/class-use/GenericMap.html b/docs/meico/mpm/elements/maps/class-use/GenericMap.html index fd6518a0..8ea7535e 100644 --- a/docs/meico/mpm/elements/maps/class-use/GenericMap.html +++ b/docs/meico/mpm/elements/maps/class-use/GenericMap.html @@ -2,9 +2,9 @@ - + Uses of Class meico.mpm.elements.maps.GenericMap - + diff --git a/docs/meico/mpm/elements/maps/class-use/ImprecisionMap.html b/docs/meico/mpm/elements/maps/class-use/ImprecisionMap.html index 1eaf822a..fb9d8fb8 100644 --- a/docs/meico/mpm/elements/maps/class-use/ImprecisionMap.html +++ b/docs/meico/mpm/elements/maps/class-use/ImprecisionMap.html @@ -2,9 +2,9 @@ - + Uses of Class meico.mpm.elements.maps.ImprecisionMap - + diff --git a/docs/meico/mpm/elements/maps/class-use/MetricalAccentuationMap.html b/docs/meico/mpm/elements/maps/class-use/MetricalAccentuationMap.html index 8a88def9..e1683a22 100644 --- a/docs/meico/mpm/elements/maps/class-use/MetricalAccentuationMap.html +++ b/docs/meico/mpm/elements/maps/class-use/MetricalAccentuationMap.html @@ -2,9 +2,9 @@ - + Uses of Class meico.mpm.elements.maps.MetricalAccentuationMap - + diff --git a/docs/meico/mpm/elements/maps/class-use/OrnamentationMap.html b/docs/meico/mpm/elements/maps/class-use/OrnamentationMap.html index 9359ef39..20030e85 100644 --- a/docs/meico/mpm/elements/maps/class-use/OrnamentationMap.html +++ b/docs/meico/mpm/elements/maps/class-use/OrnamentationMap.html @@ -2,9 +2,9 @@ - + Uses of Class meico.mpm.elements.maps.OrnamentationMap - + diff --git a/docs/meico/mpm/elements/maps/class-use/RubatoMap.html b/docs/meico/mpm/elements/maps/class-use/RubatoMap.html index 133740aa..ce43e539 100644 --- a/docs/meico/mpm/elements/maps/class-use/RubatoMap.html +++ b/docs/meico/mpm/elements/maps/class-use/RubatoMap.html @@ -2,9 +2,9 @@ - + Uses of Class meico.mpm.elements.maps.RubatoMap - + diff --git a/docs/meico/mpm/elements/maps/class-use/TempoMap.html b/docs/meico/mpm/elements/maps/class-use/TempoMap.html index bdf69590..5b4d6bf9 100644 --- a/docs/meico/mpm/elements/maps/class-use/TempoMap.html +++ b/docs/meico/mpm/elements/maps/class-use/TempoMap.html @@ -2,9 +2,9 @@ - + Uses of Class meico.mpm.elements.maps.TempoMap - + diff --git a/docs/meico/mpm/elements/maps/data/ArticulationData.html b/docs/meico/mpm/elements/maps/data/ArticulationData.html index f06b23ff..40caa790 100644 --- a/docs/meico/mpm/elements/maps/data/ArticulationData.html +++ b/docs/meico/mpm/elements/maps/data/ArticulationData.html @@ -2,9 +2,9 @@ - + ArticulationData - + diff --git a/docs/meico/mpm/elements/maps/data/DistributionData.html b/docs/meico/mpm/elements/maps/data/DistributionData.html index 98c085ec..450864df 100644 --- a/docs/meico/mpm/elements/maps/data/DistributionData.html +++ b/docs/meico/mpm/elements/maps/data/DistributionData.html @@ -2,9 +2,9 @@ - + DistributionData - + diff --git a/docs/meico/mpm/elements/maps/data/DynamicsData.html b/docs/meico/mpm/elements/maps/data/DynamicsData.html index 6daca1d4..3f90dd0d 100644 --- a/docs/meico/mpm/elements/maps/data/DynamicsData.html +++ b/docs/meico/mpm/elements/maps/data/DynamicsData.html @@ -2,9 +2,9 @@ - + DynamicsData - + diff --git a/docs/meico/mpm/elements/maps/data/MetricalAccentuationData.html b/docs/meico/mpm/elements/maps/data/MetricalAccentuationData.html index 4a3c27c7..851ed447 100644 --- a/docs/meico/mpm/elements/maps/data/MetricalAccentuationData.html +++ b/docs/meico/mpm/elements/maps/data/MetricalAccentuationData.html @@ -2,9 +2,9 @@ - + MetricalAccentuationData - + diff --git a/docs/meico/mpm/elements/maps/data/RubatoData.html b/docs/meico/mpm/elements/maps/data/RubatoData.html index 41988a1b..5ee13df0 100644 --- a/docs/meico/mpm/elements/maps/data/RubatoData.html +++ b/docs/meico/mpm/elements/maps/data/RubatoData.html @@ -2,9 +2,9 @@ - + RubatoData - + diff --git a/docs/meico/mpm/elements/maps/data/TempoData.html b/docs/meico/mpm/elements/maps/data/TempoData.html index baecb325..81704eac 100644 --- a/docs/meico/mpm/elements/maps/data/TempoData.html +++ b/docs/meico/mpm/elements/maps/data/TempoData.html @@ -2,9 +2,9 @@ - + TempoData - + diff --git a/docs/meico/mpm/elements/maps/data/class-use/ArticulationData.html b/docs/meico/mpm/elements/maps/data/class-use/ArticulationData.html index 8764c2a1..7c2816f0 100644 --- a/docs/meico/mpm/elements/maps/data/class-use/ArticulationData.html +++ b/docs/meico/mpm/elements/maps/data/class-use/ArticulationData.html @@ -2,9 +2,9 @@ - + Uses of Class meico.mpm.elements.maps.data.ArticulationData - + diff --git a/docs/meico/mpm/elements/maps/data/class-use/DistributionData.html b/docs/meico/mpm/elements/maps/data/class-use/DistributionData.html index f7534282..76dedcc6 100644 --- a/docs/meico/mpm/elements/maps/data/class-use/DistributionData.html +++ b/docs/meico/mpm/elements/maps/data/class-use/DistributionData.html @@ -2,9 +2,9 @@ - + Uses of Class meico.mpm.elements.maps.data.DistributionData - + diff --git a/docs/meico/mpm/elements/maps/data/class-use/DynamicsData.html b/docs/meico/mpm/elements/maps/data/class-use/DynamicsData.html index d48b778c..d9f48075 100644 --- a/docs/meico/mpm/elements/maps/data/class-use/DynamicsData.html +++ b/docs/meico/mpm/elements/maps/data/class-use/DynamicsData.html @@ -2,9 +2,9 @@ - + Uses of Class meico.mpm.elements.maps.data.DynamicsData - + diff --git a/docs/meico/mpm/elements/maps/data/class-use/MetricalAccentuationData.html b/docs/meico/mpm/elements/maps/data/class-use/MetricalAccentuationData.html index 37d22ee4..1d32bd84 100644 --- a/docs/meico/mpm/elements/maps/data/class-use/MetricalAccentuationData.html +++ b/docs/meico/mpm/elements/maps/data/class-use/MetricalAccentuationData.html @@ -2,9 +2,9 @@ - + Uses of Class meico.mpm.elements.maps.data.MetricalAccentuationData - + diff --git a/docs/meico/mpm/elements/maps/data/class-use/RubatoData.html b/docs/meico/mpm/elements/maps/data/class-use/RubatoData.html index bbb54535..debc3888 100644 --- a/docs/meico/mpm/elements/maps/data/class-use/RubatoData.html +++ b/docs/meico/mpm/elements/maps/data/class-use/RubatoData.html @@ -2,9 +2,9 @@ - + Uses of Class meico.mpm.elements.maps.data.RubatoData - + diff --git a/docs/meico/mpm/elements/maps/data/class-use/TempoData.html b/docs/meico/mpm/elements/maps/data/class-use/TempoData.html index 6ab0b345..2e22fd4e 100644 --- a/docs/meico/mpm/elements/maps/data/class-use/TempoData.html +++ b/docs/meico/mpm/elements/maps/data/class-use/TempoData.html @@ -2,9 +2,9 @@ - + Uses of Class meico.mpm.elements.maps.data.TempoData - + diff --git a/docs/meico/mpm/elements/maps/data/package-frame.html b/docs/meico/mpm/elements/maps/data/package-frame.html index 9abe699a..373a1403 100644 --- a/docs/meico/mpm/elements/maps/data/package-frame.html +++ b/docs/meico/mpm/elements/maps/data/package-frame.html @@ -2,9 +2,9 @@ - + meico.mpm.elements.maps.data - + diff --git a/docs/meico/mpm/elements/maps/data/package-summary.html b/docs/meico/mpm/elements/maps/data/package-summary.html index cdc2488b..85f1773f 100644 --- a/docs/meico/mpm/elements/maps/data/package-summary.html +++ b/docs/meico/mpm/elements/maps/data/package-summary.html @@ -2,9 +2,9 @@ - + meico.mpm.elements.maps.data - + diff --git a/docs/meico/mpm/elements/maps/data/package-tree.html b/docs/meico/mpm/elements/maps/data/package-tree.html index f10d2442..176884b6 100644 --- a/docs/meico/mpm/elements/maps/data/package-tree.html +++ b/docs/meico/mpm/elements/maps/data/package-tree.html @@ -2,9 +2,9 @@ - + meico.mpm.elements.maps.data Class Hierarchy - + diff --git a/docs/meico/mpm/elements/maps/data/package-use.html b/docs/meico/mpm/elements/maps/data/package-use.html index 3854d418..9956e1d8 100644 --- a/docs/meico/mpm/elements/maps/data/package-use.html +++ b/docs/meico/mpm/elements/maps/data/package-use.html @@ -2,9 +2,9 @@ - + Uses of Package meico.mpm.elements.maps.data - + diff --git a/docs/meico/mpm/elements/maps/package-frame.html b/docs/meico/mpm/elements/maps/package-frame.html index 10fe4467..253153f3 100644 --- a/docs/meico/mpm/elements/maps/package-frame.html +++ b/docs/meico/mpm/elements/maps/package-frame.html @@ -2,9 +2,9 @@ - + meico.mpm.elements.maps - + diff --git a/docs/meico/mpm/elements/maps/package-summary.html b/docs/meico/mpm/elements/maps/package-summary.html index 40fe4e29..e5eab29c 100644 --- a/docs/meico/mpm/elements/maps/package-summary.html +++ b/docs/meico/mpm/elements/maps/package-summary.html @@ -2,9 +2,9 @@ - + meico.mpm.elements.maps - + diff --git a/docs/meico/mpm/elements/maps/package-tree.html b/docs/meico/mpm/elements/maps/package-tree.html index 01bee988..910febbf 100644 --- a/docs/meico/mpm/elements/maps/package-tree.html +++ b/docs/meico/mpm/elements/maps/package-tree.html @@ -2,9 +2,9 @@ - + meico.mpm.elements.maps Class Hierarchy - + diff --git a/docs/meico/mpm/elements/maps/package-use.html b/docs/meico/mpm/elements/maps/package-use.html index c641a3db..b9364ad4 100644 --- a/docs/meico/mpm/elements/maps/package-use.html +++ b/docs/meico/mpm/elements/maps/package-use.html @@ -2,9 +2,9 @@ - + Uses of Package meico.mpm.elements.maps - + diff --git a/docs/meico/mpm/elements/metadata/Author.html b/docs/meico/mpm/elements/metadata/Author.html index be68df48..c52319fb 100644 --- a/docs/meico/mpm/elements/metadata/Author.html +++ b/docs/meico/mpm/elements/metadata/Author.html @@ -2,9 +2,9 @@ - + Author - + @@ -50,7 +50,7 @@ + +static RubatoStyle +RubatoStyle.createRubatoStyle(java.lang.String name, + java.lang.String id) +
    RubatoStyle factory
    + + diff --git a/docs/meico/mpm/elements/styles/class-use/TempoStyle.html b/docs/meico/mpm/elements/styles/class-use/TempoStyle.html index a1fb2a72..20225650 100644 --- a/docs/meico/mpm/elements/styles/class-use/TempoStyle.html +++ b/docs/meico/mpm/elements/styles/class-use/TempoStyle.html @@ -2,9 +2,9 @@ - + Uses of Class meico.mpm.elements.styles.TempoStyle - + @@ -136,6 +136,13 @@

    Uses of TempoStyle factory + +static TempoStyle +TempoStyle.createTempoStyle(java.lang.String name, + java.lang.String id) +
    TempoStyle factory
    + + diff --git a/docs/meico/mpm/elements/styles/defs/AbstractDef.html b/docs/meico/mpm/elements/styles/defs/AbstractDef.html index 4f49e708..cbcbbfaf 100644 --- a/docs/meico/mpm/elements/styles/defs/AbstractDef.html +++ b/docs/meico/mpm/elements/styles/defs/AbstractDef.html @@ -2,9 +2,9 @@ - +AbstractDef - + @@ -18,7 +18,7 @@ catch(err) { } //--> -var methods = {"i0":10,"i1":10}; +var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; @@ -144,6 +144,10 @@

    Field Summary

    + + + + @@ -181,11 +185,29 @@

    Method Summary

    + + + + - + + + + + + + + + + + + + - + - + - + - + + + + + - + - + - + - + - - - - - + - + - + - + + + + + - @@ -227,7 +228,8 @@

    Method Summary

    - @@ -321,7 +323,7 @@

    Method Summary

    Methods inherited from class meico.mpm.elements.styles.defs.AbstractDef

    -getName, setName +getId, getName, setId, setName
    • @@ -395,18 +397,20 @@

      earlyEnd

      Constructor Detail

      - +
      • RubatoDef

        -
        private RubatoDef(java.lang.String name)
        +
        private RubatoDef(java.lang.String name,
        +                  double frameLength)
                    throws java.lang.Exception
        constructor, creates an empty rubatoDef
        Parameters:
        name -
        +
        frameLength -
        Throws:
        java.lang.Exception
        @@ -462,13 +466,14 @@

        RubatoDef

        Method Detail

        - +
        • createRubatoDef

          -
          public static RubatoDef createRubatoDef(java.lang.String name)
          +
          public static RubatoDef createRubatoDef(java.lang.String name,
          +                                        double frameLength)
          RubatoDef factory
          Parameters:
          @@ -525,8 +530,8 @@

          parseData

          throws java.lang.Exception
        set the data of this object, this parses the xml element and generates the according data structure
        -
        Specified by:
        -
        parseData in class AbstractXmlSubtree
        +
        Overrides:
        +
        parseData in class AbstractDef
        Parameters:
        xml -
        Throws:
        diff --git a/docs/meico/mpm/elements/styles/defs/TempoDef.html b/docs/meico/mpm/elements/styles/defs/TempoDef.html index 78fd3356..d729413d 100644 --- a/docs/meico/mpm/elements/styles/defs/TempoDef.html +++ b/docs/meico/mpm/elements/styles/defs/TempoDef.html @@ -2,9 +2,9 @@ - + TempoDef - + @@ -248,7 +248,7 @@

        Method Summary

        Methods inherited from class meico.mpm.elements.styles.defs.AbstractDef

        -getName, setName
      • +getId, getName, setId, setName
    + + + @@ -91,6 +95,26 @@

    Field and Description
    private nu.xom.Attributeid 
    protected nu.xom.Attribute name 
    java.lang.StringgetId() +
    get the part's id
    +
    java.lang.String getName()
    get the name of the rubatoDef
    protected voidparseData(nu.xom.Element xml) +
    set the data of this object, this parses the xml element and generates the according data structure
    +
    voidsetId(java.lang.String id) +
    set the part's id
    +
    protected void setName(java.lang.String name)
    set the name of the rubatoDef
    @@ -197,7 +219,7 @@

    Method Summary

    Methods inherited from class meico.xml.AbstractXmlSubtree

    -getXml, parseData, setXml, toXml +getXml, setXml, toXml
    • @@ -223,12 +245,21 @@

      Field Detail

      -
        +
        • name

          protected nu.xom.Attribute name
        + + + +
          +
        • +

          id

          +
          private nu.xom.Attribute id
          +
        • +
      @@ -254,6 +285,24 @@

      AbstractDef

      Method Detail

      + + + +
        +
      • +

        parseData

        +
        protected void parseData(nu.xom.Element xml)
        +                  throws java.lang.Exception
        +
        Description copied from class: AbstractXmlSubtree
        +
        set the data of this object, this parses the xml element and generates the according data structure
        +
        +
        Specified by:
        +
        parseData in class AbstractXmlSubtree
        +
        Throws:
        +
        java.lang.Exception
        +
        +
      • +
      @@ -270,7 +319,7 @@

      getName

      -
        +
        • setName

          protected void setName(java.lang.String name)
          @@ -281,6 +330,34 @@

          setName

        + + + +
          +
        • +

          setId

          +
          public void setId(java.lang.String id)
          +
          set the part's id
          +
          +
          Parameters:
          +
          id - a xml:id string or null
          +
          +
        • +
        + + + +
          +
        • +

          getId

          +
          public java.lang.String getId()
          +
          get the part's id
          +
          +
          Returns:
          +
          a string or null
          +
          +
        • +
    • diff --git a/docs/meico/mpm/elements/styles/defs/AccentuationPatternDef.html b/docs/meico/mpm/elements/styles/defs/AccentuationPatternDef.html index 01c12869..3a0d270d 100644 --- a/docs/meico/mpm/elements/styles/defs/AccentuationPatternDef.html +++ b/docs/meico/mpm/elements/styles/defs/AccentuationPatternDef.html @@ -2,9 +2,9 @@ - + AccentuationPatternDef - + @@ -18,7 +18,7 @@ catch(err) { } //--> -var methods = {"i0":10,"i1":10,"i2":10,"i3":9,"i4":9,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10}; +var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":9,"i5":9,"i6":9,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10}; var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; @@ -213,85 +213,103 @@

      Method Summary

    intaddAccentuation(double beat, + double value, + double transitionFrom, + double transitionTo, + java.lang.String id) +
    create and add an accentuation to this accentuationPatternDef
    +
    int addAccentuation(nu.xom.Element xml)
    add a given xml representation of an MPM accentuation element to this accentuationPatternDef
    private int addAccentuationToArrayList(double[] accentuation, nu.xom.Element xml)
    add the accentuation at the right beat position (the xml can be unsorted, this.accentuations should be sorted)
    static AccentuationPatternDef createAccentuationPatternDef(nu.xom.Element xml)
    AcctentuationPatternDef factory
    static AccentuationPatternDef createAccentuationPatternDef(java.lang.String name, double length)
    AcctentuationPatternDef factory
    static AccentuationPatternDefcreateAccentuationPatternDef(java.lang.String name, + double length, + java.lang.String id) +
    AcctentuationPatternDef factory
    +
    double getAccentuationAt(double beatPosition)
    compute the accentuation value for a given position within the accentuation pattern
    double[] getAccentuationAttributes(int index)
    access the accentuation at the specified index
    nu.xom.Element getAccentuationXml(int index)
    access the accentuation element
    java.util.ArrayList<KeyValue<double[],nu.xom.Element>> getAllAccentuations()
    access the accentuation pattern
    double getLength()
    read the length of the accentuation pattern in beats
    intgetSize() -
    get the count of accentuations in this accentuation pattern
    -
    protected void parseData(nu.xom.Element xml)
    set the data of this object, this parses the xml element and generates the according data structure
    void removeAccentuation(int index)
    remove an accentuation from this accentuationPatternDef
    void setLength(double length)
    set the length of the accentuation pattern in midi ticks
    intsize() +
    get the count of accentuations in this accentuation pattern
    +
    private void sortXml()
    The accentuation pattern elements can be unsorted in the xml source.
    @@ -303,7 +321,7 @@

    Method Summary

    Methods inherited from class meico.mpm.elements.styles.defs.AbstractDef

    -getName, setName +getId, getName, setId, setName + + + +
      +
    • +

      createAccentuationPatternDef

      +
      public static AccentuationPatternDef createAccentuationPatternDef(java.lang.String name,
      +                                                                  double length,
      +                                                                  java.lang.String id)
      +
      AcctentuationPatternDef factory
      +
      +
      Parameters:
      +
      name -
      +
      length -
      +
      id -
      +
      Returns:
      +
      +
    • +
    @@ -445,8 +482,8 @@

    parseData

    throws java.lang.Exception
    set the data of this object, this parses the xml element and generates the according data structure
    -
    Specified by:
    -
    parseData in class AbstractXmlSubtree
    +
    Overrides:
    +
    parseData in class AbstractDef
    Parameters:
    xml -
    Throws:
    @@ -476,6 +513,30 @@

    addAccentuation

    + + + +
      +
    • +

      addAccentuation

      +
      public int addAccentuation(double beat,
      +                           double value,
      +                           double transitionFrom,
      +                           double transitionTo,
      +                           java.lang.String id)
      +
      create and add an accentuation to this accentuationPatternDef
      +
      +
      Parameters:
      +
      beat -
      +
      value -
      +
      transitionFrom -
      +
      transitionTo -
      +
      id -
      +
      Returns:
      +
      the index at which it has been added
      +
      +
    • +
    @@ -595,13 +656,13 @@

    getAccentuationAt

    - +
    • -

      getSize

      -
      public int getSize()
      +

      size

      +
      public int size()
      get the count of accentuations in this accentuation pattern
      Returns:
      diff --git a/docs/meico/mpm/elements/styles/defs/ArticulationDef.html b/docs/meico/mpm/elements/styles/defs/ArticulationDef.html index bf970c62..d049278c 100644 --- a/docs/meico/mpm/elements/styles/defs/ArticulationDef.html +++ b/docs/meico/mpm/elements/styles/defs/ArticulationDef.html @@ -2,9 +2,9 @@ - + ArticulationDef - + @@ -379,7 +379,7 @@

      Method Summary

      Methods inherited from class meico.mpm.elements.styles.defs.AbstractDef

      -getName, setName
    • +getId, getName, setId, setName
    private RubatoDef(java.lang.String name) +RubatoDef(java.lang.String name, + double frameLength)
    constructor, creates an empty rubatoDef
    static RubatoDefcreateRubatoDef(java.lang.String name) +createRubatoDef(java.lang.String name, + double frameLength)
    RubatoDef factory
    meico.mpm.elements.styles 
    meico.mpm.elements.styles.defs  
    + + + + + + + + + + + +
    Classes in meico.mpm.elements.styles with type parameters of type AbstractDef 
    Modifier and TypeClass and Description
    class GenericStyle<E extends AbstractDef> +
    This class interfaces MPM styleDef elements.
    +
    +
  • diff --git a/docs/meico/mpm/elements/styles/defs/class-use/AccentuationPatternDef.html b/docs/meico/mpm/elements/styles/defs/class-use/AccentuationPatternDef.html index a0a55455..ba82f026 100644 --- a/docs/meico/mpm/elements/styles/defs/class-use/AccentuationPatternDef.html +++ b/docs/meico/mpm/elements/styles/defs/class-use/AccentuationPatternDef.html @@ -2,9 +2,9 @@ - + Uses of Class meico.mpm.elements.styles.defs.AccentuationPatternDef - + @@ -87,10 +87,6 @@

      -meico.mpm.elements.styles -  - - meico.mpm.elements.styles.defs   @@ -117,69 +113,6 @@

    Uses of - - -

    Uses of AccentuationPatternDef in meico.mpm.elements.styles

    - - - - - - - - - - - - -
    Fields in meico.mpm.elements.styles with type parameters of type AccentuationPatternDef 
    Modifier and TypeField and Description
    private java.util.HashMap<java.lang.String,AccentuationPatternDef>MetricalAccentuationStyle.accentuationPatternDefs 
    - - - - - - - - - - - - -
    Methods in meico.mpm.elements.styles that return AccentuationPatternDef 
    Modifier and TypeMethod and Description
    AccentuationPatternDefMetricalAccentuationStyle.getAccentuationPatternDef(java.lang.String name) -
    retrieve a specific AccentuationPatternDef
    -
    - - - - - - - - - - - - -
    Methods in meico.mpm.elements.styles that return types with arguments of type AccentuationPatternDef 
    Modifier and TypeMethod and Description
    java.util.HashMap<java.lang.String,AccentuationPatternDef>MetricalAccentuationStyle.getAllAccentuationPatternDefs() -
    access the whole HashMap with (name, AccentuationPatternDef) pairs
    -
    - - - - - - - - - - - - -
    Methods in meico.mpm.elements.styles with parameters of type AccentuationPatternDef 
    Modifier and TypeMethod and Description
    voidMetricalAccentuationStyle.addAccentuationPatternDef(AccentuationPatternDef accentuationPatternDef) -
    add or (if a AccentuationPatternDef with this name is already existent) replace the AccentuationPatternDef
    -
    -
  • @@ -204,6 +137,14 @@

    Uses of AcctentuationPatternDef factory + +static AccentuationPatternDef +AccentuationPatternDef.createAccentuationPatternDef(java.lang.String name, + double length, + java.lang.String id) +
    AcctentuationPatternDef factory
    + +

  • diff --git a/docs/meico/mpm/elements/styles/defs/class-use/ArticulationDef.html b/docs/meico/mpm/elements/styles/defs/class-use/ArticulationDef.html index f2980b9d..fc5f20b0 100644 --- a/docs/meico/mpm/elements/styles/defs/class-use/ArticulationDef.html +++ b/docs/meico/mpm/elements/styles/defs/class-use/ArticulationDef.html @@ -2,9 +2,9 @@ - + Uses of Class meico.mpm.elements.styles.defs.ArticulationDef - + @@ -87,10 +87,6 @@

      -meico.mpm.elements.styles -  - - meico.mpm.elements.styles.defs   @@ -121,69 +117,6 @@

    Uses of - - -

    Uses of ArticulationDef in meico.mpm.elements.styles

    - - - - - - - - - - - - -
    Fields in meico.mpm.elements.styles with type parameters of type ArticulationDef 
    Modifier and TypeField and Description
    private java.util.HashMap<java.lang.String,ArticulationDef>ArticulationStyle.articulationDefs 
    - - - - - - - - - - - - -
    Methods in meico.mpm.elements.styles that return ArticulationDef 
    Modifier and TypeMethod and Description
    ArticulationDefArticulationStyle.getArticulationDef(java.lang.String name) -
    retrieve a specific articulationDef
    -
    - - - - - - - - - - - - -
    Methods in meico.mpm.elements.styles that return types with arguments of type ArticulationDef 
    Modifier and TypeMethod and Description
    java.util.HashMap<java.lang.String,ArticulationDef>ArticulationStyle.getAllArticulationDefs() -
    access the whole HashMap with (name, ArticulationDef) pairs
    -
    - - - - - - - - - - - - -
    Methods in meico.mpm.elements.styles with parameters of type ArticulationDef 
    Modifier and TypeMethod and Description
    voidArticulationStyle.addArticulationDef(ArticulationDef articulationDef) -
    add or (if a articulationDef with this name is already existent) replace the articulationDef
    -
    -
  • diff --git a/docs/meico/mpm/elements/styles/defs/class-use/DynamicsDef.html b/docs/meico/mpm/elements/styles/defs/class-use/DynamicsDef.html index ac5d68ce..88efb113 100644 --- a/docs/meico/mpm/elements/styles/defs/class-use/DynamicsDef.html +++ b/docs/meico/mpm/elements/styles/defs/class-use/DynamicsDef.html @@ -2,9 +2,9 @@ - + Uses of Class meico.mpm.elements.styles.defs.DynamicsDef - + @@ -87,10 +87,6 @@

      -meico.mpm.elements.styles -  - - meico.mpm.elements.styles.defs   @@ -117,69 +113,6 @@

    Uses of - - -

    Uses of DynamicsDef in meico.mpm.elements.styles

    - - - - - - - - - - - - -
    Fields in meico.mpm.elements.styles with type parameters of type DynamicsDef 
    Modifier and TypeField and Description
    private java.util.HashMap<java.lang.String,DynamicsDef>DynamicsStyle.dynamicsDefs 
    - - - - - - - - - - - - -
    Methods in meico.mpm.elements.styles that return DynamicsDef 
    Modifier and TypeMethod and Description
    DynamicsDefDynamicsStyle.getDynamicsDef(java.lang.String name) -
    retrieve a specific DynamicsDef
    -
    - - - - - - - - - - - - -
    Methods in meico.mpm.elements.styles that return types with arguments of type DynamicsDef 
    Modifier and TypeMethod and Description
    java.util.HashMap<java.lang.String,DynamicsDef>DynamicsStyle.getAllDynamicsDefs() -
    access the whole HashMap with (name, DynamicsDef) pairs
    -
    - - - - - - - - - - - - -
    Methods in meico.mpm.elements.styles with parameters of type DynamicsDef 
    Modifier and TypeMethod and Description
    voidDynamicsStyle.addDynamicsDef(DynamicsDef dynamicsDef) -
    add or (if a DynamicsDef with this name is already existent) replace the DynamicsDef
    -
    -
  • diff --git a/docs/meico/mpm/elements/styles/defs/class-use/RubatoDef.html b/docs/meico/mpm/elements/styles/defs/class-use/RubatoDef.html index 2961be59..4f5add6b 100644 --- a/docs/meico/mpm/elements/styles/defs/class-use/RubatoDef.html +++ b/docs/meico/mpm/elements/styles/defs/class-use/RubatoDef.html @@ -2,9 +2,9 @@ - + Uses of Class meico.mpm.elements.styles.defs.RubatoDef - + @@ -87,10 +87,6 @@

      -meico.mpm.elements.styles -  - - meico.mpm.elements.styles.defs   @@ -117,69 +113,6 @@

    Uses of - - -

    Uses of RubatoDef in meico.mpm.elements.styles

    - - - - - - - - - - - - -
    Fields in meico.mpm.elements.styles with type parameters of type RubatoDef 
    Modifier and TypeField and Description
    private java.util.HashMap<java.lang.String,RubatoDef>RubatoStyle.rubatoDefs 
    - - - - - - - - - - - - -
    Methods in meico.mpm.elements.styles that return RubatoDef 
    Modifier and TypeMethod and Description
    RubatoDefRubatoStyle.getRubatoDef(java.lang.String name) -
    retrieve a specific rubatoDef
    -
    - - - - - - - - - - - - -
    Methods in meico.mpm.elements.styles that return types with arguments of type RubatoDef 
    Modifier and TypeMethod and Description
    java.util.HashMap<java.lang.String,RubatoDef>RubatoStyle.getAllRubatoDefs() -
    access the whole HashMap with (name, RubatoDef) pairs
    -
    - - - - - - - - - - - - -
    Methods in meico.mpm.elements.styles with parameters of type RubatoDef 
    Modifier and TypeMethod and Description
    voidRubatoStyle.addRubatoDef(RubatoDef rubatoDef) -
    add or (if a rubatoDef with this name is already existent) replace the rubatoDef
    -
    -
  • @@ -199,7 +132,8 @@

    Uses of static RubatoDef -RubatoDef.createRubatoDef(java.lang.String name) +RubatoDef.createRubatoDef(java.lang.String name, + double frameLength)
    RubatoDef factory
    diff --git a/docs/meico/mpm/elements/styles/defs/class-use/TempoDef.html b/docs/meico/mpm/elements/styles/defs/class-use/TempoDef.html index 52a3fba2..711d118d 100644 --- a/docs/meico/mpm/elements/styles/defs/class-use/TempoDef.html +++ b/docs/meico/mpm/elements/styles/defs/class-use/TempoDef.html @@ -2,9 +2,9 @@ - + Uses of Class meico.mpm.elements.styles.defs.TempoDef - + @@ -83,10 +83,6 @@

    -meico.mpm.elements.styles -  - - meico.mpm.elements.styles.defs   @@ -95,69 +91,6 @@

    • -
    • - - -

      Uses of TempoDef in meico.mpm.elements.styles

      - - - - - - - - - - - - -
      Fields in meico.mpm.elements.styles with type parameters of type TempoDef 
      Modifier and TypeField and Description
      private java.util.HashMap<java.lang.String,TempoDef>TempoStyle.tempoDefs 
      - - - - - - - - - - - - -
      Methods in meico.mpm.elements.styles that return TempoDef 
      Modifier and TypeMethod and Description
      TempoDefTempoStyle.getTempoDef(java.lang.String name) -
      retrieve a specific TempoDef
      -
      - - - - - - - - - - - - -
      Methods in meico.mpm.elements.styles that return types with arguments of type TempoDef 
      Modifier and TypeMethod and Description
      java.util.HashMap<java.lang.String,TempoDef>TempoStyle.getAllTempoDefs() -
      access the whole HashMap with (name, TempoDef) pairs
      -
      - - - - - - - - - - - - -
      Methods in meico.mpm.elements.styles with parameters of type TempoDef 
      Modifier and TypeMethod and Description
      voidTempoStyle.addTempoDef(TempoDef tempoDef) -
      add or (if a TempoDef with this name is already existent) replace the TempoDef
      -
      -
    • diff --git a/docs/meico/mpm/elements/styles/defs/package-frame.html b/docs/meico/mpm/elements/styles/defs/package-frame.html index 0f3c732a..13d4af37 100644 --- a/docs/meico/mpm/elements/styles/defs/package-frame.html +++ b/docs/meico/mpm/elements/styles/defs/package-frame.html @@ -2,9 +2,9 @@ - + meico.mpm.elements.styles.defs - + diff --git a/docs/meico/mpm/elements/styles/defs/package-summary.html b/docs/meico/mpm/elements/styles/defs/package-summary.html index 88793d7d..434510bb 100644 --- a/docs/meico/mpm/elements/styles/defs/package-summary.html +++ b/docs/meico/mpm/elements/styles/defs/package-summary.html @@ -2,9 +2,9 @@ - + meico.mpm.elements.styles.defs - + diff --git a/docs/meico/mpm/elements/styles/defs/package-tree.html b/docs/meico/mpm/elements/styles/defs/package-tree.html index 8a9eddf9..f8a18ccc 100644 --- a/docs/meico/mpm/elements/styles/defs/package-tree.html +++ b/docs/meico/mpm/elements/styles/defs/package-tree.html @@ -2,9 +2,9 @@ - + meico.mpm.elements.styles.defs Class Hierarchy - + diff --git a/docs/meico/mpm/elements/styles/defs/package-use.html b/docs/meico/mpm/elements/styles/defs/package-use.html index 470eae94..960619d8 100644 --- a/docs/meico/mpm/elements/styles/defs/package-use.html +++ b/docs/meico/mpm/elements/styles/defs/package-use.html @@ -2,9 +2,9 @@ - + Uses of Package meico.mpm.elements.styles.defs - + @@ -139,28 +139,8 @@

      Uses of -AccentuationPatternDef -
      This class interfaces MPM's articulationPattern elements.
      - - - -ArticulationDef -
      This class interfaces MPM's articulationDef elements.
      - - - -DynamicsDef -
      This class interfaces MPM's dynamicsDef elements.
      - - - -RubatoDef -
      This class interfaces MPM rubatoDef elements.
      - - - -TempoDef -
      This class interfaces MPM's tempoDef elements.
      +AbstractDef +
      This abstract class reduces the amount of copy code in the ...Def classes.
      diff --git a/docs/meico/mpm/elements/styles/package-frame.html b/docs/meico/mpm/elements/styles/package-frame.html index 567d4730..a5f442f2 100644 --- a/docs/meico/mpm/elements/styles/package-frame.html +++ b/docs/meico/mpm/elements/styles/package-frame.html @@ -2,9 +2,9 @@ - + meico.mpm.elements.styles - + diff --git a/docs/meico/mpm/elements/styles/package-summary.html b/docs/meico/mpm/elements/styles/package-summary.html index c875dbe4..6bd3b0cc 100644 --- a/docs/meico/mpm/elements/styles/package-summary.html +++ b/docs/meico/mpm/elements/styles/package-summary.html @@ -2,9 +2,9 @@ - + meico.mpm.elements.styles - + @@ -95,7 +95,7 @@

      Package meico.mpm.elements.styles

      -GenericStyle +GenericStyle<E extends AbstractDef>
      This class interfaces MPM styleDef elements.
      diff --git a/docs/meico/mpm/elements/styles/package-tree.html b/docs/meico/mpm/elements/styles/package-tree.html index df6b7527..a54d8082 100644 --- a/docs/meico/mpm/elements/styles/package-tree.html +++ b/docs/meico/mpm/elements/styles/package-tree.html @@ -2,9 +2,9 @@ - + meico.mpm.elements.styles Class Hierarchy - + @@ -83,7 +83,7 @@

      Class Hierarchy

      • meico.xml.AbstractXmlSubtree
          -
        • meico.mpm.elements.styles.GenericStyle +
        • meico.mpm.elements.styles.GenericStyle<E>
          • meico.mpm.elements.styles.ArticulationStyle
          • meico.mpm.elements.styles.DynamicsStyle
          • diff --git a/docs/meico/mpm/elements/styles/package-use.html b/docs/meico/mpm/elements/styles/package-use.html index de760fa0..ce7d719d 100644 --- a/docs/meico/mpm/elements/styles/package-use.html +++ b/docs/meico/mpm/elements/styles/package-use.html @@ -2,9 +2,9 @@ - + Uses of Package meico.mpm.elements.styles - + diff --git a/docs/meico/mpm/package-frame.html b/docs/meico/mpm/package-frame.html index 05f624f7..1eec4231 100644 --- a/docs/meico/mpm/package-frame.html +++ b/docs/meico/mpm/package-frame.html @@ -2,9 +2,9 @@ - + meico.mpm - + diff --git a/docs/meico/mpm/package-summary.html b/docs/meico/mpm/package-summary.html index 96036ada..63f9f8f0 100644 --- a/docs/meico/mpm/package-summary.html +++ b/docs/meico/mpm/package-summary.html @@ -2,9 +2,9 @@ - + meico.mpm - + diff --git a/docs/meico/mpm/package-tree.html b/docs/meico/mpm/package-tree.html index 5ab681fa..44b465af 100644 --- a/docs/meico/mpm/package-tree.html +++ b/docs/meico/mpm/package-tree.html @@ -2,9 +2,9 @@ - + meico.mpm Class Hierarchy - + diff --git a/docs/meico/mpm/package-use.html b/docs/meico/mpm/package-use.html index b1943727..42a35b8b 100644 --- a/docs/meico/mpm/package-use.html +++ b/docs/meico/mpm/package-use.html @@ -2,9 +2,9 @@ - + Uses of Package meico.mpm - + diff --git a/docs/meico/msm/AbstractMsm.html b/docs/meico/msm/AbstractMsm.html index a161276f..98cf4d9c 100644 --- a/docs/meico/msm/AbstractMsm.html +++ b/docs/meico/msm/AbstractMsm.html @@ -2,9 +2,9 @@ - + AbstractMsm - + diff --git a/docs/meico/msm/Goto.html b/docs/meico/msm/Goto.html index f67f3259..4b98cc19 100644 --- a/docs/meico/msm/Goto.html +++ b/docs/meico/msm/Goto.html @@ -2,9 +2,9 @@ - + Goto - + diff --git a/docs/meico/msm/Msm.html b/docs/meico/msm/Msm.html index 4e081b5a..2f4e6c97 100644 --- a/docs/meico/msm/Msm.html +++ b/docs/meico/msm/Msm.html @@ -2,9 +2,9 @@ - + Msm - + diff --git a/docs/meico/msm/class-use/AbstractMsm.html b/docs/meico/msm/class-use/AbstractMsm.html index 01026a98..55d89665 100644 --- a/docs/meico/msm/class-use/AbstractMsm.html +++ b/docs/meico/msm/class-use/AbstractMsm.html @@ -2,9 +2,9 @@ - + Uses of Class meico.msm.AbstractMsm - + diff --git a/docs/meico/msm/class-use/Goto.html b/docs/meico/msm/class-use/Goto.html index 8099c5a9..903689ef 100644 --- a/docs/meico/msm/class-use/Goto.html +++ b/docs/meico/msm/class-use/Goto.html @@ -2,9 +2,9 @@ - + Uses of Class meico.msm.Goto - + diff --git a/docs/meico/msm/class-use/Msm.html b/docs/meico/msm/class-use/Msm.html index 687b76c8..e2ad14f7 100644 --- a/docs/meico/msm/class-use/Msm.html +++ b/docs/meico/msm/class-use/Msm.html @@ -2,9 +2,9 @@ - + Uses of Class meico.msm.Msm - + diff --git a/docs/meico/msm/package-frame.html b/docs/meico/msm/package-frame.html index 1862db5b..728be8a7 100644 --- a/docs/meico/msm/package-frame.html +++ b/docs/meico/msm/package-frame.html @@ -2,9 +2,9 @@ - + meico.msm - + diff --git a/docs/meico/msm/package-summary.html b/docs/meico/msm/package-summary.html index 013516df..f7820a55 100644 --- a/docs/meico/msm/package-summary.html +++ b/docs/meico/msm/package-summary.html @@ -2,9 +2,9 @@ - + meico.msm - + diff --git a/docs/meico/msm/package-tree.html b/docs/meico/msm/package-tree.html index eb45d25c..54b7ea85 100644 --- a/docs/meico/msm/package-tree.html +++ b/docs/meico/msm/package-tree.html @@ -2,9 +2,9 @@ - + meico.msm Class Hierarchy - + diff --git a/docs/meico/msm/package-use.html b/docs/meico/msm/package-use.html index aa795d00..dd900b50 100644 --- a/docs/meico/msm/package-use.html +++ b/docs/meico/msm/package-use.html @@ -2,9 +2,9 @@ - + Uses of Package meico.msm - + diff --git a/docs/meico/musicxml/MusicXml.html b/docs/meico/musicxml/MusicXml.html index 17864ec1..e623a558 100644 --- a/docs/meico/musicxml/MusicXml.html +++ b/docs/meico/musicxml/MusicXml.html @@ -2,9 +2,9 @@ - + MusicXml - + diff --git a/docs/meico/musicxml/class-use/MusicXml.html b/docs/meico/musicxml/class-use/MusicXml.html index 6cedbdf6..2715d15e 100644 --- a/docs/meico/musicxml/class-use/MusicXml.html +++ b/docs/meico/musicxml/class-use/MusicXml.html @@ -2,9 +2,9 @@ - + Uses of Class meico.musicxml.MusicXml - + diff --git a/docs/meico/musicxml/package-frame.html b/docs/meico/musicxml/package-frame.html index 7d636da0..0456066c 100644 --- a/docs/meico/musicxml/package-frame.html +++ b/docs/meico/musicxml/package-frame.html @@ -2,9 +2,9 @@ - + meico.musicxml - + diff --git a/docs/meico/musicxml/package-summary.html b/docs/meico/musicxml/package-summary.html index 6730fd74..43ff5c15 100644 --- a/docs/meico/musicxml/package-summary.html +++ b/docs/meico/musicxml/package-summary.html @@ -2,9 +2,9 @@ - + meico.musicxml - + diff --git a/docs/meico/musicxml/package-tree.html b/docs/meico/musicxml/package-tree.html index c2f82f9d..da4e71b0 100644 --- a/docs/meico/musicxml/package-tree.html +++ b/docs/meico/musicxml/package-tree.html @@ -2,9 +2,9 @@ - + meico.musicxml Class Hierarchy - + diff --git a/docs/meico/musicxml/package-use.html b/docs/meico/musicxml/package-use.html index 1ff68171..293e134a 100644 --- a/docs/meico/musicxml/package-use.html +++ b/docs/meico/musicxml/package-use.html @@ -2,9 +2,9 @@ - + Uses of Package meico.musicxml - + diff --git a/docs/meico/package-frame.html b/docs/meico/package-frame.html index 7035f7e2..de0c8183 100644 --- a/docs/meico/package-frame.html +++ b/docs/meico/package-frame.html @@ -2,9 +2,9 @@ - + meico - + diff --git a/docs/meico/package-summary.html b/docs/meico/package-summary.html index 9aab9ff6..7c4a2ad1 100644 --- a/docs/meico/package-summary.html +++ b/docs/meico/package-summary.html @@ -2,9 +2,9 @@ - + meico - + diff --git a/docs/meico/package-tree.html b/docs/meico/package-tree.html index 855c1ed2..23ec5326 100644 --- a/docs/meico/package-tree.html +++ b/docs/meico/package-tree.html @@ -2,9 +2,9 @@ - + meico Class Hierarchy - + diff --git a/docs/meico/package-use.html b/docs/meico/package-use.html index 8432b803..d91c0da1 100644 --- a/docs/meico/package-use.html +++ b/docs/meico/package-use.html @@ -2,9 +2,9 @@ - + Uses of Package meico - + diff --git a/docs/meico/pitches/FeatureElement.html b/docs/meico/pitches/FeatureElement.html index 2e9f0065..2a7c26e7 100644 --- a/docs/meico/pitches/FeatureElement.html +++ b/docs/meico/pitches/FeatureElement.html @@ -2,9 +2,9 @@ - + FeatureElement - + diff --git a/docs/meico/pitches/FeatureVector.html b/docs/meico/pitches/FeatureVector.html index 48e6b2f3..047c1100 100644 --- a/docs/meico/pitches/FeatureVector.html +++ b/docs/meico/pitches/FeatureVector.html @@ -2,9 +2,9 @@ - + FeatureVector - + diff --git a/docs/meico/pitches/Key.html b/docs/meico/pitches/Key.html index 2e3a8c8c..bda0fc26 100644 --- a/docs/meico/pitches/Key.html +++ b/docs/meico/pitches/Key.html @@ -2,9 +2,9 @@ - + Key - + diff --git a/docs/meico/pitches/Pitches.html b/docs/meico/pitches/Pitches.html index 897d3a2a..39ff53e6 100644 --- a/docs/meico/pitches/Pitches.html +++ b/docs/meico/pitches/Pitches.html @@ -2,9 +2,9 @@ - + Pitches - + diff --git a/docs/meico/pitches/class-use/FeatureElement.html b/docs/meico/pitches/class-use/FeatureElement.html index dfb88a3d..6c999059 100644 --- a/docs/meico/pitches/class-use/FeatureElement.html +++ b/docs/meico/pitches/class-use/FeatureElement.html @@ -2,9 +2,9 @@ - + Uses of Class meico.pitches.FeatureElement - + diff --git a/docs/meico/pitches/class-use/FeatureVector.html b/docs/meico/pitches/class-use/FeatureVector.html index 742e5de8..299d61d8 100644 --- a/docs/meico/pitches/class-use/FeatureVector.html +++ b/docs/meico/pitches/class-use/FeatureVector.html @@ -2,9 +2,9 @@ - + Uses of Class meico.pitches.FeatureVector - + diff --git a/docs/meico/pitches/class-use/Key.html b/docs/meico/pitches/class-use/Key.html index c1938b01..69b13225 100644 --- a/docs/meico/pitches/class-use/Key.html +++ b/docs/meico/pitches/class-use/Key.html @@ -2,9 +2,9 @@ - + Uses of Class meico.pitches.Key - + diff --git a/docs/meico/pitches/class-use/Pitches.html b/docs/meico/pitches/class-use/Pitches.html index 7b033e75..d3682751 100644 --- a/docs/meico/pitches/class-use/Pitches.html +++ b/docs/meico/pitches/class-use/Pitches.html @@ -2,9 +2,9 @@ - + Uses of Class meico.pitches.Pitches - + diff --git a/docs/meico/pitches/package-frame.html b/docs/meico/pitches/package-frame.html index 1fea4e51..a9ce3274 100644 --- a/docs/meico/pitches/package-frame.html +++ b/docs/meico/pitches/package-frame.html @@ -2,9 +2,9 @@ - + meico.pitches - + diff --git a/docs/meico/pitches/package-summary.html b/docs/meico/pitches/package-summary.html index ba6d6fc6..f39361fe 100644 --- a/docs/meico/pitches/package-summary.html +++ b/docs/meico/pitches/package-summary.html @@ -2,9 +2,9 @@ - + meico.pitches - + diff --git a/docs/meico/pitches/package-tree.html b/docs/meico/pitches/package-tree.html index 489c0eff..21daf2a1 100644 --- a/docs/meico/pitches/package-tree.html +++ b/docs/meico/pitches/package-tree.html @@ -2,9 +2,9 @@ - + meico.pitches Class Hierarchy - + diff --git a/docs/meico/pitches/package-use.html b/docs/meico/pitches/package-use.html index 7e7de539..62a3a979 100644 --- a/docs/meico/pitches/package-use.html +++ b/docs/meico/pitches/package-use.html @@ -2,9 +2,9 @@ - + Uses of Package meico.pitches - + diff --git a/docs/meico/supplementary/KeyValue.html b/docs/meico/supplementary/KeyValue.html index 59a14c58..6096a940 100644 --- a/docs/meico/supplementary/KeyValue.html +++ b/docs/meico/supplementary/KeyValue.html @@ -2,9 +2,9 @@ - + KeyValue - + diff --git a/docs/meico/supplementary/RandomNumberProvider.html b/docs/meico/supplementary/RandomNumberProvider.html index 92430b82..4002c9b7 100644 --- a/docs/meico/supplementary/RandomNumberProvider.html +++ b/docs/meico/supplementary/RandomNumberProvider.html @@ -2,9 +2,9 @@ - + RandomNumberProvider - + diff --git a/docs/meico/supplementary/class-use/KeyValue.html b/docs/meico/supplementary/class-use/KeyValue.html index 73baf9cf..b732a295 100644 --- a/docs/meico/supplementary/class-use/KeyValue.html +++ b/docs/meico/supplementary/class-use/KeyValue.html @@ -2,9 +2,9 @@ - + Uses of Class meico.supplementary.KeyValue - + diff --git a/docs/meico/supplementary/class-use/RandomNumberProvider.html b/docs/meico/supplementary/class-use/RandomNumberProvider.html index 4ca3473b..1d6c94f9 100644 --- a/docs/meico/supplementary/class-use/RandomNumberProvider.html +++ b/docs/meico/supplementary/class-use/RandomNumberProvider.html @@ -2,9 +2,9 @@ - + Uses of Class meico.supplementary.RandomNumberProvider - + diff --git a/docs/meico/supplementary/package-frame.html b/docs/meico/supplementary/package-frame.html index 317d37ec..0b2a1c3a 100644 --- a/docs/meico/supplementary/package-frame.html +++ b/docs/meico/supplementary/package-frame.html @@ -2,9 +2,9 @@ - + meico.supplementary - + diff --git a/docs/meico/supplementary/package-summary.html b/docs/meico/supplementary/package-summary.html index e83225e0..338aa747 100644 --- a/docs/meico/supplementary/package-summary.html +++ b/docs/meico/supplementary/package-summary.html @@ -2,9 +2,9 @@ - + meico.supplementary - + diff --git a/docs/meico/supplementary/package-tree.html b/docs/meico/supplementary/package-tree.html index 552f179f..a5394574 100644 --- a/docs/meico/supplementary/package-tree.html +++ b/docs/meico/supplementary/package-tree.html @@ -2,9 +2,9 @@ - + meico.supplementary Class Hierarchy - + diff --git a/docs/meico/supplementary/package-use.html b/docs/meico/supplementary/package-use.html index 671ed245..ed899a4c 100644 --- a/docs/meico/supplementary/package-use.html +++ b/docs/meico/supplementary/package-use.html @@ -2,9 +2,9 @@ - + Uses of Package meico.supplementary - + diff --git a/docs/meico/svg/Svg.html b/docs/meico/svg/Svg.html index 637bee8c..97531343 100644 --- a/docs/meico/svg/Svg.html +++ b/docs/meico/svg/Svg.html @@ -2,9 +2,9 @@ - + Svg - + diff --git a/docs/meico/svg/SvgCollection.html b/docs/meico/svg/SvgCollection.html index cee6160b..63c8f67d 100644 --- a/docs/meico/svg/SvgCollection.html +++ b/docs/meico/svg/SvgCollection.html @@ -2,9 +2,9 @@ - + SvgCollection - + diff --git a/docs/meico/svg/class-use/Svg.html b/docs/meico/svg/class-use/Svg.html index b8335ce5..92957825 100644 --- a/docs/meico/svg/class-use/Svg.html +++ b/docs/meico/svg/class-use/Svg.html @@ -2,9 +2,9 @@ - + Uses of Class meico.svg.Svg - + diff --git a/docs/meico/svg/class-use/SvgCollection.html b/docs/meico/svg/class-use/SvgCollection.html index be80c1ab..cb7326cc 100644 --- a/docs/meico/svg/class-use/SvgCollection.html +++ b/docs/meico/svg/class-use/SvgCollection.html @@ -2,9 +2,9 @@ - + Uses of Class meico.svg.SvgCollection - + diff --git a/docs/meico/svg/package-frame.html b/docs/meico/svg/package-frame.html index 46bb6f1a..99f6e539 100644 --- a/docs/meico/svg/package-frame.html +++ b/docs/meico/svg/package-frame.html @@ -2,9 +2,9 @@ - + meico.svg - + diff --git a/docs/meico/svg/package-summary.html b/docs/meico/svg/package-summary.html index 1386a25f..d9bf5333 100644 --- a/docs/meico/svg/package-summary.html +++ b/docs/meico/svg/package-summary.html @@ -2,9 +2,9 @@ - + meico.svg - + diff --git a/docs/meico/svg/package-tree.html b/docs/meico/svg/package-tree.html index f9eccb7f..f1dc4ea1 100644 --- a/docs/meico/svg/package-tree.html +++ b/docs/meico/svg/package-tree.html @@ -2,9 +2,9 @@ - + meico.svg Class Hierarchy - + diff --git a/docs/meico/svg/package-use.html b/docs/meico/svg/package-use.html index 80742f83..20844b51 100644 --- a/docs/meico/svg/package-use.html +++ b/docs/meico/svg/package-use.html @@ -2,9 +2,9 @@ - + Uses of Package meico.svg - + diff --git a/docs/meico/xml/AbstractXmlSubtree.html b/docs/meico/xml/AbstractXmlSubtree.html index f4236fcc..216e2874 100644 --- a/docs/meico/xml/AbstractXmlSubtree.html +++ b/docs/meico/xml/AbstractXmlSubtree.html @@ -2,9 +2,9 @@ - + AbstractXmlSubtree - + @@ -109,7 +109,7 @@

            Class AbstractXmlSubtree

          • Direct Known Subclasses:
            -
            AbstractDef, Author, Dated, GenericMap, GenericStyle, Global, Header, Metadata, Part, Performance, RelatedResource
            +
            AbstractDef, Author, Comment, Dated, GenericMap, GenericStyle, Global, Header, Metadata, Part, Performance, RelatedResource


            diff --git a/docs/meico/xml/XmlBase.html b/docs/meico/xml/XmlBase.html index 18555e16..322b661c 100644 --- a/docs/meico/xml/XmlBase.html +++ b/docs/meico/xml/XmlBase.html @@ -2,9 +2,9 @@ - + XmlBase - + diff --git a/docs/meico/xml/class-use/AbstractXmlSubtree.html b/docs/meico/xml/class-use/AbstractXmlSubtree.html index 2a4e33c1..71f63f09 100644 --- a/docs/meico/xml/class-use/AbstractXmlSubtree.html +++ b/docs/meico/xml/class-use/AbstractXmlSubtree.html @@ -2,9 +2,9 @@ - + Uses of Class meico.xml.AbstractXmlSubtree - + @@ -238,11 +238,17 @@

            Uses of class  +Comment +
            This class interfaces the comment element of MPM.
            + + + +class  Metadata
            This class interfaces the metadata of the MPM instance.
            - + class  RelatedResource
            This class represents an MPM resource element in the relatedResources list.
            @@ -276,7 +282,7 @@

            Uses of class  -GenericStyle +GenericStyle<E extends AbstractDef>
            This class interfaces MPM styleDef elements.
            diff --git a/docs/meico/xml/class-use/XmlBase.html b/docs/meico/xml/class-use/XmlBase.html index ad5d1789..68db0eb7 100644 --- a/docs/meico/xml/class-use/XmlBase.html +++ b/docs/meico/xml/class-use/XmlBase.html @@ -2,9 +2,9 @@ - + Uses of Class meico.xml.XmlBase - + diff --git a/docs/meico/xml/package-frame.html b/docs/meico/xml/package-frame.html index 92eccdcf..e5d8ed1f 100644 --- a/docs/meico/xml/package-frame.html +++ b/docs/meico/xml/package-frame.html @@ -2,9 +2,9 @@ - + meico.xml - + diff --git a/docs/meico/xml/package-summary.html b/docs/meico/xml/package-summary.html index 8e68650d..0d22ff18 100644 --- a/docs/meico/xml/package-summary.html +++ b/docs/meico/xml/package-summary.html @@ -2,9 +2,9 @@ - + meico.xml - + diff --git a/docs/meico/xml/package-tree.html b/docs/meico/xml/package-tree.html index fca06af6..82f90d3c 100644 --- a/docs/meico/xml/package-tree.html +++ b/docs/meico/xml/package-tree.html @@ -2,9 +2,9 @@ - + meico.xml Class Hierarchy - + diff --git a/docs/meico/xml/package-use.html b/docs/meico/xml/package-use.html index cd937954..2e15e9a8 100644 --- a/docs/meico/xml/package-use.html +++ b/docs/meico/xml/package-use.html @@ -2,9 +2,9 @@ - + Uses of Package meico.xml - + diff --git a/docs/overview-frame.html b/docs/overview-frame.html index 6dbd3c23..cb5cd206 100644 --- a/docs/overview-frame.html +++ b/docs/overview-frame.html @@ -2,9 +2,9 @@ - + Overview List - + diff --git a/docs/overview-summary.html b/docs/overview-summary.html index 91a3751f..6f4eec81 100644 --- a/docs/overview-summary.html +++ b/docs/overview-summary.html @@ -2,9 +2,9 @@ - + Overview - + diff --git a/docs/overview-tree.html b/docs/overview-tree.html index 3e04cb93..18f5b707 100644 --- a/docs/overview-tree.html +++ b/docs/overview-tree.html @@ -2,9 +2,9 @@ - + Class Hierarchy - + @@ -110,6 +110,7 @@

            Class Hierarchy

        • meico.mpm.elements.metadata.Author
        • +
        • meico.mpm.elements.metadata.Comment
        • meico.mpm.elements.Dated
        • meico.mpm.elements.maps.GenericMap
            @@ -123,7 +124,7 @@

            Class Hierarchy

          • meico.mpm.elements.maps.TempoMap
        • -
        • meico.mpm.elements.styles.GenericStyle +
        • meico.mpm.elements.styles.GenericStyle<E>
          • meico.mpm.elements.styles.ArticulationStyle
          • meico.mpm.elements.styles.DynamicsStyle
          • diff --git a/docs/serialized-form.html b/docs/serialized-form.html index 651d262b..41637bc7 100644 --- a/docs/serialized-form.html +++ b/docs/serialized-form.html @@ -2,9 +2,9 @@ - + Serialized Form - + diff --git a/history.md b/history.md index 3578b12b..0434b06b 100644 --- a/history.md +++ b/history.md @@ -1,12 +1,29 @@ ### Version History +#### v0.8.19 +- Added new class `meico.mpm.elements.metadata.Comment` and incorporated it in all classes that handle MPM metadata comment elements. +- In class `meico.mpm.elements.metadata.Metadata` some new methods have been added: `removeAuthor()` and `removeComment()`. +- Enhancement in method `meico.mpm.Mpm.addPerformance()` to cancel if the input `Performance` object is null. It also got a `boolean` return value to indicate the success of the action. +- The same has been added to method `meico.mpm.elements.Performance.addPart()`. It returns `false` also if the part is already in the performance. +- The same has been added to methods `meico.mpm.elements.metadata.Metadata.addAuthor()`, `addComment()` and `addRelatedResource()`. Instead of an index they return `-1`. +- Bugfixes in methods `meico.mpm.elements.metadata.Author.setId()` and `removeAuthor()`. +- Classes `meico.mpm.elements.Part`, `Performance` have been extended to provide access also to the element's `xml:id`. +- New methods `clear()` and `renameStyleDef()` in class `meico.mpm.elements.Header` to remove all content of from the respective MPM element. +- New method `clear()` in class `meico.mpm.elements.Dated` to remove all content of from the respective MPM element. +- Bugfix in method `meico.mpm.elements.Header.removeStyleType()`, `removeStyleDef()`, `addStyleType()`. +- Lots of enhancement and refactoring of all classes in packages `meico.mpm.elements.styles` and `meico.mpm.elements.styles.defs`. +- Correction of `rubatoDef` factory method `meico.mpm.elements.styles.defs.RubatoDef.createRubatoDef(String name)` to `createRubatoDef(String name, double frameLength)`. A `rubatoDef` without a `frameLangth` is invalid. Hence the factory could never create a `rubatoDef`. This is fixed. +- Refactoring of method `meico.mpm.elements.styles.defs.AccentuationPatternDef.getSize()` to `size()` to follow the convention used in all other classes. +- Added another method `addAccentuation()` to class `meico.mpm.elements.styles.defs.AccentuationPatternDef` that supports input of an `id` string. + + #### v0.8.18 - Enhancement of class `meico.mpm.elements.metadata.Metadata` so it can be instatiated with related resources. #### v0.8.17 -- Made class `meico.midi.InstrumentsDirectory` public so it can be used outside of its package. +- Made class `meico.midi.InstrumentsDirectory` public, so it can be used outside of its package. - Extended method `meico.mei.Mei.makePart()`. - This addresses issue [#23](https://github.com/cemfi/meico/issues/23) where the staff label did not suffice to properly indicate which General MIDI instrument should be chosen during the MIDI export. - Thus, support for MEI element `instrDef` has been added. It should be used as follows. diff --git a/src/meico/Meico.java b/src/meico/Meico.java index 49059910..a5c28c2f 100644 --- a/src/meico/Meico.java +++ b/src/meico/Meico.java @@ -5,7 +5,7 @@ * @author Axel Berndt */ public class Meico { - public static final String version = "0.8.18"; + public static final String version = "0.8.19"; public static void main(String[] args) { System.out.println("meico v" + Meico.version); diff --git a/src/meico/mei/Helper.java b/src/meico/mei/Helper.java index c5c2eb9a..ee800d05 100644 --- a/src/meico/mei/Helper.java +++ b/src/meico/mei/Helper.java @@ -656,8 +656,10 @@ public static void msmCleanup(Msm msm) { // delete all miscMaps and non-msm conform attributes Nodes n = msm.getRootElement().query("descendant::*[local-name()='miscMap'] | descendant::*[attribute::currentDate]/attribute::currentDate | descendant::*[attribute::tie]/attribute::tie | descendant::*[attribute::layer]/attribute::layer | descendant::*[attribute::endid]/attribute::endid | descendant::*[attribute::tstamp2]/attribute::tstamp2 | descendant::*[local-name()='goto' and attribute::n]/attribute::n"); for (int i=0; i < n.size(); ++i) { - if (n.get(i) instanceof Element) + if (n.get(i) instanceof Element) { n.get(i).getParent().removeChild(n.get(i)); +// n.get(i).detach(); + } if (n.get(i) instanceof Attribute) ((Element) n.get(i).getParent()).removeAttribute((Attribute) n.get(i)); @@ -839,12 +841,12 @@ else if (descriptor.contains("accel") || descriptor.contains("string")) { if (tempoStyle == null) // if there is none tempoStyle = (TempoStyle) this.currentPerformance.getGlobal().getHeader().addStyleDef(Mpm.TEMPO_STYLE, "MEI export"); // create one - if ((tempoStyle != null) && (tempoStyle.getTempoDef(descriptor) == null)) { // if there is a descriptor string for this tempo instruction + if ((tempoStyle != null) && (tempoStyle.getDef(descriptor) == null)) { // if there is a descriptor string for this tempo instruction // use the specified tempo or, if not defined, try to create a default numeric value for the descriptor string if (tempoData.bpmString == null) - tempoStyle.addTempoDef(TempoDef.createDefaultTempoDef(descriptor)); + tempoStyle.addDef(TempoDef.createDefaultTempoDef(descriptor)); else - tempoStyle.addTempoDef(TempoDef.createTempoDef(descriptor, Double.parseDouble(tempoData.bpmString))); + tempoStyle.addDef(TempoDef.createTempoDef(descriptor, Double.parseDouble(tempoData.bpmString))); } tempoData.bpmString = descriptor; } @@ -1269,6 +1271,7 @@ protected Double computeDuration(Element ofThis) { Element ts = tps.get(i); if ((ts.getAttribute("date.end") != null) && (Double.parseDouble(ts.getAttributeValue("date.end")) <= this.getMidiTime())) { // if the tupletSpan is already over this.currentPart.getFirstChildElement("dated").getFirstChildElement("miscMap").getFirstChildElement("tupletSpanMap").removeChild(ts); // remove this tupletSpan from the map, it is no longer needed +// ts.detach(); continue; // continue with the previous element in tps } if (!Helper.isSameLayer(ts, Helper.getLayerId(this.currentLayer))) { // check whether this is dedicated to a specific layer but not the current layer (layer of ofThis) diff --git a/src/meico/mei/Mei.java b/src/meico/mei/Mei.java index 1882644e..1fd9a5d9 100644 --- a/src/meico/mei/Mei.java +++ b/src/meico/mei/Mei.java @@ -11,6 +11,7 @@ import meico.mpm.elements.maps.data.DynamicsData; import meico.mpm.elements.maps.data.TempoData; import meico.mpm.elements.metadata.Author; +import meico.mpm.elements.metadata.Comment; import meico.mpm.elements.metadata.RelatedResource; import meico.mpm.elements.styles.ArticulationStyle; import meico.mpm.elements.styles.DynamicsStyle; @@ -871,9 +872,11 @@ private void makeMovement(Element mdiv) { if (this.file != null) { ArrayList relatedResources = new ArrayList<>(); relatedResources.add(RelatedResource.createRelatedResource(this.file.getAbsolutePath(), "mei")); - mpm.addMetadata(Author.createAuthor("meico", null, null), "This MPM has been generated from '" + this.getFile().getName() + "' using the meico MEI converter.", relatedResources); + Comment comment = Comment.createComment("This MPM has been generated from '" + this.getFile().getName() + "' using the meico MEI converter.", null); + mpm.addMetadata(Author.createAuthor("meico", null, null), comment, relatedResources); } else { - mpm.addMetadata(Author.createAuthor("meico", null, null), "This MPM has been generated from MEI code using the meico MEI converter.", null); + Comment comment = Comment.createComment("This MPM has been generated from MEI code using the meico MEI converter.", null); + mpm.addMetadata(Author.createAuthor("meico", null, null), comment, null); } Performance performance = Performance.createPerformance("MEI export performance"); // generate a Performance object if (performance == null) { // make sure it is not null @@ -1335,7 +1338,10 @@ private void processEnding(Element ending) { Element firstGoto = (Element)gotosAtSameDate.get(0); // get the first goto if (index >= gotosAtSameDate.size()) Helper.addToMap(gt, sequencingMap); // if the index is after the last goto at the dame date, we cann simply add the new goto at the end else sequencingMap.insertChild(gt, sequencingMap.indexOf((gotosAtSameDate.size() == 0) ? marker : gotosAtSameDate.get(index))); // otherwise insert the new goto at its respective position inbetween - if (firstGoto.getAttribute("first") != null) sequencingMap.removeChild(firstGoto); // in any case, if the first goto is a first ending's goto, remove it + if (firstGoto.getAttribute("first") != null) { // in any case, if the first goto is a first ending's goto, remove it + sequencingMap.removeChild(firstGoto); +// firstGoto.detach(); + } } } @@ -1530,8 +1536,8 @@ private void processMeasure(Element measure) { while (globalTsMap.getChildElements().size() > 0) { Element last = globalTsMap.getChildElements().get(globalTsMap.getChildCount() - 1); if (Double.parseDouble(last.getAttributeValue("date")) >= startDate) { -// last.detach(); globalTsMap.removeChild(last); +// last.detach(); } else break; } @@ -1561,8 +1567,8 @@ private void processMeasure(Element measure) { while (tsMap.getChildElements().size() > 0) { Element last = tsMap.getChildElements().get(tsMap.getChildCount() - 1); if (Double.parseDouble(last.getAttributeValue("date")) >= startDate) { -// last.detach(); tsMap.removeChild(last); +// last.detach(); } else break; } @@ -2253,8 +2259,8 @@ private void processDynam(Element dynam) { if (dynamicsStyle == null) // if there is none dynamicsStyle = (DynamicsStyle) this.helper.currentPerformance.getGlobal().getHeader().addStyleDef(Mpm.DYNAMICS_STYLE, "MEI export"); // create one - if ((dynamicsStyle != null) && (dynamicsStyle.getDynamicsDef(dd.volumeString) == null)) // it is obviously an instantanious dynamics instruction, but if its string is not defined in the global styleDef for dynamics - dynamicsStyle.addDynamicsDef(DynamicsDef.createDefaultDynamicsDef(dd.volumeString)); // add it to the styleDef and try to create a default numeric value for the volume literal + if ((dynamicsStyle != null) && (dynamicsStyle.getDef(dd.volumeString) == null)) // it is obviously an instantanious dynamics instruction, but if its string is not defined in the global styleDef for dynamics + dynamicsStyle.addDef(DynamicsDef.createDefaultDynamicsDef(dd.volumeString)); // add it to the styleDef and try to create a default numeric value for the volume literal } break; case "hairpin": // a hairpin (symbolic cresc. or dim. instruction) @@ -2525,7 +2531,7 @@ private void processArtic(Element artic) { ArticulationStyle articulationStyle = (ArticulationStyle) this.helper.currentPerformance.getGlobal().getHeader().getStyleDef(Mpm.ARTICULATION_STYLE, "MEI export"); // get the global articulationStyle/styleDef element if (articulationStyle == null) { // if there is none articulationStyle = (ArticulationStyle) this.helper.currentPerformance.getGlobal().getHeader().addStyleDef(Mpm.ARTICULATION_STYLE, "MEI export"); // create one - articulationStyle.addArticulationDef(ArticulationDef.createDefaultArticulationDef("nonlegato")); + articulationStyle.addDef(ArticulationDef.createDefaultArticulationDef("nonlegato")); } // find the local articulationMap @@ -2626,13 +2632,13 @@ private void addArticulationToMap(double date, String articulation, String id, S String[] articulations = articulation.trim().split("\\s+"); // get all articulation specifiers as individual strings for (String artic : articulations) { - if (articulationStyle.getArticulationDef(artic) == null) { + if (articulationStyle.getDef(artic) == null) { ArticulationDef def = ArticulationDef.createDefaultArticulationDef(artic); if (def == null) { System.err.println("Failed to generate articulationDef for \"" + artic + "\"."); continue; } - articulationStyle.addArticulationDef(def); + articulationStyle.addDef(def); } articulationMap.addArticulation(date, artic, ((noteid == null) ? null : ("#" + noteid)), id); // generate an articulation for the given id at the given date and with the specific descriptor } @@ -2677,7 +2683,7 @@ private void processBreath(Element breath) { ArticulationStyle articulationStyle = (ArticulationStyle) this.helper.currentPerformance.getGlobal().getHeader().getStyleDef(Mpm.ARTICULATION_STYLE, "MEI export"); // get the global articulationStyle/styleDef element if (articulationStyle == null) { // if there is none articulationStyle = (ArticulationStyle) this.helper.currentPerformance.getGlobal().getHeader().addStyleDef(Mpm.ARTICULATION_STYLE, "MEI export"); // create one - articulationStyle.getArticulationDef("defaultArticulation"); // the articulation style should define a defauult articulation which is here called defaultArticulation + articulationStyle.getDef("defaultArticulation"); // the articulation style should define a defauult articulation which is here called defaultArticulation } // find or generate the required articulationMaps and generate and insert the articulation instruction there @@ -3598,6 +3604,7 @@ public synchronized ArrayList resolveCopyofs() { for (Map.Entry placeholder : placeholders.entrySet()) { notResolved.add(placeholder.getKey().toXML()); // add all entries to the return list placeholder.getKey().getParent().removeChild(placeholder.getKey()); // delete all placeholders from the xml, we cannot resolve them anyway +// placeholder.getKey().detach(); } System.err.print(" circular copyof or sameas referencing detected, cannot be resolved,"); break; // stop the while loop @@ -3613,6 +3620,7 @@ public synchronized ArrayList resolveCopyofs() { if (found == null) { // if no element with this id has been found notResolved.add(placeholder.getKey().toXML()); // add entry to the return list placeholder.getKey().getParent().removeChild(placeholder.getKey()); // delete the placeholder from the xml, we cannot process it anyway +// placeholder.getKey().detach(); continue; // continue with the next placeholder } @@ -3680,6 +3688,7 @@ private void removeRendElements() { parent.appendChild(r.getValue()); parent.removeChild(r); +// r.detach(); count++; } @@ -3712,8 +3721,10 @@ private synchronized Element resolveExpansions(Element root) { if (expansion != null) { // remove all expansion elements from this regularizedRoot Elements expansions = regularizedRoot.getChildElements("expansion"); // get all expansion elements that are present as direct children of regularizedRoot - for (int i = expansions.size() - 1; i >= 0; --i) // delete all expansion elements from the regularizedRoot + for (int i = expansions.size() - 1; i >= 0; --i) { // delete all expansion elements from the regularizedRoot regularizedRoot.removeChild(expansions.get(i)); +// expansions.get(i).detach(); + } // parse the plist and write its content to expansionSequence if (expansion.getAttribute("plist") != null) { // if the expansion has a plist attribute @@ -3732,6 +3743,7 @@ private synchronized Element resolveExpansions(Element root) { Attribute childId = Helper.getAttribute("id", child); // get the child's id if (childId == null || !plist.contains(childId.getValue())) { // if it does not have one, it cannot be in the plist and will not be played or the id is not in the plist, again the child will not be played regularizedRoot.removeChild(child); // hence, delete it +// child.detach(); continue; // continue with the next child } } diff --git a/src/meico/mpm/Mpm.java b/src/meico/mpm/Mpm.java index 69d01e31..4f87b9ba 100644 --- a/src/meico/mpm/Mpm.java +++ b/src/meico/mpm/Mpm.java @@ -2,6 +2,7 @@ import meico.mei.Helper; import meico.mpm.elements.metadata.Author; +import meico.mpm.elements.metadata.Comment; import meico.mpm.elements.metadata.Metadata; import meico.mpm.elements.Performance; import meico.mpm.elements.metadata.RelatedResource; @@ -50,7 +51,7 @@ public class Mpm extends AbstractMsm { private final ArrayList performances = new ArrayList<>(); /** - * constructor + * Constructor. Be aware that this is not a valid MPM document until a first Performance has been added! */ public Mpm() { super(); @@ -141,7 +142,7 @@ public Mpm(InputStream inputStream, boolean validate, URL schema) throws IOExcep } /** - * an Mpm factory + * An Mpm factory. Be aware that this is not a valid MPM document until a first Performance has been added! * @return */ public static Mpm createMpm() { @@ -186,10 +187,10 @@ private Element init() { /** * add metadata to the MPM * @param author an Author object or null - * @param comment a string or null + * @param comment a Comment object or null * @return success */ - public boolean addMetadata(Author author, String comment, Collection relatedResources) { + public boolean addMetadata(Author author, Comment comment, Collection relatedResources) { if (this.metadata != null) { if (author != null) this.metadata.addAuthor(author); @@ -214,7 +215,8 @@ public boolean addMetadata(Author author, String comment, Collection getAllPerformances() { /** * add a performance to this mpm, but caution: if another performance with the same name exists already in this mpm, accessing it via getPerformance(name) will return only the first in the list * @param performance + * @return success */ - public void addPerformance(Performance performance) { + public boolean addPerformance(Performance performance) { + if (performance == null) + return false; this.getRootElement().appendChild(performance.getXml()); - this.performances.add(performance); + return this.performances.add(performance); } /** @@ -298,6 +303,7 @@ public void removePerformance(String name) { if (p.getName().equals(name)) { // with this name this.performances.remove(p); // get removed this.getRootElement().removeChild(p.getXml()); // also from the xml structure +// p.getXml().detach(); } } } @@ -307,8 +313,10 @@ public void removePerformance(String name) { * @param performance */ public void removePerformance(Performance performance) { - if (this.performances.remove(performance)) // if the performance was in this mpm and could be removed from the performances list + if (this.performances.remove(performance)) { // if the performance was in this mpm and could be removed from the performances list this.getRootElement().removeChild(performance.getXml()); // it can be removed from the xml structure +// performance.getXml().detach(); + } } /** diff --git a/src/meico/mpm/elements/Dated.java b/src/meico/mpm/elements/Dated.java index cdefc549..7142d516 100644 --- a/src/meico/mpm/elements/Dated.java +++ b/src/meico/mpm/elements/Dated.java @@ -227,8 +227,18 @@ else if (parent != this.getXml()) { */ public void removeMap(String type) { GenericMap m = this.maps.remove(type); - if (m != null) + if (m != null) { this.getXml().removeChild(m.getXml()); +// m.getXml().detach(); + } + } + + /** + * remove all maps from dated + */ + public void clear() { + this.getXml().removeChildren(); + this.maps.clear(); } /** diff --git a/src/meico/mpm/elements/Header.java b/src/meico/mpm/elements/Header.java index 14cb0ad9..f30ed84f 100644 --- a/src/meico/mpm/elements/Header.java +++ b/src/meico/mpm/elements/Header.java @@ -9,13 +9,14 @@ import java.util.HashMap; import java.util.LinkedList; +import java.util.Map; /** * This class interfaces MPM header information. * @author Axel Berndt */ public class Header extends AbstractXmlSubtree { - private HashMap> styleDefs = new HashMap<>(); // this hashmap addresses the style definitions in the form styleDefs.get(styleType, styleDefName); + private final HashMap> styleDefs = new HashMap<>(); // this hashmap addresses the style definitions in the form styleDefs.get(styleType, styleDefName); /** * constructor @@ -92,20 +93,13 @@ protected void parseData(Element xml) throws Exception { /** * add a new empty style type to the header, * if a type with this name is already existent, it will be replaced - * @param type the local name of the type, e.g. "tempoStyles" or "articulationStyles" + * @param type the local name of the type, e.g. "tempoStyles" or "articulationStyles", use the constants in Mpm (e.g. Mpm.ARTICULATION_STYLE) * @return the style collection just added, converted into a hashmap */ public HashMap addStyleType(String type) { - if (type.isEmpty()) + if ((type == null) || type.isEmpty()) return null; - - if (this.styleDefs.get(type) != null) // if there is already such a style - this.removeStyleType(type); // delete it - - this.getXml().appendChild(new Element(type)); - HashMap s = new HashMap<>(); - this.styleDefs.put(type, s); - return s; + return this.addStyleType(new Element(type, Mpm.MPM_NAMESPACE)); } /** @@ -166,8 +160,9 @@ public HashMap addStyleType(Element xml) { */ public void removeStyleType(String type) { if (this.styleDefs.remove(type) != null) { - Element typeElt = this.getXml().getFirstChildElement(type); + Element typeElt = this.getXml().getFirstChildElement(type, Mpm.MPM_NAMESPACE); this.getXml().removeChild(typeElt); +// typeElt.detach(); } } @@ -207,7 +202,7 @@ public GenericStyle getStyleDef(String type, String name) { * @param styleDef if there is already a styleDef with this name it will be replaced */ public void addStyleDef(String type, GenericStyle styleDef) { - if (type.isEmpty() || (styleDef == null)) + if ((type == null) || type.isEmpty() || (styleDef == null)) return; HashMap styleCollection = this.styleDefs.get(type); // get the style collection of the specified type @@ -276,7 +271,49 @@ public void removeStyleDef(String type, String name) { return; GenericStyle styleDef = styleCollection.remove(name); - if (styleDef != null) - this.getXml().getFirstChildElement("type").removeChild(styleDef.getXml()); + if (styleDef != null) { + this.getXml().getFirstChildElement(type, Mpm.MPM_NAMESPACE).removeChild(styleDef.getXml()); +// styleDef.getXml().detach(); + } + } + + /** + * Rename a styleDef. + * Caution: If there is already a styleDef with the newName it will be overwritten! + * @param type + * @param currentName + * @param newName + * @return + */ + public GenericStyle renameStyleDef(String type, String currentName, String newName) { + if (currentName.equals(newName)) + return this.getStyleDef(type, currentName); + + HashMap allStyleDefs = this.getAllStyleDefs(type); + if (allStyleDefs.isEmpty()) { + System.out.println("There are no styleDef elements for type " + type); + return null; + } + + GenericStyle styleDef = allStyleDefs.get(currentName); + if (styleDef == null) { + System.out.println("There is no styleDef element with name \"" + currentName + "\" to be renamed."); + return null; + } + + allStyleDefs.remove(newName); // if there is already an entry with this name itl will be removed/overwritten by the one that gets this name next + + Helper.getAttribute("name", styleDef.getXml()).setValue(newName); // set the new name in the xml + styleDef = allStyleDefs.remove(currentName); + allStyleDefs.put(newName, styleDef); // update the hashmap + return styleDef; + } + + /** + * remove all style collections of the header + */ + public void clear() { + this.getXml().removeChildren(); + this.styleDefs.clear(); } } diff --git a/src/meico/mpm/elements/Part.java b/src/meico/mpm/elements/Part.java index bb985cf8..6ff17b75 100644 --- a/src/meico/mpm/elements/Part.java +++ b/src/meico/mpm/elements/Part.java @@ -19,6 +19,7 @@ public class Part extends AbstractXmlSubtree { private int number = 0; // the part number private int midiChannel = 0; // the midi channel private int midiPort = 0; // the midi port + private Attribute id = null; // the id attribute /** * constructor for a plain/empty Part object @@ -64,6 +65,27 @@ public static Part createPart(String name, int number, int midiChannel, int midi return part; } + /** + * part factory + * @param name the name of the part, can be "" (empty string) + * @param number + * @param midiChannel + * @param midiPort + * @param id + * @return + */ + public static Part createPart(String name, int number, int midiChannel, int midiPort, String id) { + Part part; + try { + part = new Part(name, number, midiChannel, midiPort); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + part.setId(id); + return part; + } + /** * part factory * @param xml @@ -115,6 +137,7 @@ protected void parseData(Element xml) throws Exception { this.number = Integer.parseInt(number.getValue()); this.midiChannel = Integer.parseInt(midiChannelAtt.getValue()); this.midiPort = Integer.parseInt(midiPortAtt.getValue()); + this.id = Helper.getAttribute("id", this.getXml()); // make sure that this element is really a "part" element if (!this.getXml().getLocalName().equals("part")) { @@ -244,4 +267,38 @@ public void setGlobal(Global global) { public Global getGlobal() { return this.global; } + + /** + * set the part's id + * @param id a xml:id string or null + */ + public void setId(String id) { + if (id == null) { + if (this.id != null) { + this.id.detach(); + this.id = null; + } + return; + } + + if (this.id == null) { + this.id = new Attribute("id", id); + this.id.setNamespace("xml", "http://www.w3.org/XML/1998/namespace"); // set correct namespace + this.getXml().addAttribute(this.id); + return; + } + + this.id.setValue(id); + } + + /** + * get the part's id + * @return a string or null + */ + public String getId() { + if (this.id == null) + return null; + + return this.id.getValue(); + } } diff --git a/src/meico/mpm/elements/Performance.java b/src/meico/mpm/elements/Performance.java index 55ef7b89..f2ce6bf8 100644 --- a/src/meico/mpm/elements/Performance.java +++ b/src/meico/mpm/elements/Performance.java @@ -24,6 +24,7 @@ public class Performance extends AbstractXmlSubtree { private int pulsesPerQuarter = 720; // the timing resolution of symbolic time (midi.date etc.) private Global global = null; // the global performance information private ArrayList parts = new ArrayList<>(); // the local performance information + private Attribute id = null; // the id attribute /** * This constructor generates an empty performance with only a name, global and dated environment. @@ -64,6 +65,46 @@ public static Performance createPerformance(String name) { return performance; } + /** + * performance factory + * + * @param name the name of the performance + * @param pulsesPerQuarter + * @return + */ + public static Performance createPerformance(String name, int pulsesPerQuarter) { + Performance performance; + try { + performance = new Performance(name); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + performance.setPulsesPerQuarter(pulsesPerQuarter); + return performance; + } + + /** + * performance factory + * + * @param name the name of the performance + * @param pulsesPerQuarter + * @param id + * @return + */ + public static Performance createPerformance(String name, int pulsesPerQuarter, String id) { + Performance performance; + try { + performance = new Performance(name); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + performance.setPulsesPerQuarter(pulsesPerQuarter); + performance.setId(id); + return performance; + } + /** * performance factory * @@ -99,6 +140,7 @@ protected void parseData(Element xml) throws Exception { this.setXml(xml); this.name = Helper.getAttribute("name", this.getXml()); + this.id = Helper.getAttribute("id", this.getXml()); // make sure that this element is really a "performance" element if (!this.getXml().getLocalName().equals("performance")) { @@ -201,17 +243,20 @@ public Part getPart(int midiChannel, int midiPort) { /** * add the part to the performance, * caution: if another part with the same number exists already in this performance, getPart(number) will return only the first - * * @param part + * @return success */ - public void addPart(Part part) { + public boolean addPart(Part part) { + if ((part == null) || (this.parts.contains(part))) + return false; + Element parent = (Element) part.getXml().getParent(); if ((parent == null) || (parent != this.getXml())) { part.getXml().detach(); this.getXml().appendChild(part.getXml()); // add the xml code of the part to the performance's xml } part.setGlobal(this.getGlobal()); // link to the global environment where the part may find related information (styleDefs etc.) - this.parts.add(part); + return this.parts.add(part); } /** @@ -224,6 +269,7 @@ public void removePart(int number) { if (p.getNumber() == number) { this.parts.remove(p); this.getXml().removeChild(p.getXml()); +// p.getXml().detach(); } } } @@ -238,6 +284,7 @@ public void removePart(String name) { if (p.getName().equals(name)) { this.parts.remove(p); this.getXml().removeChild(p.getXml()); +// p.getXml().detach(); } } } @@ -250,6 +297,7 @@ public void removePart(String name) { public void removePart(Part part) { if (this.parts.remove(part)) { // if the part was in this performance and could be removed from the parts list this.getXml().removeChild(part.getXml()); // it can be removed from the xml structure +// part.getXml().detach(); } } @@ -550,4 +598,38 @@ private static GenericMap addMsmMapToList(String mapName, Element msmDated, Arra } return null; } + + /** + * set the performance's id + * @param id a xml:id string or null + */ + public void setId(String id) { + if (id == null) { + if (this.id != null) { + this.id.detach(); + this.id = null; + } + return; + } + + if (this.id == null) { + this.id = new Attribute("id", id); + this.id.setNamespace("xml", "http://www.w3.org/XML/1998/namespace"); // set correct namespace + this.getXml().addAttribute(this.id); + return; + } + + this.id.setValue(id); + } + + /** + * get the performance's id + * @return a string or null + */ + public String getId() { + if (this.id == null) + return null; + + return this.id.getValue(); + } } diff --git a/src/meico/mpm/elements/maps/ArticulationMap.java b/src/meico/mpm/elements/maps/ArticulationMap.java index 7f4dd427..7958f94a 100644 --- a/src/meico/mpm/elements/maps/ArticulationMap.java +++ b/src/meico/mpm/elements/maps/ArticulationMap.java @@ -279,7 +279,7 @@ private ArticulationData getArticulationDataOf(int index) { if (att != null) { ad.articulationDefName = att.getValue(); if (ad.style != null) - ad.articulationDef = ad.style.getArticulationDef(ad.articulationDefName); + ad.articulationDef = ad.style.getDef(ad.articulationDefName); } att = Helper.getAttribute("absoluteDuration", e); @@ -351,7 +351,7 @@ private void findStyle(int index, ArticulationData ad) { if (att != null) { ad.defaultArticulation = att.getValue(); if (ad.style != null) - ad.defaultArticulationDef = ad.style.getArticulationDef(ad.defaultArticulation); + ad.defaultArticulationDef = ad.style.getDef(ad.defaultArticulation); } return; } @@ -413,7 +413,7 @@ public void renderArticulationToMap_noMillisecondModifiers(GenericMap map) { continue; } - ArticulationDef aDef = aStyle.getArticulationDef(defaultArticulationAtt.getValue()); + ArticulationDef aDef = aStyle.getDef(defaultArticulationAtt.getValue()); if (aDef == null) System.err.println("Warning: attribute " + Helper.getAttribute("defaultArticulation", styleEntry.getValue()).toXML() + " in style element refers to an unknown articulationDef."); defaultArticulations.add(new KeyValue<>(styleEntry.getKey(), aDef)); diff --git a/src/meico/mpm/elements/maps/DynamicsMap.java b/src/meico/mpm/elements/maps/DynamicsMap.java index 2c417939..204cf3cb 100644 --- a/src/meico/mpm/elements/maps/DynamicsMap.java +++ b/src/meico/mpm/elements/maps/DynamicsMap.java @@ -4,6 +4,7 @@ import meico.mpm.Mpm; import meico.mpm.elements.styles.DynamicsStyle; import meico.mpm.elements.styles.GenericStyle; +import meico.mpm.elements.styles.defs.DynamicsDef; import meico.supplementary.KeyValue; import meico.mpm.elements.maps.data.DynamicsData; import nu.xom.Attribute; @@ -322,14 +323,14 @@ private DynamicsData getDynamicsDataOf(int index) { break; } } - GenericStyle gStyle = this.getStyle(Mpm.DYNAMICS_STYLE, dd.styleName); // read the dynamics style + DynamicsStyle gStyle = (DynamicsStyle) this.getStyle(Mpm.DYNAMICS_STYLE, dd.styleName); // read the dynamics style if (gStyle != null) - dd.style = (DynamicsStyle) gStyle; + dd.style = gStyle; att = Helper.getAttribute("name.ref", e); if (att != null) { // name.ref attribute is mandatory dd.dynamicsDefString = att.getValue(); - dd.dynamicsDef = dd.style.getDynamicsDef(dd.dynamicsDefString); + dd.dynamicsDef = dd.style.getDef(dd.dynamicsDefString); } att = Helper.getAttribute("volume", e); diff --git a/src/meico/mpm/elements/maps/GenericMap.java b/src/meico/mpm/elements/maps/GenericMap.java index e53f76a4..96055a10 100644 --- a/src/meico/mpm/elements/maps/GenericMap.java +++ b/src/meico/mpm/elements/maps/GenericMap.java @@ -127,6 +127,7 @@ private void sortXml() { for (int i = 0; i < this.elements.size(); ++i) { // for each element Element e = this.elements.get(i).getValue(); xml.removeChild(e); // remove the element wherever it is +// e.detach(); xml.insertChild(e, i); // and add it at its correct index } } @@ -524,6 +525,7 @@ public void removeElement(int index) { Element e = this.elements.get(index).getValue(); this.getXml().removeChild(e); +// e.detach(); this.elements.remove(index); } @@ -535,6 +537,7 @@ public void removeElement(Element xml) { for (KeyValue e : this.elements) { if (e.getValue() == xml) { this.getXml().removeChild(xml); +// xml.detach(); this.elements.remove(e); return; } @@ -644,6 +647,7 @@ public boolean applySequencingMap(Element sequencingMap) { } parent.removeChild(oldXmlData); // remove the old map from the xml tree +// oldXmlData.detach(); return true; } diff --git a/src/meico/mpm/elements/maps/MetricalAccentuationMap.java b/src/meico/mpm/elements/maps/MetricalAccentuationMap.java index 6bcfc2cf..6aef21a8 100644 --- a/src/meico/mpm/elements/maps/MetricalAccentuationMap.java +++ b/src/meico/mpm/elements/maps/MetricalAccentuationMap.java @@ -4,6 +4,7 @@ import meico.mpm.Mpm; import meico.mpm.elements.styles.GenericStyle; import meico.mpm.elements.styles.MetricalAccentuationStyle; +import meico.mpm.elements.styles.defs.AccentuationPatternDef; import meico.supplementary.KeyValue; import meico.mpm.elements.maps.data.MetricalAccentuationData; import nu.xom.Attribute; @@ -225,10 +226,10 @@ private MetricalAccentuationData getMetricalAccentuationDataOf(int index) { break; } } - GenericStyle gStyle = this.getStyle(Mpm.METRICAL_ACCENTUATION_STYLE, md.styleName); // read the metrical accentuation style + MetricalAccentuationStyle gStyle = (MetricalAccentuationStyle) this.getStyle(Mpm.METRICAL_ACCENTUATION_STYLE, md.styleName); // read the metrical accentuation style if (gStyle != null) { - md.style = (MetricalAccentuationStyle) gStyle; - md.accentuationPatternDef = md.style.getAccentuationPatternDef(md.accentuationPatternDefName); + md.style = gStyle; + md.accentuationPatternDef = md.style.getDef(md.accentuationPatternDefName); return md; // only if we have accentuationPatternDef data we have what we need for working with the accentuation pattern } } diff --git a/src/meico/mpm/elements/maps/RubatoMap.java b/src/meico/mpm/elements/maps/RubatoMap.java index f22f1499..822b3c48 100644 --- a/src/meico/mpm/elements/maps/RubatoMap.java +++ b/src/meico/mpm/elements/maps/RubatoMap.java @@ -4,6 +4,7 @@ import meico.mpm.Mpm; import meico.mpm.elements.styles.GenericStyle; import meico.mpm.elements.styles.RubatoStyle; +import meico.mpm.elements.styles.defs.RubatoDef; import meico.supplementary.KeyValue; import meico.mpm.elements.maps.data.RubatoData; import nu.xom.Attribute; @@ -248,14 +249,14 @@ private RubatoData getRubatoDataOf(int index) { break; } } - GenericStyle gStyle = this.getStyle(Mpm.DYNAMICS_STYLE, rd.styleName); // read the rubato style + RubatoStyle gStyle = (RubatoStyle) this.getStyle(Mpm.DYNAMICS_STYLE, rd.styleName); // read the rubato style if (gStyle != null) - rd.style = (RubatoStyle) gStyle; + rd.style = gStyle; att = Helper.getAttribute("name.ref", e); if (att != null) { // name.ref attribute is mandatory rd.rubatoDefString = att.getValue(); - rd.rubatoDef = rd.style.getRubatoDef(rd.rubatoDefString); + rd.rubatoDef = rd.style.getDef(rd.rubatoDefString); } att = Helper.getAttribute("frameLength", e); diff --git a/src/meico/mpm/elements/maps/TempoMap.java b/src/meico/mpm/elements/maps/TempoMap.java index b3293e69..dda8c349 100644 --- a/src/meico/mpm/elements/maps/TempoMap.java +++ b/src/meico/mpm/elements/maps/TempoMap.java @@ -229,9 +229,9 @@ private TempoData getTempoDataOf(int index) { break; } } - GenericStyle gStyle = this.getStyle(Mpm.TEMPO_STYLE, td.styleName); // read the tempo style + TempoStyle gStyle = (TempoStyle) this.getStyle(Mpm.TEMPO_STYLE, td.styleName); // read the tempo style if (gStyle != null) - td.style = (TempoStyle) gStyle; + td.style = gStyle; td.bpmString = bpmAtt.getValue(); td.bpm = TempoStyle.getNumericBpmValue(td.bpmString, td.style); // get numeric tempo value diff --git a/src/meico/mpm/elements/metadata/Author.java b/src/meico/mpm/elements/metadata/Author.java index 148fa7b9..11c4954f 100644 --- a/src/meico/mpm/elements/metadata/Author.java +++ b/src/meico/mpm/elements/metadata/Author.java @@ -88,7 +88,7 @@ protected void parseData(Element xml) throws Exception { } /** - * the the author's name + * set the author's name * @param name */ public void setName(String name) { @@ -150,13 +150,13 @@ public void setId(String id) { } if (this.id == null) { - this.id = new Attribute("number", id); + this.id = new Attribute("id", id); this.id.setNamespace("xml", "http://www.w3.org/XML/1998/namespace"); // set correct namespace this.getXml().addAttribute(this.id); return; } - this.number.setValue(id); + this.id.setValue(id); } /** diff --git a/src/meico/mpm/elements/metadata/Comment.java b/src/meico/mpm/elements/metadata/Comment.java new file mode 100644 index 00000000..f5b65db1 --- /dev/null +++ b/src/meico/mpm/elements/metadata/Comment.java @@ -0,0 +1,132 @@ +package meico.mpm.elements.metadata; + +import meico.mei.Helper; +import meico.mpm.Mpm; +import meico.xml.AbstractXmlSubtree; +import nu.xom.Attribute; +import nu.xom.Element; +import nu.xom.Text; + +/** + * This class interfaces the comment element of MPM. + * @author Axel Berndt + */ +public class Comment extends AbstractXmlSubtree { + private Text text = null; + private Attribute id = null; + + /** + * this constructor instantiates the Comment object from an existing xml source handed over as XOM Element + * @param xml + * @throws Exception + */ + private Comment(Element xml) throws Exception { + this.parseData(xml); + } + + /** + * comment factory + * @param xml + * @return + */ + public static Comment createComment(Element xml) { + Comment comment; + try { + comment = new Comment(xml); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + return comment; + } + + /** + * This factory generates a comment object from raw data. + * @param text a string or null (for an empty comment) + * @param id an id string or null + * @return + */ + public static Comment createComment(String text, String id) { + Element commentElt = new Element("comment", Mpm.MPM_NAMESPACE); + Comment comment = Comment.createComment(commentElt); + + if (comment == null) + return null; + + comment.setText(text); + comment.setId(id); + + return comment; + } + + /** + * parse the comment element and set the according class variables + * @param xml + * @throws Exception + */ + @Override + protected void parseData(Element xml) throws Exception { + if (xml == null) + throw new Exception("Cannot generate Comment object. XML Element is null."); + + this.setXml(xml); + + if ((xml.getChildCount() == 0) || !(xml.getChild(0) instanceof Text)) { // if no text node is given in the xml source + this.text = new Text(""); // generate a placeholder text node + xml.appendChild(this.text); // add it to the xml + } else + this.text = (Text) xml.getChild(0); + + this.id = Helper.getAttribute("id", xml); + } + + /** + * set the comment's text + * @param text + */ + public void setText(String text) { + this.text.setValue(text); + } + + /** + * get the comment's text + * @return + */ + public String getText() { + return this.text.getValue(); + } + + /** + * set the comment's id + * @param id a xml:id string or null + */ + public void setId(String id) { + if (id == null) { + if (this.id != null) { + this.id.detach(); + this.id = null; + } + return; + } + + if (this.id == null) { + this.id = new Attribute("id", id); + this.id.setNamespace("xml", "http://www.w3.org/XML/1998/namespace"); // set correct namespace + this.getXml().addAttribute(this.id); + return; + } + + this.id.setValue(id); + } + + /** + * get the comment's id + * @return a string or null + */ + public String getId() { + if (this.id == null) + return null; + + return this.id.getValue(); + } +} diff --git a/src/meico/mpm/elements/metadata/Metadata.java b/src/meico/mpm/elements/metadata/Metadata.java index d4a72df8..30cb5e7e 100644 --- a/src/meico/mpm/elements/metadata/Metadata.java +++ b/src/meico/mpm/elements/metadata/Metadata.java @@ -17,7 +17,7 @@ */ public class Metadata extends AbstractXmlSubtree { private final ArrayList authors = new ArrayList<>(); // the list of authors - private final ArrayList comments = new ArrayList<>(); // the list of comments + private final ArrayList comments = new ArrayList<>(); // the list of comments private final ArrayList relatedResources = new ArrayList<>(); // the related resources /** @@ -36,17 +36,14 @@ private Metadata(Element xml) throws Exception { * @param relatedResources * @throws Exception */ - private Metadata(Author author, String comment, Collection relatedResources) throws Exception { + private Metadata(Author author, Comment comment, Collection relatedResources) throws Exception { Element metadata = new Element("metadata", Mpm.MPM_NAMESPACE); if (author != null) metadata.appendChild(author.getXml()); - if (comment != null) { - Element com = new Element("comment", Mpm.MPM_NAMESPACE); - com.appendChild(new Text(comment)); - metadata.appendChild(com); - } + if (comment != null) + metadata.appendChild(comment.getXml()); if ((relatedResources != null) && !relatedResources.isEmpty()) { Element relatedResourcesElt = new Element("relatedResources"); @@ -95,7 +92,7 @@ public static Metadata createMetadata(Author author) { * @param comment * @return */ - public static Metadata createMetadata(String comment) { + public static Metadata createMetadata(Comment comment) { Metadata metadata; try { metadata = new Metadata(null, comment, null); @@ -129,7 +126,7 @@ public static Metadata createMetadata(Collection relatedResourc * @param relatedResources * @return */ - public static Metadata createMetadata(Author author, String comment, Collection relatedResources) { + public static Metadata createMetadata(Author author, Comment comment, Collection relatedResources) { Metadata metadata; try { metadata = new Metadata(author, comment, relatedResources); @@ -163,7 +160,9 @@ protected void parseData(Element xml) throws Exception { this.authors.add(author); break; case "comment": - this.comments.add(child); + Comment comment = Comment.createComment(child); + if (comment != null) + this.comments.add(comment); break; case "relatedResources": LinkedList resources = Helper.getAllChildElements("resource", child); @@ -184,9 +183,12 @@ protected void parseData(Element xml) throws Exception { /** * add an author to the metadata * @param author - * @return the index at which it has been added + * @return the index at which it has been added or -1 if failed */ public int addAuthor(Author author) { + if (author == null) + return -1; + this.getXml().appendChild(author.getXml()); this.authors.add(author); return this.authors.size() - 1; @@ -233,24 +235,34 @@ public ArrayList getAuthor(String name) { public void removeAuthor(String name) { ArrayList auts = this.getAuthor(name); // find all authors with the specified name (there can be more than one) for (Author aut : auts) { // remove them - aut.getXml().detach(); - auts.remove(aut); +// aut.getXml().detach(); + this.getXml().removeChild(aut.getXml()); + this.authors.remove(aut); + } + } + + /** + * remove the specified author from the metadata + * @param author + */ + public void removeAuthor(Author author) { + if (this.authors.contains(author)) { + this.getXml().removeChild(author.getXml()); + this.authors.remove(author); } } /** * add a comment to the metadata * @param comment - * @return the index at which it has been added + * @return the index at which it has been added or -1 if failed */ - public int addComment(String comment) { + public int addComment(Comment comment) { if (comment == null) - comment = ""; + return -1; - Element c = new Element("comment", Mpm.MPM_NAMESPACE); - c.appendChild(comment); - this.getXml().appendChild(c); - this.comments.add(c); + this.getXml().appendChild(comment.getXml()); + this.comments.add(comment); return this.comments.size() - 1; } @@ -258,7 +270,7 @@ public int addComment(String comment) { * access the comments * @return */ - public ArrayList getComments() { + public ArrayList getComments() { return this.comments; } @@ -267,8 +279,8 @@ public ArrayList getComments() { * @param index * @return */ - public String getComment(int index) { - return this.comments.get(index).getValue(); + public Comment getComment(int index) { + return this.comments.get(index); } /** @@ -276,18 +288,31 @@ public String getComment(int index) { * @param index the index of the comment object */ public void removeComment(int index) { - Element comment = this.comments.get(index); - comment.detach(); - this.getXml().removeChild(comment); - this.comments.remove(index); + Comment comment = this.getComment(index); + this.getXml().removeChild(comment.getXml()); + this.comments.remove(comment); + } + + /** + * remove the specified comment from the metadata + * @param comment + */ + public void removeComment(Comment comment) { + if (this.comments.contains(comment)) { + this.getXml().removeChild(comment.getXml()); + this.comments.remove(comment); + } } /** * add a related resource to the metadata * @param relatedResource - * @return the index where the resource is added + * @return the index where the resource is added or -1 if failed */ public int addRelatedResource(RelatedResource relatedResource) { + if (relatedResource == null) + return -1; + Element relatedResourcesElt = Helper.getFirstChildElement("relatedResources", this.getXml()); if (relatedResourcesElt == null) { relatedResourcesElt = new Element("relatedResources", Mpm.MPM_NAMESPACE); @@ -340,14 +365,14 @@ public void removeRelatedResource(RelatedResource relatedResource) { if (relatedResourcesElt == null) return; - relatedResource.getXml().detach(); relatedResourcesElt.removeChild(relatedResource.getXml()); +// relatedResource.getXml().detach(); this.relatedResources.remove(relatedResource); // it is not allowed to have an empty relatedResources list, so make sure it is deleted when empty if (relatedResourcesElt.getChildCount() == 0) { - relatedResourcesElt.detach(); this.getXml().removeChild(relatedResourcesElt); +// relatedResourcesElt.detach(); } } } diff --git a/src/meico/mpm/elements/styles/ArticulationStyle.java b/src/meico/mpm/elements/styles/ArticulationStyle.java index eaf46a34..0e783a87 100644 --- a/src/meico/mpm/elements/styles/ArticulationStyle.java +++ b/src/meico/mpm/elements/styles/ArticulationStyle.java @@ -13,9 +13,7 @@ * and assotiate it with an instance of ArticulationDef. * @author Axel Berndt */ -public class ArticulationStyle extends GenericStyle { - private HashMap articulationDefs; // the lookup table for tempoDefs (name -> ArticulationDef) - +public class ArticulationStyle extends GenericStyle { /** * this constructor generates an empty styleDef for dynamicsDefs to be added subsequently * @param name @@ -50,6 +48,24 @@ public static ArticulationStyle createArticulationStyle(String name) { return articulationStyle; } + /** + * ArticulationStyle factory + * @param name + * @param id + * @return + */ + public static ArticulationStyle createArticulationStyle(String name, String id) { + ArticulationStyle articulationStyle; + try { + articulationStyle = new ArticulationStyle(name); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + articulationStyle.setId(id); + return articulationStyle; + } + /** * ArticulationStyle factory * @param xml @@ -73,75 +89,13 @@ public static ArticulationStyle createArticulationStyle(Element xml) { protected void parseData(Element xml) throws Exception { super.parseData(xml); - this.articulationDefs = new HashMap<>(); - // parse the articulationDef elements (the children of this styleDef) LinkedList articDefs = Helper.getAllChildElements("articulationDef", this.getXml()); for (Element articDef : articDefs) { // for each articulationDef ArticulationDef ad = ArticulationDef.createArticulationDef(articDef); if (ad == null) continue; - this.articulationDefs.put(ad.getName(), ad); // add the (name, ArticulationDef) pair to the lookup table + this.defs.put(ad.getName(), ad); // add the (name, ArticulationDef) pair to the lookup table } } - - /** - * access the whole HashMap with (name, ArticulationDef) pairs - * @return - */ - public HashMap getAllArticulationDefs() { - return this.articulationDefs; - } - - /** - * retrieve a specific articulationDef - * @param name - * @return - */ - public ArticulationDef getArticulationDef(String name) { - return this.articulationDefs.get(name); - } - - /** - * add or (if a articulationDef with this name is already existent) replace the articulationDef - * @param articulationDef the ArticulationDef instance to be added, if there is already one with this name, it is replaced - */ - public void addArticulationDef(ArticulationDef articulationDef) { - if (articulationDef == null) { - System.err.println("Cannot add a null ArticulationDef to the styleDef."); - return; - } - removeArticulationDef(articulationDef.getName()); // if there is already a articulationDef with this name, remove it - this.articulationDefs.put(articulationDef.getName(), articulationDef); - this.getXml().appendChild(articulationDef.getXml()); - } - - /** - * remove the specified articulationDef from this styleDef - * @param name - */ - public void removeArticulationDef(String name) { - ArticulationDef ad = this.articulationDefs.get(name); // get the xml element of this articulationDef - if (ad == null) // if there is no such articulationDef - return; // done - - this.articulationDefs.remove(name); // remove the (name, values) lookup table entry - this.getXml().removeChild(ad.getXml()); // remove the element from the xml - } - - /** - * get the number of articulationDefs in this styleDef - * @return - */ - public int size() { - return this.articulationDefs.size(); - } - - /** - * does the styleDef contain articulationDefs? - * @return - */ - public boolean isEmpty() { - return this.articulationDefs.isEmpty(); - } } diff --git a/src/meico/mpm/elements/styles/DynamicsStyle.java b/src/meico/mpm/elements/styles/DynamicsStyle.java index 685ca3db..2e79a17b 100644 --- a/src/meico/mpm/elements/styles/DynamicsStyle.java +++ b/src/meico/mpm/elements/styles/DynamicsStyle.java @@ -13,9 +13,7 @@ * and assotiate it with an instance of DynamicsDef. * @author Axel Berndt */ -public class DynamicsStyle extends GenericStyle { - private HashMap dynamicsDefs; // the lookup table for dynamicsDefs - +public class DynamicsStyle extends GenericStyle { /** * this constructor generates an empty styleDef for dynamicsDefs to be added subsequently * @param name @@ -50,6 +48,24 @@ public static DynamicsStyle createDynamicsStyle(String name) { return dynamicsStyle; } + /** + * DynamicsStyle factory + * @param name + * @param id + * @return + */ + public static DynamicsStyle createDynamicsStyle(String name, String id) { + DynamicsStyle dynamicsStyle; + try { + dynamicsStyle = new DynamicsStyle(name); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + dynamicsStyle.setId(id); + return dynamicsStyle; + } + /** * DynamicsStyle factory * @param xml @@ -73,15 +89,13 @@ public static DynamicsStyle createDynamicsStyle(Element xml) { protected void parseData(Element xml) throws Exception { super.parseData(xml); - this.dynamicsDefs = new HashMap<>(); - // parse the dynamicsDef elements (the children of this styleDef) LinkedList dynamicsDefs = Helper.getAllChildElements("dynamicsDef", this.getXml()); for (Element def : dynamicsDefs) { // for each dynamicsDef DynamicsDef dd = DynamicsDef.createDynamicsDef(def); if (dd == null) continue; - this.dynamicsDefs.put(dd.getName(), dd); // add the (name, DynamicsDef) pair to the lookup table + this.defs.put(dd.getName(), dd); // add the (name, DynamicsDef) pair to the lookup table } } @@ -91,7 +105,7 @@ protected void parseData(Element xml) throws Exception { * @return the numeric dynamics value or 100.0 if everything else fails */ public double getNumericValue(String dynamicsString) { - DynamicsDef dynamicsDef = this.getDynamicsDef(dynamicsString); + DynamicsDef dynamicsDef = this.getDef(dynamicsString); if (dynamicsDef != null) return dynamicsDef.getValue(); try { @@ -109,7 +123,7 @@ public double getNumericValue(String dynamicsString) { * @return the numeric dynamics value or 100.0 if everything else fails */ public static double getNumericValue(String dynamicsString, DynamicsStyle style) { - DynamicsDef dynamicsDef = (style != null) ? style.getDynamicsDef(dynamicsString) : null; + DynamicsDef dynamicsDef = (style != null) ? style.getDef(dynamicsString) : null; if (dynamicsDef != null) return dynamicsDef.getValue(); @@ -120,64 +134,4 @@ public static double getNumericValue(String dynamicsString, DynamicsStyle style) return 100.0; } } - - /** - * access the whole HashMap with (name, DynamicsDef) pairs - * @return - */ - public HashMap getAllDynamicsDefs() { - return this.dynamicsDefs; - } - - /** - * retrieve a specific DynamicsDef - * @param name - * @return - */ - public DynamicsDef getDynamicsDef(String name) { - return this.dynamicsDefs.get(name); - } - - /** - * add or (if a DynamicsDef with this name is already existent) replace the DynamicsDef - * @param dynamicsDef the DynamicsDef instance to be added, if there is already one with this name, it is replaced - */ - public void addDynamicsDef(DynamicsDef dynamicsDef) { - if (dynamicsDef == null) { - System.err.println("Cannot add a null DynamicsDef to the styleDef."); - return; - } - removeDynamicsDef(dynamicsDef.getName()); // if there is already a dynamicsDef with this name, remove it - this.dynamicsDefs.put(dynamicsDef.getName(), dynamicsDef); - this.getXml().appendChild(dynamicsDef.getXml()); - } - - /** - * remove the specified DynamicsDef from this styleDef - * @param name - */ - public void removeDynamicsDef(String name) { - DynamicsDef rd = this.dynamicsDefs.get(name); // get the xml element of this dynamicsDef - if (rd == null) // if there is no such dynamicsDef - return; // done - - this.dynamicsDefs.remove(name); // remove the (name, values) lookup table entry - this.getXml().removeChild(rd.getXml()); // remove the element from the xml - } - - /** - * get the number of dynamicsDefs in this styleDef - * @return - */ - public int size() { - return this.dynamicsDefs.size(); - } - - /** - * does the styleDef contain dynamicsDefs? - * @return - */ - public boolean isEmpty() { - return this.dynamicsDefs.isEmpty(); - } } diff --git a/src/meico/mpm/elements/styles/GenericStyle.java b/src/meico/mpm/elements/styles/GenericStyle.java index c6c0cb95..2783b44e 100644 --- a/src/meico/mpm/elements/styles/GenericStyle.java +++ b/src/meico/mpm/elements/styles/GenericStyle.java @@ -2,16 +2,23 @@ import meico.mei.Helper; import meico.mpm.Mpm; +import meico.mpm.elements.styles.defs.AbstractDef; +import meico.mpm.elements.styles.defs.ArticulationDef; +import meico.mpm.elements.styles.defs.TempoDef; import meico.xml.AbstractXmlSubtree; import nu.xom.Attribute; import nu.xom.Element; +import java.util.HashMap; + /** * This class interfaces MPM styleDef elements. * @author Axel Berndt */ -public class GenericStyle extends AbstractXmlSubtree { - private Attribute name; // a quick link to the name of the styleDef +public class GenericStyle extends AbstractXmlSubtree { + private Attribute name; // a quick link to the name of the styleDef + protected Attribute id = null; // the id attribute + protected HashMap defs; // the lookup table for the defs /** * constructor, generates an empty styleDef with the specified name @@ -49,6 +56,24 @@ public static GenericStyle createGenericStyle(String name) { return genericStyle; } + /** + * GenericStyle factory + * @param name + * @param id + * @return + */ + public static GenericStyle createGenericStyle(String name, String id) { + GenericStyle genericStyle; + try { + genericStyle = new GenericStyle(name); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + genericStyle.setId(id); + return genericStyle; + } + /** * GenericStyle factory * @param xml @@ -84,6 +109,10 @@ protected void parseData(Element xml) throws Exception { if (!this.getXml().getLocalName().equals("styleDef")) { this.getXml().setLocalName("styleDef"); } + + this.id = Helper.getAttribute("id", this.getXml()); + + this.defs = new HashMap<>(); } /** @@ -101,4 +130,99 @@ public String getName() { protected void setName(String name) { this.name.setValue(name); } + + /** + * set the id + * @param id a xml:id string or null + */ + public void setId(String id) { + if (id == null) { + if (this.id != null) { + this.id.detach(); + this.id = null; + } + return; + } + + if (this.id == null) { + this.id = new Attribute("id", id); + this.id.setNamespace("xml", "http://www.w3.org/XML/1998/namespace"); // set correct namespace + this.getXml().addAttribute(this.id); + return; + } + + this.id.setValue(id); + } + + /** + * get the id + * @return a string or null + */ + public String getId() { + if (this.id == null) + return null; + + return this.id.getValue(); + } + + /** + * access the whole HashMap with (name, ...Def) pairs + * @return + */ + public HashMap getAllDefs() { + return this.defs; + } + + /** + * retrieve a specific def + * @param name + * @return + */ + public E getDef(String name) { + return this.defs.get(name); + } + + /** + * add or (if a def with this name is already existent) replace the def + * @param def the ...Def instance to be added, if there is already one with this name, it is replaced + */ + public void addDef(E def) { + if (def == null) { + System.err.println("Cannot add a null object to the styleDef."); + return; + } + removeDef(def.getName()); // if there is already a def with this name, remove it + this.defs.put(def.getName(), def); + this.getXml().appendChild(def.getXml()); + } + + /** + * remove the specified def from this styleDef + * @param name + */ + public void removeDef(String name) { + E ad = this.defs.get(name); // get the xml element of this def + if (ad == null) // if there is no such def + return; // done + + this.defs.remove(name); // remove the (name, values) lookup table entry + this.getXml().removeChild(ad.getXml()); // remove the element from the xml +// ad.getXml().detach(); + } + + /** + * get the number of defs in this styleDef + * @return + */ + public int size() { + return this.defs.size(); + } + + /** + * does the styleDef contain defs? + * @return + */ + public boolean isEmpty() { + return this.defs.isEmpty(); + } } diff --git a/src/meico/mpm/elements/styles/MetricalAccentuationStyle.java b/src/meico/mpm/elements/styles/MetricalAccentuationStyle.java index 6fc6774c..4568bc3e 100644 --- a/src/meico/mpm/elements/styles/MetricalAccentuationStyle.java +++ b/src/meico/mpm/elements/styles/MetricalAccentuationStyle.java @@ -13,9 +13,7 @@ * and assotiate it with an instance of AccentuationPatternDef. * @author Axel Berndt */ -public class MetricalAccentuationStyle extends GenericStyle { - private HashMap accentuationPatternDefs; // the lookup table for AccentuationPatternDef - +public class MetricalAccentuationStyle extends GenericStyle { /** * this constructor generates an empty styleDef for AccentuationPatternDefs to be added subsequently * @param name @@ -50,6 +48,24 @@ public static MetricalAccentuationStyle createMetricalAccentuationStyle(String n return metricalAccentuationStyle; } + /** + * MetricalAccentuationStyle factory + * @param name + * @param id + * @return + */ + public static MetricalAccentuationStyle createMetricalAccentuationStyle(String name, String id) { + MetricalAccentuationStyle metricalAccentuationStyle; + try { + metricalAccentuationStyle = new MetricalAccentuationStyle(name); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + metricalAccentuationStyle.setId(id); + return metricalAccentuationStyle; + } + /** * MetricalAccentuationStyle factory * @param xml @@ -73,75 +89,13 @@ public static MetricalAccentuationStyle createMetricalAccentuationStyle(Element protected void parseData(Element xml) throws Exception { super.parseData(xml); - this.accentuationPatternDefs = new HashMap<>(); - // parse the MetricalAccentuationStyle elements (the children of this styleDef) LinkedList maDefs = Helper.getAllChildElements("accentuationPatternDef", this.getXml()); for (Element maDef : maDefs) { // for each AccentuationPattern AccentuationPatternDef apd = AccentuationPatternDef.createAccentuationPatternDef(maDef); if (apd == null) continue; - this.accentuationPatternDefs.put(apd.getName(), apd); // add the (name, AccentuationPatternDef) pair to the lookup table + this.defs.put(apd.getName(), apd); // add the (name, AccentuationPatternDef) pair to the lookup table } } - - /** - * access the whole HashMap with (name, AccentuationPatternDef) pairs - * @return - */ - public HashMap getAllAccentuationPatternDefs() { - return this.accentuationPatternDefs; - } - - /** - * retrieve a specific AccentuationPatternDef - * @param name - * @return - */ - public AccentuationPatternDef getAccentuationPatternDef(String name) { - return this.accentuationPatternDefs.get(name); - } - - /** - * add or (if a AccentuationPatternDef with this name is already existent) replace the AccentuationPatternDef - * @param accentuationPatternDef the AccentuationPatternDef instance to be added, if there is already one with this name, it is replaced - */ - public void addAccentuationPatternDef(AccentuationPatternDef accentuationPatternDef) { - if (accentuationPatternDef == null) { - System.err.println("Cannot add a null AccentuationPatternDef to the styleDef."); - return; - } - removeAccentuationPatternDef(accentuationPatternDef.getName()); // if there is already a accentuationPatternDef with this name, remove it - this.accentuationPatternDefs.put(accentuationPatternDef.getName(), accentuationPatternDef); - this.getXml().appendChild(accentuationPatternDef.getXml()); - } - - /** - * remove the specified AccentuationPatternDef from this styleDef - * @param name - */ - public void removeAccentuationPatternDef(String name) { - AccentuationPatternDef rd = this.accentuationPatternDefs.get(name); // get the xml element of this AccentuationPatternDef - if (rd == null) // if there is no such AccentuationPatternDef - return; // done - - this.accentuationPatternDefs.remove(name); // remove the (name, values) lookup table entry - this.getXml().removeChild(rd.getXml()); // remove the element from the xml - } - - /** - * get the number of AccentuationPatternDefs in this styleDef - * @return - */ - public int size() { - return this.accentuationPatternDefs.size(); - } - - /** - * does the styleDef contain AccentuationPatternDefs? - * @return - */ - public boolean isEmpty() { - return this.accentuationPatternDefs.isEmpty(); - } } diff --git a/src/meico/mpm/elements/styles/RubatoStyle.java b/src/meico/mpm/elements/styles/RubatoStyle.java index 644f9d11..a29b1383 100644 --- a/src/meico/mpm/elements/styles/RubatoStyle.java +++ b/src/meico/mpm/elements/styles/RubatoStyle.java @@ -13,9 +13,7 @@ * and assotiate it with an instance of RubatoDef. * @author Axel Berndt */ -public class RubatoStyle extends GenericStyle { - private HashMap rubatoDefs; // the lookup table for rubatoDefs (name -> RubatoDef) - +public class RubatoStyle extends GenericStyle { /** * this constructor generates an empty styleDef for rubatoDefs to be added subsequently * @param name @@ -50,6 +48,24 @@ public static RubatoStyle createRubatoStyle(String name) { return rubatoStyle; } + /** + * RubatoStyle factory + * @param name + * @param id + * @return + */ + public static RubatoStyle createRubatoStyle(String name, String id) { + RubatoStyle rubatoStyle; + try { + rubatoStyle = new RubatoStyle(name); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + rubatoStyle.setId(id); + return rubatoStyle; + } + /** * RubatoStyle factory * @param xml @@ -73,75 +89,13 @@ public static RubatoStyle createRubatoStyle(Element xml) { protected void parseData(Element xml) throws Exception { super.parseData(xml); - this.rubatoDefs = new HashMap<>(); - // parse the rubatoDef elements (the children of this styleDef) LinkedList rubatoDefs = Helper.getAllChildElements("rubatoDef", this.getXml()); for (Element def : rubatoDefs) { // for each rubatoDef RubatoDef rd = RubatoDef.createRubatoDef(def); if (rd == null) continue; - this.rubatoDefs.put(rd.getName(), rd); // add the (name, RubatoDef) pair to the lookup table + this.defs.put(rd.getName(), rd); // add the (name, RubatoDef) pair to the lookup table } } - - /** - * access the whole HashMap with (name, RubatoDef) pairs - * @return - */ - public HashMap getAllRubatoDefs() { - return this.rubatoDefs; - } - - /** - * retrieve a specific rubatoDef - * @param name - * @return - */ - public RubatoDef getRubatoDef(String name) { - return this.rubatoDefs.get(name); - } - - /** - * add or (if a rubatoDef with this name is already existent) replace the rubatoDef - * @param rubatoDef the RubatoDef instance to be added, if there is already one with this name, it is replaced - */ - public void addRubatoDef(RubatoDef rubatoDef) { - if (rubatoDef == null) { - System.err.println("Cannot add a null RubatoDef to the styleDef."); - return; - } - removeRubatoDef(rubatoDef.getName()); // if there is already a rubatorDef with this name, remove it - this.rubatoDefs.put(rubatoDef.getName(), rubatoDef); - this.getXml().appendChild(rubatoDef.getXml()); - } - - /** - * remove the specified rubatoDef from this styleDef - * @param name - */ - public void removeRubatoDef(String name) { - RubatoDef rd = this.rubatoDefs.get(name); // get the xml element of this rubatoDef - if (rd == null) // if there is no such rubatoDef - return; // done - - this.rubatoDefs.remove(name); // remove the (name, values) lookup table entry - this.getXml().removeChild(rd.getXml()); // remove the element from the xml - } - - /** - * get the number of rubatoDefs in this styleDef - * @return - */ - public int size() { - return this.rubatoDefs.size(); - } - - /** - * does the styleDef contain rubatoDefs? - * @return - */ - public boolean isEmpty() { - return this.rubatoDefs.isEmpty(); - } } diff --git a/src/meico/mpm/elements/styles/TempoStyle.java b/src/meico/mpm/elements/styles/TempoStyle.java index 6bdfcc38..64928e42 100644 --- a/src/meico/mpm/elements/styles/TempoStyle.java +++ b/src/meico/mpm/elements/styles/TempoStyle.java @@ -13,9 +13,7 @@ * and assotiate it with an instance of TempoDef. * @author Axel Berndt */ -public class TempoStyle extends GenericStyle { - private HashMap tempoDefs; // the lookup table for TempoDef - +public class TempoStyle extends GenericStyle { /** * this constructor generates an empty styleDef for tempoDefs to be added subsequently * @param name @@ -50,6 +48,24 @@ public static TempoStyle createTempoStyle(String name) { return tempoStyle; } + /** + * TempoStyle factory + * @param name + * @param id + * @return + */ + public static TempoStyle createTempoStyle(String name, String id) { + TempoStyle tempoStyle; + try { + tempoStyle = new TempoStyle(name); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + tempoStyle.setId(id); + return tempoStyle; + } + /** * TempoStyle factory * @param xml @@ -73,15 +89,13 @@ public static TempoStyle createTempoStyle(Element xml) { public void parseData(Element xml) throws Exception { super.parseData(xml); - this.tempoDefs = new HashMap<>(); - // parse the tempoDef elements (the children of this styleDef) LinkedList tempoDefs = Helper.getAllChildElements("tempoDef", this.getXml()); for (Element def : tempoDefs) { // for each tempoDef TempoDef td = TempoDef.createTempoDef(def); if (td == null) continue; - this.tempoDefs.put(td.getName(), td); // add the (name, TempoDef) pair to the lookup table + this.defs.put(td.getName(), td); // add the (name, TempoDef) pair to the lookup table } } @@ -91,7 +105,7 @@ public void parseData(Element xml) throws Exception { * @return the numeric bpm value or 100.0 if everything else fails */ public double getNumericBpmValue(String tempoString) { - TempoDef tempoDef = this.getTempoDef(tempoString); + TempoDef tempoDef = this.getDef(tempoString); if (tempoDef != null) return tempoDef.getValue(); try { @@ -109,7 +123,7 @@ public double getNumericBpmValue(String tempoString) { * @return the numeric bpm value or 100.0 if everything else fails */ public static double getNumericBpmValue(String tempoString, TempoStyle style) { - TempoDef tempoDef = (style != null) ? style.getTempoDef(tempoString) : null; + TempoDef tempoDef = (style != null) ? style.getDef(tempoString) : null; if (tempoDef != null) return tempoDef.getValue(); @@ -120,64 +134,4 @@ public static double getNumericBpmValue(String tempoString, TempoStyle style) { return 100.0; } } - - /** - * access the whole HashMap with (name, TempoDef) pairs - * @return - */ - public HashMap getAllTempoDefs() { - return this.tempoDefs; - } - - /** - * retrieve a specific TempoDef - * @param name - * @return - */ - public TempoDef getTempoDef(String name) { - return this.tempoDefs.get(name); - } - - /** - * add or (if a TempoDef with this name is already existent) replace the TempoDef - * @param tempoDef the TempoDef instance to be added, if there is already one with this name, it is replaced - */ - public void addTempoDef(TempoDef tempoDef) { - if (tempoDef == null) { - System.err.println("Cannot add a null TempoDef to the styleDef."); - return; - } - removeTempoDef(tempoDef.getName()); // if there is already a tempoDef with this name, remove it - this.tempoDefs.put(tempoDef.getName(), tempoDef); - this.getXml().appendChild(tempoDef.getXml()); - } - - /** - * remove the specified TempoDef from this styleDef - * @param name - */ - public void removeTempoDef(String name) { - TempoDef rd = this.tempoDefs.get(name); // get the xml element of this tempoDef - if (rd == null) // if there is no such tempoDef - return; // done - - this.tempoDefs.remove(name); // remove the (name, values) lookup table entry - this.getXml().removeChild(rd.getXml()); // remove the element from the xml - } - - /** - * get the number of tempoDefs in this styleDef - * @return - */ - public int size() { - return this.tempoDefs.size(); - } - - /** - * does the styleDef contain tempoDefs? - * @return - */ - public boolean isEmpty() { - return this.tempoDefs.isEmpty(); - } } diff --git a/src/meico/mpm/elements/styles/defs/AbstractDef.java b/src/meico/mpm/elements/styles/defs/AbstractDef.java index b1abd7b8..2eab6279 100644 --- a/src/meico/mpm/elements/styles/defs/AbstractDef.java +++ b/src/meico/mpm/elements/styles/defs/AbstractDef.java @@ -1,14 +1,30 @@ package meico.mpm.elements.styles.defs; +import meico.mei.Helper; import meico.xml.AbstractXmlSubtree; import nu.xom.Attribute; +import nu.xom.Element; /** * This abstract class reduces the amount of copy code in the ...Def classes. * @author Axel Berndt */ public abstract class AbstractDef extends AbstractXmlSubtree { - protected Attribute name; // a quick link to the name attribute + protected Attribute name; // a quick link to the name attribute + private Attribute id = null; // the id attribute + + protected void parseData(Element xml) throws Exception { + if (xml == null) + throw new Exception("Cannot generate AbstractDef object. XML Element is null."); + + this.name = Helper.getAttribute("name", xml); + if (this.name == null) + throw new Exception("Cannot generate AbstractDef object. Missing name attribute."); + + this.setXml(xml); + + this.id = Helper.getAttribute("id", this.getXml()); + } /** * get the name of the rubatoDef @@ -25,4 +41,38 @@ public String getName() { protected void setName(String name) { this.name.setValue(name); } + + /** + * set the part's id + * @param id a xml:id string or null + */ + public void setId(String id) { + if (id == null) { + if (this.id != null) { + this.id.detach(); + this.id = null; + } + return; + } + + if (this.id == null) { + this.id = new Attribute("id", id); + this.id.setNamespace("xml", "http://www.w3.org/XML/1998/namespace"); // set correct namespace + this.getXml().addAttribute(this.id); + return; + } + + this.id.setValue(id); + } + + /** + * get the part's id + * @return a string or null + */ + public String getId() { + if (this.id == null) + return null; + + return this.id.getValue(); + } } diff --git a/src/meico/mpm/elements/styles/defs/AccentuationPatternDef.java b/src/meico/mpm/elements/styles/defs/AccentuationPatternDef.java index 420365a6..734bf59f 100644 --- a/src/meico/mpm/elements/styles/defs/AccentuationPatternDef.java +++ b/src/meico/mpm/elements/styles/defs/AccentuationPatternDef.java @@ -56,6 +56,25 @@ public static AccentuationPatternDef createAccentuationPatternDef(String name, d return accentuationPatternDef; } + /** + * AcctentuationPatternDef factory + * @param name + * @param length + * @param id + * @return + */ + public static AccentuationPatternDef createAccentuationPatternDef(String name, double length, String id) { + AccentuationPatternDef accentuationPatternDef; + try { + accentuationPatternDef = new AccentuationPatternDef(name, length); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + accentuationPatternDef.setId(id); + return accentuationPatternDef; + } + /** * AcctentuationPatternDef factory * @param xml @@ -77,16 +96,9 @@ public static AccentuationPatternDef createAccentuationPatternDef(Element xml) { * @param xml */ protected void parseData(Element xml) throws Exception { - if (xml == null) - throw new Exception("Cannot generate AccentuationPatternDef object. XML Element is null."); + super.parseData(xml); // parse the dynamicsDef element - this.name = Helper.getAttribute("name", xml); // get its name attribute - if (this.name == null) { // if no name - throw new Exception("Cannot generate AccentuationPatternDef object. Missing name attribute."); - } - - this.setXml(xml); // make sure that this element is really a "accentuationPatternDef" element if (!this.getXml().getLocalName().equals("accentuationPatternDef")) { @@ -139,11 +151,31 @@ protected void parseData(Element xml) throws Exception { * @return the index at which it has been added */ public int addAccentuation(double beat, double value, double transitionFrom, double transitionTo) { + return this.addAccentuation(beat, value, transitionFrom, transitionTo, null); + } + + /** + * create and add an accentuation to this accentuationPatternDef + * @param beat + * @param value + * @param transitionFrom + * @param transitionTo + * @param id + * @return the index at which it has been added + */ + public int addAccentuation(double beat, double value, double transitionFrom, double transitionTo, String id) { Element accElt = new Element("accentuation", Mpm.MPM_NAMESPACE); // create an xml representation of the accentuation to be added accElt.addAttribute(new Attribute("beat", Double.toString(beat))); accElt.addAttribute(new Attribute("value", Double.toString(value))); accElt.addAttribute(new Attribute("transition.from", Double.toString(transitionFrom))); accElt.addAttribute(new Attribute("transition.to", Double.toString(transitionTo))); + + if (id != null) { + Attribute idAtt = new Attribute("id", id); + idAtt.setNamespace("xml", "http://www.w3.org/XML/1998/namespace"); // set correct namespace + accElt.addAttribute(idAtt); + } + int index = this.addAccentuationToArrayList(new double[]{beat, value, transitionFrom, transitionTo}, accElt); // add the accentuation to this.accentuations this.getXml().insertChild(accElt, index); // add it to the xml return index; @@ -211,6 +243,7 @@ private void sortXml() { for (int i = 0; i < this.accentuations.size(); ++i) { // for each accentuation Element accentuation = this.accentuations.get(i).getValue(); xml.removeChild(accentuation); // remove the accentuation wherever it is +// accentuation.detach(); // the accentuation keeps its parent, so we don't need to do this xml.insertChild(accentuation, i); // and add it at its correct index } } @@ -224,7 +257,9 @@ public void removeAccentuation(int index) { return; this.getXml().removeChild(this.accentuations.get(index).getValue()); // remove the accentuation from the xml +// this.accentuations.get(index).getValue().detach(); this.accentuations.remove(index); // remove its values from the accentuations list + } /** @@ -293,7 +328,7 @@ public double getAccentuationAt(double beatPosition) { * get the count of accentuations in this accentuation pattern * @return the count of accentuations in this accentuation pattern */ - public int getSize() { + public int size() { return this.accentuations.size(); } diff --git a/src/meico/mpm/elements/styles/defs/ArticulationDef.java b/src/meico/mpm/elements/styles/defs/ArticulationDef.java index 94db234b..16dde975 100644 --- a/src/meico/mpm/elements/styles/defs/ArticulationDef.java +++ b/src/meico/mpm/elements/styles/defs/ArticulationDef.java @@ -85,14 +85,7 @@ public static ArticulationDef createArticulationDef(Element xml) { */ @Override protected void parseData(Element xml) throws Exception { - if (xml == null) - throw new Exception("Cannot generate ArticulationDef object. XML Element is null."); - - this.name = Helper.getAttribute("name", xml); - if (this.name == null) - throw new Exception("Cannot generate ArticulationDef object. Missing name attribute."); - - this.setXml(xml); + super.parseData(xml); // make sure that this element is really a "articulationDef" element if (!this.getXml().getLocalName().equals("articulationDef")) { diff --git a/src/meico/mpm/elements/styles/defs/DynamicsDef.java b/src/meico/mpm/elements/styles/defs/DynamicsDef.java index de3b4a25..3a7fc17e 100644 --- a/src/meico/mpm/elements/styles/defs/DynamicsDef.java +++ b/src/meico/mpm/elements/styles/defs/DynamicsDef.java @@ -72,20 +72,13 @@ public static DynamicsDef createDynamicsDef(Element xml) { * @param xml */ protected void parseData(Element xml) throws Exception { - if (xml == null) - throw new Exception("Cannot generate DynamicsDef object. XML Element is null."); + super.parseData(xml); // parse the dynamicsDef element - this.name = Helper.getAttribute("name", xml); // get its name attribute - if (this.name == null) { // if no name - throw new Exception("Cannot generate DynamicsDef object. Missing name attribute."); - } - Attribute value = Helper.getAttribute("value", xml); // get its value attribute - if (value == null) { // if no value - throw new Exception("Cannot generate DynamicsDef object. Missing value attribute."); - } - - this.setXml(xml); + Attribute value = Helper.getAttribute("value", xml); // get its value attribute + if (value == null) { // if no value + throw new Exception("Cannot generate DynamicsDef object. Missing value attribute."); + } // make sure that this element is really a DynamicsDef element if (!this.getXml().getLocalName().equals("dynamicsDef")) { diff --git a/src/meico/mpm/elements/styles/defs/RubatoDef.java b/src/meico/mpm/elements/styles/defs/RubatoDef.java index c148a568..dc8d2eee 100644 --- a/src/meico/mpm/elements/styles/defs/RubatoDef.java +++ b/src/meico/mpm/elements/styles/defs/RubatoDef.java @@ -20,11 +20,13 @@ public class RubatoDef extends AbstractDef { /** * constructor, creates an empty rubatoDef * @param name + * @param frameLength * @throws Exception */ - private RubatoDef(String name) throws Exception { + private RubatoDef(String name, double frameLength) throws Exception { Element e = new Element("rubatoDef", Mpm.MPM_NAMESPACE); e.addAttribute(new Attribute("name", name)); + e.addAttribute(new Attribute("frameLength", "" + frameLength)); this.parseData(e); } @@ -61,10 +63,10 @@ private RubatoDef(Element xml) throws Exception { * @param name * @return */ - public static RubatoDef createRubatoDef(String name) { + public static RubatoDef createRubatoDef(String name, double frameLength) { RubatoDef rubatoDef; try { - rubatoDef = new RubatoDef(name); + rubatoDef = new RubatoDef(name, frameLength); } catch (Exception e) { e.printStackTrace(); return null; @@ -114,14 +116,7 @@ public static RubatoDef createRubatoDef(Element xml) { */ @Override protected void parseData(Element xml) throws Exception { - if (xml == null) - throw new Exception("Cannot generate RubatoDef object. XML Element is null."); - - this.name = Helper.getAttribute("name", xml); - if (this.name == null) - throw new Exception("Cannot generate RubatoDef object. Missing name attribute."); - - this.setXml(xml); + super.parseData(xml); // make sure that this element is really a "rubatoDef" element if (!this.getXml().getLocalName().equals("rubatoDef")) { diff --git a/src/meico/mpm/elements/styles/defs/TempoDef.java b/src/meico/mpm/elements/styles/defs/TempoDef.java index 6da4afcc..1bc302f7 100644 --- a/src/meico/mpm/elements/styles/defs/TempoDef.java +++ b/src/meico/mpm/elements/styles/defs/TempoDef.java @@ -72,14 +72,9 @@ public static TempoDef createTempoDef(Element xml) { * @param xml */ protected void parseData(Element xml) throws Exception { - if (xml == null) - throw new Exception("Cannot generate TempoDef object. XML Element is null."); + super.parseData(xml); // parse the dynamicsDef element - this.name = Helper.getAttribute("name", xml); // get its name attribute - if (this.name == null) { // if no name - throw new Exception("Cannot generate TempoDef object. Missing name attribute."); - } Attribute value = Helper.getAttribute("value", xml); // get its value attribute if (value == null) { // if no value throw new Exception("Cannot generate TempoDef object. Missing value attribute."); diff --git a/src/meico/msm/Msm.java b/src/meico/msm/Msm.java index 27c5bc7a..a06f48d5 100644 --- a/src/meico/msm/Msm.java +++ b/src/meico/msm/Msm.java @@ -378,8 +378,10 @@ public synchronized void removeRests() { if (this.isEmpty()) return; Nodes r = this.getRootElement().query("descendant::*[local-name()='rest']"); // select all rest elements - for (int i = 0; i < r.size(); ++i) + for (int i = 0; i < r.size(); ++i) { r.get(i).getParent().removeChild(r.get(i)); // remove them + r.get(i).detach(); + } } /** @@ -438,13 +440,17 @@ public synchronized HashMap resolveSequencingMaps() { } // delete the local sequencingMap (because it does not apply anymore) - if (localMap) + if (localMap) { part.getFirstChildElement("dated").removeChild(sequencingMap); + sequencingMap.detach(); + } } // delete the global sequencingMap (because it does not apply anymore) - if (globalSequencingMap != null) + if (globalSequencingMap != null) { this.getRootElement().getFirstChildElement("global").getFirstChildElement("dated").removeChild(globalSequencingMap); + globalSequencingMap.detach(); + } return repetitionIDs; } diff --git a/src/meico/xml/XmlBase.java b/src/meico/xml/XmlBase.java index 804f34df..a5d18f61 100644 --- a/src/meico/xml/XmlBase.java +++ b/src/meico/xml/XmlBase.java @@ -365,6 +365,7 @@ public int removeAllElements(String localName) { Element parent = (Element)ns.get(i).getParent(); // get its parent element if (parent != null) { // if it has a parent (does not apply to the root node) parent.removeChild(ns.get(i)); // remove its child + ns.get(i).detach(); deletions++; // increase the deletions counter } }