comparison base/PlayParameters.cpp @ 314:70a232b1f12a

* Make XmlExportable::toXml the function that is universally overridden (and pure virtual) instead of toXmlString. Tidies up some classes, notably the model classes, significantly. Closes #1794561.
author Chris Cannam
date Thu, 18 Oct 2007 10:15:07 +0000
parents 41d64b873d87
children 5858cc462d0a
comparison
equal deleted inserted replaced
313:29485aa03da4 314:70a232b1f12a
15 15
16 #include "PlayParameters.h" 16 #include "PlayParameters.h"
17 17
18 #include <iostream> 18 #include <iostream>
19 19
20 #include <QTextStream>
21
20 void 22 void
21 PlayParameters::copyFrom(const PlayParameters *pp) 23 PlayParameters::copyFrom(const PlayParameters *pp)
22 { 24 {
23 m_playMuted = pp->isPlayMuted(); 25 m_playMuted = pp->isPlayMuted();
24 m_playPan = pp->getPlayPan(); 26 m_playPan = pp->getPlayPan();
25 m_playGain = pp->getPlayGain(); 27 m_playGain = pp->getPlayGain();
26 m_playPluginId = pp->getPlayPluginId(); 28 m_playPluginId = pp->getPlayPluginId();
27 m_playPluginConfiguration = pp->getPlayPluginConfiguration(); 29 m_playPluginConfiguration = pp->getPlayPluginConfiguration();
28 } 30 }
29 31
30 QString 32 void
31 PlayParameters::toXmlString(QString indent, 33 PlayParameters::toXml(QTextStream &stream,
32 QString extraAttributes) const 34 QString indent,
35 QString extraAttributes) const
33 { 36 {
34 QString s; 37 stream << indent;
35 s += indent; 38 stream << QString("<playparameters mute=\"%1\" pan=\"%2\" gain=\"%3\" pluginId=\"%4\" %6")
36 s += QString("<playparameters mute=\"%1\" pan=\"%2\" gain=\"%3\" pluginId=\"%4\" %6")
37 .arg(m_playMuted ? "true" : "false") 39 .arg(m_playMuted ? "true" : "false")
38 .arg(m_playPan) 40 .arg(m_playPan)
39 .arg(m_playGain) 41 .arg(m_playGain)
40 .arg(m_playPluginId) 42 .arg(m_playPluginId)
41 .arg(extraAttributes); 43 .arg(extraAttributes);
42 if (m_playPluginConfiguration != "") { 44 if (m_playPluginConfiguration != "") {
43 s += ">\n " + indent + m_playPluginConfiguration 45 stream << ">\n " << indent << m_playPluginConfiguration
44 + "\n" + indent + "</playparameters>\n"; 46 << "\n" << indent << "</playparameters>\n";
45 } else { 47 } else {
46 s += "/>\n"; 48 stream << "/>\n";
47 } 49 }
48 return s;
49 } 50 }
50 51
51 void 52 void
52 PlayParameters::setPlayMuted(bool muted) 53 PlayParameters::setPlayMuted(bool muted)
53 { 54 {