annotate widgets/PluginParameterDialog.h @ 294:919740b20cc9

* Better abbreviation modes for layer names in pane (and input model combo of plugin parameter dialog) * Avoid crash when loading SV file containing model derived from nonexistent model (shouldn't happen of course, but see bug #1771769) * Remember last-used input model in plugin parameter dialog * Don't override a layer colour loaded from a session file with the generated default colour when attaching it to a view
author Chris Cannam
date Fri, 10 Aug 2007 16:36:50 +0000
parents 8495187c13ce
children ea37c229a578
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@62 16 #ifndef _PLUGIN_PARAMETER_DIALOG_H_
Chris@62 17 #define _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@71 23 namespace Vamp { class PluginBase; }
Chris@62 24 class PluginParameterBox;
Chris@143 25 class QWidget;
Chris@143 26 class QPushButton;
Chris@163 27 class QLabel;
Chris@163 28 class QGroupBox;
Chris@164 29 class QComboBox;
Chris@62 30
Chris@62 31 /**
Chris@62 32 * A dialog for editing the parameters of a given plugin, using a
Chris@62 33 * PluginParameterBox. This dialog does not contain any mechanism for
Chris@62 34 * selecting the plugin in the first place. Note that the dialog
Chris@62 35 * directly modifies the parameters of the plugin, so they will remain
Chris@62 36 * modified even if the dialog is then cancelled.
Chris@62 37 */
Chris@62 38
Chris@62 39 class PluginParameterDialog : public QDialog
Chris@62 40 {
Chris@62 41 Q_OBJECT
Chris@62 42
Chris@62 43 public:
Chris@163 44 PluginParameterDialog(Vamp::PluginBase *, QWidget *parent = 0);
Chris@62 45 ~PluginParameterDialog();
Chris@62 46
Chris@163 47 void setChannelArrangement(int sourceChannels,
Chris@163 48 int targetChannels,
Chris@163 49 int defaultChannel);
Chris@163 50
Chris@208 51 void setOutputLabel(QString output, QString description);
Chris@163 52
Chris@163 53 void setShowProcessingOptions(bool showWindowSize,
Chris@163 54 bool showFrequencyDomainOptions);
Chris@163 55
Chris@164 56 void setCandidateInputModels(const QStringList &names);
Chris@164 57
Chris@71 58 Vamp::PluginBase *getPlugin() { return m_plugin; }
Chris@62 59
Chris@69 60 int getChannel() const { return m_channel; }
Chris@69 61
Chris@164 62 QString getInputModel() const;
Chris@164 63
Chris@146 64 //!!! merge with PluginTransform::ExecutionContext
Chris@146 65
Chris@145 66 void getProcessingParameters(size_t &blockSize) const;
Chris@145 67 void getProcessingParameters(size_t &stepSize, size_t &blockSize,
Chris@145 68 WindowType &windowType) const;
Chris@145 69
Chris@64 70 signals:
Chris@64 71 void pluginConfigurationChanged(QString);
Chris@164 72 void inputModelChanged(QString);
Chris@64 73
Chris@69 74 protected slots:
Chris@69 75 void channelComboChanged(int);
Chris@155 76 void blockSizeComboChanged(const QString &);
Chris@155 77 void incrementComboChanged(const QString &);
Chris@145 78 void windowTypeChanged(WindowType type);
Chris@143 79 void advancedToggled();
Chris@163 80 void setAdvancedVisible(bool);
Chris@294 81 void inputModelComboChanged(int);
Chris@294 82 void dialogAccepted();
Chris@69 83
Chris@62 84 protected:
Chris@71 85 Vamp::PluginBase *m_plugin;
Chris@163 86
Chris@69 87 int m_channel;
Chris@145 88 size_t m_stepSize;
Chris@145 89 size_t m_blockSize;
Chris@163 90
Chris@145 91 WindowType m_windowType;
Chris@62 92 PluginParameterBox *m_parameterBox;
Chris@163 93
Chris@163 94 QLabel *m_outputLabel;
Chris@163 95 QLabel *m_outputValue;
Chris@208 96 QLabel *m_outputDescription;
Chris@208 97 QLabel *m_outputSpacer;
Chris@164 98
Chris@163 99 QGroupBox *m_channelBox;
Chris@163 100 bool m_haveChannelBoxData;
Chris@164 101
Chris@163 102 QGroupBox *m_windowBox;
Chris@163 103 bool m_haveWindowBoxData;
Chris@163 104
Chris@164 105 QGroupBox *m_inputModelBox;
Chris@164 106 QComboBox *m_inputModels;
Chris@294 107 QStringList m_inputModelList;
Chris@164 108
Chris@143 109 QPushButton *m_advancedButton;
Chris@143 110 QWidget *m_advanced;
Chris@163 111 bool m_advancedVisible;
Chris@62 112 };
Chris@62 113
Chris@62 114 #endif
Chris@62 115