comparison widgets/PluginParameterDialog.cpp @ 309:b7d45fed8146

* fix misbehaving apply-to-selection-only checkbox, fix default step size for frequency domain plugins
author Chris Cannam
date Tue, 09 Oct 2007 16:21:59 +0000
parents e9549ea3f825
children 4a542ba875c2
comparison
equal deleted inserted replaced
308:cda569dfbdfe 309:b7d45fed8146
20 20
21 #include "base/TextAbbrev.h" 21 #include "base/TextAbbrev.h"
22 22
23 #include "vamp-sdk/Plugin.h" 23 #include "vamp-sdk/Plugin.h"
24 #include "vamp-sdk/PluginHostAdapter.h" 24 #include "vamp-sdk/PluginHostAdapter.h"
25 #include "vamp-sdk/hostext/PluginWrapper.h"
25 26
26 #include <QGridLayout> 27 #include <QGridLayout>
27 #include <QLabel> 28 #include <QLabel>
28 #include <QGroupBox> 29 #include <QGroupBox>
29 #include <QHBoxLayout> 30 #include <QHBoxLayout>
261 } else { 262 } else {
262 m_outputSpacer->show(); 263 m_outputSpacer->show();
263 m_outputValue->setText(text); 264 m_outputValue->setText(text);
264 m_outputValue->setWordWrap(true); 265 m_outputValue->setWordWrap(true);
265 m_outputDescription->setText(description); 266 m_outputDescription->setText(description);
267 m_outputDescription->setWordWrap(true);
266 m_outputLabel->show(); 268 m_outputLabel->show();
267 m_outputValue->show(); 269 m_outputValue->show();
268 if (description != "") { 270 if (description != "") {
269 m_outputDescription->show(); 271 m_outputDescription->show();
270 } else { 272 } else {
346 return; 348 return;
347 } 349 }
348 350
349 if (showWindowSize) { 351 if (showWindowSize) {
350 352
351 Vamp::PluginHostAdapter *fePlugin = dynamic_cast<Vamp::PluginHostAdapter *>(m_plugin); 353 Vamp::Plugin *fePlugin = dynamic_cast<Vamp::Plugin *>(m_plugin);
354 if (!fePlugin) fePlugin = dynamic_cast<Vamp::PluginHostAdapter *>(m_plugin);
355 if (!fePlugin) fePlugin = dynamic_cast<Vamp::HostExt::PluginWrapper *>(m_plugin);
352 int size = 1024; 356 int size = 1024;
353 int increment = 1024; 357 int increment = 1024;
354 if (fePlugin) { 358 if (fePlugin) {
355 size = fePlugin->getPreferredBlockSize(); 359 size = fePlugin->getPreferredBlockSize();
356 std::cerr << "Feature extraction plugin \"" << fePlugin->getName() << "\" reports preferred block size as " << size << std::endl; 360 std::cerr << "Feature extraction plugin \"" << fePlugin->getName() << "\" reports preferred block size as " << size << std::endl;
479 settings.beginGroup("PluginParameterDialog"); 483 settings.beginGroup("PluginParameterDialog");
480 bool lastSelectionOnly = settings.value("lastselectiononly", false).toBool(); 484 bool lastSelectionOnly = settings.value("lastselectiononly", false).toBool();
481 settings.endGroup(); 485 settings.endGroup();
482 486
483 m_selectionOnly->setChecked(lastSelectionOnly); 487 m_selectionOnly->setChecked(lastSelectionOnly);
488 m_currentSelectionOnly = lastSelectionOnly;
484 489
485 connect(m_selectionOnly, SIGNAL(stateChanged(int)), 490 connect(m_selectionOnly, SIGNAL(stateChanged(int)),
486 this, SLOT(selectionOnlyChanged(int))); 491 this, SLOT(selectionOnlyChanged(int)));
487 492
488 m_selectionOnly->show(); 493 m_selectionOnly->show();
496 } 501 }
497 502
498 bool 503 bool
499 PluginParameterDialog::getSelectionOnly() const 504 PluginParameterDialog::getSelectionOnly() const
500 { 505 {
501 return m_selectionOnly; 506 return m_currentSelectionOnly;
502 } 507 }
503 508
504 void 509 void
505 PluginParameterDialog::getProcessingParameters(size_t &blockSize) const 510 PluginParameterDialog::getProcessingParameters(size_t &blockSize) const
506 { 511 {