svgui  1.9
PluginParameterBox.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_BOX_H_
17 #define _PLUGIN_PARAMETER_BOX_H_
18 
19 #include <vamp-hostsdk/PluginBase.h>
20 
21 #include <QFrame>
22 #include <map>
23 
24 class AudioDial;
25 class QDoubleSpinBox;
26 class QCheckBox;
27 class QGridLayout;
28 class QComboBox;
29 
30 class PluginParameterBox : public QFrame
31 {
32  Q_OBJECT
33 
34 public:
35  PluginParameterBox(Vamp::PluginBase *, QWidget *parent = 0);
37 
38  Vamp::PluginBase *getPlugin() { return m_plugin; }
39 
40 signals:
41  void pluginConfigurationChanged(QString);
42 
43 protected slots:
44  void dialChanged(int);
45  void spinBoxChanged(double);
46  void checkBoxChanged(int);
47  void programComboChanged(const QString &);
48 
49 protected:
50  void populate();
51  void updateProgramCombo();
52 
53  QGridLayout *m_layout;
54  Vamp::PluginBase *m_plugin;
55 
56  struct ParamRec {
58  QDoubleSpinBox *spin;
59  QCheckBox *check;
60  QComboBox *combo;
61  Vamp::PluginBase::ParameterDescriptor param;
62  };
63 
64  QComboBox *m_programCombo;
65 
66  std::map<QString, ParamRec> m_params;
67  std::map<QString, QString> m_nameMap;
68  Vamp::PluginBase::ProgramList m_programs;
69 };
70 
71 #endif
72 
Vamp::PluginBase * m_plugin
QComboBox * m_programCombo
Vamp::PluginBase * getPlugin()
PluginParameterBox(Vamp::PluginBase *, QWidget *parent=0)
void pluginConfigurationChanged(QString)
std::map< QString, ParamRec > m_params
std::map< QString, QString > m_nameMap
AudioDial is a nicer-looking QDial that by default reacts to mouse movement on horizontal and vertica...
Definition: AudioDial.h:59
QGridLayout * m_layout
void programComboChanged(const QString &)
Vamp::PluginBase::ProgramList m_programs
Vamp::PluginBase::ParameterDescriptor param