comparison main/MainWindow.cpp @ 27:61259228d029

* More to do with passing around step/blocksize etc from plugin dialog to plugins. Still some puzzling unresolved details.
author Chris Cannam
date Tue, 19 Sep 2006 14:37:06 +0000
parents d88d117e0c34
children 544ab25d2372
comparison
equal deleted inserted replaced
26:d88d117e0c34 27:61259228d029
2788 } 2788 }
2789 } 2789 }
2790 2790
2791 bool needConfiguration = false; 2791 bool needConfiguration = false;
2792 2792
2793 //!!! actually we should probably always ask for configuration
2794 //because we need the execution context
2795
2793 if (factory->isTransformConfigurable(transform)) { 2796 if (factory->isTransformConfigurable(transform)) {
2794 needConfiguration = true; 2797 needConfiguration = true;
2795 } else { 2798 } else {
2796 int minChannels, maxChannels; 2799 int minChannels, maxChannels;
2797 int myChannels = m_document->getMainModel()->getChannelCount(); 2800 int myChannels = m_document->getMainModel()->getChannelCount();
2801 // std::cerr << "myChannels: " << myChannels << ", minChannels: " << minChannels << ", maxChannels: " << maxChannels << std::endl; 2804 // std::cerr << "myChannels: " << myChannels << ", minChannels: " << minChannels << ", maxChannels: " << maxChannels << std::endl;
2802 needConfiguration = (myChannels > maxChannels && maxChannels == 1); 2805 needConfiguration = (myChannels > maxChannels && maxChannels == 1);
2803 } 2806 }
2804 } 2807 }
2805 2808
2809 PluginTransform::ExecutionContext context(channel);
2810
2806 if (needConfiguration) { 2811 if (needConfiguration) {
2807 bool ok = 2812 bool ok =
2808 factory->getConfigurationForTransform 2813 factory->getConfigurationForTransform
2809 (transform, m_document->getMainModel(), channel, configurationXml); 2814 (transform, m_document->getMainModel(), context, configurationXml);
2810 if (!ok) return; 2815 if (!ok) return;
2811 } 2816 }
2812 2817
2813 Layer *newLayer = m_document->createDerivedLayer(transform, 2818 Layer *newLayer = m_document->createDerivedLayer(transform,
2814 m_document->getMainModel(), 2819 m_document->getMainModel(),
2815 channel, 2820 context,
2816 configurationXml); 2821 configurationXml);
2817 2822
2818 if (newLayer) { 2823 if (newLayer) {
2819 m_document->addLayerToView(pane, newLayer); 2824 m_document->addLayerToView(pane, newLayer);
2820 m_document->setChannel(newLayer, channel); 2825 m_document->setChannel(newLayer, context.channel);
2821 } 2826 }
2822 2827
2823 updateMenuStates(); 2828 updateMenuStates();
2824 } 2829 }
2825 2830