@@ -247,6 +247,41 @@ static void effects_monitor_param_cb(proto_t *proto)
247247 protocol_response_int (resp , proto );
248248}
249249
250+ static void effects_flush_params_cb (proto_t * proto )
251+ {
252+ int resp ;
253+ int param_count = atoi (proto -> list [2 ]);
254+ flushed_param_t * params ;
255+
256+ if (param_count == 0 )
257+ {
258+ protocol_response_int (ERR_ASSIGNMENT_INVALID_OP , proto );
259+ return ;
260+ }
261+
262+ params = malloc (sizeof (flushed_param_t ) * param_count );
263+
264+ if (params != NULL )
265+ {
266+ for (int i = 0 ; i < param_count ; i ++ )
267+ {
268+ params [i ].symbol = proto -> list [3 + i * 2 ];
269+ params [i ].value = atof (proto -> list [4 + i * 2 ]);
270+ }
271+ }
272+ else
273+ {
274+ protocol_response_int (ERR_MEMORY_ALLOCATION , proto );
275+ return ;
276+ }
277+
278+ resp = effects_flush_parameters (atoi (proto -> list [1 ]), param_count , params );
279+
280+ free (params );
281+
282+ protocol_response_int (resp , proto );
283+ }
284+
250285static void effects_set_property_cb (proto_t * proto )
251286{
252287 int resp ;
@@ -715,6 +750,7 @@ static int mod_host_init(jack_client_t* client, int socket_port, int feedback_po
715750 protocol_add_command (EFFECT_PARAM_SET , effects_set_param_cb );
716751 protocol_add_command (EFFECT_PARAM_GET , effects_get_param_cb );
717752 protocol_add_command (EFFECT_PARAM_MON , effects_monitor_param_cb );
753+ protocol_add_command (EFFECT_PARAMS_FLUSH , effects_flush_params_cb );
718754 protocol_add_command (EFFECT_PATCH_GET , effects_get_property_cb );
719755 protocol_add_command (EFFECT_PATCH_SET , effects_set_property_cb );
720756 protocol_add_command (EFFECT_LICENSEE , effects_licensee_cb );
0 commit comments