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 SV_PLUGIN_PARAMETER_DIALOG_H
17 #define SV_PLUGIN_PARAMETER_DIALOG_H
18 
19 #include <QDialog>
20 
21 #include "base/Window.h"
22 
23 #include <vamp-hostsdk/PluginBase.h>
24 
25 #include <memory>
26 
27 class PluginParameterBox;
28 class QWidget;
29 class QPushButton;
30 class QLabel;
31 class QGroupBox;
32 class QComboBox;
33 class QCheckBox;
34 
43 class PluginParameterDialog : public QDialog
44 {
45  Q_OBJECT
46 
47 public:
48  PluginParameterDialog(std::shared_ptr<Vamp::PluginBase> plugin,
49  QWidget *parent = 0);
51 
52  void setChannelArrangement(int sourceChannels,
53  int targetChannels,
54  int defaultChannel);
55 
56  void setOutputLabel(QString output, QString description);
57 
58  void setMoreInfoUrl(QString url);
59 
60  void setShowProcessingOptions(bool showWindowSize,
61  bool showFrequencyDomainOptions);
62 
63  void setCandidateInputModels(const QStringList &names,
64  QString defaultName);
65  void setShowSelectionOnlyOption(bool show);
66 
67  std::shared_ptr<Vamp::PluginBase> getPlugin() { return m_plugin; }
68 
69  int getChannel() const { return m_channel; }
70 
71  QString getInputModel() const;
72  bool getSelectionOnly() const;
73 
75 
76  void getProcessingParameters(int &blockSize) const;
77  void getProcessingParameters(int &stepSize, int &blockSize,
78  WindowType &windowType) const;
79 
80  int exec() override;
81 
82 signals:
83  void pluginConfigurationChanged(QString);
84  void inputModelChanged(QString);
85 
86 protected slots:
87  void channelComboChanged(int);
88  void blockSizeComboChanged(const QString &);
89  void incrementComboChanged(const QString &);
90  void windowTypeChanged(WindowType type);
91  void advancedToggled();
92  void moreInfo();
93  void setAdvancedVisible(bool);
94  void inputModelComboChanged(int);
95  void selectionOnlyChanged(int);
96  void dialogAccepted();
97 
98 protected:
99  std::shared_ptr<Vamp::PluginBase> m_plugin;
100 
104 
105  WindowType m_windowType;
107 
108  QLabel *m_outputLabel;
109  QLabel *m_outputValue;
111  QLabel *m_outputSpacer;
112 
113  QPushButton *m_moreInfo;
114  QString m_moreInfoUrl;
115 
116  QGroupBox *m_channelBox;
118 
119  QGroupBox *m_windowBox;
121 
122  QGroupBox *m_inputModelBox;
123  QComboBox *m_inputModels;
124  QCheckBox *m_selectionOnly;
125  QStringList m_inputModelList;
128 
129  QPushButton *m_advancedButton;
130  QWidget *m_advanced;
132 };
133 
134 #endif
135 
void setChannelArrangement(int sourceChannels, int targetChannels, int defaultChannel)
PluginParameterDialog(std::shared_ptr< Vamp::PluginBase > plugin, QWidget *parent=0)
void pluginConfigurationChanged(QString)
void getProcessingParameters(int &blockSize) const
!! merge with PluginTransform::ExecutionContext
void inputModelChanged(QString)
std::shared_ptr< Vamp::PluginBase > getPlugin()
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 blockSizeComboChanged(const QString &)
A dialog for editing the parameters of a given plugin, using a PluginParameterBox.
void setMoreInfoUrl(QString url)
void incrementComboChanged(const QString &)
std::shared_ptr< Vamp::PluginBase > m_plugin