comparison widgets/PluginParameterDialog.cpp @ 208:8495187c13ce

* Further fixes for Vamp API change, and update to support API versioning * Add plugin, output and parameter descriptions to GUI * Avoid squished panner in heads-up-display on pane when time-value or note layer is on top
author Chris Cannam
date Tue, 27 Feb 2007 12:51:38 +0000
parents a5b3c9f580c1
children df791d8c8f58
comparison
equal deleted inserted replaced
207:a5b3c9f580c1 208:8495187c13ce
46 46
47 QGridLayout *grid = new QGridLayout; 47 QGridLayout *grid = new QGridLayout;
48 setLayout(grid); 48 setLayout(grid);
49 49
50 QGroupBox *pluginBox = new QGroupBox; 50 QGroupBox *pluginBox = new QGroupBox;
51 pluginBox->setTitle(tr("Plugin")); 51 pluginBox->setTitle(plugin->getType().c_str());
52 grid->addWidget(pluginBox, 0, 0); 52 grid->addWidget(pluginBox, 0, 0);
53 53
54 QGridLayout *subgrid = new QGridLayout; 54 QGridLayout *subgrid = new QGridLayout;
55 pluginBox->setLayout(subgrid); 55 pluginBox->setLayout(subgrid);
56 56
57 subgrid->setSpacing(0); 57 subgrid->setSpacing(0);
58 subgrid->setMargin(10); 58 subgrid->setMargin(10);
59 59
60 QFont font(pluginBox->font()); 60 QFont boldFont(pluginBox->font());
61 font.setBold(true); 61 boldFont.setBold(true);
62
63 QFont italicFont(pluginBox->font());
64 italicFont.setItalic(true);
62 65
63 QLabel *nameLabel = new QLabel(plugin->getName().c_str()); 66 QLabel *nameLabel = new QLabel(plugin->getName().c_str());
64 nameLabel->setWordWrap(true); 67 nameLabel->setWordWrap(true);
65 nameLabel->setFont(font); 68 nameLabel->setFont(boldFont);
66 69
67 QLabel *makerLabel = new QLabel(plugin->getMaker().c_str()); 70 QLabel *makerLabel = new QLabel(plugin->getMaker().c_str());
68 makerLabel->setWordWrap(true); 71 makerLabel->setWordWrap(true);
69 72
70 QLabel *versionLabel = new QLabel(QString("%1") 73 QLabel *versionLabel = new QLabel(QString("%1")
72 versionLabel->setWordWrap(true); 75 versionLabel->setWordWrap(true);
73 76
74 QLabel *copyrightLabel = new QLabel(plugin->getCopyright().c_str()); 77 QLabel *copyrightLabel = new QLabel(plugin->getCopyright().c_str());
75 copyrightLabel->setWordWrap(true); 78 copyrightLabel->setWordWrap(true);
76 79
77 QLabel *typeLabel = new QLabel(plugin->getType().c_str()); 80 // QLabel *typeLabel = new QLabel(plugin->getType().c_str());
78 typeLabel->setWordWrap(true); 81 // typeLabel->setWordWrap(true);
79 typeLabel->setFont(font); 82 // typeLabel->setFont(boldFont);
83
84 QLabel *descriptionLabel = 0;
85 if (plugin->getDescription() != "") {
86 descriptionLabel = new QLabel(plugin->getDescription().c_str());
87 descriptionLabel->setWordWrap(true);
88 descriptionLabel->setFont(italicFont);
89 }
80 90
81 int row = 0; 91 int row = 0;
82 92
83 QLabel *label = new QLabel(tr("Name:")); 93 QLabel *label = new QLabel(tr("Name:"));
84 label->setAlignment(Qt::AlignTop | Qt::AlignLeft); 94 label->setAlignment(Qt::AlignTop | Qt::AlignLeft);
85 subgrid->addWidget(label, row, 0); 95 subgrid->addWidget(label, row, 0);
86 subgrid->addWidget(nameLabel, row, 1); 96 subgrid->addWidget(nameLabel, row, 1);
87 row++; 97 row++;
88 98
89 label = new QLabel(tr("Type:")); 99 if (descriptionLabel) {
90 label->setAlignment(Qt::AlignTop | Qt::AlignLeft); 100 // label = new QLabel(tr("Description:"));
91 subgrid->addWidget(label, row, 0); 101 // label->setAlignment(Qt::AlignTop | Qt::AlignLeft);
92 subgrid->addWidget(typeLabel, row, 1); 102 // subgrid->addWidget(label, row, 0);
93 row++; 103 subgrid->addWidget(descriptionLabel, row, 1);
94 104 row++;
95 m_outputLabel = new QLabel(tr("Output:")); 105 }
96 m_outputLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft); 106
97 subgrid->addWidget(m_outputLabel, row, 0); 107 Vamp::PluginHostAdapter *fePlugin =
98 m_outputValue = new QLabel; 108 dynamic_cast<Vamp::PluginHostAdapter *>(m_plugin);
99 subgrid->addWidget(m_outputValue, row, 1); 109
100 m_outputLabel->hide(); 110 if (fePlugin) {
101 m_outputValue->hide(); 111 label = new QLabel(tr("Version:"));
102 row++; 112 label->setAlignment(Qt::AlignTop | Qt::AlignLeft);
113 subgrid->addWidget(label, row, 0);
114 subgrid->addWidget(versionLabel, row, 1);
115 row++;
116 }
117
118 // label = new QLabel(tr("Type:"));
119 // label->setAlignment(Qt::AlignTop | Qt::AlignLeft);
120 // subgrid->addWidget(label, row, 0);
121 // subgrid->addWidget(typeLabel, row, 1);
122 // row++;
103 123
104 label = new QLabel(tr("Maker:")); 124 label = new QLabel(tr("Maker:"));
105 label->setAlignment(Qt::AlignTop | Qt::AlignLeft); 125 label->setAlignment(Qt::AlignTop | Qt::AlignLeft);
106 subgrid->addWidget(label, row, 0); 126 subgrid->addWidget(label, row, 0);
107 subgrid->addWidget(makerLabel, row, 1); 127 subgrid->addWidget(makerLabel, row, 1);
110 label = new QLabel(tr("Copyright: ")); 130 label = new QLabel(tr("Copyright: "));
111 label->setAlignment(Qt::AlignTop | Qt::AlignLeft); 131 label->setAlignment(Qt::AlignTop | Qt::AlignLeft);
112 subgrid->addWidget(label, row, 0); 132 subgrid->addWidget(label, row, 0);
113 subgrid->addWidget(copyrightLabel, row, 1); 133 subgrid->addWidget(copyrightLabel, row, 1);
114 row++; 134 row++;
115 135
116 label = new QLabel(tr("Version:")); 136 m_outputSpacer = new QLabel;
117 label->setAlignment(Qt::AlignTop | Qt::AlignLeft); 137 subgrid->addWidget(m_outputSpacer, row, 0);
118 subgrid->addWidget(label, row, 0); 138 m_outputSpacer->setFixedHeight(7);
119 subgrid->addWidget(versionLabel, row, 1); 139 m_outputSpacer->hide();
140 row++;
141
142 m_outputLabel = new QLabel(tr("Output:"));
143 m_outputLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft);
144 subgrid->addWidget(m_outputLabel, row, 0);
145 m_outputValue = new QLabel;
146 m_outputValue->setFont(boldFont);
147 subgrid->addWidget(m_outputValue, row, 1);
148 m_outputLabel->hide();
149 m_outputValue->hide();
150 row++;
151
152 m_outputDescription = new QLabel;
153 m_outputDescription->setFont(italicFont);
154 subgrid->addWidget(m_outputDescription, row, 1);
155 m_outputDescription->hide();
120 row++; 156 row++;
121 157
122 subgrid->setColumnStretch(1, 2); 158 subgrid->setColumnStretch(1, 2);
123 159
124 m_inputModelBox = new QGroupBox; 160 m_inputModelBox = new QGroupBox;
205 { 241 {
206 } 242 }
207 243
208 244
209 void 245 void
210 PluginParameterDialog::setOutputLabel(QString text) 246 PluginParameterDialog::setOutputLabel(QString text,
247 QString description)
211 { 248 {
212 if (text == "") { 249 if (text == "") {
250 m_outputSpacer->hide();
213 m_outputLabel->hide(); 251 m_outputLabel->hide();
214 m_outputValue->hide(); 252 m_outputValue->hide();
253 m_outputDescription->hide();
215 } else { 254 } else {
255 m_outputSpacer->show();
216 m_outputValue->setText(text); 256 m_outputValue->setText(text);
217 m_outputValue->setWordWrap(true); 257 m_outputValue->setWordWrap(true);
258 m_outputDescription->setText(description);
218 m_outputLabel->show(); 259 m_outputLabel->show();
219 m_outputValue->show(); 260 m_outputValue->show();
261 if (description != "") {
262 m_outputDescription->show();
263 } else {
264 m_outputDescription->hide();
265 }
220 } 266 }
221 } 267 }
222 268
223 void 269 void
224 PluginParameterDialog::setChannelArrangement(int sourceChannels, 270 PluginParameterDialog::setChannelArrangement(int sourceChannels,