annotate widgets/PluginParameterDialog.cpp @ 62:50429a56680f

* Add plugin parameter dialog, and use it to set up parameters for feature extraction plugins via a semi-opaque (translucent?) configurationXml string which is associated with a given transform instance. This is not yet saved to and restored from the SV file properly. * Remove no-longer-relevant BeatDetect and BeatDetectionFunction transforms (replaced a long time ago with the beat detector plugin).
author Chris Cannam
date Wed, 22 Mar 2006 17:38:29 +0000
parents
children fb02fe13ff47
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@62 7 This file copyright 2006 Chris Cannam.
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@62 19
Chris@62 20 #include <QGridLayout>
Chris@62 21 #include <QLabel>
Chris@62 22 #include <QGroupBox>
Chris@62 23 #include <QHBoxLayout>
Chris@62 24 #include <QPushButton>
Chris@62 25
Chris@62 26 PluginParameterDialog::PluginParameterDialog(PluginInstance *plugin,
Chris@62 27 QWidget *parent) :
Chris@62 28 QDialog(parent),
Chris@62 29 m_plugin(plugin),
Chris@62 30 m_parameterBox(0)
Chris@62 31 {
Chris@62 32 QGridLayout *grid = new QGridLayout;
Chris@62 33 setLayout(grid);
Chris@62 34
Chris@62 35 QGroupBox *pluginBox = new QGroupBox;
Chris@62 36 pluginBox->setTitle(tr("Plugin"));
Chris@62 37 grid->addWidget(pluginBox, 0, 0);
Chris@62 38
Chris@62 39 QGridLayout *subgrid = new QGridLayout;
Chris@62 40 pluginBox->setLayout(subgrid);
Chris@62 41
Chris@62 42 QFont font(pluginBox->font());
Chris@62 43 font.setBold(true);
Chris@62 44
Chris@62 45 QLabel *nameLabel = new QLabel(plugin->getDescription().c_str());
Chris@62 46 nameLabel->setFont(font);
Chris@62 47
Chris@62 48 QLabel *makerLabel = new QLabel(plugin->getMaker().c_str());
Chris@62 49 makerLabel->setFont(font);
Chris@62 50
Chris@62 51 QLabel *versionLabel = new QLabel(QString("%1")
Chris@62 52 .arg(plugin->getPluginVersion()));
Chris@62 53 versionLabel->setFont(font);
Chris@62 54
Chris@62 55 QLabel *copyrightLabel = new QLabel(plugin->getCopyright().c_str());
Chris@62 56 copyrightLabel->setFont(font);
Chris@62 57
Chris@62 58 subgrid->addWidget(new QLabel(tr("Name:")), 0, 0);
Chris@62 59 subgrid->addWidget(nameLabel, 0, 1);
Chris@62 60
Chris@62 61 subgrid->addWidget(new QLabel(tr("Maker:")), 1, 0);
Chris@62 62 subgrid->addWidget(makerLabel, 1, 1);
Chris@62 63
Chris@62 64 subgrid->addWidget(new QLabel(tr("Copyright:")), 2, 0);
Chris@62 65 subgrid->addWidget(copyrightLabel, 2, 1);
Chris@62 66
Chris@62 67 subgrid->addWidget(new QLabel(tr("Version:")), 3, 0);
Chris@62 68 subgrid->addWidget(versionLabel, 3, 1);
Chris@62 69
Chris@62 70 subgrid->setColumnStretch(1, 2);
Chris@62 71
Chris@62 72 QGroupBox *paramBox = new QGroupBox;
Chris@62 73 paramBox->setTitle(tr("Plugin Parameters"));
Chris@62 74 grid->addWidget(paramBox, 1, 0);
Chris@62 75 grid->setRowStretch(1, 10);
Chris@62 76
Chris@62 77 QHBoxLayout *paramLayout = new QHBoxLayout;
Chris@62 78 paramBox->setLayout(paramLayout);
Chris@62 79
Chris@62 80 m_parameterBox = new PluginParameterBox(m_plugin);
Chris@62 81 paramLayout->addWidget(m_parameterBox);
Chris@62 82
Chris@62 83 QHBoxLayout *hbox = new QHBoxLayout;
Chris@62 84 grid->addLayout(hbox, 2, 0);
Chris@62 85
Chris@62 86 QPushButton *ok = new QPushButton(tr("OK"));
Chris@62 87 QPushButton *cancel = new QPushButton(tr("Cancel"));
Chris@62 88 hbox->addStretch(10);
Chris@62 89 hbox->addWidget(ok);
Chris@62 90 hbox->addWidget(cancel);
Chris@62 91 connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
Chris@62 92 connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
Chris@62 93 }
Chris@62 94
Chris@62 95 PluginParameterDialog::~PluginParameterDialog()
Chris@62 96 {
Chris@62 97 }
Chris@62 98