~ubuntu-branches/ubuntu/wily/muse/wily-proposed

« back to all changes in this revision

Viewing changes to synti/simpledrums/ssplugingui.cpp

  • Committer: Package Import Robot
  • Author(s): Alessio Treglia
  • Date: 2011-12-03 17:12:54 UTC
  • mfrom: (1.1.8)
  • Revision ID: package-import@ubuntu.com-20111203171254-28b1j4lpb46r5jtl
Tags: 2.0~rc1-1
* New upstream RC release.
* Refresh patches, remove those patches not needed anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//
2
 
// C++ Implementation: ssplugingui
3
 
//
4
 
// Description:
5
 
//
6
 
//
7
 
// Author: Mathias Lundgren <lunar_shuttle@users.sf.net>, (C) 2004
8
 
//
9
 
// Copyright: See COPYING file that comes with this distribution
10
 
//
11
 
//
12
 
 
13
 
#include <stdlib.h>
14
 
#include <qlayout.h>
15
 
//Added by qt3to4:
16
 
#include <Q3HBoxLayout>
17
 
#include <Q3Frame>
18
 
#include <QLabel>
19
 
#include <Q3VBoxLayout>
20
 
#include <QtGui>
21
 
#include "ssplugingui.h"
22
 
#include "ssplugin.h"
23
 
#include "simpledrumsgui.h"
24
 
 
25
 
#define SS_PLUGINGUI_XOFF       300
26
 
#define SS_PLUGINGUI_YOFF       300
27
 
#define SS_PLUGINGUI_WIDTH      450
28
 
#define SS_PLUGINGUI_MAX_WIDTH  700
29
 
 
30
 
#define SS_PLUGINFRONT_MINWIDTH SS_PLUGINGUI_WIDTH
31
 
#define SS_PLUGINFRONT_MINHEIGHT 70
32
 
#define SS_PLUGINFRONT_MARGIN    9
33
 
#define SS_PLUGINFRONT_INC_PARAM    30
34
 
#define SS_PLUGINFRONT_INC_PARAM_MIN 60
35
 
#define SS_PLUGINGUI_HEIGHT (SS_NR_OF_SENDEFFECTS * SS_PLUGINFRONT_MINHEIGHT)
36
 
 
37
 
#define SS_PLUGINCHOOSER_NAMECOL     0
38
 
#define SS_PLUGINCHOOSER_LABELCOL    1
39
 
#define SS_PLUGINCHOOSER_INPORTSCOL  2
40
 
#define SS_PLUGINCHOOSER_OUTPORTSCOL 3
41
 
#define SS_PLUGINCHOOSER_CREATORCOL  4
42
 
 
43
 
 
44
 
/*!
45
 
    \fn SS_PluginChooser::SS_PluginChooser(QWidget* parent, const char* name = 0)
46
 
 */
47
 
SS_PluginChooser::SS_PluginChooser(QWidget* parent, const char* name)
48
 
      :SS_PluginChooserBase(parent, name)
49
 
      {
50
 
      SS_TRACE_IN
51
 
      selectedPlugin = 0;
52
 
 
53
 
      for (iPlugin i=plugins.begin(); i !=plugins.end(); i++) {
54
 
            //Support for only 2 or 1 inport/outports
55
 
            if ( ((*i)->outports() == 2 || (*i)->outports() == 1) && ((*i)->inports() == 2 || (*i)->inports() == 1) ) {
56
 
                  Q3ListViewItem* tmpItem = new Q3ListViewItem(effectsListView);
57
 
                  tmpItem->setText(SS_PLUGINCHOOSER_NAMECOL, (*i)->name());
58
 
                  tmpItem->setText(SS_PLUGINCHOOSER_LABELCOL, (*i)->label());
59
 
                  tmpItem->setText(SS_PLUGINCHOOSER_INPORTSCOL, QString::number((*i)->inports()));
60
 
                  tmpItem->setText(SS_PLUGINCHOOSER_OUTPORTSCOL, QString::number((*i)->outports()));
61
 
                  tmpItem->setText(SS_PLUGINCHOOSER_CREATORCOL, (*i)->maker());
62
 
                  effectsListView->insertItem(tmpItem);
63
 
                  }
64
 
            }
65
 
      connect(okButton, SIGNAL(pressed()), SLOT(okPressed()));
66
 
      connect(cancelButton, SIGNAL(pressed()), SLOT(cancelPressed()));
67
 
      connect(effectsListView, SIGNAL(selectionChanged(Q3ListViewItem*)), SLOT(selectionChanged(Q3ListViewItem*)));
68
 
      connect(effectsListView, SIGNAL(doubleClicked(Q3ListViewItem*)), SLOT(doubleClicked(Q3ListViewItem*)));
69
 
      SS_TRACE_OUT
70
 
      }
