annotate widgets/PluginParameterDialog.h @ 1613:fe9a643b83bf

Merge from branch csv-import-headers
author Chris Cannam
date Thu, 18 Jun 2020 13:45:11 +0100
parents 7eb595837eaa
children
rev   line source
Chris@62 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@62 2
Chris@62 3 /*
Chris@62 4 Sonic Visualiser
Chris@62 5 An audio file viewer and annotation editor.
Chris@62 6 Centre for Digital Music, Queen Mary, University of London.
Chris@182 7 This file copyright 2006 Chris Cannam and QMUL.
Chris@62 8
Chris@62 9 This program is free software; you can redistribute it and/or
Chris@62 10 modify it under the terms of the GNU General Public License as
Chris@62 11 published by the Free Software Foundation; either version 2 of the
Chris@62 12 License, or (at your option) any later version. See the file
Chris@62 13 COPYING included with this distribution for more information.
Chris@62 14 */
Chris@62 15
Chris@1407 16 #ifndef SV_PLUGIN_PARAMETER_DIALOG_H
Chris@1407 17 #define SV_PLUGIN_PARAMETER_DIALOG_H
Chris@62 18
Chris@62 19 #include <QDialog>
Chris@62 20
Chris@145 21 #include "base/Window.h"
Chris@145 22
Chris@452 23 #include <vamp-hostsdk/PluginBase.h>
Chris@452 24
Chris@1597 25 #include <memory>
Chris@1597 26
Chris@62 27 class PluginParameterBox;
Chris@143 28 class QWidget;
Chris@143 29 class QPushButton;
Chris@163 30 class QLabel;
Chris@163 31 class QGroupBox;
Chris@164 32 class QComboBox;
Chris@302 33 class QCheckBox;
Chris@62 34
Chris@62 35 /**
Chris@62 36 * A dialog for editing the parameters of a given plugin, using a
Chris@62 37 * PluginParameterBox. This dialog does not contain any mechanism for
Chris@62 38 * selecting the plugin in the first place. Note that the dialog
Chris@62 39 * directly modifies the parameters of the plugin, so they will remain
Chris@62 40 * modified even if the dialog is then cancelled.
Chris@62 41 */
Chris@62 42
Chris@62 43 class PluginParameterDialog : public QDialog
Chris@62 44 {
Chris@62 45 Q_OBJECT
Chris@62 46
Chris@62 47 public:
Chris@1581 48 PluginParameterDialog(std::shared_ptr<Vamp::PluginBase> plugin,
Chris@1581 49 QWidget *parent = 0);
Chris@62 50 ~PluginParameterDialog();
Chris@62 51
Chris@163 52 void setChannelArrangement(int sourceChannels,
Chris@163 53 int targetChannels,
Chris@163 54 int defaultChannel);
Chris@163 55
Chris@208 56 void setOutputLabel(QString output, QString description);
Chris@163 57
Chris@440 58 void setMoreInfoUrl(QString url);
Chris@440 59
Chris@163 60 void setShowProcessingOptions(bool showWindowSize,
Chris@163 61 bool showFrequencyDomainOptions);
Chris@163 62
Chris@336 63 void setCandidateInputModels(const QStringList &names,
Chris@336 64 QString defaultName);
Chris@302 65 void setShowSelectionOnlyOption(bool show);
Chris@164 66
Chris@1581 67 std::shared_ptr<Vamp::PluginBase> getPlugin() { return m_plugin; }
Chris@62 68
Chris@69 69 int getChannel() const { return m_channel; }
Chris@69 70
Chris@164 71 QString getInputModel() const;
Chris@302 72 bool getSelectionOnly() const;
Chris@164 73
Chris@146 74 //!!! merge with PluginTransform::ExecutionContext
Chris@146 75
Chris@807 76 void getProcessingParameters(int &blockSize) const;
Chris@807 77 void getProcessingParameters(int &stepSize, int &blockSize,
Chris@145 78 WindowType &windowType) const;
Chris@145 79
Chris@1406 80 int exec() override;
Chris@456 81
Chris@64 82 signals:
Chris@64 83 void pluginConfigurationChanged(QString);
Chris@164 84 void inputModelChanged(QString);
Chris@64 85
Chris@69 86 protected slots:
Chris@69 87 void channelComboChanged(int);
Chris@155 88 void blockSizeComboChanged(const QString &);
Chris@155 89 void incrementComboChanged(const QString &);
Chris@145 90 void windowTypeChanged(WindowType type);
Chris@143 91 void advancedToggled();
Chris@440 92 void moreInfo();
Chris@163 93 void setAdvancedVisible(bool);
Chris@294 94 void inputModelComboChanged(int);
Chris@302 95 void selectionOnlyChanged(int);
Chris@294 96 void dialogAccepted();
Chris@69 97
Chris@62 98 protected:
Chris@1581 99 std::shared_ptr<Vamp::PluginBase> m_plugin;
Chris@163 100
Chris@69 101 int m_channel;
Chris@807 102 int m_stepSize;
Chris@807 103 int m_blockSize;
Chris@163 104
Chris@145 105 WindowType m_windowType;
Chris@62 106 PluginParameterBox *m_parameterBox;
Chris@163 107
Chris@163 108 QLabel *m_outputLabel;
Chris@163 109 QLabel *m_outputValue;
Chris@208 110 QLabel *m_outputDescription;
Chris@208 111 QLabel *m_outputSpacer;
Chris@164 112
Chris@440 113 QPushButton *m_moreInfo;
Chris@440 114 QString m_moreInfoUrl;
Chris@440 115
Chris@163 116 QGroupBox *m_channelBox;
Chris@163 117 bool m_haveChannelBoxData;
Chris@164 118
Chris@163 119 QGroupBox *m_windowBox;
Chris@163 120 bool m_haveWindowBoxData;
Chris@163 121
Chris@164 122 QGroupBox *m_inputModelBox;
Chris@164 123 QComboBox *m_inputModels;
Chris@302 124 QCheckBox *m_selectionOnly;
Chris@294 125 QStringList m_inputModelList;
Chris@296 126 QString m_currentInputModel;
Chris@302 127 bool m_currentSelectionOnly;
Chris@164 128
Chris@143 129 QPushButton *m_advancedButton;
Chris@143 130 QWidget *m_advanced;
Chris@163 131 bool m_advancedVisible;
Chris@62 132 };
Chris@62 133
Chris@62 134 #endif
Chris@62 135