- return ret;
-}
-
-PluginLV2ClientReset::
-PluginLV2ClientReset(PluginLV2ClientWindow *gui, int x, int y)
- : BC_GenericButton(x, y, _("Reset"))
-{
- this->gui = gui;
-}
-
-PluginLV2ClientReset::
-~PluginLV2ClientReset()
-{
-}
-
-int PluginLV2ClientReset::handle_event()
-{
- PluginLV2Client *plugin = gui->plugin;
- plugin->init_lv2();
- gui->selected = 0;
- gui->update_selected();
- gui->panel->update();
- plugin->send_configure_change();
- return 1;
-}
-
-PluginLV2ClientText::
-PluginLV2ClientText(PluginLV2ClientWindow *gui, int x, int y, int w)
- : BC_TextBox(x, y, w, 1, (char *)"")
-{
- this->gui = gui;
-}
-
-PluginLV2ClientText::
-~PluginLV2ClientText()
-{
-}
-
-int PluginLV2ClientText::handle_event()
-{
- return 0;
-}
-
-
-PluginLV2ClientApply::
-PluginLV2ClientApply(PluginLV2ClientWindow *gui, int x, int y)
- : BC_GenericButton(x, y, _("Apply"))
-{
- this->gui = gui;
-}
-
-PluginLV2ClientApply::
-~PluginLV2ClientApply()
-{
-}
-
-int PluginLV2ClientApply::handle_event()
-{
- const char *text = gui->text->get_text();
- if( text && gui->selected ) {
- gui->selected->update(atof(text));
- gui->update_selected();
- gui->plugin->send_configure_change();
- }
- return 1;
-}
-
-
-PluginLV2Client_OptPanel::
-PluginLV2Client_OptPanel(PluginLV2ClientWindow *gui, int x, int y, int w, int h)
- : BC_ListBox(x, y, w, h, LISTBOX_TEXT), opts(items[0]), vals(items[1])
-{
- this->gui = gui;
- update(); // init col/wid/columns
-}
-
-PluginLV2Client_OptPanel::
-~PluginLV2Client_OptPanel()
-{
-}
-
-int PluginLV2Client_OptPanel::selection_changed()
-{
- PluginLV2Client_Opt *opt = 0;
- BC_ListBoxItem *item = get_selection(0, 0);
- if( item ) {
- PluginLV2Client_OptName *opt_name = (PluginLV2Client_OptName *)item;
- opt = opt_name->opt;
- }
- gui->update(opt);
- return 1;
-}
-
-void PluginLV2Client_OptPanel::update()
-{
- opts.remove_all();
- vals.remove_all();
- PluginLV2ClientConfig &conf = gui->plugin->config;
- for( int i=0; i<conf.size(); ++i ) {
- PluginLV2Client_Opt *opt = conf[i];
- opts.append(opt->item_name);
- vals.append(opt->item_value);
- }
- const char *cols[] = { "option", "value", };
- const int col1_w = 150;
- int wids[] = { col1_w, get_w()-col1_w };
- BC_ListBox::update(&items[0], &cols[0], &wids[0], sizeof(items)/sizeof(items[0]));
-}
-
-PluginLV2ClientWindow::PluginLV2ClientWindow(PluginLV2Client *plugin)
- : PluginClientWindow(plugin, 500, 300, 500, 300, 1)
-{
- this->plugin = plugin;
- selected = 0;
-}
-
-PluginLV2ClientWindow::~PluginLV2ClientWindow()
-{