71
 
 
72
 
/*!
73
 
    \fn SS_PluginChooser::selectionChanged(QListViewItem* item)
74
 
 */
75
 
void SS_PluginChooser::selectionChanged(Q3ListViewItem* item)
76
 
      {
77
 
      SS_TRACE_IN
78
 
      selectedItem  = item;
79
 
      SS_TRACE_OUT
80
 
      }
81
 
 
82
 
/*!
83
 
    \fn SS_PluginChooser::okPressed()
84
 
 */
85
 
void SS_PluginChooser::okPressed()
86
 
      {
87
 
      SS_TRACE_IN
88
 
      selectedPlugin = findSelectedPlugin();
89
 
      done(QDialog::Accepted);
90
 
      SS_TRACE_OUT
91
 
      }
92
 
 
93
 
/*!
94
 
    \fn SS_PluginChooser::cancelPressed()
95
 
 */
96
 
void SS_PluginChooser::cancelPressed()
97
 
      {
98
 
      SS_TRACE_IN
99
 
      SS_TRACE_OUT
100
 
      done(QDialog::Rejected);
101
 
      }
102
 
 
103
 
/*!
104
 
    \fn SS_PluginChooser::doubleClicked(QListViewItem* item)
105
 
 */
106
 
void SS_PluginChooser::doubleClicked(Q3ListViewItem* /*item*/)
107
 
      {
108
 
      SS_TRACE_IN
109
 
      selectedPlugin = findSelectedPlugin();
110
 
      SS_TRACE_OUT
111
 
      done(QDialog::Accepted);
112
 
      }
113
 
 
114
 
/*!
115
 
    \fn SS_PluginChooser::getSelectedPlugin()
116
 
 */
117
 
LadspaPlugin* SS_PluginChooser::findSelectedPlugin()
118
 
      {
119
 
      SS_TRACE_IN
120
 
      LadspaPlugin* selected = 0;
121
 
      for (iPlugin i=plugins.begin(); i != plugins.end(); i++) {
122
 
            if ((*i)->name() == selectedItem->text(SS_PLUGINCHOOSER_NAMECOL))
123
 
                  selected = (LadspaPlugin*) (*i);
124
 
            }
125
 
      SS_TRACE_OUT
126
 
      return selected;
127
 
      }
128
 
 
129
 
/*!
130
 
    \fn SS_PluginFront::SS_PluginFront(QWidget* parent, const char* name = 0)
131
 
 */
132
 
SS_PluginFront::SS_PluginFront(QWidget* parent, int in_fxid, const char* name)
133
 
      : Q3GroupBox(parent, name), fxid (in_fxid)
