fix instrument name format in score file

This commit is contained in:
ws 2014-03-25 16:55:51 +01:00
parent a87e541933
commit aa107645aa
9 changed files with 17 additions and 16 deletions

View file

@ -143,7 +143,7 @@ StringData *InstrumentData::stringData() const
void StaffName::write(Xml& xml, const char* tag) const
{
if (!name.isEmpty())
xml.tag(QString("%1 pos=\"%2\"").arg(tag).arg(pos), name);
xml.writeXml(QString("%1 pos=\"%2\"").arg(tag).arg(pos), name);
}
//---------------------------------------------------------

View file

@ -689,8 +689,9 @@ QString XmlReader::readXml()
// writeXml
//---------------------------------------------------------
void Xml::writeXml(const char* name, QString s)
void Xml::writeXml(const QString& name, QString s)
{
QString ename(name.split(' ')[0]);
putLevel();
for (int i = 0; i < s.size(); ++i) {
ushort c = s.at(i).unicode();
@ -699,7 +700,7 @@ void Xml::writeXml(const char* name, QString s)
}
*this << "<" << name << ">";
*this << s;
*this << "</" << name << ">\n";
*this << "</" << ename << ">\n";
}
//---------------------------------------------------------

View file

@ -155,7 +155,7 @@ class Xml : public QTextStream {
void tag(const char* name, const QString& s) { tag(name, QVariant(s)); }
void tag(const char* name, const QWidget*);
void writeXml(const char* tag, QString s);
void writeXml(const QString&, QString s);
void dump(int len, const unsigned char* p);
static QString xmlString(const QString&);

View file

@ -79,8 +79,8 @@
</Staff>
<trackName>Flute</trackName>
<Instrument>
<longName pos="0">&lt;font face=&quot;Times New Roman&quot;/&gt;Flute</longName>
<shortName pos="0">&lt;font face=&quot;Times New Roman&quot;/&gt;Fl.</shortName>
<longName pos="0"><font face="Times New Roman"/>Flute</longName>
<shortName pos="0"><font face="Times New Roman"/>Fl.</shortName>
<trackName>Flute</trackName>
<minPitchP>59</minPitchP>
<maxPitchP>98</maxPitchP>

View file

@ -81,8 +81,8 @@
</Staff>
<trackName>Piano</trackName>
<Instrument>
<longName pos="0">&lt;font face=&quot;Times New Roman&quot;/&gt;Piano</longName>
<shortName pos="0">&lt;font face=&quot;Times New Roman&quot;/&gt;Pno.</shortName>
<longName pos="0"><font face="Times New Roman"/>Piano</longName>
<shortName pos="0"><font face="Times New Roman"/>Pno.</shortName>
<trackName>Piano</trackName>
<minPitchP>21</minPitchP>
<maxPitchP>108</maxPitchP>

View file

@ -87,8 +87,8 @@
</Staff>
<trackName>Piano</trackName>
<Instrument>
<longName pos="0">&lt;font face=&quot;Times New Roman&quot;/&gt;Piano</longName>
<shortName pos="0">&lt;font face=&quot;Times New Roman&quot;/&gt;Pno.</shortName>
<longName pos="0"><font face="Times New Roman"/>Piano</longName>
<shortName pos="0"><font face="Times New Roman"/>Pno.</shortName>
<trackName>Piano</trackName>
<minPitchP>21</minPitchP>
<maxPitchP>108</maxPitchP>

View file

@ -83,8 +83,8 @@
</Staff>
<trackName>Voice</trackName>
<Instrument>
<longName pos="0">&lt;font face=&quot;Times New Roman&quot;/&gt;Voice</longName>
<shortName pos="0">&lt;font face=&quot;Times New Roman&quot;/&gt;Vo.</shortName>
<longName pos="0"><font face="Times New Roman"/>Voice</longName>
<shortName pos="0"><font face="Times New Roman"/>Vo.</shortName>
<trackName>Voice</trackName>
<minPitchP>36</minPitchP>
<maxPitchP>94</maxPitchP>

View file

@ -83,8 +83,8 @@
</Staff>
<trackName>Voice</trackName>
<Instrument>
<longName pos="0">&lt;font face=&quot;Times New Roman&quot;/&gt;Voice</longName>
<shortName pos="0">&lt;font face=&quot;Times New Roman&quot;/&gt;Vo.</shortName>
<longName pos="0"><font face="Times New Roman"/>Voice</longName>
<shortName pos="0"><font face="Times New Roman"/>Vo.</shortName>
<trackName>Voice</trackName>
<minPitchP>36</minPitchP>
<maxPitchP>94</maxPitchP>

View file

@ -85,8 +85,8 @@
</Staff>
<trackName>Piano</trackName>
<Instrument>
<longName pos="0">&lt;font face=&quot;Times New Roman&quot;/&gt;Piano</longName>
<shortName pos="0">&lt;font face=&quot;Times New Roman&quot;/&gt;Pno.</shortName>
<longName pos="0"><font face="Times New Roman"/>Piano</longName>
<shortName pos="0"><font face="Times New Roman"/>Pno.</shortName>
<trackName>Piano</trackName>
<minPitchP>21</minPitchP>
<maxPitchP>108</maxPitchP>