svgui  1.9
PluginParameterDialog.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 
3 /*
4  Sonic Visualiser
5  An audio file viewer and annotation editor.
6  Centre for Digital Music, Queen Mary, University of London.
7  This file copyright 2006 Chris Cannam and QMUL.
8 
9  This program is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License as
11  published by the Free Software Foundation; either version 2 of the
12  License, or (at your option) any later version. See the file
13  COPYING included with this distribution for more information.
14 */
15 
16 #ifndef _PLUGIN_PARAMETER_DIALOG_H_
17 #define _PLUGIN_PARAMETER_DIALOG_H_
18 
19 #include <QDialog>
20 
21 #include "base/Window.h"
22 
23 #include <vamp-hostsdk/PluginBase.h>
24 
25 class PluginParameterBox;
26 class QWidget;
27 class QPushButton;
28 class QLabel;
29 class QGroupBox;
30 class QComboBox;
31 class QCheckBox;
32 
41 class PluginParameterDialog : public QDialog
42 {
43  Q_OBJECT
44 
45 public:
46  PluginParameterDialog(Vamp::PluginBase *, QWidget *parent = 0);
48 
49  void setChannelArrangement(int sourceChannels,
50  int targetChannels,
51  int defaultChannel);
52 
53  void setOutputLabel(QString output, QString description);
54 
55  void setMoreInfoUrl(QString url);
56 
57  void setShowProcessingOptions(bool showWindowSize,
58  bool showFrequencyDomainOptions);
59 
60  void setCandidateInputModels(const QStringList &names,
61  QString defaultName);
62  void setShowSelectionOnlyOption(bool show);
63 
64  Vamp::PluginBase *getPlugin() { return m_plugin; }
65 
66  int getChannel() const { return m_channel; }
67 
68  QString getInputModel() const;
69  bool getSelectionOnly() const;
70 
72 
73  void getProcessingParameters(int &blockSize) const;
74  void getProcessingParameters(int &stepSize, int &blockSize,
75  WindowType &windowType) const;
76 
77  int exec();
78 
79 signals:
80  void pluginConfigurationChanged(QString);
81  void inputModelChanged(QString);
82 
83 protected slots:
84  void channelComboChanged(int);
85  void blockSizeComboChanged(const QString &);
86  void incrementComboChanged(const QString &);
87  void windowTypeChanged(WindowType type);
88  void advancedToggled();
89  void moreInfo();
90  void setAdvancedVisible(bool);
91  void inputModelComboChanged(int);
92  void selectionOnlyChanged(int);
93  void dialogAccepted();
94 
95 protected:
96  Vamp::PluginBase *m_plugin;
97 
98  int m_channel;
101 
102  WindowType m_windowType;
104 
105  QLabel *m_outputLabel;
106  QLabel *m_outputValue;
108  QLabel *m_outputSpacer;
109 
110  QPushButton *m_moreInfo;
111  QString m_moreInfoUrl;
112 
113  QGroupBox *m_channelBox;
115 
116  QGroupBox *m_windowBox;
118 
119  QGroupBox *m_inputModelBox;
120  QComboBox *m_inputModels;
121  QCheckBox *m_selectionOnly;
122  QStringList m_inputModelList;
125 
126  QPushButton *m_advancedButton;
127  QWidget *m_advanced;
129 };
130 
131 #endif
132 
void setChannelArrangement(int sourceChannels, int targetChannels, int defaultChannel)
Vamp::PluginBase * getPlugin()
void pluginConfigurationChanged(QString)
void inputModelChanged(QString)
void windowTypeChanged(WindowType type)
void setCandidateInputModels(const QStringList &names, QString defaultName)
void setShowSelectionOnlyOption(bool show)
void setOutputLabel(QString output, QString description)
PluginParameterBox * m_parameterBox
void setShowProcessingOptions(bool showWindowSize, bool showFrequencyDomainOptions)
void getProcessingParameters(int &blockSize) const
!! merge with PluginTransform::ExecutionContext
Vamp::PluginBase * m_plugin
void blockSizeComboChanged(const QString &)
A dialog for editing the parameters of a given plugin, using a PluginParameterBox.
void setMoreInfoUrl(QString url)
void incrementComboChanged(const QString &)
PluginParameterDialog(Vamp::PluginBase *, QWidget *parent=0)