annotate widgets/PluginParameterDialog.cpp @ 249:e6d0b097d102 sv1-1.0rc1

* more compile warning fixes
author Chris Cannam
date Mon, 30 Apr 2007 14:06:45 +0000
parents df791d8c8f58
children 948a3b05798b
rev   line source
Chris@62 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@62 2
Chris@62 3 /*
Chris@62 4 Sonic Visualiser
Chris@62 5 An audio file viewer and annotation editor.
Chris@62 6 Centre for Digital Music, Queen Mary, University of London.
Chris@182 7 This file copyright 2006 Chris Cannam and QMUL.
Chris@62 8
Chris@62 9 This program is free software; you can redistribute it and/or
Chris@62 10 modify it under the terms of the GNU General Public License as
Chris@62 11 published by the Free Software Foundation; either version 2 of the
Chris@62 12 License, or (at your option) any later version. See the file
Chris@62 13 COPYING included with this distribution for more information.
Chris@62 14 */
Chris@62 15
Chris@62 16 #include "PluginParameterDialog.h"
Chris@62 17
Chris@62 18 #include "PluginParameterBox.h"
Chris@140 19 #include "WindowTypeSelector.h"
Chris@62 20
Chris@106 21 #include "vamp-sdk/Plugin.h"
Chris@147 22 #include "vamp-sdk/PluginHostAdapter.h"
Chris@106 23
Chris@62 24 #include <QGridLayout>
Chris@62 25 #include <QLabel>
Chris@62 26 #include <QGroupBox>
Chris@62 27 #include <QHBoxLayout>
Chris@143 28 #include <QVBoxLayout>
Chris@149 29 #include <QScrollArea>
Chris@62 30 #include <QPushButton>
Chris@69 31 #include <QMessageBox>
Chris@69 32 #include <QComboBox>
Chris@143 33 #include <QSettings>
Chris@62 34
Chris@71 35 PluginParameterDialog::PluginParameterDialog(Vamp::PluginBase *plugin,
Chris@62 36 QWidget *parent) :
Chris@62 37 QDialog(parent),
Chris@62 38 m_plugin(plugin),
Chris@163 39 m_channel(-1),
Chris@145 40 m_stepSize(0),
Chris@145 41 m_blockSize(0),
Chris@145 42 m_windowType(HanningWindow),
Chris@62 43 m_parameterBox(0)
Chris@62 44 {
Chris@122 45 setWindowTitle(tr("Plugin Parameters"));
Chris@122 46
Chris@62 47 QGridLayout *grid = new QGridLayout;
Chris@62 48 setLayout(grid);
Chris@62 49
Chris@62 50 QGroupBox *pluginBox = new QGroupBox;
Chris@208 51 pluginBox->setTitle(plugin->getType().c_str());
Chris@62 52 grid->addWidget(pluginBox, 0, 0);
Chris@62 53
Chris@62 54 QGridLayout *subgrid = new QGridLayout;
Chris@62 55 pluginBox->setLayout(subgrid);
Chris@62 56
Chris@63 57 subgrid->setSpacing(0);
Chris@63 58 subgrid->setMargin(10);
Chris@63 59
Chris@208 60 QFont boldFont(pluginBox->font());
Chris@208 61 boldFont.setBold(true);
Chris@208 62
Chris@208 63 QFont italicFont(pluginBox->font());
Chris@208 64 italicFont.setItalic(true);
Chris@62 65
Chris@207 66 QLabel *nameLabel = new QLabel(plugin->getName().c_str());
Chris@146 67 nameLabel->setWordWrap(true);
Chris@208 68 nameLabel->setFont(boldFont);
Chris@62 69
Chris@62 70 QLabel *makerLabel = new QLabel(plugin->getMaker().c_str());
Chris@146 71 makerLabel->setWordWrap(true);
Chris@62 72
Chris@62 73 QLabel *versionLabel = new QLabel(QString("%1")
Chris@62 74 .arg(plugin->getPluginVersion()));
Chris@146 75 versionLabel->setWordWrap(true);
Chris@62 76
Chris@62 77 QLabel *copyrightLabel = new QLabel(plugin->getCopyright().c_str());
Chris@146 78 copyrightLabel->setWordWrap(true);
Chris@62 79
Chris@208 80 // QLabel *typeLabel = new QLabel(plugin->getType().c_str());
Chris@208 81 // typeLabel->setWordWrap(true);
Chris@208 82 // typeLabel->setFont(boldFont);
Chris@208 83
Chris@208 84 QLabel *descriptionLabel = 0;
Chris@208 85 if (plugin->getDescription() != "") {
Chris@208 86 descriptionLabel = new QLabel(plugin->getDescription().c_str());
Chris@208 87 descriptionLabel->setWordWrap(true);
Chris@208 88 descriptionLabel->setFont(italicFont);
Chris@208 89 }
Chris@63 90
Chris@163 91 int row = 0;
Chris@163 92
Chris@147 93 QLabel *label = new QLabel(tr("Name:"));
Chris@147 94 label->setAlignment(Qt::AlignTop | Qt::AlignLeft);
Chris@163 95 subgrid->addWidget(label, row, 0);
Chris@163 96 subgrid->addWidget(nameLabel, row, 1);
Chris@163 97 row++;
Chris@62 98
Chris@208 99 if (descriptionLabel) {
Chris@208 100 // label = new QLabel(tr("Description:"));
Chris@208 101 // label->setAlignment(Qt::AlignTop | Qt::AlignLeft);
Chris@208 102 // subgrid->addWidget(label, row, 0);
Chris@208 103 subgrid->addWidget(descriptionLabel, row, 1);
Chris@208 104 row++;
Chris@208 105 }
Chris@208 106
Chris@208 107 Vamp::PluginHostAdapter *fePlugin =
Chris@208 108 dynamic_cast<Vamp::PluginHostAdapter *>(m_plugin);
Chris@208 109
Chris@208 110 if (fePlugin) {
Chris@208 111 label = new QLabel(tr("Version:"));
Chris@208 112 label->setAlignment(Qt::AlignTop | Qt::AlignLeft);
Chris@208 113 subgrid->addWidget(label, row, 0);
Chris@208 114 subgrid->addWidget(versionLabel, row, 1);
Chris@208 115 row++;
Chris@208 116 }
Chris@208 117
Chris@208 118 // label = new QLabel(tr("Type:"));
Chris@208 119 // label->setAlignment(Qt::AlignTop | Qt::AlignLeft);
Chris@208 120 // subgrid->addWidget(label, row, 0);
Chris@208 121 // subgrid->addWidget(typeLabel, row, 1);
Chris@208 122 // row++;
Chris@62 123
Chris@147 124 label = new QLabel(tr("Maker:"));
Chris@147 125 label->setAlignment(Qt::AlignTop | Qt::AlignLeft);
Chris@163 126 subgrid->addWidget(label, row, 0);
Chris@163 127 subgrid->addWidget(makerLabel, row, 1);
Chris@163 128 row++;
Chris@63 129
Chris@147 130 label = new QLabel(tr("Copyright: "));
Chris@147 131 label->setAlignment(Qt::AlignTop | Qt::AlignLeft);
Chris@163 132 subgrid->addWidget(label, row, 0);
Chris@163 133 subgrid->addWidget(copyrightLabel, row, 1);
Chris@163 134 row++;
Chris@208 135
Chris@208 136 m_outputSpacer = new QLabel;
Chris@208 137 subgrid->addWidget(m_outputSpacer, row, 0);
Chris@208 138 m_outputSpacer->setFixedHeight(7);
Chris@208 139 m_outputSpacer->hide();
Chris@208 140 row++;
Chris@106 141
Chris@208 142 m_outputLabel = new QLabel(tr("Output:"));
Chris@208 143 m_outputLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft);
Chris@208 144 subgrid->addWidget(m_outputLabel, row, 0);
Chris@208 145 m_outputValue = new QLabel;
Chris@208 146 m_outputValue->setFont(boldFont);
Chris@208 147 subgrid->addWidget(m_outputValue, row, 1);
Chris@208 148 m_outputLabel->hide();
Chris@208 149 m_outputValue->hide();
Chris@208 150 row++;
Chris@208 151
Chris@208 152 m_outputDescription = new QLabel;
Chris@208 153 m_outputDescription->setFont(italicFont);
Chris@208 154 subgrid->addWidget(m_outputDescription, row, 1);
Chris@208 155 m_outputDescription->hide();
Chris@163 156 row++;
Chris@62 157
Chris@62 158 subgrid->setColumnStretch(1, 2);
Chris@62 159
Chris@164 160 m_inputModelBox = new QGroupBox;
Chris@164 161 m_inputModelBox->setTitle(tr("Input Source"));
Chris@164 162 grid->addWidget(m_inputModelBox, 1, 0);
Chris@164 163
Chris@164 164 m_inputModels = new QComboBox;
Chris@164 165 QHBoxLayout *inputLayout = new QHBoxLayout;
Chris@164 166 m_inputModelBox->setLayout(inputLayout);
Chris@164 167 inputLayout->addWidget(m_inputModels);
Chris@164 168 m_inputModelBox->hide();
Chris@164 169
Chris@62 170 QGroupBox *paramBox = new QGroupBox;
Chris@62 171 paramBox->setTitle(tr("Plugin Parameters"));
Chris@164 172 grid->addWidget(paramBox, 2, 0);
Chris@164 173 grid->setRowStretch(2, 10);
Chris@62 174
Chris@62 175 QHBoxLayout *paramLayout = new QHBoxLayout;
Chris@63 176 paramLayout->setMargin(0);
Chris@62 177 paramBox->setLayout(paramLayout);
Chris@62 178
Chris@149 179 QScrollArea *scroll = new QScrollArea;
Chris@149 180 scroll->setWidgetResizable(true);
Chris@149 181 scroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
Chris@149 182 scroll->setFrameShape(QFrame::NoFrame);
Chris@149 183 paramLayout->addWidget(scroll);
Chris@149 184
Chris@62 185 m_parameterBox = new PluginParameterBox(m_plugin);
Chris@64 186 connect(m_parameterBox, SIGNAL(pluginConfigurationChanged(QString)),
Chris@64 187 this, SIGNAL(pluginConfigurationChanged(QString)));
Chris@149 188 scroll->setWidget(m_parameterBox);
Chris@62 189
Chris@143 190 m_advanced = new QFrame;
Chris@143 191 QVBoxLayout *advancedLayout = new QVBoxLayout;
Chris@143 192 advancedLayout->setMargin(0);
Chris@143 193 m_advanced->setLayout(advancedLayout);
Chris@164 194 grid->addWidget(m_advanced, 3, 0);
Chris@143 195
Chris@163 196 m_channelBox = new QGroupBox;
Chris@163 197 m_channelBox->setTitle(tr("Channels"));
Chris@163 198 advancedLayout->addWidget(m_channelBox);
Chris@163 199 m_channelBox->setVisible(false);
Chris@163 200 m_haveChannelBoxData = false;
Chris@163 201
Chris@163 202 m_windowBox = new QGroupBox;
Chris@163 203 m_windowBox->setTitle(tr("Processing"));
Chris@163 204 advancedLayout->addWidget(m_windowBox);
Chris@163 205 m_windowBox->setVisible(false);
Chris@163 206 m_haveWindowBoxData = false;
Chris@163 207
Chris@163 208 QHBoxLayout *hbox = new QHBoxLayout;
Chris@163 209 grid->addLayout(hbox, 4, 0);
Chris@163 210
Chris@163 211 m_advancedVisible = false;
Chris@163 212
Chris@163 213 m_advancedButton = new QPushButton(tr("Advanced >>"));
Chris@163 214 m_advancedButton->setCheckable(true);
Chris@163 215 connect(m_advancedButton, SIGNAL(clicked()), this, SLOT(advancedToggled()));
Chris@163 216
Chris@163 217 QSettings settings;
Chris@163 218 settings.beginGroup("PluginParameterDialog");
Chris@163 219 m_advancedVisible = settings.value("advancedvisible", false).toBool();
Chris@163 220 settings.endGroup();
Chris@163 221
Chris@163 222 m_advanced->setVisible(false);
Chris@163 223
Chris@163 224 hbox->addWidget(m_advancedButton);
Chris@163 225 m_advancedButton->hide();
Chris@163 226
Chris@163 227 QPushButton *ok = new QPushButton(tr("OK"));
Chris@163 228 QPushButton *cancel = new QPushButton(tr("Cancel"));
Chris@163 229 hbox->addStretch(10);
Chris@163 230 hbox->addWidget(ok);
Chris@163 231 hbox->addWidget(cancel);
Chris@163 232 connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
Chris@163 233 connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
Chris@163 234
Chris@163 235 setAdvancedVisible(m_advancedVisible);
Chris@163 236 }
Chris@163 237
Chris@163 238 PluginParameterDialog::~PluginParameterDialog()
Chris@163 239 {
Chris@163 240 }
Chris@163 241
Chris@163 242
Chris@163 243 void
Chris@208 244 PluginParameterDialog::setOutputLabel(QString text,
Chris@208 245 QString description)
Chris@163 246 {
Chris@163 247 if (text == "") {
Chris@208 248 m_outputSpacer->hide();
Chris@163 249 m_outputLabel->hide();
Chris@163 250 m_outputValue->hide();
Chris@208 251 m_outputDescription->hide();
Chris@163 252 } else {
Chris@208 253 m_outputSpacer->show();
Chris@163 254 m_outputValue->setText(text);
Chris@163 255 m_outputValue->setWordWrap(true);
Chris@208 256 m_outputDescription->setText(description);
Chris@163 257 m_outputLabel->show();
Chris@163 258 m_outputValue->show();
Chris@208 259 if (description != "") {
Chris@208 260 m_outputDescription->show();
Chris@208 261 } else {
Chris@208 262 m_outputDescription->hide();
Chris@208 263 }
Chris@163 264 }
Chris@163 265 }
Chris@163 266
Chris@163 267 void
Chris@163 268 PluginParameterDialog::setChannelArrangement(int sourceChannels,
Chris@163 269 int targetChannels,
Chris@163 270 int defaultChannel)
Chris@163 271 {
Chris@163 272 m_channel = defaultChannel;
Chris@163 273
Chris@69 274 if (sourceChannels != targetChannels) {
Chris@69 275
Chris@69 276 // At the moment we can only cope with the case where
Chris@69 277 // sourceChannels > targetChannels and targetChannels == 1
Chris@69 278
Chris@69 279 if (sourceChannels < targetChannels) {
Chris@69 280
Chris@69 281 QMessageBox::warning
Chris@163 282 (parentWidget(),
Chris@69 283 tr("Channel mismatch"),
Chris@69 284 tr("This plugin requires at least %1 input channels, but only %2 %3 available. The plugin probably will not work correctly.").arg(targetChannels).arg(sourceChannels).arg(sourceChannels != 1 ? tr("are") : tr("is")),
Chris@69 285 QMessageBox::Ok,
Chris@69 286 QMessageBox::NoButton);
Chris@69 287
Chris@69 288 } else {
Chris@69 289
Chris@163 290 if (m_haveChannelBoxData) {
Chris@163 291 std::cerr << "WARNING: PluginParameterDialog::setChannelArrangement: Calling more than once on same dialog is not currently implemented" << std::endl;
Chris@163 292 return;
Chris@163 293 }
Chris@69 294
Chris@69 295 QVBoxLayout *channelLayout = new QVBoxLayout;
Chris@163 296 m_channelBox->setLayout(channelLayout);
Chris@69 297
Chris@69 298 if (targetChannels != 1) {
Chris@69 299
Chris@69 300 channelLayout->addWidget
Chris@69 301 (new QLabel(tr("This plugin accepts no more than %1 input channels,\nbut %2 are available. Only the first %3 will be used.\n")
Chris@69 302 .arg(targetChannels)
Chris@69 303 .arg(sourceChannels)
Chris@69 304 .arg(targetChannels)));
Chris@69 305
Chris@69 306 } else {
Chris@69 307
Chris@69 308 channelLayout->addWidget(new QLabel(tr("This plugin only has a single channel input,\nbut the source has %1 channels.").arg(sourceChannels)));
Chris@69 309
Chris@69 310 QComboBox *channelCombo = new QComboBox;
Chris@76 311 channelCombo->addItem(tr("Use mean of source channels"));
Chris@69 312 for (int i = 0; i < sourceChannels; ++i) {
Chris@69 313 channelCombo->addItem(tr("Use channel %1 only").arg(i + 1));
Chris@69 314 }
Chris@69 315
Chris@69 316 connect(channelCombo, SIGNAL(activated(int)),
Chris@69 317 this, SLOT(channelComboChanged(int)));
Chris@69 318
Chris@69 319 channelLayout->addWidget(channelCombo);
Chris@69 320 }
Chris@163 321
Chris@163 322 m_channelBox->setVisible(true);
Chris@163 323 m_haveChannelBoxData = true;
Chris@163 324 m_advancedButton->show();
Chris@69 325 }
Chris@69 326 }
Chris@69 327
Chris@163 328 setAdvancedVisible(m_advancedVisible);
Chris@163 329 }
Chris@163 330
Chris@163 331 void
Chris@163 332 PluginParameterDialog::setShowProcessingOptions(bool showWindowSize,
Chris@163 333 bool showFrequencyDomainOptions)
Chris@163 334 {
Chris@163 335 if (m_haveWindowBoxData) {
Chris@163 336 std::cerr << "WARNING: PluginParameterDialog::setShowProcessingOptions: Calling more than once on same dialog is not currently implemented" << std::endl;
Chris@163 337 return;
Chris@163 338 }
Chris@163 339
Chris@140 340 if (showWindowSize) {
Chris@140 341
Chris@147 342 Vamp::PluginHostAdapter *fePlugin = dynamic_cast<Vamp::PluginHostAdapter *>(m_plugin);
Chris@140 343 int size = 1024;
Chris@140 344 int increment = 1024;
Chris@140 345 if (fePlugin) {
Chris@140 346 size = fePlugin->getPreferredBlockSize();
Chris@207 347 std::cerr << "Feature extraction plugin \"" << fePlugin->getName() << "\" reports preferred block size as " << size << std::endl;
Chris@140 348 if (size == 0) size = 1024;
Chris@140 349 increment = fePlugin->getPreferredStepSize();
Chris@146 350 if (increment == 0) {
Chris@146 351 if (fePlugin->getInputDomain() == Vamp::Plugin::TimeDomain) {
Chris@146 352 increment = size;
Chris@146 353 } else {
Chris@146 354 increment = size/2;
Chris@146 355 }
Chris@146 356 }
Chris@140 357 }
Chris@140 358
Chris@140 359 QGridLayout *windowLayout = new QGridLayout;
Chris@163 360 m_windowBox->setLayout(windowLayout);
Chris@140 361
Chris@140 362 if (showFrequencyDomainOptions) {
Chris@140 363 windowLayout->addWidget(new QLabel(tr("Window size:")), 0, 0);
Chris@140 364 } else {
Chris@140 365 windowLayout->addWidget(new QLabel(tr("Audio frames per block:")), 0, 0);
Chris@140 366 }
Chris@140 367
Chris@143 368 std::cerr << "size: " << size << ", increment: " << increment << std::endl;
Chris@143 369
Chris@140 370 QComboBox *blockSizeCombo = new QComboBox;
Chris@140 371 blockSizeCombo->setEditable(true);
Chris@147 372 bool found = false;
Chris@143 373 for (int i = 0; i < 14; ++i) {
Chris@249 374 int val = 1 << (i + 3);
Chris@140 375 blockSizeCombo->addItem(QString("%1").arg(val));
Chris@147 376 if (val == size) {
Chris@147 377 blockSizeCombo->setCurrentIndex(i);
Chris@147 378 found = true;
Chris@147 379 }
Chris@147 380 }
Chris@147 381 if (!found) {
Chris@147 382 blockSizeCombo->addItem(QString("%1").arg(size));
Chris@147 383 blockSizeCombo->setCurrentIndex(blockSizeCombo->count() - 1);
Chris@140 384 }
Chris@143 385 blockSizeCombo->setValidator(new QIntValidator(1, pow(2, 18), this));
Chris@155 386 connect(blockSizeCombo, SIGNAL(editTextChanged(const QString &)),
Chris@155 387 this, SLOT(blockSizeComboChanged(const QString &)));
Chris@140 388 windowLayout->addWidget(blockSizeCombo, 0, 1);
Chris@140 389
Chris@148 390 windowLayout->addWidget(new QLabel(tr("Window increment:")), 1, 0);
Chris@148 391
Chris@148 392 QComboBox *incrementCombo = new QComboBox;
Chris@148 393 incrementCombo->setEditable(true);
Chris@148 394 found = false;
Chris@148 395 for (int i = 0; i < 14; ++i) {
Chris@249 396 int val = 1 << (i + 3);
Chris@148 397 incrementCombo->addItem(QString("%1").arg(val));
Chris@148 398 if (val == increment) {
Chris@148 399 incrementCombo->setCurrentIndex(i);
Chris@148 400 found = true;
Chris@148 401 }
Chris@148 402 }
Chris@148 403 if (!found) {
Chris@148 404 incrementCombo->addItem(QString("%1").arg(increment));
Chris@148 405 incrementCombo->setCurrentIndex(incrementCombo->count() - 1);
Chris@148 406 }
Chris@148 407 incrementCombo->setValidator(new QIntValidator(1, pow(2, 18), this));
Chris@155 408 connect(incrementCombo, SIGNAL(editTextChanged(const QString &)),
Chris@155 409 this, SLOT(incrementComboChanged(const QString &)));
Chris@148 410 windowLayout->addWidget(incrementCombo, 1, 1);
Chris@148 411
Chris@140 412 if (showFrequencyDomainOptions) {
Chris@140 413
Chris@140 414 windowLayout->addWidget(new QLabel(tr("Window shape:")), 2, 0);
Chris@140 415 WindowTypeSelector *windowTypeSelector = new WindowTypeSelector;
Chris@171 416 connect(windowTypeSelector, SIGNAL(windowTypeChanged(WindowType)),
Chris@171 417 this, SLOT(windowTypeChanged(WindowType)));
Chris@140 418 windowLayout->addWidget(windowTypeSelector, 2, 1);
Chris@140 419 }
Chris@163 420
Chris@163 421 m_windowBox->setVisible(true);
Chris@163 422 m_haveWindowBoxData = true;
Chris@163 423 m_advancedButton->show();
Chris@140 424 }
Chris@140 425
Chris@163 426 setAdvancedVisible(m_advancedVisible);
Chris@62 427 }
Chris@62 428
Chris@69 429 void
Chris@164 430 PluginParameterDialog::setCandidateInputModels(const QStringList &models)
Chris@164 431 {
Chris@164 432 m_inputModels->clear();
Chris@164 433 m_inputModels->insertItems(0, models);
Chris@164 434 connect(m_inputModels, SIGNAL(activated(const QString &)),
Chris@164 435 this, SIGNAL(inputModelChanged(QString)));
Chris@164 436 m_inputModelBox->show();
Chris@164 437 }
Chris@164 438
Chris@164 439 QString
Chris@164 440 PluginParameterDialog::getInputModel() const
Chris@164 441 {
Chris@164 442 return m_inputModels->currentText();
Chris@164 443 }
Chris@164 444
Chris@164 445 void
Chris@145 446 PluginParameterDialog::getProcessingParameters(size_t &blockSize) const
Chris@145 447 {
Chris@145 448 blockSize = m_blockSize;
Chris@145 449 return;
Chris@145 450 }
Chris@145 451
Chris@145 452 void
Chris@145 453 PluginParameterDialog::getProcessingParameters(size_t &stepSize,
Chris@145 454 size_t &blockSize,
Chris@145 455 WindowType &windowType) const
Chris@145 456 {
Chris@145 457 stepSize = m_stepSize;
Chris@145 458 blockSize = m_blockSize;
Chris@145 459 windowType = m_windowType;
Chris@146 460 return;
Chris@145 461 }
Chris@145 462
Chris@145 463 void
Chris@155 464 PluginParameterDialog::blockSizeComboChanged(const QString &text)
Chris@145 465 {
Chris@145 466 m_blockSize = text.toInt();
Chris@146 467 std::cerr << "Block size changed to " << m_blockSize << std::endl;
Chris@145 468 }
Chris@145 469
Chris@145 470 void
Chris@155 471 PluginParameterDialog::incrementComboChanged(const QString &text)
Chris@145 472 {
Chris@145 473 m_stepSize = text.toInt();
Chris@146 474 //!!! rename increment to step size throughout
Chris@147 475 std::cerr << "Increment changed to " << m_stepSize << std::endl;
Chris@145 476 }
Chris@145 477
Chris@145 478 void
Chris@145 479 PluginParameterDialog::windowTypeChanged(WindowType type)
Chris@145 480 {
Chris@145 481 m_windowType = type;
Chris@145 482 }
Chris@145 483
Chris@145 484 void
Chris@143 485 PluginParameterDialog::advancedToggled()
Chris@143 486 {
Chris@163 487 setAdvancedVisible(!m_advancedVisible);
Chris@163 488 }
Chris@143 489
Chris@163 490 void
Chris@163 491 PluginParameterDialog::setAdvancedVisible(bool visible)
Chris@163 492 {
Chris@143 493 m_advanced->setVisible(visible);
Chris@143 494
Chris@163 495 if (visible) {
Chris@163 496 m_advancedButton->setText(tr("Advanced <<"));
Chris@163 497 m_advancedButton->setChecked(true);
Chris@163 498 } else {
Chris@163 499 m_advancedButton->setText(tr("Advanced >>"));
Chris@163 500 m_advancedButton->setChecked(false);
Chris@163 501 }
Chris@143 502
Chris@143 503 QSettings settings;
Chris@143 504 settings.beginGroup("PluginParameterDialog");
Chris@143 505 settings.setValue("advancedvisible", visible);
Chris@143 506 settings.endGroup();
Chris@143 507
Chris@213 508 // std::cerr << "resize to " << sizeHint().width() << " x " << sizeHint().height() << std::endl;
Chris@143 509
Chris@149 510 setMinimumHeight(sizeHint().height());
Chris@163 511 adjustSize();
Chris@163 512
Chris@163 513 m_advancedVisible = visible;
Chris@163 514
Chris@163 515 // if (visible) setMaximumHeight(sizeHint().height());
Chris@163 516 // adjustSize();
Chris@143 517 }
Chris@143 518
Chris@143 519 void
Chris@69 520 PluginParameterDialog::channelComboChanged(int index)
Chris@69 521 {
Chris@69 522 m_channel = index - 1;
Chris@69 523 }
Chris@69 524