Plugin api: Ms::PluginAPI::Measure::measureNumber property needed
The Ms::PluginAPI::Measure::measureNumber
property would be an excellent way of finding measures, looping through measures, checking if a measure == another measure
(faster than the is(...)
method), etc.
I believe it wouldn't be hard to implement since the function looks safe and is here
A lot of other measure properties could be by the way added to the list, here's a non-exhaustive list that looks safe:
- from measure.h: https://github.com/musescore/MuseScore/blob/master/libmscore/measure.h
virtual Measure* clone() const override { return new Measure(*this); } // line 98 virtual void add(Element*) override; // line 113 virtual void remove(Element*) override; // line 114 virtual void change(Element* o, Element* n) override; // line 115 bool hasVoices(int staffIdx) const; // line 119 bool corrupted(int staffIdx) const; // line 127 MeasureNumberMode measureNumberMode() const { return _noMode; } // line 134 void setMeasureNumberMode(MeasureNumberMode v) { _noMode = v; } // line 135 Fraction timesig() const { return _timesig; } // line 137 qreal userStretch() const; // line 152 with void stretchMeasure(qreal stretch); // line 155 // - lines 213 to 228: the bool getters
- from measurebase: https://github.com/musescore/MuseScore/blob/master/libmscore/measurebas…
// the getters from lines 144 to 168 void clearElements(); // - line 144
- and a lot of others which i can't tell if they are safe. Getters should be safe by default, no?
Comments
Looks like a lot has already been done here, but it has been commented out. Why that?
Also, a lot of properties out there are undocumented and the names are not always enough...
In reply to Looks like a lot has already… by ecstrema
Logically, you have to deal in both "absolute" measure numbers and "user" measure numbers, the latter including "exclude from measure count" measures.