diff -Nru abgate-1.1.3/abGateQt/abGateQt.pro abgate-1.1.6/abGateQt/abGateQt.pro --- abgate-1.1.3/abGateQt/abGateQt.pro 1970-01-01 00:00:00.000000000 +0000 +++ abgate-1.1.6/abGateQt/abGateQt.pro 2012-04-20 06:36:47.000000000 +0000 @@ -0,0 +1,27 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2012-04-14T15:06:53 +# +#------------------------------------------------- + +QT += core gui + +CONFIG += shared plugin + +TARGET = abGateQt +TEMPLATE = lib + +SOURCES +=\ + mainwindow.cpp \ + abgatestyle.cpp \ + gate_gui_Qt4.cpp + +HEADERS += mainwindow.h \ + abgatestyle.h \ + ui.h \ + gate_const.h + +FORMS += mainwindow.ui + +RESOURCES += \ + resursas.qrc diff -Nru abgate-1.1.3/abGateQt/abGateQt.pro.user abgate-1.1.6/abGateQt/abGateQt.pro.user --- abgate-1.1.3/abGateQt/abGateQt.pro.user 1970-01-01 00:00:00.000000000 +0000 +++ abgate-1.1.6/abGateQt/abGateQt.pro.user 2012-04-20 07:14:02.000000000 +0000 @@ -0,0 +1,264 @@ + + + + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + System + false + 4 + true + 1 + true + 0 + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.Target.0 + + Desktop + Desktop + Qt4ProjectManager.Target.DesktopTarget + 0 + 0 + 0 + + ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit./usr/bin/gdb + + + qmake + + QtProjectManager.QMakeBuildStep + false + true + + false + + + Make + + Qt4ProjectManager.MakeStep + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + Make + + Qt4ProjectManager.MakeStep + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Qt 4.8.1 in PATH (System) Release + + Qt4ProjectManager.Qt4BuildConfiguration + 0 + /home/antanas/qt programavimas/abGateQt-build + 1 + true + + + ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit./usr/bin/gdb + + + qmake + + QtProjectManager.QMakeBuildStep + false + true + + false + + + Make + + Qt4ProjectManager.MakeStep + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + Make + + Qt4ProjectManager.MakeStep + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Qt 4.8.1 in PATH (System) Debug + + Qt4ProjectManager.Qt4BuildConfiguration + 2 + /home/antanas/qt programavimas/abGateQt-build-desktop-Qt_4_8_1_in_PATH__System__Debug + 1 + true + + 2 + + + 0 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + No deployment + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + true + true + + + false + false + false + false + false + false + false + false + true + true + 0.01 + 0.01 + 10 + 10 + true + true + 25 + 25 + + + true + true + valgrind + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + + 2 + + false + + %{buildDir} + Custom Executable + + ProjectExplorer.CustomExecutableRunConfiguration + 3768 + true + false + false + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.EnvironmentId + {7c74e392-2a0d-4d26-ad25-4269ca1dca54} + + + ProjectExplorer.Project.Updater.FileVersion + 10 + + diff -Nru abgate-1.1.3/abGateQt/abgatestyle.cpp abgate-1.1.6/abGateQt/abgatestyle.cpp --- abgate-1.1.3/abGateQt/abgatestyle.cpp 1970-01-01 00:00:00.000000000 +0000 +++ abgate-1.1.6/abGateQt/abgatestyle.cpp 2012-04-15 05:58:54.000000000 +0000 @@ -0,0 +1,204 @@ +/* abGate Knob Style + * + * Copyright 2012 Antanas Bružas + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include "abgatestyle.h" + +inline int valueAngle(const QStyleOptionSlider *dial) +{ + return -((dial->sliderValue - dial->minimum) * 300 * 16) / (dial->maximum - dial->minimum); +} + +inline void paintArc(QPainter *p, const QStyleOptionSlider *dial) +{ + QColor color_0f0f0f(15, 15, 15); + QColor color_b10a0a(170, 10, 10); + QColor arcColor = (dial->state & QStyle::State_Enabled) ? color_0f0f0f : color_b10a0a; + QLinearGradient linGrad(80, 100, 140, 140); + linGrad.setColorAt(0, arcColor.dark(140)); + linGrad.setColorAt(1, arcColor.light().light()); + linGrad.setSpread(QGradient::PadSpread); + p->setBrush(linGrad); + + p->setPen(QPen(Qt::black, 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); + QRectF rectangle(1, 1, 198, 198); + + int spanAngle = valueAngle(dial); + int startAngle = 240 * 16; + p->drawPie(rectangle, startAngle, spanAngle); +} + +inline void paintDial(QPainter *painter) +{ + // Metal color + QColor color_d0d2c2(208, 210, 194); + // Color for cirles + QColor transparent_black(0, 0, 0, 15); + // Color #1 for plastic bg gradient + QColor color_1b1b1b(27, 27, 27); + // Color #2 for plastic bg gradient + QColor color_63635c(70, 70, 65); + + painter->setPen(Qt::NoPen); + + // Shadow for plastic + QRadialGradient radGrad1(100, 100, 100, 100, 100); + // radGrad1.setColorAt(0, Qt::black); + radGrad1.setColorAt(0.8, Qt::black); + radGrad1.setColorAt(1, Qt::transparent); + painter->setBrush(radGrad1); + painter->drawEllipse(1, 1, 198, 198); + + // Black plastic gradient background + QConicalGradient coneGradient1(100, 100, 135.0); + coneGradient1.setColorAt(0.0, color_1b1b1b); + coneGradient1.setColorAt(0.17, color_63635c); + coneGradient1.setColorAt(0.34, color_1b1b1b); + coneGradient1.setColorAt(0.51, color_63635c); + coneGradient1.setColorAt(0.68, color_1b1b1b); + coneGradient1.setColorAt(0.85, color_63635c); + coneGradient1.setColorAt(1.0, color_1b1b1b); + + painter->setBrush(coneGradient1); + // Drawing plastic gradiented ellipse + painter->drawEllipse(5, 5, 190, 190); + + // Shadow for metal + QRadialGradient radGrad2(100, 100, 60, 100, 100); + radGrad2.setColorAt(0, Qt::black); + radGrad2.setColorAt(1, Qt::transparent); + painter->setBrush(radGrad2); + painter->drawEllipse(40, 40, 120, 120); + + // First metal gradient background + QConicalGradient coneGradient2(100, 100, 90.0); + coneGradient2.setColorAt(0.0, color_d0d2c2); + coneGradient2.setColorAt(0.17, Qt::white); + coneGradient2.setColorAt(0.34, color_d0d2c2); + coneGradient2.setColorAt(0.51, Qt::white); + coneGradient2.setColorAt(0.68, color_d0d2c2); + coneGradient2.setColorAt(0.85, Qt::white); + coneGradient2.setColorAt(1.0, color_d0d2c2); + + painter->setBrush(coneGradient2); + // Drawing first metal gradiented ellipse + painter->drawEllipse(45, 45, 110, 110); + + painter->setBrush(Qt::NoBrush); + painter->setPen(QPen(transparent_black, 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); + // Drawing small circle + painter->drawEllipse(50, 50, 100, 100); + + // Second Metal gradient background + QConicalGradient coneGradient3(100, 100, 135.0); + coneGradient3.setColorAt(0.0, color_d0d2c2); + coneGradient3.setColorAt(0.17, Qt::white); + coneGradient3.setColorAt(0.34, color_d0d2c2); + coneGradient3.setColorAt(0.51, Qt::white); + coneGradient3.setColorAt(0.68, color_d0d2c2); + coneGradient3.setColorAt(0.85, Qt::white); + coneGradient3.setColorAt(1.0, color_d0d2c2); + + painter->setBrush(coneGradient3); + // Drawing second metal gradiented ellipse + painter->drawEllipse(53, 53, 94, 94); +} + +inline void paintDot(QPainter *painter, const QStyleOptionSlider *dial) +{ + int startPoint = (240 * 16) + valueAngle(dial); + QColor color_0f0f0f(15, 15, 15, 150); + QColor color_b10a0a(170, 10, 10, 224); + QPalette pal = dial->palette; + QPen dotPen((dial->state & QStyle::State_Enabled) ? color_b10a0a : pal.mid().color(), 9, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin); + QRect rectangle1(63, 63, 74, 74); + painter->setPen(dotPen); + painter->drawArc(rectangle1, startPoint, 5); + + painter->setPen(QPen(Qt::transparent, 0, Qt::SolidLine, Qt::FlatCap, Qt::RoundJoin)); + // Red pointer gradient + QRadialGradient radGrad1(100, 100, 104, 100, 100); + radGrad1.setColorAt(0.0, Qt::transparent); + radGrad1.setColorAt(0.69, Qt::transparent); + radGrad1.setColorAt(0.7, color_b10a0a); + radGrad1.setColorAt(1.0, color_b10a0a); + painter->setBrush(radGrad1); + painter->drawPie(5, 5, 190, 190, startPoint - 30, 60); + + // Dark pointer gradient + QRadialGradient radGrad2(100, 100, 104, 100, 100); + radGrad2.setColorAt(0.0, Qt::transparent); + radGrad2.setColorAt(0.69, Qt::transparent); + radGrad2.setColorAt(0.7, color_0f0f0f); + radGrad2.setColorAt(1.0, color_0f0f0f); + painter->setBrush(radGrad2); + for (int i = 1; i < 16; ++i) { + painter->drawPie(6, 6, 188, 188, startPoint - 30 - 16 * 22.5 * i, 60); + } + + /*painter->translate(100, 100); + for (int j = 0; j < 16; ++j) { +// if ((j % 5) != 0) + painter->drawLine(74, 0, 93, 0); + painter->rotate(22.5 + valueAngle(dial)); + }*/ +} + +inline void paintScale(QPainter *painter, const QStyleOptionSlider *dial) +{ + if (dial->subControls & QStyle::SC_DialTickmarks) + { + QRect rectangle2(5, 5, 190, 190); + int ns = dial->tickInterval; + int dot = -1 + (dial->maximum + ns - dial->minimum) / ns; //int dot = 25; + double delta = 300.0*16.0 / dot; + painter->setPen(QPen(Qt::black, 5, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); + for (int i = 0; i <= dot; i++) + { + painter->drawArc(rectangle2, int(240*16 - delta*i), 5); + } + } +} + +void abGateStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *widget) const +{ + if (cc != QStyle::CC_Dial) { + QCommonStyle::drawComplexControl(cc, opt, p, widget); + return; + } + + const QStyleOptionSlider *dial = qstyleoption_cast(opt); + if (dial == NULL) { return; } + + p->save(); + int size = dial->rect.width() < dial->rect.height() ? dial->rect.width() : dial->rect.height(); + p->setViewport((dial->rect.width()-size)/2, (dial->rect.height()-size)/2, size, size); + p->setWindow(0, 0, 200, 200); + p->setRenderHint(QPainter::Antialiasing); + +// paintArc(p, dial); + paintScale(p, dial); + paintDial(p); + paintDot(p, dial); + + // done + p->restore(); +} diff -Nru abgate-1.1.3/abGateQt/abgatestyle.h abgate-1.1.6/abGateQt/abgatestyle.h --- abgate-1.1.3/abGateQt/abgatestyle.h 1970-01-01 00:00:00.000000000 +0000 +++ abgate-1.1.6/abGateQt/abgatestyle.h 2012-04-15 13:03:40.000000000 +0000 @@ -0,0 +1,35 @@ +/* abGate Knob Style + * + * Copyright 2012 Antanas Bružas + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef ABGATESTYLE_H +#define ABGATESTYLE_H + +#include + +class abGateStyle : public QCommonStyle +{ +public: + abGateStyle() {} + virtual ~abGateStyle() {} + + virtual void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *widget = 0) const; + +}; + +#endif // ABGATESTYLE_H Binary files /tmp/ki7iO7SG4A/abgate-1.1.3/abGateQt/background.png and /tmp/y2QJFB5Cgm/abgate-1.1.6/abGateQt/background.png differ Binary files /tmp/ki7iO7SG4A/abgate-1.1.3/abGateQt/bypass_off.png and /tmp/y2QJFB5Cgm/abgate-1.1.6/abGateQt/bypass_off.png differ Binary files /tmp/ki7iO7SG4A/abgate-1.1.3/abGateQt/bypass_on.png and /tmp/y2QJFB5Cgm/abgate-1.1.6/abGateQt/bypass_on.png differ diff -Nru abgate-1.1.3/abGateQt/gate_const.h abgate-1.1.6/abGateQt/gate_const.h --- abgate-1.1.3/abGateQt/gate_const.h 1970-01-01 00:00:00.000000000 +0000 +++ abgate-1.1.6/abGateQt/gate_const.h 2012-04-15 11:29:05.000000000 +0000 @@ -0,0 +1,53 @@ +/* abGate - LV2 Noise Gate Plugin + * + * Copyright 2011 Antanas Bružas + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#define p_output 0 +#define p_input 1 +#define p_switch 2 +#define p_threshold 3 +#define p_attack 4 +#define p_hold 5 +#define p_decay 6 +#define p_gaterange 7 +#define p_n_ports 8 + +#define BYPASS_MIN 0 +#define BYPASS_MAX 1 +#define BYPASS_DEFAULT 0 + +#define THRESHOLD_MIN -70 +#define THRESHOLD_MAX 12 +#define THRESHOLD_DEFAULT -70 + +#define ATTACK_MIN 0.1 +#define ATTACK_MAX 500 +#define ATTACK_DEFAULT 30 + +#define HOLD_MIN 5 +#define HOLD_MAX 3000 +#define HOLD_DEFAULT 500 + +#define DECAY_MIN 5 +#define DECAY_MAX 4000 +#define DECAY_DEFAULT 1000 + +#define RANGE_MIN -90 +#define RANGE_MAX -20 +#define RANGE_DEFAULT -90 + +#define p_uri "http://hippie.lt/lv2/gate" diff -Nru abgate-1.1.3/abGateQt/gate_gui_Qt4.cpp abgate-1.1.6/abGateQt/gate_gui_Qt4.cpp --- abgate-1.1.3/abGateQt/gate_gui_Qt4.cpp 1970-01-01 00:00:00.000000000 +0000 +++ abgate-1.1.6/abGateQt/gate_gui_Qt4.cpp 2012-04-15 12:09:34.000000000 +0000 @@ -0,0 +1,74 @@ +/* abGate - Qt4 GUI + * + * Copyright 2011 Antanas Bružas + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include "ui.h" + +#include "mainwindow.h" + +static LV2UI_Descriptor *gate_guiDescriptor = NULL; + +static LV2_Handle instantiateGate_gui(const _LV2UI_Descriptor *descriptor, const char *plugin_uri, const char *bundle_path, LV2UI_Write_Function write_function, LV2UI_Controller controller, LV2UI_Widget *widget, const LV2_Feature *const *features) { + +// Gtk::Main::init_gtkmm_internals(); + + MainWindow* gui_data = new MainWindow(); + gui_data->controller = controller; + gui_data->write_function = write_function; + + *widget = gui_data->window(); + + return (LV2_Handle)gui_data; +} + + +static void cleanupGate_gui(LV2UI_Handle instance) { + delete static_cast(instance); + //free(instance); +} + +static void portEventGate_gui(LV2UI_Handle ui, uint32_t port_index, uint32_t buffer_size, uint32_t format, const void *buffer) { + MainWindow *gui = (MainWindow *)ui; + gui->gui_port_event(ui, port_index, buffer_size, format, buffer); +} + + +static void init_gui() { + + gate_guiDescriptor = (LV2UI_Descriptor *)malloc(sizeof(LV2UI_Descriptor)); + gate_guiDescriptor->URI = "http://hippie.lt/lv2/gate/guiQt4"; + gate_guiDescriptor->instantiate = instantiateGate_gui; + gate_guiDescriptor->cleanup = cleanupGate_gui; + gate_guiDescriptor->port_event = portEventGate_gui; + gate_guiDescriptor->extension_data = NULL; + +} + +//LV2_SYMBOL_EXPORT +const LV2UI_Descriptor *lv2ui_descriptor(uint32_t index) { + + if (!gate_guiDescriptor) { init_gui(); } + + switch (index) { + case 0: + return gate_guiDescriptor; + default: + return NULL; + } +} diff -Nru abgate-1.1.3/abGateQt/mainwindow.cpp abgate-1.1.6/abGateQt/mainwindow.cpp --- abgate-1.1.3/abGateQt/mainwindow.cpp 1970-01-01 00:00:00.000000000 +0000 +++ abgate-1.1.6/abGateQt/mainwindow.cpp 2012-04-20 07:01:28.000000000 +0000 @@ -0,0 +1,206 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" + +MainWindow::MainWindow(QWidget *parent) : + QWidget(parent), + designer_ui(new Ui::MainWindow) +{ + designer_ui->setupUi(this); + + defaultKnobParams(); + KnobStyle = NULL; + updateKnobStyle(); + +} + +MainWindow::~MainWindow() +{ + delete designer_ui; + if (KnobStyle) { delete KnobStyle; } +} + + +void MainWindow::defaultKnobParams() +{ + bypass_bool = BYPASS_DEFAULT > 0 ? true : false; + designer_ui->bypass->setChecked(bypass_bool); + + designer_ui->threshold->setMouseTracking(false); + designer_ui->threshold->setMinimum(THRESHOLD_MIN); + designer_ui->threshold->setMaximum(THRESHOLD_MAX); + designer_ui->threshold->setValue(THRESHOLD_DEFAULT); + + designer_ui->attack->setMouseTracking(false); + designer_ui->attack->setMinimum(ATTACK_MIN); + designer_ui->attack->setMaximum(ATTACK_MAX); + designer_ui->attack->setValue(ATTACK_DEFAULT); + + designer_ui->hold->setMouseTracking(false); + designer_ui->hold->setMinimum(HOLD_MIN); + designer_ui->hold->setMaximum(HOLD_MAX); + designer_ui->hold->setValue(HOLD_DEFAULT); + + designer_ui->decay->setMouseTracking(false); + designer_ui->decay->setMinimum(DECAY_MIN); + designer_ui->decay->setMaximum(DECAY_MAX); + designer_ui->decay->setValue(DECAY_DEFAULT); + + designer_ui->range->setMouseTracking(false); + designer_ui->range->setMinimum(RANGE_MIN); + designer_ui->range->setMaximum(RANGE_MAX); + designer_ui->range->setValue(RANGE_DEFAULT); +} + +void MainWindow::updateKnobStyle() +{ + KnobStyleNum style = KnobStyleNum(abGate); + if (KnobStyle) { + delete KnobStyle; + } + switch (style) { + case Classic: + //KnobStyle = new DialClassicStyle(); + KnobStyle = NULL; + break; + case abGate: + KnobStyle = new abGateStyle(); + break; + default: + KnobStyle = NULL; + break; + } + // Change the style for all of the dials + QList all_dials = findChildren(); + foreach(QDial* knob, all_dials) { + knob->setStyle(KnobStyle); + // Show nothes + if (style != abGate) { knob->setNotchesVisible(true); } else { knob->setNotchesVisible(false); } + } + + //ui->decay->setStyle(KnobStyle); +} + +// Informing GUI about changes in the control ports +void MainWindow::gui_port_event(LV2UI_Handle ui, uint32_t port_index, uint32_t buffer_size, uint32_t format, const void * buffer) { + + float val; + val = * static_cast(buffer); + + // Checking if params are the same as specified in the LV2 documentation + if (format != 0) { return; } + if (buffer_size != 4) { return; } + + // Updating values for GUI changes + + switch(port_index){ + case p_switch: + bypass_bool = val > 0 ? true : false; + designer_ui->bypass->setChecked(bypass_bool); + //bypass->set_toggle_value(val); + break; + case p_threshold: + designer_ui->threshold->setValue(val); + break; + case p_attack: + designer_ui->attack->setValue(val); + break; + case p_hold: + designer_ui->hold->setValue(val); + break; + case p_decay: + designer_ui->decay->setValue(val); + break; + case p_gaterange: + designer_ui->range->setValue(val); + break; + default: + return; + } + + +} + +void MainWindow::write_control(uint32_t port_index, float value) { + write_function(controller, port_index, 4, 0, &value); +} + +void MainWindow::on_threshold_actionTriggered(int action) +{ + write_control(p_threshold, designer_ui->threshold->value()); +} + +void MainWindow::on_threshold_dialPressed() +{ + write_control(p_threshold, designer_ui->threshold->value()); +} + +void MainWindow::on_threshold_dialReleased() +{ + write_control(p_threshold, designer_ui->threshold->value()); +} + +void MainWindow::on_attack_actionTriggered(int action) +{ + write_control(p_attack, designer_ui->attack->value()); +} + +void MainWindow::on_attack_dialPressed() +{ + write_control(p_attack, designer_ui->attack->value()); +} + +void MainWindow::on_attack_dialReleased() +{ + write_control(p_attack, designer_ui->attack->value()); +} + +void MainWindow::on_hold_actionTriggered(int action) +{ + write_control(p_hold, designer_ui->hold->value()); +} + +void MainWindow::on_hold_dialPressed() +{ + write_control(p_hold, designer_ui->hold->value()); +} + +void MainWindow::on_hold_dialReleased() +{ + write_control(p_hold, designer_ui->hold->value()); +} + +void MainWindow::on_decay_actionTriggered(int action) +{ + write_control(p_decay, designer_ui->decay->value()); +} + +void MainWindow::on_decay_dialPressed() +{ + write_control(p_decay, designer_ui->decay->value()); +} + +void MainWindow::on_decay_dialReleased() +{ + write_control(p_decay, designer_ui->decay->value()); +} + +void MainWindow::on_range_actionTriggered(int action) +{ + write_control(p_gaterange, designer_ui->range->value()); +} + +void MainWindow::on_range_dialPressed() +{ + write_control(p_gaterange, designer_ui->range->value()); +} + +void MainWindow::on_range_dialReleased() +{ + write_control(p_gaterange, designer_ui->range->value()); +} + +void MainWindow::on_bypass_toggled(bool checked) +{ + bypass_float = checked != true ? 0 : 1; + write_control(p_switch, bypass_float); +} diff -Nru abgate-1.1.3/abGateQt/mainwindow.h abgate-1.1.6/abGateQt/mainwindow.h --- abgate-1.1.3/abGateQt/mainwindow.h 1970-01-01 00:00:00.000000000 +0000 +++ abgate-1.1.6/abGateQt/mainwindow.h 2012-04-20 07:01:15.000000000 +0000 @@ -0,0 +1,79 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include +#include + +#include "abgatestyle.h" +#include "ui.h" +#include "gate_const.h" + +namespace Ui { +class MainWindow; +} + +class MainWindow : public QWidget +{ + Q_OBJECT + +public: + explicit MainWindow(QWidget *parent = 0); + ~MainWindow(); + + enum KnobStyleNum { Classic, abGate }; + + // Informing GUI about changes in the control ports + void gui_port_event(LV2UI_Handle ui, uint32_t port_index, uint32_t buffer_size, uint32_t format, const void * buffer); + + LV2UI_Controller controller; + LV2UI_Write_Function write_function; + + void write_control(uint32_t port_index, float value); + +protected: + void updateKnobStyle(); + + +private slots: + void on_threshold_actionTriggered(int action); + + void on_threshold_dialPressed(); + + void on_threshold_dialReleased(); + + void on_attack_actionTriggered(int action); + + void on_attack_dialPressed(); + + void on_attack_dialReleased(); + + void on_hold_actionTriggered(int action); + + void on_hold_dialPressed(); + + void on_hold_dialReleased(); + + void on_decay_actionTriggered(int action); + + void on_decay_dialPressed(); + + void on_decay_dialReleased(); + + void on_range_actionTriggered(int action); + + void on_range_dialPressed(); + + void on_range_dialReleased(); + + void on_bypass_toggled(bool checked); + +private: + Ui::MainWindow *designer_ui; + // Style for QDial + QStyle* KnobStyle; + bool bypass_bool; + float bypass_float; + void defaultKnobParams(); +}; + +#endif // MAINWINDOW_H diff -Nru abgate-1.1.3/abGateQt/mainwindow.ui abgate-1.1.6/abGateQt/mainwindow.ui --- abgate-1.1.3/abGateQt/mainwindow.ui 1970-01-01 00:00:00.000000000 +0000 +++ abgate-1.1.6/abGateQt/mainwindow.ui 2012-04-20 06:03:31.000000000 +0000 @@ -0,0 +1,232 @@ + + + MainWindow + + + + 0 + 0 + 640 + 200 + + + + + 640 + 200 + + + + + 640 + 200 + + + + MainWindow + + + + + + + + 640 + 200 + + + + + 640 + 200 + + + + QWidget#centralWidget { + background-image: url(:/images/Background); +} + + + + + 20 + 90 + 101 + 71 + + + + -70 + + + 12 + + + -70 + + + 2.000000000000000 + + + true + + + + + + 130 + 90 + 81 + 71 + + + + 500 + + + 50 + + + 25.000000000000000 + + + true + + + + + + 230 + 90 + 81 + 71 + + + + 5 + + + 3000 + + + 300 + + + 25.000000000000000 + + + true + + + + + + 330 + 90 + 81 + 71 + + + + 5 + + + 4000 + + + 400 + + + 25.000000000000000 + + + true + + + + + + 430 + 90 + 81 + 71 + + + + -90 + + + -20 + + + -90 + + + 5.000000000000000 + + + true + + + + + true + + + + 520 + 69 + 100 + 111 + + + + false + + + Qt::NoFocus + + + false + + + QPushButton#bypass { + background: none; + border: none; + padding: 0; +} +/* +QPushButton#bypass:pressed { + padding: 0; +} +QPushButton#bypass:active { + padding: 0; +} +*/ + + + + + + + :/images/Bypass Off + :/images/Bypass On:/images/Bypass Off + + + + 100 + 100 + + + + true + + + + + + + + + + diff -Nru abgate-1.1.3/abGateQt/resursas.qrc abgate-1.1.6/abGateQt/resursas.qrc --- abgate-1.1.3/abGateQt/resursas.qrc 1970-01-01 00:00:00.000000000 +0000 +++ abgate-1.1.6/abGateQt/resursas.qrc 2012-04-15 12:39:32.000000000 +0000 @@ -0,0 +1,7 @@ + + + background.png + bypass_on.png + bypass_off.png + + diff -Nru abgate-1.1.3/abGateQt/ui.h abgate-1.1.6/abGateQt/ui.h --- abgate-1.1.3/abGateQt/ui.h 1970-01-01 00:00:00.000000000 +0000 +++ abgate-1.1.6/abGateQt/ui.h 2012-04-15 11:12:22.000000000 +0000 @@ -0,0 +1,384 @@ +/* + LV2 UI Extension + Copyright 2009-2012 David Robillard + Copyright 2006-2011 Lars Luthman + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +/** + @file ui.h + C header for the LV2 UI extension . +*/ + +#ifndef LV2_UI_H +#define LV2_UI_H + +#include + +#include "lv2/lv2plug.in/ns/lv2core/lv2.h" + +#define LV2_UI_URI "http://lv2plug.in/ns/extensions/ui" +#define LV2_UI_PREFIX LV2_UI_URI "#" + +#define LV2_UI__GtkUI LV2_UI_PREFIX "GtkUI" +#define LV2_UI__PortNotification LV2_UI_PREFIX "PortNotification" +#define LV2_UI__Qt4UI LV2_UI_PREFIX "Qt4UI" +#define LV2_UI__UI LV2_UI_PREFIX "UI" +#define LV2_UI__X11UI LV2_UI_PREFIX "X11UI" +#define LV2_UI__binary LV2_UI_PREFIX "binary" +#define LV2_UI__fixedSize LV2_UI_PREFIX "fixedSize" +#define LV2_UI__noUserResize LV2_UI_PREFIX "noUserResize" +#define LV2_UI__notifyType LV2_UI_PREFIX "notifyType" +#define LV2_UI__parent LV2_UI_PREFIX "parent" +#define LV2_UI__plugin LV2_UI_PREFIX "plugin" +#define LV2_UI__portIndex LV2_UI_PREFIX "portIndex" +#define LV2_UI__portMap LV2_UI_PREFIX "portMap" +#define LV2_UI__portNotification LV2_UI_PREFIX "portNotification" +#define LV2_UI__portSubscribe LV2_UI_PREFIX "portSubscribe" +#define LV2_UI__resize LV2_UI_PREFIX "resize" +#define LV2_UI__touch LV2_UI_PREFIX "touch" +#define LV2_UI__ui LV2_UI_PREFIX "ui" + +/** + The index returned by LV2_UI_Port_Port::port_index() for unknown ports. +*/ +#define LV2UI_INVALID_PORT_INDEX ((uint32_t)-1) + +#ifdef __cplusplus +extern "C" { +#else +# include +#endif + +/** + A pointer to some widget or other type of UI handle. + + The actual type is defined by the type of the UI. +*/ +typedef void* LV2UI_Widget; + +/** + A pointer to an instance of a UI. + + It is valid to compare this to NULL (0 for C++) but otherwise the host MUST + not attempt to interpret it. The UI plugin may use it to reference internal + instance data. +*/ +typedef void* LV2UI_Handle; + +/** + A pointer to a controller provided by the host. + + It is valid to compare this to NULL (0 for C++) but otherwise the UI plugin + MUST NOT attempt to interpret it. The host may use it to reference internal + instance data. +*/ +typedef void* LV2UI_Controller; + +/** + A pointer to opaque data for a feature. +*/ +typedef void* LV2UI_Feature_Handle; + +/** + The type of the host-provided function that the UI can use to + send data to a plugin's input ports. + + The @p buffer parameter must point to a block of data, @c buffer_size bytes + large. The format of this data and how the host should use it is defined by + the @p port_protocol. This buffer is owned by the UI and is only valid for + the duration of this call. + + The @p port_protocol parameter should either be 0 or the URID for a + ui:PortProtocol. If it is 0, the protocol is implicitly ui:floatProtocol, + the port must be an lv2:ControlPort input, @c buffer must point to a single + float value, and @c buffer_size must be sizeof(float). + + The UI SHOULD NOT use a PortProtocol not supported by the host (i.e. one not + passed by the host as a feature), but the host MUST gracefully ignore any + port_protocol it does not understand. +*/ +typedef void (*LV2UI_Write_Function)(LV2UI_Controller controller, + uint32_t port_index, + uint32_t buffer_size, + uint32_t port_protocol, + const void* buffer); + +/** + The implementation of a UI. + + A pointer to an object of this type is returned by the lv2ui_descriptor() + function. +*/ +typedef struct _LV2UI_Descriptor { + /** + The URI for this UI (not for the plugin it controls). + */ + const char* URI; + + /** + Create a new UI object and return a handle to it. This function works + similarly to the instantiate() member in LV2_Descriptor. + + @param descriptor The descriptor for the UI that you want to instantiate. + + @param plugin_uri The URI of the plugin that this UI will control. + + @param bundle_path The path to the bundle containing the RDF data file + that references this shared object file, including the trailing '/'. + + @param write_function A function provided by the host that the UI can use + to send data to the plugin's input ports. + + @param controller A handle for the plugin instance that should be passed + as the first parameter of @p write_function. + + @param widget A pointer to an LV2UI_Widget. The UI will write a widget + pointer to this location (what type of widget depends on the RDF class of + the UI) that will be the main UI widget. + + @param features An array of LV2_Feature pointers. The host must pass all + feature URIs that it and the UI supports and any additional data, just + like in the LV2 plugin instantiate() function. Note that UI features and + plugin features are NOT necessarily the same, they just share the same + data structure - this will probably not be the same array as the one the + plugin host passes to a plugin. + + */ + LV2UI_Handle (*instantiate)(const struct _LV2UI_Descriptor* descriptor, + const char* plugin_uri, + const char* bundle_path, + LV2UI_Write_Function write_function, + LV2UI_Controller controller, + LV2UI_Widget* widget, + const LV2_Feature* const* features); + + + /** + Destroy the UI object and the associated widget. The host must not try + to access the widget after calling this function. + */ + void (*cleanup)(LV2UI_Handle ui); + + /** + Tell the UI that something interesting has happened at a plugin port. + + What is interesting and how it is written to the buffer passed to this + function is defined by the @p format parameter, which has the same + meaning as in LV2UI_Write_Function. The only exception is ports of the + class lv2:ControlPort, for which this function should be called when the + port value changes (it does not have to be called for every single change + if the host's UI thread has problems keeping up with the thread the + plugin is running in), @p buffer_size should be 4, the buffer should + contain a single IEEE-754 float, and @p format should be 0. + + By default, the host should only call this function for input ports of + the lv2:ControlPort class. However, this can be modified by using + ui:portNotification in the UI data, or the ui:portSubscribe feature. + + The @p buffer is only valid during the time of this function call, so if + the UI wants to keep it for later use it has to copy the contents to an + internal buffer. + + This member may be set to NULL if the UI is not interested in any + port events. + */ + void (*port_event)(LV2UI_Handle ui, + uint32_t port_index, + uint32_t buffer_size, + uint32_t format, + const void* buffer); + + /** + Return a data structure associated with an extension URI, for example + a struct containing additional function pointers. + + Avoid returning function pointers directly since standard C/C++ has no + valid way of casting a void* to a function pointer. This member may be set + to NULL if the UI is not interested in supporting any extensions. This is + similar to the extension_data() member in LV2_Descriptor. + */ + const void* (*extension_data)(const char* uri); +} LV2UI_Descriptor; + +/** + UI Resize Feature (LV2_UI__resize) + + This structure may be used in two ways: as a feature passed by the host via + LV2UI_Descriptor::instantiate(), or as extension data provided by a UI via + LV2UI_Descriptor::extension_data()). +*/ +typedef struct _LV2UI_Resize { + /** + Pointer to opaque data which must be passed to ui_resize(). + */ + LV2UI_Feature_Handle handle; + + /** + Request or advertise a size change. + + When this struct is provided by the host, the UI may call this + function to inform the host about the size of the UI. + + When this struct is provided by the UI, the host may call this + function to notify the UI that it should change its size accordingly. + + @return 0 on success. + */ + int (*ui_resize)(LV2UI_Feature_Handle handle, int width, int height); +} LV2UI_Resize; + +/** + Port Map Feature (LV2_UI__portMap). + + This feature can be used by the UI to get the index for a port with the + given symbol. This makes it possible to implement and distribute a UI + separately from the plugin (since symbol is a guaranteed stable port + identifier while index is not). +*/ +typedef struct _LV2UI_Port_Map { + /** + Pointer to opaque data which must be passed to ui_resize(). + */ + LV2UI_Feature_Handle handle; + + /** + Get the index for the port with the given @p symbol. + + @return The index of the port, or LV2_UI_INVALID_PORT_INDEX if no such + port is found. + */ + uint32_t (*port_index)(LV2UI_Feature_Handle handle, const char* symbol); +} LV2UI_Port_Map; + +/** + Port subscription feature (LV2_UI__portSubscribe); +*/ +typedef struct _LV2UI_Port_Subscribe { + /** + Pointer to opaque data which must be passed to ui_resize(). + */ + LV2UI_Feature_Handle handle; + + /** + Subscribe to updates for a port. + + This means that the host will call the UI's port_event() function when + the port value changes (as defined by protocol). + + Calling this function with the same @p port_index and @p port_protocol + as an already active subscription has no effect. + + @param handle The handle field of this struct. + @param port_index The index of the port. + @param port_protocol The URID of the ui:PortProtocol. + @param features Features for this subscription. + @return 0 on success. + */ + uint32_t (*subscribe)(LV2UI_Feature_Handle handle, + uint32_t port_index, + uint32_t port_protocol, + const LV2_Feature* const* features); + + /** + Unsubscribe from updates for a port. + + This means that the host will cease calling calling port_event() when + the port value changes. + + Calling this function with a @p port_index and @p port_protocol that + does not refer to an active port subscription has no effect. + + @param handle The handle field of this struct. + @param port_index The index of the port. + @param port_protocol The URID of the ui:PortProtocol. + @param features Features for this subscription. + @return 0 on success. + */ + uint32_t (*unsubscribe)(LV2UI_Feature_Handle handle, + uint32_t port_index, + uint32_t port_protocol, + const LV2_Feature* const* features); +} LV2UI_Port_Subscribe; + +/** + A feature to notify the host the user has grabbed a UI control. +*/ +typedef struct _LV2UI_Touch { + /** + Pointer to opaque data which must be passed to ui_resize(). + */ + LV2UI_Feature_Handle handle; + + /** + Notify the host that a control has been grabbed or released. + + @param handle The handle field of this struct. + @param port_index The index of the port associated with the control. + @param grabbed If true, the control has been grabbed, otherwise the + control has been released. + */ + void (*touch)(LV2UI_Feature_Handle handle, + uint32_t port_index, + bool grabbed); +} LV2UI_Touch; + +/** + Peak data for a slice of time, the update format for ui:peakProtocol. +*/ +typedef struct _LV2UI_Peak_Data { + /** + The start of the measurement period. This is just a running counter + that is only meaningful in comparison to previous values and must not be + interpreted as an absolute time. + */ + uint32_t period_start; + + /** + The size of the measurement period, in the same units as period_start. + */ + uint32_t period_size; + + /** + The peak value for the measurement period. This should be the maximal + value for abs(sample) over all the samples in the period. + */ + float peak; +} LV2UI_Peak_Data; + +/** + A plugin UI programmer must include a function called "lv2ui_descriptor" + with the following function prototype within the shared object file. This + function will have C-style linkage (if you are using C++ this is taken care + of by the 'extern "C"' clause at the top of the file). This function is + loaded from the library by the UI host and called to get a + LV2UI_Descriptor for the wanted plugin. + + Just like lv2_descriptor(), this function takes an index parameter. The + index should only be used for enumeration and not as any sort of ID number - + the host should just iterate from 0 and upwards until the function returns + NULL or a descriptor with an URI matching the one the host is looking for. +*/ +const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index); + +/** + The type of the lv2ui_descriptor() function. +*/ +typedef const LV2UI_Descriptor* (*LV2UI_DescriptorFunction)(uint32_t index); + +#ifdef __cplusplus +} +#endif + +#endif /* LV2_UI_H */ diff -Nru abgate-1.1.3/ChangeLog abgate-1.1.6/ChangeLog --- abgate-1.1.3/ChangeLog 2011-03-06 07:15:35.000000000 +0000 +++ abgate-1.1.6/ChangeLog 2012-04-21 05:34:35.000000000 +0000 @@ -1,5 +1,16 @@ abGate +Version 1.1.6 - 2012-04-21 09:00 UTC+02 + * updated Makefile and ttl files + +Version 1.1.5 - 2012-04-20 10:30 UTC+02 + * Qt4 GUI uses QWidget instead of QMainWindow + * removed main.cpp from Qt4 GUI + * changed filenames for Qt4 GUI + +Version 1.1.4 - 2012-04-16 10:00 UTC+02 + * added new Qt4 GUI + Version 1.1.3 - 2011-03-06 09:20 UTC+02 * changed required compiler to g++ diff -Nru abgate-1.1.3/debian/changelog abgate-1.1.6/debian/changelog --- abgate-1.1.3/debian/changelog 2011-04-11 07:27:40.000000000 +0000 +++ abgate-1.1.6/debian/changelog 2012-05-14 16:19:54.000000000 +0000 @@ -1,3 +1,14 @@ +abgate (1.1.6-1) unstable; urgency=low + + * New upstream release. + * Build-Depends on libqt4-dev, qt4-dev-tools. + * Add patch to port abGate to the LV2's new release. + * Replace lv2core with lv2-dev. + * Bump Standards. + * Update debian/copyright. + + -- Alessio Treglia Mon, 14 May 2012 18:19:46 +0200 + abgate (1.1.3-1) unstable; urgency=low * New upstream bugfix release. diff -Nru abgate-1.1.3/debian/control abgate-1.1.6/debian/control --- abgate-1.1.3/debian/control 2011-04-11 07:23:30.000000000 +0000 +++ abgate-1.1.6/debian/control 2012-05-14 16:18:05.000000000 +0000 @@ -2,21 +2,27 @@ Priority: optional Section: sound Maintainer: Debian Multimedia Maintainers -Uploaders: Alessio Treglia -Build-Depends: debhelper (>= 7), +Uploaders: + Alessio Treglia +Build-Depends: + debhelper (>= 7), libgtkmm-2.4-dev, - lv2core, - pkg-config -Standards-Version: 3.9.1 + libqt4-dev, + lv2-dev, + pkg-config, + qt4-dev-tools +Standards-Version: 3.9.3 Vcs-Git: git://git.debian.org/pkg-multimedia/abgate.git Vcs-Browser: http://git.debian.org/?p=pkg-multimedia/abgate.git Homepage: http://abgate.sourceforge.net Package: abgate Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Provides: lv2-plugin +Depends: + ${misc:Depends}, + ${shlibs:Depends} +Provides: + lv2-plugin Description: LV2 noise gate plugin abGate is a LV2 noise gate plugin in the LV2 format to manage noise. A noise gate is a component which attenuates an audio diff -Nru abgate-1.1.3/debian/copyright abgate-1.1.6/debian/copyright --- abgate-1.1.3/debian/copyright 2011-04-11 07:23:30.000000000 +0000 +++ abgate-1.1.6/debian/copyright 2012-05-14 16:19:19.000000000 +0000 @@ -1,13 +1,13 @@ -Format: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=166 +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: abGate Upstream-Contact: Antanas Bružas Source: http://sourceforge.net/projects/abgate/files/ Files: * -Copyright: 2011 Antanas Bružas +Copyright: 2011-2012 Antanas Bružas License: LGPL-3+ -Files: ui.h +Files: ui.h Copyright: 2009-2010 David Robillard 2006 Steve Harris, David Robillard 2000-2002 Richard W.E. Furse, Paul Barton-Davis diff -Nru abgate-1.1.3/debian/patches/0001-lv2core_to_lv2.patch abgate-1.1.6/debian/patches/0001-lv2core_to_lv2.patch --- abgate-1.1.3/debian/patches/0001-lv2core_to_lv2.patch 1970-01-01 00:00:00.000000000 +0000 +++ abgate-1.1.6/debian/patches/0001-lv2core_to_lv2.patch 2012-05-14 15:54:19.000000000 +0000 @@ -0,0 +1,22 @@ +Description: Port to LV2's new release. +Author: Alessio Treglia +Forwarded: no +--- + Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- abgate.orig/Makefile ++++ abgate/Makefile +@@ -13,10 +13,10 @@ abGateQt/libabGateQt.so: + cd abGateQt; qmake; make + + gate.so: gate.cpp +- g++ $(LDFLAGS) -O3 -shared -fPIC -DPIC gate.cpp `pkg-config --cflags --libs lv2core` -o gate.so ++ g++ $(LDFLAGS) -O3 -shared -fPIC -DPIC gate.cpp `pkg-config --cflags --libs lv2` -o gate.so + + gate_gui.so: gate_gui.cpp main_window.cpp main_window.h knob.cpp knob.h toggle.cpp toggle.h preset_widget.cpp preset_widget.h presets.cpp presets.h preset.cpp preset.h gate_const.h ui.h plugin_configuration.h +- g++ $(LDFLAGS) -O3 -shared -fPIC -DPIC gate_gui.cpp main_window.cpp knob.cpp toggle.cpp preset_widget.cpp presets.cpp preset.cpp `pkg-config --cflags gtkmm-2.4 --libs lv2core gthread-2.0` -o gate_gui.so ++ g++ $(LDFLAGS) -O3 -shared -fPIC -DPIC gate_gui.cpp main_window.cpp knob.cpp toggle.cpp preset_widget.cpp presets.cpp preset.cpp `pkg-config --cflags gtkmm-2.4 --libs lv2 gthread-2.0` -o gate_gui.so + + install: $(BUNDLE) + mkdir -p $(INSTALL_DIR) diff -Nru abgate-1.1.3/debian/patches/series abgate-1.1.6/debian/patches/series --- abgate-1.1.3/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ abgate-1.1.6/debian/patches/series 2012-05-14 15:53:07.000000000 +0000 @@ -0,0 +1 @@ +0001-lv2core_to_lv2.patch diff -Nru abgate-1.1.3/gate.ttl abgate-1.1.6/gate.ttl --- abgate-1.1.3/gate.ttl 2011-01-27 18:32:09.000000000 +0000 +++ abgate-1.1.6/gate.ttl 2012-04-21 05:18:24.000000000 +0000 @@ -1,21 +1,22 @@ @prefix lv2: . @prefix doap: . -@prefix guiext: . +@prefix ui: . @prefix units: . -@prefix epp: . +@prefix pprops: . @prefix foaf: . - - - a guiext:GtkUI; - guiext:binary ; - guiext:requiredFeature guiext:makeResident; - guiext:optionalFeature guiext:noUserResize. + + a ui:Qt4UI; + ui:requiredFeature ui:makeResident; + ui:optionalFeature ui:noUserResize. + + a ui:GtkUI; + ui:requiredFeature ui:makeResident; + ui:optionalFeature ui:noUserResize. - a lv2:Plugin, lv2:GatePlugin; lv2:binary ; @@ -36,7 +37,8 @@ doap:license ; - guiext:ui ; + ui:ui ; + ui:ui ; lv2:port [ a lv2:AudioPort, lv2:OutputPort; @@ -60,7 +62,7 @@ lv2:minimum 0; lv2:maximum 1; lv2:default 0; - lv2:portProperty epp:hasStrictBounds; + lv2:portProperty pprops:hasStrictBounds; lv2:PortProperty lv2:toggled; ], @@ -72,7 +74,7 @@ lv2:minimum -70; lv2:maximum 12; lv2:default -70; - lv2:portProperty epp:hasStrictBounds; + lv2:portProperty pprops:hasStrictBounds; units:unit units:db; units:conversion [ units:to units:s; @@ -89,7 +91,7 @@ lv2:minimum 0.1; lv2:maximum 500; lv2:default 30; - lv2:portProperty epp:hasStrictBounds; + lv2:portProperty pprops:hasStrictBounds; units:unit units:ms; units:conversion [ units:to units:s; @@ -105,7 +107,7 @@ lv2:minimum 5; lv2:maximum 3000; lv2:default 500; - lv2:portProperty epp:hasStrictBounds; + lv2:portProperty pprops:hasStrictBounds; units:unit units:ms; units:conversion [ units:to units:s; @@ -121,7 +123,7 @@ lv2:minimum 5; lv2:maximum 4000; lv2:default 1000; - lv2:portProperty epp:hasStrictBounds; + lv2:portProperty pprops:hasStrictBounds; units:unit units:ms; units:conversion [ units:to units:s; @@ -134,7 +136,7 @@ lv2:index 7; lv2:symbol "gaterange"; lv2:name "Range"; - lv2:portProperty epp:hasStrictBounds; + lv2:portProperty pprops:hasStrictBounds; lv2:minimum -90; lv2:maximum -20; lv2:default -90; diff -Nru abgate-1.1.3/Makefile abgate-1.1.6/Makefile --- abgate-1.1.3/Makefile 2011-03-06 07:11:29.000000000 +0000 +++ abgate-1.1.6/Makefile 2012-04-21 05:04:43.000000000 +0000 @@ -4,11 +4,14 @@ PREFIX = /usr INSTALL_DIR = $(DESTDIR)$(PREFIX)/lib/lv2 -$(BUNDLE): manifest.ttl gate.ttl gate.so gate_gui.so bypass_on.png bypass_off.png knob.png background.png +$(BUNDLE): manifest.ttl gate.ttl gate.so gate_gui.so bypass_on.png bypass_off.png knob.png background.png abGateQt/libabGateQt.so rm -rf $(BUNDLE) mkdir $(BUNDLE) cp $^ $(BUNDLE) +abGateQt/libabGateQt.so: + cd abGateQt; qmake; make + gate.so: gate.cpp g++ $(LDFLAGS) -O3 -shared -fPIC -DPIC gate.cpp `pkg-config --cflags --libs lv2core` -o gate.so @@ -21,4 +24,4 @@ cp -R $(BUNDLE) $(INSTALL_DIR) clean: - rm -rf $(BUNDLE) gate.so gate_gui.so + rm -rf $(BUNDLE) gate.so gate_gui.so; cd abGateQt; rm -rf libabGateQt.so; make clean; rm -rf Makefile diff -Nru abgate-1.1.3/manifest.ttl abgate-1.1.6/manifest.ttl --- abgate-1.1.3/manifest.ttl 2011-01-19 09:51:37.000000000 +0000 +++ abgate-1.1.6/manifest.ttl 2012-04-21 05:16:31.000000000 +0000 @@ -1,7 +1,19 @@ @prefix lv2: . @prefix rdfs: . +@prefix ui: . - a lv2:Plugin; + a lv2:Plugin, lv2:GatePlugin; + lv2:binary ; + rdfs:seeAlso . + + + a ui:Qt4UI; + ui:binary ; + rdfs:seeAlso . + + + a ui:GtkUI; + ui:binary ; rdfs:seeAlso . diff -Nru abgate-1.1.3/README abgate-1.1.6/README --- abgate-1.1.3/README 2011-03-06 07:14:15.000000000 +0000 +++ abgate-1.1.6/README 2012-04-21 05:35:01.000000000 +0000 @@ -1,17 +1,18 @@ ======================== - abGate LV2 Plugin v1.1.3 + abGate LV2 Plugin v1.1.6 ======================== abGate is LV2 noise gate plugin for Linux. Features: + * Qt4 GUI * Presets * Automation works with all controls * User interface works with Gtk+ Hosts (tested with Ardour 2.8.11) -Newest version of the plugin can be downloaded from http://hippie.lt/lv2/gate/ +Newest version of the plugin can be downloaded from http://abgate.sf.net Installation diff -Nru abgate-1.1.3/ui.h abgate-1.1.6/ui.h --- abgate-1.1.3/ui.h 2011-01-27 13:27:29.000000000 +0000 +++ abgate-1.1.6/ui.h 2012-04-15 11:12:22.000000000 +0000 @@ -1,241 +1,384 @@ -/* LV2 UI Extension - * Copyright (C) 2006-2008 Lars Luthman - * Copyright (C) 2009-2010 David Robillard - * - * Based on lv2.h, which was - * Copyright (C) 2000-2002 Richard W.E. Furse, Paul Barton-Davis, - * Stefan Westerfeld - * Copyright (C) 2006 Steve Harris, David Robillard. - * - * This header is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, - * or (at your option) any later version. - * - * This header 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 - * USA. - * - */ - -/** @file - * C header for the LV2 UI extension . - */ - -#ifndef LV2_UI_H -#define LV2_UI_H - -#include "lv2.h" - -#define LV2_UI_URI "http://lv2plug.in/ns/extensions/ui" - - -#ifdef __cplusplus -extern "C" { -#endif - - -/** A pointer to some widget or other type of UI handle. - The actual type is defined by the type URI of the UI. - All the functionality provided by this extension is toolkit - independent, the host only needs to pass the necessary callbacks and - display the widget, if possible. Plugins may have several UIs, in various - toolkits. */ -typedef void* LV2UI_Widget; - - -/** A pointer to a particular instance of a UI. - It is valid to compare this to NULL (0 for C++) but otherwise the - host MUST not attempt to interpret it. The UI plugin may use it to - reference internal instance data. */ -typedef void* LV2UI_Handle; - - -/** A pointer to a particular plugin controller, provided by the host. - It is valid to compare this to NULL (0 for C++) but otherwise the - UI plugin MUST not attempt to interpret it. The host may use it to - reference internal instance data. */ -typedef void* LV2UI_Controller; - - -/** The type of the host-provided function that the UI can use to - send data to a plugin's input ports. The @c buffer parameter must point - to a block of data, @c buffer_size bytes large. The contents of this buffer - and what the host should do with it depends on the value of the @c format - parameter. - - The @c format parameter should either be 0 or a numeric ID for a "Transfer - mechanism". Transfer mechanisms are Features and may be defined in - meta-extensions. They specify how to translate the data buffers passed - to this function to input data for the plugin ports. If a UI wishes to - write data to an input port, it must list a transfer mechanism Feature - for that port's class as an optional or required feature (depending on - whether the UI will work without being able to write to that port or not). - The only exception is when the UI wants to write single float values to - input ports of the class lv2:ControlPort, in which case @c buffer_size - should always be 4, the buffer should always contain a single IEEE-754 - float, and @c format should be 0. - - The numeric IDs for the transfer mechanisms are provided by a - URI-to-integer mapping function provided by the host, using the URI Map - feature with the map URI - "http://lv2plug.in/ns/extensions/ui". Thus a UI that requires transfer - mechanism features also requires the URI Map feature, but this is - implicit - the UI does not have to list the URI map feature as a required - or optional feature in it's RDF data. - - An UI MUST NOT pass a @c format parameter value (except 0) that has not - been returned by the host-provided URI mapping function for a - host-supported transfer mechanism feature URI. - - The UI MUST NOT try to write to a port for which there is no specified - transfer mechanism, or to an output port. The UI is responsible for - allocating the buffer and deallocating it after the call. -*/ -typedef void (*LV2UI_Write_Function)(LV2UI_Controller controller, - uint32_t port_index, - uint32_t buffer_size, - uint32_t format, - const void* buffer); - - -/** This struct contains the implementation of a UI. A pointer to an - object of this type is returned by the lv2ui_descriptor() function. -*/ -typedef struct _LV2UI_Descriptor { - - /** The URI for this UI (not for the plugin it controls). */ - const char* URI; - - /** Create a new UI object and return a handle to it. This function works - similarly to the instantiate() member in LV2_Descriptor. - - @param descriptor The descriptor for the UI that you want to instantiate. - @param plugin_uri The URI of the plugin that this UI will control. - @param bundle_path The path to the bundle containing the RDF data file - that references this shared object file, including the - trailing '/'. - @param write_function A function provided by the host that the UI can - use to send data to the plugin's input ports. - @param controller A handle for the plugin instance that should be passed - as the first parameter of @c write_function. - @param widget A pointer to an LV2UI_Widget. The UI will write a - widget pointer to this location (what type of widget - depends on the RDF class of the UI) that will be the - main UI widget. - @param features An array of LV2_Feature pointers. The host must pass - all feature URIs that it and the UI supports and any - additional data, just like in the LV2 plugin - instantiate() function. Note that UI features and plugin - features are NOT necessarily the same, they just share - the same data structure - this will probably not be the - same array as the one the plugin host passes to a - plugin. - */ - LV2UI_Handle (*instantiate)(const struct _LV2UI_Descriptor* descriptor, - const char* plugin_uri, - const char* bundle_path, - LV2UI_Write_Function write_function, - LV2UI_Controller controller, - LV2UI_Widget* widget, - const LV2_Feature* const* features); - - - /** Destroy the UI object and the associated widget. The host must not try - to access the widget after calling this function. - */ - void (*cleanup)(LV2UI_Handle ui); - - /** Tell the UI that something interesting has happened at a plugin port. - What is interesting and how it is written to the buffer passed to this - function is defined by the @c format parameter, which has the same - meaning as in LV2UI_Write_Function. The only exception is ports of the - class lv2:ControlPort, for which this function should be called - when the port value changes (it does not have to be called for every - single change if the host's UI thread has problems keeping up with the - thread the plugin is running in), @c buffer_size should be 4, the buffer - should contain a single IEEE-754 float, and @c format should be 0. - - By default, the host should only call this function for input ports of - the lv2:ControlPort class. However, the default setting can be modified - by using the following URIs in the UI's RDF data: -
-      uiext:portNotification
-      uiext:noPortNotification
-      uiext:plugin
-      uiext:portIndex
-      
- For example, if you want the UI with uri - for the plugin with URI - to get notified when the value of the - output control port with index 4 changes, you would use the following - in the RDF for your UI: -
-       uiext:portNotification [ uiext:plugin  ;
-                                                    uiext:portIndex 4 ] .
-      
- and similarly with uiext:noPortNotification if you wanted - to prevent notifications for a port for which it would be on by default - otherwise. The UI is not allowed to request notifications for ports of - types for which no transfer mechanism is specified, if it does it should - be considered broken and the host should not load it. - - The @c buffer is only valid during the time of this function call, so if - the UI wants to keep it for later use it has to copy the contents to an - internal buffer. - - This member may be set to NULL if the UI is not interested in any - port events. - */ - void (*port_event)(LV2UI_Handle ui, - uint32_t port_index, - uint32_t buffer_size, - uint32_t format, - const void* buffer); - - /** Returns a data structure associated with an extension URI, for example - a struct containing additional function pointers. Avoid returning - function pointers directly since standard C/C++ has no valid way of - casting a void* to a function pointer. This member may be set to NULL - if the UI is not interested in supporting any extensions. This is similar - to the extension_data() member in LV2_Descriptor. - */ - const void* (*extension_data)(const char* uri); - -} LV2UI_Descriptor; - - - -/** A plugin UI programmer must include a function called "lv2ui_descriptor" - with the following function prototype within the shared object - file. This function will have C-style linkage (if you are using - C++ this is taken care of by the 'extern "C"' clause at the top of - the file). This function will be accessed by the UI host using the - @c dlsym() function and called to get a LV2UI_UIDescriptor for the - wanted plugin. - - Just like lv2_descriptor(), this function takes an index parameter. The - index should only be used for enumeration and not as any sort of ID number - - the host should just iterate from 0 and upwards until the function returns - NULL or a descriptor with an URI matching the one the host is looking for. -*/ -const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index); - - -/** This is the type of the lv2ui_descriptor() function. */ -typedef const LV2UI_Descriptor* (*LV2UI_DescriptorFunction)(uint32_t index); - - - -#ifdef __cplusplus -} -#endif - - -#endif +/* + LV2 UI Extension + Copyright 2009-2012 David Robillard + Copyright 2006-2011 Lars Luthman + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +/** + @file ui.h + C header for the LV2 UI extension . +*/ + +#ifndef LV2_UI_H +#define LV2_UI_H + +#include + +#include "lv2/lv2plug.in/ns/lv2core/lv2.h" + +#define LV2_UI_URI "http://lv2plug.in/ns/extensions/ui" +#define LV2_UI_PREFIX LV2_UI_URI "#" + +#define LV2_UI__GtkUI LV2_UI_PREFIX "GtkUI" +#define LV2_UI__PortNotification LV2_UI_PREFIX "PortNotification" +#define LV2_UI__Qt4UI LV2_UI_PREFIX "Qt4UI" +#define LV2_UI__UI LV2_UI_PREFIX "UI" +#define LV2_UI__X11UI LV2_UI_PREFIX "X11UI" +#define LV2_UI__binary LV2_UI_PREFIX "binary" +#define LV2_UI__fixedSize LV2_UI_PREFIX "fixedSize" +#define LV2_UI__noUserResize LV2_UI_PREFIX "noUserResize" +#define LV2_UI__notifyType LV2_UI_PREFIX "notifyType" +#define LV2_UI__parent LV2_UI_PREFIX "parent" +#define LV2_UI__plugin LV2_UI_PREFIX "plugin" +#define LV2_UI__portIndex LV2_UI_PREFIX "portIndex" +#define LV2_UI__portMap LV2_UI_PREFIX "portMap" +#define LV2_UI__portNotification LV2_UI_PREFIX "portNotification" +#define LV2_UI__portSubscribe LV2_UI_PREFIX "portSubscribe" +#define LV2_UI__resize LV2_UI_PREFIX "resize" +#define LV2_UI__touch LV2_UI_PREFIX "touch" +#define LV2_UI__ui LV2_UI_PREFIX "ui" + +/** + The index returned by LV2_UI_Port_Port::port_index() for unknown ports. +*/ +#define LV2UI_INVALID_PORT_INDEX ((uint32_t)-1) + +#ifdef __cplusplus +extern "C" { +#else +# include +#endif + +/** + A pointer to some widget or other type of UI handle. + + The actual type is defined by the type of the UI. +*/ +typedef void* LV2UI_Widget; + +/** + A pointer to an instance of a UI. + + It is valid to compare this to NULL (0 for C++) but otherwise the host MUST + not attempt to interpret it. The UI plugin may use it to reference internal + instance data. +*/ +typedef void* LV2UI_Handle; + +/** + A pointer to a controller provided by the host. + + It is valid to compare this to NULL (0 for C++) but otherwise the UI plugin + MUST NOT attempt to interpret it. The host may use it to reference internal + instance data. +*/ +typedef void* LV2UI_Controller; + +/** + A pointer to opaque data for a feature. +*/ +typedef void* LV2UI_Feature_Handle; + +/** + The type of the host-provided function that the UI can use to + send data to a plugin's input ports. + + The @p buffer parameter must point to a block of data, @c buffer_size bytes + large. The format of this data and how the host should use it is defined by + the @p port_protocol. This buffer is owned by the UI and is only valid for + the duration of this call. + + The @p port_protocol parameter should either be 0 or the URID for a + ui:PortProtocol. If it is 0, the protocol is implicitly ui:floatProtocol, + the port must be an lv2:ControlPort input, @c buffer must point to a single + float value, and @c buffer_size must be sizeof(float). + + The UI SHOULD NOT use a PortProtocol not supported by the host (i.e. one not + passed by the host as a feature), but the host MUST gracefully ignore any + port_protocol it does not understand. +*/ +typedef void (*LV2UI_Write_Function)(LV2UI_Controller controller, + uint32_t port_index, + uint32_t buffer_size, + uint32_t port_protocol, + const void* buffer); + +/** + The implementation of a UI. + + A pointer to an object of this type is returned by the lv2ui_descriptor() + function. +*/ +typedef struct _LV2UI_Descriptor { + /** + The URI for this UI (not for the plugin it controls). + */ + const char* URI; + + /** + Create a new UI object and return a handle to it. This function works + similarly to the instantiate() member in LV2_Descriptor. + + @param descriptor The descriptor for the UI that you want to instantiate. + + @param plugin_uri The URI of the plugin that this UI will control. + + @param bundle_path The path to the bundle containing the RDF data file + that references this shared object file, including the trailing '/'. + + @param write_function A function provided by the host that the UI can use + to send data to the plugin's input ports. + + @param controller A handle for the plugin instance that should be passed + as the first parameter of @p write_function. + + @param widget A pointer to an LV2UI_Widget. The UI will write a widget + pointer to this location (what type of widget depends on the RDF class of + the UI) that will be the main UI widget. + + @param features An array of LV2_Feature pointers. The host must pass all + feature URIs that it and the UI supports and any additional data, just + like in the LV2 plugin instantiate() function. Note that UI features and + plugin features are NOT necessarily the same, they just share the same + data structure - this will probably not be the same array as the one the + plugin host passes to a plugin. + + */ + LV2UI_Handle (*instantiate)(const struct _LV2UI_Descriptor* descriptor, + const char* plugin_uri, + const char* bundle_path, + LV2UI_Write_Function write_function, + LV2UI_Controller controller, + LV2UI_Widget* widget, + const LV2_Feature* const* features); + + + /** + Destroy the UI object and the associated widget. The host must not try + to access the widget after calling this function. + */ + void (*cleanup)(LV2UI_Handle ui); + + /** + Tell the UI that something interesting has happened at a plugin port. + + What is interesting and how it is written to the buffer passed to this + function is defined by the @p format parameter, which has the same + meaning as in LV2UI_Write_Function. The only exception is ports of the + class lv2:ControlPort, for which this function should be called when the + port value changes (it does not have to be called for every single change + if the host's UI thread has problems keeping up with the thread the + plugin is running in), @p buffer_size should be 4, the buffer should + contain a single IEEE-754 float, and @p format should be 0. + + By default, the host should only call this function for input ports of + the lv2:ControlPort class. However, this can be modified by using + ui:portNotification in the UI data, or the ui:portSubscribe feature. + + The @p buffer is only valid during the time of this function call, so if + the UI wants to keep it for later use it has to copy the contents to an + internal buffer. + + This member may be set to NULL if the UI is not interested in any + port events. + */ + void (*port_event)(LV2UI_Handle ui, + uint32_t port_index, + uint32_t buffer_size, + uint32_t format, + const void* buffer); + + /** + Return a data structure associated with an extension URI, for example + a struct containing additional function pointers. + + Avoid returning function pointers directly since standard C/C++ has no + valid way of casting a void* to a function pointer. This member may be set + to NULL if the UI is not interested in supporting any extensions. This is + similar to the extension_data() member in LV2_Descriptor. + */ + const void* (*extension_data)(const char* uri); +} LV2UI_Descriptor; + +/** + UI Resize Feature (LV2_UI__resize) + + This structure may be used in two ways: as a feature passed by the host via + LV2UI_Descriptor::instantiate(), or as extension data provided by a UI via + LV2UI_Descriptor::extension_data()). +*/ +typedef struct _LV2UI_Resize { + /** + Pointer to opaque data which must be passed to ui_resize(). + */ + LV2UI_Feature_Handle handle; + + /** + Request or advertise a size change. + + When this struct is provided by the host, the UI may call this + function to inform the host about the size of the UI. + + When this struct is provided by the UI, the host may call this + function to notify the UI that it should change its size accordingly. + + @return 0 on success. + */ + int (*ui_resize)(LV2UI_Feature_Handle handle, int width, int height); +} LV2UI_Resize; + +/** + Port Map Feature (LV2_UI__portMap). + + This feature can be used by the UI to get the index for a port with the + given symbol. This makes it possible to implement and distribute a UI + separately from the plugin (since symbol is a guaranteed stable port + identifier while index is not). +*/ +typedef struct _LV2UI_Port_Map { + /** + Pointer to opaque data which must be passed to ui_resize(). + */ + LV2UI_Feature_Handle handle; + + /** + Get the index for the port with the given @p symbol. + + @return The index of the port, or LV2_UI_INVALID_PORT_INDEX if no such + port is found. + */ + uint32_t (*port_index)(LV2UI_Feature_Handle handle, const char* symbol); +} LV2UI_Port_Map; + +/** + Port subscription feature (LV2_UI__portSubscribe); +*/ +typedef struct _LV2UI_Port_Subscribe { + /** + Pointer to opaque data which must be passed to ui_resize(). + */ + LV2UI_Feature_Handle handle; + + /** + Subscribe to updates for a port. + + This means that the host will call the UI's port_event() function when + the port value changes (as defined by protocol). + + Calling this function with the same @p port_index and @p port_protocol + as an already active subscription has no effect. + + @param handle The handle field of this struct. + @param port_index The index of the port. + @param port_protocol The URID of the ui:PortProtocol. + @param features Features for this subscription. + @return 0 on success. + */ + uint32_t (*subscribe)(LV2UI_Feature_Handle handle, + uint32_t port_index, + uint32_t port_protocol, + const LV2_Feature* const* features); + + /** + Unsubscribe from updates for a port. + + This means that the host will cease calling calling port_event() when + the port value changes. + + Calling this function with a @p port_index and @p port_protocol that + does not refer to an active port subscription has no effect. + + @param handle The handle field of this struct. + @param port_index The index of the port. + @param port_protocol The URID of the ui:PortProtocol. + @param features Features for this subscription. + @return 0 on success. + */ + uint32_t (*unsubscribe)(LV2UI_Feature_Handle handle, + uint32_t port_index, + uint32_t port_protocol, + const LV2_Feature* const* features); +} LV2UI_Port_Subscribe; + +/** + A feature to notify the host the user has grabbed a UI control. +*/ +typedef struct _LV2UI_Touch { + /** + Pointer to opaque data which must be passed to ui_resize(). + */ + LV2UI_Feature_Handle handle; + + /** + Notify the host that a control has been grabbed or released. + + @param handle The handle field of this struct. + @param port_index The index of the port associated with the control. + @param grabbed If true, the control has been grabbed, otherwise the + control has been released. + */ + void (*touch)(LV2UI_Feature_Handle handle, + uint32_t port_index, + bool grabbed); +} LV2UI_Touch; + +/** + Peak data for a slice of time, the update format for ui:peakProtocol. +*/ +typedef struct _LV2UI_Peak_Data { + /** + The start of the measurement period. This is just a running counter + that is only meaningful in comparison to previous values and must not be + interpreted as an absolute time. + */ + uint32_t period_start; + + /** + The size of the measurement period, in the same units as period_start. + */ + uint32_t period_size; + + /** + The peak value for the measurement period. This should be the maximal + value for abs(sample) over all the samples in the period. + */ + float peak; +} LV2UI_Peak_Data; + +/** + A plugin UI programmer must include a function called "lv2ui_descriptor" + with the following function prototype within the shared object file. This + function will have C-style linkage (if you are using C++ this is taken care + of by the 'extern "C"' clause at the top of the file). This function is + loaded from the library by the UI host and called to get a + LV2UI_Descriptor for the wanted plugin. + + Just like lv2_descriptor(), this function takes an index parameter. The + index should only be used for enumeration and not as any sort of ID number - + the host should just iterate from 0 and upwards until the function returns + NULL or a descriptor with an URI matching the one the host is looking for. +*/ +const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index); + +/** + The type of the lv2ui_descriptor() function. +*/ +typedef const LV2UI_Descriptor* (*LV2UI_DescriptorFunction)(uint32_t index); + +#ifdef __cplusplus +} +#endif + +#endif /* LV2_UI_H */