comparison main/OSCHandler.cpp @ 2300:eb7f4579e5cc by-id

Updates throughout for ModelById logic
author Chris Cannam
date Thu, 04 Jul 2019 14:32:08 +0100
parents e9c77a4c865e
children 1e77e4ee27f5
comparison
equal deleted inserted replaced
2299:bb0f5a8f93fe 2300:eb7f4579e5cc
108 getMainModel()->getSampleRate(), 108 getMainModel()->getSampleRate(),
109 getMainModel()->getChannelCount(), 109 getMainModel()->getChannelCount(),
110 WavFileWriter::WriteToTemporary); 110 WavFileWriter::WriteToTemporary);
111 MultiSelection ms = m_viewManager->getSelection(); 111 MultiSelection ms = m_viewManager->getSelection();
112 if (!ms.getSelections().empty()) { 112 if (!ms.getSelections().empty()) {
113 writer.writeModel(getMainModel(), &ms); 113 //!!! todo: update WavFileWriter!
114 writer.writeModel(getMainModel().get(), &ms);
114 } else { 115 } else {
115 writer.writeModel(getMainModel()); 116 writer.writeModel(getMainModel().get());
116 } 117 }
117 } 118 }
118 } 119 }
119 } 120 }
120 121
350 cerr << "WARNING: OSCHandler: unknown layer " 351 cerr << "WARNING: OSCHandler: unknown layer "
351 << "type " << str << endl; 352 << "type " << str << endl;
352 } else { 353 } else {
353 354
354 LayerConfiguration configuration(type, 355 LayerConfiguration configuration(type,
355 getMainModel(), 356 getMainModelId(),
356 channel); 357 channel);
357 358
358 addPane(configuration, 359 addPane(configuration,
359 tr("Add %1 Pane") 360 tr("Add %1 Pane")
360 .arg(LayerFactory::getInstance()-> 361 .arg(LayerFactory::getInstance()->
609 610
610 Transform transform = TransformFactory::getInstance()-> 611 Transform transform = TransformFactory::getInstance()->
611 getDefaultTransformFor(transformId); 612 getDefaultTransformFor(transformId);
612 613
613 Layer *newLayer = m_document->createDerivedLayer 614 Layer *newLayer = m_document->createDerivedLayer
614 (transform, getMainModel()); 615 (transform, getMainModelId());
615 616
616 if (newLayer) { 617 if (newLayer) {
617 m_document->addLayerToView(pane, newLayer); 618 m_document->addLayerToView(pane, newLayer);
618 m_recentTransforms.add(transformId); 619 m_recentTransforms.add(transformId);
619 m_paneStack->setCurrentLayer(pane, newLayer); 620 m_paneStack->setCurrentLayer(pane, newLayer);