comparison transform/RealTimePluginTransform.cpp @ 26:d88d117e0c34

* Add mono timestretch toggle button; some more work on getting blocksize etc parameters through to plugins
author Chris Cannam
date Mon, 18 Sep 2006 16:43:17 +0000
parents 40116f709d3b
children 61259228d029
comparison
equal deleted inserted replaced
25:e74f508db18c 26:d88d117e0c34
29 RealTimePluginTransform::RealTimePluginTransform(Model *inputModel, 29 RealTimePluginTransform::RealTimePluginTransform(Model *inputModel,
30 QString pluginId, 30 QString pluginId,
31 int channel, 31 int channel,
32 QString configurationXml, 32 QString configurationXml,
33 QString units, 33 QString units,
34 int output) : 34 int output,
35 size_t blockSize) :
35 Transform(inputModel), 36 Transform(inputModel),
36 m_plugin(0), 37 m_plugin(0),
37 m_channel(channel), 38 m_channel(channel),
38 m_outputNo(output) 39 m_outputNo(output),
40 m_blockSize(blockSize)
39 { 41 {
42 if (!m_blockSize) m_blockSize = 1024;
43
40 std::cerr << "RealTimePluginTransform::RealTimePluginTransform: plugin " << pluginId.toStdString() << ", output " << output << std::endl; 44 std::cerr << "RealTimePluginTransform::RealTimePluginTransform: plugin " << pluginId.toStdString() << ", output " << output << std::endl;
41 45
42 RealTimePluginFactory *factory = 46 RealTimePluginFactory *factory =
43 RealTimePluginFactory::instanceFor(pluginId); 47 RealTimePluginFactory::instanceFor(pluginId);
44 48
50 54
51 DenseTimeValueModel *input = getInput(); 55 DenseTimeValueModel *input = getInput();
52 if (!input) return; 56 if (!input) return;
53 57
54 m_plugin = factory->instantiatePlugin(pluginId, 0, 0, m_input->getSampleRate(), 58 m_plugin = factory->instantiatePlugin(pluginId, 0, 0, m_input->getSampleRate(),
55 1024, //!!! wants to be configurable 59 m_blockSize,
56 input->getChannelCount()); 60 input->getChannelCount());
57 61
58 if (!m_plugin) { 62 if (!m_plugin) {
59 std::cerr << "RealTimePluginTransform: Failed to instantiate plugin \"" 63 std::cerr << "RealTimePluginTransform: Failed to instantiate plugin \""
60 << pluginId.toStdString() << "\"" << std::endl; 64 << pluginId.toStdString() << "\"" << std::endl;
69 std::cerr << "RealTimePluginTransform: Plugin has fewer than desired " << m_outputNo << " control outputs" << std::endl; 73 std::cerr << "RealTimePluginTransform: Plugin has fewer than desired " << m_outputNo << " control outputs" << std::endl;
70 return; 74 return;
71 } 75 }
72 76
73 SparseTimeValueModel *model = new SparseTimeValueModel 77 SparseTimeValueModel *model = new SparseTimeValueModel
74 (input->getSampleRate(), 1024, //!!! 78 (input->getSampleRate(), m_blockSize, 0.0, 0.0, false);
75 0.0, 0.0, false);
76 79
77 if (units != "") model->setScaleUnits(units); 80 if (units != "") model->setScaleUnits(units);
78 81
79 m_output = model; 82 m_output = model;
80 } 83 }