134
 
      {
135
 
      SS_TRACE_IN
136
 
      expanded = false;
137
 
      pluginChooser = 0;
138
 
      plugin = 0;
139
 
      expGroup = 0;
140
 
 
141
 
      setLineWidth(3);
142
 
      setFlat(false);
143
 
      setFrameStyle( Q3Frame::Box | Q3Frame::Raised );
144
 
      setFrameShape(Q3GroupBox::Box);//  QFrame::Box);
145
 
      setFrameShadow(Sunken);
146
 
      setFocusPolicy(Qt::NoFocus);
147
 
      setMinimumSize(SS_PLUGINFRONT_MINWIDTH, SS_PLUGINFRONT_MINHEIGHT);
148
 
      setMaximumSize(SS_PLUGINGUI_MAX_WIDTH, SS_PLUGINFRONT_MINHEIGHT);
149
 
 
150
 
      Q3VBoxLayout* bigLayout = new Q3VBoxLayout(this);
151
 
      bigLayout->setMargin(SS_PLUGINFRONT_MARGIN);
152
 
      bigLayout->setAlignment(Qt::AlignTop);
153
 
      bigLayout->setResizeMode(QLayout::SetNoConstraint);
154
 
 
155
 
      layout = new Q3HBoxLayout(bigLayout);
156
 
      layout->setAlignment(Qt::AlignVCenter);
157
 
      layout->setResizeMode(QLayout::SetNoConstraint);
158
 
 
159
 
 
160
 
      Q3VBoxLayout* onOffLayout = new Q3VBoxLayout(layout);
161
 
      onOffLayout->setMargin(SS_PLUGINFRONT_MARGIN);
162
 
      onOff = new QCheckBox(this);
163
 
      onOffLayout->add(new QLabel("On/Off", this));
164
 
      onOffLayout->add(onOff);
165
 
      connect(onOff, SIGNAL(toggled(bool)), SLOT(onOffToggled(bool)));
166
 
 
167
 
      pluginName = new QLineEdit(this);
168
 
      pluginName->setReadOnly(true);
169
 
      layout->add(pluginName);
170
 
 
171
 
      loadFxButton = new QPushButton("L", this);
172
 
      QRect r = loadFxButton->geometry();
173
 
      loadFxButton->setGeometry(r.x(), r.y(), 20, pluginName->geometry().height());
174
 
      loadFxButton->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
175
 
      loadFxButton->setMinimumSize(20,pluginName->geometry().height());
176
 
      loadFxButton->setMaximumSize(30,pluginName->geometry().height());
177
 
      connect(loadFxButton, SIGNAL(clicked()), SLOT(loadButton()));
178
 
      layout->add(loadFxButton);
179
 
 
180
 
      clearFxButton = new QPushButton("C", this);
181
 
      r = clearFxButton->geometry();
182
 
      clearFxButton->setGeometry(r.x(), r.y(), 20, pluginName->geometry().height());
183
 
      clearFxButton->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
184
 
      clearFxButton->setMinimumSize(20,pluginName->geometry().height());
185
 
      clearFxButton->setMaximumSize(30,pluginName->geometry().height());
186
 
      connect(clearFxButton, SIGNAL(clicked()), SLOT(clearButtonPressed()));
187
 
      layout->add(clearFxButton);
188
 
 
189
 
      layout->addSpacing(5);
190
 
 
191
 
      expandButton = new QPushButton("->", this);
192
 
      r = loadFxButton->geometry();
193
 
      expandButton->setGeometry(r.x(), r.y(), 20, pluginName->geometry().height());
194
 
      expandButton->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
195
 
      expandButton->setMinimumSize(20,pluginName->geometry().height());
196
 
      expandButton->setMaximumSize(30,pluginName->geometry().height());
197
 
      connect(expandButton, SIGNAL(clicked()), SLOT(expandButtonPressed()));
198
 
      layout->add(expandButton);
199
 
 
200
 
      layout->addSpacing(5);
201
 
 
202
 
      Q3VBoxLayout* gainSliderLayout = new Q3VBoxLayout(layout);
203
 
      gainSliderLayout->add(new QLabel("Return level", this));
204
 
      gainSliderLayout->setMargin(SS_PLUGINFRONT_MARGIN);
205
 
      outGainSlider = new QSlider(Qt::Horizontal, this);
206
 
      outGainSlider->setMinimumSize(100, pluginName->geometry().height());
207
 
      outGainSlider->setMaximumSize(500, pluginName->geometry().height());
208
 
      loadFxButton->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
209
 
      outGainSlider->setRange(0, 127);
210
 
      outGainSlider->setValue(75);
211
 
      connect(outGainSlider, SIGNAL(valueChanged(int)), SLOT(returnSliderMoved(int)));
212
 
      gainSliderLayout->add(outGainSlider);
213
 
      clearPluginDisplay();
214
 
 
215
 
      expLayout = new Q3VBoxLayout(bigLayout, 2);
216
 
 
217
 
      QToolTip::add(clearFxButton, "Clear and unload effect");
218
 
      QToolTip::add(loadFxButton,  "Load effect");
219
 
      QToolTip::add(expandButton,  "Toggle display of effect parameters");
220
 
      QToolTip::add(onOff,         "Turn effect on/off");
221
 
      SS_TRACE_OUT
222
 
      }
