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@182
|
7 This file copyright 2006 Chris Cannam and QMUL.
|
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@1407
|
16 #ifndef SV_PLUGIN_PARAMETER_DIALOG_H
|
Chris@1407
|
17 #define SV_PLUGIN_PARAMETER_DIALOG_H
|
Chris@62
|
18
|
Chris@62
|
19 #include <QDialog>
|
Chris@62
|
20
|
Chris@145
|
21 #include "base/Window.h"
|
Chris@145
|
22
|
Chris@452
|
23 #include <vamp-hostsdk/PluginBase.h>
|
Chris@452
|
24
|
Chris@62
|
25 class PluginParameterBox;
|
Chris@143
|
26 class QWidget;
|
Chris@143
|
27 class QPushButton;
|
Chris@163
|
28 class QLabel;
|
Chris@163
|
29 class QGroupBox;
|
Chris@164
|
30 class QComboBox;
|
Chris@302
|
31 class QCheckBox;
|
Chris@62
|
32
|
Chris@62
|
33 /**
|
Chris@62
|
34 * A dialog for editing the parameters of a given plugin, using a
|
Chris@62
|
35 * PluginParameterBox. This dialog does not contain any mechanism for
|
Chris@62
|
36 * selecting the plugin in the first place. Note that the dialog
|
Chris@62
|
37 * directly modifies the parameters of the plugin, so they will remain
|
Chris@62
|
38 * modified even if the dialog is then cancelled.
|
Chris@62
|
39 */
|
Chris@62
|
40
|
Chris@62
|
41 class PluginParameterDialog : public QDialog
|
Chris@62
|
42 {
|
Chris@62
|
43 Q_OBJECT
|
Chris@62
|
44
|
Chris@62
|
45 public:
|
Chris@1581
|
46 PluginParameterDialog(std::shared_ptr<Vamp::PluginBase> plugin,
|
Chris@1581
|
47 QWidget *parent = 0);
|
Chris@62
|
48 ~PluginParameterDialog();
|
Chris@62
|
49
|
Chris@163
|
50 void setChannelArrangement(int sourceChannels,
|
Chris@163
|
51 int targetChannels,
|
Chris@163
|
52 int defaultChannel);
|
Chris@163
|
53
|
Chris@208
|
54 void setOutputLabel(QString output, QString description);
|
Chris@163
|
55
|
Chris@440
|
56 void setMoreInfoUrl(QString url);
|
Chris@440
|
57
|
Chris@163
|
58 void setShowProcessingOptions(bool showWindowSize,
|
Chris@163
|
59 bool showFrequencyDomainOptions);
|
Chris@163
|
60
|
Chris@336
|
61 void setCandidateInputModels(const QStringList &names,
|
Chris@336
|
62 QString defaultName);
|
Chris@302
|
63 void setShowSelectionOnlyOption(bool show);
|
Chris@164
|
64
|
Chris@1581
|
65 std::shared_ptr<Vamp::PluginBase> getPlugin() { return m_plugin; }
|
Chris@62
|
66
|
Chris@69
|
67 int getChannel() const { return m_channel; }
|
Chris@69
|
68
|
Chris@164
|
69 QString getInputModel() const;
|
Chris@302
|
70 bool getSelectionOnly() const;
|
Chris@164
|
71
|
Chris@146
|
72 //!!! merge with PluginTransform::ExecutionContext
|
Chris@146
|
73
|
Chris@807
|
74 void getProcessingParameters(int &blockSize) const;
|
Chris@807
|
75 void getProcessingParameters(int &stepSize, int &blockSize,
|
Chris@145
|
76 WindowType &windowType) const;
|
Chris@145
|
77
|
Chris@1406
|
78 int exec() override;
|
Chris@456
|
79
|
Chris@64
|
80 signals:
|
Chris@64
|
81 void pluginConfigurationChanged(QString);
|
Chris@164
|
82 void inputModelChanged(QString);
|
Chris@64
|
83
|
Chris@69
|
84 protected slots:
|
Chris@69
|
85 void channelComboChanged(int);
|
Chris@155
|
86 void blockSizeComboChanged(const QString &);
|
Chris@155
|
87 void incrementComboChanged(const QString &);
|
Chris@145
|
88 void windowTypeChanged(WindowType type);
|
Chris@143
|
89 void advancedToggled();
|
Chris@440
|
90 void moreInfo();
|
Chris@163
|
91 void setAdvancedVisible(bool);
|
Chris@294
|
92 void inputModelComboChanged(int);
|
Chris@302
|
93 void selectionOnlyChanged(int);
|
Chris@294
|
94 void dialogAccepted();
|
Chris@69
|
95
|
Chris@62
|
96 protected:
|
Chris@1581
|
97 std::shared_ptr<Vamp::PluginBase> m_plugin;
|
Chris@163
|
98
|
Chris@69
|
99 int m_channel;
|
Chris@807
|
100 int m_stepSize;
|
Chris@807
|
101 int m_blockSize;
|
Chris@163
|
102
|
Chris@145
|
103 WindowType m_windowType;
|
Chris@62
|
104 PluginParameterBox *m_parameterBox;
|
Chris@163
|
105
|
Chris@163
|
106 QLabel *m_outputLabel;
|
Chris@163
|
107 QLabel *m_outputValue;
|
Chris@208
|
108 QLabel *m_outputDescription;
|
Chris@208
|
109 QLabel *m_outputSpacer;
|
Chris@164
|
110
|
Chris@440
|
111 QPushButton *m_moreInfo;
|
Chris@440
|
112 QString m_moreInfoUrl;
|
Chris@440
|
113
|
Chris@163
|
114 QGroupBox *m_channelBox;
|
Chris@163
|
115 bool m_haveChannelBoxData;
|
Chris@164
|
116
|
Chris@163
|
117 QGroupBox *m_windowBox;
|
Chris@163
|
118 bool m_haveWindowBoxData;
|
Chris@163
|
119
|
Chris@164
|
120 QGroupBox *m_inputModelBox;
|
Chris@164
|
121 QComboBox *m_inputModels;
|
Chris@302
|
122 QCheckBox *m_selectionOnly;
|
Chris@294
|
123 QStringList m_inputModelList;
|
Chris@296
|
124 QString m_currentInputModel;
|
Chris@302
|
125 bool m_currentSelectionOnly;
|
Chris@164
|
126
|
Chris@143
|
127 QPushButton *m_advancedButton;
|
Chris@143
|
128 QWidget *m_advanced;
|
Chris@163
|
129 bool m_advancedVisible;
|
Chris@62
|
130 };
|
Chris@62
|
131
|
Chris@62
|
132 #endif
|
Chris@62
|
133
|