56 int _lastLocalIndex { -1 };
60 int assignLocalIndex(
const Location& mainElementInfo);
72 QIODevice* _readAheadDevice =
nullptr;
79 int _trackOffset { 0 };
80 bool _pasteMode {
false };
83 int _curMeasureIdx { 0 };
92 std::vector<std::unique_ptr<ConnectorInfoReader>>
_connectors;
95 void htmlToString(
int level, QString*);
104 void addConnectorInfo(std::unique_ptr<ConnectorInfoReader>);
108 XmlReader(QFile* f) : QXmlStreamReader(f), docName(f->fileName()) {}
109 XmlReader(
const QByteArray& d,
const QString& st = QString()) : QXmlStreamReader(d), docName(st) {}
110 XmlReader(QIODevice* d,
const QString& st = QString()) : QXmlStreamReader(d), docName(st) {}
111 XmlReader(
const QString& d,
const QString& st = QString()) : QXmlStreamReader(d), docName(st) {}
120 QString
attribute(
const char* s)
const {
return attributes().value(s).toString(); }
121 QString attribute(
const char* s,
const QString&)
const;
122 int intAttribute(
const char* s)
const;
123 int intAttribute(
const char* s,
int _default)
const;
124 double doubleAttribute(
const char* s)
const;
125 double doubleAttribute(
const char* s,
double _default)
const;
126 bool hasAttribute(
const char* s)
const;
129 int readInt() {
return readElementText().toInt(); }
130 int readInt(
bool* ok) {
return readElementText().toInt(ok); }
135 double readDouble(
double min,
double max);
153 int track()
const {
return _track + _trackOffset; }
160 Location location(
bool forceAbsFrac =
false)
const;
161 void fillLocation(
Location&,
bool forceAbsFrac =
false)
const;
165 void addBeam(
Beam* s);
168 void addTuplet(
Tuplet* s);
170 QHash<int, Tuplet*>&
tuplets() {
return _tuplets; }
179 void removeSpanner(
const Spanner*);
180 void addSpanner(
int id,
Spanner*);
189 void checkConnectors();
190 void reconnectBrokenConnectors();
199 QMap<int, LinkedElements*>&
linkIds() {
return _elinks; }
200 QMultiMap<int, int>&
tracks() {
return _tracks; }
203 Tid addUserTextStyle(
const QString& name);
204 Tid lookupUserTextStyle(
const QString& name);
209 void performReadAhead(std::function<
void(QIODevice&)> readAheadRoutine);
211 QList<std::pair<Element*, QPointF>>&
fixOffsets() {
return _fixOffsets; }
219 static const int BS = 2048;
227 int _curTrack { -1 };
228 int _trackDiff { 0 };
230 bool _clipboardmode {
false };
231 bool _excerptmode {
false };
232 bool _writeOmr {
true };
233 bool _writeTrack {
false };
234 bool _writePosition {
false };
239 std::vector<std::pair<const ScoreElement*, QString>>
_elements;
240 bool _recordElements =
false;
273 int assignLocalIndex(
const Location& mainElementLocation);
274 void setLidLocalIndex(
int lid,
int localIndex) { _lidLocalIndices.insert(lid, localIndex); }
275 int lidLocalIndex(
int lid)
const { Q_ASSERT(_lidLocalIndices.contains(lid));
return _lidLocalIndices[lid]; }
277 const std::vector<std::pair<const ScoreElement*, QString>>&
elements()
const {
return _elements; }
285 void stag(
const QString&);
288 void stag(
const ScoreElement* se,
const QString& attributes = QString());
289 void stag(
const QString& name,
const ScoreElement* se,
const QString& attributes = QString());
291 void tagE(
const QString&);
292 void tagE(
const char* format, ...);
293 void ntag(
const char* name);
294 void netag(
const char* name);
296 void tag(
Pid id,
void* data,
void* defaultVal);
297 void tag(
Pid id, QVariant data, QVariant defaultData = QVariant());
298 void tag(
const char* name, QVariant data, QVariant defaultData = QVariant());
299 void tag(
const QString&, QVariant data);
300 void tag(
const char* name,
const char* s) {
tag(name, QVariant(s)); }
301 void tag(
const char* name,
const QString& s) {
tag(name, QVariant(s)); }
302 void tag(
const char* name,
const QWidget*);
304 void comment(
const QString&);
306 void writeXml(
const QString&, QString s);
307 void dump(
int len,
const unsigned char* p);
310 bool canWrite(
const Element*)
const;
311 bool canWriteVoice(
int track)
const;
313 static QString xmlString(
const QString&);
314 static QString xmlString(ushort c);
Helper class for reading beams, tuplets and spanners.
Definition: connector.h:96
QMap< int, LinkedElements * > & linkIds()
Definition: xml.h:199
void incCurTick(const Fraction &v)
Definition: xml.h:250
QMultiMap< int, int > _tracks
Definition: xml.h:100
Global staff data not directly related to drawing.
Definition: staff.h:62
signed char chromatic
Definition: interval.h:24
QMap< int, QList< QPair< LinkedElements *, Location > > > _staffLinkedElements
Definition: xml.h:98
Pid
Definition: property.h:62
QMap< int, LinkedElements * > _elinks
Definition: xml.h:97
double readDouble()
Definition: xml.h:132
void tag(Pid id, void *data, void *defaultVal)
bool pasteMode() const
Definition: xml.h:157
XmlReader(QIODevice *d, const QString &st=QString())
Definition: xml.h:110
void setDocName(const QString &s)
Definition: xml.h:144
Tuplet * findTuplet(int id) const
Definition: xml.h:169
Virtual base class for slurs, ties, lines etc.
Definition: spanner.h:136
Definition: scoreElement.h:146
one measure in a system
Definition: measure.h:65
void setCurrentMeasure(Measure *m)
Definition: xml.h:174
void tag(const char *name, const QString &s)
Definition: xml.h:301
Definition: scoreElement.h:173
int lidLocalIndex(int lid) const
Definition: xml.h:275
void setPasteMode(bool v)
Definition: xml.h:158
Score * _score
Definition: xml.h:221
Base class of score layout elements.
Definition: element.h:158
void setWriteTrack(bool v)
Definition: xml.h:270
QHash< int, Tuplet * > _tuplets
Definition: xml.h:85
QMultiMap< int, int > & tracks()
Definition: xml.h:200
Measure * lastMeasure() const
Definition: xml.h:173
int track2
Definition: xml.h:39
void setWritePosition(bool v)
Definition: xml.h:271
void setFilter(SelectionFilter f)
Definition: xml.h:309
void setTrackOffset(int val)
Definition: xml.h:154
void addSpannerValues(const SpannerValues &sv)
Definition: xml.h:185
int curTrack() const
Definition: xml.h:252
QList< std::pair< Element *, QPointF > > & fixOffsets()
Definition: xml.h:211
std::vector< std::unique_ptr< ConnectorInfoReader > > _pendingConnectors
Definition: xml.h:93
constexpr qreal val() const
Definition: spatium.h:32
void setReadAheadDevice(QIODevice *dev)
Definition: xml.h:207
qlonglong readLongLong()
Definition: xml.h:133
Example of 1/8 triplet: _baseLen = 1/8 _actualNotes = 3 _normalNotes = 2 (3 notes played in the time ...
Definition: tuplet.h:37
int readInt()
Definition: xml.h:129
int spannerId
Definition: xml.h:37
void setRecordElements(bool record)
Definition: xml.h:278
int currentMeasureIndex() const
Definition: xml.h:177
void sTag(const char *name, Spatium sp)
Definition: xml.h:280
void setCurTick(const Fraction &v)
Definition: xml.h:249
static constexpr Location absolute()
Definition: location.h:50
int readInt(bool *ok)
Definition: xml.h:130
Measure * currentMeasure() const
Definition: xml.h:175
QList< std::pair< int, Spanner * > > _spanner
Definition: xml.h:88
Beam * findBeam(int id) const
Definition: xml.h:166
Interval transpose() const
Definition: xml.h:193
PlaceText readPlacement(XmlReader &)
Definition: xmlreader.cpp:423
QString docName
Definition: xml.h:68
Tid
Enumerates the list of built-in text substyles.
Definition: types.h:371
void setTickOffset(const Fraction &val)
Definition: xml.h:151
void setTrackDiff(int v)
Definition: xml.h:259
QList< StaffType > _staffTypes
Definition: xml.h:89
bool clipboardmode() const
Definition: xml.h:261
void setTickDiff(const Fraction &v)
Definition: xml.h:256
bool readAheadAvailable() const
Definition: xml.h:208
void setLastMeasure(Measure *m)
Definition: xml.h:172
Definition: interval.h:22
QHash< int, Beam * > _beams
Definition: xml.h:84
QList< std::pair< Element *, QPointF > > _fixOffsets
Definition: xml.h:90
Definition: aeolus.cpp:26
int readIntHex()
Definition: xml.h:131
Fraction tickDiff() const
Definition: xml.h:255
const std::vector< std::pair< const ScoreElement *, QString > > & elements() const
Definition: xml.h:277
QHash< int, Tuplet * > & tuplets()
Definition: xml.h:170
signed char diatonic
Definition: interval.h:23
void setExcerptmode(bool v)
Definition: xml.h:268
void tag(const char *name, const char *s)
Definition: xml.h:300
void setTransposeChromatic(int v)
Definition: xml.h:194
void setLidLocalIndex(int lid, int localIndex)
Definition: xml.h:274
Fraction tick2
Definition: xml.h:38
void setTrack(int val)
Definition: xml.h:156
Interval _transpose
Definition: xml.h:96
std::vector< std::unique_ptr< ConnectorInfoReader > > _connectors
Definition: xml.h:92
XmlReader(const QString &d, const QString &st=QString())
Definition: xml.h:111
Tid ss
Definition: xml.h:48
void setTransposeDiatonic(int v)
Definition: xml.h:195
bool excerptmode() const
Definition: xml.h:262
bool writePosition() const
Definition: xml.h:265
int track() const
Definition: xml.h:153
Definition: location.h:32
XmlReader(QFile *f)
Definition: xml.h:108
bool writeTrack() const
Definition: xml.h:264
Fraction tick() const
Definition: xml.h:147
QList< SpannerValues > _spannerValues
Definition: xml.h:87
int trackDiff() const
Definition: xml.h:258
XmlReader(const QByteArray &d, const QString &st=QString())
Definition: xml.h:109
QList< StaffType > & staffType()
Definition: xml.h:192
Fraction curTick() const
Definition: xml.h:248
void setClipboardmode(bool v)
Definition: xml.h:267
PlaceText
Definition: mscore.h:115
ClefType
Definition: clef.h:37
Definition: fraction.h:46
LinksIndexer _linksIndexer
Definition: xml.h:99
QMap< int, int > _lidLocalIndices
Definition: xml.h:237
QList< TextStyleMap > userTextStyles
Definition: xml.h:102
QList< QString > stack
Definition: xml.h:222
LinksIndexer _linksIndexer
Definition: xml.h:236
void addConnectorInfoLater(std::unique_ptr< ConnectorInfoReader > c)
Definition: xml.h:188
void setWriteOmr(bool v)
Definition: xml.h:269
QString attribute(const char *s) const
Definition: xml.h:120
void setCurTrack(int v)
Definition: xml.h:253
int trackOffset() const
Definition: xml.h:155
bool hasAccidental
Definition: xml.h:116
void setCurrentMeasureIndex(int idx)
Definition: xml.h:176
SelectionFilter _filter
Definition: xml.h:223
QString name
Definition: xml.h:47
bool writeOmr() const
Definition: xml.h:263
std::vector< std::pair< const ScoreElement *, QString > > _elements
Definition: xml.h:239
QString getDocName() const
Definition: xml.h:145