Chris@62: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@62: Chris@62: /* Chris@62: Sonic Visualiser Chris@62: An audio file viewer and annotation editor. Chris@62: Centre for Digital Music, Queen Mary, University of London. Chris@182: This file copyright 2006 Chris Cannam and QMUL. Chris@62: Chris@62: This program is free software; you can redistribute it and/or Chris@62: modify it under the terms of the GNU General Public License as Chris@62: published by the Free Software Foundation; either version 2 of the Chris@62: License, or (at your option) any later version. See the file Chris@62: COPYING included with this distribution for more information. Chris@62: */ Chris@62: Chris@62: #ifndef _PLUGIN_PARAMETER_DIALOG_H_ Chris@62: #define _PLUGIN_PARAMETER_DIALOG_H_ Chris@62: Chris@62: #include Chris@62: Chris@145: #include "base/Window.h" Chris@145: Chris@452: #include Chris@452: Chris@62: class PluginParameterBox; Chris@143: class QWidget; Chris@143: class QPushButton; Chris@163: class QLabel; Chris@163: class QGroupBox; Chris@164: class QComboBox; Chris@302: class QCheckBox; Chris@62: Chris@62: /** Chris@62: * A dialog for editing the parameters of a given plugin, using a Chris@62: * PluginParameterBox. This dialog does not contain any mechanism for Chris@62: * selecting the plugin in the first place. Note that the dialog Chris@62: * directly modifies the parameters of the plugin, so they will remain Chris@62: * modified even if the dialog is then cancelled. Chris@62: */ Chris@62: Chris@62: class PluginParameterDialog : public QDialog Chris@62: { Chris@62: Q_OBJECT Chris@62: Chris@62: public: Chris@163: PluginParameterDialog(Vamp::PluginBase *, QWidget *parent = 0); Chris@62: ~PluginParameterDialog(); Chris@62: Chris@163: void setChannelArrangement(int sourceChannels, Chris@163: int targetChannels, Chris@163: int defaultChannel); Chris@163: Chris@208: void setOutputLabel(QString output, QString description); Chris@163: Chris@440: void setMoreInfoUrl(QString url); Chris@440: Chris@163: void setShowProcessingOptions(bool showWindowSize, Chris@163: bool showFrequencyDomainOptions); Chris@163: Chris@336: void setCandidateInputModels(const QStringList &names, Chris@336: QString defaultName); Chris@302: void setShowSelectionOnlyOption(bool show); Chris@164: Chris@71: Vamp::PluginBase *getPlugin() { return m_plugin; } Chris@62: Chris@69: int getChannel() const { return m_channel; } Chris@69: Chris@164: QString getInputModel() const; Chris@302: bool getSelectionOnly() const; Chris@164: Chris@146: //!!! merge with PluginTransform::ExecutionContext Chris@146: Chris@807: void getProcessingParameters(int &blockSize) const; Chris@807: void getProcessingParameters(int &stepSize, int &blockSize, Chris@145: WindowType &windowType) const; Chris@145: Chris@456: int exec(); Chris@456: Chris@64: signals: Chris@64: void pluginConfigurationChanged(QString); Chris@164: void inputModelChanged(QString); Chris@64: Chris@69: protected slots: Chris@69: void channelComboChanged(int); Chris@155: void blockSizeComboChanged(const QString &); Chris@155: void incrementComboChanged(const QString &); Chris@145: void windowTypeChanged(WindowType type); Chris@143: void advancedToggled(); Chris@440: void moreInfo(); Chris@163: void setAdvancedVisible(bool); Chris@294: void inputModelComboChanged(int); Chris@302: void selectionOnlyChanged(int); Chris@294: void dialogAccepted(); Chris@69: Chris@62: protected: Chris@71: Vamp::PluginBase *m_plugin; Chris@163: Chris@69: int m_channel; Chris@807: int m_stepSize; Chris@807: int m_blockSize; Chris@163: Chris@145: WindowType m_windowType; Chris@62: PluginParameterBox *m_parameterBox; Chris@163: Chris@163: QLabel *m_outputLabel; Chris@163: QLabel *m_outputValue; Chris@208: QLabel *m_outputDescription; Chris@208: QLabel *m_outputSpacer; Chris@164: Chris@440: QPushButton *m_moreInfo; Chris@440: QString m_moreInfoUrl; Chris@440: Chris@163: QGroupBox *m_channelBox; Chris@163: bool m_haveChannelBoxData; Chris@164: Chris@163: QGroupBox *m_windowBox; Chris@163: bool m_haveWindowBoxData; Chris@163: Chris@164: QGroupBox *m_inputModelBox; Chris@164: QComboBox *m_inputModels; Chris@302: QCheckBox *m_selectionOnly; Chris@294: QStringList m_inputModelList; Chris@296: QString m_currentInputModel; Chris@302: bool m_currentSelectionOnly; Chris@164: Chris@143: QPushButton *m_advancedButton; Chris@143: QWidget *m_advanced; Chris@163: bool m_advancedVisible; Chris@62: }; Chris@62: Chris@62: #endif Chris@62: