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