diff options
17 files changed, 124 insertions, 44 deletions
diff --git a/src/plugins/Effect/ladspa/CMakeLists.txt b/src/plugins/Effect/ladspa/CMakeLists.txt index 6df10d924..f0bc14d33 100644 --- a/src/plugins/Effect/ladspa/CMakeLists.txt +++ b/src/plugins/Effect/ladspa/CMakeLists.txt @@ -29,6 +29,7 @@ SET(libladspa_SRCS ladspahost.cpp ladspahelper.cpp ladspaslider.cpp + ladspabutton.cpp settingsdialog.cpp effectladspafactory.cpp ) @@ -37,6 +38,7 @@ SET(libladspa_MOC_HDRS ladspahost.h ladspahelper.h ladspaslider.h + ladspabutton.h settingsdialog.h effectladspafactory.h ) diff --git a/src/plugins/Effect/ladspa/ladspa.pro b/src/plugins/Effect/ladspa/ladspa.pro index d942dc0b0..163a1efd1 100644 --- a/src/plugins/Effect/ladspa/ladspa.pro +++ b/src/plugins/Effect/ladspa/ladspa.pro @@ -4,12 +4,14 @@ HEADERS += ladspahost.h \ settingsdialog.h \ ladspaslider.h \ ladspa.h \ - ladspahelper.h + ladspahelper.h \ + ladspabutton.h SOURCES += ladspahost.cpp \ effectladspafactory.cpp \ settingsdialog.cpp \ ladspaslider.cpp \ - ladspahelper.cpp + ladspahelper.cpp \ + ladspabutton.cpp TARGET = $$PLUGINS_PREFIX/Effect/ladspa QMAKE_CLEAN = $$PLUGINS_PREFIX/Effect/libladspa.so INCLUDEPATH += ../../../ @@ -32,7 +34,6 @@ TRANSLATIONS = translations/ladspa_plugin_cs.ts \ translations/ladspa_plugin_it.ts \ translations/ladspa_plugin_tr.ts \ translations/ladspa_plugin_lt.ts - RESOURCES = translations/translations.qrc isEmpty(LIB_DIR):LIB_DIR = /lib target.path = $$LIB_DIR/qmmp/Effect diff --git a/src/plugins/Effect/ladspa/ladspabutton.cpp b/src/plugins/Effect/ladspa/ladspabutton.cpp new file mode 100644 index 000000000..2d78a2c4b --- /dev/null +++ b/src/plugins/Effect/ladspa/ladspabutton.cpp @@ -0,0 +1,33 @@ +/*************************************************************************** + * Copyright (C) 2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "ladspabutton.h" + +LADSPAButton::LADSPAButton(LADSPA_Data *value, QWidget *parent) : QCheckBox(parent) +{ + m_value = value; + setChecked(*value == 1.0); + connect(this, SIGNAL(clicked (bool)), SLOT(enable(bool))); +} + +void LADSPAButton::enable(bool yes) +{ + *m_value = yes ? 1.0 : 0.0; +} diff --git a/src/plugins/Effect/ladspa/ladspabutton.h b/src/plugins/Effect/ladspa/ladspabutton.h new file mode 100644 index 000000000..be35c3562 --- /dev/null +++ b/src/plugins/Effect/ladspa/ladspabutton.h @@ -0,0 +1,45 @@ +/*************************************************************************** + * Copyright (C) 2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef LADSPABUTTON_H +#define LADSPABUTTON_H + +#include <QCheckBox> +#include "ladspa.h" + +class LADSPAHost; + +/** + @author Ilya Kotov <forkotov02@hotmail.ru> +*/ +class LADSPAButton : public QCheckBox +{ +Q_OBJECT +public: + LADSPAButton(LADSPA_Data *value, QWidget *parent = 0); + +private slots: + void enable(bool yes); + +private: + LADSPA_Data *m_value; +}; + +#endif // LADSPABUTTON_H diff --git a/src/plugins/Effect/ladspa/ladspaslider.cpp b/src/plugins/Effect/ladspa/ladspaslider.cpp index 87e3c01f2..2c9ecf6c4 100644 --- a/src/plugins/Effect/ladspa/ladspaslider.cpp +++ b/src/plugins/Effect/ladspa/ladspaslider.cpp @@ -18,20 +18,17 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ - #include <QDoubleSpinBox> #include <QSlider> #include <QHBoxLayout> -#include "ladspahost.h" #include "ladspaslider.h" -LADSPASlider::LADSPASlider(double min, double max, double step, LADSPA_Data *value, - LADSPAHost *host, QWidget *parent) : QWidget(parent) +LADSPASlider::LADSPASlider(double min, double max, double step, + LADSPA_Data *value, QWidget *parent) : QWidget(parent) { m_min = min; m_max = max; m_step = step; - m_host = host; m_value = value; m_slider = new QSlider(Qt::Horizontal, this); m_spinBox = new QDoubleSpinBox(this); diff --git a/src/plugins/Effect/ladspa/ladspaslider.h b/src/plugins/Effect/ladspa/ladspaslider.h index a7290581a..0bdf6f933 100644 --- a/src/plugins/Effect/ladspa/ladspaslider.h +++ b/src/plugins/Effect/ladspa/ladspaslider.h @@ -25,7 +25,6 @@ class QDoubleSpinBox; class QSlider; -class LADSPAHost; /** @author Ilya Kotov <forkotov02@hotmail.ru> @@ -38,7 +37,6 @@ public: double max, double step, LADSPA_Data *value, - LADSPAHost *host, QWidget *parent = 0); private slots: @@ -52,8 +50,6 @@ private: double m_min; double m_max; double m_step; - LADSPAHost *m_host; - }; #endif // LADSPASLIDER_H diff --git a/src/plugins/Effect/ladspa/settingsdialog.cpp b/src/plugins/Effect/ladspa/settingsdialog.cpp index 0bfb50247..fec394d3f 100644 --- a/src/plugins/Effect/ladspa/settingsdialog.cpp +++ b/src/plugins/Effect/ladspa/settingsdialog.cpp @@ -27,6 +27,7 @@ #include <QLabel> #include <qmmp/qmmp.h> #include "ladspaslider.h" +#include "ladspabutton.h" #include "ladspahost.h" #include "settingsdialog.h" @@ -95,16 +96,21 @@ void SettingsDialog::on_configureButton_clicked() QDialog *dialog = new QDialog(this); dialog->setWindowTitle(effect->descriptor->Name); QFormLayout *formLayout = new QFormLayout(dialog); + LADSPAButton *button = 0; + LADSPASlider *slider = 0; foreach(LADSPAControl *c, effect->controls) { switch ((int) c->type) { case LADSPAControl::BUTTON: + button = new LADSPAButton(c->value, dialog); + button->setText(c->name); + formLayout->addRow(button); break; case LADSPAControl::SLIDER: - LADSPASlider *slider = new LADSPASlider(c->min, c->max, c->step, c->value, l, dialog); - formLayout->addRow(c->name, slider); + slider = new LADSPASlider(c->min, c->max, c->step, c->value, dialog); + formLayout->addRow(c->name, slider); } } if (effect->controls.isEmpty()) diff --git a/src/plugins/Effect/ladspa/translations/ladspa_plugin_cs.ts b/src/plugins/Effect/ladspa/translations/ladspa_plugin_cs.ts index c70657678..24e47a156 100644 --- a/src/plugins/Effect/ladspa/translations/ladspa_plugin_cs.ts +++ b/src/plugins/Effect/ladspa/translations/ladspa_plugin_cs.ts @@ -47,17 +47,17 @@ <context> <name>SettingsDialog</name> <message> - <location filename="../settingsdialog.cpp" line="42"/> + <location filename="../settingsdialog.cpp" line="43"/> <source>UID</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../settingsdialog.cpp" line="43"/> + <location filename="../settingsdialog.cpp" line="44"/> <source>Name</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../settingsdialog.cpp" line="112"/> + <location filename="../settingsdialog.cpp" line="118"/> <source>This LADSPA plugin has no user controls</source> <translation type="unfinished"></translation> </message> diff --git a/src/plugins/Effect/ladspa/translations/ladspa_plugin_de.ts b/src/plugins/Effect/ladspa/translations/ladspa_plugin_de.ts index c70657678..24e47a156 100644 --- a/src/plugins/Effect/ladspa/translations/ladspa_plugin_de.ts +++ b/src/plugins/Effect/ladspa/translations/ladspa_plugin_de.ts @@ -47,17 +47,17 @@ <context> <name>SettingsDialog</name> <message> - <location filename="../settingsdialog.cpp" line="42"/> + <location filename="../settingsdialog.cpp" line="43"/> <source>UID</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../settingsdialog.cpp" line="43"/> + <location filename="../settingsdialog.cpp" line="44"/> <source>Name</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../settingsdialog.cpp" line="112"/> + <location filename="../settingsdialog.cpp" line="118"/> <source>This LADSPA plugin has no user controls</source> <translation type="unfinished"></translation> </message> diff --git a/src/plugins/Effect/ladspa/translations/ladspa_plugin_it.ts b/src/plugins/Effect/ladspa/translations/ladspa_plugin_it.ts index 3c53620e9..073956ba6 100644 --- a/src/plugins/Effect/ladspa/translations/ladspa_plugin_it.ts +++ b/src/plugins/Effect/ladspa/translations/ladspa_plugin_it.ts @@ -47,17 +47,17 @@ <context> <name>SettingsDialog</name> <message> - <location filename="../settingsdialog.cpp" line="42"/> + <location filename="../settingsdialog.cpp" line="43"/> <source>UID</source> <translation>UID</translation> </message> <message> - <location filename="../settingsdialog.cpp" line="43"/> + <location filename="../settingsdialog.cpp" line="44"/> <source>Name</source> <translation>Nome</translation> </message> <message> - <location filename="../settingsdialog.cpp" line="112"/> + <location filename="../settingsdialog.cpp" line="118"/> <source>This LADSPA plugin has no user controls</source> <translation>QUesot plugin LADSPA non ha controlli</translation> </message> diff --git a/src/plugins/Effect/ladspa/translations/ladspa_plugin_lt.ts b/src/plugins/Effect/ladspa/translations/ladspa_plugin_lt.ts index c41637d06..19489a42d 100644 --- a/src/plugins/Effect/ladspa/translations/ladspa_plugin_lt.ts +++ b/src/plugins/Effect/ladspa/translations/ladspa_plugin_lt.ts @@ -47,17 +47,17 @@ <context> <name>SettingsDialog</name> <message> - <location filename="../settingsdialog.cpp" line="42"/> + <location filename="../settingsdialog.cpp" line="43"/> <source>UID</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../settingsdialog.cpp" line="43"/> + <location filename="../settingsdialog.cpp" line="44"/> <source>Name</source> <translation>Pavadinimas</translation> </message> <message> - <location filename="../settingsdialog.cpp" line="112"/> + <location filename="../settingsdialog.cpp" line="118"/> <source>This LADSPA plugin has no user controls</source> <translation>Šis LADSPA įskiepis neturi nustatymų</translation> </message> diff --git a/src/plugins/Effect/ladspa/translations/ladspa_plugin_pl.ts b/src/plugins/Effect/ladspa/translations/ladspa_plugin_pl.ts index 933b9c5b5..ceb2b5985 100644 --- a/src/plugins/Effect/ladspa/translations/ladspa_plugin_pl.ts +++ b/src/plugins/Effect/ladspa/translations/ladspa_plugin_pl.ts @@ -47,17 +47,17 @@ <context> <name>SettingsDialog</name> <message> - <location filename="../settingsdialog.cpp" line="42"/> + <location filename="../settingsdialog.cpp" line="43"/> <source>UID</source> <translation></translation> </message> <message> - <location filename="../settingsdialog.cpp" line="43"/> + <location filename="../settingsdialog.cpp" line="44"/> <source>Name</source> <translation>Nazwa</translation> </message> <message> - <location filename="../settingsdialog.cpp" line="112"/> + <location filename="../settingsdialog.cpp" line="118"/> <source>This LADSPA plugin has no user controls</source> <translation>Ta wtyczka LADSPA nie posiada panelu sterowania</translation> </message> diff --git a/src/plugins/Effect/ladspa/translations/ladspa_plugin_ru.ts b/src/plugins/Effect/ladspa/translations/ladspa_plugin_ru.ts index 4dc654e6c..5d96c7d01 100644 --- a/src/plugins/Effect/ladspa/translations/ladspa_plugin_ru.ts +++ b/src/plugins/Effect/ladspa/translations/ladspa_plugin_ru.ts @@ -47,17 +47,17 @@ <context> <name>SettingsDialog</name> <message> - <location filename="../settingsdialog.cpp" line="42"/> + <location filename="../settingsdialog.cpp" line="43"/> <source>UID</source> <translation>UID</translation> </message> <message> - <location filename="../settingsdialog.cpp" line="43"/> + <location filename="../settingsdialog.cpp" line="44"/> <source>Name</source> <translation>Имя</translation> </message> <message> - <location filename="../settingsdialog.cpp" line="112"/> + <location filename="../settingsdialog.cpp" line="118"/> <source>This LADSPA plugin has no user controls</source> <translation>Этот модуль не содержит настроек</translation> </message> diff --git a/src/plugins/Effect/ladspa/translations/ladspa_plugin_tr.ts b/src/plugins/Effect/ladspa/translations/ladspa_plugin_tr.ts index c70657678..24e47a156 100644 --- a/src/plugins/Effect/ladspa/translations/ladspa_plugin_tr.ts +++ b/src/plugins/Effect/ladspa/translations/ladspa_plugin_tr.ts @@ -47,17 +47,17 @@ <context> <name>SettingsDialog</name> <message> - <location filename="../settingsdialog.cpp" line="42"/> + <location filename="../settingsdialog.cpp" line="43"/> <source>UID</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../settingsdialog.cpp" line="43"/> + <location filename="../settingsdialog.cpp" line="44"/> <source>Name</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../settingsdialog.cpp" line="112"/> + <location filename="../settingsdialog.cpp" line="118"/> <source>This LADSPA plugin has no user controls</source> <translation type="unfinished"></translation> </message> diff --git a/src/plugins/Effect/ladspa/translations/ladspa_plugin_uk_UA.ts b/src/plugins/Effect/ladspa/translations/ladspa_plugin_uk_UA.ts index 428ea48b3..a1de4976f 100644 --- a/src/plugins/Effect/ladspa/translations/ladspa_plugin_uk_UA.ts +++ b/src/plugins/Effect/ladspa/translations/ladspa_plugin_uk_UA.ts @@ -47,17 +47,17 @@ <context> <name>SettingsDialog</name> <message> - <location filename="../settingsdialog.cpp" line="42"/> + <location filename="../settingsdialog.cpp" line="43"/> <source>UID</source> <translation>UID</translation> </message> <message> - <location filename="../settingsdialog.cpp" line="43"/> + <location filename="../settingsdialog.cpp" line="44"/> <source>Name</source> <translation>Ім'я</translation> </message> <message> - <location filename="../settingsdialog.cpp" line="112"/> + <location filename="../settingsdialog.cpp" line="118"/> <source>This LADSPA plugin has no user controls</source> <translation>Цей модуль не містить налаштувань</translation> </message> diff --git a/src/plugins/Effect/ladspa/translations/ladspa_plugin_zh_CN.ts b/src/plugins/Effect/ladspa/translations/ladspa_plugin_zh_CN.ts index c70657678..24e47a156 100644 --- a/src/plugins/Effect/ladspa/translations/ladspa_plugin_zh_CN.ts +++ b/src/plugins/Effect/ladspa/translations/ladspa_plugin_zh_CN.ts @@ -47,17 +47,17 @@ <context> <name>SettingsDialog</name> <message> - <location filename="../settingsdialog.cpp" line="42"/> + <location filename="../settingsdialog.cpp" line="43"/> <source>UID</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../settingsdialog.cpp" line="43"/> + <location filename="../settingsdialog.cpp" line="44"/> <source>Name</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../settingsdialog.cpp" line="112"/> + <location filename="../settingsdialog.cpp" line="118"/> <source>This LADSPA plugin has no user controls</source> <translation type="unfinished"></translation> </message> diff --git a/src/plugins/Effect/ladspa/translations/ladspa_plugin_zh_TW.ts b/src/plugins/Effect/ladspa/translations/ladspa_plugin_zh_TW.ts index c70657678..24e47a156 100644 --- a/src/plugins/Effect/ladspa/translations/ladspa_plugin_zh_TW.ts +++ b/src/plugins/Effect/ladspa/translations/ladspa_plugin_zh_TW.ts @@ -47,17 +47,17 @@ <context> <name>SettingsDialog</name> <message> - <location filename="../settingsdialog.cpp" line="42"/> + <location filename="../settingsdialog.cpp" line="43"/> <source>UID</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../settingsdialog.cpp" line="43"/> + <location filename="../settingsdialog.cpp" line="44"/> <source>Name</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../settingsdialog.cpp" line="112"/> + <location filename="../settingsdialog.cpp" line="118"/> <source>This LADSPA plugin has no user controls</source> <translation type="unfinished"></translation> </message> |
