1 /* a-comp UI -- test/example
3 * Copyright (C) 2016 Robin Gareus <robin@gareus.org>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #define ACOMP_URI "urn:ardour:a-comp"
25 #include "lv2/lv2plug.in/ns/extensions/ui/ui.h"
30 LV2UI_Write_Function write;
31 LV2UI_Controller controller;
38 /******************************************************************************
42 static void* setup_ui (ACompUI* ui) {
43 ui->box = manage (new HBox);
45 ui->label = manage (new Label ("Hello World"));
46 ui->box->pack_start (*ui->label, false, false, 4);
48 return ui->box->gobj ();
52 /******************************************************************************
57 instantiate (const LV2UI_Descriptor* descriptor,
58 const char* plugin_uri,
59 const char* bundle_path,
60 LV2UI_Write_Function write_function,
61 LV2UI_Controller controller,
63 const LV2_Feature* const* features)
65 ACompUI* ui = (ACompUI*)calloc (1, sizeof (ACompUI));
66 ui->write = write_function;
67 ui->controller = controller;
70 *widget = setup_ui (ui);
75 cleanup (LV2UI_Handle handle)
77 ACompUI* ui = (ACompUI*)handle;
82 port_event (LV2UI_Handle handle,
88 ACompUI* ui = (ACompUI*)handle;
91 /******************************************************************************
96 extension_data (const char* uri)
101 static const LV2UI_Descriptor descriptor = {
110 const LV2UI_Descriptor*
111 lv2ui_descriptor (uint32_t index)