From c315a1c3c34d4fa8652ff7250dd9460de9b5e0c5 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Mon, 4 Jan 2010 18:30:22 +0000 Subject: ladspa host plugin: added buttons git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1481 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Effect/ladspa/CMakeLists.txt | 2 + src/plugins/Effect/ladspa/ladspa.pro | 7 ++-- src/plugins/Effect/ladspa/ladspabutton.cpp | 33 ++++++++++++++++ src/plugins/Effect/ladspa/ladspabutton.h | 45 ++++++++++++++++++++++ src/plugins/Effect/ladspa/ladspaslider.cpp | 7 +--- src/plugins/Effect/ladspa/ladspaslider.h | 4 -- src/plugins/Effect/ladspa/settingsdialog.cpp | 10 ++++- .../Effect/ladspa/translations/ladspa_plugin_cs.ts | 6 +-- .../Effect/ladspa/translations/ladspa_plugin_de.ts | 6 +-- .../Effect/ladspa/translations/ladspa_plugin_it.ts | 6 +-- .../Effect/ladspa/translations/ladspa_plugin_lt.ts | 6 +-- .../Effect/ladspa/translations/ladspa_plugin_pl.ts | 6 +-- .../Effect/ladspa/translations/ladspa_plugin_ru.ts | 6 +-- .../Effect/ladspa/translations/ladspa_plugin_tr.ts | 6 +-- .../ladspa/translations/ladspa_plugin_uk_UA.ts | 6 +-- .../ladspa/translations/ladspa_plugin_zh_CN.ts | 6 +-- .../ladspa/translations/ladspa_plugin_zh_TW.ts | 6 +-- 17 files changed, 124 insertions(+), 44 deletions(-) create mode 100644 src/plugins/Effect/ladspa/ladspabutton.cpp create mode 100644 src/plugins/Effect/ladspa/ladspabutton.h 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 +#include "ladspa.h" + +class LADSPAHost; + +/** + @author Ilya Kotov +*/ +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 #include #include -#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 @@ -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 #include #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 @@ SettingsDialog - + UID - + Name - + This LADSPA plugin has no user controls 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 @@ SettingsDialog - + UID - + Name - + This LADSPA plugin has no user controls 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 @@ SettingsDialog - + UID UID - + Name Nome - + This LADSPA plugin has no user controls QUesot plugin LADSPA non ha controlli 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 @@ SettingsDialog - + UID - + Name Pavadinimas - + This LADSPA plugin has no user controls Šis LADSPA įskiepis neturi nustatymų 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 @@ SettingsDialog - + UID - + Name Nazwa - + This LADSPA plugin has no user controls Ta wtyczka LADSPA nie posiada panelu sterowania 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 @@ SettingsDialog - + UID UID - + Name Имя - + This LADSPA plugin has no user controls Этот модуль не содержит настроек 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 @@ SettingsDialog - + UID - + Name - + This LADSPA plugin has no user controls 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 @@ SettingsDialog - + UID UID - + Name Ім'я - + This LADSPA plugin has no user controls Цей модуль не містить налаштувань 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 @@ SettingsDialog - + UID - + Name - + This LADSPA plugin has no user controls 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 @@ SettingsDialog - + UID - + Name - + This LADSPA plugin has no user controls -- cgit v1.2.3-13-gbd6f