Mercurial > hg > svapp
comparison framework/SVFileReader.cpp @ 53:de2b3c6479c8
* Introduce new Transform class which contains data necessary to describe the
context for a plugin -- the plugin's name and output, the step/block size
etc (formerly spread across ExecutionContext and TransformFactory). Other
code hasn't been updated to use this yet.
* Rename existing Transform stuff to Transformers (because they run Transforms)
I'm still not 100% sure about this change, don't rely on it.
| author | Chris Cannam |
|---|---|
| date | Mon, 05 Nov 2007 15:31:06 +0000 |
| parents | 73f682a551dc |
| children | 215b8b1b0308 89a689720ee9 |
comparison
equal
deleted
inserted
replaced
| 52:43ad8d909e28 | 53:de2b3c6479c8 |
|---|---|
| 284 std::cerr << "WARNING: SV-XML: Derivation has existing model " | 284 std::cerr << "WARNING: SV-XML: Derivation has existing model " |
| 285 << m_currentDerivedModelId | 285 << m_currentDerivedModelId |
| 286 << " as target, not regenerating" << std::endl; | 286 << " as target, not regenerating" << std::endl; |
| 287 } else { | 287 } else { |
| 288 m_currentDerivedModel = m_models[m_currentDerivedModelId] = | 288 m_currentDerivedModel = m_models[m_currentDerivedModelId] = |
| 289 m_document->addDerivedModel(m_currentTransform, | 289 m_document->addDerivedModel(m_currentTransformer, |
| 290 m_currentTransformSource, | 290 m_currentTransformerSource, |
| 291 m_currentTransformContext, | 291 m_currentTransformerContext, |
| 292 m_currentTransformConfiguration); | 292 m_currentTransformerConfiguration); |
| 293 } | 293 } |
| 294 } else { | 294 } else { |
| 295 m_document->addDerivedModel(m_currentTransform, | 295 m_document->addDerivedModel(m_currentTransformer, |
| 296 m_currentTransformSource, | 296 m_currentTransformerSource, |
| 297 m_currentTransformContext, | 297 m_currentTransformerContext, |
| 298 m_currentDerivedModel, | 298 m_currentDerivedModel, |
| 299 m_currentTransformConfiguration); | 299 m_currentTransformerConfiguration); |
| 300 } | 300 } |
| 301 | 301 |
| 302 m_addedModels.insert(m_currentDerivedModel); | 302 m_addedModels.insert(m_currentDerivedModel); |
| 303 m_currentDerivedModel = 0; | 303 m_currentDerivedModel = 0; |
| 304 m_currentDerivedModelId = -1; | 304 m_currentDerivedModelId = -1; |
| 305 m_currentTransform = ""; | 305 m_currentTransformer = ""; |
| 306 m_currentTransformConfiguration = ""; | 306 m_currentTransformerConfiguration = ""; |
| 307 | 307 |
| 308 } else if (name == "row") { | 308 } else if (name == "row") { |
| 309 m_inRow = false; | 309 m_inRow = false; |
| 310 } else if (name == "layer") { | 310 } else if (name == "layer") { |
| 311 m_inLayer = false; | 311 m_inLayer = false; |
| 1002 int sourceId = 0; | 1002 int sourceId = 0; |
| 1003 bool sourceOk = false; | 1003 bool sourceOk = false; |
| 1004 sourceId = attributes.value("source").trimmed().toInt(&sourceOk); | 1004 sourceId = attributes.value("source").trimmed().toInt(&sourceOk); |
| 1005 | 1005 |
| 1006 if (sourceOk && haveModel(sourceId)) { | 1006 if (sourceOk && haveModel(sourceId)) { |
| 1007 m_currentTransformSource = m_models[sourceId]; | 1007 m_currentTransformerSource = m_models[sourceId]; |
| 1008 } else { | 1008 } else { |
| 1009 m_currentTransformSource = m_document->getMainModel(); | 1009 m_currentTransformerSource = m_document->getMainModel(); |
| 1010 } | 1010 } |
| 1011 | 1011 |
| 1012 m_currentTransform = transform; | 1012 m_currentTransformer = transform; |
| 1013 m_currentTransformConfiguration = ""; | 1013 m_currentTransformerConfiguration = ""; |
| 1014 | 1014 |
| 1015 m_currentTransformContext = PluginTransform::ExecutionContext(); | 1015 m_currentTransformerContext = PluginTransformer::ExecutionContext(); |
| 1016 | 1016 |
| 1017 bool ok = false; | 1017 bool ok = false; |
| 1018 int channel = attributes.value("channel").trimmed().toInt(&ok); | 1018 int channel = attributes.value("channel").trimmed().toInt(&ok); |
| 1019 if (ok) m_currentTransformContext.channel = channel; | 1019 if (ok) m_currentTransformerContext.channel = channel; |
| 1020 | 1020 |
| 1021 int domain = attributes.value("domain").trimmed().toInt(&ok); | 1021 int domain = attributes.value("domain").trimmed().toInt(&ok); |
| 1022 if (ok) m_currentTransformContext.domain = Vamp::Plugin::InputDomain(domain); | 1022 if (ok) m_currentTransformerContext.domain = Vamp::Plugin::InputDomain(domain); |
| 1023 | 1023 |
| 1024 int stepSize = attributes.value("stepSize").trimmed().toInt(&ok); | 1024 int stepSize = attributes.value("stepSize").trimmed().toInt(&ok); |
| 1025 if (ok) m_currentTransformContext.stepSize = stepSize; | 1025 if (ok) m_currentTransformerContext.stepSize = stepSize; |
| 1026 | 1026 |
| 1027 int blockSize = attributes.value("blockSize").trimmed().toInt(&ok); | 1027 int blockSize = attributes.value("blockSize").trimmed().toInt(&ok); |
| 1028 if (ok) m_currentTransformContext.blockSize = blockSize; | 1028 if (ok) m_currentTransformerContext.blockSize = blockSize; |
| 1029 | 1029 |
| 1030 int windowType = attributes.value("windowType").trimmed().toInt(&ok); | 1030 int windowType = attributes.value("windowType").trimmed().toInt(&ok); |
| 1031 if (ok) m_currentTransformContext.windowType = WindowType(windowType); | 1031 if (ok) m_currentTransformerContext.windowType = WindowType(windowType); |
| 1032 | 1032 |
| 1033 QString startFrameStr = attributes.value("startFrame"); | 1033 QString startFrameStr = attributes.value("startFrame"); |
| 1034 QString durationStr = attributes.value("duration"); | 1034 QString durationStr = attributes.value("duration"); |
| 1035 | 1035 |
| 1036 size_t startFrame = 0; | 1036 size_t startFrame = 0; |
| 1043 if (durationStr != "") { | 1043 if (durationStr != "") { |
| 1044 duration = durationStr.trimmed().toInt(&ok); | 1044 duration = durationStr.trimmed().toInt(&ok); |
| 1045 if (!ok) duration = 0; | 1045 if (!ok) duration = 0; |
| 1046 } | 1046 } |
| 1047 | 1047 |
| 1048 m_currentTransformContext.startFrame = startFrame; | 1048 m_currentTransformerContext.startFrame = startFrame; |
| 1049 m_currentTransformContext.duration = duration; | 1049 m_currentTransformerContext.duration = duration; |
| 1050 | 1050 |
| 1051 return true; | 1051 return true; |
| 1052 } | 1052 } |
| 1053 | 1053 |
| 1054 bool | 1054 bool |
| 1125 configurationXml += "/>"; | 1125 configurationXml += "/>"; |
| 1126 | 1126 |
| 1127 if (m_currentPlayParameters) { | 1127 if (m_currentPlayParameters) { |
| 1128 m_currentPlayParameters->setPlayPluginConfiguration(configurationXml); | 1128 m_currentPlayParameters->setPlayPluginConfiguration(configurationXml); |
| 1129 } else { | 1129 } else { |
| 1130 m_currentTransformConfiguration += configurationXml; | 1130 m_currentTransformerConfiguration += configurationXml; |
| 1131 } | 1131 } |
| 1132 | 1132 |
| 1133 return true; | 1133 return true; |
| 1134 } | 1134 } |
| 1135 | 1135 |
