# HG changeset patch # User Chris Cannam # Date 1158676626 0 # Node ID a1f7d265ac79a045280a2fed67e4cf37e4543de0 # Parent 4d132a06db9b86311b00ae0b8ba7cb8d8cbfd7cd * More to do with passing around step/blocksize etc from plugin dialog to plugins. Still some puzzling unresolved details. diff -r 4d132a06db9b -r a1f7d265ac79 widgets/PluginParameterDialog.cpp --- a/widgets/PluginParameterDialog.cpp Mon Sep 18 16:43:17 2006 +0000 +++ b/widgets/PluginParameterDialog.cpp Tue Sep 19 14:37:06 2006 +0000 @@ -65,9 +65,11 @@ font.setBold(true); QLabel *nameLabel = new QLabel(plugin->getDescription().c_str()); + nameLabel->setWordWrap(true); nameLabel->setFont(font); QLabel *makerLabel = new QLabel(plugin->getMaker().c_str()); + makerLabel->setWordWrap(true); QLabel *outputLabel = 0; @@ -85,19 +87,25 @@ for (size_t i = 0; i < od.size(); ++i) { if (od[i].name == output.toStdString()) { outputLabel = new QLabel(od[i].description.c_str()); + outputLabel->setWordWrap(true); break; } } } + } else { + std::cerr << "Plugin " << plugin << " is not a feature extraction plugin" << std::endl;//!!! } } QLabel *versionLabel = new QLabel(QString("%1") .arg(plugin->getPluginVersion())); + versionLabel->setWordWrap(true); QLabel *copyrightLabel = new QLabel(plugin->getCopyright().c_str()); + copyrightLabel->setWordWrap(true); QLabel *typeLabel = new QLabel(plugin->getType().c_str()); + typeLabel->setWordWrap(true); typeLabel->setFont(font); subgrid->addWidget(new QLabel(tr("Name:")), 0, 0); @@ -203,9 +211,18 @@ int increment = 1024; if (fePlugin) { size = fePlugin->getPreferredBlockSize(); + std::cerr << "Feature extraction plugin \"" << fePlugin->getDescription() << "\" reports preferred block size as " << size << std::endl; if (size == 0) size = 1024; increment = fePlugin->getPreferredStepSize(); - if (increment == 0) increment = size; + if (increment == 0) { + if (fePlugin->getInputDomain() == Vamp::Plugin::TimeDomain) { + increment = size; + } else { + increment = size/2; + } + } + } else { + std::cerr << "Plugin " << plugin << " is not a feature extraction plugin" << std::endl;//!!! } QGroupBox *windowBox = new QGroupBox; @@ -235,7 +252,7 @@ if (val == size) blockSizeCombo->setCurrentIndex(i); } blockSizeCombo->setValidator(new QIntValidator(1, pow(2, 18), this)); - connect(blockSizeCombo, SIGNAL(valueChanged(QString)), + connect(blockSizeCombo, SIGNAL(textChanged(QString)), this, SLOT(blockSizeComboChanged(QString))); windowLayout->addWidget(blockSizeCombo, 0, 1); @@ -251,7 +268,7 @@ if (val == increment) incrementCombo->setCurrentIndex(i); } incrementCombo->setValidator(new QIntValidator(1, pow(2, 18), this)); - connect(incrementCombo, SIGNAL(valueChanged(QString)), + connect(incrementCombo, SIGNAL(textChanged(QString)), this, SLOT(incrementComboChanged(QString))); windowLayout->addWidget(incrementCombo, 1, 1); @@ -317,18 +334,22 @@ stepSize = m_stepSize; blockSize = m_blockSize; windowType = m_windowType; + return; } void PluginParameterDialog::blockSizeComboChanged(QString text) { m_blockSize = text.toInt(); + std::cerr << "Block size changed to " << m_blockSize << std::endl; } void PluginParameterDialog::incrementComboChanged(QString text) { m_stepSize = text.toInt(); + //!!! rename increment to step size throughout + std::cerr << "Increment changed to " << m_blockSize << std::endl; } void diff -r 4d132a06db9b -r a1f7d265ac79 widgets/PluginParameterDialog.h --- a/widgets/PluginParameterDialog.h Mon Sep 18 16:43:17 2006 +0000 +++ b/widgets/PluginParameterDialog.h Tue Sep 19 14:37:06 2006 +0000 @@ -52,6 +52,8 @@ int getChannel() const { return m_channel; } + //!!! merge with PluginTransform::ExecutionContext + void getProcessingParameters(size_t &blockSize) const; void getProcessingParameters(size_t &stepSize, size_t &blockSize, WindowType &windowType) const;