-void PluginLV2ClientConfig::copy_from(PluginLV2ClientConfig &that)
-{
- if( nb_ports != that.nb_ports ) {
- reset();
- nb_ports = that.nb_ports;
- names = new const char *[nb_ports];
- for( int i=0; i<nb_ports; ++i ) names[i] = 0;
- mins = new float[nb_ports];
- maxs = new float[nb_ports];
- ctls = new float[nb_ports];
- }
- for( int i=0; i<nb_ports; ++i ) {
- delete [] names[i];
- names[i] = cstrdup(that.names[i]);
- mins[i] = that.mins[i];
- maxs[i] = that.maxs[i];
- ctls[i] = that.ctls[i];
- }
- remove_all_objects();
- for( int i=0; i<that.size(); ++i ) {
- append(new PluginLV2Client_Opt(this, that[i]->sym, that[i]->idx));
- }
-}
-
-void PluginLV2ClientConfig::interpolate(PluginLV2ClientConfig &prev, PluginLV2ClientConfig &next,
- int64_t prev_frame, int64_t next_frame, int64_t current_frame)
-{
- copy_from(prev);
-}
-
-void PluginLV2ClientConfig::init_lv2(const LilvPlugin *lilv)
-{
- reset();
- nb_ports = lilv_plugin_get_num_ports(lilv);
- names = new const char *[nb_ports];
- mins = new float[nb_ports];
- maxs = new float[nb_ports];
- ctls = new float[nb_ports];
- lilv_plugin_get_port_ranges_float(lilv, mins, maxs, ctls);
- for( int i=0; i<nb_ports; ++i ) {
- const LilvPort *lp = lilv_plugin_get_port_by_index(lilv, i);
- LilvNode *pnm = lilv_port_get_name(lilv, lp);
- names[i] = cstrdup(lilv_node_as_string(pnm));
- lilv_node_free(pnm);
- }
-}
-
-int PluginLV2ClientConfig::update()
-{
- int ret = 0;
- PluginLV2ClientConfig &conf = *this;
- for( int i=0; i<size(); ++i ) {
- if( conf[i]->item_value->update() ) ++ret;
- }
- return ret;
-}
-