summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--muse/ChangeLog3
-rw-r--r--muse/muse/driver/alsamidi.cpp6
-rw-r--r--muse/muse/driver/jackmidi.cpp14
-rw-r--r--muse/muse/marker/marker.cpp7
-rw-r--r--muse/muse/plugin.cpp6
-rw-r--r--muse/muse/songfile.cpp3
-rw-r--r--muse/muse/track.cpp14
-rw-r--r--muse/muse/widgets/header.cpp6
-rw-r--r--muse/muse/widgets/splitter.cpp6
-rw-r--r--muse/muse/xml.cpp9
-rw-r--r--muse/muse/xml.h1
-rw-r--r--muse/synti/vam/vamgui.cpp3
12 files changed, 59 insertions, 19 deletions
diff --git a/muse/ChangeLog b/muse/ChangeLog
index 0056b535..106035de 100644
--- a/muse/ChangeLog
+++ b/muse/ChangeLog
@@ -1,3 +1,6 @@
+07.05.2010
+ * Fixed: Xml file trouble: Tag attributes not storing xml-friendly entities, trouble reloading song. (T356)
+ - Fixed all usages of Xml::nput, ::put, ::tag, and ::etag. Discovered by Geoff B.
06.05.2010
* Fixed: Audio Input tracks: Loud noises or DC output with unconnected input routes. (T356)
- AudioInput::getData(): Do not get buffers of unconnected client ports. Causes repeating leftover data.
diff --git a/muse/muse/driver/alsamidi.cpp b/muse/muse/driver/alsamidi.cpp
index bcd1bd75..de39d48f 100644
--- a/muse/muse/driver/alsamidi.cpp
+++ b/muse/muse/driver/alsamidi.cpp
@@ -231,7 +231,8 @@ void MidiAlsaDevice::writeRouting(int level, Xml& xml) const
//xml.tag(level, "source type=\"%d\" name=\"%s\"/", Route::ALSA_MIDI_ROUTE, name().latin1());
//xml.tag(level, "source type=\"%d\" name=\"%s\"/", Route::MIDI_DEVICE_ROUTE, name().latin1());
*/
- xml.tag(level, "source devtype=\"%d\" name=\"%s\"/", MidiDevice::ALSA_MIDI, name().latin1());
+ //xml.tag(level, "source devtype=\"%d\" name=\"%s\"/", MidiDevice::ALSA_MIDI, name().latin1());
+ xml.tag(level, "source devtype=\"%d\" name=\"%s\"/", MidiDevice::ALSA_MIDI, Xml::xmlString(name()).latin1());
/*
//xml.strTag(level, "dstNode", r->name());
@@ -257,7 +258,8 @@ void MidiAlsaDevice::writeRouting(int level, Xml& xml) const
else
if(r->type != Route::TRACK_ROUTE)
s += QString(QT_TR_NOOP(" type=\"%1\"")).arg(r->type);
- s += QString(QT_TR_NOOP(" name=\"%1\"/")).arg(r->name());
+ //s += QString(QT_TR_NOOP(" name=\"%1\"/")).arg(r->name());
+ s += QString(QT_TR_NOOP(" name=\"%1\"/")).arg(Xml::xmlString(r->name()));
xml.tag(level, s);
xml.etag(level--, "Route");
diff --git a/muse/muse/driver/jackmidi.cpp b/muse/muse/driver/jackmidi.cpp
index 0fb8e3d2..e465a491 100644
--- a/muse/muse/driver/jackmidi.cpp
+++ b/muse/muse/driver/jackmidi.cpp
@@ -527,13 +527,16 @@ void MidiJackDevice::writeRouting(int level, Xml& xml) const
s = QT_TR_NOOP("source");
if(r->type != Route::TRACK_ROUTE)
s += QString(QT_TR_NOOP(" type=\"%1\"")).arg(r->type);
- s += QString(QT_TR_NOOP(" name=\"%1\"/")).arg(r->name());
+
+ //s += QString(QT_TR_NOOP(" name=\"%1\"/")).arg(r->name());
+ s += QString(QT_TR_NOOP(" name=\"%1\"/")).arg(Xml::xmlString(r->name()));
xml.tag(level, s);
//xml.strTag(level, "dstNode", name());
//xml.tag(level, "dest type=\"%d\" name=\"%s\"/", Route::JACK_MIDI_ROUTE, name().latin1());
//xml.tag(level, "dest type=\"%d\" name=\"%s\"/", Route::MIDI_DEVICE_ROUTE, name().latin1());
- xml.tag(level, "dest devtype=\"%d\" name=\"%s\"/", MidiDevice::JACK_MIDI, name().latin1());
+ //xml.tag(level, "dest devtype=\"%d\" name=\"%s\"/", MidiDevice::JACK_MIDI, name().latin1());
+ xml.tag(level, "dest devtype=\"%d\" name=\"%s\"/", MidiDevice::JACK_MIDI, Xml::xmlString(name()).latin1());
xml.etag(level--, "Route");
}
@@ -561,7 +564,8 @@ void MidiJackDevice::writeRouting(int level, Xml& xml) const
//xml.tag(level, "source type=\"%d\" name=\"%s\"/", Route::JACK_MIDI_ROUTE, name().latin1());
//xml.tag(level, "source type=\"%d\" name=\"%s\"/", Route::MIDI_DEVICE_ROUTE, name().latin1());
*/
- xml.tag(level, "source devtype=\"%d\" name=\"%s\"/", MidiDevice::JACK_MIDI, name().latin1());
+ //xml.tag(level, "source devtype=\"%d\" name=\"%s\"/", MidiDevice::JACK_MIDI, name().latin1());
+ xml.tag(level, "source devtype=\"%d\" name=\"%s\"/", MidiDevice::JACK_MIDI, Xml::xmlString(name()).latin1());
/*
//xml.strTag(level, "dstNode", r->name());
@@ -587,7 +591,9 @@ void MidiJackDevice::writeRouting(int level, Xml& xml) const
else
if(r->type != Route::TRACK_ROUTE)
s += QString(QT_TR_NOOP(" type=\"%1\"")).arg(r->type);
- s += QString(QT_TR_NOOP(" name=\"%1\"/")).arg(r->name());
+
+ //s += QString(QT_TR_NOOP(" name=\"%1\"/")).arg(r->name());
+ s += QString(QT_TR_NOOP(" name=\"%1\"/")).arg(Xml::xmlString(r->name()));
xml.tag(level, s);
diff --git a/muse/muse/marker/marker.cpp b/muse/muse/marker/marker.cpp
index 9162b0e4..28de52d9 100644
--- a/muse/muse/marker/marker.cpp
+++ b/muse/muse/marker/marker.cpp
@@ -45,7 +45,11 @@ void Marker::read(Xml& xml)
else if (tag == "lock")
setType(xml.s2().toInt() ? FRAMES:TICKS);
else if (tag == "name")
+ {
_name = xml.s2();
+ //p3.3.42
+ //printf("Marker::read name:%s\n", _name.latin1());
+ }
break;
case Xml::TagEnd:
if (xml.s1() == "marker")
@@ -65,7 +69,8 @@ void MarkerList::write(int level, Xml& xml) const
for (ciMarker i = begin(); i != end(); ++i) {
const Marker& m = i->second;
xml.put(level, "<marker tick=\"%d\" lock=\"%d\" name=\"%s\" />",
- m.tick(), m.type()==Pos::FRAMES, m.name().latin1());
+ //m.tick(), m.type()==Pos::FRAMES, m.name().latin1());
+ m.tick(), m.type()==Pos::FRAMES, Xml::xmlString(m.name()).latin1());
}
}
diff --git a/muse/muse/plugin.cpp b/muse/muse/plugin.cpp
index 75edeef4..a8b7fa5a 100644
--- a/muse/muse/plugin.cpp
+++ b/muse/muse/plugin.cpp
@@ -1856,12 +1856,14 @@ void PluginI::writeConfiguration(int level, Xml& xml)
xml.tag(level++, "plugin file=\"%s\" label=\"%s\" channel=\"%d\"",
//_plugin->lib().latin1(), _plugin->label().latin1(), instances * _plugin->inports());
// p3.3.41
- _plugin->lib().latin1(), _plugin->label().latin1(), channel);
+ //_plugin->lib().latin1(), _plugin->label().latin1(), channel);
+ Xml::xmlString(_plugin->lib()).latin1(), Xml::xmlString(_plugin->label()).latin1(), channel);
for (int i = 0; i < controlPorts; ++i) {
int idx = controls[i].idx;
QString s("control name=\"%1\" val=\"%2\" /");
- xml.tag(level, s.arg(_plugin->portName(idx)).arg(controls[i].tmpVal).latin1());
+ //xml.tag(level, s.arg(_plugin->portName(idx)).arg(controls[i].tmpVal).latin1());
+ xml.tag(level, s.arg(Xml::xmlString(_plugin->portName(idx)).latin1()).arg(controls[i].tmpVal).latin1());
}
if (_on == false)
xml.intTag(level, "on", _on);
diff --git a/muse/muse/songfile.cpp b/muse/muse/songfile.cpp
index a1f51c69..42b41a92 100644
--- a/muse/muse/songfile.cpp
+++ b/muse/muse/songfile.cpp
@@ -891,7 +891,8 @@ void Song::writeFont(int level, Xml& xml, const char* name,
const QFont& font) const
{
xml.nput(level, "<%s family=\"%s\" size=\"%d\"",
- name, font.family().latin1(), font.pointSize());
+ //name, font.family().latin1(), font.pointSize());
+ name, Xml::xmlString(font.family()).latin1(), font.pointSize());
if (font.weight() != QFont::Normal)
xml.nput(" weight=\"%d\"", font.weight());
if (font.italic())
diff --git a/muse/muse/track.cpp b/muse/muse/track.cpp
index 6f6f11a8..40eb646c 100644
--- a/muse/muse/track.cpp
+++ b/muse/muse/track.cpp
@@ -679,7 +679,8 @@ void Track::writeRouting(int level, Xml& xml) const
s = QT_TR_NOOP("source");
if(r->type != Route::TRACK_ROUTE)
s += QString(QT_TR_NOOP(" type=\"%1\"")).arg(r->type);
- s += QString(QT_TR_NOOP(" name=\"%1\"/")).arg(r->name());
+ //s += QString(QT_TR_NOOP(" name=\"%1\"/")).arg(r->name());
+ s += QString(QT_TR_NOOP(" name=\"%1\"/")).arg(Xml::xmlString(r->name()));
xml.tag(level, s);
///xml.strTag(level, "dstNode", dst.name());
@@ -688,7 +689,9 @@ void Track::writeRouting(int level, Xml& xml) const
// xml.tag(level, "dest type=\"%d\" channel=\"%d\" name=\"%s\"/", Route::TRACK_ROUTE, r->channel, name().latin1());
//else
// xml.tag(level, "dest type=\"%d\" name=\"%s\"/", Route::TRACK_ROUTE, name().latin1());
- xml.tag(level, "dest name=\"%s\"/", name().latin1());
+
+ //xml.tag(level, "dest name=\"%s\"/", name().latin1());
+ xml.tag(level, "dest name=\"%s\"/", Xml::xmlString(name()).latin1());
xml.etag(level--, "Route");
}
@@ -733,7 +736,8 @@ void Track::writeRouting(int level, Xml& xml) const
// xml.tag(level, "source type=\"%d\" channel=\"%d\" name=\"%s\"/", Route::TRACK_ROUTE, r->channel, name().latin1());
//else
// xml.tag(level, "source type=\"%d\" name=\"%s\"/", Route::TRACK_ROUTE, name().latin1());
- xml.tag(level, "source name=\"%s\"/", name().latin1());
+ //xml.tag(level, "source name=\"%s\"/", name().latin1());
+ xml.tag(level, "source name=\"%s\"/", Xml::xmlString(name()).latin1());
///xml.strTag(level, "dstNode", r->name());
//if(r->channel != -1)
@@ -759,7 +763,9 @@ void Track::writeRouting(int level, Xml& xml) const
else
if(r->type != Route::TRACK_ROUTE)
s += QString(QT_TR_NOOP(" type=\"%1\"")).arg(r->type);
- s += QString(QT_TR_NOOP(" name=\"%1\"/")).arg(r->name());
+
+ //s += QString(QT_TR_NOOP(" name=\"%1\"/")).arg(r->name());
+ s += QString(QT_TR_NOOP(" name=\"%1\"/")).arg(Xml::xmlString(r->name()));
xml.tag(level, s);
xml.etag(level--, "Route");
diff --git a/muse/muse/widgets/header.cpp b/muse/muse/widgets/header.cpp
index 9baff38e..6cbf9c3a 100644
--- a/muse/muse/widgets/header.cpp
+++ b/muse/muse/widgets/header.cpp
@@ -51,10 +51,12 @@ void Header::readStatus(Xml& xml)
void Header::writeStatus(int level, Xml& xml) const
{
- xml.nput(level, "<%s> ", name());
+ //xml.nput(level, "<%s> ", name());
+ xml.nput(level, "<%s> ", Xml::xmlString(name()).latin1());
int n = count() - 1;
for (int i = n; i >= 0; --i)
xml.nput("%d ", mapToSection(i));
- xml.put("</%s>", name());
+ //xml.put("</%s>", name());
+ xml.put("</%s>", Xml::xmlString(name()).latin1());
}
diff --git a/muse/muse/widgets/splitter.cpp b/muse/muse/widgets/splitter.cpp
index 7f6f32b7..b0284648 100644
--- a/muse/muse/widgets/splitter.cpp
+++ b/muse/muse/widgets/splitter.cpp
@@ -26,12 +26,14 @@ Splitter::Splitter(Qt::Orientation o, QWidget* parent, const char* name)
void Splitter::writeStatus(int level, Xml& xml)
{
QValueList<int> vl = sizes();
- xml.nput(level++, "<%s>", name());
+ //xml.nput(level++, "<%s>", name());
+ xml.nput(level++, "<%s>", Xml::xmlString(name()).latin1());
QValueListIterator<int> ivl = vl.begin();
for (; ivl != vl.end(); ++ivl) {
xml.nput("%d ", *ivl);
}
- xml.nput("</%s>\n", name());
+ //xml.nput("</%s>\n", name());
+ xml.nput("</%s>\n", Xml::xmlString(name()).latin1());
}
//---------------------------------------------------------
diff --git a/muse/muse/xml.cpp b/muse/muse/xml.cpp
index 0d19d4c0..88251cc8 100644
--- a/muse/muse/xml.cpp
+++ b/muse/muse/xml.cpp
@@ -700,6 +700,15 @@ void Xml::skip(const QString& etag)
// xmlString
//---------------------------------------------------------
+QString Xml::xmlString(const char* s)
+ {
+ return Xml::xmlString(QString(s));
+ }
+
+//---------------------------------------------------------
+// xmlString
+//---------------------------------------------------------
+
QString Xml::xmlString(const QString& ss)
{
QString s(ss);
diff --git a/muse/muse/xml.h b/muse/muse/xml.h
index 1af6bd1b..912ddb4a 100644
--- a/muse/muse/xml.h
+++ b/muse/muse/xml.h
@@ -85,6 +85,7 @@ class Xml {
void geometryTag(int level, const char* name, const QWidget* g);
void qrectTag(int level, const char* name, const QRect& r);
static QString xmlString(const QString&);
+ static QString xmlString(const char*);
void skip(const QString& tag);
};
diff --git a/muse/synti/vam/vamgui.cpp b/muse/synti/vam/vamgui.cpp
index ea56628d..3e3ea30d 100644
--- a/muse/synti/vam/vamgui.cpp
+++ b/muse/synti/vam/vamgui.cpp
@@ -164,7 +164,8 @@ void Preset::readConfiguration(Xml& xml)
void Preset::writeConfiguration(Xml& xml, int level)
{
- xml.tag(level++, "preset name=\"%s\"", name.ascii());
+ //xml.tag(level++, "preset name=\"%s\"", name.ascii());
+ xml.tag(level++, "preset name=\"%s\"", Xml::xmlString(name).ascii());
for (int i = 0; i < NUM_CONTROLLER; ++i) {
xml.tag(level, "control idx=\"%d\" val=\"%d\" /", i, ctrl[i]);
}