223
 
 
224
 
SS_PluginFront::~SS_PluginFront()
225
 
      {
226
 
      if (pluginChooser)
227
 
            delete pluginChooser;
228
 
      }
229
 
 
230
 
/*!
231
 
    \fn SS_PluginFront::clearPluginDisplay()
232
 
 */
233
 
void SS_PluginFront::clearPluginDisplay()
234
 
      {
235
 
      SS_TRACE_IN
236
 
      if (expanded)
237
 
            expandButtonPressed();
238
 
 
239
 
      pluginName->setText("No plugin loaded");
240
 
      pluginName->setEnabled(false);
241
 
 
242
 
      onOff->setEnabled(false);
243
 
      onOff->blockSignals(true);
244
 
      onOff->setChecked(false);
245
 
      onOff->blockSignals(false);
246
 
 
247
 
      clearFxButton->setEnabled(false);
248
 
      expandButton->setEnabled(false);
249
 
      outGainSlider->setEnabled(false);
250
 
      SS_TRACE_OUT
251
 
      }
252
 
 
253
 
/*!
254
 
    \fn SS_PluginFront::setPluginName(QString name)
255
 
 */
256
 
void SS_PluginFront::setPluginName(QString name)
257
 
      {
258
 
      pluginName->setText(name);
259
 
      }
260
 
 
261
 
 
262
 
/*!
263
 
    \fn SS_PluginFront::loadButton()
264
 
 */
265
 
void SS_PluginFront::loadButton()
266
 
      {
267
 
      SS_TRACE_IN
268
 
      if (!pluginChooser)
269
 
            pluginChooser = new SS_PluginChooser(this, "temppluginchooser");
270
 
 
271
 
      pluginChooser->exec();
272
 
      if ((pluginChooser->result() == QDialog::Accepted) && pluginChooser->getSelectedPlugin()) {
273
 
            Plugin* p = pluginChooser->getSelectedPlugin();
274
 
            //printf("Selected plugin: %s\n", pluginChooser->getSelectedPlugin()->name().toLatin1());
275
 
            emit loadPlugin(fxid, p->lib(), p->label());
276
 
            }
277
 
      SS_TRACE_OUT
278
 
      }
279
 
 
280
 
/*!
281
 
    \fn SS_PluginFront::returnSliderMoved(int val)
282
 
 */
283
 
void SS_PluginFront::returnSliderMoved(int val)
284
 
      {
285
 
      emit returnLevelChanged(fxid, val);
286
 
      }
287
 
 
288
 
 
289
 
/*!
290
 
    \fn SS_PluginFront::updatePluginValue(unsigned i)
291
 
 */
292
 
