SOUND4 x1.CLOUD Library [1.3.8]
vars_process_impl.h
Go to the documentation of this file.
1 // WARNING: Automated generated files, do not edit
2 #include "vars.h"
3 #include "jsonconvert.h"
4 #include <string.h>
5 
6 // =============================
7 // ======= scales enums =======
8 // =============================
9 
10 // === enum lim_release ===
11  static const char *e_lim_release_to_string(enum e_lim_release value)
12  {
13  switch (value) {
14  case e_lim_release_Slow:
15  return "Slow";
17  return "Medium Slow";
19  return "Medium Fast";
20  case e_lim_release_Fast:
21  return "Fast";
22  };
23  return "";
24  }
25  static bool string_to_e_lim_release(const char *str, enum e_lim_release *value)
26  {
27  // Try with Name
28  if (strcasecmp(str,"Slow")==0)
29  {
30  *value=e_lim_release_Slow;
31  return true;
32  }
33  if (strcasecmp(str,"Medium Slow")==0)
34  {
36  return true;
37  }
38  if (strcasecmp(str,"Medium Fast")==0)
39  {
41  return true;
42  }
43  if (strcasecmp(str,"Fast")==0)
44  {
45  *value=e_lim_release_Fast;
46  return true;
47  }
48  // Try with ID
49  if (strcasecmp(str,"Medium_Slow")==0)
50  {
52  return true;
53  }
54  if (strcasecmp(str,"Medium_Fast")==0)
55  {
57  return true;
58  }
59  // Try with Title
60  // Find if starts with one ID
61  {
62  int found=0;
63  e_lim_release found_id;
64  if (strncasecmp(str,"Slow", strlen("Slow"))==0)
65  {
66  found_id=e_lim_release_Slow;
67  found++;
68  }
69  if (strncasecmp(str,"Medium_Slow", strlen("Medium_Slow"))==0)
70  {
72  found++;
73  }
74  if (strncasecmp(str,"Medium_Fast", strlen("Medium_Fast"))==0)
75  {
77  found++;
78  }
79  if (strncasecmp(str,"Fast", strlen("Fast"))==0)
80  {
81  found_id=e_lim_release_Fast;
82  found++;
83  }
84  if (found==1) {
85  *value=found_id;
86  return true;
87  }
88  }
89  PLOG_WARNING << "Failed to convert '" << str << "' to enum lim_release";
90  return false;
91  }
93 
94 // === enum bs1770_vutype ===
95  static const char *e_bs1770_vutype_to_string(enum e_bs1770_vutype value)
96  {
97  switch (value) {
99  return "Momentary";
101  return "Short-Term";
103  return "Long-Term";
104  };
105  return "";
106  }
107  static bool string_to_e_bs1770_vutype(const char *str, enum e_bs1770_vutype *value)
108  {
109  // Try with Name
110  if (strcasecmp(str,"Momentary")==0)
111  {
113  return true;
114  }
115  if (strcasecmp(str,"Short-Term")==0)
116  {
118  return true;
119  }
120  if (strcasecmp(str,"Long-Term")==0)
121  {
123  return true;
124  }
125  // Try with ID
126  if (strcasecmp(str,"ShortTerm")==0)
127  {
129  return true;
130  }
131  if (strcasecmp(str,"LongTerm")==0)
132  {
134  return true;
135  }
136  // Try with Title
137  // Find if starts with one ID
138  {
139  int found=0;
140  e_bs1770_vutype found_id;
141  if (strncasecmp(str,"Momentary", strlen("Momentary"))==0)
142  {
143  found_id=e_bs1770_vutype_Momentary;
144  found++;
145  }
146  if (strncasecmp(str,"ShortTerm", strlen("ShortTerm"))==0)
147  {
148  found_id=e_bs1770_vutype_ShortTerm;
149  found++;
150  }
151  if (strncasecmp(str,"LongTerm", strlen("LongTerm"))==0)
152  {
153  found_id=e_bs1770_vutype_LongTerm;
154  found++;
155  }
156  if (found==1) {
157  *value=found_id;
158  return true;
159  }
160  }
161  PLOG_WARNING << "Failed to convert '" << str << "' to enum bs1770_vutype";
162  return false;
163  }
165 
166 // === enum lk_mode ===
167  static const char *e_lk_mode_to_string(enum e_lk_mode value)
168  {
169  switch (value) {
171  return "Stereo Link";
173  return "Independant";
175  return "Mixed Channel";
176  };
177  return "";
178  }
179  static bool string_to_e_lk_mode(const char *str, enum e_lk_mode *value)
180  {
181  // Try with Name
182  if (strcasecmp(str,"Stereo Link")==0)
183  {
184  *value=e_lk_mode_Stereo_Link;
185  return true;
186  }
187  if (strcasecmp(str,"Independant")==0)
188  {
189  *value=e_lk_mode_Independant;
190  return true;
191  }
192  if (strcasecmp(str,"Mixed Channel")==0)
193  {
195  return true;
196  }
197  // Try with ID
198  if (strcasecmp(str,"Stereo_Link")==0)
199  {
200  *value=e_lk_mode_Stereo_Link;
201  return true;
202  }
203  if (strcasecmp(str,"Mixed_Channel")==0)
204  {
206  return true;
207  }
208  // Try with Title
209  // Find if starts with one ID
210  {
211  int found=0;
212  e_lk_mode found_id;
213  if (strncasecmp(str,"Stereo_Link", strlen("Stereo_Link"))==0)
214  {
215  found_id=e_lk_mode_Stereo_Link;
216  found++;
217  }
218  if (strncasecmp(str,"Independant", strlen("Independant"))==0)
219  {
220  found_id=e_lk_mode_Independant;
221  found++;
222  }
223  if (strncasecmp(str,"Mixed_Channel", strlen("Mixed_Channel"))==0)
224  {
225  found_id=e_lk_mode_Mixed_Channel;
226  found++;
227  }
228  if (found==1) {
229  *value=found_id;
230  return true;
231  }
232  }
233  PLOG_WARNING << "Failed to convert '" << str << "' to enum lk_mode";
234  return false;
235  }
237 
238 // === enum history_unit ===
239  static const char *e_history_unit_to_string(enum e_history_unit value)
240  {
241  switch (value) {
243  return "Second";
245  return "Minute";
246  case e_history_unit_Hour:
247  return "Hour";
248  case e_history_unit_Day:
249  return "Day";
250  };
251  return "";
252  }
253  static bool string_to_e_history_unit(const char *str, enum e_history_unit *value)
254  {
255  // Try with Name
256  if (strcasecmp(str,"Second")==0)
257  {
258  *value=e_history_unit_Second;
259  return true;
260  }
261  if (strcasecmp(str,"Minute")==0)
262  {
263  *value=e_history_unit_Minute;
264  return true;
265  }
266  if (strcasecmp(str,"Hour")==0)
267  {
268  *value=e_history_unit_Hour;
269  return true;
270  }
271  if (strcasecmp(str,"Day")==0)
272  {
273  *value=e_history_unit_Day;
274  return true;
275  }
276  // Try with ID
277  // Try with Title
278  // Find if starts with one ID
279  {
280  int found=0;
281  e_history_unit found_id;
282  if (strncasecmp(str,"Second", strlen("Second"))==0)
283  {
284  found_id=e_history_unit_Second;
285  found++;
286  }
287  if (strncasecmp(str,"Minute", strlen("Minute"))==0)
288  {
289  found_id=e_history_unit_Minute;
290  found++;
291  }
292  if (strncasecmp(str,"Hour", strlen("Hour"))==0)
293  {
294  found_id=e_history_unit_Hour;
295  found++;
296  }
297  if (strncasecmp(str,"Day", strlen("Day"))==0)
298  {
299  found_id=e_history_unit_Day;
300  found++;
301  }
302  if (found==1) {
303  *value=found_id;
304  return true;
305  }
306  }
307  PLOG_WARNING << "Failed to convert '" << str << "' to enum history_unit";
308  return false;
309  }
311 
312 // === enum history_var ===
313  static const char *e_history_var_to_string(enum e_history_var value)
314  {
315  switch (value) {
317  return "Input Long-Term LUFS";
319  return "Output Long-Term LUFS";
320  };
321  return "";
322  }
323  static bool string_to_e_history_var(const char *str, enum e_history_var *value)
324  {
325  // Try with Name
326  if (strcasecmp(str,"Input Long-Term LUFS")==0)
327  {
329  return true;
330  }
331  if (strcasecmp(str,"Output Long-Term LUFS")==0)
332  {
334  return true;
335  }
336  // Try with ID
337  if (strcasecmp(str,"in_bs_long")==0)
338  {
340  return true;
341  }
342  if (strcasecmp(str,"out_bs_long")==0)
343  {
345  return true;
346  }
347  // Try with Title
348  // Find if starts with one ID
349  {
350  int found=0;
351  e_history_var found_id;
352  if (strncasecmp(str,"in_bs_long", strlen("in_bs_long"))==0)
353  {
354  found_id=e_history_var_in_bs_long;
355  found++;
356  }
357  if (strncasecmp(str,"out_bs_long", strlen("out_bs_long"))==0)
358  {
359  found_id=e_history_var_out_bs_long;
360  found++;
361  }
362  if (found==1) {
363  *value=found_id;
364  return true;
365  }
366  }
367  PLOG_WARNING << "Failed to convert '" << str << "' to enum history_var";
368  return false;
369  }
371 
372 // =============================
373 // ==== scales constraints ====
374 // =============================
375 
376 // =============================
377 // ========== structs =========
378 // =============================
379 
380 // === struct json_peakhold ===
381  template <>
382  struct JsonConvert<json_peakhold> {
383 
384  static bool FromJson(const JSON_Value& json, json_peakhold& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_peakhold> &constraints = JsonConstraint<json_peakhold>()) {
385  if (sizeof(json_peakhold)==0) return true; // quick empty struct
386  if (json.IsNull()) { return true; }
387  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
388  if ( !JsonHelper::Member_FromJson(json, flags, "hold", data.hold, allocator, JsonConstraint<S4Float>(-6,6))) return false;
389  if ( !JsonHelper::Member_FromJson(json, flags, "pk", data.pk, allocator, JsonConstraint<S4Float>(-6,6))) return false;
390  return true;
391  }
392 
393  static bool ToJson(JSON_Value &json, const json_peakhold& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
394  if (sizeof(json_peakhold)==0) return true; // quick empty struct
395  if (json.IsNull ()) {
396  json.SetObject ();
397  flags &= ~JSON_CVT_ONLYREQ; // children get all
398  } else if (!json.IsObject()) {
399  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
400  return false;
401  }
402  if (!JsonHelper::Member_ToJson(json, flags, allocator, "hold", data.hold)) return false;
403  if (!JsonHelper::Member_ToJson(json, flags, allocator, "pk", data.pk)) return false;
404  if (json.MemberCount()==0) json.SetNull();
405  return true;
406  }
407 
408  static bool DiffToJson(JSON_Value &json, const json_peakhold& data [[maybe_unused]], json_peakhold& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
409  if (sizeof(json_peakhold)==0) return true; // quick empty struct
410  if (json.IsNull ()) {
411  json.SetObject ();
412  flags &= ~JSON_CVT_ONLYREQ; // children get all
413  } else if (!json.IsObject()) {
414  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
415  return false;
416  }
417  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "hold", data.hold, ref.hold)) return false;
418  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "pk", data.pk, ref.pk)) return false;
419  if (json.MemberCount()==0) json.SetNull();
420  return true;
421  }
422 
423  static void ForceChange(const json_peakhold& data [[maybe_unused]], json_peakhold& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
424  JsonHelper::Member_ForceChange(allocator, "hold", data.hold, ref.hold);
425  JsonHelper::Member_ForceChange(allocator, "pk", data.pk, ref.pk);
426  }
427 
428  };
429 
430 // === struct json_peakhold_stereo ===
431  template <>
432  struct JsonConvert<json_peakhold_stereo> {
433 
434  static bool FromJson(const JSON_Value& json, json_peakhold_stereo& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_peakhold_stereo> &constraints = JsonConstraint<json_peakhold_stereo>()) {
435  if (sizeof(json_peakhold_stereo)==0) return true; // quick empty struct
436  if (json.IsNull()) { return true; }
437  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
438  if ( !JsonHelper::Member_FromJson(json, flags, "hold", data.hold, allocator, JsonConstraint<S4Float>(-6,6))) return false;
439  if ( !JsonHelper::Member_FromJson(json, flags, "pk", data.pk, allocator, JsonConstraint<S4Float>(-6,6))) return false;
440  return true;
441  }
442 
443  static bool ToJson(JSON_Value &json, const json_peakhold_stereo& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
444  if (sizeof(json_peakhold_stereo)==0) return true; // quick empty struct
445  if (json.IsNull ()) {
446  json.SetObject ();
447  flags &= ~JSON_CVT_ONLYREQ; // children get all
448  } else if (!json.IsObject()) {
449  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
450  return false;
451  }
452  if (!JsonHelper::Member_ToJson(json, flags, allocator, "hold", data.hold)) return false;
453  if (!JsonHelper::Member_ToJson(json, flags, allocator, "pk", data.pk)) return false;
454  if (json.MemberCount()==0) json.SetNull();
455  return true;
456  }
457 
458  static bool DiffToJson(JSON_Value &json, const json_peakhold_stereo& data [[maybe_unused]], json_peakhold_stereo& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
459  if (sizeof(json_peakhold_stereo)==0) return true; // quick empty struct
460  if (json.IsNull ()) {
461  json.SetObject ();
462  flags &= ~JSON_CVT_ONLYREQ; // children get all
463  } else if (!json.IsObject()) {
464  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
465  return false;
466  }
467  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "hold", data.hold, ref.hold)) return false;
468  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "pk", data.pk, ref.pk)) return false;
469  if (json.MemberCount()==0) json.SetNull();
470  return true;
471  }
472 
473  static void ForceChange(const json_peakhold_stereo& data [[maybe_unused]], json_peakhold_stereo& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
474  JsonHelper::Member_ForceChange(allocator, "hold", data.hold, ref.hold);
475  JsonHelper::Member_ForceChange(allocator, "pk", data.pk, ref.pk);
476  }
477 
478  };
479 
480 // === struct json_vupeakhold_stereo ===
481  template <>
482  struct JsonConvert<json_vupeakhold_stereo> {
483 
484  static bool FromJson(const JSON_Value& json, json_vupeakhold_stereo& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_vupeakhold_stereo> &constraints = JsonConstraint<json_vupeakhold_stereo>()) {
485  if (sizeof(json_vupeakhold_stereo)==0) return true; // quick empty struct
486  if (json.IsNull()) { return true; }
487  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
488  if ( !JsonHelper::Member_FromJson(json, flags, "hold", data.hold, allocator, JsonConstraint<S4Float>(-6,6))) return false;
489  if ( !JsonHelper::Member_FromJson(json, flags, "pk", data.pk, allocator, JsonConstraint<S4Float>(-6,6))) return false;
490  if ( !JsonHelper::Member_FromJson(json, flags, "vu", data.vu, allocator, JsonConstraint<S4Float>(-6,6))) return false;
491  return true;
492  }
493 
494  static bool ToJson(JSON_Value &json, const json_vupeakhold_stereo& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
495  if (sizeof(json_vupeakhold_stereo)==0) return true; // quick empty struct
496  if (json.IsNull ()) {
497  json.SetObject ();
498  flags &= ~JSON_CVT_ONLYREQ; // children get all
499  } else if (!json.IsObject()) {
500  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
501  return false;
502  }
503  if (!JsonHelper::Member_ToJson(json, flags, allocator, "hold", data.hold)) return false;
504  if (!JsonHelper::Member_ToJson(json, flags, allocator, "pk", data.pk)) return false;
505  if (!JsonHelper::Member_ToJson(json, flags, allocator, "vu", data.vu)) return false;
506  if (json.MemberCount()==0) json.SetNull();
507  return true;
508  }
509 
510  static bool DiffToJson(JSON_Value &json, const json_vupeakhold_stereo& data [[maybe_unused]], json_vupeakhold_stereo& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
511  if (sizeof(json_vupeakhold_stereo)==0) return true; // quick empty struct
512  if (json.IsNull ()) {
513  json.SetObject ();
514  flags &= ~JSON_CVT_ONLYREQ; // children get all
515  } else if (!json.IsObject()) {
516  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
517  return false;
518  }
519  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "hold", data.hold, ref.hold)) return false;
520  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "pk", data.pk, ref.pk)) return false;
521  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "vu", data.vu, ref.vu)) return false;
522  if (json.MemberCount()==0) json.SetNull();
523  return true;
524  }
525 
526  static void ForceChange(const json_vupeakhold_stereo& data [[maybe_unused]], json_vupeakhold_stereo& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
527  JsonHelper::Member_ForceChange(allocator, "hold", data.hold, ref.hold);
528  JsonHelper::Member_ForceChange(allocator, "pk", data.pk, ref.pk);
529  JsonHelper::Member_ForceChange(allocator, "vu", data.vu, ref.vu);
530  }
531 
532  };
533 
534 // === struct json_peak_percent ===
535  template <>
536  struct JsonConvert<json_peak_percent> {
537 
538  static bool FromJson(const JSON_Value& json, json_peak_percent& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_peak_percent> &constraints = JsonConstraint<json_peak_percent>()) {
539  if (sizeof(json_peak_percent)==0) return true; // quick empty struct
540  if (json.IsNull()) { return true; }
541  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
542  if ( !JsonHelper::Member_FromJson(json, flags, "hold", data.hold, allocator, JsonConstraint<S4Float>(0,100))) return false;
543  if ( !JsonHelper::Member_FromJson(json, flags, "pk", data.pk, allocator, JsonConstraint<S4Float>(0,100))) return false;
544  return true;
545  }
546 
547  static bool ToJson(JSON_Value &json, const json_peak_percent& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
548  if (sizeof(json_peak_percent)==0) return true; // quick empty struct
549  if (json.IsNull ()) {
550  json.SetObject ();
551  flags &= ~JSON_CVT_ONLYREQ; // children get all
552  } else if (!json.IsObject()) {
553  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
554  return false;
555  }
556  if (!JsonHelper::Member_ToJson(json, flags, allocator, "hold", data.hold)) return false;
557  if (!JsonHelper::Member_ToJson(json, flags, allocator, "pk", data.pk)) return false;
558  if (json.MemberCount()==0) json.SetNull();
559  return true;
560  }
561 
562  static bool DiffToJson(JSON_Value &json, const json_peak_percent& data [[maybe_unused]], json_peak_percent& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
563  if (sizeof(json_peak_percent)==0) return true; // quick empty struct
564  if (json.IsNull ()) {
565  json.SetObject ();
566  flags &= ~JSON_CVT_ONLYREQ; // children get all
567  } else if (!json.IsObject()) {
568  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
569  return false;
570  }
571  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "hold", data.hold, ref.hold)) return false;
572  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "pk", data.pk, ref.pk)) return false;
573  if (json.MemberCount()==0) json.SetNull();
574  return true;
575  }
576 
577  static void ForceChange(const json_peak_percent& data [[maybe_unused]], json_peak_percent& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
578  JsonHelper::Member_ForceChange(allocator, "hold", data.hold, ref.hold);
579  JsonHelper::Member_ForceChange(allocator, "pk", data.pk, ref.pk);
580  }
581 
582  };
583 
584 // === struct json_band_peakhold ===
585  template <>
586  struct JsonConvert<json_band_peakhold> {
587 
588  static bool FromJson(const JSON_Value& json, json_band_peakhold& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_band_peakhold> &constraints = JsonConstraint<json_band_peakhold>()) {
589  if (sizeof(json_band_peakhold)==0) return true; // quick empty struct
590  if (json.IsNull()) { return true; }
591  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
592  if ( !JsonHelper::Member_FromJson(json, flags, "hold", data.hold, allocator, JsonConstraint<S4Float>(-6,6))) return false;
593  if ( !JsonHelper::Member_FromJson(json, flags, "pk", data.pk, allocator, JsonConstraint<S4Float>(-6,6))) return false;
594  return true;
595  }
596 
597  static bool ToJson(JSON_Value &json, const json_band_peakhold& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
598  if (sizeof(json_band_peakhold)==0) return true; // quick empty struct
599  if (json.IsNull ()) {
600  json.SetObject ();
601  flags &= ~JSON_CVT_ONLYREQ; // children get all
602  } else if (!json.IsObject()) {
603  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
604  return false;
605  }
606  if (!JsonHelper::Member_ToJson(json, flags, allocator, "hold", data.hold)) return false;
607  if (!JsonHelper::Member_ToJson(json, flags, allocator, "pk", data.pk)) return false;
608  if (json.MemberCount()==0) json.SetNull();
609  return true;
610  }
611 
612  static bool DiffToJson(JSON_Value &json, const json_band_peakhold& data [[maybe_unused]], json_band_peakhold& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
613  if (sizeof(json_band_peakhold)==0) return true; // quick empty struct
614  if (json.IsNull ()) {
615  json.SetObject ();
616  flags &= ~JSON_CVT_ONLYREQ; // children get all
617  } else if (!json.IsObject()) {
618  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
619  return false;
620  }
621  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "hold", data.hold, ref.hold)) return false;
622  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "pk", data.pk, ref.pk)) return false;
623  if (json.MemberCount()==0) json.SetNull();
624  return true;
625  }
626 
627  static void ForceChange(const json_band_peakhold& data [[maybe_unused]], json_band_peakhold& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
628  JsonHelper::Member_ForceChange(allocator, "hold", data.hold, ref.hold);
629  JsonHelper::Member_ForceChange(allocator, "pk", data.pk, ref.pk);
630  }
631 
632  };
633 
634 // === struct json_bandlim_peakhold ===
635  template <>
636  struct JsonConvert<json_bandlim_peakhold> {
637 
638  static bool FromJson(const JSON_Value& json, json_bandlim_peakhold& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_bandlim_peakhold> &constraints = JsonConstraint<json_bandlim_peakhold>()) {
639  if (sizeof(json_bandlim_peakhold)==0) return true; // quick empty struct
640  if (json.IsNull()) { return true; }
641  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
642  if ( !JsonHelper::Member_FromJson(json, flags, "hold", data.hold, allocator, JsonConstraint<S4Float>(-6,6))) return false;
643  if ( !JsonHelper::Member_FromJson(json, flags, "pk", data.pk, allocator, JsonConstraint<S4Float>(-6,6))) return false;
644  return true;
645  }
646 
647  static bool ToJson(JSON_Value &json, const json_bandlim_peakhold& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
648  if (sizeof(json_bandlim_peakhold)==0) return true; // quick empty struct
649  if (json.IsNull ()) {
650  json.SetObject ();
651  flags &= ~JSON_CVT_ONLYREQ; // children get all
652  } else if (!json.IsObject()) {
653  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
654  return false;
655  }
656  if (!JsonHelper::Member_ToJson(json, flags, allocator, "hold", data.hold)) return false;
657  if (!JsonHelper::Member_ToJson(json, flags, allocator, "pk", data.pk)) return false;
658  if (json.MemberCount()==0) json.SetNull();
659  return true;
660  }
661 
662  static bool DiffToJson(JSON_Value &json, const json_bandlim_peakhold& data [[maybe_unused]], json_bandlim_peakhold& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
663  if (sizeof(json_bandlim_peakhold)==0) return true; // quick empty struct
664  if (json.IsNull ()) {
665  json.SetObject ();
666  flags &= ~JSON_CVT_ONLYREQ; // children get all
667  } else if (!json.IsObject()) {
668  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
669  return false;
670  }
671  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "hold", data.hold, ref.hold)) return false;
672  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "pk", data.pk, ref.pk)) return false;
673  if (json.MemberCount()==0) json.SetNull();
674  return true;
675  }
676 
677  static void ForceChange(const json_bandlim_peakhold& data [[maybe_unused]], json_bandlim_peakhold& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
678  JsonHelper::Member_ForceChange(allocator, "hold", data.hold, ref.hold);
679  JsonHelper::Member_ForceChange(allocator, "pk", data.pk, ref.pk);
680  }
681 
682  };
683 
684 // =============================
685 // ========== objects =========
686 // =============================
687 // === object preset_setup ===
688  // === Preset ===
689  template <>
690  struct JsonConvert<json_preset_setup> {
691 
692  static bool FromJson(const JSON_Value& json, json_preset_setup& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_preset_setup> &constraints = JsonConstraint<json_preset_setup>()) {
693  if (sizeof(json_preset_setup)==0) return true; // quick empty struct
694  if (json.IsNull()) { return true; }
695  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
696  if ( !JsonHelper::Member_FromJson(json, flags, "gate_on", data.gate_on, allocator)) return false;
697  if ( !JsonHelper::Member_FromJson(json, flags, "gate", data.gate, allocator, JsonConstraint<S4Float>(-100,0))) return false;
698  if ( !JsonHelper::Member_FromJson(json, flags, "hp_on", data.hp_on, allocator)) return false;
699  if ( !JsonHelper::Member_FromJson(json, flags, "hp_freq", data.hp_freq, allocator, JsonConstraint<S4Float>(10,200))) return false;
700  if ( !JsonHelper::Member_FromJson(json, flags, "stereo_link", data.stereo_link, allocator)) return false;
701  if ( !JsonHelper::Member_FromJson(json, flags, "display_agc", data.display_agc, allocator)) return false;
702  if ( !JsonHelper::Member_FromJson(json, flags, "display_tonefx", data.display_tonefx, allocator)) return false;
703  if ( !JsonHelper::Member_FromJson(json, flags, "display_stereofx", data.display_stereofx, allocator)) return false;
704  if ( !JsonHelper::Member_FromJson(json, flags, "display_bandprocess", data.display_bandprocess, allocator)) return false;
705  if ( !JsonHelper::Member_FromJson(json, flags, "display_bandlimiter", data.display_bandlimiter, allocator)) return false;
706  return true;
707  }
708 
709  static bool ToJson(JSON_Value &json, const json_preset_setup& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
710  if (sizeof(json_preset_setup)==0) return true; // quick empty struct
711  if (json.IsNull ()) {
712  json.SetObject ();
713  flags &= ~JSON_CVT_ONLYREQ; // children get all
714  } else if (!json.IsObject()) {
715  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
716  return false;
717  }
718  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gate_on", data.gate_on)) return false;
719  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gate", data.gate)) return false;
720  if (!JsonHelper::Member_ToJson(json, flags, allocator, "hp_on", data.hp_on)) return false;
721  if (!JsonHelper::Member_ToJson(json, flags, allocator, "hp_freq", data.hp_freq)) return false;
722  if (!JsonHelper::Member_ToJson(json, flags, allocator, "stereo_link", data.stereo_link)) return false;
723  if (!JsonHelper::Member_ToJson(json, flags, allocator, "display_agc", data.display_agc)) return false;
724  if (!JsonHelper::Member_ToJson(json, flags, allocator, "display_tonefx", data.display_tonefx)) return false;
725  if (!JsonHelper::Member_ToJson(json, flags, allocator, "display_stereofx", data.display_stereofx)) return false;
726  if (!JsonHelper::Member_ToJson(json, flags, allocator, "display_bandprocess", data.display_bandprocess)) return false;
727  if (!JsonHelper::Member_ToJson(json, flags, allocator, "display_bandlimiter", data.display_bandlimiter)) return false;
728  if (json.MemberCount()==0) json.SetNull();
729  return true;
730  }
731 
732  static bool DiffToJson(JSON_Value &json, const json_preset_setup& data [[maybe_unused]], json_preset_setup& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
733  if (sizeof(json_preset_setup)==0) return true; // quick empty struct
734  if (json.IsNull ()) {
735  json.SetObject ();
736  flags &= ~JSON_CVT_ONLYREQ; // children get all
737  } else if (!json.IsObject()) {
738  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
739  return false;
740  }
741  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gate_on", data.gate_on, ref.gate_on)) return false;
742  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gate", data.gate, ref.gate)) return false;
743  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "hp_on", data.hp_on, ref.hp_on)) return false;
744  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "hp_freq", data.hp_freq, ref.hp_freq)) return false;
745  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "stereo_link", data.stereo_link, ref.stereo_link)) return false;
746  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "display_agc", data.display_agc, ref.display_agc)) return false;
747  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "display_tonefx", data.display_tonefx, ref.display_tonefx)) return false;
748  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "display_stereofx", data.display_stereofx, ref.display_stereofx)) return false;
749  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "display_bandprocess", data.display_bandprocess, ref.display_bandprocess)) return false;
750  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "display_bandlimiter", data.display_bandlimiter, ref.display_bandlimiter)) return false;
751  if (json.MemberCount()==0) json.SetNull();
752  return true;
753  }
754 
755  static void ForceChange(const json_preset_setup& data [[maybe_unused]], json_preset_setup& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
756  JsonHelper::Member_ForceChange(allocator, "gate_on", data.gate_on, ref.gate_on);
757  JsonHelper::Member_ForceChange(allocator, "gate", data.gate, ref.gate);
758  JsonHelper::Member_ForceChange(allocator, "hp_on", data.hp_on, ref.hp_on);
759  JsonHelper::Member_ForceChange(allocator, "hp_freq", data.hp_freq, ref.hp_freq);
760  JsonHelper::Member_ForceChange(allocator, "stereo_link", data.stereo_link, ref.stereo_link);
761  JsonHelper::Member_ForceChange(allocator, "display_agc", data.display_agc, ref.display_agc);
762  JsonHelper::Member_ForceChange(allocator, "display_tonefx", data.display_tonefx, ref.display_tonefx);
763  JsonHelper::Member_ForceChange(allocator, "display_stereofx", data.display_stereofx, ref.display_stereofx);
764  JsonHelper::Member_ForceChange(allocator, "display_bandprocess", data.display_bandprocess, ref.display_bandprocess);
765  JsonHelper::Member_ForceChange(allocator, "display_bandlimiter", data.display_bandlimiter, ref.display_bandlimiter);
766  }
767 
768  };
769  // === VU ===
770  template <>
771  struct JsonConvert<jsonvu_preset_setup> {
772 
773  /* VU have no FromJson */
774 
775  static bool ToJson(JSON_Value &json, const jsonvu_preset_setup& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
776  if (sizeof(jsonvu_preset_setup)==0) return true; // quick empty struct
777  if (json.IsNull ()) {
778  json.SetObject ();
779  flags &= ~JSON_CVT_ONLYREQ; // children get all
780  } else if (!json.IsObject()) {
781  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
782  return false;
783  }
784  if (json.MemberCount()==0) json.SetNull();
785  return true;
786  }
787 
788  static bool DiffToJson(JSON_Value &json, const jsonvu_preset_setup& data [[maybe_unused]], jsonvu_preset_setup& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
789  if (sizeof(jsonvu_preset_setup)==0) return true; // quick empty struct
790  if (json.IsNull ()) {
791  json.SetObject ();
792  flags &= ~JSON_CVT_ONLYREQ; // children get all
793  } else if (!json.IsObject()) {
794  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
795  return false;
796  }
797  if (json.MemberCount()==0) json.SetNull();
798  return true;
799  }
800 
801  static void ForceChange(const jsonvu_preset_setup& data [[maybe_unused]], jsonvu_preset_setup& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
802  }
803 
804  };
805 // === object input ===
806  // === Preset ===
807  template <>
808  struct JsonConvert<json_input> {
809 
810  static bool FromJson(const JSON_Value& json, json_input& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_input> &constraints = JsonConstraint<json_input>()) {
811  if (sizeof(json_input)==0) return true; // quick empty struct
812  if (json.IsNull()) { return true; }
813  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
814  return true;
815  }
816 
817  static bool ToJson(JSON_Value &json, const json_input& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
818  if (sizeof(json_input)==0) return true; // quick empty struct
819  if (json.IsNull ()) {
820  json.SetObject ();
821  flags &= ~JSON_CVT_ONLYREQ; // children get all
822  } else if (!json.IsObject()) {
823  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
824  return false;
825  }
826  if (json.MemberCount()==0) json.SetNull();
827  return true;
828  }
829 
830  static bool DiffToJson(JSON_Value &json, const json_input& data [[maybe_unused]], json_input& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
831  if (sizeof(json_input)==0) return true; // quick empty struct
832  if (json.IsNull ()) {
833  json.SetObject ();
834  flags &= ~JSON_CVT_ONLYREQ; // children get all
835  } else if (!json.IsObject()) {
836  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
837  return false;
838  }
839  if (json.MemberCount()==0) json.SetNull();
840  return true;
841  }
842 
843  static void ForceChange(const json_input& data [[maybe_unused]], json_input& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
844  }
845 
846  };
847  // === VU ===
848  template <>
849  struct JsonConvert<jsonvu_input> {
850 
851  /* VU have no FromJson */
852 
853  static bool ToJson(JSON_Value &json, const jsonvu_input& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
854  if (sizeof(jsonvu_input)==0) return true; // quick empty struct
855  if (json.IsNull ()) {
856  json.SetObject ();
857  flags &= ~JSON_CVT_ONLYREQ; // children get all
858  } else if (!json.IsObject()) {
859  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
860  return false;
861  }
862  if (!JsonHelper::Member_ToJson(json, flags, allocator, "vu", data.vu)) return false;
863  if (!JsonHelper::Member_ToJson(json, flags, allocator, "standby", data.standby)) return false;
864  if (!JsonHelper::Member_ToJson(json, flags, allocator, "vuout", data.vuout)) return false;
865  if ((flags & JSON_CVT_WITHDEV) &&
866  !JsonHelper::Member_ToJson(json, flags, allocator, "bs_moment", data.bs_moment)) return false;
867  if ((flags & JSON_CVT_WITHDEV) &&
868  !JsonHelper::Member_ToJson(json, flags, allocator, "bs_short", data.bs_short)) return false;
869  if (!JsonHelper::Member_ToJson(json, flags, allocator, "bs_long", data.bs_long)) return false;
870  if (!JsonHelper::Member_ToJson(json, flags, allocator, "bs_user", data.bs_user)) return false;
871  if ((flags & JSON_CVT_WITHDEV) &&
872  !JsonHelper::Member_ToJson(json, flags, allocator, "bs_psr", data.bs_psr)) return false;
873  if ((flags & JSON_CVT_WITHDEV) &&
874  !JsonHelper::Member_ToJson(json, flags, allocator, "bs_plr", data.bs_plr)) return false;
875  if (json.MemberCount()==0) json.SetNull();
876  return true;
877  }
878 
879  static bool DiffToJson(JSON_Value &json, const jsonvu_input& data [[maybe_unused]], jsonvu_input& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
880  if (sizeof(jsonvu_input)==0) return true; // quick empty struct
881  if (json.IsNull ()) {
882  json.SetObject ();
883  flags &= ~JSON_CVT_ONLYREQ; // children get all
884  } else if (!json.IsObject()) {
885  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
886  return false;
887  }
888  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "vu", data.vu, ref.vu)) return false;
889  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "standby", data.standby, ref.standby)) return false;
890  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "vuout", data.vuout, ref.vuout)) return false;
891  if ((flags & JSON_CVT_WITHDEV) &&
892  !JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_moment", data.bs_moment, ref.bs_moment)) return false;
893  if ((flags & JSON_CVT_WITHDEV) &&
894  !JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_short", data.bs_short, ref.bs_short)) return false;
895  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_long", data.bs_long, ref.bs_long)) return false;
896  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_user", data.bs_user, ref.bs_user)) return false;
897  if ((flags & JSON_CVT_WITHDEV) &&
898  !JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_psr", data.bs_psr, ref.bs_psr)) return false;
899  if ((flags & JSON_CVT_WITHDEV) &&
900  !JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_plr", data.bs_plr, ref.bs_plr)) return false;
901  if (json.MemberCount()==0) json.SetNull();
902  return true;
903  }
904 
905  static void ForceChange(const jsonvu_input& data [[maybe_unused]], jsonvu_input& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
906  JsonHelper::Member_ForceChange(allocator, "vu", data.vu, ref.vu);
907  JsonHelper::Member_ForceChange(allocator, "standby", data.standby, ref.standby);
908  JsonHelper::Member_ForceChange(allocator, "vuout", data.vuout, ref.vuout);
909  JsonHelper::Member_ForceChange(allocator, "bs_moment", data.bs_moment, ref.bs_moment);
910  JsonHelper::Member_ForceChange(allocator, "bs_short", data.bs_short, ref.bs_short);
911  JsonHelper::Member_ForceChange(allocator, "bs_long", data.bs_long, ref.bs_long);
912  JsonHelper::Member_ForceChange(allocator, "bs_user", data.bs_user, ref.bs_user);
913  JsonHelper::Member_ForceChange(allocator, "bs_psr", data.bs_psr, ref.bs_psr);
914  JsonHelper::Member_ForceChange(allocator, "bs_plr", data.bs_plr, ref.bs_plr);
915  }
916 
917  };
918 // === object agc ===
919  // === Preset ===
920  template <>
921  struct JsonConvert<json_agc> {
922 
923  static bool FromJson(const JSON_Value& json, json_agc& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_agc> &constraints = JsonConstraint<json_agc>()) {
924  if (sizeof(json_agc)==0) return true; // quick empty struct
925  if (json.IsNull()) { return true; }
926  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
927  if ( !JsonHelper::Member_FromJson(json, flags, "on", data.on, allocator)) return false;
928  if ( !JsonHelper::Member_FromJson(json, flags, "hp_on", data.hp_on, allocator)) return false;
929  if ( !JsonHelper::Member_FromJson(json, flags, "hp_freq", data.hp_freq, allocator, JsonConstraint<S4Float>(10,200))) return false;
930  if ( !JsonHelper::Member_FromJson(json, flags, "drive_on", data.drive_on, allocator)) return false;
931  if ( !JsonHelper::Member_FromJson(json, flags, "drive", data.drive, allocator, JsonConstraint<S4Float>(-30,30))) return false;
932  if ((flags & JSON_CVT_WITHDEV) &&
933  !JsonHelper::Member_FromJson(json, flags, "threshold", data.threshold, allocator, JsonConstraint<S4Float>(-30,30))) return false;
934  if ((flags & JSON_CVT_WITHDEV) &&
935  !JsonHelper::Member_FromJson(json, flags, "postgain", data.postgain, allocator, JsonConstraint<S4Float>(-30,30))) return false;
936  if ((flags & JSON_CVT_WITHDEV) &&
937  !JsonHelper::Member_FromJson(json, flags, "ratio", data.ratio, allocator, JsonConstraint<S4Float>(0,100))) return false;
938  if ( !JsonHelper::Member_FromJson(json, flags, "attack", data.attack, allocator, JsonConstraint<S4Float>(5,50))) return false;
939  if ( !JsonHelper::Member_FromJson(json, flags, "release", data.release, allocator, JsonConstraint<S4Float>(0.5,30))) return false;
940  if ((flags & JSON_CVT_WITHDEV) &&
941  !JsonHelper::Member_FromJson(json, flags, "impact", data.impact, allocator, JsonConstraint<S4Float>(0,10))) return false;
942  return true;
943  }
944 
945  static bool ToJson(JSON_Value &json, const json_agc& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
946  if (sizeof(json_agc)==0) return true; // quick empty struct
947  if (json.IsNull ()) {
948  json.SetObject ();
949  flags &= ~JSON_CVT_ONLYREQ; // children get all
950  } else if (!json.IsObject()) {
951  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
952  return false;
953  }
954  if (!JsonHelper::Member_ToJson(json, flags, allocator, "on", data.on)) return false;
955  if (!JsonHelper::Member_ToJson(json, flags, allocator, "hp_on", data.hp_on)) return false;
956  if (!JsonHelper::Member_ToJson(json, flags, allocator, "hp_freq", data.hp_freq)) return false;
957  if (!JsonHelper::Member_ToJson(json, flags, allocator, "drive_on", data.drive_on)) return false;
958  if (!JsonHelper::Member_ToJson(json, flags, allocator, "drive", data.drive)) return false;
959  if ((flags & JSON_CVT_WITHDEV) &&
960  !JsonHelper::Member_ToJson(json, flags, allocator, "threshold", data.threshold)) return false;
961  if ((flags & JSON_CVT_WITHDEV) &&
962  !JsonHelper::Member_ToJson(json, flags, allocator, "postgain", data.postgain)) return false;
963  if ((flags & JSON_CVT_WITHDEV) &&
964  !JsonHelper::Member_ToJson(json, flags, allocator, "ratio", data.ratio)) return false;
965  if (!JsonHelper::Member_ToJson(json, flags, allocator, "attack", data.attack)) return false;
966  if (!JsonHelper::Member_ToJson(json, flags, allocator, "release", data.release)) return false;
967  if ((flags & JSON_CVT_WITHDEV) &&
968  !JsonHelper::Member_ToJson(json, flags, allocator, "impact", data.impact)) return false;
969  if (json.MemberCount()==0) json.SetNull();
970  return true;
971  }
972 
973  static bool DiffToJson(JSON_Value &json, const json_agc& data [[maybe_unused]], json_agc& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
974  if (sizeof(json_agc)==0) return true; // quick empty struct
975  if (json.IsNull ()) {
976  json.SetObject ();
977  flags &= ~JSON_CVT_ONLYREQ; // children get all
978  } else if (!json.IsObject()) {
979  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
980  return false;
981  }
982  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "on", data.on, ref.on)) return false;
983  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "hp_on", data.hp_on, ref.hp_on)) return false;
984  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "hp_freq", data.hp_freq, ref.hp_freq)) return false;
985  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "drive_on", data.drive_on, ref.drive_on)) return false;
986  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "drive", data.drive, ref.drive)) return false;
987  if ((flags & JSON_CVT_WITHDEV) &&
988  !JsonHelper::Member_DiffToJson(json, flags, allocator, "threshold", data.threshold, ref.threshold)) return false;
989  if ((flags & JSON_CVT_WITHDEV) &&
990  !JsonHelper::Member_DiffToJson(json, flags, allocator, "postgain", data.postgain, ref.postgain)) return false;
991  if ((flags & JSON_CVT_WITHDEV) &&
992  !JsonHelper::Member_DiffToJson(json, flags, allocator, "ratio", data.ratio, ref.ratio)) return false;
993  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "attack", data.attack, ref.attack)) return false;
994  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "release", data.release, ref.release)) return false;
995  if ((flags & JSON_CVT_WITHDEV) &&
996  !JsonHelper::Member_DiffToJson(json, flags, allocator, "impact", data.impact, ref.impact)) return false;
997  if (json.MemberCount()==0) json.SetNull();
998  return true;
999  }
1000 
1001  static void ForceChange(const json_agc& data [[maybe_unused]], json_agc& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1002  JsonHelper::Member_ForceChange(allocator, "on", data.on, ref.on);
1003  JsonHelper::Member_ForceChange(allocator, "hp_on", data.hp_on, ref.hp_on);
1004  JsonHelper::Member_ForceChange(allocator, "hp_freq", data.hp_freq, ref.hp_freq);
1005  JsonHelper::Member_ForceChange(allocator, "drive_on", data.drive_on, ref.drive_on);
1006  JsonHelper::Member_ForceChange(allocator, "drive", data.drive, ref.drive);
1007  JsonHelper::Member_ForceChange(allocator, "threshold", data.threshold, ref.threshold);
1008  JsonHelper::Member_ForceChange(allocator, "postgain", data.postgain, ref.postgain);
1009  JsonHelper::Member_ForceChange(allocator, "ratio", data.ratio, ref.ratio);
1010  JsonHelper::Member_ForceChange(allocator, "attack", data.attack, ref.attack);
1011  JsonHelper::Member_ForceChange(allocator, "release", data.release, ref.release);
1012  JsonHelper::Member_ForceChange(allocator, "impact", data.impact, ref.impact);
1013  }
1014 
1015  };
1016  // === VU ===
1017  template <>
1018  struct JsonConvert<jsonvu_agc> {
1019 
1020  /* VU have no FromJson */
1021 
1022  static bool ToJson(JSON_Value &json, const jsonvu_agc& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1023  if (sizeof(jsonvu_agc)==0) return true; // quick empty struct
1024  if (json.IsNull ()) {
1025  json.SetObject ();
1026  flags &= ~JSON_CVT_ONLYREQ; // children get all
1027  } else if (!json.IsObject()) {
1028  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1029  return false;
1030  }
1031  if (!JsonHelper::Member_ToJson(json, flags, allocator, "vu", data.vu)) return false;
1032  if (json.MemberCount()==0) json.SetNull();
1033  return true;
1034  }
1035 
1036  static bool DiffToJson(JSON_Value &json, const jsonvu_agc& data [[maybe_unused]], jsonvu_agc& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1037  if (sizeof(jsonvu_agc)==0) return true; // quick empty struct
1038  if (json.IsNull ()) {
1039  json.SetObject ();
1040  flags &= ~JSON_CVT_ONLYREQ; // children get all
1041  } else if (!json.IsObject()) {
1042  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1043  return false;
1044  }
1045  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "vu", data.vu, ref.vu)) return false;
1046  if (json.MemberCount()==0) json.SetNull();
1047  return true;
1048  }
1049 
1050  static void ForceChange(const jsonvu_agc& data [[maybe_unused]], jsonvu_agc& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1051  JsonHelper::Member_ForceChange(allocator, "vu", data.vu, ref.vu);
1052  }
1053 
1054  };
1055 // === object tonefx ===
1056  // === Preset ===
1057  template <>
1058  struct JsonConvert<json_tonefx> {
1059 
1060  static bool FromJson(const JSON_Value& json, json_tonefx& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_tonefx> &constraints = JsonConstraint<json_tonefx>()) {
1061  if (sizeof(json_tonefx)==0) return true; // quick empty struct
1062  if (json.IsNull()) { return true; }
1063  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
1064  if ( !JsonHelper::Member_FromJson(json, flags, "on", data.on, allocator)) return false;
1065  if ( !JsonHelper::Member_FromJson(json, flags, "eq_on", data.eq_on, allocator)) return false;
1066  if ( !JsonHelper::Member_FromJson(json, flags, "eq_freq", data.eq_freq, allocator, JsonConstraint<S4Float>(20,20000))) return false;
1067  if ( !JsonHelper::Member_FromJson(json, flags, "eq_Q", data.eq_Q, allocator, JsonConstraint<S4Float>(0.01,60.))) return false;
1068  if ( !JsonHelper::Member_FromJson(json, flags, "eq_gain", data.eq_gain, allocator, JsonConstraint<S4Float>(-12,12))) return false;
1069  if ( !JsonHelper::Member_FromJson(json, flags, "bass_on", data.bass_on, allocator)) return false;
1070  if ( !JsonHelper::Member_FromJson(json, flags, "bass_gain", data.bass_gain, allocator, JsonConstraint<S4Float>(0,20))) return false;
1071  if ((flags & JSON_CVT_WITHDEV) &&
1072  !JsonHelper::Member_FromJson(json, flags, "bass_freq", data.bass_freq, allocator, JsonConstraint<S4Float>(20,20000))) return false;
1073  if ( !JsonHelper::Member_FromJson(json, flags, "treble_on", data.treble_on, allocator)) return false;
1074  if ( !JsonHelper::Member_FromJson(json, flags, "treble_value", data.treble_value, allocator, JsonConstraint<S4Float>(0,20))) return false;
1075  if ((flags & JSON_CVT_WITHDEV) &&
1076  !JsonHelper::Member_FromJson(json, flags, "treble_range", data.treble_range, allocator, JsonConstraint<S4Float>(0,100))) return false;
1077  return true;
1078  }
1079 
1080  static bool ToJson(JSON_Value &json, const json_tonefx& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1081  if (sizeof(json_tonefx)==0) return true; // quick empty struct
1082  if (json.IsNull ()) {
1083  json.SetObject ();
1084  flags &= ~JSON_CVT_ONLYREQ; // children get all
1085  } else if (!json.IsObject()) {
1086  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1087  return false;
1088  }
1089  if (!JsonHelper::Member_ToJson(json, flags, allocator, "on", data.on)) return false;
1090  if (!JsonHelper::Member_ToJson(json, flags, allocator, "eq_on", data.eq_on)) return false;
1091  if (!JsonHelper::Member_ToJson(json, flags, allocator, "eq_freq", data.eq_freq)) return false;
1092  if (!JsonHelper::Member_ToJson(json, flags, allocator, "eq_Q", data.eq_Q)) return false;
1093  if (!JsonHelper::Member_ToJson(json, flags, allocator, "eq_gain", data.eq_gain)) return false;
1094  if (!JsonHelper::Member_ToJson(json, flags, allocator, "bass_on", data.bass_on)) return false;
1095  if (!JsonHelper::Member_ToJson(json, flags, allocator, "bass_gain", data.bass_gain)) return false;
1096  if ((flags & JSON_CVT_WITHDEV) &&
1097  !JsonHelper::Member_ToJson(json, flags, allocator, "bass_freq", data.bass_freq)) return false;
1098  if (!JsonHelper::Member_ToJson(json, flags, allocator, "treble_on", data.treble_on)) return false;
1099  if (!JsonHelper::Member_ToJson(json, flags, allocator, "treble_value", data.treble_value)) return false;
1100  if ((flags & JSON_CVT_WITHDEV) &&
1101  !JsonHelper::Member_ToJson(json, flags, allocator, "treble_range", data.treble_range)) return false;
1102  if (json.MemberCount()==0) json.SetNull();
1103  return true;
1104  }
1105 
1106  static bool DiffToJson(JSON_Value &json, const json_tonefx& data [[maybe_unused]], json_tonefx& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1107  if (sizeof(json_tonefx)==0) return true; // quick empty struct
1108  if (json.IsNull ()) {
1109  json.SetObject ();
1110  flags &= ~JSON_CVT_ONLYREQ; // children get all
1111  } else if (!json.IsObject()) {
1112  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1113  return false;
1114  }
1115  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "on", data.on, ref.on)) return false;
1116  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "eq_on", data.eq_on, ref.eq_on)) return false;
1117  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "eq_freq", data.eq_freq, ref.eq_freq)) return false;
1118  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "eq_Q", data.eq_Q, ref.eq_Q)) return false;
1119  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "eq_gain", data.eq_gain, ref.eq_gain)) return false;
1120  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "bass_on", data.bass_on, ref.bass_on)) return false;
1121  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "bass_gain", data.bass_gain, ref.bass_gain)) return false;
1122  if ((flags & JSON_CVT_WITHDEV) &&
1123  !JsonHelper::Member_DiffToJson(json, flags, allocator, "bass_freq", data.bass_freq, ref.bass_freq)) return false;
1124  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "treble_on", data.treble_on, ref.treble_on)) return false;
1125  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "treble_value", data.treble_value, ref.treble_value)) return false;
1126  if ((flags & JSON_CVT_WITHDEV) &&
1127  !JsonHelper::Member_DiffToJson(json, flags, allocator, "treble_range", data.treble_range, ref.treble_range)) return false;
1128  if (json.MemberCount()==0) json.SetNull();
1129  return true;
1130  }
1131 
1132  static void ForceChange(const json_tonefx& data [[maybe_unused]], json_tonefx& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1133  JsonHelper::Member_ForceChange(allocator, "on", data.on, ref.on);
1134  JsonHelper::Member_ForceChange(allocator, "eq_on", data.eq_on, ref.eq_on);
1135  JsonHelper::Member_ForceChange(allocator, "eq_freq", data.eq_freq, ref.eq_freq);
1136  JsonHelper::Member_ForceChange(allocator, "eq_Q", data.eq_Q, ref.eq_Q);
1137  JsonHelper::Member_ForceChange(allocator, "eq_gain", data.eq_gain, ref.eq_gain);
1138  JsonHelper::Member_ForceChange(allocator, "bass_on", data.bass_on, ref.bass_on);
1139  JsonHelper::Member_ForceChange(allocator, "bass_gain", data.bass_gain, ref.bass_gain);
1140  JsonHelper::Member_ForceChange(allocator, "bass_freq", data.bass_freq, ref.bass_freq);
1141  JsonHelper::Member_ForceChange(allocator, "treble_on", data.treble_on, ref.treble_on);
1142  JsonHelper::Member_ForceChange(allocator, "treble_value", data.treble_value, ref.treble_value);
1143  JsonHelper::Member_ForceChange(allocator, "treble_range", data.treble_range, ref.treble_range);
1144  }
1145 
1146  };
1147  // === VU ===
1148  template <>
1149  struct JsonConvert<jsonvu_tonefx> {
1150 
1151  /* VU have no FromJson */
1152 
1153  static bool ToJson(JSON_Value &json, const jsonvu_tonefx& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1154  if (sizeof(jsonvu_tonefx)==0) return true; // quick empty struct
1155  if (json.IsNull ()) {
1156  json.SetObject ();
1157  flags &= ~JSON_CVT_ONLYREQ; // children get all
1158  } else if (!json.IsObject()) {
1159  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1160  return false;
1161  }
1162  if (json.MemberCount()==0) json.SetNull();
1163  return true;
1164  }
1165 
1166  static bool DiffToJson(JSON_Value &json, const jsonvu_tonefx& data [[maybe_unused]], jsonvu_tonefx& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1167  if (sizeof(jsonvu_tonefx)==0) return true; // quick empty struct
1168  if (json.IsNull ()) {
1169  json.SetObject ();
1170  flags &= ~JSON_CVT_ONLYREQ; // children get all
1171  } else if (!json.IsObject()) {
1172  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1173  return false;
1174  }
1175  if (json.MemberCount()==0) json.SetNull();
1176  return true;
1177  }
1178 
1179  static void ForceChange(const jsonvu_tonefx& data [[maybe_unused]], jsonvu_tonefx& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1180  }
1181 
1182  };
1183 // === object stereofx ===
1184  // === Preset ===
1185  template <>
1186  struct JsonConvert<json_stereofx> {
1187 
1188  static bool FromJson(const JSON_Value& json, json_stereofx& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_stereofx> &constraints = JsonConstraint<json_stereofx>()) {
1189  if (sizeof(json_stereofx)==0) return true; // quick empty struct
1190  if (json.IsNull()) { return true; }
1191  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
1192  if ( !JsonHelper::Member_FromJson(json, flags, "on", data.on, allocator)) return false;
1193  if ( !JsonHelper::Member_FromJson(json, flags, "enh_on", data.enh_on, allocator)) return false;
1194  if ( !JsonHelper::Member_FromJson(json, flags, "enh_width", data.enh_width, allocator, JsonConstraint<S4Float>(0,100))) return false;
1195  if ((flags & JSON_CVT_WITHDEV) &&
1196  !JsonHelper::Member_FromJson(json, flags, "enh_attack", data.enh_attack, allocator, JsonConstraint<S4Float>(0,100.00))) return false;
1197  if ((flags & JSON_CVT_WITHDEV) &&
1198  !JsonHelper::Member_FromJson(json, flags, "enh_release", data.enh_release, allocator, JsonConstraint<S4Float>(0,100.00))) return false;
1199  if ((flags & JSON_CVT_WITHDEV) &&
1200  !JsonHelper::Member_FromJson(json, flags, "enh_threshold", data.enh_threshold, allocator, JsonConstraint<S4Float>(-100,0))) return false;
1201  if ((flags & JSON_CVT_WITHDEV) &&
1202  !JsonHelper::Member_FromJson(json, flags, "enh_thresLR", data.enh_thresLR, allocator, JsonConstraint<S4Float>(-100,0))) return false;
1203  if ( !JsonHelper::Member_FromJson(json, flags, "lim_on", data.lim_on, allocator)) return false;
1204  if ( !JsonHelper::Member_FromJson(json, flags, "lim_threshold", data.lim_threshold, allocator, JsonConstraint<S4Float>(0,100))) return false;
1205  if ((flags & JSON_CVT_WITHDEV) &&
1206  !JsonHelper::Member_FromJson(json, flags, "lim_release", data.lim_release, allocator, JsonConstraint<S4Float>(0,50.00))) return false;
1207  return true;
1208  }
1209 
1210  static bool ToJson(JSON_Value &json, const json_stereofx& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1211  if (sizeof(json_stereofx)==0) return true; // quick empty struct
1212  if (json.IsNull ()) {
1213  json.SetObject ();
1214  flags &= ~JSON_CVT_ONLYREQ; // children get all
1215  } else if (!json.IsObject()) {
1216  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1217  return false;
1218  }
1219  if (!JsonHelper::Member_ToJson(json, flags, allocator, "on", data.on)) return false;
1220  if (!JsonHelper::Member_ToJson(json, flags, allocator, "enh_on", data.enh_on)) return false;
1221  if (!JsonHelper::Member_ToJson(json, flags, allocator, "enh_width", data.enh_width)) return false;
1222  if ((flags & JSON_CVT_WITHDEV) &&
1223  !JsonHelper::Member_ToJson(json, flags, allocator, "enh_attack", data.enh_attack)) return false;
1224  if ((flags & JSON_CVT_WITHDEV) &&
1225  !JsonHelper::Member_ToJson(json, flags, allocator, "enh_release", data.enh_release)) return false;
1226  if ((flags & JSON_CVT_WITHDEV) &&
1227  !JsonHelper::Member_ToJson(json, flags, allocator, "enh_threshold", data.enh_threshold)) return false;
1228  if ((flags & JSON_CVT_WITHDEV) &&
1229  !JsonHelper::Member_ToJson(json, flags, allocator, "enh_thresLR", data.enh_thresLR)) return false;
1230  if (!JsonHelper::Member_ToJson(json, flags, allocator, "lim_on", data.lim_on)) return false;
1231  if (!JsonHelper::Member_ToJson(json, flags, allocator, "lim_threshold", data.lim_threshold)) return false;
1232  if ((flags & JSON_CVT_WITHDEV) &&
1233  !JsonHelper::Member_ToJson(json, flags, allocator, "lim_release", data.lim_release)) return false;
1234  if (json.MemberCount()==0) json.SetNull();
1235  return true;
1236  }
1237 
1238  static bool DiffToJson(JSON_Value &json, const json_stereofx& data [[maybe_unused]], json_stereofx& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1239  if (sizeof(json_stereofx)==0) return true; // quick empty struct
1240  if (json.IsNull ()) {
1241  json.SetObject ();
1242  flags &= ~JSON_CVT_ONLYREQ; // children get all
1243  } else if (!json.IsObject()) {
1244  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1245  return false;
1246  }
1247  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "on", data.on, ref.on)) return false;
1248  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "enh_on", data.enh_on, ref.enh_on)) return false;
1249  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "enh_width", data.enh_width, ref.enh_width)) return false;
1250  if ((flags & JSON_CVT_WITHDEV) &&
1251  !JsonHelper::Member_DiffToJson(json, flags, allocator, "enh_attack", data.enh_attack, ref.enh_attack)) return false;
1252  if ((flags & JSON_CVT_WITHDEV) &&
1253  !JsonHelper::Member_DiffToJson(json, flags, allocator, "enh_release", data.enh_release, ref.enh_release)) return false;
1254  if ((flags & JSON_CVT_WITHDEV) &&
1255  !JsonHelper::Member_DiffToJson(json, flags, allocator, "enh_threshold", data.enh_threshold, ref.enh_threshold)) return false;
1256  if ((flags & JSON_CVT_WITHDEV) &&
1257  !JsonHelper::Member_DiffToJson(json, flags, allocator, "enh_thresLR", data.enh_thresLR, ref.enh_thresLR)) return false;
1258  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "lim_on", data.lim_on, ref.lim_on)) return false;
1259  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "lim_threshold", data.lim_threshold, ref.lim_threshold)) return false;
1260  if ((flags & JSON_CVT_WITHDEV) &&
1261  !JsonHelper::Member_DiffToJson(json, flags, allocator, "lim_release", data.lim_release, ref.lim_release)) return false;
1262  if (json.MemberCount()==0) json.SetNull();
1263  return true;
1264  }
1265 
1266  static void ForceChange(const json_stereofx& data [[maybe_unused]], json_stereofx& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1267  JsonHelper::Member_ForceChange(allocator, "on", data.on, ref.on);
1268  JsonHelper::Member_ForceChange(allocator, "enh_on", data.enh_on, ref.enh_on);
1269  JsonHelper::Member_ForceChange(allocator, "enh_width", data.enh_width, ref.enh_width);
1270  JsonHelper::Member_ForceChange(allocator, "enh_attack", data.enh_attack, ref.enh_attack);
1271  JsonHelper::Member_ForceChange(allocator, "enh_release", data.enh_release, ref.enh_release);
1272  JsonHelper::Member_ForceChange(allocator, "enh_threshold", data.enh_threshold, ref.enh_threshold);
1273  JsonHelper::Member_ForceChange(allocator, "enh_thresLR", data.enh_thresLR, ref.enh_thresLR);
1274  JsonHelper::Member_ForceChange(allocator, "lim_on", data.lim_on, ref.lim_on);
1275  JsonHelper::Member_ForceChange(allocator, "lim_threshold", data.lim_threshold, ref.lim_threshold);
1276  JsonHelper::Member_ForceChange(allocator, "lim_release", data.lim_release, ref.lim_release);
1277  }
1278 
1279  };
1280  // === VU ===
1281  template <>
1282  struct JsonConvert<jsonvu_stereofx> {
1283 
1284  /* VU have no FromJson */
1285 
1286  static bool ToJson(JSON_Value &json, const jsonvu_stereofx& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1287  if (sizeof(jsonvu_stereofx)==0) return true; // quick empty struct
1288  if (json.IsNull ()) {
1289  json.SetObject ();
1290  flags &= ~JSON_CVT_ONLYREQ; // children get all
1291  } else if (!json.IsObject()) {
1292  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1293  return false;
1294  }
1295  if (!JsonHelper::Member_ToJson(json, flags, allocator, "enh_vu", data.enh_vu)) return false;
1296  if (!JsonHelper::Member_ToJson(json, flags, allocator, "lim_vu", data.lim_vu)) return false;
1297  if (json.MemberCount()==0) json.SetNull();
1298  return true;
1299  }
1300 
1301  static bool DiffToJson(JSON_Value &json, const jsonvu_stereofx& data [[maybe_unused]], jsonvu_stereofx& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1302  if (sizeof(jsonvu_stereofx)==0) return true; // quick empty struct
1303  if (json.IsNull ()) {
1304  json.SetObject ();
1305  flags &= ~JSON_CVT_ONLYREQ; // children get all
1306  } else if (!json.IsObject()) {
1307  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1308  return false;
1309  }
1310  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "enh_vu", data.enh_vu, ref.enh_vu)) return false;
1311  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "lim_vu", data.lim_vu, ref.lim_vu)) return false;
1312  if (json.MemberCount()==0) json.SetNull();
1313  return true;
1314  }
1315 
1316  static void ForceChange(const jsonvu_stereofx& data [[maybe_unused]], jsonvu_stereofx& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1317  JsonHelper::Member_ForceChange(allocator, "enh_vu", data.enh_vu, ref.enh_vu);
1318  JsonHelper::Member_ForceChange(allocator, "lim_vu", data.lim_vu, ref.lim_vu);
1319  }
1320 
1321  };
1322 // === object bandprocess ===
1323  // === Preset ===
1324  template <>
1325  struct JsonConvert<json_bandprocess> {
1326 
1327  static bool FromJson(const JSON_Value& json, json_bandprocess& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_bandprocess> &constraints = JsonConstraint<json_bandprocess>()) {
1328  if (sizeof(json_bandprocess)==0) return true; // quick empty struct
1329  if (json.IsNull()) { return true; }
1330  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
1331  if ( !JsonHelper::Member_FromJson(json, flags, "on", data.on, allocator)) return false;
1332  if ( !JsonHelper::Member_FromJson(json, flags, "freq", data.freq, allocator, JsonConstraint<S4Float>(20,20000))) return false;
1333  if ( !JsonHelper::Member_FromJson(json, flags, "gate_on", data.gate_on, allocator)) return false;
1334  if ( !JsonHelper::Member_FromJson(json, flags, "gate", data.gate, allocator, JsonConstraint<S4Float>(-70,0))) return false;
1335  if ( !JsonHelper::Member_FromJson(json, flags, "fidelity_on", data.fidelity_on, allocator)) return false;
1336  if ((flags & JSON_CVT_WITHDEV) &&
1337  !JsonHelper::Member_FromJson(json, flags, "fidelity_speed", data.fidelity_speed, allocator, JsonConstraint<S4Float>(0.1,60))) return false;
1338  if ( !JsonHelper::Member_FromJson(json, flags, "fidelity", data.fidelity, allocator, JsonConstraint<S4Float>(0,100))) return false;
1339  if ( !JsonHelper::Member_FromJson(json, flags, "drive_on", data.drive_on, allocator)) return false;
1340  if ( !JsonHelper::Member_FromJson(json, flags, "drive", data.drive, allocator, JsonConstraint<S4Float>(-6,6))) return false;
1341  if ( !JsonHelper::Member_FromJson(json, flags, "threshold_on", data.threshold_on, allocator)) return false;
1342  if ( !JsonHelper::Member_FromJson(json, flags, "threshold", data.threshold, allocator, JsonConstraint<S4Float>(-6,6))) return false;
1343  if ((flags & JSON_CVT_WITHDEV) &&
1344  !JsonHelper::Member_FromJson(json, flags, "base_thres", data.base_thres, allocator, JsonConstraint<S4Float>(-30,0))) return false;
1345  if ( !JsonHelper::Member_FromJson(json, flags, "ratio", data.ratio, allocator, JsonConstraint<S4Float>(0,100))) return false;
1346  if ( !JsonHelper::Member_FromJson(json, flags, "impact_on", data.impact_on, allocator)) return false;
1347  if ( !JsonHelper::Member_FromJson(json, flags, "impact", data.impact, allocator, JsonConstraint<S4Float>(0,10))) return false;
1348  if ((flags & JSON_CVT_WITHDEV) &&
1349  !JsonHelper::Member_FromJson(json, flags, "postgain", data.postgain, allocator, JsonConstraint<S4Float>(-30,30))) return false;
1350  if ( !JsonHelper::Member_FromJson(json, flags, "attack", data.attack, allocator, JsonConstraint<S4Float>(0,1000))) return false;
1351  if ( !JsonHelper::Member_FromJson(json, flags, "release", data.release, allocator, JsonConstraint<S4Float>(0,100))) return false;
1352  if ((flags & JSON_CVT_WITHDEV) &&
1353  !JsonHelper::Member_FromJson(json, flags, "avgspeed", data.avgspeed, allocator, JsonConstraint<S4Float>(0.1,60))) return false;
1354  if ((flags & JSON_CVT_WITHDEV) &&
1355  !JsonHelper::Member_FromJson(json, flags, "delta_up", data.delta_up, allocator, JsonConstraint<S4Float>(-30,30))) return false;
1356  if ((flags & JSON_CVT_WITHDEV) &&
1357  !JsonHelper::Member_FromJson(json, flags, "attack_up", data.attack_up, allocator, JsonConstraint<S4Float>(0,32000))) return false;
1358  if ((flags & JSON_CVT_WITHDEV) &&
1359  !JsonHelper::Member_FromJson(json, flags, "release_up", data.release_up, allocator, JsonConstraint<S4Float>(0,320))) return false;
1360  if ((flags & JSON_CVT_WITHDEV) &&
1361  !JsonHelper::Member_FromJson(json, flags, "delta_dn", data.delta_dn, allocator, JsonConstraint<S4Float>(-100,0))) return false;
1362  if ((flags & JSON_CVT_WITHDEV) &&
1363  !JsonHelper::Member_FromJson(json, flags, "attack_dn", data.attack_dn, allocator, JsonConstraint<S4Float>(0,32000))) return false;
1364  if ((flags & JSON_CVT_WITHDEV) &&
1365  !JsonHelper::Member_FromJson(json, flags, "release_dn", data.release_dn, allocator, JsonConstraint<S4Float>(0,320))) return false;
1366  if ( !JsonHelper::Member_FromJson(json, flags, "listen", data.listen, allocator, JsonConstraint<int>(0,3))) return false;
1367  return true;
1368  }
1369 
1370  static bool ToJson(JSON_Value &json, const json_bandprocess& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1371  if (sizeof(json_bandprocess)==0) return true; // quick empty struct
1372  if (json.IsNull ()) {
1373  json.SetObject ();
1374  flags &= ~JSON_CVT_ONLYREQ; // children get all
1375  } else if (!json.IsObject()) {
1376  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1377  return false;
1378  }
1379  if (!JsonHelper::Member_ToJson(json, flags, allocator, "on", data.on)) return false;
1380  if (!JsonHelper::Member_ToJson(json, flags, allocator, "freq", data.freq)) return false;
1381  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gate_on", data.gate_on)) return false;
1382  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gate", data.gate)) return false;
1383  if (!JsonHelper::Member_ToJson(json, flags, allocator, "fidelity_on", data.fidelity_on)) return false;
1384  if ((flags & JSON_CVT_WITHDEV) &&
1385  !JsonHelper::Member_ToJson(json, flags, allocator, "fidelity_speed", data.fidelity_speed)) return false;
1386  if (!JsonHelper::Member_ToJson(json, flags, allocator, "fidelity", data.fidelity)) return false;
1387  if (!JsonHelper::Member_ToJson(json, flags, allocator, "drive_on", data.drive_on)) return false;
1388  if (!JsonHelper::Member_ToJson(json, flags, allocator, "drive", data.drive)) return false;
1389  if (!JsonHelper::Member_ToJson(json, flags, allocator, "threshold_on", data.threshold_on)) return false;
1390  if (!JsonHelper::Member_ToJson(json, flags, allocator, "threshold", data.threshold)) return false;
1391  if ((flags & JSON_CVT_WITHDEV) &&
1392  !JsonHelper::Member_ToJson(json, flags, allocator, "base_thres", data.base_thres)) return false;
1393  if (!JsonHelper::Member_ToJson(json, flags, allocator, "ratio", data.ratio)) return false;
1394  if (!JsonHelper::Member_ToJson(json, flags, allocator, "impact_on", data.impact_on)) return false;
1395  if (!JsonHelper::Member_ToJson(json, flags, allocator, "impact", data.impact)) return false;
1396  if ((flags & JSON_CVT_WITHDEV) &&
1397  !JsonHelper::Member_ToJson(json, flags, allocator, "postgain", data.postgain)) return false;
1398  if (!JsonHelper::Member_ToJson(json, flags, allocator, "attack", data.attack)) return false;
1399  if (!JsonHelper::Member_ToJson(json, flags, allocator, "release", data.release)) return false;
1400  if ((flags & JSON_CVT_WITHDEV) &&
1401  !JsonHelper::Member_ToJson(json, flags, allocator, "avgspeed", data.avgspeed)) return false;
1402  if ((flags & JSON_CVT_WITHDEV) &&
1403  !JsonHelper::Member_ToJson(json, flags, allocator, "delta_up", data.delta_up)) return false;
1404  if ((flags & JSON_CVT_WITHDEV) &&
1405  !JsonHelper::Member_ToJson(json, flags, allocator, "attack_up", data.attack_up)) return false;
1406  if ((flags & JSON_CVT_WITHDEV) &&
1407  !JsonHelper::Member_ToJson(json, flags, allocator, "release_up", data.release_up)) return false;
1408  if ((flags & JSON_CVT_WITHDEV) &&
1409  !JsonHelper::Member_ToJson(json, flags, allocator, "delta_dn", data.delta_dn)) return false;
1410  if ((flags & JSON_CVT_WITHDEV) &&
1411  !JsonHelper::Member_ToJson(json, flags, allocator, "attack_dn", data.attack_dn)) return false;
1412  if ((flags & JSON_CVT_WITHDEV) &&
1413  !JsonHelper::Member_ToJson(json, flags, allocator, "release_dn", data.release_dn)) return false;
1414  if (!JsonHelper::Member_ToJson(json, flags, allocator, "listen", data.listen)) return false;
1415  if (json.MemberCount()==0) json.SetNull();
1416  return true;
1417  }
1418 
1419  static bool DiffToJson(JSON_Value &json, const json_bandprocess& data [[maybe_unused]], json_bandprocess& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1420  if (sizeof(json_bandprocess)==0) return true; // quick empty struct
1421  if (json.IsNull ()) {
1422  json.SetObject ();
1423  flags &= ~JSON_CVT_ONLYREQ; // children get all
1424  } else if (!json.IsObject()) {
1425  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1426  return false;
1427  }
1428  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "on", data.on, ref.on)) return false;
1429  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "freq", data.freq, ref.freq)) return false;
1430  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gate_on", data.gate_on, ref.gate_on)) return false;
1431  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gate", data.gate, ref.gate)) return false;
1432  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "fidelity_on", data.fidelity_on, ref.fidelity_on)) return false;
1433  if ((flags & JSON_CVT_WITHDEV) &&
1434  !JsonHelper::Member_DiffToJson(json, flags, allocator, "fidelity_speed", data.fidelity_speed, ref.fidelity_speed)) return false;
1435  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "fidelity", data.fidelity, ref.fidelity)) return false;
1436  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "drive_on", data.drive_on, ref.drive_on)) return false;
1437  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "drive", data.drive, ref.drive)) return false;
1438  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "threshold_on", data.threshold_on, ref.threshold_on)) return false;
1439  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "threshold", data.threshold, ref.threshold)) return false;
1440  if ((flags & JSON_CVT_WITHDEV) &&
1441  !JsonHelper::Member_DiffToJson(json, flags, allocator, "base_thres", data.base_thres, ref.base_thres)) return false;
1442  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "ratio", data.ratio, ref.ratio)) return false;
1443  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "impact_on", data.impact_on, ref.impact_on)) return false;
1444  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "impact", data.impact, ref.impact)) return false;
1445  if ((flags & JSON_CVT_WITHDEV) &&
1446  !JsonHelper::Member_DiffToJson(json, flags, allocator, "postgain", data.postgain, ref.postgain)) return false;
1447  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "attack", data.attack, ref.attack)) return false;
1448  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "release", data.release, ref.release)) return false;
1449  if ((flags & JSON_CVT_WITHDEV) &&
1450  !JsonHelper::Member_DiffToJson(json, flags, allocator, "avgspeed", data.avgspeed, ref.avgspeed)) return false;
1451  if ((flags & JSON_CVT_WITHDEV) &&
1452  !JsonHelper::Member_DiffToJson(json, flags, allocator, "delta_up", data.delta_up, ref.delta_up)) return false;
1453  if ((flags & JSON_CVT_WITHDEV) &&
1454  !JsonHelper::Member_DiffToJson(json, flags, allocator, "attack_up", data.attack_up, ref.attack_up)) return false;
1455  if ((flags & JSON_CVT_WITHDEV) &&
1456  !JsonHelper::Member_DiffToJson(json, flags, allocator, "release_up", data.release_up, ref.release_up)) return false;
1457  if ((flags & JSON_CVT_WITHDEV) &&
1458  !JsonHelper::Member_DiffToJson(json, flags, allocator, "delta_dn", data.delta_dn, ref.delta_dn)) return false;
1459  if ((flags & JSON_CVT_WITHDEV) &&
1460  !JsonHelper::Member_DiffToJson(json, flags, allocator, "attack_dn", data.attack_dn, ref.attack_dn)) return false;
1461  if ((flags & JSON_CVT_WITHDEV) &&
1462  !JsonHelper::Member_DiffToJson(json, flags, allocator, "release_dn", data.release_dn, ref.release_dn)) return false;
1463  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "listen", data.listen, ref.listen)) return false;
1464  if (json.MemberCount()==0) json.SetNull();
1465  return true;
1466  }
1467 
1468  static void ForceChange(const json_bandprocess& data [[maybe_unused]], json_bandprocess& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1469  JsonHelper::Member_ForceChange(allocator, "on", data.on, ref.on);
1470  JsonHelper::Member_ForceChange(allocator, "freq", data.freq, ref.freq);
1471  JsonHelper::Member_ForceChange(allocator, "gate_on", data.gate_on, ref.gate_on);
1472  JsonHelper::Member_ForceChange(allocator, "gate", data.gate, ref.gate);
1473  JsonHelper::Member_ForceChange(allocator, "fidelity_on", data.fidelity_on, ref.fidelity_on);
1474  JsonHelper::Member_ForceChange(allocator, "fidelity_speed", data.fidelity_speed, ref.fidelity_speed);
1475  JsonHelper::Member_ForceChange(allocator, "fidelity", data.fidelity, ref.fidelity);
1476  JsonHelper::Member_ForceChange(allocator, "drive_on", data.drive_on, ref.drive_on);
1477  JsonHelper::Member_ForceChange(allocator, "drive", data.drive, ref.drive);
1478  JsonHelper::Member_ForceChange(allocator, "threshold_on", data.threshold_on, ref.threshold_on);
1479  JsonHelper::Member_ForceChange(allocator, "threshold", data.threshold, ref.threshold);
1480  JsonHelper::Member_ForceChange(allocator, "base_thres", data.base_thres, ref.base_thres);
1481  JsonHelper::Member_ForceChange(allocator, "ratio", data.ratio, ref.ratio);
1482  JsonHelper::Member_ForceChange(allocator, "impact_on", data.impact_on, ref.impact_on);
1483  JsonHelper::Member_ForceChange(allocator, "impact", data.impact, ref.impact);
1484  JsonHelper::Member_ForceChange(allocator, "postgain", data.postgain, ref.postgain);
1485  JsonHelper::Member_ForceChange(allocator, "attack", data.attack, ref.attack);
1486  JsonHelper::Member_ForceChange(allocator, "release", data.release, ref.release);
1487  JsonHelper::Member_ForceChange(allocator, "avgspeed", data.avgspeed, ref.avgspeed);
1488  JsonHelper::Member_ForceChange(allocator, "delta_up", data.delta_up, ref.delta_up);
1489  JsonHelper::Member_ForceChange(allocator, "attack_up", data.attack_up, ref.attack_up);
1490  JsonHelper::Member_ForceChange(allocator, "release_up", data.release_up, ref.release_up);
1491  JsonHelper::Member_ForceChange(allocator, "delta_dn", data.delta_dn, ref.delta_dn);
1492  JsonHelper::Member_ForceChange(allocator, "attack_dn", data.attack_dn, ref.attack_dn);
1493  JsonHelper::Member_ForceChange(allocator, "release_dn", data.release_dn, ref.release_dn);
1494  JsonHelper::Member_ForceChange(allocator, "listen", data.listen, ref.listen);
1495  }
1496 
1497  };
1498  // === VU ===
1499  template <>
1500  struct JsonConvert<jsonvu_bandprocess> {
1501 
1502  /* VU have no FromJson */
1503 
1504  static bool ToJson(JSON_Value &json, const jsonvu_bandprocess& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1505  if (sizeof(jsonvu_bandprocess)==0) return true; // quick empty struct
1506  if (json.IsNull ()) {
1507  json.SetObject ();
1508  flags &= ~JSON_CVT_ONLYREQ; // children get all
1509  } else if (!json.IsObject()) {
1510  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1511  return false;
1512  }
1513  if (!JsonHelper::Member_ToJson(json, flags, allocator, "in", data.in)) return false;
1514  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gated", data.gated)) return false;
1515  if ((flags & JSON_CVT_WITHDEV) &&
1516  !JsonHelper::Member_ToJson(json, flags, allocator, "fidel", data.fidel)) return false;
1517  if ((flags & JSON_CVT_WITHDEV) &&
1518  !JsonHelper::Member_ToJson(json, flags, allocator, "mes_in", data.mes_in)) return false;
1519  if ((flags & JSON_CVT_WITHDEV) &&
1520  !JsonHelper::Member_ToJson(json, flags, allocator, "in_avg", data.in_avg)) return false;
1521  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gain", data.gain)) return false;
1522  if (!JsonHelper::Member_ToJson(json, flags, allocator, "out", data.out)) return false;
1523  if (json.MemberCount()==0) json.SetNull();
1524  return true;
1525  }
1526 
1527  static bool DiffToJson(JSON_Value &json, const jsonvu_bandprocess& data [[maybe_unused]], jsonvu_bandprocess& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1528  if (sizeof(jsonvu_bandprocess)==0) return true; // quick empty struct
1529  if (json.IsNull ()) {
1530  json.SetObject ();
1531  flags &= ~JSON_CVT_ONLYREQ; // children get all
1532  } else if (!json.IsObject()) {
1533  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1534  return false;
1535  }
1536  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "in", data.in, ref.in)) return false;
1537  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gated", data.gated, ref.gated)) return false;
1538  if ((flags & JSON_CVT_WITHDEV) &&
1539  !JsonHelper::Member_DiffToJson(json, flags, allocator, "fidel", data.fidel, ref.fidel)) return false;
1540  if ((flags & JSON_CVT_WITHDEV) &&
1541  !JsonHelper::Member_DiffToJson(json, flags, allocator, "mes_in", data.mes_in, ref.mes_in)) return false;
1542  if ((flags & JSON_CVT_WITHDEV) &&
1543  !JsonHelper::Member_DiffToJson(json, flags, allocator, "in_avg", data.in_avg, ref.in_avg)) return false;
1544  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gain", data.gain, ref.gain)) return false;
1545  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "out", data.out, ref.out)) return false;
1546  if (json.MemberCount()==0) json.SetNull();
1547  return true;
1548  }
1549 
1550  static void ForceChange(const jsonvu_bandprocess& data [[maybe_unused]], jsonvu_bandprocess& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1551  JsonHelper::Member_ForceChange(allocator, "in", data.in, ref.in);
1552  JsonHelper::Member_ForceChange(allocator, "gated", data.gated, ref.gated);
1553  JsonHelper::Member_ForceChange(allocator, "fidel", data.fidel, ref.fidel);
1554  JsonHelper::Member_ForceChange(allocator, "mes_in", data.mes_in, ref.mes_in);
1555  JsonHelper::Member_ForceChange(allocator, "in_avg", data.in_avg, ref.in_avg);
1556  JsonHelper::Member_ForceChange(allocator, "gain", data.gain, ref.gain);
1557  JsonHelper::Member_ForceChange(allocator, "out", data.out, ref.out);
1558  }
1559 
1560  };
1561 // === object bandlimiter ===
1562  // === Preset ===
1563  template <>
1564  struct JsonConvert<json_bandlimiter> {
1565 
1566  static bool FromJson(const JSON_Value& json, json_bandlimiter& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_bandlimiter> &constraints = JsonConstraint<json_bandlimiter>()) {
1567  if (sizeof(json_bandlimiter)==0) return true; // quick empty struct
1568  if (json.IsNull()) { return true; }
1569  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
1570  if ((flags & JSON_CVT_WITHDEV) &&
1571  !JsonHelper::Member_FromJson(json, flags, "on", data.on, allocator)) return false;
1572  if ( !JsonHelper::Member_FromJson(json, flags, "drive_on", data.drive_on, allocator)) return false;
1573  if ( !JsonHelper::Member_FromJson(json, flags, "drive", data.drive, allocator, JsonConstraint<S4Float>(-8,8))) return false;
1574  if ( !JsonHelper::Member_FromJson(json, flags, "threshold_on", data.threshold_on, allocator)) return false;
1575  if ( !JsonHelper::Member_FromJson(json, flags, "threshold", data.threshold, allocator, JsonConstraint<S4Float>(-6,6))) return false;
1576  if ((flags & JSON_CVT_WITHDEV) &&
1577  !JsonHelper::Member_FromJson(json, flags, "base_thres", data.base_thres, allocator, JsonConstraint<S4Float>(-30,0))) return false;
1578  if ((flags & JSON_CVT_WITHDEV) &&
1579  !JsonHelper::Member_FromJson(json, flags, "postgain", data.postgain, allocator, JsonConstraint<S4Float>(-30,0))) return false;
1580  if ( !JsonHelper::Member_FromJson(json, flags, "mix_on", data.mix_on, allocator)) return false;
1581  if ( !JsonHelper::Member_FromJson(json, flags, "mix", data.mix, allocator, JsonConstraint<S4Float>(-6,6))) return false;
1582  if ((flags & JSON_CVT_WITHDEV) &&
1583  !JsonHelper::Member_FromJson(json, flags, "preview", data.preview, allocator, JsonConstraint<int>(1,32))) return false;
1584  if ((flags & JSON_CVT_WITHDEV) &&
1585  !JsonHelper::Member_FromJson(json, flags, "asymmetric", data.asymmetric, allocator)) return false;
1586  if ( !JsonHelper::Member_FromJson(json, flags, "he_on", data.he_on, allocator)) return false;
1587  if ((flags & JSON_CVT_WITHDEV) &&
1588  !JsonHelper::Member_FromJson(json, flags, "he_freq", data.he_freq, allocator, JsonConstraint<S4Float>(0.1,20.))) return false;
1589  if ( !JsonHelper::Member_FromJson(json, flags, "he_drive_on", data.he_drive_on, allocator)) return false;
1590  if ( !JsonHelper::Member_FromJson(json, flags, "he_drive", data.he_drive, allocator, JsonConstraint<S4Float>(-6,6))) return false;
1591  if ( !JsonHelper::Member_FromJson(json, flags, "he_mix_on", data.he_mix_on, allocator)) return false;
1592  if ( !JsonHelper::Member_FromJson(json, flags, "he_mix", data.he_mix, allocator, JsonConstraint<S4Float>(-6,6))) return false;
1593  if ((flags & JSON_CVT_WITHDEV) &&
1594  !JsonHelper::Member_FromJson(json, flags, "he_threshold", data.he_threshold, allocator, JsonConstraint<S4Float>(-30,30))) return false;
1595  return true;
1596  }
1597 
1598  static bool ToJson(JSON_Value &json, const json_bandlimiter& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1599  if (sizeof(json_bandlimiter)==0) return true; // quick empty struct
1600  if (json.IsNull ()) {
1601  json.SetObject ();
1602  flags &= ~JSON_CVT_ONLYREQ; // children get all
1603  } else if (!json.IsObject()) {
1604  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1605  return false;
1606  }
1607  if ((flags & JSON_CVT_WITHDEV) &&
1608  !JsonHelper::Member_ToJson(json, flags, allocator, "on", data.on)) return false;
1609  if (!JsonHelper::Member_ToJson(json, flags, allocator, "drive_on", data.drive_on)) return false;
1610  if (!JsonHelper::Member_ToJson(json, flags, allocator, "drive", data.drive)) return false;
1611  if (!JsonHelper::Member_ToJson(json, flags, allocator, "threshold_on", data.threshold_on)) return false;
1612  if (!JsonHelper::Member_ToJson(json, flags, allocator, "threshold", data.threshold)) return false;
1613  if ((flags & JSON_CVT_WITHDEV) &&
1614  !JsonHelper::Member_ToJson(json, flags, allocator, "base_thres", data.base_thres)) return false;
1615  if ((flags & JSON_CVT_WITHDEV) &&
1616  !JsonHelper::Member_ToJson(json, flags, allocator, "postgain", data.postgain)) return false;
1617  if (!JsonHelper::Member_ToJson(json, flags, allocator, "mix_on", data.mix_on)) return false;
1618  if (!JsonHelper::Member_ToJson(json, flags, allocator, "mix", data.mix)) return false;
1619  if ((flags & JSON_CVT_WITHDEV) &&
1620  !JsonHelper::Member_ToJson(json, flags, allocator, "preview", data.preview)) return false;
1621  if ((flags & JSON_CVT_WITHDEV) &&
1622  !JsonHelper::Member_ToJson(json, flags, allocator, "asymmetric", data.asymmetric)) return false;
1623  if (!JsonHelper::Member_ToJson(json, flags, allocator, "he_on", data.he_on)) return false;
1624  if ((flags & JSON_CVT_WITHDEV) &&
1625  !JsonHelper::Member_ToJson(json, flags, allocator, "he_freq", data.he_freq)) return false;
1626  if (!JsonHelper::Member_ToJson(json, flags, allocator, "he_drive_on", data.he_drive_on)) return false;
1627  if (!JsonHelper::Member_ToJson(json, flags, allocator, "he_drive", data.he_drive)) return false;
1628  if (!JsonHelper::Member_ToJson(json, flags, allocator, "he_mix_on", data.he_mix_on)) return false;
1629  if (!JsonHelper::Member_ToJson(json, flags, allocator, "he_mix", data.he_mix)) return false;
1630  if ((flags & JSON_CVT_WITHDEV) &&
1631  !JsonHelper::Member_ToJson(json, flags, allocator, "he_threshold", data.he_threshold)) return false;
1632  if (json.MemberCount()==0) json.SetNull();
1633  return true;
1634  }
1635 
1636  static bool DiffToJson(JSON_Value &json, const json_bandlimiter& data [[maybe_unused]], json_bandlimiter& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1637  if (sizeof(json_bandlimiter)==0) return true; // quick empty struct
1638  if (json.IsNull ()) {
1639  json.SetObject ();
1640  flags &= ~JSON_CVT_ONLYREQ; // children get all
1641  } else if (!json.IsObject()) {
1642  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1643  return false;
1644  }
1645  if ((flags & JSON_CVT_WITHDEV) &&
1646  !JsonHelper::Member_DiffToJson(json, flags, allocator, "on", data.on, ref.on)) return false;
1647  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "drive_on", data.drive_on, ref.drive_on)) return false;
1648  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "drive", data.drive, ref.drive)) return false;
1649  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "threshold_on", data.threshold_on, ref.threshold_on)) return false;
1650  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "threshold", data.threshold, ref.threshold)) return false;
1651  if ((flags & JSON_CVT_WITHDEV) &&
1652  !JsonHelper::Member_DiffToJson(json, flags, allocator, "base_thres", data.base_thres, ref.base_thres)) return false;
1653  if ((flags & JSON_CVT_WITHDEV) &&
1654  !JsonHelper::Member_DiffToJson(json, flags, allocator, "postgain", data.postgain, ref.postgain)) return false;
1655  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "mix_on", data.mix_on, ref.mix_on)) return false;
1656  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "mix", data.mix, ref.mix)) return false;
1657  if ((flags & JSON_CVT_WITHDEV) &&
1658  !JsonHelper::Member_DiffToJson(json, flags, allocator, "preview", data.preview, ref.preview)) return false;
1659  if ((flags & JSON_CVT_WITHDEV) &&
1660  !JsonHelper::Member_DiffToJson(json, flags, allocator, "asymmetric", data.asymmetric, ref.asymmetric)) return false;
1661  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "he_on", data.he_on, ref.he_on)) return false;
1662  if ((flags & JSON_CVT_WITHDEV) &&
1663  !JsonHelper::Member_DiffToJson(json, flags, allocator, "he_freq", data.he_freq, ref.he_freq)) return false;
1664  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "he_drive_on", data.he_drive_on, ref.he_drive_on)) return false;
1665  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "he_drive", data.he_drive, ref.he_drive)) return false;
1666  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "he_mix_on", data.he_mix_on, ref.he_mix_on)) return false;
1667  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "he_mix", data.he_mix, ref.he_mix)) return false;
1668  if ((flags & JSON_CVT_WITHDEV) &&
1669  !JsonHelper::Member_DiffToJson(json, flags, allocator, "he_threshold", data.he_threshold, ref.he_threshold)) return false;
1670  if (json.MemberCount()==0) json.SetNull();
1671  return true;
1672  }
1673 
1674  static void ForceChange(const json_bandlimiter& data [[maybe_unused]], json_bandlimiter& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1675  JsonHelper::Member_ForceChange(allocator, "on", data.on, ref.on);
1676  JsonHelper::Member_ForceChange(allocator, "drive_on", data.drive_on, ref.drive_on);
1677  JsonHelper::Member_ForceChange(allocator, "drive", data.drive, ref.drive);
1678  JsonHelper::Member_ForceChange(allocator, "threshold_on", data.threshold_on, ref.threshold_on);
1679  JsonHelper::Member_ForceChange(allocator, "threshold", data.threshold, ref.threshold);
1680  JsonHelper::Member_ForceChange(allocator, "base_thres", data.base_thres, ref.base_thres);
1681  JsonHelper::Member_ForceChange(allocator, "postgain", data.postgain, ref.postgain);
1682  JsonHelper::Member_ForceChange(allocator, "mix_on", data.mix_on, ref.mix_on);
1683  JsonHelper::Member_ForceChange(allocator, "mix", data.mix, ref.mix);
1684  JsonHelper::Member_ForceChange(allocator, "preview", data.preview, ref.preview);
1685  JsonHelper::Member_ForceChange(allocator, "asymmetric", data.asymmetric, ref.asymmetric);
1686  JsonHelper::Member_ForceChange(allocator, "he_on", data.he_on, ref.he_on);
1687  JsonHelper::Member_ForceChange(allocator, "he_freq", data.he_freq, ref.he_freq);
1688  JsonHelper::Member_ForceChange(allocator, "he_drive_on", data.he_drive_on, ref.he_drive_on);
1689  JsonHelper::Member_ForceChange(allocator, "he_drive", data.he_drive, ref.he_drive);
1690  JsonHelper::Member_ForceChange(allocator, "he_mix_on", data.he_mix_on, ref.he_mix_on);
1691  JsonHelper::Member_ForceChange(allocator, "he_mix", data.he_mix, ref.he_mix);
1692  JsonHelper::Member_ForceChange(allocator, "he_threshold", data.he_threshold, ref.he_threshold);
1693  }
1694 
1695  };
1696  // === VU ===
1697  template <>
1698  struct JsonConvert<jsonvu_bandlimiter> {
1699 
1700  /* VU have no FromJson */
1701 
1702  static bool ToJson(JSON_Value &json, const jsonvu_bandlimiter& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1703  if (sizeof(jsonvu_bandlimiter)==0) return true; // quick empty struct
1704  if (json.IsNull ()) {
1705  json.SetObject ();
1706  flags &= ~JSON_CVT_ONLYREQ; // children get all
1707  } else if (!json.IsObject()) {
1708  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1709  return false;
1710  }
1711  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gain", data.gain)) return false;
1712  if ((flags & JSON_CVT_WITHDEV) &&
1713  !JsonHelper::Member_ToJson(json, flags, allocator, "out", data.out)) return false;
1714  if (json.MemberCount()==0) json.SetNull();
1715  return true;
1716  }
1717 
1718  static bool DiffToJson(JSON_Value &json, const jsonvu_bandlimiter& data [[maybe_unused]], jsonvu_bandlimiter& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1719  if (sizeof(jsonvu_bandlimiter)==0) return true; // quick empty struct
1720  if (json.IsNull ()) {
1721  json.SetObject ();
1722  flags &= ~JSON_CVT_ONLYREQ; // children get all
1723  } else if (!json.IsObject()) {
1724  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1725  return false;
1726  }
1727  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gain", data.gain, ref.gain)) return false;
1728  if ((flags & JSON_CVT_WITHDEV) &&
1729  !JsonHelper::Member_DiffToJson(json, flags, allocator, "out", data.out, ref.out)) return false;
1730  if (json.MemberCount()==0) json.SetNull();
1731  return true;
1732  }
1733 
1734  static void ForceChange(const jsonvu_bandlimiter& data [[maybe_unused]], jsonvu_bandlimiter& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1735  JsonHelper::Member_ForceChange(allocator, "gain", data.gain, ref.gain);
1736  JsonHelper::Member_ForceChange(allocator, "out", data.out, ref.out);
1737  }
1738 
1739  };
1740 // === object limiter ===
1741  // === Preset ===
1742  template <>
1743  struct JsonConvert<json_limiter> {
1744 
1745  static bool FromJson(const JSON_Value& json, json_limiter& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_limiter> &constraints = JsonConstraint<json_limiter>()) {
1746  if (sizeof(json_limiter)==0) return true; // quick empty struct
1747  if (json.IsNull()) { return true; }
1748  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
1749  if ((flags & JSON_CVT_WITHDEV) &&
1750  !JsonHelper::Member_FromJson(json, flags, "mode", data.mode, allocator)) return false;
1751  if ((flags & JSON_CVT_WITHDEV) &&
1752  !JsonHelper::Member_FromJson(json, flags, "drive", data.drive, allocator, JsonConstraint<S4Float>(-20,8))) return false;
1753  if ((flags & JSON_CVT_WITHDEV) &&
1754  !JsonHelper::Member_FromJson(json, flags, "base_drive", data.base_drive, allocator, JsonConstraint<S4Float>(-20,20))) return false;
1755  if ( !JsonHelper::Member_FromJson(json, flags, "lk_drive_on", data.lk_drive_on, allocator)) return false;
1756  if ( !JsonHelper::Member_FromJson(json, flags, "lk_drive", data.lk_drive, allocator, JsonConstraint<S4Float>(-20,8))) return false;
1757  if ((flags & JSON_CVT_WITHDEV) &&
1758  !JsonHelper::Member_FromJson(json, flags, "lk_base_drive", data.lk_base_drive, allocator, JsonConstraint<S4Float>(-20,20))) return false;
1759  if ((flags & JSON_CVT_WITHDEV) &&
1760  !JsonHelper::Member_FromJson(json, flags, "lk_len", data.lk_len, allocator, JsonConstraint<S4Float>(0.5,30))) return false;
1761  if ((flags & JSON_CVT_WITHDEV) &&
1762  !JsonHelper::Member_FromJson(json, flags, "lk_attack", data.lk_attack, allocator, JsonConstraint<S4Float>(1,32000))) return false;
1763  if ( !JsonHelper::Member_FromJson(json, flags, "lk_release", data.lk_release, allocator)) return false;
1764  if ( !JsonHelper::Member_FromJson(json, flags, "lk_postgain_on", data.lk_postgain_on, allocator)) return false;
1765  if ( !JsonHelper::Member_FromJson(json, flags, "lk_postgain", data.lk_postgain, allocator, JsonConstraint<S4Float>(0,+4))) return false;
1766  if ((flags & JSON_CVT_WITHDEV) &&
1767  !JsonHelper::Member_FromJson(json, flags, "lk_factor", data.lk_factor, allocator, JsonConstraint<S4Float>(1.0,8.0))) return false;
1768  if ((flags & JSON_CVT_WITHDEV) &&
1769  !JsonHelper::Member_FromJson(json, flags, "lk_rel_tab", data.lk_rel_tab, allocator, JsonConstraint<S4Float>(1,32000))) return false;
1770  if ((flags & JSON_CVT_WITHDEV) &&
1771  !JsonHelper::Member_FromJson(json, flags, "lk_mode", data.lk_mode, allocator)) return false;
1772  return true;
1773  }
1774 
1775  static bool ToJson(JSON_Value &json, const json_limiter& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1776  if (sizeof(json_limiter)==0) return true; // quick empty struct
1777  if (json.IsNull ()) {
1778  json.SetObject ();
1779  flags &= ~JSON_CVT_ONLYREQ; // children get all
1780  } else if (!json.IsObject()) {
1781  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1782  return false;
1783  }
1784  if ((flags & JSON_CVT_WITHDEV) &&
1785  !JsonHelper::Member_ToJson(json, flags, allocator, "mode", data.mode)) return false;
1786  if ((flags & JSON_CVT_WITHDEV) &&
1787  !JsonHelper::Member_ToJson(json, flags, allocator, "drive", data.drive)) return false;
1788  if ((flags & JSON_CVT_WITHDEV) &&
1789  !JsonHelper::Member_ToJson(json, flags, allocator, "base_drive", data.base_drive)) return false;
1790  if (!JsonHelper::Member_ToJson(json, flags, allocator, "lk_drive_on", data.lk_drive_on)) return false;
1791  if (!JsonHelper::Member_ToJson(json, flags, allocator, "lk_drive", data.lk_drive)) return false;
1792  if ((flags & JSON_CVT_WITHDEV) &&
1793  !JsonHelper::Member_ToJson(json, flags, allocator, "lk_base_drive", data.lk_base_drive)) return false;
1794  if ((flags & JSON_CVT_WITHDEV) &&
1795  !JsonHelper::Member_ToJson(json, flags, allocator, "lk_len", data.lk_len)) return false;
1796  if ((flags & JSON_CVT_WITHDEV) &&
1797  !JsonHelper::Member_ToJson(json, flags, allocator, "lk_attack", data.lk_attack)) return false;
1798  if (!JsonHelper::Member_ToJson(json, flags, allocator, "lk_release", data.lk_release)) return false;
1799  if (!JsonHelper::Member_ToJson(json, flags, allocator, "lk_postgain_on", data.lk_postgain_on)) return false;
1800  if (!JsonHelper::Member_ToJson(json, flags, allocator, "lk_postgain", data.lk_postgain)) return false;
1801  if ((flags & JSON_CVT_WITHDEV) &&
1802  !JsonHelper::Member_ToJson(json, flags, allocator, "lk_factor", data.lk_factor)) return false;
1803  if ((flags & JSON_CVT_WITHDEV) &&
1804  !JsonHelper::Member_ToJson(json, flags, allocator, "lk_rel_tab", data.lk_rel_tab)) return false;
1805  if ((flags & JSON_CVT_WITHDEV) &&
1806  !JsonHelper::Member_ToJson(json, flags, allocator, "lk_mode", data.lk_mode)) return false;
1807  if (json.MemberCount()==0) json.SetNull();
1808  return true;
1809  }
1810 
1811  static bool DiffToJson(JSON_Value &json, const json_limiter& data [[maybe_unused]], json_limiter& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1812  if (sizeof(json_limiter)==0) return true; // quick empty struct
1813  if (json.IsNull ()) {
1814  json.SetObject ();
1815  flags &= ~JSON_CVT_ONLYREQ; // children get all
1816  } else if (!json.IsObject()) {
1817  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1818  return false;
1819  }
1820  if ((flags & JSON_CVT_WITHDEV) &&
1821  !JsonHelper::Member_DiffToJson(json, flags, allocator, "mode", data.mode, ref.mode)) return false;
1822  if ((flags & JSON_CVT_WITHDEV) &&
1823  !JsonHelper::Member_DiffToJson(json, flags, allocator, "drive", data.drive, ref.drive)) return false;
1824  if ((flags & JSON_CVT_WITHDEV) &&
1825  !JsonHelper::Member_DiffToJson(json, flags, allocator, "base_drive", data.base_drive, ref.base_drive)) return false;
1826  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "lk_drive_on", data.lk_drive_on, ref.lk_drive_on)) return false;
1827  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "lk_drive", data.lk_drive, ref.lk_drive)) return false;
1828  if ((flags & JSON_CVT_WITHDEV) &&
1829  !JsonHelper::Member_DiffToJson(json, flags, allocator, "lk_base_drive", data.lk_base_drive, ref.lk_base_drive)) return false;
1830  if ((flags & JSON_CVT_WITHDEV) &&
1831  !JsonHelper::Member_DiffToJson(json, flags, allocator, "lk_len", data.lk_len, ref.lk_len)) return false;
1832  if ((flags & JSON_CVT_WITHDEV) &&
1833  !JsonHelper::Member_DiffToJson(json, flags, allocator, "lk_attack", data.lk_attack, ref.lk_attack)) return false;
1834  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "lk_release", data.lk_release, ref.lk_release)) return false;
1835  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "lk_postgain_on", data.lk_postgain_on, ref.lk_postgain_on)) return false;
1836  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "lk_postgain", data.lk_postgain, ref.lk_postgain)) return false;
1837  if ((flags & JSON_CVT_WITHDEV) &&
1838  !JsonHelper::Member_DiffToJson(json, flags, allocator, "lk_factor", data.lk_factor, ref.lk_factor)) return false;
1839  if ((flags & JSON_CVT_WITHDEV) &&
1840  !JsonHelper::Member_DiffToJson(json, flags, allocator, "lk_rel_tab", data.lk_rel_tab, ref.lk_rel_tab)) return false;
1841  if ((flags & JSON_CVT_WITHDEV) &&
1842  !JsonHelper::Member_DiffToJson(json, flags, allocator, "lk_mode", data.lk_mode, ref.lk_mode)) return false;
1843  if (json.MemberCount()==0) json.SetNull();
1844  return true;
1845  }
1846 
1847  static void ForceChange(const json_limiter& data [[maybe_unused]], json_limiter& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1848  JsonHelper::Member_ForceChange(allocator, "mode", data.mode, ref.mode);
1849  JsonHelper::Member_ForceChange(allocator, "drive", data.drive, ref.drive);
1850  JsonHelper::Member_ForceChange(allocator, "base_drive", data.base_drive, ref.base_drive);
1851  JsonHelper::Member_ForceChange(allocator, "lk_drive_on", data.lk_drive_on, ref.lk_drive_on);
1852  JsonHelper::Member_ForceChange(allocator, "lk_drive", data.lk_drive, ref.lk_drive);
1853  JsonHelper::Member_ForceChange(allocator, "lk_base_drive", data.lk_base_drive, ref.lk_base_drive);
1854  JsonHelper::Member_ForceChange(allocator, "lk_len", data.lk_len, ref.lk_len);
1855  JsonHelper::Member_ForceChange(allocator, "lk_attack", data.lk_attack, ref.lk_attack);
1856  JsonHelper::Member_ForceChange(allocator, "lk_release", data.lk_release, ref.lk_release);
1857  JsonHelper::Member_ForceChange(allocator, "lk_postgain_on", data.lk_postgain_on, ref.lk_postgain_on);
1858  JsonHelper::Member_ForceChange(allocator, "lk_postgain", data.lk_postgain, ref.lk_postgain);
1859  JsonHelper::Member_ForceChange(allocator, "lk_factor", data.lk_factor, ref.lk_factor);
1860  JsonHelper::Member_ForceChange(allocator, "lk_rel_tab", data.lk_rel_tab, ref.lk_rel_tab);
1861  JsonHelper::Member_ForceChange(allocator, "lk_mode", data.lk_mode, ref.lk_mode);
1862  }
1863 
1864  };
1865  // === VU ===
1866  template <>
1867  struct JsonConvert<jsonvu_limiter> {
1868 
1869  /* VU have no FromJson */
1870 
1871  static bool ToJson(JSON_Value &json, const jsonvu_limiter& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1872  if (sizeof(jsonvu_limiter)==0) return true; // quick empty struct
1873  if (json.IsNull ()) {
1874  json.SetObject ();
1875  flags &= ~JSON_CVT_ONLYREQ; // children get all
1876  } else if (!json.IsObject()) {
1877  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1878  return false;
1879  }
1880  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gain", data.gain)) return false;
1881  if ((flags & JSON_CVT_WITHDEV) &&
1882  !JsonHelper::Member_ToJson(json, flags, allocator, "lkatt", data.lkatt)) return false;
1883  if ((flags & JSON_CVT_WITHDEV) &&
1884  !JsonHelper::Member_ToJson(json, flags, allocator, "over", data.over)) return false;
1885  if (json.MemberCount()==0) json.SetNull();
1886  return true;
1887  }
1888 
1889  static bool DiffToJson(JSON_Value &json, const jsonvu_limiter& data [[maybe_unused]], jsonvu_limiter& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1890  if (sizeof(jsonvu_limiter)==0) return true; // quick empty struct
1891  if (json.IsNull ()) {
1892  json.SetObject ();
1893  flags &= ~JSON_CVT_ONLYREQ; // children get all
1894  } else if (!json.IsObject()) {
1895  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1896  return false;
1897  }
1898  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gain", data.gain, ref.gain)) return false;
1899  if ((flags & JSON_CVT_WITHDEV) &&
1900  !JsonHelper::Member_DiffToJson(json, flags, allocator, "lkatt", data.lkatt, ref.lkatt)) return false;
1901  if ((flags & JSON_CVT_WITHDEV) &&
1902  !JsonHelper::Member_DiffToJson(json, flags, allocator, "over", data.over, ref.over)) return false;
1903  if (json.MemberCount()==0) json.SetNull();
1904  return true;
1905  }
1906 
1907  static void ForceChange(const jsonvu_limiter& data [[maybe_unused]], jsonvu_limiter& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1908  JsonHelper::Member_ForceChange(allocator, "gain", data.gain, ref.gain);
1909  JsonHelper::Member_ForceChange(allocator, "lkatt", data.lkatt, ref.lkatt);
1910  JsonHelper::Member_ForceChange(allocator, "over", data.over, ref.over);
1911  }
1912 
1913  };
1914 // === object output ===
1915  // === Preset ===
1916  template <>
1917  struct JsonConvert<json_output> {
1918 
1919  static bool FromJson(const JSON_Value& json, json_output& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_output> &constraints = JsonConstraint<json_output>()) {
1920  if (sizeof(json_output)==0) return true; // quick empty struct
1921  if (json.IsNull()) { return true; }
1922  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
1923  return true;
1924  }
1925 
1926  static bool ToJson(JSON_Value &json, const json_output& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1927  if (sizeof(json_output)==0) return true; // quick empty struct
1928  if (json.IsNull ()) {
1929  json.SetObject ();
1930  flags &= ~JSON_CVT_ONLYREQ; // children get all
1931  } else if (!json.IsObject()) {
1932  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1933  return false;
1934  }
1935  if (json.MemberCount()==0) json.SetNull();
1936  return true;
1937  }
1938 
1939  static bool DiffToJson(JSON_Value &json, const json_output& data [[maybe_unused]], json_output& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1940  if (sizeof(json_output)==0) return true; // quick empty struct
1941  if (json.IsNull ()) {
1942  json.SetObject ();
1943  flags &= ~JSON_CVT_ONLYREQ; // children get all
1944  } else if (!json.IsObject()) {
1945  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1946  return false;
1947  }
1948  if (json.MemberCount()==0) json.SetNull();
1949  return true;
1950  }
1951 
1952  static void ForceChange(const json_output& data [[maybe_unused]], json_output& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1953  }
1954 
1955  };
1956  // === VU ===
1957  template <>
1958  struct JsonConvert<jsonvu_output> {
1959 
1960  /* VU have no FromJson */
1961 
1962  static bool ToJson(JSON_Value &json, const jsonvu_output& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1963  if (sizeof(jsonvu_output)==0) return true; // quick empty struct
1964  if (json.IsNull ()) {
1965  json.SetObject ();
1966  flags &= ~JSON_CVT_ONLYREQ; // children get all
1967  } else if (!json.IsObject()) {
1968  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1969  return false;
1970  }
1971  if (!JsonHelper::Member_ToJson(json, flags, allocator, "vu", data.vu)) return false;
1972  if (json.MemberCount()==0) json.SetNull();
1973  return true;
1974  }
1975 
1976  static bool DiffToJson(JSON_Value &json, const jsonvu_output& data [[maybe_unused]], jsonvu_output& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1977  if (sizeof(jsonvu_output)==0) return true; // quick empty struct
1978  if (json.IsNull ()) {
1979  json.SetObject ();
1980  flags &= ~JSON_CVT_ONLYREQ; // children get all
1981  } else if (!json.IsObject()) {
1982  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1983  return false;
1984  }
1985  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "vu", data.vu, ref.vu)) return false;
1986  if (json.MemberCount()==0) json.SetNull();
1987  return true;
1988  }
1989 
1990  static void ForceChange(const jsonvu_output& data [[maybe_unused]], jsonvu_output& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1991  JsonHelper::Member_ForceChange(allocator, "vu", data.vu, ref.vu);
1992  }
1993 
1994  };
1995 // === object r128 ===
1996  // === Preset ===
1997  template <>
1998  struct JsonConvert<json_r128> {
1999 
2000  static bool FromJson(const JSON_Value& json, json_r128& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_r128> &constraints = JsonConstraint<json_r128>()) {
2001  if (sizeof(json_r128)==0) return true; // quick empty struct
2002  if (json.IsNull()) { return true; }
2003  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
2004  if ( !JsonHelper::Member_FromJson(json, flags, "on", data.on, allocator)) return false;
2005  if ( !JsonHelper::Member_FromJson(json, flags, "target", data.target, allocator, JsonConstraint<S4Float>(-36,0))) return false;
2006  if ((flags & JSON_CVT_WITHDEV) &&
2007  !JsonHelper::Member_FromJson(json, flags, "attack", data.attack, allocator, JsonConstraint<S4Float>(0.01,10))) return false;
2008  if ((flags & JSON_CVT_WITHDEV) &&
2009  !JsonHelper::Member_FromJson(json, flags, "release", data.release, allocator, JsonConstraint<S4Float>(0.01,10))) return false;
2010  return true;
2011  }
2012 
2013  static bool ToJson(JSON_Value &json, const json_r128& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2014  if (sizeof(json_r128)==0) return true; // quick empty struct
2015  if (json.IsNull ()) {
2016  json.SetObject ();
2017  flags &= ~JSON_CVT_ONLYREQ; // children get all
2018  } else if (!json.IsObject()) {
2019  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2020  return false;
2021  }
2022  if (!JsonHelper::Member_ToJson(json, flags, allocator, "on", data.on)) return false;
2023  if (!JsonHelper::Member_ToJson(json, flags, allocator, "target", data.target)) return false;
2024  if ((flags & JSON_CVT_WITHDEV) &&
2025  !JsonHelper::Member_ToJson(json, flags, allocator, "attack", data.attack)) return false;
2026  if ((flags & JSON_CVT_WITHDEV) &&
2027  !JsonHelper::Member_ToJson(json, flags, allocator, "release", data.release)) return false;
2028  if (json.MemberCount()==0) json.SetNull();
2029  return true;
2030  }
2031 
2032  static bool DiffToJson(JSON_Value &json, const json_r128& data [[maybe_unused]], json_r128& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2033  if (sizeof(json_r128)==0) return true; // quick empty struct
2034  if (json.IsNull ()) {
2035  json.SetObject ();
2036  flags &= ~JSON_CVT_ONLYREQ; // children get all
2037  } else if (!json.IsObject()) {
2038  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2039  return false;
2040  }
2041  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "on", data.on, ref.on)) return false;
2042  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "target", data.target, ref.target)) return false;
2043  if ((flags & JSON_CVT_WITHDEV) &&
2044  !JsonHelper::Member_DiffToJson(json, flags, allocator, "attack", data.attack, ref.attack)) return false;
2045  if ((flags & JSON_CVT_WITHDEV) &&
2046  !JsonHelper::Member_DiffToJson(json, flags, allocator, "release", data.release, ref.release)) return false;
2047  if (json.MemberCount()==0) json.SetNull();
2048  return true;
2049  }
2050 
2051  static void ForceChange(const json_r128& data [[maybe_unused]], json_r128& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2052  JsonHelper::Member_ForceChange(allocator, "on", data.on, ref.on);
2053  JsonHelper::Member_ForceChange(allocator, "target", data.target, ref.target);
2054  JsonHelper::Member_ForceChange(allocator, "attack", data.attack, ref.attack);
2055  JsonHelper::Member_ForceChange(allocator, "release", data.release, ref.release);
2056  }
2057 
2058  };
2059  // === VU ===
2060  template <>
2061  struct JsonConvert<jsonvu_r128> {
2062 
2063  /* VU have no FromJson */
2064 
2065  static bool ToJson(JSON_Value &json, const jsonvu_r128& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2066  if (sizeof(jsonvu_r128)==0) return true; // quick empty struct
2067  if (json.IsNull ()) {
2068  json.SetObject ();
2069  flags &= ~JSON_CVT_ONLYREQ; // children get all
2070  } else if (!json.IsObject()) {
2071  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2072  return false;
2073  }
2074  if (!JsonHelper::Member_ToJson(json, flags, allocator, "vu_on", data.vu_on)) return false;
2075  if (!JsonHelper::Member_ToJson(json, flags, allocator, "vu_target", data.vu_target)) return false;
2076  if ((flags & JSON_CVT_WITHDEV) &&
2077  !JsonHelper::Member_ToJson(json, flags, allocator, "bs_moment", data.bs_moment)) return false;
2078  if ((flags & JSON_CVT_WITHDEV) &&
2079  !JsonHelper::Member_ToJson(json, flags, allocator, "bs_short", data.bs_short)) return false;
2080  if (!JsonHelper::Member_ToJson(json, flags, allocator, "bs_long", data.bs_long)) return false;
2081  if (!JsonHelper::Member_ToJson(json, flags, allocator, "bs_user", data.bs_user)) return false;
2082  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gain", data.gain)) return false;
2083  if ((flags & JSON_CVT_WITHDEV) &&
2084  !JsonHelper::Member_ToJson(json, flags, allocator, "bs_psr", data.bs_psr)) return false;
2085  if ((flags & JSON_CVT_WITHDEV) &&
2086  !JsonHelper::Member_ToJson(json, flags, allocator, "bs_plr", data.bs_plr)) return false;
2087  if ((flags & JSON_CVT_WITHDEV) &&
2088  !JsonHelper::Member_ToJson(json, flags, allocator, "bs_moment_pk", data.bs_moment_pk)) return false;
2089  if ((flags & JSON_CVT_WITHDEV) &&
2090  !JsonHelper::Member_ToJson(json, flags, allocator, "bs_short_pk", data.bs_short_pk)) return false;
2091  if ((flags & JSON_CVT_WITHDEV) &&
2092  !JsonHelper::Member_ToJson(json, flags, allocator, "bs_long_pk", data.bs_long_pk)) return false;
2093  if (!JsonHelper::Member_ToJson(json, flags, allocator, "bs_user_pk", data.bs_user_pk)) return false;
2094  if (json.MemberCount()==0) json.SetNull();
2095  return true;
2096  }
2097 
2098  static bool DiffToJson(JSON_Value &json, const jsonvu_r128& data [[maybe_unused]], jsonvu_r128& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2099  if (sizeof(jsonvu_r128)==0) return true; // quick empty struct
2100  if (json.IsNull ()) {
2101  json.SetObject ();
2102  flags &= ~JSON_CVT_ONLYREQ; // children get all
2103  } else if (!json.IsObject()) {
2104  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2105  return false;
2106  }
2107  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "vu_on", data.vu_on, ref.vu_on)) return false;
2108  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "vu_target", data.vu_target, ref.vu_target)) return false;
2109  if ((flags & JSON_CVT_WITHDEV) &&
2110  !JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_moment", data.bs_moment, ref.bs_moment)) return false;
2111  if ((flags & JSON_CVT_WITHDEV) &&
2112  !JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_short", data.bs_short, ref.bs_short)) return false;
2113  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_long", data.bs_long, ref.bs_long)) return false;
2114  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_user", data.bs_user, ref.bs_user)) return false;
2115  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gain", data.gain, ref.gain)) return false;
2116  if ((flags & JSON_CVT_WITHDEV) &&
2117  !JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_psr", data.bs_psr, ref.bs_psr)) return false;
2118  if ((flags & JSON_CVT_WITHDEV) &&
2119  !JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_plr", data.bs_plr, ref.bs_plr)) return false;
2120  if ((flags & JSON_CVT_WITHDEV) &&
2121  !JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_moment_pk", data.bs_moment_pk, ref.bs_moment_pk)) return false;
2122  if ((flags & JSON_CVT_WITHDEV) &&
2123  !JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_short_pk", data.bs_short_pk, ref.bs_short_pk)) return false;
2124  if ((flags & JSON_CVT_WITHDEV) &&
2125  !JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_long_pk", data.bs_long_pk, ref.bs_long_pk)) return false;
2126  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_user_pk", data.bs_user_pk, ref.bs_user_pk)) return false;
2127  if (json.MemberCount()==0) json.SetNull();
2128  return true;
2129  }
2130 
2131  static void ForceChange(const jsonvu_r128& data [[maybe_unused]], jsonvu_r128& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2132  JsonHelper::Member_ForceChange(allocator, "vu_on", data.vu_on, ref.vu_on);
2133  JsonHelper::Member_ForceChange(allocator, "vu_target", data.vu_target, ref.vu_target);
2134  JsonHelper::Member_ForceChange(allocator, "bs_moment", data.bs_moment, ref.bs_moment);
2135  JsonHelper::Member_ForceChange(allocator, "bs_short", data.bs_short, ref.bs_short);
2136  JsonHelper::Member_ForceChange(allocator, "bs_long", data.bs_long, ref.bs_long);
2137  JsonHelper::Member_ForceChange(allocator, "bs_user", data.bs_user, ref.bs_user);
2138  JsonHelper::Member_ForceChange(allocator, "gain", data.gain, ref.gain);
2139  JsonHelper::Member_ForceChange(allocator, "bs_psr", data.bs_psr, ref.bs_psr);
2140  JsonHelper::Member_ForceChange(allocator, "bs_plr", data.bs_plr, ref.bs_plr);
2141  JsonHelper::Member_ForceChange(allocator, "bs_moment_pk", data.bs_moment_pk, ref.bs_moment_pk);
2142  JsonHelper::Member_ForceChange(allocator, "bs_short_pk", data.bs_short_pk, ref.bs_short_pk);
2143  JsonHelper::Member_ForceChange(allocator, "bs_long_pk", data.bs_long_pk, ref.bs_long_pk);
2144  JsonHelper::Member_ForceChange(allocator, "bs_user_pk", data.bs_user_pk, ref.bs_user_pk);
2145  }
2146 
2147  };
2148 // === object settings_gain ===
2149  // === Preset ===
2150  template <>
2151  struct JsonConvert<json_settings_gain> {
2152 
2153  static bool FromJson(const JSON_Value& json, json_settings_gain& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_settings_gain> &constraints = JsonConstraint<json_settings_gain>()) {
2154  if (sizeof(json_settings_gain)==0) return true; // quick empty struct
2155  if (json.IsNull()) { return true; }
2156  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
2157  if ( !JsonHelper::Member_FromJson(json, flags, "in", data.in, allocator, JsonConstraint<S4Float>(-30,30))) return false;
2158  if ( !JsonHelper::Member_FromJson(json, flags, "out", data.out, allocator, JsonConstraint<S4Float>(-30,30))) return false;
2159  return true;
2160  }
2161 
2162  static bool ToJson(JSON_Value &json, const json_settings_gain& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2163  if (sizeof(json_settings_gain)==0) return true; // quick empty struct
2164  if (json.IsNull ()) {
2165  json.SetObject ();
2166  flags &= ~JSON_CVT_ONLYREQ; // children get all
2167  } else if (!json.IsObject()) {
2168  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2169  return false;
2170  }
2171  if (!JsonHelper::Member_ToJson(json, flags, allocator, "in", data.in)) return false;
2172  if (!JsonHelper::Member_ToJson(json, flags, allocator, "out", data.out)) return false;
2173  if (json.MemberCount()==0) json.SetNull();
2174  return true;
2175  }
2176 
2177  static bool DiffToJson(JSON_Value &json, const json_settings_gain& data [[maybe_unused]], json_settings_gain& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2178  if (sizeof(json_settings_gain)==0) return true; // quick empty struct
2179  if (json.IsNull ()) {
2180  json.SetObject ();
2181  flags &= ~JSON_CVT_ONLYREQ; // children get all
2182  } else if (!json.IsObject()) {
2183  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2184  return false;
2185  }
2186  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "in", data.in, ref.in)) return false;
2187  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "out", data.out, ref.out)) return false;
2188  if (json.MemberCount()==0) json.SetNull();
2189  return true;
2190  }
2191 
2192  static void ForceChange(const json_settings_gain& data [[maybe_unused]], json_settings_gain& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2193  JsonHelper::Member_ForceChange(allocator, "in", data.in, ref.in);
2194  JsonHelper::Member_ForceChange(allocator, "out", data.out, ref.out);
2195  }
2196 
2197  };
2198  // === VU ===
2199  template <>
2200  struct JsonConvert<jsonvu_settings_gain> {
2201 
2202  /* VU have no FromJson */
2203 
2204  static bool ToJson(JSON_Value &json, const jsonvu_settings_gain& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2205  if (sizeof(jsonvu_settings_gain)==0) return true; // quick empty struct
2206  if (json.IsNull ()) {
2207  json.SetObject ();
2208  flags &= ~JSON_CVT_ONLYREQ; // children get all
2209  } else if (!json.IsObject()) {
2210  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2211  return false;
2212  }
2213  if (json.MemberCount()==0) json.SetNull();
2214  return true;
2215  }
2216 
2217  static bool DiffToJson(JSON_Value &json, const jsonvu_settings_gain& data [[maybe_unused]], jsonvu_settings_gain& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2218  if (sizeof(jsonvu_settings_gain)==0) return true; // quick empty struct
2219  if (json.IsNull ()) {
2220  json.SetObject ();
2221  flags &= ~JSON_CVT_ONLYREQ; // children get all
2222  } else if (!json.IsObject()) {
2223  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2224  return false;
2225  }
2226  if (json.MemberCount()==0) json.SetNull();
2227  return true;
2228  }
2229 
2230  static void ForceChange(const jsonvu_settings_gain& data [[maybe_unused]], jsonvu_settings_gain& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2231  }
2232 
2233  };
2234 // === object r128_settings ===
2235  // === Preset ===
2236  template <>
2237  struct JsonConvert<json_r128_settings> {
2238 
2239  static bool FromJson(const JSON_Value& json, json_r128_settings& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_r128_settings> &constraints = JsonConstraint<json_r128_settings>()) {
2240  if (sizeof(json_r128_settings)==0) return true; // quick empty struct
2241  if (json.IsNull()) { return true; }
2242  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
2243  if ( !JsonHelper::Member_FromJson(json, flags, "longterm_time", data.longterm_time, allocator, JsonConstraint<S4Float>(4,120))) return false;
2244  if ( !JsonHelper::Member_FromJson(json, flags, "vutype", data.vutype, allocator)) return false;
2245  if ( !JsonHelper::Member_FromJson(json, flags, "on", data.on, allocator)) return false;
2246  if ( !JsonHelper::Member_FromJson(json, flags, "truepeak_protect", data.truepeak_protect, allocator)) return false;
2247  if ( !JsonHelper::Member_FromJson(json, flags, "target", data.target, allocator, JsonConstraint<S4Float>(-36,0))) return false;
2248  return true;
2249  }
2250 
2251  static bool ToJson(JSON_Value &json, const json_r128_settings& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2252  if (sizeof(json_r128_settings)==0) return true; // quick empty struct
2253  if (json.IsNull ()) {
2254  json.SetObject ();
2255  flags &= ~JSON_CVT_ONLYREQ; // children get all
2256  } else if (!json.IsObject()) {
2257  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2258  return false;
2259  }
2260  if (!JsonHelper::Member_ToJson(json, flags, allocator, "longterm_time", data.longterm_time)) return false;
2261  if (!JsonHelper::Member_ToJson(json, flags, allocator, "vutype", data.vutype)) return false;
2262  if (!JsonHelper::Member_ToJson(json, flags, allocator, "on", data.on)) return false;
2263  if (!JsonHelper::Member_ToJson(json, flags, allocator, "truepeak_protect", data.truepeak_protect)) return false;
2264  if (!JsonHelper::Member_ToJson(json, flags, allocator, "target", data.target)) return false;
2265  if (json.MemberCount()==0) json.SetNull();
2266  return true;
2267  }
2268 
2269  static bool DiffToJson(JSON_Value &json, const json_r128_settings& data [[maybe_unused]], json_r128_settings& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2270  if (sizeof(json_r128_settings)==0) return true; // quick empty struct
2271  if (json.IsNull ()) {
2272  json.SetObject ();
2273  flags &= ~JSON_CVT_ONLYREQ; // children get all
2274  } else if (!json.IsObject()) {
2275  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2276  return false;
2277  }
2278  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "longterm_time", data.longterm_time, ref.longterm_time)) return false;
2279  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "vutype", data.vutype, ref.vutype)) return false;
2280  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "on", data.on, ref.on)) return false;
2281  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "truepeak_protect", data.truepeak_protect, ref.truepeak_protect)) return false;
2282  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "target", data.target, ref.target)) return false;
2283  if (json.MemberCount()==0) json.SetNull();
2284  return true;
2285  }
2286 
2287  static void ForceChange(const json_r128_settings& data [[maybe_unused]], json_r128_settings& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2288  JsonHelper::Member_ForceChange(allocator, "longterm_time", data.longterm_time, ref.longterm_time);
2289  JsonHelper::Member_ForceChange(allocator, "vutype", data.vutype, ref.vutype);
2290  JsonHelper::Member_ForceChange(allocator, "on", data.on, ref.on);
2291  JsonHelper::Member_ForceChange(allocator, "truepeak_protect", data.truepeak_protect, ref.truepeak_protect);
2292  JsonHelper::Member_ForceChange(allocator, "target", data.target, ref.target);
2293  }
2294 
2295  };
2296  // === VU ===
2297  template <>
2298  struct JsonConvert<jsonvu_r128_settings> {
2299 
2300  /* VU have no FromJson */
2301 
2302  static bool ToJson(JSON_Value &json, const jsonvu_r128_settings& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2303  if (sizeof(jsonvu_r128_settings)==0) return true; // quick empty struct
2304  if (json.IsNull ()) {
2305  json.SetObject ();
2306  flags &= ~JSON_CVT_ONLYREQ; // children get all
2307  } else if (!json.IsObject()) {
2308  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2309  return false;
2310  }
2311  if (json.MemberCount()==0) json.SetNull();
2312  return true;
2313  }
2314 
2315  static bool DiffToJson(JSON_Value &json, const jsonvu_r128_settings& data [[maybe_unused]], jsonvu_r128_settings& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2316  if (sizeof(jsonvu_r128_settings)==0) return true; // quick empty struct
2317  if (json.IsNull ()) {
2318  json.SetObject ();
2319  flags &= ~JSON_CVT_ONLYREQ; // children get all
2320  } else if (!json.IsObject()) {
2321  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2322  return false;
2323  }
2324  if (json.MemberCount()==0) json.SetNull();
2325  return true;
2326  }
2327 
2328  static void ForceChange(const jsonvu_r128_settings& data [[maybe_unused]], jsonvu_r128_settings& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2329  }
2330 
2331  };
2332 // === object settings_general ===
2333  // === Preset ===
2334  template <>
2335  struct JsonConvert<json_settings_general> {
2336 
2337  static bool FromJson(const JSON_Value& json, json_settings_general& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_settings_general> &constraints = JsonConstraint<json_settings_general>()) {
2338  if (sizeof(json_settings_general)==0) return true; // quick empty struct
2339  if (json.IsNull()) { return true; }
2340  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
2341  if ( !JsonHelper::Member_FromJson(json, flags, "operate", data.operate, allocator)) return false;
2342  if ( !JsonHelper::Member_FromJson(json, flags, "history_unit", data.history_unit, allocator)) return false;
2343  return true;
2344  }
2345 
2346  static bool ToJson(JSON_Value &json, const json_settings_general& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2347  if (sizeof(json_settings_general)==0) return true; // quick empty struct
2348  if (json.IsNull ()) {
2349  json.SetObject ();
2350  flags &= ~JSON_CVT_ONLYREQ; // children get all
2351  } else if (!json.IsObject()) {
2352  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2353  return false;
2354  }
2355  if (!JsonHelper::Member_ToJson(json, flags, allocator, "operate", data.operate)) return false;
2356  if (!JsonHelper::Member_ToJson(json, flags, allocator, "history_unit", data.history_unit)) return false;
2357  if (json.MemberCount()==0) json.SetNull();
2358  return true;
2359  }
2360 
2361  static bool DiffToJson(JSON_Value &json, const json_settings_general& data [[maybe_unused]], json_settings_general& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2362  if (sizeof(json_settings_general)==0) return true; // quick empty struct
2363  if (json.IsNull ()) {
2364  json.SetObject ();
2365  flags &= ~JSON_CVT_ONLYREQ; // children get all
2366  } else if (!json.IsObject()) {
2367  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2368  return false;
2369  }
2370  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "operate", data.operate, ref.operate)) return false;
2371  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "history_unit", data.history_unit, ref.history_unit)) return false;
2372  if (json.MemberCount()==0) json.SetNull();
2373  return true;
2374  }
2375 
2376  static void ForceChange(const json_settings_general& data [[maybe_unused]], json_settings_general& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2377  JsonHelper::Member_ForceChange(allocator, "operate", data.operate, ref.operate);
2378  JsonHelper::Member_ForceChange(allocator, "history_unit", data.history_unit, ref.history_unit);
2379  }
2380 
2381  };
2382  // === VU ===
2383  template <>
2384  struct JsonConvert<jsonvu_settings_general> {
2385 
2386  /* VU have no FromJson */
2387 
2388  static bool ToJson(JSON_Value &json, const jsonvu_settings_general& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2389  if (sizeof(jsonvu_settings_general)==0) return true; // quick empty struct
2390  if (json.IsNull ()) {
2391  json.SetObject ();
2392  flags &= ~JSON_CVT_ONLYREQ; // children get all
2393  } else if (!json.IsObject()) {
2394  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2395  return false;
2396  }
2397  if (json.MemberCount()==0) json.SetNull();
2398  return true;
2399  }
2400 
2401  static bool DiffToJson(JSON_Value &json, const jsonvu_settings_general& data [[maybe_unused]], jsonvu_settings_general& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2402  if (sizeof(jsonvu_settings_general)==0) return true; // quick empty struct
2403  if (json.IsNull ()) {
2404  json.SetObject ();
2405  flags &= ~JSON_CVT_ONLYREQ; // children get all
2406  } else if (!json.IsObject()) {
2407  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2408  return false;
2409  }
2410  if (json.MemberCount()==0) json.SetNull();
2411  return true;
2412  }
2413 
2414  static void ForceChange(const jsonvu_settings_general& data [[maybe_unused]], jsonvu_settings_general& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2415  }
2416 
2417  };
2418 
2419 // =============================
2420 // =========== settings ========
2421 // =============================
2422  template <>
2423  struct JsonConvert<json_settings> {
2424 
2425  static bool FromJson(const JSON_Value& json, json_settings& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_settings> &constraints = JsonConstraint<json_settings>()) {
2426  if (sizeof(json_settings)==0) return true; // quick empty struct
2427  if (json.IsNull()) { return true; }
2428  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
2429  if ( !JsonHelper::Member_FromJson(json, flags, "general", data.general, allocator)) return false;
2430  if ( !JsonHelper::Member_FromJson(json, flags, "gain", data.gain, allocator)) return false;
2431  if ( !JsonHelper::Member_FromJson(json, flags, "r128", data.r128, allocator)) return false;
2432  return true;
2433  }
2434 
2435  static bool ToJson(JSON_Value &json, const json_settings& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2436  if (sizeof(json_settings)==0) return true; // quick empty struct
2437  if (json.IsNull ()) {
2438  json.SetObject ();
2439  flags &= ~JSON_CVT_ONLYREQ; // children get all
2440  } else if (!json.IsObject()) {
2441  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2442  return false;
2443  }
2444  if (!JsonHelper::Member_ToJson(json, flags, allocator, "general", data.general)) return false;
2445  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gain", data.gain)) return false;
2446  if (!JsonHelper::Member_ToJson(json, flags, allocator, "r128", data.r128)) return false;
2447  if (json.MemberCount()==0) json.SetNull();
2448  return true;
2449  }
2450 
2451  static bool DiffToJson(JSON_Value &json, const json_settings& data [[maybe_unused]], json_settings& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2452  if (sizeof(json_settings)==0) return true; // quick empty struct
2453  if (json.IsNull ()) {
2454  json.SetObject ();
2455  flags &= ~JSON_CVT_ONLYREQ; // children get all
2456  } else if (!json.IsObject()) {
2457  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2458  return false;
2459  }
2460  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "general", data.general, ref.general)) return false;
2461  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gain", data.gain, ref.gain)) return false;
2462  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "r128", data.r128, ref.r128)) return false;
2463  if (json.MemberCount()==0) json.SetNull();
2464  return true;
2465  }
2466 
2467  static void ForceChange(const json_settings& data [[maybe_unused]], json_settings& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2468  JsonHelper::Member_ForceChange(allocator, "general", data.general, ref.general);
2469  JsonHelper::Member_ForceChange(allocator, "gain", data.gain, ref.gain);
2470  JsonHelper::Member_ForceChange(allocator, "r128", data.r128, ref.r128);
2471  }
2472 
2473  };
2474 // =============================
2475 // ========= Settings VU =======
2476 // =============================
2477  template <>
2478  struct JsonConvert<jsonvu_settings> {
2479 
2480  /* VU have no FromJson */
2481 
2482  static bool ToJson(JSON_Value &json, const jsonvu_settings& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2483  if (sizeof(jsonvu_settings)==0) return true; // quick empty struct
2484  if (json.IsNull ()) {
2485  json.SetObject ();
2486  flags &= ~JSON_CVT_ONLYREQ; // children get all
2487  } else if (!json.IsObject()) {
2488  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2489  return false;
2490  }
2491  if (!JsonHelper::Member_ToJson(json, flags, allocator, "general", data.general)) return false;
2492  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gain", data.gain)) return false;
2493  if (!JsonHelper::Member_ToJson(json, flags, allocator, "r128", data.r128)) return false;
2494  if (json.MemberCount()==0) json.SetNull();
2495  return true;
2496  }
2497 
2498  static bool DiffToJson(JSON_Value &json, const jsonvu_settings& data [[maybe_unused]], jsonvu_settings& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2499  if (sizeof(jsonvu_settings)==0) return true; // quick empty struct
2500  if (json.IsNull ()) {
2501  json.SetObject ();
2502  flags &= ~JSON_CVT_ONLYREQ; // children get all
2503  } else if (!json.IsObject()) {
2504  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2505  return false;
2506  }
2507  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "general", data.general, ref.general)) return false;
2508  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gain", data.gain, ref.gain)) return false;
2509  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "r128", data.r128, ref.r128)) return false;
2510  if (json.MemberCount()==0) json.SetNull();
2511  return true;
2512  }
2513 
2514  static void ForceChange(const jsonvu_settings& data [[maybe_unused]], jsonvu_settings& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2515  JsonHelper::Member_ForceChange(allocator, "general", data.general, ref.general);
2516  JsonHelper::Member_ForceChange(allocator, "gain", data.gain, ref.gain);
2517  JsonHelper::Member_ForceChange(allocator, "r128", data.r128, ref.r128);
2518  }
2519 
2520  };
2521 // =============================
2522 // ========== preset ==========
2523 // =============================
2524  template <>
2525  struct JsonConvert<json_preset> {
2526 
2527  static bool FromJson(const JSON_Value& json, json_preset& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_preset> &constraints = JsonConstraint<json_preset>()) {
2528  if (sizeof(json_preset)==0) return true; // quick empty struct
2529  if (json.IsNull()) { return true; }
2530  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
2531  if ( !JsonHelper::Member_FromJson(json, flags, "setup", data.setup, allocator)) return false;
2532  if ( !JsonHelper::Member_FromJson(json, flags, "in", data.in, allocator)) return false;
2533  if ( !JsonHelper::Member_FromJson(json, flags, "agc", data.agc, allocator)) return false;
2534  if ( !JsonHelper::Member_FromJson(json, flags, "tonefx", data.tonefx, allocator)) return false;
2535  if ( !JsonHelper::Member_FromJson(json, flags, "stereofx", data.stereofx, allocator)) return false;
2536  if ( !JsonHelper::Member_FromJson(json, flags, "bandprocess", data.bandprocess, allocator)) return false;
2537  if ( !JsonHelper::Member_FromJson(json, flags, "bandlimiter", data.bandlimiter, allocator)) return false;
2538  if ( !JsonHelper::Member_FromJson(json, flags, "limiter", data.limiter, allocator)) return false;
2539  if ( !JsonHelper::Member_FromJson(json, flags, "out", data.out, allocator)) return false;
2540  if ( !JsonHelper::Member_FromJson(json, flags, "r128", data.r128, allocator)) return false;
2541  return true;
2542  }
2543 
2544  static bool ToJson(JSON_Value &json, const json_preset& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2545  if (sizeof(json_preset)==0) return true; // quick empty struct
2546  if (json.IsNull ()) {
2547  json.SetObject ();
2548  flags &= ~JSON_CVT_ONLYREQ; // children get all
2549  } else if (!json.IsObject()) {
2550  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2551  return false;
2552  }
2553  if (!JsonHelper::Member_ToJson(json, flags, allocator, "setup", data.setup)) return false;
2554  if (!JsonHelper::Member_ToJson(json, flags, allocator, "in", data.in)) return false;
2555  if (!JsonHelper::Member_ToJson(json, flags, allocator, "agc", data.agc)) return false;
2556  if (!JsonHelper::Member_ToJson(json, flags, allocator, "tonefx", data.tonefx)) return false;
2557  if (!JsonHelper::Member_ToJson(json, flags, allocator, "stereofx", data.stereofx)) return false;
2558  if (!JsonHelper::Member_ToJson(json, flags, allocator, "bandprocess", data.bandprocess)) return false;
2559  if (!JsonHelper::Member_ToJson(json, flags, allocator, "bandlimiter", data.bandlimiter)) return false;
2560  if (!JsonHelper::Member_ToJson(json, flags, allocator, "limiter", data.limiter)) return false;
2561  if (!JsonHelper::Member_ToJson(json, flags, allocator, "out", data.out)) return false;
2562  if (!JsonHelper::Member_ToJson(json, flags, allocator, "r128", data.r128)) return false;
2563  if (json.MemberCount()==0) json.SetNull();
2564  return true;
2565  }
2566 
2567  static bool DiffToJson(JSON_Value &json, const json_preset& data [[maybe_unused]], json_preset& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2568  if (sizeof(json_preset)==0) return true; // quick empty struct
2569  if (json.IsNull ()) {
2570  json.SetObject ();
2571  flags &= ~JSON_CVT_ONLYREQ; // children get all
2572  } else if (!json.IsObject()) {
2573  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2574  return false;
2575  }
2576  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "setup", data.setup, ref.setup)) return false;
2577  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "in", data.in, ref.in)) return false;
2578  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "agc", data.agc, ref.agc)) return false;
2579  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "tonefx", data.tonefx, ref.tonefx)) return false;
2580  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "stereofx", data.stereofx, ref.stereofx)) return false;
2581  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "bandprocess", data.bandprocess, ref.bandprocess)) return false;
2582  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "bandlimiter", data.bandlimiter, ref.bandlimiter)) return false;
2583  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "limiter", data.limiter, ref.limiter)) return false;
2584  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "out", data.out, ref.out)) return false;
2585  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "r128", data.r128, ref.r128)) return false;
2586  if (json.MemberCount()==0) json.SetNull();
2587  return true;
2588  }
2589 
2590  static void ForceChange(const json_preset& data [[maybe_unused]], json_preset& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2591  JsonHelper::Member_ForceChange(allocator, "setup", data.setup, ref.setup);
2592  JsonHelper::Member_ForceChange(allocator, "in", data.in, ref.in);
2593  JsonHelper::Member_ForceChange(allocator, "agc", data.agc, ref.agc);
2594  JsonHelper::Member_ForceChange(allocator, "tonefx", data.tonefx, ref.tonefx);
2595  JsonHelper::Member_ForceChange(allocator, "stereofx", data.stereofx, ref.stereofx);
2596  JsonHelper::Member_ForceChange(allocator, "bandprocess", data.bandprocess, ref.bandprocess);
2597  JsonHelper::Member_ForceChange(allocator, "bandlimiter", data.bandlimiter, ref.bandlimiter);
2598  JsonHelper::Member_ForceChange(allocator, "limiter", data.limiter, ref.limiter);
2599  JsonHelper::Member_ForceChange(allocator, "out", data.out, ref.out);
2600  JsonHelper::Member_ForceChange(allocator, "r128", data.r128, ref.r128);
2601  }
2602 
2603  };
2604 // =============================
2605 // ========= All VU =========
2606 // =============================
2607  template <>
2608  struct JsonConvert<json_vu> {
2609 
2610  /* VU have no FromJson */
2611 
2612  static bool ToJson(JSON_Value &json, const json_vu& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2613  if (sizeof(json_vu)==0) return true; // quick empty struct
2614  if (json.IsNull ()) {
2615  json.SetObject ();
2616  flags &= ~JSON_CVT_ONLYREQ; // children get all
2617  } else if (!json.IsObject()) {
2618  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2619  return false;
2620  }
2621  if (!JsonHelper::Member_ToJson(json, flags, allocator, "setup", data.setup)) return false;
2622  if (!JsonHelper::Member_ToJson(json, flags, allocator, "in", data.in)) return false;
2623  if (!JsonHelper::Member_ToJson(json, flags, allocator, "agc", data.agc)) return false;
2624  if (!JsonHelper::Member_ToJson(json, flags, allocator, "tonefx", data.tonefx)) return false;
2625  if (!JsonHelper::Member_ToJson(json, flags, allocator, "stereofx", data.stereofx)) return false;
2626  if (!JsonHelper::Member_ToJson(json, flags, allocator, "bandprocess", data.bandprocess)) return false;
2627  if (!JsonHelper::Member_ToJson(json, flags, allocator, "bandlimiter", data.bandlimiter)) return false;
2628  if (!JsonHelper::Member_ToJson(json, flags, allocator, "limiter", data.limiter)) return false;
2629  if (!JsonHelper::Member_ToJson(json, flags, allocator, "out", data.out)) return false;
2630  if (!JsonHelper::Member_ToJson(json, flags, allocator, "r128", data.r128)) return false;
2631  // From settings
2632  if (!JsonHelper::Member_ToJson(json, flags, allocator, "settings", data.settings)) return false;
2633  if (json.MemberCount()==0) json.SetNull();
2634  return true;
2635  }
2636 
2637  static bool DiffToJson(JSON_Value &json, const json_vu& data [[maybe_unused]], json_vu& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2638  if (sizeof(json_vu)==0) return true; // quick empty struct
2639  if (json.IsNull ()) {
2640  json.SetObject ();
2641  flags &= ~JSON_CVT_ONLYREQ; // children get all
2642  } else if (!json.IsObject()) {
2643  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2644  return false;
2645  }
2646  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "setup", data.setup, ref.setup)) return false;
2647  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "in", data.in, ref.in)) return false;
2648  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "agc", data.agc, ref.agc)) return false;
2649  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "tonefx", data.tonefx, ref.tonefx)) return false;
2650  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "stereofx", data.stereofx, ref.stereofx)) return false;
2651  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "bandprocess", data.bandprocess, ref.bandprocess)) return false;
2652  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "bandlimiter", data.bandlimiter, ref.bandlimiter)) return false;
2653  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "limiter", data.limiter, ref.limiter)) return false;
2654  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "out", data.out, ref.out)) return false;
2655  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "r128", data.r128, ref.r128)) return false;
2656  // From settings
2657  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "settings", data.settings, ref.settings)) return false;
2658  if (json.MemberCount()==0) json.SetNull();
2659  return true;
2660  }
2661 
2662  static void ForceChange(const json_vu& data [[maybe_unused]], json_vu& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2663  JsonHelper::Member_ForceChange(allocator, "setup", data.setup, ref.setup);
2664  JsonHelper::Member_ForceChange(allocator, "in", data.in, ref.in);
2665  JsonHelper::Member_ForceChange(allocator, "agc", data.agc, ref.agc);
2666  JsonHelper::Member_ForceChange(allocator, "tonefx", data.tonefx, ref.tonefx);
2667  JsonHelper::Member_ForceChange(allocator, "stereofx", data.stereofx, ref.stereofx);
2668  JsonHelper::Member_ForceChange(allocator, "bandprocess", data.bandprocess, ref.bandprocess);
2669  JsonHelper::Member_ForceChange(allocator, "bandlimiter", data.bandlimiter, ref.bandlimiter);
2670  JsonHelper::Member_ForceChange(allocator, "limiter", data.limiter, ref.limiter);
2671  JsonHelper::Member_ForceChange(allocator, "out", data.out, ref.out);
2672  JsonHelper::Member_ForceChange(allocator, "r128", data.r128, ref.r128);
2673 // From settings
2674  JsonHelper::Member_ForceChange(allocator, "settings", data.settings, ref.settings);
2675  }
2676 
2677  };
static bool ToJson(JSON_Value &json, const json_agc &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_agc &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_agc > &constraints=JsonConstraint< json_agc >())
static void ForceChange(const json_agc &data[[maybe_unused]], json_agc &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const json_agc &data[[maybe_unused]], json_agc &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const json_band_peakhold &data[[maybe_unused]], json_band_peakhold &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_band_peakhold &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_band_peakhold > &constraints=JsonConstraint< json_band_peakhold >())
static bool ToJson(JSON_Value &json, const json_band_peakhold &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const json_band_peakhold &data[[maybe_unused]], json_band_peakhold &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const json_bandlim_peakhold &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const json_bandlim_peakhold &data[[maybe_unused]], json_bandlim_peakhold &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const json_bandlim_peakhold &data[[maybe_unused]], json_bandlim_peakhold &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_bandlim_peakhold &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_bandlim_peakhold > &constraints=JsonConstraint< json_bandlim_peakhold >())
static void ForceChange(const json_bandlimiter &data[[maybe_unused]], json_bandlimiter &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_bandlimiter &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_bandlimiter > &constraints=JsonConstraint< json_bandlimiter >())
static bool ToJson(JSON_Value &json, const json_bandlimiter &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const json_bandlimiter &data[[maybe_unused]], json_bandlimiter &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_bandprocess &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_bandprocess > &constraints=JsonConstraint< json_bandprocess >())
static bool ToJson(JSON_Value &json, const json_bandprocess &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const json_bandprocess &data[[maybe_unused]], json_bandprocess &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const json_bandprocess &data[[maybe_unused]], json_bandprocess &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_input &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_input > &constraints=JsonConstraint< json_input >())
static bool ToJson(JSON_Value &json, const json_input &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const json_input &data[[maybe_unused]], json_input &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const json_input &data[[maybe_unused]], json_input &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const json_limiter &data[[maybe_unused]], json_limiter &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_limiter &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_limiter > &constraints=JsonConstraint< json_limiter >())
static bool ToJson(JSON_Value &json, const json_limiter &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const json_limiter &data[[maybe_unused]], json_limiter &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const json_output &data[[maybe_unused]], json_output &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const json_output &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const json_output &data[[maybe_unused]], json_output &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_output &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_output > &constraints=JsonConstraint< json_output >())
static bool DiffToJson(JSON_Value &json, const json_peak_percent &data[[maybe_unused]], json_peak_percent &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_peak_percent &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_peak_percent > &constraints=JsonConstraint< json_peak_percent >())
static void ForceChange(const json_peak_percent &data[[maybe_unused]], json_peak_percent &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const json_peak_percent &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const json_peakhold &data[[maybe_unused]], json_peakhold &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_peakhold &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_peakhold > &constraints=JsonConstraint< json_peakhold >())
static bool ToJson(JSON_Value &json, const json_peakhold &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const json_peakhold &data[[maybe_unused]], json_peakhold &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const json_peakhold_stereo &data[[maybe_unused]], json_peakhold_stereo &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const json_peakhold_stereo &data[[maybe_unused]], json_peakhold_stereo &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_peakhold_stereo &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_peakhold_stereo > &constraints=JsonConstraint< json_peakhold_stereo >())
static bool ToJson(JSON_Value &json, const json_peakhold_stereo &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const json_preset &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_preset &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_preset > &constraints=JsonConstraint< json_preset >())
static void ForceChange(const json_preset &data[[maybe_unused]], json_preset &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const json_preset &data[[maybe_unused]], json_preset &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_preset_setup &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_preset_setup > &constraints=JsonConstraint< json_preset_setup >())
static void ForceChange(const json_preset_setup &data[[maybe_unused]], json_preset_setup &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const json_preset_setup &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const json_preset_setup &data[[maybe_unused]], json_preset_setup &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const json_r128 &data[[maybe_unused]], json_r128 &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_r128 &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_r128 > &constraints=JsonConstraint< json_r128 >())
static void ForceChange(const json_r128 &data[[maybe_unused]], json_r128 &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const json_r128 &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const json_r128_settings &data[[maybe_unused]], json_r128_settings &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const json_r128_settings &data[[maybe_unused]], json_r128_settings &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_r128_settings &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_r128_settings > &constraints=JsonConstraint< json_r128_settings >())
static bool ToJson(JSON_Value &json, const json_r128_settings &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_settings &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_settings > &constraints=JsonConstraint< json_settings >())
static void ForceChange(const json_settings &data[[maybe_unused]], json_settings &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const json_settings &data[[maybe_unused]], json_settings &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const json_settings &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_settings_gain &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_settings_gain > &constraints=JsonConstraint< json_settings_gain >())
static void ForceChange(const json_settings_gain &data[[maybe_unused]], json_settings_gain &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const json_settings_gain &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const json_settings_gain &data[[maybe_unused]], json_settings_gain &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const json_settings_general &data[[maybe_unused]], json_settings_general &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_settings_general &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_settings_general > &constraints=JsonConstraint< json_settings_general >())
static void ForceChange(const json_settings_general &data[[maybe_unused]], json_settings_general &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const json_settings_general &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const json_stereofx &data[[maybe_unused]], json_stereofx &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_stereofx &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_stereofx > &constraints=JsonConstraint< json_stereofx >())
static bool ToJson(JSON_Value &json, const json_stereofx &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const json_stereofx &data[[maybe_unused]], json_stereofx &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_tonefx &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_tonefx > &constraints=JsonConstraint< json_tonefx >())
static bool ToJson(JSON_Value &json, const json_tonefx &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const json_tonefx &data[[maybe_unused]], json_tonefx &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const json_tonefx &data[[maybe_unused]], json_tonefx &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const json_vu &data[[maybe_unused]], json_vu &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const json_vu &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const json_vu &data[[maybe_unused]], json_vu &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_vupeakhold_stereo &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_vupeakhold_stereo > &constraints=JsonConstraint< json_vupeakhold_stereo >())
static bool DiffToJson(JSON_Value &json, const json_vupeakhold_stereo &data[[maybe_unused]], json_vupeakhold_stereo &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const json_vupeakhold_stereo &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const json_vupeakhold_stereo &data[[maybe_unused]], json_vupeakhold_stereo &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const jsonvu_agc &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const jsonvu_agc &data[[maybe_unused]], jsonvu_agc &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const jsonvu_agc &data[[maybe_unused]], jsonvu_agc &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const jsonvu_bandlimiter &data[[maybe_unused]], jsonvu_bandlimiter &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const jsonvu_bandlimiter &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const jsonvu_bandlimiter &data[[maybe_unused]], jsonvu_bandlimiter &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const jsonvu_bandprocess &data[[maybe_unused]], jsonvu_bandprocess &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const jsonvu_bandprocess &data[[maybe_unused]], jsonvu_bandprocess &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const jsonvu_bandprocess &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const jsonvu_input &data[[maybe_unused]], jsonvu_input &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const jsonvu_input &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const jsonvu_input &data[[maybe_unused]], jsonvu_input &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const jsonvu_limiter &data[[maybe_unused]], jsonvu_limiter &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const jsonvu_limiter &data[[maybe_unused]], jsonvu_limiter &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const jsonvu_limiter &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const jsonvu_output &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const jsonvu_output &data[[maybe_unused]], jsonvu_output &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const jsonvu_output &data[[maybe_unused]], jsonvu_output &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const jsonvu_preset_setup &data[[maybe_unused]], jsonvu_preset_setup &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const jsonvu_preset_setup &data[[maybe_unused]], jsonvu_preset_setup &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const jsonvu_preset_setup &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const jsonvu_r128 &data[[maybe_unused]], jsonvu_r128 &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const jsonvu_r128 &data[[maybe_unused]], jsonvu_r128 &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const jsonvu_r128 &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const jsonvu_r128_settings &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const jsonvu_r128_settings &data[[maybe_unused]], jsonvu_r128_settings &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const jsonvu_r128_settings &data[[maybe_unused]], jsonvu_r128_settings &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const jsonvu_settings &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const jsonvu_settings &data[[maybe_unused]], jsonvu_settings &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const jsonvu_settings &data[[maybe_unused]], jsonvu_settings &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const jsonvu_settings_gain &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const jsonvu_settings_gain &data[[maybe_unused]], jsonvu_settings_gain &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const jsonvu_settings_gain &data[[maybe_unused]], jsonvu_settings_gain &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const jsonvu_settings_general &data[[maybe_unused]], jsonvu_settings_general &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const jsonvu_settings_general &data[[maybe_unused]], jsonvu_settings_general &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const jsonvu_settings_general &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const jsonvu_stereofx &data[[maybe_unused]], jsonvu_stereofx &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const jsonvu_stereofx &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const jsonvu_stereofx &data[[maybe_unused]], jsonvu_stereofx &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const jsonvu_tonefx &data[[maybe_unused]], jsonvu_tonefx &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const jsonvu_tonefx &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const jsonvu_tonefx &data[[maybe_unused]], jsonvu_tonefx &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
e_bs1770_vutype
Definition: vars_process.h:29
@ e_bs1770_vutype_LongTerm
Definition: vars_process.h:32
@ e_bs1770_vutype_ShortTerm
Definition: vars_process.h:31
@ e_bs1770_vutype_Momentary
Definition: vars_process.h:30
e_history_var
Definition: vars_process.h:51
@ e_history_var_in_bs_long
Definition: vars_process.h:52
@ e_history_var_out_bs_long
Definition: vars_process.h:53
e_history_unit
Definition: vars_process.h:43
@ e_history_unit_Hour
Definition: vars_process.h:46
@ e_history_unit_Day
Definition: vars_process.h:47
@ e_history_unit_Second
Definition: vars_process.h:44
@ e_history_unit_Minute
Definition: vars_process.h:45
e_lk_mode
Definition: vars_process.h:36
@ e_lk_mode_Independant
Definition: vars_process.h:38
@ e_lk_mode_Stereo_Link
Definition: vars_process.h:37
@ e_lk_mode_Mixed_Channel
Definition: vars_process.h:39
e_lim_release
Definition: vars_process.h:21
@ e_lim_release_Medium_Slow
Definition: vars_process.h:23
@ e_lim_release_Medium_Fast
Definition: vars_process.h:24
@ e_lim_release_Fast
Definition: vars_process.h:25
@ e_lim_release_Slow
Definition: vars_process.h:22
JsonConvert_ENUM(e_lim_release)