comparison widgets/PluginParameterDialog.h @ 0:fc9323a41f5a

start base : Sonic Visualiser sv1-1.0rc1
author lbajardsilogic
date Fri, 11 May 2007 09:08:14 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:fc9323a41f5a
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 namespace Vamp { class PluginBase; }
24 class PluginParameterBox;
25 class QWidget;
26 class QPushButton;
27 class QLabel;
28 class QGroupBox;
29 class QComboBox;
30
31 /**
32 * A dialog for editing the parameters of a given plugin, using a
33 * PluginParameterBox. This dialog does not contain any mechanism for
34 * selecting the plugin in the first place. Note that the dialog
35 * directly modifies the parameters of the plugin, so they will remain
36 * modified even if the dialog is then cancelled.
37 */
38
39 class PluginParameterDialog : public QDialog
40 {
41 Q_OBJECT
42
43 public:
44 PluginParameterDialog(Vamp::PluginBase *, QWidget *parent = 0);
45 ~PluginParameterDialog();
46
47 void setChannelArrangement(int sourceChannels,
48 int targetChannels,
49 int defaultChannel);
50
51 void setOutputLabel(QString output, QString description);
52
53 void setShowProcessingOptions(bool showWindowSize,
54 bool showFrequencyDomainOptions);
55
56 void setCandidateInputModels(const QStringList &names);
57
58 Vamp::PluginBase *getPlugin() { return m_plugin; }
59
60 int getChannel() const { return m_channel; }
61
62 QString getInputModel() const;
63
64 //!!! merge with PluginTransform::ExecutionContext
65
66 void getProcessingParameters(size_t &blockSize) const;
67 void getProcessingParameters(size_t &stepSize, size_t &blockSize,
68 WindowType &windowType) const;
69
70 signals:
71 void pluginConfigurationChanged(QString);
72 void inputModelChanged(QString);
73
74 protected slots:
75 void channelComboChanged(int);
76 void blockSizeComboChanged(const QString &);
77 void incrementComboChanged(const QString &);
78 void windowTypeChanged(WindowType type);
79 void advancedToggled();
80 void setAdvancedVisible(bool);
81
82 protected:
83 Vamp::PluginBase *m_plugin;
84
85 int m_channel;
86 size_t m_stepSize;
87 size_t m_blockSize;
88
89 WindowType m_windowType;
90 PluginParameterBox *m_parameterBox;
91
92 QLabel *m_outputLabel;
93 QLabel *m_outputValue;
94 QLabel *m_outputDescription;
95 QLabel *m_outputSpacer;
96
97 QGroupBox *m_channelBox;
98 bool m_haveChannelBoxData;
99
100 QGroupBox *m_windowBox;
101 bool m_haveWindowBoxData;
102
103 QGroupBox *m_inputModelBox;
104 QComboBox *m_inputModels;
105
106 QPushButton *m_advancedButton;
107 QWidget *m_advanced;
108 bool m_advancedVisible;
109 };
110
111 #endif
112