void SS_PluginFront::updatePluginValue(unsigned k)
293
 
      {
294
 
      SS_TRACE_IN
295
 
      // If parameters are shown - close them
296
 
      if (expanded) {
297
 
            expandButtonPressed();
298
 
            }
299
 
 
300
 
      unsigned j=0;
301
 
      if (k > plugins.size()) {
302
 
            fprintf(stderr, "Internal error, tried to update plugin w range outside of list\n");
303
 
            return;
304
 
            }
305
 
 
306
 
      iPlugin i;
307
 
      for (i = plugins.begin(); j != k; i++, j++) ;
308
 
      plugin = (LadspaPlugin*) *(i);
309
 
      setPluginName(plugin->label());
310
 
      outGainSlider->setEnabled(true);
311
 
      clearFxButton->setEnabled(true);
312
 
      expandButton->setEnabled(true);
313
 
      pluginName->setEnabled(true);
314
 
      onOff->setEnabled(true);
315
 
      onOff->setChecked(true);
316
 
      SS_TRACE_OUT
317
 
      }
318
 
 
319
 
/*!
320
 
    \fn SS_PluginFront::onOffToggled(bool state)
321
 
 */
322
 
void SS_PluginFront::onOffToggled(bool state)
323
 
      {
324
 
      emit fxToggled(fxid, state);
325
 
      }
326
 
 
327
 
/*!
328
 
    \fn SS_PluginFront::sizeHint() const
329
 
 */
330
 
QSize SS_PluginFront::sizeHint() const
331
 
      {
332
 
      return QSize(SS_PLUGINFRONT_MINWIDTH, 50);
333
 
      }
334
 
 
335
 
/*!
336
 
    \fn SS_PluginFront::sizePolicy() const
337
 
 */
338
 
QSizePolicy SS_PluginFront::sizePolicy() const
339
 
      {
340
 
      return QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
341
 
      }
342
 
 
343
 
 
344
 
/*!
345
 
    \fn SS_PluginFront::clearButtonPressed()
346
 
 */
347
 
void SS_PluginFront::clearButtonPressed()
348
 
      {
349
 
      // If parameters are shown - close them
350
 
      if (expanded) {
351
 
            expandButtonPressed();
352
 
            }
353
 
      emit clearPlugin(fxid);
354
 
      }
355
 
 
356
 
/*!
357
 
    \fn SS_PluginFront::setRetGain(int val)
358
 
 */
359
 
void SS_PluginFront::setRetGain(int val)
360
 
      {
361
 
      outGainSlider->blockSignals(true);
362
 
      outGainSlider->setValue(val);
363
 
      outGainSlider->blockSignals(false);
364
 
      }
365
 
 
366
 
/*!
367
 
    \fn SS_PluginFront::expandButtonPressed()
368
 
 */
369
 
void SS_PluginFront::expandButtonPressed()
370
 
      {
371
 
      SS_TRACE_IN
372
 
      int sizeIncrease = 0;
373
 
      QRect pf = geometry();
374
 
 
375
 
      if (!expanded) {
376
 
            plugin->parameter() == 1 ? sizeIncrease = SS_PLUGINFRONT_INC_PARAM_MIN : sizeIncrease = plugin->parameter() * SS_PLUGINFRONT_INC_PARAM;
377
 
            pf.setHeight(pf.height() + sizeIncrease);
378
 
            setMinimumSize(QSize(pf.width(), pf.height()));
379
 
            setMaximumSize(QSize(SS_PLUGINGUI_MAX_WIDTH, pf.height()));
380
 
            setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
381
 
            setGeometry(pf);
382
 
            emit sizeChanged(fxid, sizeIncrease);
383
 
 
384
 
            expanded = true;
385
 
            expandButton->setText("<-");
386
 
            createPluginParameters();
387
 
            }
388
 
      else {
389
 
            expLayout->remove(expGroup);
390
 
            expGroup->hide();
391
 
            expGroup->deleteLater();
392
 
            paramWidgets.clear();
393
 
            expGroup = 0;
394
 
            plugin->parameter() == 1 ? sizeIncrease = (0-SS_PLUGINFRONT_INC_PARAM_MIN) : sizeIncrease = 0 - (plugin->parameter() * SS_PLUGINFRONT_INC_PARAM);
395
 
            expandButton->setText("->");
396
 
            expanded = false;
397
 
            pf.setHeight(pf.height() + sizeIncrease);
398
 
            pf.setTop(pf.top() + sizeIncrease);
399
 
            pf.setBottom(pf.bottom() + sizeIncrease);
400
 
            setGeometry(pf);
401
 
            adjustSize();
402
 
            layout->activate();
403
 
            setMinimumSize(QSize(pf.width(), pf.height()));
404
 
            setMaximumSize(QSize(SS_PLUGINGUI_MAX_WIDTH, pf.height()));
405
 
            setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
406
 
            emit sizeChanged(fxid, sizeIncrease);
407
 
            }
408
 
      SS_TRACE_OUT
409
 
      }
