need help cannot reproduce compilation error

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

need help cannot reproduce compilation error

Jim Newton
I'm suspecting that I have a misconception about xml-in and xml-out in musescore.
Can someone help me understand better?

Someone reported that he cannot compile a commit which I uploaded.  However, I can compile it just fine.
 https://musescore.org/en/node/56281#comment-265571
errors are logged here: https://musescore.org/sites/musescore.org/files/compile_errors_0.zip

When I look at his compiler errors, they are indeed related to places in the code which I changed.

I'm trying to guess why he's getting the errors, even though I'm not.

The first issue is
/home/peter/src/MuseScore/libmscore/articulation.cpp:311:46: error: call of overloaded ‘tag(const char [17], bool)’ is ambiguous
             xml.tag("playArticulation", false);

One thing I don't understand is how does musescore decide how to xml-out and in particular structures.
There seems to be contradictory code.

For example, the file property.cpp defines an array
static const PropertyData propertyList[] = { ....}.
This array defines a mapping from musescore property id to xml tag and default value.
However the file articulation.cpp defines a function perhaps redundantly with the function definition below.
Is this correct?
Why should it be that propertyList[] define the mapping, but the write() method needs to duplicate the logic?
I would guess naively that properties declared correctly in propertyList[] need not be mentioned in the write() or read() methods.


void Articulation::write(Xml& xml) const
      {
      if (!xml.canWrite(this))
            return;
      xml.stag("Articulation");
      if (!_channelName.isEmpty())
            xml.tagE(QString("channel name=\"%1\"").arg(_channelName));
      writeProperty(xml, P_ID::DIRECTION);
      xml.tag("subtype", subtypeName());
      if (_timeStretch != 1.0)
            xml.tag("timeStretch", _timeStretch);
      if (ornamentStyle() != MScore::OrnamentStyle::DEFAULT)
            xml.tag("ornamentStyle", int(_ornamentStyle));
      xml.tag("playArticulation", playArticulation(), true);

      Element::writeProperties(xml);
      if (anchorStyle == PropertyStyle::UNSTYLED)
            xml.tag("anchor", int(_anchor));
      xml.etag();
      }
Reply | Threaded
Open this post in threaded view
|

Re: need help cannot reproduce compilation error

Jim Newton
So Jojo suggested that I cast the bool to int in the call to xml.tag().
I'll try it and see what happens.
Reply | Threaded
Open this post in threaded view
|

Re: need help cannot reproduce compilation error

lasconic
Administrator
If playArticulation is a property in the articulation class. Just use   writeProperty(xml, P_ID::PLAY_ARTICULATION); the class will figure out the value and the default value by itself. (Since you should have coded it in propertyDefault and getProperty)

lasconic

2015-04-24 10:29 GMT+02:00 Jim Newton <[hidden email]>:
So Jojo suggested that I cast the bool to int in the call to xml.tag().
I'll try it and see what happens.



--
View this message in context: http://dev-list.musescore.org/need-help-cannot-reproduce-compilation-error-tp7579197p7579198.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: need help cannot reproduce compilation error

Jim Newton
Thanks.  but the write function does special case timeStretch and anchor.
Is this a mistake?

Jim

On 24 Apr 2015, at 12:25, lasconic [via MuseScore Developer] <[hidden email]> wrote:

If playArticulation is a property in the articulation class. Just use   writeProperty(xml, P_ID::PLAY_ARTICULATION); the class will figure out the value and the default value by itself. (Since you should have coded it in propertyDefault and getProperty)

lasconic

2015-04-24 10:29 GMT+02:00 Jim Newton <<a href="x-msg://6/user/SendEmail.jtp?type=node&amp;node=7579201&amp;i=0" target="_top" rel="nofollow" link="external" class="">[hidden email]>:
So Jojo suggested that I cast the bool to int in the call to xml.tag().
I'll try it and see what happens.



--
View this message in context: http://dev-list.musescore.org/need-help-cannot-reproduce-compilation-error-tp7579197p7579198.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
<a href="x-msg://6/user/SendEmail.jtp?type=node&amp;node=7579201&amp;i=1" target="_top" rel="nofollow" link="external" class="">[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
<a href="x-msg://6/user/SendEmail.jtp?type=node&amp;node=7579201&amp;i=2" target="_top" rel="nofollow" link="external" class="">[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer



If you reply to this email, your message will be added to the discussion below:
http://dev-list.musescore.org/need-help-cannot-reproduce-compilation-error-tp7579197p7579201.html
To unsubscribe from need help cannot reproduce compilation error, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: need help cannot reproduce compilation error

Jim Newton
In reply to this post by lasconic
apparently this will only work if the switch/case statement in 
void Xml::tag(P_ID id, QVariant data, QVariant defaultData)
is extended to include P_ID::PLAY_ARTICULATION

Otherwise the Q_ASSERT(false) line is reached.

But yes this does seem like a more centralized place.


On 24 Apr 2015, at 12:25, lasconic [via MuseScore Developer] <[hidden email]> wrote:

If playArticulation is a property in the articulation class. Just use   writeProperty(xml, P_ID::PLAY_ARTICULATION); the class will figure out the value and the default value by itself. (Since you should have coded it in propertyDefault and getProperty)

lasconic

2015-04-24 10:29 GMT+02:00 Jim Newton <<a href="x-msg://8/user/SendEmail.jtp?type=node&amp;node=7579201&amp;i=0" target="_top" rel="nofollow" link="external" class="">[hidden email]>:
So Jojo suggested that I cast the bool to int in the call to xml.tag().
I'll try it and see what happens.



--
View this message in context: http://dev-list.musescore.org/need-help-cannot-reproduce-compilation-error-tp7579197p7579198.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
<a href="x-msg://8/user/SendEmail.jtp?type=node&amp;node=7579201&amp;i=1" target="_top" rel="nofollow" link="external" class="">[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
<a href="x-msg://8/user/SendEmail.jtp?type=node&amp;node=7579201&amp;i=2" target="_top" rel="nofollow" link="external" class="">[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer



If you reply to this email, your message will be added to the discussion below:
http://dev-list.musescore.org/need-help-cannot-reproduce-compilation-error-tp7579197p7579201.html
To unsubscribe from need help cannot reproduce compilation error, click here.
NAML