191
189
void calf_plugins::plugin_ctl_iface::clear_preset() {
192
190
int param_count = get_metadata_iface()->get_param_count();
193
for (int i=0; i < param_count; i++)
191
for (int i = 0; i < param_count; i++)
195
193
const parameter_properties &pp = *get_metadata_iface()->get_param_props(i);
196
if ((pp.flags & PF_TYPEMASK) == PF_STRING)
198
configure(pp.short_name, pp.choices ? pp.choices[0] : "");
201
set_param_value(i, pp.def_value);
194
set_param_value(i, pp.def_value);
196
const char *const *vars = get_metadata_iface()->get_configure_vars();
199
for (int i = 0; vars[i]; i++)
200
configure(vars[i], NULL);
218
bool calf_plugins::check_for_message_context_ports(const parameter_properties *parameters, int count)
220
for (int i = count - 1; i >= 0; i--)
222
if (parameters[i].flags & PF_PROP_MSGCONTEXT)
228
bool calf_plugins::check_for_string_ports(const parameter_properties *parameters, int count)
230
for (int i = count - 1; i >= 0; i--)
232
if ((parameters[i].flags & PF_TYPEMASK) == PF_STRING)
234
if ((parameters[i].flags & PF_TYPEMASK) < PF_STRING)
240
bool calf_plugins::get_freq_gridline(int subindex, float &pos, bool &vertical, std::string &legend, cairo_iface *context, bool use_frequencies)
217
bool calf_plugins::get_freq_gridline(int subindex, float &pos, bool &vertical, std::string &legend, cairo_iface *context, bool use_frequencies, float res, float ofs)
242
219
if (subindex < 0 )
345
///////////////////////////////////////////////////////////////////////////////////////
347
std::string table_edit_iface::get_cell(int param, int row, int column) const
349
return calf_utils::i2s(row)+":"+calf_utils::i2s(column);
323
///////////////////////////////////////////////////////////////////////////////////////
325
bool calf_plugins::parse_table_key(const char *key, const char *prefix, bool &is_rows, int &row, int &column)
330
if (0 != strncmp(key, prefix, strlen(prefix)))
333
key += strlen(prefix);
335
if (!strcmp(key, "rows"))
341
const char *comma = strchr(key, ',');
344
row = atoi(string(key, comma - key).c_str());
345
column = atoi(comma + 1);
349
printf("Unknown key %s under prefix %s", key, prefix);
354
///////////////////////////////////////////////////////////////////////////////////////
356
const char *mod_mapping_names[] = { "0..1", "-1..1", "-1..0", "x^2", "2x^2-1", "ASqr", "ASqrBip", "Para", NULL };
358
mod_matrix_metadata::mod_matrix_metadata(unsigned int _rows, const char **_src_names, const char **_dest_names)
359
: mod_src_names(_src_names)
360
, mod_dest_names(_dest_names)
363
table_column_info tci[6] = {
364
{ "Source", TCT_ENUM, 0, 0, 0, mod_src_names },
365
{ "Mapping", TCT_ENUM, 0, 0, 0, mod_mapping_names },
366
{ "Modulator", TCT_ENUM, 0, 0, 0, mod_src_names },
367
{ "Amount", TCT_FLOAT, 0, 1, 1, NULL},
368
{ "Destination", TCT_ENUM, 0, 0, 0, mod_dest_names },
371
assert(sizeof(table_columns) == sizeof(tci));
372
memcpy(table_columns, tci, sizeof(table_columns));
375
const table_column_info *mod_matrix_metadata::get_table_columns() const
377
return table_columns;
380
uint32_t mod_matrix_metadata::get_table_rows() const
352
385
///////////////////////////////////////////////////////////////////////////////////////