Mercurial > hg > svapp
comparison framework/SVFileReader.h @ 100:22bf057ea151 1.2-stable
* merge from trunk (1.2 ended up being tracked from trunk, but we may want
this branch for fixes later)
author | Chris Cannam |
---|---|
date | Wed, 27 Feb 2008 10:32:45 +0000 |
parents | a798f5e6fc5e |
children |
comparison
equal
deleted
inserted
replaced
71:a8acc7841d70 | 100:22bf057ea151 |
---|---|
16 #ifndef _SV_FILE_READER_H_ | 16 #ifndef _SV_FILE_READER_H_ |
17 #define _SV_FILE_READER_H_ | 17 #define _SV_FILE_READER_H_ |
18 | 18 |
19 #include "layer/LayerFactory.h" | 19 #include "layer/LayerFactory.h" |
20 #include "plugin/transform/Transform.h" | 20 #include "plugin/transform/Transform.h" |
21 #include "plugin/transform/PluginTransformer.h" | |
22 | 21 |
23 #include <QXmlDefaultHandler> | 22 #include <QXmlDefaultHandler> |
24 | 23 |
25 #include <map> | 24 #include <map> |
26 | 25 |
87 is to be regenerated completely from the transform when | 86 is to be regenerated completely from the transform when |
88 the session is reloaded, then the model should have _only_ | 87 the session is reloaded, then the model should have _only_ |
89 a derivation element, and no model element should appear | 88 a derivation element, and no model element should appear |
90 for it at all. --> | 89 for it at all. --> |
91 | 90 |
92 <derivation source="0" model="2" transform="..." ...> | 91 <derivation type="transform" source="0" model="2" channel="-1"> |
93 <plugin id="..." ... /> | 92 <transform id="vamp:soname:pluginid:output" ... /> |
93 </derivation> | |
94 | |
95 <!-- Note that the derivation element just described replaces | |
96 this earlier formulation, which had more attributes in the | |
97 derivation element and a plugin element describing plugin | |
98 parameters and properties. What we actually read and | |
99 write these days is a horrid composite of the two formats, | |
100 for backward compatibility reasons. --> | |
101 | |
102 <derivation source="0" model="2" transform="vamp:soname:pluginid:output" ...> | |
103 <plugin id="pluginid" ... /> | |
94 </derivation> | 104 </derivation> |
95 | 105 |
96 <!-- The playparameters element lists playback settings for | 106 <!-- The playparameters element lists playback settings for |
97 a model. --> | 107 a model. --> |
98 | 108 |
149 | 159 |
150 \endverbatim | 160 \endverbatim |
151 */ | 161 */ |
152 | 162 |
153 | 163 |
154 class SVFileReader : public QXmlDefaultHandler | 164 class SVFileReader : public QObject, QXmlDefaultHandler |
155 { | 165 { |
166 Q_OBJECT | |
167 | |
156 public: | 168 public: |
157 SVFileReader(Document *document, | 169 SVFileReader(Document *document, |
158 SVFileReaderPaneCallback &callback, | 170 SVFileReaderPaneCallback &callback, |
159 QString location = ""); // for audio file locate mechanism | 171 QString location = ""); // for audio file locate mechanism |
160 virtual ~SVFileReader(); | 172 virtual ~SVFileReader(); |
179 const QString &localName, | 191 const QString &localName, |
180 const QString &qName); | 192 const QString &qName); |
181 | 193 |
182 bool error(const QXmlParseException &exception); | 194 bool error(const QXmlParseException &exception); |
183 bool fatalError(const QXmlParseException &exception); | 195 bool fatalError(const QXmlParseException &exception); |
196 | |
197 signals: | |
198 void modelRegenerationFailed(QString layerName, QString transformName, | |
199 QString message); | |
200 void modelRegenerationWarning(QString layerName, QString transformName, | |
201 QString message); | |
184 | 202 |
185 protected: | 203 protected: |
186 bool readWindow(const QXmlAttributes &); | 204 bool readWindow(const QXmlAttributes &); |
187 bool readModel(const QXmlAttributes &); | 205 bool readModel(const QXmlAttributes &); |
188 bool readView(const QXmlAttributes &); | 206 bool readView(const QXmlAttributes &); |
193 bool addRowToDataset(const QXmlAttributes &); | 211 bool addRowToDataset(const QXmlAttributes &); |
194 bool readRowData(const QString &); | 212 bool readRowData(const QString &); |
195 bool readDerivation(const QXmlAttributes &); | 213 bool readDerivation(const QXmlAttributes &); |
196 bool readPlayParameters(const QXmlAttributes &); | 214 bool readPlayParameters(const QXmlAttributes &); |
197 bool readPlugin(const QXmlAttributes &); | 215 bool readPlugin(const QXmlAttributes &); |
216 bool readTransform(const QXmlAttributes &); | |
217 bool readParameter(const QXmlAttributes &); | |
198 bool readSelection(const QXmlAttributes &); | 218 bool readSelection(const QXmlAttributes &); |
199 bool readMeasurement(const QXmlAttributes &); | 219 bool readMeasurement(const QXmlAttributes &); |
200 void addUnaddedModels(); | 220 void addUnaddedModels(); |
201 | 221 |
202 bool haveModel(int id) { | 222 bool haveModel(int id) { |
214 Layer *m_currentLayer; | 234 Layer *m_currentLayer; |
215 Model *m_currentDataset; | 235 Model *m_currentDataset; |
216 Model *m_currentDerivedModel; | 236 Model *m_currentDerivedModel; |
217 int m_currentDerivedModelId; | 237 int m_currentDerivedModelId; |
218 PlayParameters *m_currentPlayParameters; | 238 PlayParameters *m_currentPlayParameters; |
219 QString m_currentTransformer; | 239 Transform m_currentTransform; |
220 Model *m_currentTransformerSource; | 240 Model *m_currentTransformSource; |
221 PluginTransformer::ExecutionContext m_currentTransformerContext; | 241 int m_currentTransformChannel; |
222 QString m_currentTransformerConfiguration; | 242 bool m_currentTransformIsNewStyle; |
223 QString m_datasetSeparator; | 243 QString m_datasetSeparator; |
224 bool m_inRow; | 244 bool m_inRow; |
225 bool m_inLayer; | 245 bool m_inLayer; |
226 bool m_inView; | 246 bool m_inView; |
227 bool m_inData; | 247 bool m_inData; |