From 3ba644457343b3a24bb260e53f8fb608c624580d Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Wed, 2 Mar 2011 20:26:55 +0000 Subject: ladspa plugin: added support for read-only options git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2080 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Effect/ladspa/ladspahost.cpp | 5 ++++- src/plugins/Effect/ladspa/ladspahost.h | 5 +++-- src/plugins/Effect/ladspa/settingsdialog.cpp | 8 ++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/plugins/Effect/ladspa/ladspahost.cpp b/src/plugins/Effect/ladspa/ladspahost.cpp index 4dcbd8440..29500e349 100644 --- a/src/plugins/Effect/ladspa/ladspahost.cpp +++ b/src/plugins/Effect/ladspa/ladspahost.cpp @@ -539,7 +539,10 @@ void LADSPAHost::initialize(LADSPAEffect *instance) start = min * 0.5f + max * 0.5f; instance->knobs[k] = start; - c->type = LADSPAControl::SLIDER; + if(LADSPA_IS_PORT_OUTPUT(plugin->PortDescriptors[k])) + c->type = LADSPAControl::LABEL; + else + c->type = LADSPAControl::SLIDER; c->min = min; c->max = max; c->step = step; diff --git a/src/plugins/Effect/ladspa/ladspahost.h b/src/plugins/Effect/ladspa/ladspahost.h index 9d65f0f49..1fb7af373 100644 --- a/src/plugins/Effect/ladspa/ladspahost.h +++ b/src/plugins/Effect/ladspa/ladspahost.h @@ -51,13 +51,14 @@ public: enum Type { BUTTON = 0, - SLIDER + SLIDER, + LABEL }; double min; double max; double step; LADSPA_Data *value; - bool type; + int type; QString name; }; diff --git a/src/plugins/Effect/ladspa/settingsdialog.cpp b/src/plugins/Effect/ladspa/settingsdialog.cpp index a78fa8c5a..95a989069 100644 --- a/src/plugins/Effect/ladspa/settingsdialog.cpp +++ b/src/plugins/Effect/ladspa/settingsdialog.cpp @@ -98,6 +98,7 @@ void SettingsDialog::on_configureButton_clicked() QFormLayout *formLayout = new QFormLayout(dialog); LADSPAButton *button = 0; LADSPASlider *slider = 0; + QLabel *label = 0; foreach(LADSPAControl *c, effect->controls) { @@ -111,6 +112,13 @@ void SettingsDialog::on_configureButton_clicked() case LADSPAControl::SLIDER: slider = new LADSPASlider(c->min, c->max, c->step, c->value, dialog); formLayout->addRow(c->name, slider); + break; + case LADSPAControl::LABEL: + label = new QLabel(this); + label->setText(QString("%1").arg(*c->value)); + label->setFrameStyle(QFrame::StyledPanel); + label->setFrameShadow(QFrame::Sunken); + formLayout->addRow(c->name, label); } } if (effect->controls.isEmpty()) -- cgit v1.2.3-13-gbd6f