annotate widgets/PluginParameterDialog.h @ 163:dd6dd983e8ef

* Tidy up plugin parameter dialog by switching it to a simple constructor with separate methods for passing in the additional options if necessary * Fix sizing problem on advanced pane toggle in plugin parameter dialog * Make a start on passing in list of candidate input models for transform
author Chris Cannam
date Wed, 11 Oct 2006 16:18:51 +0000
parents 8c730f49b9b3
children 11949d0b2739
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@62 7 This file copyright 2006 Chris Cannam.
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@62 29
Chris@62 30 /**
Chris@62 31 * A dialog for editing the parameters of a given plugin, using a
Chris@62 32 * PluginParameterBox. This dialog does not contain any mechanism for
Chris@62 33 * selecting the plugin in the first place. Note that the dialog
Chris@62 34 * directly modifies the parameters of the plugin, so they will remain
Chris@62 35 * modified even if the dialog is then cancelled.
Chris@62 36 */
Chris@62 37
Chris@62 38 class PluginParameterDialog : public QDialog
Chris@62 39 {
Chris@62 40 Q_OBJECT
Chris@62 41
Chris@62 42 public:
Chris@163 43 PluginParameterDialog(Vamp::PluginBase *, QWidget *parent = 0);
Chris@62 44 ~PluginParameterDialog();
Chris@62 45
Chris@163 46 void setChannelArrangement(int sourceChannels,
Chris@163 47 int targetChannels,
Chris@163 48 int defaultChannel);
Chris@163 49
Chris@163 50 void setOutputLabel(QString output);
Chris@163 51
Chris@163 52 void setShowProcessingOptions(bool showWindowSize,
Chris@163 53 bool showFrequencyDomainOptions);
Chris@163 54
Chris@71 55 Vamp::PluginBase *getPlugin() { return m_plugin; }
Chris@62 56
Chris@69 57 int getChannel() const { return m_channel; }
Chris@69 58
Chris@146 59 //!!! merge with PluginTransform::ExecutionContext
Chris@146 60
Chris@145 61 void getProcessingParameters(size_t &blockSize) const;
Chris@145 62 void getProcessingParameters(size_t &stepSize, size_t &blockSize,
Chris@145 63 WindowType &windowType) const;
Chris@145 64
Chris@64 65 signals:
Chris@64 66 void pluginConfigurationChanged(QString);
Chris@64 67
Chris@69 68 protected slots:
Chris@69 69 void channelComboChanged(int);
Chris@155 70 void blockSizeComboChanged(const QString &);
Chris@155 71 void incrementComboChanged(const QString &);
Chris@145 72 void windowTypeChanged(WindowType type);
Chris@143 73 void advancedToggled();
Chris@163 74 void setAdvancedVisible(bool);
Chris@69 75
Chris@62 76 protected:
Chris@71 77 Vamp::PluginBase *m_plugin;
Chris@163 78
Chris@69 79 int m_channel;
Chris@145 80 size_t m_stepSize;
Chris@145 81 size_t m_blockSize;
Chris@163 82
Chris@145 83 WindowType m_windowType;
Chris@62 84 PluginParameterBox *m_parameterBox;
Chris@163 85
Chris@163 86 QLabel *m_outputLabel;
Chris@163 87 QLabel *m_outputValue;
Chris@163 88 QGroupBox *m_channelBox;
Chris@163 89 bool m_haveChannelBoxData;
Chris@163 90 QGroupBox *m_windowBox;
Chris@163 91 bool m_haveWindowBoxData;
Chris@163 92
Chris@143 93 QPushButton *m_advancedButton;
Chris@143 94 QWidget *m_advanced;
Chris@163 95 bool m_advancedVisible;
Chris@62 96 };
Chris@62 97
Chris@62 98 #endif
Chris@62 99