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 namespace Vamp { class PluginBase; }
00024 class PluginParameterBox;
00025 class QWidget;
00026 class QPushButton;
00027 class QLabel;
00028 class QGroupBox;
00029 class QComboBox;
00030 class QCheckBox;
00031 
00040 class PluginParameterDialog : public QDialog
00041 {
00042     Q_OBJECT
00043     
00044 public:
00045     PluginParameterDialog(Vamp::PluginBase *, QWidget *parent = 0);
00046     ~PluginParameterDialog();
00047 
00048     void setChannelArrangement(int sourceChannels,
00049                                int targetChannels,
00050                                int defaultChannel);
00051 
00052     void setOutputLabel(QString output, QString description);
00053 
00054     void setShowProcessingOptions(bool showWindowSize,
00055                                   bool showFrequencyDomainOptions);
00056 
00057     void setCandidateInputModels(const QStringList &names,
00058                                  QString defaultName);
00059     void setShowSelectionOnlyOption(bool show);
00060 
00061     Vamp::PluginBase *getPlugin() { return m_plugin; }
00062 
00063     int getChannel() const { return m_channel; }
00064 
00065     QString getInputModel() const;
00066     bool getSelectionOnly() const;
00067 
00069 
00070     void getProcessingParameters(size_t &blockSize) const;
00071     void getProcessingParameters(size_t &stepSize, size_t &blockSize,
00072                                  WindowType &windowType) const;
00073 
00074 signals:
00075     void pluginConfigurationChanged(QString);
00076     void inputModelChanged(QString);
00077 
00078 protected slots:
00079     void channelComboChanged(int);
00080     void blockSizeComboChanged(const QString &);
00081     void incrementComboChanged(const QString &);
00082     void windowTypeChanged(WindowType type);
00083     void advancedToggled();
00084     void setAdvancedVisible(bool);
00085     void inputModelComboChanged(int);
00086     void selectionOnlyChanged(int);
00087     void dialogAccepted();
00088 
00089 protected:
00090     Vamp::PluginBase *m_plugin;
00091 
00092     int m_channel;
00093     size_t m_stepSize;
00094     size_t m_blockSize;
00095 
00096     WindowType m_windowType;
00097     PluginParameterBox *m_parameterBox;
00098 
00099     QLabel *m_outputLabel;
00100     QLabel *m_outputValue;
00101     QLabel *m_outputDescription;
00102     QLabel *m_outputSpacer;
00103 
00104     QGroupBox *m_channelBox;
00105     bool m_haveChannelBoxData;
00106 
00107     QGroupBox *m_windowBox;
00108     bool m_haveWindowBoxData;
00109 
00110     QGroupBox *m_inputModelBox;
00111     QComboBox *m_inputModels;
00112     QCheckBox *m_selectionOnly;
00113     QStringList m_inputModelList;
00114     QString m_currentInputModel;
00115     bool m_currentSelectionOnly;
00116 
00117     QPushButton *m_advancedButton;
00118     QWidget *m_advanced;
00119     bool m_advancedVisible;
00120 };
00121 
00122 #endif
00123 

Generated on Wed Feb 20 15:45:27 2008 for SonicVisualiser by  doxygen 1.5.1