comparison sv/document/Document.cpp @ 19:2a6f70f97395

add - EasaierSessionManager - Easaier menus - Interval model
author lbajardsilogic
date Mon, 14 May 2007 13:13:59 +0000
parents fc9323a41f5a
children 1894b1f1326b
comparison
equal deleted inserted replaced
18:d8e6709e9075 19:2a6f70f97395
30 #include <iostream> 30 #include <iostream>
31 31
32 //!!! still need to handle command history, documentRestored/documentModified 32 //!!! still need to handle command history, documentRestored/documentModified
33 33
34 Document::Document() : 34 Document::Document() :
35 m_mainModel(0) 35 m_mainModel(0),
36 m_audioSourceInfoModel(0)
36 { 37 {
37 connect(this, SIGNAL(modelAboutToBeDeleted(Model *)), 38 connect(this, SIGNAL(modelAboutToBeDeleted(Model *)),
38 TransformFactory::getInstance(), 39 TransformFactory::getInstance(),
39 SLOT(modelAboutToBeDeleted(Model *))); 40 SLOT(modelAboutToBeDeleted(Model *)));
40 } 41 }
68 delete m_models.begin()->first; 69 delete m_models.begin()->first;
69 } 70 }
70 m_models.erase(m_models.begin()); 71 m_models.erase(m_models.begin());
71 } 72 }
72 } 73 }
74
75 if (m_audioSourceInfoModel)
76 {
77 delete m_audioSourceInfoModel;
78 m_audioSourceInfoModel = 0;
79 }
73 80
74 // std::cerr << "Document::~Document: About to get rid of main model" 81 // std::cerr << "Document::~Document: About to get rid of main model"
75 // << std::endl; 82 // << std::endl;
76 emit modelAboutToBeDeleted(m_mainModel); 83 emit modelAboutToBeDeleted(m_mainModel);
77 emit mainModelChanged(0); 84 emit mainModelChanged(0);
310 317
311 // we already emitted modelAboutToBeDeleted for this 318 // we already emitted modelAboutToBeDeleted for this
312 delete oldMainModel; 319 delete oldMainModel;
313 } 320 }
314 321
322 void Document::setAudioSourceInfoModel(AudioSourceInfoModel *infoModel)
323 {
324 m_audioSourceInfoModel = infoModel;
325 emit audioSourceInfoAdded(m_audioSourceInfoModel);
326 }
327
315 void 328 void
316 Document::addDerivedModel(TransformId transform, 329 Document::addDerivedModel(TransformId transform,
317 Model *inputModel, 330 Model *inputModel,
318 const PluginTransform::ExecutionContext &context, 331 const PluginTransform::ExecutionContext &context,
319 Model *outputModelToAdd, 332 Model *outputModelToAdd,
859 } 872 }
860 873
861 return s; 874 return s;
862 } 875 }
863 876
877 QString
878 Document::toEasaierXmlString(QString indent, QString extraAttributes) const
879 {
880 QString s;
881
882 s += indent + QString("<data%1%2>\n")
883 .arg(extraAttributes == "" ? "" : " ").arg(extraAttributes);
884
885 s += indent + indent + QString("<easaierResources>\n");
886
887 s += indent + indent + indent + QString("<audio value=\"%1\" >\n")
888 .arg(getAudioSourceInfoFileName());
889
890 s += indent + indent + indent + QString("</audio>\n");
891
892 s += indent + indent + QString("</easaierResources>\n");
893
894 s += indent + "</data>\n";
895
896 return s;
897 }