annotate widgets/PluginParameterDialog.h @ 349:369a197737c7

* Various fixes to object lifetime management, particularly in the spectrum layer and for notification of main model deletion. The main purpose of this is to improve the behaviour of the spectrum, but I think it may also help with #1840922 Various crashes in Layer Summary window.
author Chris Cannam
date Wed, 23 Jan 2008 15:43:27 +0000
parents 4a542ba875c2
children 08d6bc698d16
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@302 30 class QCheckBox;
Chris@62 31
Chris@62 32 /**
Chris@62 33 * A dialog for editing the parameters of a given plugin, using a
Chris@62 34 * PluginParameterBox. This dialog does not contain any mechanism for
Chris@62 35 * selecting the plugin in the first place. Note that the dialog
Chris@62 36 * directly modifies the parameters of the plugin, so they will remain
Chris@62 37 * modified even if the dialog is then cancelled.
Chris@62 38 */
Chris@62 39
Chris@62 40 class PluginParameterDialog : public QDialog
Chris@62 41 {
Chris@62 42 Q_OBJECT
Chris@62 43
Chris@62 44 public:
Chris@163 45 PluginParameterDialog(Vamp::PluginBase *, QWidget *parent = 0);
Chris@62 46 ~PluginParameterDialog();
Chris@62 47
Chris@163 48 void setChannelArrangement(int sourceChannels,
Chris@163 49 int targetChannels,
Chris@163 50 int defaultChannel);
Chris@163 51
Chris@208 52 void setOutputLabel(QString output, QString description);
Chris@163 53
Chris@163 54 void setShowProcessingOptions(bool showWindowSize,
Chris@163 55 bool showFrequencyDomainOptions);
Chris@163 56
Chris@336 57 void setCandidateInputModels(const QStringList &names,
Chris@336 58 QString defaultName);
Chris@302 59 void setShowSelectionOnlyOption(bool show);
Chris@164 60
Chris@71 61 Vamp::PluginBase *getPlugin() { return m_plugin; }
Chris@62 62
Chris@69 63 int getChannel() const { return m_channel; }
Chris@69 64
Chris@164 65 QString getInputModel() const;
Chris@302 66 bool getSelectionOnly() const;
Chris@164 67
Chris@146 68 //!!! merge with PluginTransform::ExecutionContext
Chris@146 69
Chris@145 70 void getProcessingParameters(size_t &blockSize) const;
Chris@145 71 void getProcessingParameters(size_t &stepSize, size_t &blockSize,
Chris@145 72 WindowType &windowType) const;
Chris@145 73
Chris@64 74 signals:
Chris@64 75 void pluginConfigurationChanged(QString);
Chris@164 76 void inputModelChanged(QString);
Chris@64 77
Chris@69 78 protected slots:
Chris@69 79 void channelComboChanged(int);
Chris@155 80 void blockSizeComboChanged(const QString &);
Chris@155 81 void incrementComboChanged(const QString &);
Chris@145 82 void windowTypeChanged(WindowType type);
Chris@143 83 void advancedToggled();
Chris@163 84 void setAdvancedVisible(bool);
Chris@294 85 void inputModelComboChanged(int);
Chris@302 86 void selectionOnlyChanged(int);
Chris@294 87 void dialogAccepted();
Chris@69 88
Chris@62 89 protected:
Chris@71 90 Vamp::PluginBase *m_plugin;
Chris@163 91
Chris@69 92 int m_channel;
Chris@145 93 size_t m_stepSize;
Chris@145 94 size_t m_blockSize;
Chris@163 95
Chris@145 96 WindowType m_windowType;
Chris@62 97 PluginParameterBox *m_parameterBox;
Chris@163 98
Chris@163 99 QLabel *m_outputLabel;
Chris@163 100 QLabel *m_outputValue;
Chris@208 101 QLabel *m_outputDescription;
Chris@208 102 QLabel *m_outputSpacer;
Chris@164 103
Chris@163 104 QGroupBox *m_channelBox;
Chris@163 105 bool m_haveChannelBoxData;
Chris@164 106
Chris@163 107 QGroupBox *m_windowBox;
Chris@163 108 bool m_haveWindowBoxData;
Chris@163 109
Chris@164 110 QGroupBox *m_inputModelBox;
Chris@164 111 QComboBox *m_inputModels;
Chris@302 112 QCheckBox *m_selectionOnly;
Chris@294 113 QStringList m_inputModelList;
Chris@296 114 QString m_currentInputModel;
Chris@302 115 bool m_currentSelectionOnly;
Chris@164 116
Chris@143 117 QPushButton *m_advancedButton;
Chris@143 118 QWidget *m_advanced;
Chris@163 119 bool m_advancedVisible;
Chris@62 120 };
Chris@62 121
Chris@62 122 #endif
Chris@62 123