# HG changeset patch # User Chris Cannam # Date 1143139337 0 # Node ID 10bcd53ddc71af74d15227ab7a98e63c5a311aff # Parent fb02fe13ff4778cbedd57570710308e0e89b1978 * Add icon for playback plugin edit button * Make playback plugins respond to parameter & program changes while their edit dialog is still visible diff -r fb02fe13ff47 -r 10bcd53ddc71 widgets/PluginParameterBox.cpp --- a/widgets/PluginParameterBox.cpp Thu Mar 23 15:49:41 2006 +0000 +++ b/widgets/PluginParameterBox.cpp Thu Mar 23 18:42:17 2006 +0000 @@ -192,6 +192,8 @@ } m_plugin->setParameter(name.toStdString(), newValue); + + emit pluginConfigurationChanged(m_plugin->toXmlString()); } void @@ -209,6 +211,8 @@ if (state) m_plugin->setParameter(name.toStdString(), 1.0); else m_plugin->setParameter(name.toStdString(), 0.0); + + emit pluginConfigurationChanged(m_plugin->toXmlString()); } void @@ -253,6 +257,8 @@ } m_plugin->setParameter(name.toStdString(), value); + + emit pluginConfigurationChanged(m_plugin->toXmlString()); } void @@ -289,5 +295,7 @@ i->second.dial->blockSignals(false); } } + + emit pluginConfigurationChanged(m_plugin->toXmlString()); } diff -r fb02fe13ff47 -r 10bcd53ddc71 widgets/PluginParameterBox.h --- a/widgets/PluginParameterBox.h Thu Mar 23 15:49:41 2006 +0000 +++ b/widgets/PluginParameterBox.h Thu Mar 23 18:42:17 2006 +0000 @@ -36,6 +36,9 @@ PluginInstance *getPlugin() { return m_plugin; } +signals: + void pluginConfigurationChanged(QString); + protected slots: void dialChanged(int); void spinBoxChanged(double); diff -r fb02fe13ff47 -r 10bcd53ddc71 widgets/PluginParameterDialog.cpp --- a/widgets/PluginParameterDialog.cpp Thu Mar 23 15:49:41 2006 +0000 +++ b/widgets/PluginParameterDialog.cpp Thu Mar 23 18:42:17 2006 +0000 @@ -88,6 +88,8 @@ paramBox->setLayout(paramLayout); m_parameterBox = new PluginParameterBox(m_plugin); + connect(m_parameterBox, SIGNAL(pluginConfigurationChanged(QString)), + this, SIGNAL(pluginConfigurationChanged(QString))); paramLayout->addWidget(m_parameterBox); QHBoxLayout *hbox = new QHBoxLayout; diff -r fb02fe13ff47 -r 10bcd53ddc71 widgets/PluginParameterDialog.h --- a/widgets/PluginParameterDialog.h Thu Mar 23 15:49:41 2006 +0000 +++ b/widgets/PluginParameterDialog.h Thu Mar 23 18:42:17 2006 +0000 @@ -39,6 +39,9 @@ PluginInstance *getPlugin() { return m_plugin; } +signals: + void pluginConfigurationChanged(QString); + protected: PluginInstance *m_plugin; PluginParameterBox *m_parameterBox; diff -r fb02fe13ff47 -r 10bcd53ddc71 widgets/PropertyBox.cpp --- a/widgets/PropertyBox.cpp Thu Mar 23 15:49:41 2006 +0000 +++ b/widgets/PropertyBox.cpp Thu Mar 23 18:42:17 2006 +0000 @@ -154,7 +154,9 @@ layout->insertStretch(-1, 10); if (params->getPlayPluginId() != "") { - QPushButton *pluginButton = new QPushButton("E"); + QPushButton *pluginButton = new QPushButton(QIcon(":icons/faders.png"), ""); + pluginButton->setFixedWidth(24); + pluginButton->setFixedHeight(24); layout->addWidget(pluginButton); connect(pluginButton, SIGNAL(clicked()), this, SLOT(editPlugin())); @@ -486,14 +488,32 @@ instance->setParametersFromXml(configurationXml); PluginParameterDialog *dialog = new PluginParameterDialog(instance); + connect(dialog, SIGNAL(pluginConfigurationChanged(QString)), + this, SLOT(pluginConfigurationChanged(QString))); + if (dialog->exec() == QDialog::Accepted) { params->setPlayPluginConfiguration(instance->toXmlString()); + } else { + // restore in case we mucked about with the configuration + // as a consequence of signals from the dialog + params->setPlayPluginConfiguration(configurationXml); } delete dialog; delete instance; } +void +PropertyBox::pluginConfigurationChanged(QString configurationXml) +{ + PlayParameters *params = m_container->getPlayParameters(); + if (!params) return; + + params->setPlayPluginConfiguration(configurationXml); +} + + + #ifdef INCLUDE_MOCFILES #include "PropertyBox.moc.cpp" #endif diff -r fb02fe13ff47 -r 10bcd53ddc71 widgets/PropertyBox.h --- a/widgets/PropertyBox.h Thu Mar 23 15:49:41 2006 +0000 +++ b/widgets/PropertyBox.h Thu Mar 23 18:42:17 2006 +0000 @@ -45,6 +45,7 @@ public slots: void propertyContainerPropertyChanged(PropertyContainer *); + void pluginConfigurationChanged(QString); protected slots: void propertyControllerChanged(int);