changeset 288:7b96b3bd4bae

* Fix #1757772 tempo, dynamic related plug-ins bug -- make auto-align only auto-align if there is a unit involved * Fix #1755366 text layer bug in retrieved session * Fix input model selection in plugin parameter dialog (was being ignored) * Use lighter background than the standard widget one for panes (assuming the widget background is light but not white) -- similarly darker if dark * Fix colour reference counting in loaded session in SingleColourLayer * Reset overview pane colour when switching dark background on or off
author Chris Cannam
date Tue, 14 Aug 2007 13:58:53 +0000
parents 557e00480279
children 3020904de772
files data/model/Model.cpp data/model/NoteModel.h data/model/TextModel.h data/model/WaveFileModel.cpp data/model/WaveFileModel.h data/model/WritableWaveFileModel.cpp data/model/WritableWaveFileModel.h
diffstat 7 files changed, 16 insertions(+), 43 deletions(-) [+]
line wrap: on
line diff
--- a/data/model/Model.cpp	Mon Aug 13 14:51:35 2007 +0000
+++ b/data/model/Model.cpp	Tue Aug 14 13:58:53 2007 +0000
@@ -51,16 +51,11 @@
 Model::toXmlString(QString indent, QString extraAttributes) const
 {
     QString s;
-    
-    s += indent;
 
-    s += QString("<model id=\"%1\" name=\"%2\" sampleRate=\"%3\" start=\"%4\" end=\"%5\" %6/>\n")
-	.arg(getObjectExportId(this))
-	.arg(encodeEntities(objectName()))
-	.arg(getSampleRate())
-	.arg(getStartFrame())
-	.arg(getEndFrame())
-	.arg(extraAttributes);
+    {
+        QTextStream out(&s);
+        toXml(out, indent, extraAttributes);
+    }
 
     return s;
 }
--- a/data/model/NoteModel.h	Mon Aug 13 14:51:35 2007 +0000
+++ b/data/model/NoteModel.h	Tue Aug 14 13:58:53 2007 +0000
@@ -120,11 +120,13 @@
      */
     virtual PointList getPoints(long frame) const;
 
-    virtual QString toXmlString(QString indent = "",
-				QString extraAttributes = "") const
+    virtual void toXml(QTextStream &out,
+                       QString indent = "",
+                       QString extraAttributes = "") const
     {
-	return SparseValueModel<Note>::toXmlString
-	    (indent,
+	return SparseValueModel<Note>::toXml
+	    (out,
+             indent,
 	     QString("%1 valueQuantization=\"%2\"")
 	     .arg(extraAttributes).arg(m_valueQuantization));
     }
--- a/data/model/TextModel.h	Mon Aug 13 14:51:35 2007 +0000
+++ b/data/model/TextModel.h	Tue Aug 14 13:58:53 2007 +0000
@@ -81,11 +81,13 @@
 	SparseModel<TextPoint>(sampleRate, resolution, notifyOnAdd)
     { }
 
-    virtual QString toXmlString(QString indent = "",
-				QString extraAttributes = "") const
+    virtual void toXml(QTextStream &out,
+                       QString indent = "",
+                       QString extraAttributes = "") const
     {
-	return SparseModel<TextPoint>::toXmlString
-	    (indent,
+        SparseModel<TextPoint>::toXml
+	    (out, 
+             indent,
 	     QString("%1 subtype=\"text\"")
 	     .arg(extraAttributes));
     }
--- a/data/model/WaveFileModel.cpp	Mon Aug 13 14:51:35 2007 +0000
+++ b/data/model/WaveFileModel.cpp	Tue Aug 14 13:58:53 2007 +0000
@@ -618,12 +618,4 @@
                  .arg(encodeEntities(m_path)).arg(extraAttributes));
 }
 
-QString
-WaveFileModel::toXmlString(QString indent,
-			   QString extraAttributes) const
-{
-    return Model::toXmlString(indent,
-			      QString("type=\"wavefile\" file=\"%1\" %2")
-			      .arg(encodeEntities(m_path)).arg(extraAttributes));
-}
     
--- a/data/model/WaveFileModel.h	Mon Aug 13 14:51:35 2007 +0000
+++ b/data/model/WaveFileModel.h	Tue Aug 14 13:58:53 2007 +0000
@@ -70,9 +70,6 @@
                        QString indent = "",
                        QString extraAttributes = "") const;
 
-    virtual QString toXmlString(QString indent = "",
-				QString extraAttributes = "") const;
-
 signals:
     void modelChanged();
     void modelChanged(size_t, size_t);
--- a/data/model/WritableWaveFileModel.cpp	Mon Aug 13 14:51:35 2007 +0000
+++ b/data/model/WritableWaveFileModel.cpp	Tue Aug 14 13:58:53 2007 +0000
@@ -211,15 +211,3 @@
          .arg(m_writer->getPath()).arg(m_model->getChannelCount()).arg(extraAttributes));
 }
 
-QString
-WritableWaveFileModel::toXmlString(QString indent,
-                                   QString extraAttributes) const
-{
-    // As above.
-
-    return Model::toXmlString
-        (indent,
-         QString("type=\"writablewavefile\" file=\"%1\" channels=\"%2\" %3")
-         .arg(m_writer->getPath()).arg(m_model->getChannelCount()).arg(extraAttributes));
-}
-
--- a/data/model/WritableWaveFileModel.h	Mon Aug 13 14:51:35 2007 +0000
+++ b/data/model/WritableWaveFileModel.h	Tue Aug 14 13:58:53 2007 +0000
@@ -75,9 +75,6 @@
                        QString indent = "",
                        QString extraAttributes = "") const;
 
-    virtual QString toXmlString(QString indent = "",
-				QString extraAttributes = "") const;
-
 protected:
     WaveFileModel *m_model;
     WavFileWriter *m_writer;