410
 
 
411
 
/*!
412
 
    \fn SS_PluginFront::createPluginParameters()
413
 
 */
414
 
void SS_PluginFront::createPluginParameters()
415
 
      {
416
 
      SS_TRACE_IN
417
 
      expGroup = new Q3ButtonGroup(this);
418
 
 
419
 
      expGroup->setMinimumSize(QSize(50, 50));
420
 
      expGroup->setMaximumSize(QSize(SS_PLUGINGUI_MAX_WIDTH, (plugin->parameter() * SS_PLUGINFRONT_INC_PARAM  - SS_PLUGINFRONT_MARGIN)));
421
 
      expGroup->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
422
 
      expLayout->add(expGroup);
423
 
      expGroup->show();
424
 
      Q3VBoxLayout* expGroupLayout = new Q3VBoxLayout(expGroup, 1);
425
 
      expGroupLayout->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
426
 
      expGroupLayout->setResizeMode(QLayout::SetNoConstraint);
427
 
      expGroupLayout->setMargin(SS_PLUGINFRONT_MARGIN);
428
 
 
429
 
      for (int i=0; i < plugin->parameter(); i++) {
430
 
            Q3HBoxLayout* paramStrip = new Q3HBoxLayout(expGroupLayout, 3);
431
 
            paramStrip->setAlignment(Qt::AlignLeft);
432
 
            QLabel* paramName = new QLabel(plugin->getParameterName(i), expGroup);
433
 
            paramName->show();
434
 
            paramName->setMinimumSize(QSize(150, 10));
435
 
            paramName->setMaximumSize(QSize(300, SS_PLUGINFRONT_INC_PARAM));
436
 
            paramName->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding));
437
 
 
438
 
            paramStrip->add(paramName);
439
 
 
440
 
            if (plugin->isBool(i)) {
441
 
                  SS_ParameterCheckBox* paramCheckBox = new SS_ParameterCheckBox(expGroup, plugin, fxid, i);
442
 
                  paramCheckBox->setEnabled(true);
443
 
                  paramCheckBox->setParamValue((int) plugin->getControlValue(i));
444
 
                  paramCheckBox->show();
445
 
                  paramStrip->add(paramCheckBox);
446
 
                  connect(paramCheckBox, SIGNAL(valueChanged(int, int, int)), SLOT(parameterValueChanged(int, int, int)));
447
 
                  }
448
 
            else  {
449
 
                  SS_ParameterSlider* paramSlider = new SS_ParameterSlider(expGroup, plugin, fxid, i);
450
 
                  paramSlider->setEnabled(true);
451
 
                  paramSlider->show();
452
 
                  paramSlider->setRange(SS_PLUGIN_PARAM_MIN, SS_PLUGIN_PARAM_MAX);
453
 
 
454
 
                  float max, min;
455
 
                  plugin->range(i, &min, &max);
456
 
                  //int intval = 0;
457
 
                  paramSlider->setParamValue(plugin->getGuiControlValue(i));
458
 
                  connect(paramSlider, SIGNAL(valueChanged(int, int, int)), SLOT(parameterValueChanged(int, int, int)));
459
 
                  paramStrip->add(paramSlider);
460
 
                  }
461
 
            }
462
 
      expLayout->activate();
463
 
      SS_TRACE_OUT
464
 
      }
465
 
 
466
 
