Two possible problems: mp->last() may not be the end barline segment and element(0) may not contain a barline. For convenience i (re)added a Measure->endBarLineType() method which does the lookup.

Am 16.04.2016 um 21:48 schrieb Sideways Skullfinger:
Measure::first() == the begin barline segment
Measure::last() == the end barline segment

Here is sample code of mine before and after:

Measure* mp;
/
BEFORE/:if(mp->endBarLineType()==BarLineType::DOUBLE){
/
AFTER/://if (mp->last()->isEndBarLineType()
&& static_cast<BarLine*>(mp->last()->element(0))->barLineType() == BarLineType::DOUBLE) {

Yea, it's a bit more complex, but it seems to work.

  * The element(0) is to get the segment's first track (4
    tracks/voices per staff).
  * I do the check for isEndBarLineType() just to be safe.  If I can
    count on the last segment of every measure being the end barline
    element in track zero, then that check is not necessary.

Other than that, I think the sample code tells it better than anything I can add here.

Let me know if there's a better way to do it.

Thanks,

Sideways

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Mscore-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mscore-developer

Reply via email to