help to understand writeProperty(xml...)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

help to understand writeProperty(xml...)

Jim Newton
I have apparently introduced a bug into my branch of musescore.
The Glissando class which inherits from SLine, now write the xml tag <noOffset>3</noOffset>
rather than the expected <anchor>3</anchor>.
I've tracked this down in the code, sort of.

The method  Glissando::writeProperties explicitly calls SLine::writeProperties.
While debugging i've replaced the line in that function:

    writeProperty(xml, P_ID::ANCHOR);

with

      xml.tag("x1","[");
      writeProperty(xml, P_ID::ANCHOR);
      xml.tag("x2","]");

And what I see in the xml file is the following:

            <Glissando id="2">
              <text>gliss.</text>
              <subtype>1</subtype>
              <playGlissando>false</playGlissando>
              <glissandoStyle>Black keys</glissandoStyle>
              <diagonal>1</diagonal>
              <lineWidth>0.15</lineWidth>
              <x1>[</x1>
              <noOffset>3</noOffset>
              <x2>]</x2>
              </Glissando>

Apparently I've done something which causes       writeProperty(xml, P_ID::ANCHOR);
to write the noOffset label instead.

Does that make sense to anyone?
Reply | Threaded
Open this post in threaded view
|

Re: help to understand writeProperty(xml...)

lasconic
Administrator

2015-05-11 17:27 GMT+02:00 Jim Newton <[hidden email]>:
I have apparently introduced a bug into my branch of musescore.
The Glissando class which inherits from SLine, now write the xml tag
<noOffset>3</noOffset>
rather than the expected <anchor>3</anchor>.
I've tracked this down in the code, sort of.

The method  Glissando::writeProperties explicitly calls
SLine::writeProperties.
While debugging i've replaced the line in that function:

    writeProperty(xml, P_ID::ANCHOR);

with

      xml.tag("x1","[");
      writeProperty(xml, P_ID::ANCHOR);
      xml.tag("x2","]");

And what I see in the xml file is the following:

            <Glissando id="2">
              <text>gliss.</text>
              <subtype>1</subtype>
              <playGlissando>false</playGlissando>
              <glissandoStyle>Black keys</glissandoStyle>
              <diagonal>1</diagonal>
              <lineWidth>0.15</lineWidth>
              <x1>[</x1>
              <noOffset>3</noOffset>
              <x2>]</x2>
              </Glissando>

Apparently I've done something which causes       writeProperty(xml,
P_ID::ANCHOR);
to write the noOffset label instead.

Does that make sense to anyone?



--
View this message in context: http://dev-list.musescore.org/help-to-understand-writeProperty-xml-tp7579332.html
Sent from the MuseScore Developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer
Reply | Threaded
Open this post in threaded view
|

Re: help to understand writeProperty(xml...)

Jim Newton
In reply to this post by Jim Newton
maybe I've found the problem.
Look in the file property.cpp, at line 37 at the definition of
static const PropertyData propertyList[] = { ...};

Then look below at line 257 (+/2 depending on your version of the file) at the definition of
const char* propertyName(P_ID id)

This function assumes that the PropertyData object at index N, is the PropertyData object
whose id is int(P_ID), but this is not enforced anywhere.