/*!
467
 
    \fn SS_PluginFront::parameterValueChanged(int fxid, int parameter, int val)
468
 
 */
469
 
void SS_PluginFront::parameterValueChanged(int fxid, int parameter, int val)
470
 
      {
471
 
      emit effectParameterChanged(fxid, parameter, val);
472
 
      }
473
 
 
474
 
/*!
475
 
    \fn SS_PluginFront::setParameterValue(int param, float val)
476
 
 */
477
 
void SS_PluginFront::setParameterValue(int param, int val)
478
 
      {
479
 
      SS_TRACE_IN
480
 
      int j=0;
481
 
      for (SS_iParameterWidgetList i=paramWidgets.begin(); i != paramWidgets.end(); i++, j++) {
482
 
            if (j == param) {
483
 
                  (*i)->setParamValue(val);
484
 
                  }
485
 
            }
486
 
      SS_TRACE_OUT
487
 
      }
488
 
 
489
 
SS_PluginGui::SS_PluginGui(QWidget* parent, const char* name)
490
 
      : QDialog(parent, name, false)
491
 
      {
492
 
      this->setCaption("SimpleDrums LADSPA sendeffects");
493
 
      for (int i=0; i<SS_NR_OF_SENDEFFECTS; i++) {
494
 
            pluginFronts[i] = 0;
495
 
            }
496
 
      layout = new Q3VBoxLayout(this);
497
 
 
498
 
      for (int i=0; i<SS_NR_OF_SENDEFFECTS; i++) {
499
 
            pluginFronts[i] = new SS_PluginFront(this, i);
500
 
            pluginFronts[i]->update();
501
 
            layout->add(pluginFronts[i]);
502
 
            connect(pluginFronts[i], SIGNAL(loadPlugin(int, QString, QString)), simplesynthgui_ptr, SLOT(loadEffectInvoked(int, QString, QString)));
503
 
            connect(pluginFronts[i], SIGNAL(returnLevelChanged(int, int)), simplesynthgui_ptr, SLOT(returnLevelChanged(int, int)));
504
 
            connect(pluginFronts[i], SIGNAL(fxToggled(int, int)), simplesynthgui_ptr, SLOT(toggleEffectOnOff(int, int)));
505
 
            connect(pluginFronts[i], SIGNAL(clearPlugin(int)), simplesynthgui_ptr, SLOT(clearPlugin(int)));
506
 
            connect(pluginFronts[i], SIGNAL(sizeChanged(int, int)), SLOT(pluginFrontSizeChanged(int, int)));
507
 
            connect(pluginFronts[i], SIGNAL(effectParameterChanged(int, int, int)), simplesynthgui_ptr, SLOT(effectParameterChanged(int, int, int)));
508
 
            }
509
 
      setMinimumSize(QSize(SS_PLUGINGUI_WIDTH, geometry().height()));
510
 
      setMaximumSize(QSize(SS_PLUGINGUI_MAX_WIDTH, geometry().height()));
511
 
      }
512
 
 
513
 
 
514
 
/*!
515
 
    \fn SS_PluginGui::pluginFrontSizeChanged(int fxid, int val)
516
 
 */
517
 
void SS_PluginGui::pluginFrontSizeChanged(int /*fxid*/, int val)
518
 
      {
519
 
      QRect r = geometry();
520
 
      r.setHeight(r.height() + val);
521
 
      setMinimumSize(QSize(SS_PLUGINGUI_WIDTH, r.height()));
522
 
      setMaximumSize(QSize(SS_PLUGINGUI_MAX_WIDTH, r.height()));
523
 
      setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
524
 
      setGeometry(r);
525
 
      adjustSize();
526
 
      }
527
 
 
528
 
SS_PluginFront* SS_PluginGui::getPluginFront(unsigned i)
529
 
      {
530
 
      SS_TRACE_IN
531
 
      if (i<SS_NR_OF_SENDEFFECTS)
532
 
      SS_TRACE_OUT
533
 
      return pluginFronts[i];
534
 
      }