Mercurial > hg > svgui
comparison widgets/PluginParameterDialog.cpp @ 706:97ea68f62c1f imaf_enc
Merge from default branch
author | Chris Cannam |
---|---|
date | Thu, 05 Dec 2013 09:47:02 +0000 |
parents | 1a0dfcbffaf1 |
children | e4773943c9c1 |
comparison
equal
deleted
inserted
replaced
678:26c5f7fd4807 | 706:97ea68f62c1f |
---|---|
37 #include <QCheckBox> | 37 #include <QCheckBox> |
38 #include <QSettings> | 38 #include <QSettings> |
39 #include <QDialogButtonBox> | 39 #include <QDialogButtonBox> |
40 #include <QDesktopServices> | 40 #include <QDesktopServices> |
41 #include <QUrl> | 41 #include <QUrl> |
42 | |
43 #include "base/Debug.h" | |
42 | 44 |
43 PluginParameterDialog::PluginParameterDialog(Vamp::PluginBase *plugin, | 45 PluginParameterDialog::PluginParameterDialog(Vamp::PluginBase *plugin, |
44 QWidget *parent) : | 46 QWidget *parent) : |
45 QDialog(parent), | 47 QDialog(parent), |
46 m_plugin(plugin), | 48 m_plugin(plugin), |
325 QMessageBox::NoButton); | 327 QMessageBox::NoButton); |
326 | 328 |
327 } else { | 329 } else { |
328 | 330 |
329 if (m_haveChannelBoxData) { | 331 if (m_haveChannelBoxData) { |
330 std::cerr << "WARNING: PluginParameterDialog::setChannelArrangement: Calling more than once on same dialog is not currently implemented" << std::endl; | 332 cerr << "WARNING: PluginParameterDialog::setChannelArrangement: Calling more than once on same dialog is not currently implemented" << endl; |
331 return; | 333 return; |
332 } | 334 } |
333 | 335 |
334 QVBoxLayout *channelLayout = new QVBoxLayout; | 336 QVBoxLayout *channelLayout = new QVBoxLayout; |
335 m_channelBox->setLayout(channelLayout); | 337 m_channelBox->setLayout(channelLayout); |
370 void | 372 void |
371 PluginParameterDialog::setShowProcessingOptions(bool showWindowSize, | 373 PluginParameterDialog::setShowProcessingOptions(bool showWindowSize, |
372 bool showFrequencyDomainOptions) | 374 bool showFrequencyDomainOptions) |
373 { | 375 { |
374 if (m_haveWindowBoxData) { | 376 if (m_haveWindowBoxData) { |
375 std::cerr << "WARNING: PluginParameterDialog::setShowProcessingOptions: Calling more than once on same dialog is not currently implemented" << std::endl; | 377 cerr << "WARNING: PluginParameterDialog::setShowProcessingOptions: Calling more than once on same dialog is not currently implemented" << endl; |
376 return; | 378 return; |
377 } | 379 } |
378 | 380 |
379 if (showWindowSize) { | 381 if (showWindowSize) { |
380 | 382 |
383 if (!fePlugin) fePlugin = dynamic_cast<Vamp::HostExt::PluginWrapper *>(m_plugin); | 385 if (!fePlugin) fePlugin = dynamic_cast<Vamp::HostExt::PluginWrapper *>(m_plugin); |
384 int size = 1024; | 386 int size = 1024; |
385 int increment = 1024; | 387 int increment = 1024; |
386 if (fePlugin) { | 388 if (fePlugin) { |
387 size = fePlugin->getPreferredBlockSize(); | 389 size = fePlugin->getPreferredBlockSize(); |
388 std::cerr << "Feature extraction plugin \"" << fePlugin->getName() << "\" reports preferred block size as " << size << std::endl; | 390 cerr << "Feature extraction plugin \"" << fePlugin->getName() << "\" reports preferred block size as " << size << endl; |
389 if (size == 0) size = 1024; | 391 if (size == 0) size = 1024; |
390 increment = fePlugin->getPreferredStepSize(); | 392 increment = fePlugin->getPreferredStepSize(); |
391 if (increment == 0) { | 393 if (increment == 0) { |
392 if (fePlugin->getInputDomain() == Vamp::Plugin::TimeDomain) { | 394 if (fePlugin->getInputDomain() == Vamp::Plugin::TimeDomain) { |
393 increment = size; | 395 increment = size; |
404 windowLayout->addWidget(new QLabel(tr("Window size:")), 0, 0); | 406 windowLayout->addWidget(new QLabel(tr("Window size:")), 0, 0); |
405 } else { | 407 } else { |
406 windowLayout->addWidget(new QLabel(tr("Audio frames per block:")), 0, 0); | 408 windowLayout->addWidget(new QLabel(tr("Audio frames per block:")), 0, 0); |
407 } | 409 } |
408 | 410 |
409 std::cerr << "size: " << size << ", increment: " << increment << std::endl; | 411 cerr << "size: " << size << ", increment: " << increment << endl; |
410 | 412 |
411 QComboBox *blockSizeCombo = new QComboBox; | 413 QComboBox *blockSizeCombo = new QComboBox; |
412 blockSizeCombo->setEditable(true); | 414 blockSizeCombo->setEditable(true); |
413 bool found = false; | 415 bool found = false; |
414 for (int i = 0; i < 14; ++i) { | 416 for (int i = 0; i < 14; ++i) { |
557 | 559 |
558 void | 560 void |
559 PluginParameterDialog::blockSizeComboChanged(const QString &text) | 561 PluginParameterDialog::blockSizeComboChanged(const QString &text) |
560 { | 562 { |
561 m_blockSize = text.toInt(); | 563 m_blockSize = text.toInt(); |
562 std::cerr << "Block size changed to " << m_blockSize << std::endl; | 564 cerr << "Block size changed to " << m_blockSize << endl; |
563 } | 565 } |
564 | 566 |
565 void | 567 void |
566 PluginParameterDialog::incrementComboChanged(const QString &text) | 568 PluginParameterDialog::incrementComboChanged(const QString &text) |
567 { | 569 { |
568 m_stepSize = text.toInt(); | 570 m_stepSize = text.toInt(); |
569 //!!! rename increment to step size throughout | 571 //!!! rename increment to step size throughout |
570 std::cerr << "Increment changed to " << m_stepSize << std::endl; | 572 cerr << "Increment changed to " << m_stepSize << endl; |
571 } | 573 } |
572 | 574 |
573 void | 575 void |
574 PluginParameterDialog::windowTypeChanged(WindowType type) | 576 PluginParameterDialog::windowTypeChanged(WindowType type) |
575 { | 577 { |
603 m_advanced->hide(); | 605 m_advanced->hide(); |
604 m_advancedButton->setText(tr("Advanced >>")); | 606 m_advancedButton->setText(tr("Advanced >>")); |
605 m_advancedButton->setChecked(false); | 607 m_advancedButton->setChecked(false); |
606 } | 608 } |
607 | 609 |
608 // std::cerr << "resize to " << sizeHint().width() << " x " << sizeHint().height() << std::endl; | 610 // cerr << "resize to " << sizeHint().width() << " x " << sizeHint().height() << endl; |
609 | 611 |
610 // setMinimumHeight(sizeHint().height()); | 612 // setMinimumHeight(sizeHint().height()); |
611 adjustSize(); | 613 adjustSize(); |
612 | 614 |
613 // (sizeHint()); | 615 // (sizeHint()); |