svgui  1.9
PluginParameterDialog.h
Go to the documentation of this file.
00001 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
00002 
00003 /*
00004     Sonic Visualiser
00005     An audio file viewer and annotation editor.
00006     Centre for Digital Music, Queen Mary, University of London.
00007     This file copyright 2006 Chris Cannam and QMUL.
00008     
00009     This program is free software; you can redistribute it and/or
00010     modify it under the terms of the GNU General Public License as
00011     published by the Free Software Foundation; either version 2 of the
00012     License, or (at your option) any later version.  See the file
00013     COPYING included with this distribution for more information.
00014 */
00015 
00016 #ifndef _PLUGIN_PARAMETER_DIALOG_H_
00017 #define _PLUGIN_PARAMETER_DIALOG_H_
00018 
00019 #include <QDialog>
00020 
00021 #include "base/Window.h"
00022 
00023 #include <vamp-hostsdk/PluginBase.h>
00024 
00025 class PluginParameterBox;
00026 class QWidget;
00027 class QPushButton;
00028 class QLabel;
00029 class QGroupBox;
00030 class QComboBox;
00031 class QCheckBox;
00032 
00041 class PluginParameterDialog : public QDialog
00042 {
00043     Q_OBJECT
00044     
00045 public:
00046     PluginParameterDialog(Vamp::PluginBase *, QWidget *parent = 0);
00047     ~PluginParameterDialog();
00048 
00049     void setChannelArrangement(int sourceChannels,
00050                                int targetChannels,
00051                                int defaultChannel);
00052 
00053     void setOutputLabel(QString output, QString description);
00054 
00055     void setMoreInfoUrl(QString url);
00056 
00057     void setShowProcessingOptions(bool showWindowSize,
00058                                   bool showFrequencyDomainOptions);
00059 
00060     void setCandidateInputModels(const QStringList &names,
00061                                  QString defaultName);
00062     void setShowSelectionOnlyOption(bool show);
00063 
00064     Vamp::PluginBase *getPlugin() { return m_plugin; }
00065 
00066     int getChannel() const { return m_channel; }
00067 
00068     QString getInputModel() const;
00069     bool getSelectionOnly() const;
00070 
00072 
00073     void getProcessingParameters(int &blockSize) const;
00074     void getProcessingParameters(int &stepSize, int &blockSize,
00075                                  WindowType &windowType) const;
00076 
00077     int exec();
00078 
00079 signals:
00080     void pluginConfigurationChanged(QString);
00081     void inputModelChanged(QString);
00082 
00083 protected slots:
00084     void channelComboChanged(int);
00085     void blockSizeComboChanged(const QString &);
00086     void incrementComboChanged(const QString &);
00087     void windowTypeChanged(WindowType type);
00088     void advancedToggled();
00089     void moreInfo();
00090     void setAdvancedVisible(bool);
00091     void inputModelComboChanged(int);
00092     void selectionOnlyChanged(int);
00093     void dialogAccepted();
00094 
00095 protected:
00096     Vamp::PluginBase *m_plugin;
00097 
00098     int m_channel;
00099     int m_stepSize;
00100     int m_blockSize;
00101 
00102     WindowType m_windowType;
00103     PluginParameterBox *m_parameterBox;
00104 
00105     QLabel *m_outputLabel;
00106     QLabel *m_outputValue;
00107     QLabel *m_outputDescription;
00108     QLabel *m_outputSpacer;
00109 
00110     QPushButton *m_moreInfo;
00111     QString m_moreInfoUrl;
00112 
00113     QGroupBox *m_channelBox;
00114     bool m_haveChannelBoxData;
00115 
00116     QGroupBox *m_windowBox;
00117     bool m_haveWindowBoxData;
00118 
00119     QGroupBox *m_inputModelBox;
00120     QComboBox *m_inputModels;
00121     QCheckBox *m_selectionOnly;
00122     QStringList m_inputModelList;
00123     QString m_currentInputModel;
00124     bool m_currentSelectionOnly;
00125 
00126     QPushButton *m_advancedButton;
00127     QWidget *m_advanced;
00128     bool m_advancedVisible;
00129 };
00130 
00131 #endif
00132