Mercurial > hg > svcore
comparison data/model/Path.h @ 1741:9d82b164f264 by-id
Work on commands, and some other model updates
author | Chris Cannam |
---|---|
date | Thu, 27 Jun 2019 13:08:10 +0100 |
parents | 4abc0f08adf9 |
children | 14bf9bf5ac28 |
comparison
equal
deleted
inserted
replaced
1740:fe3f7f8df3a3 | 1741:9d82b164f264 |
---|---|
94 QString indent = "", | 94 QString indent = "", |
95 QString extraAttributes = "") const override { | 95 QString extraAttributes = "") const override { |
96 | 96 |
97 // For historical reasons we serialise a Path as a model, | 97 // For historical reasons we serialise a Path as a model, |
98 // although the class itself no longer is. | 98 // although the class itself no longer is. |
99 | |
100 // We also write start and end frames - which our API no | |
101 // longer exposes - just for backward compatibility | |
102 | |
103 sv_frame_t start = 0; | |
104 sv_frame_t end = 0; | |
105 if (!m_points.empty()) { | |
106 start = m_points.begin()->frame; | |
107 end = m_points.rbegin()->frame + m_resolution; | |
108 } | |
99 | 109 |
100 // Our dataset doesn't have its own export ID, we just use | 110 // Our dataset doesn't have its own export ID, we just use |
101 // ours. Actually any model could do that, since datasets | 111 // ours. Actually any model could do that, since datasets |
102 // aren't in the same id-space as models (or paths) when | 112 // aren't in the same id-space as models (or paths) when |
103 // re-read | 113 // re-read |
104 | 114 |
105 out << indent; | 115 out << indent; |
106 out << QString("<model id=\"%1\" name=\"\" sampleRate=\"%2\" " | 116 out << QString("<model id=\"%1\" name=\"\" sampleRate=\"%2\" " |
107 "type=\"sparse\" dimensions=\"2\" resolution=\"%3\" " | 117 "start=\"%3\" end=\"%4\" type=\"sparse\" " |
108 "notifyOnAdd=\"true\" dataset=\"%4\" " | 118 "dimensions=\"2\" resolution=\"%5\" " |
109 "subtype=\"path\" %5/>\n") | 119 "notifyOnAdd=\"true\" dataset=\"%6\" " |
120 "subtype=\"path\" %7/>\n") | |
110 .arg(getExportId()) | 121 .arg(getExportId()) |
111 .arg(m_sampleRate) | 122 .arg(m_sampleRate) |
123 .arg(start) | |
124 .arg(end) | |
112 .arg(m_resolution) | 125 .arg(m_resolution) |
113 .arg(getExportId()) | 126 .arg(getExportId()) |
114 .arg(extraAttributes); | 127 .arg(extraAttributes); |
115 | 128 |
116 out << indent << QString("<dataset id=\"%1\" dimensions=\"2\">\n") | 129 out << indent << QString("<dataset id=\"%1\" dimensions=\"2\">\n") |