comparison framework/Document.cpp @ 272:94bf7d7f2d6f tonioni

removed additional prints, midi playback still broken
author gyorgyf
date Sat, 13 Apr 2013 17:18:28 +0100
parents 776e1aae635a
children 14b1768e5406
comparison
equal deleted inserted replaced
271:f3f3ca272bce 272:94bf7d7f2d6f
118 118
119 #ifdef DEBUG_DOCUMENT 119 #ifdef DEBUG_DOCUMENT
120 SVDEBUG << "Document::createLayer: Added layer of type " << type 120 SVDEBUG << "Document::createLayer: Added layer of type " << type
121 << ", now have " << m_layers.size() << " layers" << endl; 121 << ", now have " << m_layers.size() << " layers" << endl;
122 #endif 122 #endif
123
124 std::cerr << "Document::createLayer: Added layer of type " << type
125 << ", now have " << m_layers.size() << " layers" << endl;
126 123
127 emit layerAdded(newLayer); 124 emit layerAdded(newLayer);
128 125
129 return newLayer; 126 return newLayer;
130 } 127 }
294 } 291 }
295 292
296 //!!! creating layer with the specified type 293 //!!! creating layer with the specified type
297 294
298 Layer *newLayer = createLayer(type); 295 Layer *newLayer = createLayer(type);
299 std::cerr << " NOTE: Created layer " << newLayer << " calling Document::setModel() " << std::endl;
300 setModel(newLayer, newModel); 296 setModel(newLayer, newModel);
301 297
302 //!!! We need to clone the model when adding the layer, so that it 298 //!!! We need to clone the model when adding the layer, so that it
303 //can be edited without affecting other layers that are based on 299 //can be edited without affecting other layers that are based on
304 //the same model. Unfortunately we can't just clone it now, 300 //the same model. Unfortunately we can't just clone it now,
605 if (!model) { 601 if (!model) {
606 std::cerr << "WARNING: Document::addDerivedModel: no output model for transform " << transform.getIdentifier() << std::endl; 602 std::cerr << "WARNING: Document::addDerivedModel: no output model for transform " << transform.getIdentifier() << std::endl;
607 } else { 603 } else {
608 addDerivedModel(applied, input, model); 604 addDerivedModel(applied, input, model);
609 } 605 }
610 std::cerr << "derived model from ModelTransformerFactory::getInstance()->transform " << std::endl; 606 // std::cerr << "derived model name: " << model->getTypeName() << std::endl;
611 std::cerr << "derived model name: " << model->getTypeName() << std::endl;
612 607
613 return model; 608 return model;
614 } 609 }
615 610
616 void 611 void
730 } 725 }
731 726
732 void 727 void
733 Document::setModel(Layer *layer, Model *model) 728 Document::setModel(Layer *layer, Model *model)
734 { 729 {
735 std::cerr << "Document::setModel: setting model " << std::endl;
736 if (model && 730 if (model &&
737 model != m_mainModel && 731 model != m_mainModel &&
738 m_models.find(model) == m_models.end()) { 732 m_models.find(model) == m_models.end()) {
739 std::cerr << "ERROR: Document::setModel: Layer " << layer 733 std::cerr << "ERROR: Document::setModel: Layer " << layer
740 << " (\"" << layer->objectName().toStdString() 734 << " (\"" << layer->objectName().toStdString()
762 if (model && previousModel) { 756 if (model && previousModel) {
763 PlayParameterRepository::getInstance()->copyParameters 757 PlayParameterRepository::getInstance()->copyParameters
764 (previousModel, model); 758 (previousModel, model);
765 } 759 }
766 760
767 std::cerr << "Document::setModel: calling layer->setModel() " << std::endl;
768 std::cerr << "Document::setModel: getInstance: " << LayerFactory::getInstance() << std::endl;
769 std::cerr << "model: " << model << std::endl;
770 std::cerr << "layer: " << layer << std::endl;
771 LayerFactory::getInstance()->setModel(layer, model); 761 LayerFactory::getInstance()->setModel(layer, model);
772 std::cerr << "layer type: " << LayerFactory::getInstance()->getLayerTypeName(LayerFactory::getInstance()->getLayerType(layer)) << std::endl; 762 // std::cerr << "layer type: " << LayerFactory::getInstance()->getLayerTypeName(LayerFactory::getInstance()->getLayerType(layer)) << std::endl;
773 std::cerr << "Document::setModel: done. " << std::endl;
774 763
775 if (previousModel) { 764 if (previousModel) {
776 releaseModel(previousModel); 765 releaseModel(previousModel);
777 } 766 }
778 } 767 }