X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fpluginlv2ui.C;h=64db9b2919eb0b75d22b3a5fc2ea3129cf3374ea;hb=9bfa5ffc623a598d68264609cad82d71432981c5;hp=17f072a2c6bf63b6c5960f21d7c364aa10e5199c;hpb=7fd85fb66168f6b518c5f2d73e04036e87faa0e1;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/pluginlv2ui.C b/cinelerra-5.1/cinelerra/pluginlv2ui.C index 17f072a2..64db9b29 100644 --- a/cinelerra-5.1/cinelerra/pluginlv2ui.C +++ b/cinelerra-5.1/cinelerra/pluginlv2ui.C @@ -1,3 +1,22 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ // shared between parent/child fork #include "language.h" @@ -114,6 +133,7 @@ bool PluginLV2UI::lv2ui_resizable() return !fs_matches && !nrs_matches; } +//force= 1:ctls(all),gui(all) 0:changed(ctls) -1:gui(all) int PluginLV2UI::update_lv2_input(float *vals, int force) { int ret = 0; @@ -122,9 +142,12 @@ int PluginLV2UI::update_lv2_input(float *vals, int force) int idx = config[i]->idx; float val = vals[idx]; if( !force && ctls[idx] == val ) continue; - ctls[idx] = val; - update_control(idx, sizeof(ctls[idx]), 0, &ctls[idx]); - ++ret; + if( force >= 0 ) { + ctls[idx] = val; + ++ret; + } + if( force ) + update_control(idx, sizeof(val), 0, &val); } return ret; } @@ -164,28 +187,7 @@ void PluginLV2ChildUI::start_gui() update_lv2_input(config.ctls, 1); connect_ports(config, PORTS_CONTROL | PORTS_ATOM); int n = 0; -#if 1 -// some plugins must have pointers, or they crash - float inp[nb_inputs], out[nb_outputs]; - memset(&inp, 0, nb_inputs*sizeof(float)); - memset(&out, 0, nb_outputs*sizeof(float)); - int ich = 0, och = 0; - for( int i=0; i