SOUND4 IMPACT.CL Library [1.1.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";
21  return "Medium Fast+";
22  case e_lim_release_Fast:
23  return "Super Fast";
24  };
25  return "";
26  }
27  static bool string_to_e_lim_release(const char *str, enum e_lim_release *value)
28  {
29  // Try with Name
30  if (strcasecmp(str,"Slow")==0)
31  {
32  *value=e_lim_release_Slow;
33  return true;
34  }
35  if (strcasecmp(str,"Medium Slow")==0)
36  {
38  return true;
39  }
40  if (strcasecmp(str,"Medium Fast")==0)
41  {
43  return true;
44  }
45  if (strcasecmp(str,"Medium Fast+")==0)
46  {
47  *value=e_lim_release_FastLow;
48  return true;
49  }
50  if (strcasecmp(str,"Super Fast")==0)
51  {
52  *value=e_lim_release_Fast;
53  return true;
54  }
55  // Try with ID
56  if (strcasecmp(str,"Medium_Slow")==0)
57  {
59  return true;
60  }
61  if (strcasecmp(str,"Medium_Fast")==0)
62  {
64  return true;
65  }
66  if (strcasecmp(str,"FastLow")==0)
67  {
68  *value=e_lim_release_FastLow;
69  return true;
70  }
71  if (strcasecmp(str,"Fast")==0)
72  {
73  *value=e_lim_release_Fast;
74  return true;
75  }
76  // Try with Title
77  // Find if starts with one ID
78  {
79  int found=0;
80  e_lim_release found_id;
81  if (strncasecmp(str,"Slow", strlen("Slow"))==0)
82  {
83  found_id=e_lim_release_Slow;
84  found++;
85  }
86  if (strncasecmp(str,"Medium_Slow", strlen("Medium_Slow"))==0)
87  {
89  found++;
90  }
91  if (strncasecmp(str,"Medium_Fast", strlen("Medium_Fast"))==0)
92  {
94  found++;
95  }
96  if (strncasecmp(str,"FastLow", strlen("FastLow"))==0)
97  {
98  found_id=e_lim_release_FastLow;
99  found++;
100  }
101  if (strncasecmp(str,"Fast", strlen("Fast"))==0)
102  {
103  found_id=e_lim_release_Fast;
104  found++;
105  }
106  if (found==1) {
107  *value=found_id;
108  return true;
109  }
110  }
111  PLOG_WARNING << "Failed to convert '" << str << "' to enum lim_release";
112  return false;
113  }
115 
116 // === enum bs1770_vutype ===
117  static const char *e_bs1770_vutype_to_string(enum e_bs1770_vutype value)
118  {
119  switch (value) {
121  return "Momentary";
123  return "Short-Term";
125  return "Long-Term";
126  };
127  return "";
128  }
129  static bool string_to_e_bs1770_vutype(const char *str, enum e_bs1770_vutype *value)
130  {
131  // Try with Name
132  if (strcasecmp(str,"Momentary")==0)
133  {
135  return true;
136  }
137  if (strcasecmp(str,"Short-Term")==0)
138  {
140  return true;
141  }
142  if (strcasecmp(str,"Long-Term")==0)
143  {
145  return true;
146  }
147  // Try with ID
148  if (strcasecmp(str,"ShortTerm")==0)
149  {
151  return true;
152  }
153  if (strcasecmp(str,"LongTerm")==0)
154  {
156  return true;
157  }
158  // Try with Title
159  // Find if starts with one ID
160  {
161  int found=0;
162  e_bs1770_vutype found_id;
163  if (strncasecmp(str,"Momentary", strlen("Momentary"))==0)
164  {
165  found_id=e_bs1770_vutype_Momentary;
166  found++;
167  }
168  if (strncasecmp(str,"ShortTerm", strlen("ShortTerm"))==0)
169  {
170  found_id=e_bs1770_vutype_ShortTerm;
171  found++;
172  }
173  if (strncasecmp(str,"LongTerm", strlen("LongTerm"))==0)
174  {
175  found_id=e_bs1770_vutype_LongTerm;
176  found++;
177  }
178  if (found==1) {
179  *value=found_id;
180  return true;
181  }
182  }
183  PLOG_WARNING << "Failed to convert '" << str << "' to enum bs1770_vutype";
184  return false;
185  }
187 
188 // === enum lk_mode ===
189  static const char *e_lk_mode_to_string(enum e_lk_mode value)
190  {
191  switch (value) {
193  return "Stereo Link";
195  return "Independant";
197  return "Mixed Channel";
198  };
199  return "";
200  }
201  static bool string_to_e_lk_mode(const char *str, enum e_lk_mode *value)
202  {
203  // Try with Name
204  if (strcasecmp(str,"Stereo Link")==0)
205  {
206  *value=e_lk_mode_Stereo_Link;
207  return true;
208  }
209  if (strcasecmp(str,"Independant")==0)
210  {
211  *value=e_lk_mode_Independant;
212  return true;
213  }
214  if (strcasecmp(str,"Mixed Channel")==0)
215  {
217  return true;
218  }
219  // Try with ID
220  if (strcasecmp(str,"Stereo_Link")==0)
221  {
222  *value=e_lk_mode_Stereo_Link;
223  return true;
224  }
225  if (strcasecmp(str,"Mixed_Channel")==0)
226  {
228  return true;
229  }
230  // Try with Title
231  // Find if starts with one ID
232  {
233  int found=0;
234  e_lk_mode found_id;
235  if (strncasecmp(str,"Stereo_Link", strlen("Stereo_Link"))==0)
236  {
237  found_id=e_lk_mode_Stereo_Link;
238  found++;
239  }
240  if (strncasecmp(str,"Independant", strlen("Independant"))==0)
241  {
242  found_id=e_lk_mode_Independant;
243  found++;
244  }
245  if (strncasecmp(str,"Mixed_Channel", strlen("Mixed_Channel"))==0)
246  {
247  found_id=e_lk_mode_Mixed_Channel;
248  found++;
249  }
250  if (found==1) {
251  *value=found_id;
252  return true;
253  }
254  }
255  PLOG_WARNING << "Failed to convert '" << str << "' to enum lk_mode";
256  return false;
257  }
259 
260 // === enum preset_mode ===
261  static const char *e_preset_mode_to_string(enum e_preset_mode value)
262  {
263  switch (value) {
264  case e_preset_mode_pure:
265  return "Pure Force";
266  case e_preset_mode_hg1:
267  return "HG";
268  case e_preset_mode_hg2:
269  return "HG II";
270  case e_preset_mode_hg3:
271  return "HG III";
272  };
273  return "";
274  }
275  static bool string_to_e_preset_mode(const char *str, enum e_preset_mode *value)
276  {
277  // Try with Name
278  if (strcasecmp(str,"Pure Force")==0)
279  {
280  *value=e_preset_mode_pure;
281  return true;
282  }
283  if (strcasecmp(str,"HG")==0)
284  {
285  *value=e_preset_mode_hg1;
286  return true;
287  }
288  if (strcasecmp(str,"HG II")==0)
289  {
290  *value=e_preset_mode_hg2;
291  return true;
292  }
293  if (strcasecmp(str,"HG III")==0)
294  {
295  *value=e_preset_mode_hg3;
296  return true;
297  }
298  // Try with ID
299  if (strcasecmp(str,"pure")==0)
300  {
301  *value=e_preset_mode_pure;
302  return true;
303  }
304  if (strcasecmp(str,"hg1")==0)
305  {
306  *value=e_preset_mode_hg1;
307  return true;
308  }
309  if (strcasecmp(str,"hg2")==0)
310  {
311  *value=e_preset_mode_hg2;
312  return true;
313  }
314  if (strcasecmp(str,"hg3")==0)
315  {
316  *value=e_preset_mode_hg3;
317  return true;
318  }
319  // Try with Title
320  // Find if starts with one ID
321  {
322  int found=0;
323  e_preset_mode found_id;
324  if (strncasecmp(str,"pure", strlen("pure"))==0)
325  {
326  found_id=e_preset_mode_pure;
327  found++;
328  }
329  if (strncasecmp(str,"hg1", strlen("hg1"))==0)
330  {
331  found_id=e_preset_mode_hg1;
332  found++;
333  }
334  if (strncasecmp(str,"hg2", strlen("hg2"))==0)
335  {
336  found_id=e_preset_mode_hg2;
337  found++;
338  }
339  if (strncasecmp(str,"hg3", strlen("hg3"))==0)
340  {
341  found_id=e_preset_mode_hg3;
342  found++;
343  }
344  if (found==1) {
345  *value=found_id;
346  return true;
347  }
348  }
349  PLOG_WARNING << "Failed to convert '" << str << "' to enum preset_mode";
350  return false;
351  }
353 
354 // === enum history_unit ===
355  static const char *e_history_unit_to_string(enum e_history_unit value)
356  {
357  switch (value) {
359  return "Second";
361  return "Minute";
362  case e_history_unit_Hour:
363  return "Hour";
364  case e_history_unit_Day:
365  return "Day";
366  };
367  return "";
368  }
369  static bool string_to_e_history_unit(const char *str, enum e_history_unit *value)
370  {
371  // Try with Name
372  if (strcasecmp(str,"Second")==0)
373  {
374  *value=e_history_unit_Second;
375  return true;
376  }
377  if (strcasecmp(str,"Minute")==0)
378  {
379  *value=e_history_unit_Minute;
380  return true;
381  }
382  if (strcasecmp(str,"Hour")==0)
383  {
384  *value=e_history_unit_Hour;
385  return true;
386  }
387  if (strcasecmp(str,"Day")==0)
388  {
389  *value=e_history_unit_Day;
390  return true;
391  }
392  // Try with ID
393  // Try with Title
394  // Find if starts with one ID
395  {
396  int found=0;
397  e_history_unit found_id;
398  if (strncasecmp(str,"Second", strlen("Second"))==0)
399  {
400  found_id=e_history_unit_Second;
401  found++;
402  }
403  if (strncasecmp(str,"Minute", strlen("Minute"))==0)
404  {
405  found_id=e_history_unit_Minute;
406  found++;
407  }
408  if (strncasecmp(str,"Hour", strlen("Hour"))==0)
409  {
410  found_id=e_history_unit_Hour;
411  found++;
412  }
413  if (strncasecmp(str,"Day", strlen("Day"))==0)
414  {
415  found_id=e_history_unit_Day;
416  found++;
417  }
418  if (found==1) {
419  *value=found_id;
420  return true;
421  }
422  }
423  PLOG_WARNING << "Failed to convert '" << str << "' to enum history_unit";
424  return false;
425  }
427 
428 // === enum history_var ===
429  static const char *e_history_var_to_string(enum e_history_var value)
430  {
431  switch (value) {
433  return "Input Long-Term LUFS";
435  return "Output Long-Term LUFS";
436  };
437  return "";
438  }
439  static bool string_to_e_history_var(const char *str, enum e_history_var *value)
440  {
441  // Try with Name
442  if (strcasecmp(str,"Input Long-Term LUFS")==0)
443  {
445  return true;
446  }
447  if (strcasecmp(str,"Output Long-Term LUFS")==0)
448  {
450  return true;
451  }
452  // Try with ID
453  if (strcasecmp(str,"in_bs_long")==0)
454  {
456  return true;
457  }
458  if (strcasecmp(str,"out_bs_long")==0)
459  {
461  return true;
462  }
463  // Try with Title
464  // Find if starts with one ID
465  {
466  int found=0;
467  e_history_var found_id;
468  if (strncasecmp(str,"in_bs_long", strlen("in_bs_long"))==0)
469  {
470  found_id=e_history_var_in_bs_long;
471  found++;
472  }
473  if (strncasecmp(str,"out_bs_long", strlen("out_bs_long"))==0)
474  {
475  found_id=e_history_var_out_bs_long;
476  found++;
477  }
478  if (found==1) {
479  *value=found_id;
480  return true;
481  }
482  }
483  PLOG_WARNING << "Failed to convert '" << str << "' to enum history_var";
484  return false;
485  }
487 
488 // === enum lim_hilbert_filter ===
489  static const char *e_lim_hilbert_filter_to_string(enum e_lim_hilbert_filter value)
490  {
491  switch (value) {
493  return "253";
495  return "377";
497  return "501";
499  return "749";
501  return "1001";
503  return "2001";
505  return "4001";
507  return "8001";
508  };
509  return "";
510  }
511  static bool string_to_e_lim_hilbert_filter(const char *str, enum e_lim_hilbert_filter *value)
512  {
513  // Try with Name
514  if (strcasecmp(str,"253")==0)
515  {
517  return true;
518  }
519  if (strcasecmp(str,"377")==0)
520  {
522  return true;
523  }
524  if (strcasecmp(str,"501")==0)
525  {
527  return true;
528  }
529  if (strcasecmp(str,"749")==0)
530  {
532  return true;
533  }
534  if (strcasecmp(str,"1001")==0)
535  {
537  return true;
538  }
539  if (strcasecmp(str,"2001")==0)
540  {
542  return true;
543  }
544  if (strcasecmp(str,"4001")==0)
545  {
547  return true;
548  }
549  if (strcasecmp(str,"8001")==0)
550  {
552  return true;
553  }
554  // Try with ID
555  if (strcasecmp(str,"hilb_253")==0)
556  {
558  return true;
559  }
560  if (strcasecmp(str,"hilb_377")==0)
561  {
563  return true;
564  }
565  if (strcasecmp(str,"hilb_501")==0)
566  {
568  return true;
569  }
570  if (strcasecmp(str,"hilb_749")==0)
571  {
573  return true;
574  }
575  if (strcasecmp(str,"hilb_1001")==0)
576  {
578  return true;
579  }
580  if (strcasecmp(str,"hilb_2001")==0)
581  {
583  return true;
584  }
585  if (strcasecmp(str,"hilb_4001")==0)
586  {
588  return true;
589  }
590  if (strcasecmp(str,"hilb_8001")==0)
591  {
593  return true;
594  }
595  // Try with Title
596  // Find if starts with one ID
597  {
598  int found=0;
599  e_lim_hilbert_filter found_id;
600  if (strncasecmp(str,"hilb_253", strlen("hilb_253"))==0)
601  {
603  found++;
604  }
605  if (strncasecmp(str,"hilb_377", strlen("hilb_377"))==0)
606  {
608  found++;
609  }
610  if (strncasecmp(str,"hilb_501", strlen("hilb_501"))==0)
611  {
613  found++;
614  }
615  if (strncasecmp(str,"hilb_749", strlen("hilb_749"))==0)
616  {
618  found++;
619  }
620  if (strncasecmp(str,"hilb_1001", strlen("hilb_1001"))==0)
621  {
623  found++;
624  }
625  if (strncasecmp(str,"hilb_2001", strlen("hilb_2001"))==0)
626  {
628  found++;
629  }
630  if (strncasecmp(str,"hilb_4001", strlen("hilb_4001"))==0)
631  {
633  found++;
634  }
635  if (strncasecmp(str,"hilb_8001", strlen("hilb_8001"))==0)
636  {
638  found++;
639  }
640  if (found==1) {
641  *value=found_id;
642  return true;
643  }
644  }
645  PLOG_WARNING << "Failed to convert '" << str << "' to enum lim_hilbert_filter";
646  return false;
647  }
649 
650 // === enum hilbert_window ===
651  static const char *e_hilbert_window_to_string(enum e_hilbert_window value)
652  {
653  switch (value) {
655  return "rect";
657  return "sinc";
659  return "kaiser";
661  return "hann";
663  return "hamming";
665  return "blackman";
666  };
667  return "";
668  }
669  static bool string_to_e_hilbert_window(const char *str, enum e_hilbert_window *value)
670  {
671  // Try with Name
672  if (strcasecmp(str,"rect")==0)
673  {
674  *value=e_hilbert_window_rect;
675  return true;
676  }
677  if (strcasecmp(str,"sinc")==0)
678  {
679  *value=e_hilbert_window_sinc;
680  return true;
681  }
682  if (strcasecmp(str,"kaiser")==0)
683  {
685  return true;
686  }
687  if (strcasecmp(str,"hann")==0)
688  {
689  *value=e_hilbert_window_hann;
690  return true;
691  }
692  if (strcasecmp(str,"hamming")==0)
693  {
695  return true;
696  }
697  if (strcasecmp(str,"blackman")==0)
698  {
700  return true;
701  }
702  // Try with ID
703  // Try with Title
704  // Find if starts with one ID
705  {
706  int found=0;
707  e_hilbert_window found_id;
708  if (strncasecmp(str,"rect", strlen("rect"))==0)
709  {
710  found_id=e_hilbert_window_rect;
711  found++;
712  }
713  if (strncasecmp(str,"sinc", strlen("sinc"))==0)
714  {
715  found_id=e_hilbert_window_sinc;
716  found++;
717  }
718  if (strncasecmp(str,"kaiser", strlen("kaiser"))==0)
719  {
720  found_id=e_hilbert_window_kaiser;
721  found++;
722  }
723  if (strncasecmp(str,"hann", strlen("hann"))==0)
724  {
725  found_id=e_hilbert_window_hann;
726  found++;
727  }
728  if (strncasecmp(str,"hamming", strlen("hamming"))==0)
729  {
730  found_id=e_hilbert_window_hamming;
731  found++;
732  }
733  if (strncasecmp(str,"blackman", strlen("blackman"))==0)
734  {
735  found_id=e_hilbert_window_blackman;
736  found++;
737  }
738  if (found==1) {
739  *value=found_id;
740  return true;
741  }
742  }
743  PLOG_WARNING << "Failed to convert '" << str << "' to enum hilbert_window";
744  return false;
745  }
747 
748 // === enum autoatt_mode ===
749  static const char *e_autoatt_mode_to_string(enum e_autoatt_mode value)
750  {
751  switch (value) {
752  case e_autoatt_mode_off:
753  return "Off";
754  case e_autoatt_mode_gain:
755  return "Gain";
757  return "Input";
758  };
759  return "";
760  }
761  static bool string_to_e_autoatt_mode(const char *str, enum e_autoatt_mode *value)
762  {
763  // Try with Name
764  if (strcasecmp(str,"Off")==0)
765  {
766  *value=e_autoatt_mode_off;
767  return true;
768  }
769  if (strcasecmp(str,"Gain")==0)
770  {
771  *value=e_autoatt_mode_gain;
772  return true;
773  }
774  if (strcasecmp(str,"Input")==0)
775  {
776  *value=e_autoatt_mode_input;
777  return true;
778  }
779  // Try with ID
780  if (strcasecmp(str,"off")==0)
781  {
782  *value=e_autoatt_mode_off;
783  return true;
784  }
785  if (strcasecmp(str,"gain")==0)
786  {
787  *value=e_autoatt_mode_gain;
788  return true;
789  }
790  if (strcasecmp(str,"input")==0)
791  {
792  *value=e_autoatt_mode_input;
793  return true;
794  }
795  // Try with Title
796  // Find if starts with one ID
797  {
798  int found=0;
799  e_autoatt_mode found_id;
800  if (strncasecmp(str,"off", strlen("off"))==0)
801  {
802  found_id=e_autoatt_mode_off;
803  found++;
804  }
805  if (strncasecmp(str,"gain", strlen("gain"))==0)
806  {
807  found_id=e_autoatt_mode_gain;
808  found++;
809  }
810  if (strncasecmp(str,"input", strlen("input"))==0)
811  {
812  found_id=e_autoatt_mode_input;
813  found++;
814  }
815  if (found==1) {
816  *value=found_id;
817  return true;
818  }
819  }
820  PLOG_WARNING << "Failed to convert '" << str << "' to enum autoatt_mode";
821  return false;
822  }
824 
825 // =============================
826 // ==== scales constraints ====
827 // =============================
828 
829 // =============================
830 // ========== structs =========
831 // =============================
832 
833 // === struct json_peakhold ===
834  template <>
835  struct JsonConvert<json_peakhold> {
836 
837  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>()) {
838  if (sizeof(json_peakhold)==0) return true; // quick empty struct
839  if (json.IsNull()) { return true; }
840  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
841  if ( !JsonHelper::Member_FromJson(json, flags, "hold", data.hold, allocator, JsonConstraint<S4Float>(-6,6))) return false;
842  if ( !JsonHelper::Member_FromJson(json, flags, "pk", data.pk, allocator, JsonConstraint<S4Float>(-6,6))) return false;
843  return true;
844  }
845 
846  static bool ToJson(JSON_Value &json, const json_peakhold& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
847  if (sizeof(json_peakhold)==0) return true; // quick empty struct
848  if (json.IsNull ()) {
849  json.SetObject ();
850  flags &= ~JSON_CVT_ONLYREQ; // children get all
851  } else if (!json.IsObject()) {
852  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
853  return false;
854  }
855  if (!JsonHelper::Member_ToJson(json, flags, allocator, "hold", data.hold)) return false;
856  if (!JsonHelper::Member_ToJson(json, flags, allocator, "pk", data.pk)) return false;
857  if (json.MemberCount()==0) json.SetNull();
858  return true;
859  }
860 
861  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]]) {
862  if (sizeof(json_peakhold)==0) return true; // quick empty struct
863  if (json.IsNull ()) {
864  json.SetObject ();
865  flags &= ~JSON_CVT_ONLYREQ; // children get all
866  } else if (!json.IsObject()) {
867  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
868  return false;
869  }
870  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "hold", data.hold, ref.hold)) return false;
871  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "pk", data.pk, ref.pk)) return false;
872  if (json.MemberCount()==0) json.SetNull();
873  return true;
874  }
875 
876  static void ForceChange(const json_peakhold& data [[maybe_unused]], json_peakhold& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
877  JsonHelper::Member_ForceChange(allocator, "hold", data.hold, ref.hold);
878  JsonHelper::Member_ForceChange(allocator, "pk", data.pk, ref.pk);
879  }
880 
881  };
882 
883 // === struct json_peakhold_stereo ===
884  template <>
885  struct JsonConvert<json_peakhold_stereo> {
886 
887  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>()) {
888  if (sizeof(json_peakhold_stereo)==0) return true; // quick empty struct
889  if (json.IsNull()) { return true; }
890  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
891  if ( !JsonHelper::Member_FromJson(json, flags, "hold", data.hold, allocator, JsonConstraint<S4Float>(-6,6))) return false;
892  if ( !JsonHelper::Member_FromJson(json, flags, "pk", data.pk, allocator, JsonConstraint<S4Float>(-6,6))) return false;
893  return true;
894  }
895 
896  static bool ToJson(JSON_Value &json, const json_peakhold_stereo& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
897  if (sizeof(json_peakhold_stereo)==0) return true; // quick empty struct
898  if (json.IsNull ()) {
899  json.SetObject ();
900  flags &= ~JSON_CVT_ONLYREQ; // children get all
901  } else if (!json.IsObject()) {
902  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
903  return false;
904  }
905  if (!JsonHelper::Member_ToJson(json, flags, allocator, "hold", data.hold)) return false;
906  if (!JsonHelper::Member_ToJson(json, flags, allocator, "pk", data.pk)) return false;
907  if (json.MemberCount()==0) json.SetNull();
908  return true;
909  }
910 
911  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]]) {
912  if (sizeof(json_peakhold_stereo)==0) return true; // quick empty struct
913  if (json.IsNull ()) {
914  json.SetObject ();
915  flags &= ~JSON_CVT_ONLYREQ; // children get all
916  } else if (!json.IsObject()) {
917  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
918  return false;
919  }
920  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "hold", data.hold, ref.hold)) return false;
921  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "pk", data.pk, ref.pk)) return false;
922  if (json.MemberCount()==0) json.SetNull();
923  return true;
924  }
925 
926  static void ForceChange(const json_peakhold_stereo& data [[maybe_unused]], json_peakhold_stereo& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
927  JsonHelper::Member_ForceChange(allocator, "hold", data.hold, ref.hold);
928  JsonHelper::Member_ForceChange(allocator, "pk", data.pk, ref.pk);
929  }
930 
931  };
932 
933 // === struct json_vupeakhold_stereo ===
934  template <>
935  struct JsonConvert<json_vupeakhold_stereo> {
936 
937  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>()) {
938  if (sizeof(json_vupeakhold_stereo)==0) return true; // quick empty struct
939  if (json.IsNull()) { return true; }
940  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
941  if ( !JsonHelper::Member_FromJson(json, flags, "hold", data.hold, allocator, JsonConstraint<S4Float>(-6,6))) return false;
942  if ( !JsonHelper::Member_FromJson(json, flags, "pk", data.pk, allocator, JsonConstraint<S4Float>(-6,6))) return false;
943  if ( !JsonHelper::Member_FromJson(json, flags, "vu", data.vu, allocator, JsonConstraint<S4Float>(-6,6))) return false;
944  return true;
945  }
946 
947  static bool ToJson(JSON_Value &json, const json_vupeakhold_stereo& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
948  if (sizeof(json_vupeakhold_stereo)==0) return true; // quick empty struct
949  if (json.IsNull ()) {
950  json.SetObject ();
951  flags &= ~JSON_CVT_ONLYREQ; // children get all
952  } else if (!json.IsObject()) {
953  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
954  return false;
955  }
956  if (!JsonHelper::Member_ToJson(json, flags, allocator, "hold", data.hold)) return false;
957  if (!JsonHelper::Member_ToJson(json, flags, allocator, "pk", data.pk)) return false;
958  if (!JsonHelper::Member_ToJson(json, flags, allocator, "vu", data.vu)) return false;
959  if (json.MemberCount()==0) json.SetNull();
960  return true;
961  }
962 
963  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]]) {
964  if (sizeof(json_vupeakhold_stereo)==0) return true; // quick empty struct
965  if (json.IsNull ()) {
966  json.SetObject ();
967  flags &= ~JSON_CVT_ONLYREQ; // children get all
968  } else if (!json.IsObject()) {
969  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
970  return false;
971  }
972  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "hold", data.hold, ref.hold)) return false;
973  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "pk", data.pk, ref.pk)) return false;
974  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "vu", data.vu, ref.vu)) return false;
975  if (json.MemberCount()==0) json.SetNull();
976  return true;
977  }
978 
979  static void ForceChange(const json_vupeakhold_stereo& data [[maybe_unused]], json_vupeakhold_stereo& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
980  JsonHelper::Member_ForceChange(allocator, "hold", data.hold, ref.hold);
981  JsonHelper::Member_ForceChange(allocator, "pk", data.pk, ref.pk);
982  JsonHelper::Member_ForceChange(allocator, "vu", data.vu, ref.vu);
983  }
984 
985  };
986 
987 // === struct json_peak_percent ===
988  template <>
989  struct JsonConvert<json_peak_percent> {
990 
991  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>()) {
992  if (sizeof(json_peak_percent)==0) return true; // quick empty struct
993  if (json.IsNull()) { return true; }
994  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
995  if ( !JsonHelper::Member_FromJson(json, flags, "hold", data.hold, allocator, JsonConstraint<S4Float>(0,100))) return false;
996  if ( !JsonHelper::Member_FromJson(json, flags, "pk", data.pk, allocator, JsonConstraint<S4Float>(0,100))) return false;
997  return true;
998  }
999 
1000  static bool ToJson(JSON_Value &json, const json_peak_percent& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1001  if (sizeof(json_peak_percent)==0) return true; // quick empty struct
1002  if (json.IsNull ()) {
1003  json.SetObject ();
1004  flags &= ~JSON_CVT_ONLYREQ; // children get all
1005  } else if (!json.IsObject()) {
1006  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1007  return false;
1008  }
1009  if (!JsonHelper::Member_ToJson(json, flags, allocator, "hold", data.hold)) return false;
1010  if (!JsonHelper::Member_ToJson(json, flags, allocator, "pk", data.pk)) return false;
1011  if (json.MemberCount()==0) json.SetNull();
1012  return true;
1013  }
1014 
1015  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]]) {
1016  if (sizeof(json_peak_percent)==0) return true; // quick empty struct
1017  if (json.IsNull ()) {
1018  json.SetObject ();
1019  flags &= ~JSON_CVT_ONLYREQ; // children get all
1020  } else if (!json.IsObject()) {
1021  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1022  return false;
1023  }
1024  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "hold", data.hold, ref.hold)) return false;
1025  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "pk", data.pk, ref.pk)) return false;
1026  if (json.MemberCount()==0) json.SetNull();
1027  return true;
1028  }
1029 
1030  static void ForceChange(const json_peak_percent& data [[maybe_unused]], json_peak_percent& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1031  JsonHelper::Member_ForceChange(allocator, "hold", data.hold, ref.hold);
1032  JsonHelper::Member_ForceChange(allocator, "pk", data.pk, ref.pk);
1033  }
1034 
1035  };
1036 
1037 // === struct json_agc_peakhold ===
1038  template <>
1039  struct JsonConvert<json_agc_peakhold> {
1040 
1041  static bool FromJson(const JSON_Value& json, json_agc_peakhold& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_agc_peakhold> &constraints = JsonConstraint<json_agc_peakhold>()) {
1042  if (sizeof(json_agc_peakhold)==0) return true; // quick empty struct
1043  if (json.IsNull()) { return true; }
1044  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
1045  if ( !JsonHelper::Member_FromJson(json, flags, "hold", data.hold, allocator, JsonConstraint<S4Float>(-6,6))) return false;
1046  if ( !JsonHelper::Member_FromJson(json, flags, "pk", data.pk, allocator, JsonConstraint<S4Float>(-6,6))) return false;
1047  return true;
1048  }
1049 
1050  static bool ToJson(JSON_Value &json, const json_agc_peakhold& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1051  if (sizeof(json_agc_peakhold)==0) return true; // quick empty struct
1052  if (json.IsNull ()) {
1053  json.SetObject ();
1054  flags &= ~JSON_CVT_ONLYREQ; // children get all
1055  } else if (!json.IsObject()) {
1056  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1057  return false;
1058  }
1059  if (!JsonHelper::Member_ToJson(json, flags, allocator, "hold", data.hold)) return false;
1060  if (!JsonHelper::Member_ToJson(json, flags, allocator, "pk", data.pk)) return false;
1061  if (json.MemberCount()==0) json.SetNull();
1062  return true;
1063  }
1064 
1065  static bool DiffToJson(JSON_Value &json, const json_agc_peakhold& data [[maybe_unused]], json_agc_peakhold& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1066  if (sizeof(json_agc_peakhold)==0) return true; // quick empty struct
1067  if (json.IsNull ()) {
1068  json.SetObject ();
1069  flags &= ~JSON_CVT_ONLYREQ; // children get all
1070  } else if (!json.IsObject()) {
1071  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1072  return false;
1073  }
1074  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "hold", data.hold, ref.hold)) return false;
1075  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "pk", data.pk, ref.pk)) return false;
1076  if (json.MemberCount()==0) json.SetNull();
1077  return true;
1078  }
1079 
1080  static void ForceChange(const json_agc_peakhold& data [[maybe_unused]], json_agc_peakhold& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1081  JsonHelper::Member_ForceChange(allocator, "hold", data.hold, ref.hold);
1082  JsonHelper::Member_ForceChange(allocator, "pk", data.pk, ref.pk);
1083  }
1084 
1085  };
1086 
1087 // === struct json_agc_stereo_peakhold ===
1088  template <>
1089  struct JsonConvert<json_agc_stereo_peakhold> {
1090 
1091  static bool FromJson(const JSON_Value& json, json_agc_stereo_peakhold& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_agc_stereo_peakhold> &constraints = JsonConstraint<json_agc_stereo_peakhold>()) {
1092  if (sizeof(json_agc_stereo_peakhold)==0) return true; // quick empty struct
1093  if (json.IsNull()) { return true; }
1094  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
1095  if ( !JsonHelper::Member_FromJson(json, flags, "hold", data.hold, allocator, JsonConstraint<S4Float>(-6,6))) return false;
1096  if ( !JsonHelper::Member_FromJson(json, flags, "pk", data.pk, allocator, JsonConstraint<S4Float>(-6,6))) return false;
1097  return true;
1098  }
1099 
1100  static bool ToJson(JSON_Value &json, const json_agc_stereo_peakhold& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1101  if (sizeof(json_agc_stereo_peakhold)==0) return true; // quick empty struct
1102  if (json.IsNull ()) {
1103  json.SetObject ();
1104  flags &= ~JSON_CVT_ONLYREQ; // children get all
1105  } else if (!json.IsObject()) {
1106  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1107  return false;
1108  }
1109  if (!JsonHelper::Member_ToJson(json, flags, allocator, "hold", data.hold)) return false;
1110  if (!JsonHelper::Member_ToJson(json, flags, allocator, "pk", data.pk)) return false;
1111  if (json.MemberCount()==0) json.SetNull();
1112  return true;
1113  }
1114 
1115  static bool DiffToJson(JSON_Value &json, const json_agc_stereo_peakhold& data [[maybe_unused]], json_agc_stereo_peakhold& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1116  if (sizeof(json_agc_stereo_peakhold)==0) return true; // quick empty struct
1117  if (json.IsNull ()) {
1118  json.SetObject ();
1119  flags &= ~JSON_CVT_ONLYREQ; // children get all
1120  } else if (!json.IsObject()) {
1121  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1122  return false;
1123  }
1124  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "hold", data.hold, ref.hold)) return false;
1125  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "pk", data.pk, ref.pk)) return false;
1126  if (json.MemberCount()==0) json.SetNull();
1127  return true;
1128  }
1129 
1130  static void ForceChange(const json_agc_stereo_peakhold& data [[maybe_unused]], json_agc_stereo_peakhold& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1131  JsonHelper::Member_ForceChange(allocator, "hold", data.hold, ref.hold);
1132  JsonHelper::Member_ForceChange(allocator, "pk", data.pk, ref.pk);
1133  }
1134 
1135  };
1136 
1137 // === struct json_band_peakhold ===
1138  template <>
1139  struct JsonConvert<json_band_peakhold> {
1140 
1141  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>()) {
1142  if (sizeof(json_band_peakhold)==0) return true; // quick empty struct
1143  if (json.IsNull()) { return true; }
1144  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
1145  if ( !JsonHelper::Member_FromJson(json, flags, "hold", data.hold, allocator, JsonConstraint<S4Float>(-6,6))) return false;
1146  if ( !JsonHelper::Member_FromJson(json, flags, "pk", data.pk, allocator, JsonConstraint<S4Float>(-6,6))) return false;
1147  return true;
1148  }
1149 
1150  static bool ToJson(JSON_Value &json, const json_band_peakhold& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1151  if (sizeof(json_band_peakhold)==0) return true; // quick empty struct
1152  if (json.IsNull ()) {
1153  json.SetObject ();
1154  flags &= ~JSON_CVT_ONLYREQ; // children get all
1155  } else if (!json.IsObject()) {
1156  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1157  return false;
1158  }
1159  if (!JsonHelper::Member_ToJson(json, flags, allocator, "hold", data.hold)) return false;
1160  if (!JsonHelper::Member_ToJson(json, flags, allocator, "pk", data.pk)) return false;
1161  if (json.MemberCount()==0) json.SetNull();
1162  return true;
1163  }
1164 
1165  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]]) {
1166  if (sizeof(json_band_peakhold)==0) return true; // quick empty struct
1167  if (json.IsNull ()) {
1168  json.SetObject ();
1169  flags &= ~JSON_CVT_ONLYREQ; // children get all
1170  } else if (!json.IsObject()) {
1171  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1172  return false;
1173  }
1174  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "hold", data.hold, ref.hold)) return false;
1175  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "pk", data.pk, ref.pk)) return false;
1176  if (json.MemberCount()==0) json.SetNull();
1177  return true;
1178  }
1179 
1180  static void ForceChange(const json_band_peakhold& data [[maybe_unused]], json_band_peakhold& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1181  JsonHelper::Member_ForceChange(allocator, "hold", data.hold, ref.hold);
1182  JsonHelper::Member_ForceChange(allocator, "pk", data.pk, ref.pk);
1183  }
1184 
1185  };
1186 
1187 // === struct json_band_stereo_peakhold ===
1188  template <>
1189  struct JsonConvert<json_band_stereo_peakhold> {
1190 
1191  static bool FromJson(const JSON_Value& json, json_band_stereo_peakhold& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_band_stereo_peakhold> &constraints = JsonConstraint<json_band_stereo_peakhold>()) {
1192  if (sizeof(json_band_stereo_peakhold)==0) return true; // quick empty struct
1193  if (json.IsNull()) { return true; }
1194  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
1195  if ( !JsonHelper::Member_FromJson(json, flags, "hold", data.hold, allocator, JsonConstraint<S4Float>(-6,6))) return false;
1196  if ( !JsonHelper::Member_FromJson(json, flags, "pk", data.pk, allocator, JsonConstraint<S4Float>(-6,6))) return false;
1197  return true;
1198  }
1199 
1200  static bool ToJson(JSON_Value &json, const json_band_stereo_peakhold& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1201  if (sizeof(json_band_stereo_peakhold)==0) return true; // quick empty struct
1202  if (json.IsNull ()) {
1203  json.SetObject ();
1204  flags &= ~JSON_CVT_ONLYREQ; // children get all
1205  } else if (!json.IsObject()) {
1206  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1207  return false;
1208  }
1209  if (!JsonHelper::Member_ToJson(json, flags, allocator, "hold", data.hold)) return false;
1210  if (!JsonHelper::Member_ToJson(json, flags, allocator, "pk", data.pk)) return false;
1211  if (json.MemberCount()==0) json.SetNull();
1212  return true;
1213  }
1214 
1215  static bool DiffToJson(JSON_Value &json, const json_band_stereo_peakhold& data [[maybe_unused]], json_band_stereo_peakhold& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1216  if (sizeof(json_band_stereo_peakhold)==0) return true; // quick empty struct
1217  if (json.IsNull ()) {
1218  json.SetObject ();
1219  flags &= ~JSON_CVT_ONLYREQ; // children get all
1220  } else if (!json.IsObject()) {
1221  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1222  return false;
1223  }
1224  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "hold", data.hold, ref.hold)) return false;
1225  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "pk", data.pk, ref.pk)) return false;
1226  if (json.MemberCount()==0) json.SetNull();
1227  return true;
1228  }
1229 
1230  static void ForceChange(const json_band_stereo_peakhold& data [[maybe_unused]], json_band_stereo_peakhold& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1231  JsonHelper::Member_ForceChange(allocator, "hold", data.hold, ref.hold);
1232  JsonHelper::Member_ForceChange(allocator, "pk", data.pk, ref.pk);
1233  }
1234 
1235  };
1236 
1237 // === struct json_band_peak_percent ===
1238  template <>
1239  struct JsonConvert<json_band_peak_percent> {
1240 
1241  static bool FromJson(const JSON_Value& json, json_band_peak_percent& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_band_peak_percent> &constraints = JsonConstraint<json_band_peak_percent>()) {
1242  if (sizeof(json_band_peak_percent)==0) return true; // quick empty struct
1243  if (json.IsNull()) { return true; }
1244  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
1245  if ( !JsonHelper::Member_FromJson(json, flags, "hold", data.hold, allocator, JsonConstraint<S4Float>(0,100))) return false;
1246  if ( !JsonHelper::Member_FromJson(json, flags, "pk", data.pk, allocator, JsonConstraint<S4Float>(0,100))) return false;
1247  return true;
1248  }
1249 
1250  static bool ToJson(JSON_Value &json, const json_band_peak_percent& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1251  if (sizeof(json_band_peak_percent)==0) return true; // quick empty struct
1252  if (json.IsNull ()) {
1253  json.SetObject ();
1254  flags &= ~JSON_CVT_ONLYREQ; // children get all
1255  } else if (!json.IsObject()) {
1256  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1257  return false;
1258  }
1259  if (!JsonHelper::Member_ToJson(json, flags, allocator, "hold", data.hold)) return false;
1260  if (!JsonHelper::Member_ToJson(json, flags, allocator, "pk", data.pk)) return false;
1261  if (json.MemberCount()==0) json.SetNull();
1262  return true;
1263  }
1264 
1265  static bool DiffToJson(JSON_Value &json, const json_band_peak_percent& data [[maybe_unused]], json_band_peak_percent& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1266  if (sizeof(json_band_peak_percent)==0) return true; // quick empty struct
1267  if (json.IsNull ()) {
1268  json.SetObject ();
1269  flags &= ~JSON_CVT_ONLYREQ; // children get all
1270  } else if (!json.IsObject()) {
1271  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1272  return false;
1273  }
1274  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "hold", data.hold, ref.hold)) return false;
1275  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "pk", data.pk, ref.pk)) return false;
1276  if (json.MemberCount()==0) json.SetNull();
1277  return true;
1278  }
1279 
1280  static void ForceChange(const json_band_peak_percent& data [[maybe_unused]], json_band_peak_percent& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1281  JsonHelper::Member_ForceChange(allocator, "hold", data.hold, ref.hold);
1282  JsonHelper::Member_ForceChange(allocator, "pk", data.pk, ref.pk);
1283  }
1284 
1285  };
1286 
1287 // === struct json_bandlim_peakhold ===
1288  template <>
1289  struct JsonConvert<json_bandlim_peakhold> {
1290 
1291  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>()) {
1292  if (sizeof(json_bandlim_peakhold)==0) return true; // quick empty struct
1293  if (json.IsNull()) { return true; }
1294  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
1295  if ( !JsonHelper::Member_FromJson(json, flags, "hold", data.hold, allocator, JsonConstraint<S4Float>(-6,6))) return false;
1296  if ( !JsonHelper::Member_FromJson(json, flags, "pk", data.pk, allocator, JsonConstraint<S4Float>(-6,6))) return false;
1297  return true;
1298  }
1299 
1300  static bool ToJson(JSON_Value &json, const json_bandlim_peakhold& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1301  if (sizeof(json_bandlim_peakhold)==0) return true; // quick empty struct
1302  if (json.IsNull ()) {
1303  json.SetObject ();
1304  flags &= ~JSON_CVT_ONLYREQ; // children get all
1305  } else if (!json.IsObject()) {
1306  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1307  return false;
1308  }
1309  if (!JsonHelper::Member_ToJson(json, flags, allocator, "hold", data.hold)) return false;
1310  if (!JsonHelper::Member_ToJson(json, flags, allocator, "pk", data.pk)) return false;
1311  if (json.MemberCount()==0) json.SetNull();
1312  return true;
1313  }
1314 
1315  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]]) {
1316  if (sizeof(json_bandlim_peakhold)==0) return true; // quick empty struct
1317  if (json.IsNull ()) {
1318  json.SetObject ();
1319  flags &= ~JSON_CVT_ONLYREQ; // children get all
1320  } else if (!json.IsObject()) {
1321  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1322  return false;
1323  }
1324  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "hold", data.hold, ref.hold)) return false;
1325  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "pk", data.pk, ref.pk)) return false;
1326  if (json.MemberCount()==0) json.SetNull();
1327  return true;
1328  }
1329 
1330  static void ForceChange(const json_bandlim_peakhold& data [[maybe_unused]], json_bandlim_peakhold& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1331  JsonHelper::Member_ForceChange(allocator, "hold", data.hold, ref.hold);
1332  JsonHelper::Member_ForceChange(allocator, "pk", data.pk, ref.pk);
1333  }
1334 
1335  };
1336 
1337 // === struct json_bandlim_stereo_peakhold ===
1338  template <>
1339  struct JsonConvert<json_bandlim_stereo_peakhold> {
1340 
1341  static bool FromJson(const JSON_Value& json, json_bandlim_stereo_peakhold& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_bandlim_stereo_peakhold> &constraints = JsonConstraint<json_bandlim_stereo_peakhold>()) {
1342  if (sizeof(json_bandlim_stereo_peakhold)==0) return true; // quick empty struct
1343  if (json.IsNull()) { return true; }
1344  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
1345  if ( !JsonHelper::Member_FromJson(json, flags, "hold", data.hold, allocator, JsonConstraint<S4Float>(-6,6))) return false;
1346  if ( !JsonHelper::Member_FromJson(json, flags, "pk", data.pk, allocator, JsonConstraint<S4Float>(-6,6))) return false;
1347  return true;
1348  }
1349 
1350  static bool ToJson(JSON_Value &json, const json_bandlim_stereo_peakhold& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1351  if (sizeof(json_bandlim_stereo_peakhold)==0) return true; // quick empty struct
1352  if (json.IsNull ()) {
1353  json.SetObject ();
1354  flags &= ~JSON_CVT_ONLYREQ; // children get all
1355  } else if (!json.IsObject()) {
1356  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1357  return false;
1358  }
1359  if (!JsonHelper::Member_ToJson(json, flags, allocator, "hold", data.hold)) return false;
1360  if (!JsonHelper::Member_ToJson(json, flags, allocator, "pk", data.pk)) return false;
1361  if (json.MemberCount()==0) json.SetNull();
1362  return true;
1363  }
1364 
1365  static bool DiffToJson(JSON_Value &json, const json_bandlim_stereo_peakhold& data [[maybe_unused]], json_bandlim_stereo_peakhold& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1366  if (sizeof(json_bandlim_stereo_peakhold)==0) return true; // quick empty struct
1367  if (json.IsNull ()) {
1368  json.SetObject ();
1369  flags &= ~JSON_CVT_ONLYREQ; // children get all
1370  } else if (!json.IsObject()) {
1371  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1372  return false;
1373  }
1374  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "hold", data.hold, ref.hold)) return false;
1375  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "pk", data.pk, ref.pk)) return false;
1376  if (json.MemberCount()==0) json.SetNull();
1377  return true;
1378  }
1379 
1380  static void ForceChange(const json_bandlim_stereo_peakhold& data [[maybe_unused]], json_bandlim_stereo_peakhold& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1381  JsonHelper::Member_ForceChange(allocator, "hold", data.hold, ref.hold);
1382  JsonHelper::Member_ForceChange(allocator, "pk", data.pk, ref.pk);
1383  }
1384 
1385  };
1386 
1387 // === struct json_bandlim_peak_percent ===
1388  template <>
1389  struct JsonConvert<json_bandlim_peak_percent> {
1390 
1391  static bool FromJson(const JSON_Value& json, json_bandlim_peak_percent& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_bandlim_peak_percent> &constraints = JsonConstraint<json_bandlim_peak_percent>()) {
1392  if (sizeof(json_bandlim_peak_percent)==0) return true; // quick empty struct
1393  if (json.IsNull()) { return true; }
1394  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
1395  if ( !JsonHelper::Member_FromJson(json, flags, "hold", data.hold, allocator, JsonConstraint<S4Float>(0,100))) return false;
1396  if ( !JsonHelper::Member_FromJson(json, flags, "pk", data.pk, allocator, JsonConstraint<S4Float>(0,100))) return false;
1397  return true;
1398  }
1399 
1400  static bool ToJson(JSON_Value &json, const json_bandlim_peak_percent& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1401  if (sizeof(json_bandlim_peak_percent)==0) return true; // quick empty struct
1402  if (json.IsNull ()) {
1403  json.SetObject ();
1404  flags &= ~JSON_CVT_ONLYREQ; // children get all
1405  } else if (!json.IsObject()) {
1406  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1407  return false;
1408  }
1409  if (!JsonHelper::Member_ToJson(json, flags, allocator, "hold", data.hold)) return false;
1410  if (!JsonHelper::Member_ToJson(json, flags, allocator, "pk", data.pk)) return false;
1411  if (json.MemberCount()==0) json.SetNull();
1412  return true;
1413  }
1414 
1415  static bool DiffToJson(JSON_Value &json, const json_bandlim_peak_percent& data [[maybe_unused]], json_bandlim_peak_percent& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1416  if (sizeof(json_bandlim_peak_percent)==0) return true; // quick empty struct
1417  if (json.IsNull ()) {
1418  json.SetObject ();
1419  flags &= ~JSON_CVT_ONLYREQ; // children get all
1420  } else if (!json.IsObject()) {
1421  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1422  return false;
1423  }
1424  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "hold", data.hold, ref.hold)) return false;
1425  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "pk", data.pk, ref.pk)) return false;
1426  if (json.MemberCount()==0) json.SetNull();
1427  return true;
1428  }
1429 
1430  static void ForceChange(const json_bandlim_peak_percent& data [[maybe_unused]], json_bandlim_peak_percent& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1431  JsonHelper::Member_ForceChange(allocator, "hold", data.hold, ref.hold);
1432  JsonHelper::Member_ForceChange(allocator, "pk", data.pk, ref.pk);
1433  }
1434 
1435  };
1436 
1437 // =============================
1438 // ========== objects =========
1439 // =============================
1440 // === object preset_setup ===
1441  // === Preset ===
1442  template <>
1443  struct JsonConvert<json_preset_setup> {
1444 
1445  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>()) {
1446  if (sizeof(json_preset_setup)==0) return true; // quick empty struct
1447  if (json.IsNull()) { return true; }
1448  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
1449  if ( !JsonHelper::Member_FromJson(json, flags, "gate_on", data.gate_on, allocator)) return false;
1450  if ( !JsonHelper::Member_FromJson(json, flags, "gate", data.gate, allocator, JsonConstraint<S4Float>(-100,0))) return false;
1451  if ( !JsonHelper::Member_FromJson(json, flags, "hp_on", data.hp_on, allocator)) return false;
1452  if ( !JsonHelper::Member_FromJson(json, flags, "hp_freq", data.hp_freq, allocator, JsonConstraint<S4Float>(10,200))) return false;
1453  if ( !JsonHelper::Member_FromJson(json, flags, "stereo_link", data.stereo_link, allocator)) return false;
1454  if ( !JsonHelper::Member_FromJson(json, flags, "agc_matricing", data.agc_matricing, allocator)) return false;
1455  if ( !JsonHelper::Member_FromJson(json, flags, "band_matricing", data.band_matricing, allocator)) return false;
1456  if ( !JsonHelper::Member_FromJson(json, flags, "agc_usewide", data.agc_usewide, allocator)) return false;
1457  if ( !JsonHelper::Member_FromJson(json, flags, "changespeed", data.changespeed, allocator, JsonConstraint<S4Float>(0.1,4))) return false;
1458  if ( !JsonHelper::Member_FromJson(json, flags, "smoothagc_on", data.smoothagc_on, allocator)) return false;
1459  if ( !JsonHelper::Member_FromJson(json, flags, "smoothband_on", data.smoothband_on, allocator)) return false;
1460  if ((flags & JSON_CVT_WITHDEV) &&
1461  !JsonHelper::Member_FromJson(json, flags, "preset_mode", data.preset_mode, allocator)) return false;
1462  if ( !JsonHelper::Member_FromJson(json, flags, "display_agc", data.display_agc, allocator)) return false;
1463  if ( !JsonHelper::Member_FromJson(json, flags, "display_tonefx", data.display_tonefx, allocator)) return false;
1464  if ( !JsonHelper::Member_FromJson(json, flags, "display_stereofx", data.display_stereofx, allocator)) return false;
1465  if ( !JsonHelper::Member_FromJson(json, flags, "display_bandexp", data.display_bandexp, allocator)) return false;
1466  if ( !JsonHelper::Member_FromJson(json, flags, "display_bandprocess", data.display_bandprocess, allocator)) return false;
1467  if ( !JsonHelper::Member_FromJson(json, flags, "display_bandlook", data.display_bandlook, allocator)) return false;
1468  if ( !JsonHelper::Member_FromJson(json, flags, "display_bandlim", data.display_bandlim, allocator)) return false;
1469  if ( !JsonHelper::Member_FromJson(json, flags, "display_bassclip", data.display_bassclip, allocator)) return false;
1470  if ( !JsonHelper::Member_FromJson(json, flags, "display_agcattack", data.display_agcattack, allocator)) return false;
1471  if ( !JsonHelper::Member_FromJson(json, flags, "display_bassfx", data.display_bassfx, allocator)) return false;
1472  if ( !JsonHelper::Member_FromJson(json, flags, "display_treblefx", data.display_treblefx, allocator)) return false;
1473  if ( !JsonHelper::Member_FromJson(json, flags, "display_bandimpact", data.display_bandimpact, allocator)) return false;
1474  if ( !JsonHelper::Member_FromJson(json, flags, "display_bandattack", data.display_bandattack, allocator)) return false;
1475  if ( !JsonHelper::Member_FromJson(json, flags, "display_bandratio", data.display_bandratio, allocator)) return false;
1476  if ( !JsonHelper::Member_FromJson(json, flags, "display_bandthickness", data.display_bandthickness, allocator)) return false;
1477  return true;
1478  }
1479 
1480  static bool ToJson(JSON_Value &json, const json_preset_setup& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1481  if (sizeof(json_preset_setup)==0) return true; // quick empty struct
1482  if (json.IsNull ()) {
1483  json.SetObject ();
1484  flags &= ~JSON_CVT_ONLYREQ; // children get all
1485  } else if (!json.IsObject()) {
1486  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1487  return false;
1488  }
1489  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gate_on", data.gate_on)) return false;
1490  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gate", data.gate)) return false;
1491  if (!JsonHelper::Member_ToJson(json, flags, allocator, "hp_on", data.hp_on)) return false;
1492  if (!JsonHelper::Member_ToJson(json, flags, allocator, "hp_freq", data.hp_freq)) return false;
1493  if (!JsonHelper::Member_ToJson(json, flags, allocator, "stereo_link", data.stereo_link)) return false;
1494  if (!JsonHelper::Member_ToJson(json, flags, allocator, "agc_matricing", data.agc_matricing)) return false;
1495  if (!JsonHelper::Member_ToJson(json, flags, allocator, "band_matricing", data.band_matricing)) return false;
1496  if (!JsonHelper::Member_ToJson(json, flags, allocator, "agc_usewide", data.agc_usewide)) return false;
1497  if (!JsonHelper::Member_ToJson(json, flags, allocator, "changespeed", data.changespeed)) return false;
1498  if (!JsonHelper::Member_ToJson(json, flags, allocator, "smoothagc_on", data.smoothagc_on)) return false;
1499  if (!JsonHelper::Member_ToJson(json, flags, allocator, "smoothband_on", data.smoothband_on)) return false;
1500  if ((flags & JSON_CVT_WITHDEV) &&
1501  !JsonHelper::Member_ToJson(json, flags, allocator, "preset_mode", data.preset_mode)) return false;
1502  if (!JsonHelper::Member_ToJson(json, flags, allocator, "display_agc", data.display_agc)) return false;
1503  if (!JsonHelper::Member_ToJson(json, flags, allocator, "display_tonefx", data.display_tonefx)) return false;
1504  if (!JsonHelper::Member_ToJson(json, flags, allocator, "display_stereofx", data.display_stereofx)) return false;
1505  if (!JsonHelper::Member_ToJson(json, flags, allocator, "display_bandexp", data.display_bandexp)) return false;
1506  if (!JsonHelper::Member_ToJson(json, flags, allocator, "display_bandprocess", data.display_bandprocess)) return false;
1507  if (!JsonHelper::Member_ToJson(json, flags, allocator, "display_bandlook", data.display_bandlook)) return false;
1508  if (!JsonHelper::Member_ToJson(json, flags, allocator, "display_bandlim", data.display_bandlim)) return false;
1509  if (!JsonHelper::Member_ToJson(json, flags, allocator, "display_bassclip", data.display_bassclip)) return false;
1510  if (!JsonHelper::Member_ToJson(json, flags, allocator, "display_agcattack", data.display_agcattack)) return false;
1511  if (!JsonHelper::Member_ToJson(json, flags, allocator, "display_bassfx", data.display_bassfx)) return false;
1512  if (!JsonHelper::Member_ToJson(json, flags, allocator, "display_treblefx", data.display_treblefx)) return false;
1513  if (!JsonHelper::Member_ToJson(json, flags, allocator, "display_bandimpact", data.display_bandimpact)) return false;
1514  if (!JsonHelper::Member_ToJson(json, flags, allocator, "display_bandattack", data.display_bandattack)) return false;
1515  if (!JsonHelper::Member_ToJson(json, flags, allocator, "display_bandratio", data.display_bandratio)) return false;
1516  if (!JsonHelper::Member_ToJson(json, flags, allocator, "display_bandthickness", data.display_bandthickness)) return false;
1517  if (json.MemberCount()==0) json.SetNull();
1518  return true;
1519  }
1520 
1521  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]]) {
1522  if (sizeof(json_preset_setup)==0) return true; // quick empty struct
1523  if (json.IsNull ()) {
1524  json.SetObject ();
1525  flags &= ~JSON_CVT_ONLYREQ; // children get all
1526  } else if (!json.IsObject()) {
1527  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1528  return false;
1529  }
1530  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gate_on", data.gate_on, ref.gate_on)) return false;
1531  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gate", data.gate, ref.gate)) return false;
1532  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "hp_on", data.hp_on, ref.hp_on)) return false;
1533  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "hp_freq", data.hp_freq, ref.hp_freq)) return false;
1534  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "stereo_link", data.stereo_link, ref.stereo_link)) return false;
1535  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "agc_matricing", data.agc_matricing, ref.agc_matricing)) return false;
1536  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "band_matricing", data.band_matricing, ref.band_matricing)) return false;
1537  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "agc_usewide", data.agc_usewide, ref.agc_usewide)) return false;
1538  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "changespeed", data.changespeed, ref.changespeed)) return false;
1539  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "smoothagc_on", data.smoothagc_on, ref.smoothagc_on)) return false;
1540  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "smoothband_on", data.smoothband_on, ref.smoothband_on)) return false;
1541  if ((flags & JSON_CVT_WITHDEV) &&
1542  !JsonHelper::Member_DiffToJson(json, flags, allocator, "preset_mode", data.preset_mode, ref.preset_mode)) return false;
1543  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "display_agc", data.display_agc, ref.display_agc)) return false;
1544  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "display_tonefx", data.display_tonefx, ref.display_tonefx)) return false;
1545  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "display_stereofx", data.display_stereofx, ref.display_stereofx)) return false;
1546  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "display_bandexp", data.display_bandexp, ref.display_bandexp)) return false;
1547  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "display_bandprocess", data.display_bandprocess, ref.display_bandprocess)) return false;
1548  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "display_bandlook", data.display_bandlook, ref.display_bandlook)) return false;
1549  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "display_bandlim", data.display_bandlim, ref.display_bandlim)) return false;
1550  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "display_bassclip", data.display_bassclip, ref.display_bassclip)) return false;
1551  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "display_agcattack", data.display_agcattack, ref.display_agcattack)) return false;
1552  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "display_bassfx", data.display_bassfx, ref.display_bassfx)) return false;
1553  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "display_treblefx", data.display_treblefx, ref.display_treblefx)) return false;
1554  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "display_bandimpact", data.display_bandimpact, ref.display_bandimpact)) return false;
1555  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "display_bandattack", data.display_bandattack, ref.display_bandattack)) return false;
1556  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "display_bandratio", data.display_bandratio, ref.display_bandratio)) return false;
1557  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "display_bandthickness", data.display_bandthickness, ref.display_bandthickness)) return false;
1558  if (json.MemberCount()==0) json.SetNull();
1559  return true;
1560  }
1561 
1562  static void ForceChange(const json_preset_setup& data [[maybe_unused]], json_preset_setup& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1563  JsonHelper::Member_ForceChange(allocator, "gate_on", data.gate_on, ref.gate_on);
1564  JsonHelper::Member_ForceChange(allocator, "gate", data.gate, ref.gate);
1565  JsonHelper::Member_ForceChange(allocator, "hp_on", data.hp_on, ref.hp_on);
1566  JsonHelper::Member_ForceChange(allocator, "hp_freq", data.hp_freq, ref.hp_freq);
1567  JsonHelper::Member_ForceChange(allocator, "stereo_link", data.stereo_link, ref.stereo_link);
1568  JsonHelper::Member_ForceChange(allocator, "agc_matricing", data.agc_matricing, ref.agc_matricing);
1569  JsonHelper::Member_ForceChange(allocator, "band_matricing", data.band_matricing, ref.band_matricing);
1570  JsonHelper::Member_ForceChange(allocator, "agc_usewide", data.agc_usewide, ref.agc_usewide);
1571  JsonHelper::Member_ForceChange(allocator, "changespeed", data.changespeed, ref.changespeed);
1572  JsonHelper::Member_ForceChange(allocator, "smoothagc_on", data.smoothagc_on, ref.smoothagc_on);
1573  JsonHelper::Member_ForceChange(allocator, "smoothband_on", data.smoothband_on, ref.smoothband_on);
1574  JsonHelper::Member_ForceChange(allocator, "preset_mode", data.preset_mode, ref.preset_mode);
1575  JsonHelper::Member_ForceChange(allocator, "display_agc", data.display_agc, ref.display_agc);
1576  JsonHelper::Member_ForceChange(allocator, "display_tonefx", data.display_tonefx, ref.display_tonefx);
1577  JsonHelper::Member_ForceChange(allocator, "display_stereofx", data.display_stereofx, ref.display_stereofx);
1578  JsonHelper::Member_ForceChange(allocator, "display_bandexp", data.display_bandexp, ref.display_bandexp);
1579  JsonHelper::Member_ForceChange(allocator, "display_bandprocess", data.display_bandprocess, ref.display_bandprocess);
1580  JsonHelper::Member_ForceChange(allocator, "display_bandlook", data.display_bandlook, ref.display_bandlook);
1581  JsonHelper::Member_ForceChange(allocator, "display_bandlim", data.display_bandlim, ref.display_bandlim);
1582  JsonHelper::Member_ForceChange(allocator, "display_bassclip", data.display_bassclip, ref.display_bassclip);
1583  JsonHelper::Member_ForceChange(allocator, "display_agcattack", data.display_agcattack, ref.display_agcattack);
1584  JsonHelper::Member_ForceChange(allocator, "display_bassfx", data.display_bassfx, ref.display_bassfx);
1585  JsonHelper::Member_ForceChange(allocator, "display_treblefx", data.display_treblefx, ref.display_treblefx);
1586  JsonHelper::Member_ForceChange(allocator, "display_bandimpact", data.display_bandimpact, ref.display_bandimpact);
1587  JsonHelper::Member_ForceChange(allocator, "display_bandattack", data.display_bandattack, ref.display_bandattack);
1588  JsonHelper::Member_ForceChange(allocator, "display_bandratio", data.display_bandratio, ref.display_bandratio);
1589  JsonHelper::Member_ForceChange(allocator, "display_bandthickness", data.display_bandthickness, ref.display_bandthickness);
1590  }
1591 
1592  };
1593  // === VU ===
1594  template <>
1595  struct JsonConvert<jsonvu_preset_setup> {
1596 
1597  /* VU have no FromJson */
1598 
1599  static bool ToJson(JSON_Value &json, const jsonvu_preset_setup& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1600  if (sizeof(jsonvu_preset_setup)==0) return true; // quick empty struct
1601  if (json.IsNull ()) {
1602  json.SetObject ();
1603  flags &= ~JSON_CVT_ONLYREQ; // children get all
1604  } else if (!json.IsObject()) {
1605  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1606  return false;
1607  }
1608  if (!JsonHelper::Member_ToJson(json, flags, allocator, "has_tonefx", data.has_tonefx)) return false;
1609  if (!JsonHelper::Member_ToJson(json, flags, allocator, "has_bandexp", data.has_bandexp)) return false;
1610  if (!JsonHelper::Member_ToJson(json, flags, allocator, "has_bandlook", data.has_bandlook)) return false;
1611  if (!JsonHelper::Member_ToJson(json, flags, allocator, "has_bandlim", data.has_bandlim)) return false;
1612  if (!JsonHelper::Member_ToJson(json, flags, allocator, "has_bassclip", data.has_bassclip)) return false;
1613  if (!JsonHelper::Member_ToJson(json, flags, allocator, "show_stereolink", data.show_stereolink)) return false;
1614  if (!JsonHelper::Member_ToJson(json, flags, allocator, "show_2bagc", data.show_2bagc)) return false;
1615  if (!JsonHelper::Member_ToJson(json, flags, allocator, "show_agcwide", data.show_agcwide)) return false;
1616  if (json.MemberCount()==0) json.SetNull();
1617  return true;
1618  }
1619 
1620  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]]) {
1621  if (sizeof(jsonvu_preset_setup)==0) return true; // quick empty struct
1622  if (json.IsNull ()) {
1623  json.SetObject ();
1624  flags &= ~JSON_CVT_ONLYREQ; // children get all
1625  } else if (!json.IsObject()) {
1626  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1627  return false;
1628  }
1629  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "has_tonefx", data.has_tonefx, ref.has_tonefx)) return false;
1630  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "has_bandexp", data.has_bandexp, ref.has_bandexp)) return false;
1631  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "has_bandlook", data.has_bandlook, ref.has_bandlook)) return false;
1632  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "has_bandlim", data.has_bandlim, ref.has_bandlim)) return false;
1633  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "has_bassclip", data.has_bassclip, ref.has_bassclip)) return false;
1634  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "show_stereolink", data.show_stereolink, ref.show_stereolink)) return false;
1635  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "show_2bagc", data.show_2bagc, ref.show_2bagc)) return false;
1636  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "show_agcwide", data.show_agcwide, ref.show_agcwide)) return false;
1637  if (json.MemberCount()==0) json.SetNull();
1638  return true;
1639  }
1640 
1641  static void ForceChange(const jsonvu_preset_setup& data [[maybe_unused]], jsonvu_preset_setup& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1642  JsonHelper::Member_ForceChange(allocator, "has_tonefx", data.has_tonefx, ref.has_tonefx);
1643  JsonHelper::Member_ForceChange(allocator, "has_bandexp", data.has_bandexp, ref.has_bandexp);
1644  JsonHelper::Member_ForceChange(allocator, "has_bandlook", data.has_bandlook, ref.has_bandlook);
1645  JsonHelper::Member_ForceChange(allocator, "has_bandlim", data.has_bandlim, ref.has_bandlim);
1646  JsonHelper::Member_ForceChange(allocator, "has_bassclip", data.has_bassclip, ref.has_bassclip);
1647  JsonHelper::Member_ForceChange(allocator, "show_stereolink", data.show_stereolink, ref.show_stereolink);
1648  JsonHelper::Member_ForceChange(allocator, "show_2bagc", data.show_2bagc, ref.show_2bagc);
1649  JsonHelper::Member_ForceChange(allocator, "show_agcwide", data.show_agcwide, ref.show_agcwide);
1650  }
1651 
1652  };
1653 // === object input ===
1654  // === Preset ===
1655  template <>
1656  struct JsonConvert<json_input> {
1657 
1658  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>()) {
1659  if (sizeof(json_input)==0) return true; // quick empty struct
1660  if (json.IsNull()) { return true; }
1661  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
1662  return true;
1663  }
1664 
1665  static bool ToJson(JSON_Value &json, const json_input& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1666  if (sizeof(json_input)==0) return true; // quick empty struct
1667  if (json.IsNull ()) {
1668  json.SetObject ();
1669  flags &= ~JSON_CVT_ONLYREQ; // children get all
1670  } else if (!json.IsObject()) {
1671  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1672  return false;
1673  }
1674  if (json.MemberCount()==0) json.SetNull();
1675  return true;
1676  }
1677 
1678  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]]) {
1679  if (sizeof(json_input)==0) return true; // quick empty struct
1680  if (json.IsNull ()) {
1681  json.SetObject ();
1682  flags &= ~JSON_CVT_ONLYREQ; // children get all
1683  } else if (!json.IsObject()) {
1684  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1685  return false;
1686  }
1687  if (json.MemberCount()==0) json.SetNull();
1688  return true;
1689  }
1690 
1691  static void ForceChange(const json_input& data [[maybe_unused]], json_input& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1692  }
1693 
1694  };
1695  // === VU ===
1696  template <>
1697  struct JsonConvert<jsonvu_input> {
1698 
1699  /* VU have no FromJson */
1700 
1701  static bool ToJson(JSON_Value &json, const jsonvu_input& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1702  if (sizeof(jsonvu_input)==0) return true; // quick empty struct
1703  if (json.IsNull ()) {
1704  json.SetObject ();
1705  flags &= ~JSON_CVT_ONLYREQ; // children get all
1706  } else if (!json.IsObject()) {
1707  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1708  return false;
1709  }
1710  if (!JsonHelper::Member_ToJson(json, flags, allocator, "vu", data.vu)) return false;
1711  if (!JsonHelper::Member_ToJson(json, flags, allocator, "standby", data.standby)) return false;
1712  if (!JsonHelper::Member_ToJson(json, flags, allocator, "vuout", data.vuout)) return false;
1713  if ((flags & JSON_CVT_WITHDEV) &&
1714  !JsonHelper::Member_ToJson(json, flags, allocator, "bs_moment", data.bs_moment)) return false;
1715  if ((flags & JSON_CVT_WITHDEV) &&
1716  !JsonHelper::Member_ToJson(json, flags, allocator, "bs_short", data.bs_short)) return false;
1717  if (!JsonHelper::Member_ToJson(json, flags, allocator, "bs_long", data.bs_long)) return false;
1718  if (!JsonHelper::Member_ToJson(json, flags, allocator, "bs_user", data.bs_user)) return false;
1719  if ((flags & JSON_CVT_WITHDEV) &&
1720  !JsonHelper::Member_ToJson(json, flags, allocator, "bs_psr", data.bs_psr)) return false;
1721  if ((flags & JSON_CVT_WITHDEV) &&
1722  !JsonHelper::Member_ToJson(json, flags, allocator, "bs_plr", data.bs_plr)) return false;
1723  if (json.MemberCount()==0) json.SetNull();
1724  return true;
1725  }
1726 
1727  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]]) {
1728  if (sizeof(jsonvu_input)==0) return true; // quick empty struct
1729  if (json.IsNull ()) {
1730  json.SetObject ();
1731  flags &= ~JSON_CVT_ONLYREQ; // children get all
1732  } else if (!json.IsObject()) {
1733  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1734  return false;
1735  }
1736  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "vu", data.vu, ref.vu)) return false;
1737  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "standby", data.standby, ref.standby)) return false;
1738  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "vuout", data.vuout, ref.vuout)) return false;
1739  if ((flags & JSON_CVT_WITHDEV) &&
1740  !JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_moment", data.bs_moment, ref.bs_moment)) return false;
1741  if ((flags & JSON_CVT_WITHDEV) &&
1742  !JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_short", data.bs_short, ref.bs_short)) return false;
1743  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_long", data.bs_long, ref.bs_long)) return false;
1744  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_user", data.bs_user, ref.bs_user)) return false;
1745  if ((flags & JSON_CVT_WITHDEV) &&
1746  !JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_psr", data.bs_psr, ref.bs_psr)) return false;
1747  if ((flags & JSON_CVT_WITHDEV) &&
1748  !JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_plr", data.bs_plr, ref.bs_plr)) return false;
1749  if (json.MemberCount()==0) json.SetNull();
1750  return true;
1751  }
1752 
1753  static void ForceChange(const jsonvu_input& data [[maybe_unused]], jsonvu_input& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1754  JsonHelper::Member_ForceChange(allocator, "vu", data.vu, ref.vu);
1755  JsonHelper::Member_ForceChange(allocator, "standby", data.standby, ref.standby);
1756  JsonHelper::Member_ForceChange(allocator, "vuout", data.vuout, ref.vuout);
1757  JsonHelper::Member_ForceChange(allocator, "bs_moment", data.bs_moment, ref.bs_moment);
1758  JsonHelper::Member_ForceChange(allocator, "bs_short", data.bs_short, ref.bs_short);
1759  JsonHelper::Member_ForceChange(allocator, "bs_long", data.bs_long, ref.bs_long);
1760  JsonHelper::Member_ForceChange(allocator, "bs_user", data.bs_user, ref.bs_user);
1761  JsonHelper::Member_ForceChange(allocator, "bs_psr", data.bs_psr, ref.bs_psr);
1762  JsonHelper::Member_ForceChange(allocator, "bs_plr", data.bs_plr, ref.bs_plr);
1763  }
1764 
1765  };
1766 // === object agc ===
1767  // === Preset ===
1768  template <>
1769  struct JsonConvert<json_agc> {
1770 
1771  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>()) {
1772  if (sizeof(json_agc)==0) return true; // quick empty struct
1773  if (json.IsNull()) { return true; }
1774  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
1775  if ( !JsonHelper::Member_FromJson(json, flags, "on", data.on, allocator)) return false;
1776  if ( !JsonHelper::Member_FromJson(json, flags, "freq", data.freq, allocator, JsonConstraint<S4Float>(20,22000))) return false;
1777  if ((flags & JSON_CVT_WITHDEV) &&
1778  !JsonHelper::Member_FromJson(json, flags, "hp_on", data.hp_on, allocator)) return false;
1779  if ((flags & JSON_CVT_WITHDEV) &&
1780  !JsonHelper::Member_FromJson(json, flags, "hp_freq", data.hp_freq, allocator, JsonConstraint<S4Float>(10,200))) return false;
1781  if ( !JsonHelper::Member_FromJson(json, flags, "gate_on", data.gate_on, allocator)) return false;
1782  if ( !JsonHelper::Member_FromJson(json, flags, "gate", data.gate, allocator, JsonConstraint<S4Float>(-100,-10))) return false;
1783  if ( !JsonHelper::Member_FromJson(json, flags, "drive_on", data.drive_on, allocator)) return false;
1784  if ( !JsonHelper::Member_FromJson(json, flags, "drive", data.drive, allocator, JsonConstraint<S4Float>(-30,30))) return false;
1785  if ((flags & JSON_CVT_WITHDEV) &&
1786  !JsonHelper::Member_FromJson(json, flags, "threshold", data.threshold, allocator, JsonConstraint<S4Float>(-146,16))) return false;
1787  if ((flags & JSON_CVT_WITHDEV) &&
1788  !JsonHelper::Member_FromJson(json, flags, "postgain", data.postgain, allocator, JsonConstraint<S4Float>(-30,30))) return false;
1789  if ((flags & JSON_CVT_WITHDEV) &&
1790  !JsonHelper::Member_FromJson(json, flags, "ratio", data.ratio, allocator, JsonConstraint<S4Float>(0,100))) return false;
1791  if ( !JsonHelper::Member_FromJson(json, flags, "attack", data.attack, allocator, JsonConstraint<S4Float>(1,32000))) return false;
1792  if ( !JsonHelper::Member_FromJson(json, flags, "release", data.release, allocator, JsonConstraint<S4Float>(1.0,15))) return false;
1793  if ( !JsonHelper::Member_FromJson(json, flags, "sustain", data.sustain, allocator, JsonConstraint<S4Float>(0.0,600))) return false;
1794  if ((flags & JSON_CVT_WITHDEV) &&
1795  !JsonHelper::Member_FromJson(json, flags, "autoatt_mode", data.autoatt_mode, allocator)) return false;
1796  if ((flags & JSON_CVT_WITHDEV) &&
1797  !JsonHelper::Member_FromJson(json, flags, "autoatt_max", data.autoatt_max, allocator, JsonConstraint<S4Float>(5,32000))) return false;
1798  if ((flags & JSON_CVT_WITHDEV) &&
1799  !JsonHelper::Member_FromJson(json, flags, "autoatt_start", data.autoatt_start, allocator, JsonConstraint<S4Float>(0,10))) return false;
1800  if ((flags & JSON_CVT_WITHDEV) &&
1801  !JsonHelper::Member_FromJson(json, flags, "autoatt_stop", data.autoatt_stop, allocator, JsonConstraint<S4Float>(0,30))) return false;
1802  if ((flags & JSON_CVT_WITHDEV) &&
1803  !JsonHelper::Member_FromJson(json, flags, "autoatt_sym", data.autoatt_sym, allocator)) return false;
1804  if ((flags & JSON_CVT_WITHDEV) &&
1805  !JsonHelper::Member_FromJson(json, flags, "nbperiod", data.nbperiod, allocator, JsonConstraint<int>(1,AGC2B_MAX_PERIOD))) return false;
1806  if ((flags & JSON_CVT_WITHDEV) &&
1807  !JsonHelper::Member_FromJson(json, flags, "smooth_agc", data.smooth_agc, allocator, JsonConstraint<int>(1,AGC2B_MAX_PERIOD))) return false;
1808  if ((flags & JSON_CVT_WITHDEV) &&
1809  !JsonHelper::Member_FromJson(json, flags, "impact", data.impact, allocator, JsonConstraint<S4Float>(0,10))) return false;
1810  if ((flags & JSON_CVT_WITHDEV) &&
1811  !JsonHelper::Member_FromJson(json, flags, "avg_speed_gain", data.avg_speed_gain, allocator, JsonConstraint<S4Float>(0.1,300))) return false;
1812  if ((flags & JSON_CVT_WITHDEV) &&
1813  !JsonHelper::Member_FromJson(json, flags, "avg_speed_in", data.avg_speed_in, allocator, JsonConstraint<S4Float>(0.1,300))) return false;
1814  if ((flags & JSON_CVT_WITHDEV) &&
1815  !JsonHelper::Member_FromJson(json, flags, "ref_speed_in", data.ref_speed_in, allocator, JsonConstraint<S4Float>(0.01,1))) return false;
1816  if ( !JsonHelper::Member_FromJson(json, flags, "fidelity_on", data.fidelity_on, allocator)) return false;
1817  if ((flags & JSON_CVT_WITHDEV) &&
1818  !JsonHelper::Member_FromJson(json, flags, "fidelity_speed", data.fidelity_speed, allocator, JsonConstraint<S4Float>(0.1,60))) return false;
1819  if ( !JsonHelper::Member_FromJson(json, flags, "fidelity", data.fidelity, allocator, JsonConstraint<S4Float>(0,100))) return false;
1820  if ((flags & JSON_CVT_WITHDEV) &&
1821  !JsonHelper::Member_FromJson(json, flags, "attack_min", data.attack_min, allocator, JsonConstraint<S4Float>(1,32000))) return false;
1822  if ((flags & JSON_CVT_WITHDEV) &&
1823  !JsonHelper::Member_FromJson(json, flags, "attack_max", data.attack_max, allocator, JsonConstraint<S4Float>(1,32000))) return false;
1824  if ( !JsonHelper::Member_FromJson(json, flags, "voicethres", data.voicethres, allocator, JsonConstraint<S4Float>(-30,10))) return false;
1825  if ( !JsonHelper::Member_FromJson(json, flags, "peak_mode", data.peak_mode, allocator)) return false;
1826  return true;
1827  }
1828 
1829  static bool ToJson(JSON_Value &json, const json_agc& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1830  if (sizeof(json_agc)==0) return true; // quick empty struct
1831  if (json.IsNull ()) {
1832  json.SetObject ();
1833  flags &= ~JSON_CVT_ONLYREQ; // children get all
1834  } else if (!json.IsObject()) {
1835  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1836  return false;
1837  }
1838  if (!JsonHelper::Member_ToJson(json, flags, allocator, "on", data.on)) return false;
1839  if (!JsonHelper::Member_ToJson(json, flags, allocator, "freq", data.freq)) return false;
1840  if ((flags & JSON_CVT_WITHDEV) &&
1841  !JsonHelper::Member_ToJson(json, flags, allocator, "hp_on", data.hp_on)) return false;
1842  if ((flags & JSON_CVT_WITHDEV) &&
1843  !JsonHelper::Member_ToJson(json, flags, allocator, "hp_freq", data.hp_freq)) return false;
1844  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gate_on", data.gate_on)) return false;
1845  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gate", data.gate)) return false;
1846  if (!JsonHelper::Member_ToJson(json, flags, allocator, "drive_on", data.drive_on)) return false;
1847  if (!JsonHelper::Member_ToJson(json, flags, allocator, "drive", data.drive)) return false;
1848  if ((flags & JSON_CVT_WITHDEV) &&
1849  !JsonHelper::Member_ToJson(json, flags, allocator, "threshold", data.threshold)) return false;
1850  if ((flags & JSON_CVT_WITHDEV) &&
1851  !JsonHelper::Member_ToJson(json, flags, allocator, "postgain", data.postgain)) return false;
1852  if ((flags & JSON_CVT_WITHDEV) &&
1853  !JsonHelper::Member_ToJson(json, flags, allocator, "ratio", data.ratio)) return false;
1854  if (!JsonHelper::Member_ToJson(json, flags, allocator, "attack", data.attack)) return false;
1855  if (!JsonHelper::Member_ToJson(json, flags, allocator, "release", data.release)) return false;
1856  if (!JsonHelper::Member_ToJson(json, flags, allocator, "sustain", data.sustain)) return false;
1857  if ((flags & JSON_CVT_WITHDEV) &&
1858  !JsonHelper::Member_ToJson(json, flags, allocator, "autoatt_mode", data.autoatt_mode)) return false;
1859  if ((flags & JSON_CVT_WITHDEV) &&
1860  !JsonHelper::Member_ToJson(json, flags, allocator, "autoatt_max", data.autoatt_max)) return false;
1861  if ((flags & JSON_CVT_WITHDEV) &&
1862  !JsonHelper::Member_ToJson(json, flags, allocator, "autoatt_start", data.autoatt_start)) return false;
1863  if ((flags & JSON_CVT_WITHDEV) &&
1864  !JsonHelper::Member_ToJson(json, flags, allocator, "autoatt_stop", data.autoatt_stop)) return false;
1865  if ((flags & JSON_CVT_WITHDEV) &&
1866  !JsonHelper::Member_ToJson(json, flags, allocator, "autoatt_sym", data.autoatt_sym)) return false;
1867  if ((flags & JSON_CVT_WITHDEV) &&
1868  !JsonHelper::Member_ToJson(json, flags, allocator, "nbperiod", data.nbperiod)) return false;
1869  if ((flags & JSON_CVT_WITHDEV) &&
1870  !JsonHelper::Member_ToJson(json, flags, allocator, "smooth_agc", data.smooth_agc)) return false;
1871  if ((flags & JSON_CVT_WITHDEV) &&
1872  !JsonHelper::Member_ToJson(json, flags, allocator, "impact", data.impact)) return false;
1873  if ((flags & JSON_CVT_WITHDEV) &&
1874  !JsonHelper::Member_ToJson(json, flags, allocator, "avg_speed_gain", data.avg_speed_gain)) return false;
1875  if ((flags & JSON_CVT_WITHDEV) &&
1876  !JsonHelper::Member_ToJson(json, flags, allocator, "avg_speed_in", data.avg_speed_in)) return false;
1877  if ((flags & JSON_CVT_WITHDEV) &&
1878  !JsonHelper::Member_ToJson(json, flags, allocator, "ref_speed_in", data.ref_speed_in)) return false;
1879  if (!JsonHelper::Member_ToJson(json, flags, allocator, "fidelity_on", data.fidelity_on)) return false;
1880  if ((flags & JSON_CVT_WITHDEV) &&
1881  !JsonHelper::Member_ToJson(json, flags, allocator, "fidelity_speed", data.fidelity_speed)) return false;
1882  if (!JsonHelper::Member_ToJson(json, flags, allocator, "fidelity", data.fidelity)) return false;
1883  if ((flags & JSON_CVT_WITHDEV) &&
1884  !JsonHelper::Member_ToJson(json, flags, allocator, "attack_min", data.attack_min)) return false;
1885  if ((flags & JSON_CVT_WITHDEV) &&
1886  !JsonHelper::Member_ToJson(json, flags, allocator, "attack_max", data.attack_max)) return false;
1887  if (!JsonHelper::Member_ToJson(json, flags, allocator, "voicethres", data.voicethres)) return false;
1888  if (!JsonHelper::Member_ToJson(json, flags, allocator, "peak_mode", data.peak_mode)) return false;
1889  if (json.MemberCount()==0) json.SetNull();
1890  return true;
1891  }
1892 
1893  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]]) {
1894  if (sizeof(json_agc)==0) return true; // quick empty struct
1895  if (json.IsNull ()) {
1896  json.SetObject ();
1897  flags &= ~JSON_CVT_ONLYREQ; // children get all
1898  } else if (!json.IsObject()) {
1899  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
1900  return false;
1901  }
1902  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "on", data.on, ref.on)) return false;
1903  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "freq", data.freq, ref.freq)) return false;
1904  if ((flags & JSON_CVT_WITHDEV) &&
1905  !JsonHelper::Member_DiffToJson(json, flags, allocator, "hp_on", data.hp_on, ref.hp_on)) return false;
1906  if ((flags & JSON_CVT_WITHDEV) &&
1907  !JsonHelper::Member_DiffToJson(json, flags, allocator, "hp_freq", data.hp_freq, ref.hp_freq)) return false;
1908  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gate_on", data.gate_on, ref.gate_on)) return false;
1909  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gate", data.gate, ref.gate)) return false;
1910  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "drive_on", data.drive_on, ref.drive_on)) return false;
1911  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "drive", data.drive, ref.drive)) return false;
1912  if ((flags & JSON_CVT_WITHDEV) &&
1913  !JsonHelper::Member_DiffToJson(json, flags, allocator, "threshold", data.threshold, ref.threshold)) return false;
1914  if ((flags & JSON_CVT_WITHDEV) &&
1915  !JsonHelper::Member_DiffToJson(json, flags, allocator, "postgain", data.postgain, ref.postgain)) return false;
1916  if ((flags & JSON_CVT_WITHDEV) &&
1917  !JsonHelper::Member_DiffToJson(json, flags, allocator, "ratio", data.ratio, ref.ratio)) return false;
1918  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "attack", data.attack, ref.attack)) return false;
1919  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "release", data.release, ref.release)) return false;
1920  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "sustain", data.sustain, ref.sustain)) return false;
1921  if ((flags & JSON_CVT_WITHDEV) &&
1922  !JsonHelper::Member_DiffToJson(json, flags, allocator, "autoatt_mode", data.autoatt_mode, ref.autoatt_mode)) return false;
1923  if ((flags & JSON_CVT_WITHDEV) &&
1924  !JsonHelper::Member_DiffToJson(json, flags, allocator, "autoatt_max", data.autoatt_max, ref.autoatt_max)) return false;
1925  if ((flags & JSON_CVT_WITHDEV) &&
1926  !JsonHelper::Member_DiffToJson(json, flags, allocator, "autoatt_start", data.autoatt_start, ref.autoatt_start)) return false;
1927  if ((flags & JSON_CVT_WITHDEV) &&
1928  !JsonHelper::Member_DiffToJson(json, flags, allocator, "autoatt_stop", data.autoatt_stop, ref.autoatt_stop)) return false;
1929  if ((flags & JSON_CVT_WITHDEV) &&
1930  !JsonHelper::Member_DiffToJson(json, flags, allocator, "autoatt_sym", data.autoatt_sym, ref.autoatt_sym)) return false;
1931  if ((flags & JSON_CVT_WITHDEV) &&
1932  !JsonHelper::Member_DiffToJson(json, flags, allocator, "nbperiod", data.nbperiod, ref.nbperiod)) return false;
1933  if ((flags & JSON_CVT_WITHDEV) &&
1934  !JsonHelper::Member_DiffToJson(json, flags, allocator, "smooth_agc", data.smooth_agc, ref.smooth_agc)) return false;
1935  if ((flags & JSON_CVT_WITHDEV) &&
1936  !JsonHelper::Member_DiffToJson(json, flags, allocator, "impact", data.impact, ref.impact)) return false;
1937  if ((flags & JSON_CVT_WITHDEV) &&
1938  !JsonHelper::Member_DiffToJson(json, flags, allocator, "avg_speed_gain", data.avg_speed_gain, ref.avg_speed_gain)) return false;
1939  if ((flags & JSON_CVT_WITHDEV) &&
1940  !JsonHelper::Member_DiffToJson(json, flags, allocator, "avg_speed_in", data.avg_speed_in, ref.avg_speed_in)) return false;
1941  if ((flags & JSON_CVT_WITHDEV) &&
1942  !JsonHelper::Member_DiffToJson(json, flags, allocator, "ref_speed_in", data.ref_speed_in, ref.ref_speed_in)) return false;
1943  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "fidelity_on", data.fidelity_on, ref.fidelity_on)) return false;
1944  if ((flags & JSON_CVT_WITHDEV) &&
1945  !JsonHelper::Member_DiffToJson(json, flags, allocator, "fidelity_speed", data.fidelity_speed, ref.fidelity_speed)) return false;
1946  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "fidelity", data.fidelity, ref.fidelity)) return false;
1947  if ((flags & JSON_CVT_WITHDEV) &&
1948  !JsonHelper::Member_DiffToJson(json, flags, allocator, "attack_min", data.attack_min, ref.attack_min)) return false;
1949  if ((flags & JSON_CVT_WITHDEV) &&
1950  !JsonHelper::Member_DiffToJson(json, flags, allocator, "attack_max", data.attack_max, ref.attack_max)) return false;
1951  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "voicethres", data.voicethres, ref.voicethres)) return false;
1952  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "peak_mode", data.peak_mode, ref.peak_mode)) return false;
1953  if (json.MemberCount()==0) json.SetNull();
1954  return true;
1955  }
1956 
1957  static void ForceChange(const json_agc& data [[maybe_unused]], json_agc& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
1958  JsonHelper::Member_ForceChange(allocator, "on", data.on, ref.on);
1959  JsonHelper::Member_ForceChange(allocator, "freq", data.freq, ref.freq);
1960  JsonHelper::Member_ForceChange(allocator, "hp_on", data.hp_on, ref.hp_on);
1961  JsonHelper::Member_ForceChange(allocator, "hp_freq", data.hp_freq, ref.hp_freq);
1962  JsonHelper::Member_ForceChange(allocator, "gate_on", data.gate_on, ref.gate_on);
1963  JsonHelper::Member_ForceChange(allocator, "gate", data.gate, ref.gate);
1964  JsonHelper::Member_ForceChange(allocator, "drive_on", data.drive_on, ref.drive_on);
1965  JsonHelper::Member_ForceChange(allocator, "drive", data.drive, ref.drive);
1966  JsonHelper::Member_ForceChange(allocator, "threshold", data.threshold, ref.threshold);
1967  JsonHelper::Member_ForceChange(allocator, "postgain", data.postgain, ref.postgain);
1968  JsonHelper::Member_ForceChange(allocator, "ratio", data.ratio, ref.ratio);
1969  JsonHelper::Member_ForceChange(allocator, "attack", data.attack, ref.attack);
1970  JsonHelper::Member_ForceChange(allocator, "release", data.release, ref.release);
1971  JsonHelper::Member_ForceChange(allocator, "sustain", data.sustain, ref.sustain);
1972  JsonHelper::Member_ForceChange(allocator, "autoatt_mode", data.autoatt_mode, ref.autoatt_mode);
1973  JsonHelper::Member_ForceChange(allocator, "autoatt_max", data.autoatt_max, ref.autoatt_max);
1974  JsonHelper::Member_ForceChange(allocator, "autoatt_start", data.autoatt_start, ref.autoatt_start);
1975  JsonHelper::Member_ForceChange(allocator, "autoatt_stop", data.autoatt_stop, ref.autoatt_stop);
1976  JsonHelper::Member_ForceChange(allocator, "autoatt_sym", data.autoatt_sym, ref.autoatt_sym);
1977  JsonHelper::Member_ForceChange(allocator, "nbperiod", data.nbperiod, ref.nbperiod);
1978  JsonHelper::Member_ForceChange(allocator, "smooth_agc", data.smooth_agc, ref.smooth_agc);
1979  JsonHelper::Member_ForceChange(allocator, "impact", data.impact, ref.impact);
1980  JsonHelper::Member_ForceChange(allocator, "avg_speed_gain", data.avg_speed_gain, ref.avg_speed_gain);
1981  JsonHelper::Member_ForceChange(allocator, "avg_speed_in", data.avg_speed_in, ref.avg_speed_in);
1982  JsonHelper::Member_ForceChange(allocator, "ref_speed_in", data.ref_speed_in, ref.ref_speed_in);
1983  JsonHelper::Member_ForceChange(allocator, "fidelity_on", data.fidelity_on, ref.fidelity_on);
1984  JsonHelper::Member_ForceChange(allocator, "fidelity_speed", data.fidelity_speed, ref.fidelity_speed);
1985  JsonHelper::Member_ForceChange(allocator, "fidelity", data.fidelity, ref.fidelity);
1986  JsonHelper::Member_ForceChange(allocator, "attack_min", data.attack_min, ref.attack_min);
1987  JsonHelper::Member_ForceChange(allocator, "attack_max", data.attack_max, ref.attack_max);
1988  JsonHelper::Member_ForceChange(allocator, "voicethres", data.voicethres, ref.voicethres);
1989  JsonHelper::Member_ForceChange(allocator, "peak_mode", data.peak_mode, ref.peak_mode);
1990  }
1991 
1992  };
1993  // === VU ===
1994  template <>
1995  struct JsonConvert<jsonvu_agc> {
1996 
1997  /* VU have no FromJson */
1998 
1999  static bool ToJson(JSON_Value &json, const jsonvu_agc& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2000  if (sizeof(jsonvu_agc)==0) return true; // quick empty struct
2001  if (json.IsNull ()) {
2002  json.SetObject ();
2003  flags &= ~JSON_CVT_ONLYREQ; // children get all
2004  } else if (!json.IsObject()) {
2005  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2006  return false;
2007  }
2008  if (!JsonHelper::Member_ToJson(json, flags, allocator, "in", data.in)) return false;
2009  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gated", data.gated)) return false;
2010  if ((flags & JSON_CVT_WITHDEV) &&
2011  !JsonHelper::Member_ToJson(json, flags, allocator, "fidel", data.fidel)) return false;
2012  if ((flags & JSON_CVT_WITHDEV) &&
2013  !JsonHelper::Member_ToJson(json, flags, allocator, "mes_in", data.mes_in)) return false;
2014  if ((flags & JSON_CVT_WITHDEV) &&
2015  !JsonHelper::Member_ToJson(json, flags, allocator, "in_avg", data.in_avg)) return false;
2016  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gain", data.gain)) return false;
2017  if (!JsonHelper::Member_ToJson(json, flags, allocator, "out", data.out)) return false;
2018  if ((flags & JSON_CVT_WITHDEV) &&
2019  !JsonHelper::Member_ToJson(json, flags, allocator, "gain_avg", data.gain_avg)) return false;
2020  if ((flags & JSON_CVT_WITHDEV) &&
2021  !JsonHelper::Member_ToJson(json, flags, allocator, "attack_vu", data.attack_vu)) return false;
2022  if (!JsonHelper::Member_ToJson(json, flags, allocator, "attack_min_vu", data.attack_min_vu)) return false;
2023  if (!JsonHelper::Member_ToJson(json, flags, allocator, "attack_max_vu", data.attack_max_vu)) return false;
2024  if (!JsonHelper::Member_ToJson(json, flags, allocator, "vu_on", data.vu_on)) return false;
2025  if (!JsonHelper::Member_ToJson(json, flags, allocator, "vu_freq", data.vu_freq)) return false;
2026  if (json.MemberCount()==0) json.SetNull();
2027  return true;
2028  }
2029 
2030  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]]) {
2031  if (sizeof(jsonvu_agc)==0) return true; // quick empty struct
2032  if (json.IsNull ()) {
2033  json.SetObject ();
2034  flags &= ~JSON_CVT_ONLYREQ; // children get all
2035  } else if (!json.IsObject()) {
2036  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2037  return false;
2038  }
2039  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "in", data.in, ref.in)) return false;
2040  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gated", data.gated, ref.gated)) return false;
2041  if ((flags & JSON_CVT_WITHDEV) &&
2042  !JsonHelper::Member_DiffToJson(json, flags, allocator, "fidel", data.fidel, ref.fidel)) return false;
2043  if ((flags & JSON_CVT_WITHDEV) &&
2044  !JsonHelper::Member_DiffToJson(json, flags, allocator, "mes_in", data.mes_in, ref.mes_in)) return false;
2045  if ((flags & JSON_CVT_WITHDEV) &&
2046  !JsonHelper::Member_DiffToJson(json, flags, allocator, "in_avg", data.in_avg, ref.in_avg)) return false;
2047  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gain", data.gain, ref.gain)) return false;
2048  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "out", data.out, ref.out)) return false;
2049  if ((flags & JSON_CVT_WITHDEV) &&
2050  !JsonHelper::Member_DiffToJson(json, flags, allocator, "gain_avg", data.gain_avg, ref.gain_avg)) return false;
2051  if ((flags & JSON_CVT_WITHDEV) &&
2052  !JsonHelper::Member_DiffToJson(json, flags, allocator, "attack_vu", data.attack_vu, ref.attack_vu)) return false;
2053  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "attack_min_vu", data.attack_min_vu, ref.attack_min_vu)) return false;
2054  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "attack_max_vu", data.attack_max_vu, ref.attack_max_vu)) return false;
2055  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "vu_on", data.vu_on, ref.vu_on)) return false;
2056  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "vu_freq", data.vu_freq, ref.vu_freq)) return false;
2057  if (json.MemberCount()==0) json.SetNull();
2058  return true;
2059  }
2060 
2061  static void ForceChange(const jsonvu_agc& data [[maybe_unused]], jsonvu_agc& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2062  JsonHelper::Member_ForceChange(allocator, "in", data.in, ref.in);
2063  JsonHelper::Member_ForceChange(allocator, "gated", data.gated, ref.gated);
2064  JsonHelper::Member_ForceChange(allocator, "fidel", data.fidel, ref.fidel);
2065  JsonHelper::Member_ForceChange(allocator, "mes_in", data.mes_in, ref.mes_in);
2066  JsonHelper::Member_ForceChange(allocator, "in_avg", data.in_avg, ref.in_avg);
2067  JsonHelper::Member_ForceChange(allocator, "gain", data.gain, ref.gain);
2068  JsonHelper::Member_ForceChange(allocator, "out", data.out, ref.out);
2069  JsonHelper::Member_ForceChange(allocator, "gain_avg", data.gain_avg, ref.gain_avg);
2070  JsonHelper::Member_ForceChange(allocator, "attack_vu", data.attack_vu, ref.attack_vu);
2071  JsonHelper::Member_ForceChange(allocator, "attack_min_vu", data.attack_min_vu, ref.attack_min_vu);
2072  JsonHelper::Member_ForceChange(allocator, "attack_max_vu", data.attack_max_vu, ref.attack_max_vu);
2073  JsonHelper::Member_ForceChange(allocator, "vu_on", data.vu_on, ref.vu_on);
2074  JsonHelper::Member_ForceChange(allocator, "vu_freq", data.vu_freq, ref.vu_freq);
2075  }
2076 
2077  };
2078 // === object agcwide ===
2079  // === Preset ===
2080  template <>
2081  struct JsonConvert<json_agcwide> {
2082 
2083  static bool FromJson(const JSON_Value& json, json_agcwide& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_agcwide> &constraints = JsonConstraint<json_agcwide>()) {
2084  if (sizeof(json_agcwide)==0) return true; // quick empty struct
2085  if (json.IsNull()) { return true; }
2086  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
2087  if ( !JsonHelper::Member_FromJson(json, flags, "on", data.on, allocator)) return false;
2088  if ((flags & JSON_CVT_WITHDEV) &&
2089  !JsonHelper::Member_FromJson(json, flags, "hp_on", data.hp_on, allocator)) return false;
2090  if ((flags & JSON_CVT_WITHDEV) &&
2091  !JsonHelper::Member_FromJson(json, flags, "hp_freq", data.hp_freq, allocator, JsonConstraint<S4Float>(10,200))) return false;
2092  if ( !JsonHelper::Member_FromJson(json, flags, "gate_on", data.gate_on, allocator)) return false;
2093  if ( !JsonHelper::Member_FromJson(json, flags, "gate", data.gate, allocator, JsonConstraint<S4Float>(-100,-10))) return false;
2094  if ( !JsonHelper::Member_FromJson(json, flags, "drive_on", data.drive_on, allocator)) return false;
2095  if ( !JsonHelper::Member_FromJson(json, flags, "drive", data.drive, allocator, JsonConstraint<S4Float>(-30,30))) return false;
2096  if ((flags & JSON_CVT_WITHDEV) &&
2097  !JsonHelper::Member_FromJson(json, flags, "threshold", data.threshold, allocator, JsonConstraint<S4Float>(-146,16))) return false;
2098  if ((flags & JSON_CVT_WITHDEV) &&
2099  !JsonHelper::Member_FromJson(json, flags, "postgain", data.postgain, allocator, JsonConstraint<S4Float>(-30,30))) return false;
2100  if ((flags & JSON_CVT_WITHDEV) &&
2101  !JsonHelper::Member_FromJson(json, flags, "ratio", data.ratio, allocator, JsonConstraint<S4Float>(0,100))) return false;
2102  if ( !JsonHelper::Member_FromJson(json, flags, "attack", data.attack, allocator, JsonConstraint<S4Float>(1,32000))) return false;
2103  if ( !JsonHelper::Member_FromJson(json, flags, "release", data.release, allocator, JsonConstraint<S4Float>(1.0,15))) return false;
2104  if ( !JsonHelper::Member_FromJson(json, flags, "sustain", data.sustain, allocator, JsonConstraint<S4Float>(0.0,600))) return false;
2105  if ((flags & JSON_CVT_WITHDEV) &&
2106  !JsonHelper::Member_FromJson(json, flags, "autoatt_mode", data.autoatt_mode, allocator)) return false;
2107  if ((flags & JSON_CVT_WITHDEV) &&
2108  !JsonHelper::Member_FromJson(json, flags, "autoatt_max", data.autoatt_max, allocator, JsonConstraint<S4Float>(5,32000))) return false;
2109  if ((flags & JSON_CVT_WITHDEV) &&
2110  !JsonHelper::Member_FromJson(json, flags, "autoatt_start", data.autoatt_start, allocator, JsonConstraint<S4Float>(0,10))) return false;
2111  if ((flags & JSON_CVT_WITHDEV) &&
2112  !JsonHelper::Member_FromJson(json, flags, "autoatt_stop", data.autoatt_stop, allocator, JsonConstraint<S4Float>(0,30))) return false;
2113  if ((flags & JSON_CVT_WITHDEV) &&
2114  !JsonHelper::Member_FromJson(json, flags, "autoatt_sym", data.autoatt_sym, allocator)) return false;
2115  if ((flags & JSON_CVT_WITHDEV) &&
2116  !JsonHelper::Member_FromJson(json, flags, "nbperiod", data.nbperiod, allocator, JsonConstraint<int>(1,AGC2B_MAX_PERIOD))) return false;
2117  if ((flags & JSON_CVT_WITHDEV) &&
2118  !JsonHelper::Member_FromJson(json, flags, "smooth_agc", data.smooth_agc, allocator, JsonConstraint<int>(1,AGC2B_MAX_PERIOD))) return false;
2119  if ((flags & JSON_CVT_WITHDEV) &&
2120  !JsonHelper::Member_FromJson(json, flags, "impact", data.impact, allocator, JsonConstraint<S4Float>(0,10))) return false;
2121  if ((flags & JSON_CVT_WITHDEV) &&
2122  !JsonHelper::Member_FromJson(json, flags, "avg_speed_gain", data.avg_speed_gain, allocator, JsonConstraint<S4Float>(0.1,300))) return false;
2123  if ((flags & JSON_CVT_WITHDEV) &&
2124  !JsonHelper::Member_FromJson(json, flags, "avg_speed_in", data.avg_speed_in, allocator, JsonConstraint<S4Float>(0.1,300))) return false;
2125  if ((flags & JSON_CVT_WITHDEV) &&
2126  !JsonHelper::Member_FromJson(json, flags, "ref_speed_in", data.ref_speed_in, allocator, JsonConstraint<S4Float>(0.01,1))) return false;
2127  if ((flags & JSON_CVT_WITHDEV) &&
2128  !JsonHelper::Member_FromJson(json, flags, "attack_min", data.attack_min, allocator, JsonConstraint<S4Float>(1,32000))) return false;
2129  if ((flags & JSON_CVT_WITHDEV) &&
2130  !JsonHelper::Member_FromJson(json, flags, "attack_max", data.attack_max, allocator, JsonConstraint<S4Float>(1,32000))) return false;
2131  if ( !JsonHelper::Member_FromJson(json, flags, "voicethres", data.voicethres, allocator, JsonConstraint<S4Float>(-30,10))) return false;
2132  if ( !JsonHelper::Member_FromJson(json, flags, "peak_mode", data.peak_mode, allocator)) return false;
2133  return true;
2134  }
2135 
2136  static bool ToJson(JSON_Value &json, const json_agcwide& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2137  if (sizeof(json_agcwide)==0) return true; // quick empty struct
2138  if (json.IsNull ()) {
2139  json.SetObject ();
2140  flags &= ~JSON_CVT_ONLYREQ; // children get all
2141  } else if (!json.IsObject()) {
2142  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2143  return false;
2144  }
2145  if (!JsonHelper::Member_ToJson(json, flags, allocator, "on", data.on)) return false;
2146  if ((flags & JSON_CVT_WITHDEV) &&
2147  !JsonHelper::Member_ToJson(json, flags, allocator, "hp_on", data.hp_on)) return false;
2148  if ((flags & JSON_CVT_WITHDEV) &&
2149  !JsonHelper::Member_ToJson(json, flags, allocator, "hp_freq", data.hp_freq)) return false;
2150  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gate_on", data.gate_on)) return false;
2151  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gate", data.gate)) return false;
2152  if (!JsonHelper::Member_ToJson(json, flags, allocator, "drive_on", data.drive_on)) return false;
2153  if (!JsonHelper::Member_ToJson(json, flags, allocator, "drive", data.drive)) return false;
2154  if ((flags & JSON_CVT_WITHDEV) &&
2155  !JsonHelper::Member_ToJson(json, flags, allocator, "threshold", data.threshold)) return false;
2156  if ((flags & JSON_CVT_WITHDEV) &&
2157  !JsonHelper::Member_ToJson(json, flags, allocator, "postgain", data.postgain)) return false;
2158  if ((flags & JSON_CVT_WITHDEV) &&
2159  !JsonHelper::Member_ToJson(json, flags, allocator, "ratio", data.ratio)) return false;
2160  if (!JsonHelper::Member_ToJson(json, flags, allocator, "attack", data.attack)) return false;
2161  if (!JsonHelper::Member_ToJson(json, flags, allocator, "release", data.release)) return false;
2162  if (!JsonHelper::Member_ToJson(json, flags, allocator, "sustain", data.sustain)) return false;
2163  if ((flags & JSON_CVT_WITHDEV) &&
2164  !JsonHelper::Member_ToJson(json, flags, allocator, "autoatt_mode", data.autoatt_mode)) return false;
2165  if ((flags & JSON_CVT_WITHDEV) &&
2166  !JsonHelper::Member_ToJson(json, flags, allocator, "autoatt_max", data.autoatt_max)) return false;
2167  if ((flags & JSON_CVT_WITHDEV) &&
2168  !JsonHelper::Member_ToJson(json, flags, allocator, "autoatt_start", data.autoatt_start)) return false;
2169  if ((flags & JSON_CVT_WITHDEV) &&
2170  !JsonHelper::Member_ToJson(json, flags, allocator, "autoatt_stop", data.autoatt_stop)) return false;
2171  if ((flags & JSON_CVT_WITHDEV) &&
2172  !JsonHelper::Member_ToJson(json, flags, allocator, "autoatt_sym", data.autoatt_sym)) return false;
2173  if ((flags & JSON_CVT_WITHDEV) &&
2174  !JsonHelper::Member_ToJson(json, flags, allocator, "nbperiod", data.nbperiod)) return false;
2175  if ((flags & JSON_CVT_WITHDEV) &&
2176  !JsonHelper::Member_ToJson(json, flags, allocator, "smooth_agc", data.smooth_agc)) return false;
2177  if ((flags & JSON_CVT_WITHDEV) &&
2178  !JsonHelper::Member_ToJson(json, flags, allocator, "impact", data.impact)) return false;
2179  if ((flags & JSON_CVT_WITHDEV) &&
2180  !JsonHelper::Member_ToJson(json, flags, allocator, "avg_speed_gain", data.avg_speed_gain)) return false;
2181  if ((flags & JSON_CVT_WITHDEV) &&
2182  !JsonHelper::Member_ToJson(json, flags, allocator, "avg_speed_in", data.avg_speed_in)) return false;
2183  if ((flags & JSON_CVT_WITHDEV) &&
2184  !JsonHelper::Member_ToJson(json, flags, allocator, "ref_speed_in", data.ref_speed_in)) return false;
2185  if ((flags & JSON_CVT_WITHDEV) &&
2186  !JsonHelper::Member_ToJson(json, flags, allocator, "attack_min", data.attack_min)) return false;
2187  if ((flags & JSON_CVT_WITHDEV) &&
2188  !JsonHelper::Member_ToJson(json, flags, allocator, "attack_max", data.attack_max)) return false;
2189  if (!JsonHelper::Member_ToJson(json, flags, allocator, "voicethres", data.voicethres)) return false;
2190  if (!JsonHelper::Member_ToJson(json, flags, allocator, "peak_mode", data.peak_mode)) return false;
2191  if (json.MemberCount()==0) json.SetNull();
2192  return true;
2193  }
2194 
2195  static bool DiffToJson(JSON_Value &json, const json_agcwide& data [[maybe_unused]], json_agcwide& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2196  if (sizeof(json_agcwide)==0) return true; // quick empty struct
2197  if (json.IsNull ()) {
2198  json.SetObject ();
2199  flags &= ~JSON_CVT_ONLYREQ; // children get all
2200  } else if (!json.IsObject()) {
2201  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2202  return false;
2203  }
2204  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "on", data.on, ref.on)) return false;
2205  if ((flags & JSON_CVT_WITHDEV) &&
2206  !JsonHelper::Member_DiffToJson(json, flags, allocator, "hp_on", data.hp_on, ref.hp_on)) return false;
2207  if ((flags & JSON_CVT_WITHDEV) &&
2208  !JsonHelper::Member_DiffToJson(json, flags, allocator, "hp_freq", data.hp_freq, ref.hp_freq)) return false;
2209  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gate_on", data.gate_on, ref.gate_on)) return false;
2210  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gate", data.gate, ref.gate)) return false;
2211  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "drive_on", data.drive_on, ref.drive_on)) return false;
2212  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "drive", data.drive, ref.drive)) return false;
2213  if ((flags & JSON_CVT_WITHDEV) &&
2214  !JsonHelper::Member_DiffToJson(json, flags, allocator, "threshold", data.threshold, ref.threshold)) return false;
2215  if ((flags & JSON_CVT_WITHDEV) &&
2216  !JsonHelper::Member_DiffToJson(json, flags, allocator, "postgain", data.postgain, ref.postgain)) return false;
2217  if ((flags & JSON_CVT_WITHDEV) &&
2218  !JsonHelper::Member_DiffToJson(json, flags, allocator, "ratio", data.ratio, ref.ratio)) return false;
2219  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "attack", data.attack, ref.attack)) return false;
2220  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "release", data.release, ref.release)) return false;
2221  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "sustain", data.sustain, ref.sustain)) return false;
2222  if ((flags & JSON_CVT_WITHDEV) &&
2223  !JsonHelper::Member_DiffToJson(json, flags, allocator, "autoatt_mode", data.autoatt_mode, ref.autoatt_mode)) return false;
2224  if ((flags & JSON_CVT_WITHDEV) &&
2225  !JsonHelper::Member_DiffToJson(json, flags, allocator, "autoatt_max", data.autoatt_max, ref.autoatt_max)) return false;
2226  if ((flags & JSON_CVT_WITHDEV) &&
2227  !JsonHelper::Member_DiffToJson(json, flags, allocator, "autoatt_start", data.autoatt_start, ref.autoatt_start)) return false;
2228  if ((flags & JSON_CVT_WITHDEV) &&
2229  !JsonHelper::Member_DiffToJson(json, flags, allocator, "autoatt_stop", data.autoatt_stop, ref.autoatt_stop)) return false;
2230  if ((flags & JSON_CVT_WITHDEV) &&
2231  !JsonHelper::Member_DiffToJson(json, flags, allocator, "autoatt_sym", data.autoatt_sym, ref.autoatt_sym)) return false;
2232  if ((flags & JSON_CVT_WITHDEV) &&
2233  !JsonHelper::Member_DiffToJson(json, flags, allocator, "nbperiod", data.nbperiod, ref.nbperiod)) return false;
2234  if ((flags & JSON_CVT_WITHDEV) &&
2235  !JsonHelper::Member_DiffToJson(json, flags, allocator, "smooth_agc", data.smooth_agc, ref.smooth_agc)) return false;
2236  if ((flags & JSON_CVT_WITHDEV) &&
2237  !JsonHelper::Member_DiffToJson(json, flags, allocator, "impact", data.impact, ref.impact)) return false;
2238  if ((flags & JSON_CVT_WITHDEV) &&
2239  !JsonHelper::Member_DiffToJson(json, flags, allocator, "avg_speed_gain", data.avg_speed_gain, ref.avg_speed_gain)) return false;
2240  if ((flags & JSON_CVT_WITHDEV) &&
2241  !JsonHelper::Member_DiffToJson(json, flags, allocator, "avg_speed_in", data.avg_speed_in, ref.avg_speed_in)) return false;
2242  if ((flags & JSON_CVT_WITHDEV) &&
2243  !JsonHelper::Member_DiffToJson(json, flags, allocator, "ref_speed_in", data.ref_speed_in, ref.ref_speed_in)) return false;
2244  if ((flags & JSON_CVT_WITHDEV) &&
2245  !JsonHelper::Member_DiffToJson(json, flags, allocator, "attack_min", data.attack_min, ref.attack_min)) return false;
2246  if ((flags & JSON_CVT_WITHDEV) &&
2247  !JsonHelper::Member_DiffToJson(json, flags, allocator, "attack_max", data.attack_max, ref.attack_max)) return false;
2248  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "voicethres", data.voicethres, ref.voicethres)) return false;
2249  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "peak_mode", data.peak_mode, ref.peak_mode)) return false;
2250  if (json.MemberCount()==0) json.SetNull();
2251  return true;
2252  }
2253 
2254  static void ForceChange(const json_agcwide& data [[maybe_unused]], json_agcwide& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2255  JsonHelper::Member_ForceChange(allocator, "on", data.on, ref.on);
2256  JsonHelper::Member_ForceChange(allocator, "hp_on", data.hp_on, ref.hp_on);
2257  JsonHelper::Member_ForceChange(allocator, "hp_freq", data.hp_freq, ref.hp_freq);
2258  JsonHelper::Member_ForceChange(allocator, "gate_on", data.gate_on, ref.gate_on);
2259  JsonHelper::Member_ForceChange(allocator, "gate", data.gate, ref.gate);
2260  JsonHelper::Member_ForceChange(allocator, "drive_on", data.drive_on, ref.drive_on);
2261  JsonHelper::Member_ForceChange(allocator, "drive", data.drive, ref.drive);
2262  JsonHelper::Member_ForceChange(allocator, "threshold", data.threshold, ref.threshold);
2263  JsonHelper::Member_ForceChange(allocator, "postgain", data.postgain, ref.postgain);
2264  JsonHelper::Member_ForceChange(allocator, "ratio", data.ratio, ref.ratio);
2265  JsonHelper::Member_ForceChange(allocator, "attack", data.attack, ref.attack);
2266  JsonHelper::Member_ForceChange(allocator, "release", data.release, ref.release);
2267  JsonHelper::Member_ForceChange(allocator, "sustain", data.sustain, ref.sustain);
2268  JsonHelper::Member_ForceChange(allocator, "autoatt_mode", data.autoatt_mode, ref.autoatt_mode);
2269  JsonHelper::Member_ForceChange(allocator, "autoatt_max", data.autoatt_max, ref.autoatt_max);
2270  JsonHelper::Member_ForceChange(allocator, "autoatt_start", data.autoatt_start, ref.autoatt_start);
2271  JsonHelper::Member_ForceChange(allocator, "autoatt_stop", data.autoatt_stop, ref.autoatt_stop);
2272  JsonHelper::Member_ForceChange(allocator, "autoatt_sym", data.autoatt_sym, ref.autoatt_sym);
2273  JsonHelper::Member_ForceChange(allocator, "nbperiod", data.nbperiod, ref.nbperiod);
2274  JsonHelper::Member_ForceChange(allocator, "smooth_agc", data.smooth_agc, ref.smooth_agc);
2275  JsonHelper::Member_ForceChange(allocator, "impact", data.impact, ref.impact);
2276  JsonHelper::Member_ForceChange(allocator, "avg_speed_gain", data.avg_speed_gain, ref.avg_speed_gain);
2277  JsonHelper::Member_ForceChange(allocator, "avg_speed_in", data.avg_speed_in, ref.avg_speed_in);
2278  JsonHelper::Member_ForceChange(allocator, "ref_speed_in", data.ref_speed_in, ref.ref_speed_in);
2279  JsonHelper::Member_ForceChange(allocator, "attack_min", data.attack_min, ref.attack_min);
2280  JsonHelper::Member_ForceChange(allocator, "attack_max", data.attack_max, ref.attack_max);
2281  JsonHelper::Member_ForceChange(allocator, "voicethres", data.voicethres, ref.voicethres);
2282  JsonHelper::Member_ForceChange(allocator, "peak_mode", data.peak_mode, ref.peak_mode);
2283  }
2284 
2285  };
2286  // === VU ===
2287  template <>
2288  struct JsonConvert<jsonvu_agcwide> {
2289 
2290  /* VU have no FromJson */
2291 
2292  static bool ToJson(JSON_Value &json, const jsonvu_agcwide& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2293  if (sizeof(jsonvu_agcwide)==0) return true; // quick empty struct
2294  if (json.IsNull ()) {
2295  json.SetObject ();
2296  flags &= ~JSON_CVT_ONLYREQ; // children get all
2297  } else if (!json.IsObject()) {
2298  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2299  return false;
2300  }
2301  if (!JsonHelper::Member_ToJson(json, flags, allocator, "in", data.in)) return false;
2302  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gated", data.gated)) return false;
2303  if ((flags & JSON_CVT_WITHDEV) &&
2304  !JsonHelper::Member_ToJson(json, flags, allocator, "mes_in", data.mes_in)) return false;
2305  if ((flags & JSON_CVT_WITHDEV) &&
2306  !JsonHelper::Member_ToJson(json, flags, allocator, "in_avg", data.in_avg)) return false;
2307  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gain", data.gain)) return false;
2308  if (!JsonHelper::Member_ToJson(json, flags, allocator, "out", data.out)) return false;
2309  if ((flags & JSON_CVT_WITHDEV) &&
2310  !JsonHelper::Member_ToJson(json, flags, allocator, "gain_avg", data.gain_avg)) return false;
2311  if ((flags & JSON_CVT_WITHDEV) &&
2312  !JsonHelper::Member_ToJson(json, flags, allocator, "attack_vu", data.attack_vu)) return false;
2313  if (!JsonHelper::Member_ToJson(json, flags, allocator, "attack_min_vu", data.attack_min_vu)) return false;
2314  if (!JsonHelper::Member_ToJson(json, flags, allocator, "attack_max_vu", data.attack_max_vu)) return false;
2315  if (!JsonHelper::Member_ToJson(json, flags, allocator, "vu_on", data.vu_on)) return false;
2316  if (json.MemberCount()==0) json.SetNull();
2317  return true;
2318  }
2319 
2320  static bool DiffToJson(JSON_Value &json, const jsonvu_agcwide& data [[maybe_unused]], jsonvu_agcwide& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2321  if (sizeof(jsonvu_agcwide)==0) return true; // quick empty struct
2322  if (json.IsNull ()) {
2323  json.SetObject ();
2324  flags &= ~JSON_CVT_ONLYREQ; // children get all
2325  } else if (!json.IsObject()) {
2326  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2327  return false;
2328  }
2329  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "in", data.in, ref.in)) return false;
2330  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gated", data.gated, ref.gated)) return false;
2331  if ((flags & JSON_CVT_WITHDEV) &&
2332  !JsonHelper::Member_DiffToJson(json, flags, allocator, "mes_in", data.mes_in, ref.mes_in)) return false;
2333  if ((flags & JSON_CVT_WITHDEV) &&
2334  !JsonHelper::Member_DiffToJson(json, flags, allocator, "in_avg", data.in_avg, ref.in_avg)) return false;
2335  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gain", data.gain, ref.gain)) return false;
2336  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "out", data.out, ref.out)) return false;
2337  if ((flags & JSON_CVT_WITHDEV) &&
2338  !JsonHelper::Member_DiffToJson(json, flags, allocator, "gain_avg", data.gain_avg, ref.gain_avg)) return false;
2339  if ((flags & JSON_CVT_WITHDEV) &&
2340  !JsonHelper::Member_DiffToJson(json, flags, allocator, "attack_vu", data.attack_vu, ref.attack_vu)) return false;
2341  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "attack_min_vu", data.attack_min_vu, ref.attack_min_vu)) return false;
2342  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "attack_max_vu", data.attack_max_vu, ref.attack_max_vu)) return false;
2343  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "vu_on", data.vu_on, ref.vu_on)) return false;
2344  if (json.MemberCount()==0) json.SetNull();
2345  return true;
2346  }
2347 
2348  static void ForceChange(const jsonvu_agcwide& data [[maybe_unused]], jsonvu_agcwide& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2349  JsonHelper::Member_ForceChange(allocator, "in", data.in, ref.in);
2350  JsonHelper::Member_ForceChange(allocator, "gated", data.gated, ref.gated);
2351  JsonHelper::Member_ForceChange(allocator, "mes_in", data.mes_in, ref.mes_in);
2352  JsonHelper::Member_ForceChange(allocator, "in_avg", data.in_avg, ref.in_avg);
2353  JsonHelper::Member_ForceChange(allocator, "gain", data.gain, ref.gain);
2354  JsonHelper::Member_ForceChange(allocator, "out", data.out, ref.out);
2355  JsonHelper::Member_ForceChange(allocator, "gain_avg", data.gain_avg, ref.gain_avg);
2356  JsonHelper::Member_ForceChange(allocator, "attack_vu", data.attack_vu, ref.attack_vu);
2357  JsonHelper::Member_ForceChange(allocator, "attack_min_vu", data.attack_min_vu, ref.attack_min_vu);
2358  JsonHelper::Member_ForceChange(allocator, "attack_max_vu", data.attack_max_vu, ref.attack_max_vu);
2359  JsonHelper::Member_ForceChange(allocator, "vu_on", data.vu_on, ref.vu_on);
2360  }
2361 
2362  };
2363 // === object tonefx ===
2364  // === Preset ===
2365  template <>
2366  struct JsonConvert<json_tonefx> {
2367 
2368  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>()) {
2369  if (sizeof(json_tonefx)==0) return true; // quick empty struct
2370  if (json.IsNull()) { return true; }
2371  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
2372  if ( !JsonHelper::Member_FromJson(json, flags, "on", data.on, allocator)) return false;
2373  if ( !JsonHelper::Member_FromJson(json, flags, "eq_on", data.eq_on, allocator)) return false;
2374  if ( !JsonHelper::Member_FromJson(json, flags, "eq_freq", data.eq_freq, allocator, JsonConstraint<S4Float>(20,22000))) return false;
2375  if ( !JsonHelper::Member_FromJson(json, flags, "eq_Q", data.eq_Q, allocator, JsonConstraint<S4Float>(0.01,60.))) return false;
2376  if ( !JsonHelper::Member_FromJson(json, flags, "eq_gain", data.eq_gain, allocator, JsonConstraint<S4Float>(-12,12))) return false;
2377  if ( !JsonHelper::Member_FromJson(json, flags, "bass_on", data.bass_on, allocator)) return false;
2378  if ( !JsonHelper::Member_FromJson(json, flags, "bass_gain", data.bass_gain, allocator, JsonConstraint<S4Float>(0,20))) return false;
2379  if ((flags & JSON_CVT_WITHDEV) &&
2380  !JsonHelper::Member_FromJson(json, flags, "bass_gain_max", data.bass_gain_max, allocator, JsonConstraint<S4Float>(0,20))) return false;
2381  if ((flags & JSON_CVT_WITHDEV) &&
2382  !JsonHelper::Member_FromJson(json, flags, "bass_freq", data.bass_freq, allocator, JsonConstraint<S4Float>(20,20000))) return false;
2383  if ((flags & JSON_CVT_WITHDEV) &&
2384  !JsonHelper::Member_FromJson(json, flags, "bass_fix_mode", data.bass_fix_mode, allocator)) return false;
2385  if ((flags & JSON_CVT_WITHDEV) &&
2386  !JsonHelper::Member_FromJson(json, flags, "bass_efficiency", data.bass_efficiency, allocator, JsonConstraint<S4Float>(0,100))) return false;
2387  if ((flags & JSON_CVT_WITHDEV) &&
2388  !JsonHelper::Member_FromJson(json, flags, "bass_threshold", data.bass_threshold, allocator, JsonConstraint<S4Float>(-30,30))) return false;
2389  if ((flags & JSON_CVT_WITHDEV) &&
2390  !JsonHelper::Member_FromJson(json, flags, "bass_attack", data.bass_attack, allocator, JsonConstraint<S4Float>(0.1,320))) return false;
2391  if ((flags & JSON_CVT_WITHDEV) &&
2392  !JsonHelper::Member_FromJson(json, flags, "bass_release", data.bass_release, allocator, JsonConstraint<S4Float>(0.1,320))) return false;
2393  if ( !JsonHelper::Member_FromJson(json, flags, "treble_on", data.treble_on, allocator)) return false;
2394  if ( !JsonHelper::Member_FromJson(json, flags, "treble_value", data.treble_value, allocator, JsonConstraint<S4Float>(0,20))) return false;
2395  if ((flags & JSON_CVT_WITHDEV) &&
2396  !JsonHelper::Member_FromJson(json, flags, "treble_value_max", data.treble_value_max, allocator, JsonConstraint<S4Float>(0,20))) return false;
2397  if ((flags & JSON_CVT_WITHDEV) &&
2398  !JsonHelper::Member_FromJson(json, flags, "treble_range", data.treble_range, allocator, JsonConstraint<S4Float>(0,100))) return false;
2399  return true;
2400  }
2401 
2402  static bool ToJson(JSON_Value &json, const json_tonefx& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2403  if (sizeof(json_tonefx)==0) return true; // quick empty struct
2404  if (json.IsNull ()) {
2405  json.SetObject ();
2406  flags &= ~JSON_CVT_ONLYREQ; // children get all
2407  } else if (!json.IsObject()) {
2408  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2409  return false;
2410  }
2411  if (!JsonHelper::Member_ToJson(json, flags, allocator, "on", data.on)) return false;
2412  if (!JsonHelper::Member_ToJson(json, flags, allocator, "eq_on", data.eq_on)) return false;
2413  if (!JsonHelper::Member_ToJson(json, flags, allocator, "eq_freq", data.eq_freq)) return false;
2414  if (!JsonHelper::Member_ToJson(json, flags, allocator, "eq_Q", data.eq_Q)) return false;
2415  if (!JsonHelper::Member_ToJson(json, flags, allocator, "eq_gain", data.eq_gain)) return false;
2416  if (!JsonHelper::Member_ToJson(json, flags, allocator, "bass_on", data.bass_on)) return false;
2417  if (!JsonHelper::Member_ToJson(json, flags, allocator, "bass_gain", data.bass_gain)) return false;
2418  if ((flags & JSON_CVT_WITHDEV) &&
2419  !JsonHelper::Member_ToJson(json, flags, allocator, "bass_gain_max", data.bass_gain_max)) return false;
2420  if ((flags & JSON_CVT_WITHDEV) &&
2421  !JsonHelper::Member_ToJson(json, flags, allocator, "bass_freq", data.bass_freq)) return false;
2422  if ((flags & JSON_CVT_WITHDEV) &&
2423  !JsonHelper::Member_ToJson(json, flags, allocator, "bass_fix_mode", data.bass_fix_mode)) return false;
2424  if ((flags & JSON_CVT_WITHDEV) &&
2425  !JsonHelper::Member_ToJson(json, flags, allocator, "bass_efficiency", data.bass_efficiency)) return false;
2426  if ((flags & JSON_CVT_WITHDEV) &&
2427  !JsonHelper::Member_ToJson(json, flags, allocator, "bass_threshold", data.bass_threshold)) return false;
2428  if ((flags & JSON_CVT_WITHDEV) &&
2429  !JsonHelper::Member_ToJson(json, flags, allocator, "bass_attack", data.bass_attack)) return false;
2430  if ((flags & JSON_CVT_WITHDEV) &&
2431  !JsonHelper::Member_ToJson(json, flags, allocator, "bass_release", data.bass_release)) return false;
2432  if (!JsonHelper::Member_ToJson(json, flags, allocator, "treble_on", data.treble_on)) return false;
2433  if (!JsonHelper::Member_ToJson(json, flags, allocator, "treble_value", data.treble_value)) return false;
2434  if ((flags & JSON_CVT_WITHDEV) &&
2435  !JsonHelper::Member_ToJson(json, flags, allocator, "treble_value_max", data.treble_value_max)) return false;
2436  if ((flags & JSON_CVT_WITHDEV) &&
2437  !JsonHelper::Member_ToJson(json, flags, allocator, "treble_range", data.treble_range)) return false;
2438  if (json.MemberCount()==0) json.SetNull();
2439  return true;
2440  }
2441 
2442  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]]) {
2443  if (sizeof(json_tonefx)==0) return true; // quick empty struct
2444  if (json.IsNull ()) {
2445  json.SetObject ();
2446  flags &= ~JSON_CVT_ONLYREQ; // children get all
2447  } else if (!json.IsObject()) {
2448  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2449  return false;
2450  }
2451  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "on", data.on, ref.on)) return false;
2452  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "eq_on", data.eq_on, ref.eq_on)) return false;
2453  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "eq_freq", data.eq_freq, ref.eq_freq)) return false;
2454  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "eq_Q", data.eq_Q, ref.eq_Q)) return false;
2455  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "eq_gain", data.eq_gain, ref.eq_gain)) return false;
2456  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "bass_on", data.bass_on, ref.bass_on)) return false;
2457  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "bass_gain", data.bass_gain, ref.bass_gain)) return false;
2458  if ((flags & JSON_CVT_WITHDEV) &&
2459  !JsonHelper::Member_DiffToJson(json, flags, allocator, "bass_gain_max", data.bass_gain_max, ref.bass_gain_max)) return false;
2460  if ((flags & JSON_CVT_WITHDEV) &&
2461  !JsonHelper::Member_DiffToJson(json, flags, allocator, "bass_freq", data.bass_freq, ref.bass_freq)) return false;
2462  if ((flags & JSON_CVT_WITHDEV) &&
2463  !JsonHelper::Member_DiffToJson(json, flags, allocator, "bass_fix_mode", data.bass_fix_mode, ref.bass_fix_mode)) return false;
2464  if ((flags & JSON_CVT_WITHDEV) &&
2465  !JsonHelper::Member_DiffToJson(json, flags, allocator, "bass_efficiency", data.bass_efficiency, ref.bass_efficiency)) return false;
2466  if ((flags & JSON_CVT_WITHDEV) &&
2467  !JsonHelper::Member_DiffToJson(json, flags, allocator, "bass_threshold", data.bass_threshold, ref.bass_threshold)) return false;
2468  if ((flags & JSON_CVT_WITHDEV) &&
2469  !JsonHelper::Member_DiffToJson(json, flags, allocator, "bass_attack", data.bass_attack, ref.bass_attack)) return false;
2470  if ((flags & JSON_CVT_WITHDEV) &&
2471  !JsonHelper::Member_DiffToJson(json, flags, allocator, "bass_release", data.bass_release, ref.bass_release)) return false;
2472  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "treble_on", data.treble_on, ref.treble_on)) return false;
2473  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "treble_value", data.treble_value, ref.treble_value)) return false;
2474  if ((flags & JSON_CVT_WITHDEV) &&
2475  !JsonHelper::Member_DiffToJson(json, flags, allocator, "treble_value_max", data.treble_value_max, ref.treble_value_max)) return false;
2476  if ((flags & JSON_CVT_WITHDEV) &&
2477  !JsonHelper::Member_DiffToJson(json, flags, allocator, "treble_range", data.treble_range, ref.treble_range)) return false;
2478  if (json.MemberCount()==0) json.SetNull();
2479  return true;
2480  }
2481 
2482  static void ForceChange(const json_tonefx& data [[maybe_unused]], json_tonefx& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2483  JsonHelper::Member_ForceChange(allocator, "on", data.on, ref.on);
2484  JsonHelper::Member_ForceChange(allocator, "eq_on", data.eq_on, ref.eq_on);
2485  JsonHelper::Member_ForceChange(allocator, "eq_freq", data.eq_freq, ref.eq_freq);
2486  JsonHelper::Member_ForceChange(allocator, "eq_Q", data.eq_Q, ref.eq_Q);
2487  JsonHelper::Member_ForceChange(allocator, "eq_gain", data.eq_gain, ref.eq_gain);
2488  JsonHelper::Member_ForceChange(allocator, "bass_on", data.bass_on, ref.bass_on);
2489  JsonHelper::Member_ForceChange(allocator, "bass_gain", data.bass_gain, ref.bass_gain);
2490  JsonHelper::Member_ForceChange(allocator, "bass_gain_max", data.bass_gain_max, ref.bass_gain_max);
2491  JsonHelper::Member_ForceChange(allocator, "bass_freq", data.bass_freq, ref.bass_freq);
2492  JsonHelper::Member_ForceChange(allocator, "bass_fix_mode", data.bass_fix_mode, ref.bass_fix_mode);
2493  JsonHelper::Member_ForceChange(allocator, "bass_efficiency", data.bass_efficiency, ref.bass_efficiency);
2494  JsonHelper::Member_ForceChange(allocator, "bass_threshold", data.bass_threshold, ref.bass_threshold);
2495  JsonHelper::Member_ForceChange(allocator, "bass_attack", data.bass_attack, ref.bass_attack);
2496  JsonHelper::Member_ForceChange(allocator, "bass_release", data.bass_release, ref.bass_release);
2497  JsonHelper::Member_ForceChange(allocator, "treble_on", data.treble_on, ref.treble_on);
2498  JsonHelper::Member_ForceChange(allocator, "treble_value", data.treble_value, ref.treble_value);
2499  JsonHelper::Member_ForceChange(allocator, "treble_value_max", data.treble_value_max, ref.treble_value_max);
2500  JsonHelper::Member_ForceChange(allocator, "treble_range", data.treble_range, ref.treble_range);
2501  }
2502 
2503  };
2504  // === VU ===
2505  template <>
2506  struct JsonConvert<jsonvu_tonefx> {
2507 
2508  /* VU have no FromJson */
2509 
2510  static bool ToJson(JSON_Value &json, const jsonvu_tonefx& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2511  if (sizeof(jsonvu_tonefx)==0) return true; // quick empty struct
2512  if (json.IsNull ()) {
2513  json.SetObject ();
2514  flags &= ~JSON_CVT_ONLYREQ; // children get all
2515  } else if (!json.IsObject()) {
2516  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2517  return false;
2518  }
2519  if (!JsonHelper::Member_ToJson(json, flags, allocator, "bass_vu", data.bass_vu)) return false;
2520  if (!JsonHelper::Member_ToJson(json, flags, allocator, "bass_gain_max_vu", data.bass_gain_max_vu)) return false;
2521  if (!JsonHelper::Member_ToJson(json, flags, allocator, "treble_value_max_vu", data.treble_value_max_vu)) return false;
2522  if (json.MemberCount()==0) json.SetNull();
2523  return true;
2524  }
2525 
2526  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]]) {
2527  if (sizeof(jsonvu_tonefx)==0) return true; // quick empty struct
2528  if (json.IsNull ()) {
2529  json.SetObject ();
2530  flags &= ~JSON_CVT_ONLYREQ; // children get all
2531  } else if (!json.IsObject()) {
2532  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2533  return false;
2534  }
2535  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "bass_vu", data.bass_vu, ref.bass_vu)) return false;
2536  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "bass_gain_max_vu", data.bass_gain_max_vu, ref.bass_gain_max_vu)) return false;
2537  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "treble_value_max_vu", data.treble_value_max_vu, ref.treble_value_max_vu)) return false;
2538  if (json.MemberCount()==0) json.SetNull();
2539  return true;
2540  }
2541 
2542  static void ForceChange(const jsonvu_tonefx& data [[maybe_unused]], jsonvu_tonefx& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2543  JsonHelper::Member_ForceChange(allocator, "bass_vu", data.bass_vu, ref.bass_vu);
2544  JsonHelper::Member_ForceChange(allocator, "bass_gain_max_vu", data.bass_gain_max_vu, ref.bass_gain_max_vu);
2545  JsonHelper::Member_ForceChange(allocator, "treble_value_max_vu", data.treble_value_max_vu, ref.treble_value_max_vu);
2546  }
2547 
2548  };
2549 // === object stereofx ===
2550  // === Preset ===
2551  template <>
2552  struct JsonConvert<json_stereofx> {
2553 
2554  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>()) {
2555  if (sizeof(json_stereofx)==0) return true; // quick empty struct
2556  if (json.IsNull()) { return true; }
2557  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
2558  if ( !JsonHelper::Member_FromJson(json, flags, "on", data.on, allocator)) return false;
2559  if ( !JsonHelper::Member_FromJson(json, flags, "enh_on", data.enh_on, allocator)) return false;
2560  if ( !JsonHelper::Member_FromJson(json, flags, "enh_width", data.enh_width, allocator, JsonConstraint<S4Float>(0,100))) return false;
2561  if ((flags & JSON_CVT_WITHDEV) &&
2562  !JsonHelper::Member_FromJson(json, flags, "enh_attack", data.enh_attack, allocator, JsonConstraint<S4Float>(0,100.00))) return false;
2563  if ((flags & JSON_CVT_WITHDEV) &&
2564  !JsonHelper::Member_FromJson(json, flags, "enh_release", data.enh_release, allocator, JsonConstraint<S4Float>(0,100.00))) return false;
2565  if ((flags & JSON_CVT_WITHDEV) &&
2566  !JsonHelper::Member_FromJson(json, flags, "enh_threshold", data.enh_threshold, allocator, JsonConstraint<S4Float>(-100,0))) return false;
2567  if ((flags & JSON_CVT_WITHDEV) &&
2568  !JsonHelper::Member_FromJson(json, flags, "enh_thresLR", data.enh_thresLR, allocator, JsonConstraint<S4Float>(-100,0))) return false;
2569  if ( !JsonHelper::Member_FromJson(json, flags, "lim_on", data.lim_on, allocator)) return false;
2570  if ( !JsonHelper::Member_FromJson(json, flags, "lim_threshold", data.lim_threshold, allocator, JsonConstraint<S4Float>(0,100))) return false;
2571  if ((flags & JSON_CVT_WITHDEV) &&
2572  !JsonHelper::Member_FromJson(json, flags, "lim_attack", data.lim_attack, allocator, JsonConstraint<S4Float>(1,32000.00))) return false;
2573  if ((flags & JSON_CVT_WITHDEV) &&
2574  !JsonHelper::Member_FromJson(json, flags, "lim_release", data.lim_release, allocator, JsonConstraint<S4Float>(1,320.00))) return false;
2575  if ((flags & JSON_CVT_WITHDEV) &&
2576  !JsonHelper::Member_FromJson(json, flags, "clean_on", data.clean_on, allocator)) return false;
2577  if ((flags & JSON_CVT_WITHDEV) &&
2578  !JsonHelper::Member_FromJson(json, flags, "clean_threshold", data.clean_threshold, allocator, JsonConstraint<S4Float>(0,100))) return false;
2579  if ((flags & JSON_CVT_WITHDEV) &&
2580  !JsonHelper::Member_FromJson(json, flags, "clean_release", data.clean_release, allocator, JsonConstraint<S4Float>(0,320.00))) return false;
2581  return true;
2582  }
2583 
2584  static bool ToJson(JSON_Value &json, const json_stereofx& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2585  if (sizeof(json_stereofx)==0) return true; // quick empty struct
2586  if (json.IsNull ()) {
2587  json.SetObject ();
2588  flags &= ~JSON_CVT_ONLYREQ; // children get all
2589  } else if (!json.IsObject()) {
2590  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2591  return false;
2592  }
2593  if (!JsonHelper::Member_ToJson(json, flags, allocator, "on", data.on)) return false;
2594  if (!JsonHelper::Member_ToJson(json, flags, allocator, "enh_on", data.enh_on)) return false;
2595  if (!JsonHelper::Member_ToJson(json, flags, allocator, "enh_width", data.enh_width)) return false;
2596  if ((flags & JSON_CVT_WITHDEV) &&
2597  !JsonHelper::Member_ToJson(json, flags, allocator, "enh_attack", data.enh_attack)) return false;
2598  if ((flags & JSON_CVT_WITHDEV) &&
2599  !JsonHelper::Member_ToJson(json, flags, allocator, "enh_release", data.enh_release)) return false;
2600  if ((flags & JSON_CVT_WITHDEV) &&
2601  !JsonHelper::Member_ToJson(json, flags, allocator, "enh_threshold", data.enh_threshold)) return false;
2602  if ((flags & JSON_CVT_WITHDEV) &&
2603  !JsonHelper::Member_ToJson(json, flags, allocator, "enh_thresLR", data.enh_thresLR)) return false;
2604  if (!JsonHelper::Member_ToJson(json, flags, allocator, "lim_on", data.lim_on)) return false;
2605  if (!JsonHelper::Member_ToJson(json, flags, allocator, "lim_threshold", data.lim_threshold)) return false;
2606  if ((flags & JSON_CVT_WITHDEV) &&
2607  !JsonHelper::Member_ToJson(json, flags, allocator, "lim_attack", data.lim_attack)) return false;
2608  if ((flags & JSON_CVT_WITHDEV) &&
2609  !JsonHelper::Member_ToJson(json, flags, allocator, "lim_release", data.lim_release)) return false;
2610  if ((flags & JSON_CVT_WITHDEV) &&
2611  !JsonHelper::Member_ToJson(json, flags, allocator, "clean_on", data.clean_on)) return false;
2612  if ((flags & JSON_CVT_WITHDEV) &&
2613  !JsonHelper::Member_ToJson(json, flags, allocator, "clean_threshold", data.clean_threshold)) return false;
2614  if ((flags & JSON_CVT_WITHDEV) &&
2615  !JsonHelper::Member_ToJson(json, flags, allocator, "clean_release", data.clean_release)) return false;
2616  if (json.MemberCount()==0) json.SetNull();
2617  return true;
2618  }
2619 
2620  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]]) {
2621  if (sizeof(json_stereofx)==0) return true; // quick empty struct
2622  if (json.IsNull ()) {
2623  json.SetObject ();
2624  flags &= ~JSON_CVT_ONLYREQ; // children get all
2625  } else if (!json.IsObject()) {
2626  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2627  return false;
2628  }
2629  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "on", data.on, ref.on)) return false;
2630  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "enh_on", data.enh_on, ref.enh_on)) return false;
2631  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "enh_width", data.enh_width, ref.enh_width)) return false;
2632  if ((flags & JSON_CVT_WITHDEV) &&
2633  !JsonHelper::Member_DiffToJson(json, flags, allocator, "enh_attack", data.enh_attack, ref.enh_attack)) return false;
2634  if ((flags & JSON_CVT_WITHDEV) &&
2635  !JsonHelper::Member_DiffToJson(json, flags, allocator, "enh_release", data.enh_release, ref.enh_release)) return false;
2636  if ((flags & JSON_CVT_WITHDEV) &&
2637  !JsonHelper::Member_DiffToJson(json, flags, allocator, "enh_threshold", data.enh_threshold, ref.enh_threshold)) return false;
2638  if ((flags & JSON_CVT_WITHDEV) &&
2639  !JsonHelper::Member_DiffToJson(json, flags, allocator, "enh_thresLR", data.enh_thresLR, ref.enh_thresLR)) return false;
2640  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "lim_on", data.lim_on, ref.lim_on)) return false;
2641  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "lim_threshold", data.lim_threshold, ref.lim_threshold)) return false;
2642  if ((flags & JSON_CVT_WITHDEV) &&
2643  !JsonHelper::Member_DiffToJson(json, flags, allocator, "lim_attack", data.lim_attack, ref.lim_attack)) return false;
2644  if ((flags & JSON_CVT_WITHDEV) &&
2645  !JsonHelper::Member_DiffToJson(json, flags, allocator, "lim_release", data.lim_release, ref.lim_release)) return false;
2646  if ((flags & JSON_CVT_WITHDEV) &&
2647  !JsonHelper::Member_DiffToJson(json, flags, allocator, "clean_on", data.clean_on, ref.clean_on)) return false;
2648  if ((flags & JSON_CVT_WITHDEV) &&
2649  !JsonHelper::Member_DiffToJson(json, flags, allocator, "clean_threshold", data.clean_threshold, ref.clean_threshold)) return false;
2650  if ((flags & JSON_CVT_WITHDEV) &&
2651  !JsonHelper::Member_DiffToJson(json, flags, allocator, "clean_release", data.clean_release, ref.clean_release)) return false;
2652  if (json.MemberCount()==0) json.SetNull();
2653  return true;
2654  }
2655 
2656  static void ForceChange(const json_stereofx& data [[maybe_unused]], json_stereofx& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2657  JsonHelper::Member_ForceChange(allocator, "on", data.on, ref.on);
2658  JsonHelper::Member_ForceChange(allocator, "enh_on", data.enh_on, ref.enh_on);
2659  JsonHelper::Member_ForceChange(allocator, "enh_width", data.enh_width, ref.enh_width);
2660  JsonHelper::Member_ForceChange(allocator, "enh_attack", data.enh_attack, ref.enh_attack);
2661  JsonHelper::Member_ForceChange(allocator, "enh_release", data.enh_release, ref.enh_release);
2662  JsonHelper::Member_ForceChange(allocator, "enh_threshold", data.enh_threshold, ref.enh_threshold);
2663  JsonHelper::Member_ForceChange(allocator, "enh_thresLR", data.enh_thresLR, ref.enh_thresLR);
2664  JsonHelper::Member_ForceChange(allocator, "lim_on", data.lim_on, ref.lim_on);
2665  JsonHelper::Member_ForceChange(allocator, "lim_threshold", data.lim_threshold, ref.lim_threshold);
2666  JsonHelper::Member_ForceChange(allocator, "lim_attack", data.lim_attack, ref.lim_attack);
2667  JsonHelper::Member_ForceChange(allocator, "lim_release", data.lim_release, ref.lim_release);
2668  JsonHelper::Member_ForceChange(allocator, "clean_on", data.clean_on, ref.clean_on);
2669  JsonHelper::Member_ForceChange(allocator, "clean_threshold", data.clean_threshold, ref.clean_threshold);
2670  JsonHelper::Member_ForceChange(allocator, "clean_release", data.clean_release, ref.clean_release);
2671  }
2672 
2673  };
2674  // === VU ===
2675  template <>
2676  struct JsonConvert<jsonvu_stereofx> {
2677 
2678  /* VU have no FromJson */
2679 
2680  static bool ToJson(JSON_Value &json, const jsonvu_stereofx& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2681  if (sizeof(jsonvu_stereofx)==0) return true; // quick empty struct
2682  if (json.IsNull ()) {
2683  json.SetObject ();
2684  flags &= ~JSON_CVT_ONLYREQ; // children get all
2685  } else if (!json.IsObject()) {
2686  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2687  return false;
2688  }
2689  if (!JsonHelper::Member_ToJson(json, flags, allocator, "enh_vu", data.enh_vu)) return false;
2690  if (!JsonHelper::Member_ToJson(json, flags, allocator, "lim_bdvu", data.lim_bdvu)) return false;
2691  if (!JsonHelper::Member_ToJson(json, flags, allocator, "lim_vu", data.lim_vu)) return false;
2692  if ((flags & JSON_CVT_WITHDEV) &&
2693  !JsonHelper::Member_ToJson(json, flags, allocator, "clean_bdvu", data.clean_bdvu)) return false;
2694  if ((flags & JSON_CVT_WITHDEV) &&
2695  !JsonHelper::Member_ToJson(json, flags, allocator, "clean_vu", data.clean_vu)) return false;
2696  if (json.MemberCount()==0) json.SetNull();
2697  return true;
2698  }
2699 
2700  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]]) {
2701  if (sizeof(jsonvu_stereofx)==0) return true; // quick empty struct
2702  if (json.IsNull ()) {
2703  json.SetObject ();
2704  flags &= ~JSON_CVT_ONLYREQ; // children get all
2705  } else if (!json.IsObject()) {
2706  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2707  return false;
2708  }
2709  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "enh_vu", data.enh_vu, ref.enh_vu)) return false;
2710  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "lim_bdvu", data.lim_bdvu, ref.lim_bdvu)) return false;
2711  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "lim_vu", data.lim_vu, ref.lim_vu)) return false;
2712  if ((flags & JSON_CVT_WITHDEV) &&
2713  !JsonHelper::Member_DiffToJson(json, flags, allocator, "clean_bdvu", data.clean_bdvu, ref.clean_bdvu)) return false;
2714  if ((flags & JSON_CVT_WITHDEV) &&
2715  !JsonHelper::Member_DiffToJson(json, flags, allocator, "clean_vu", data.clean_vu, ref.clean_vu)) return false;
2716  if (json.MemberCount()==0) json.SetNull();
2717  return true;
2718  }
2719 
2720  static void ForceChange(const jsonvu_stereofx& data [[maybe_unused]], jsonvu_stereofx& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2721  JsonHelper::Member_ForceChange(allocator, "enh_vu", data.enh_vu, ref.enh_vu);
2722  JsonHelper::Member_ForceChange(allocator, "lim_bdvu", data.lim_bdvu, ref.lim_bdvu);
2723  JsonHelper::Member_ForceChange(allocator, "lim_vu", data.lim_vu, ref.lim_vu);
2724  JsonHelper::Member_ForceChange(allocator, "clean_bdvu", data.clean_bdvu, ref.clean_bdvu);
2725  JsonHelper::Member_ForceChange(allocator, "clean_vu", data.clean_vu, ref.clean_vu);
2726  }
2727 
2728  };
2729 // === object bandexp ===
2730  // === Preset ===
2731  template <>
2732  struct JsonConvert<json_bandexp> {
2733 
2734  static bool FromJson(const JSON_Value& json, json_bandexp& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_bandexp> &constraints = JsonConstraint<json_bandexp>()) {
2735  if (sizeof(json_bandexp)==0) return true; // quick empty struct
2736  if (json.IsNull()) { return true; }
2737  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
2738  if ( !JsonHelper::Member_FromJson(json, flags, "on", data.on, allocator)) return false;
2739  if ( !JsonHelper::Member_FromJson(json, flags, "down_on", data.down_on, allocator)) return false;
2740  if ( !JsonHelper::Member_FromJson(json, flags, "matrix_on", data.matrix_on, allocator)) return false;
2741  if ((flags & JSON_CVT_WITHDEV) &&
2742  !JsonHelper::Member_FromJson(json, flags, "stereo_link", data.stereo_link, allocator)) return false;
2743  if ( !JsonHelper::Member_FromJson(json, flags, "up_on", data.up_on, allocator)) return false;
2744  if ( !JsonHelper::Member_FromJson(json, flags, "drive_on", data.drive_on, allocator)) return false;
2745  if ( !JsonHelper::Member_FromJson(json, flags, "drive", data.drive, allocator, JsonConstraint<S4Float>(-20,20))) return false;
2746  if ((flags & JSON_CVT_WITHDEV) &&
2747  !JsonHelper::Member_FromJson(json, flags, "postgain", data.postgain, allocator, JsonConstraint<S4Float>(-20,20))) return false;
2748  if ( !JsonHelper::Member_FromJson(json, flags, "down_thres", data.down_thres, allocator, JsonConstraint<S4Float>(-60,0))) return false;
2749  if ((flags & JSON_CVT_WITHDEV) &&
2750  !JsonHelper::Member_FromJson(json, flags, "down_ratio", data.down_ratio, allocator, JsonConstraint<S4Float>(0,100))) return false;
2751  if ( !JsonHelper::Member_FromJson(json, flags, "down_attack", data.down_attack, allocator, JsonConstraint<S4Float>(1,32000))) return false;
2752  if ( !JsonHelper::Member_FromJson(json, flags, "down_release", data.down_release, allocator, JsonConstraint<S4Float>(1,32000))) return false;
2753  if ( !JsonHelper::Member_FromJson(json, flags, "down_sustain_on", data.down_sustain_on, allocator)) return false;
2754  if ( !JsonHelper::Member_FromJson(json, flags, "down_sustain", data.down_sustain, allocator, JsonConstraint<S4Float>(0,200))) return false;
2755  if ( !JsonHelper::Member_FromJson(json, flags, "down_min", data.down_min, allocator, JsonConstraint<S4Float>(-90,0))) return false;
2756  if ( !JsonHelper::Member_FromJson(json, flags, "up_thres", data.up_thres, allocator, JsonConstraint<S4Float>(-60,0))) return false;
2757  if ((flags & JSON_CVT_WITHDEV) &&
2758  !JsonHelper::Member_FromJson(json, flags, "up_ratio", data.up_ratio, allocator, JsonConstraint<S4Float>(0,100))) return false;
2759  if ( !JsonHelper::Member_FromJson(json, flags, "up_attack", data.up_attack, allocator, JsonConstraint<S4Float>(1,32000))) return false;
2760  if ( !JsonHelper::Member_FromJson(json, flags, "up_release", data.up_release, allocator, JsonConstraint<S4Float>(1,32000))) return false;
2761  if ( !JsonHelper::Member_FromJson(json, flags, "up_sustain_on", data.up_sustain_on, allocator)) return false;
2762  if ( !JsonHelper::Member_FromJson(json, flags, "up_sustain", data.up_sustain, allocator, JsonConstraint<S4Float>(0,200))) return false;
2763  if ( !JsonHelper::Member_FromJson(json, flags, "up_max", data.up_max, allocator, JsonConstraint<S4Float>(0,20))) return false;
2764  return true;
2765  }
2766 
2767  static bool ToJson(JSON_Value &json, const json_bandexp& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2768  if (sizeof(json_bandexp)==0) return true; // quick empty struct
2769  if (json.IsNull ()) {
2770  json.SetObject ();
2771  flags &= ~JSON_CVT_ONLYREQ; // children get all
2772  } else if (!json.IsObject()) {
2773  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2774  return false;
2775  }
2776  if (!JsonHelper::Member_ToJson(json, flags, allocator, "on", data.on)) return false;
2777  if (!JsonHelper::Member_ToJson(json, flags, allocator, "down_on", data.down_on)) return false;
2778  if (!JsonHelper::Member_ToJson(json, flags, allocator, "matrix_on", data.matrix_on)) return false;
2779  if ((flags & JSON_CVT_WITHDEV) &&
2780  !JsonHelper::Member_ToJson(json, flags, allocator, "stereo_link", data.stereo_link)) return false;
2781  if (!JsonHelper::Member_ToJson(json, flags, allocator, "up_on", data.up_on)) return false;
2782  if (!JsonHelper::Member_ToJson(json, flags, allocator, "drive_on", data.drive_on)) return false;
2783  if (!JsonHelper::Member_ToJson(json, flags, allocator, "drive", data.drive)) return false;
2784  if ((flags & JSON_CVT_WITHDEV) &&
2785  !JsonHelper::Member_ToJson(json, flags, allocator, "postgain", data.postgain)) return false;
2786  if (!JsonHelper::Member_ToJson(json, flags, allocator, "down_thres", data.down_thres)) return false;
2787  if ((flags & JSON_CVT_WITHDEV) &&
2788  !JsonHelper::Member_ToJson(json, flags, allocator, "down_ratio", data.down_ratio)) return false;
2789  if (!JsonHelper::Member_ToJson(json, flags, allocator, "down_attack", data.down_attack)) return false;
2790  if (!JsonHelper::Member_ToJson(json, flags, allocator, "down_release", data.down_release)) return false;
2791  if (!JsonHelper::Member_ToJson(json, flags, allocator, "down_sustain_on", data.down_sustain_on)) return false;
2792  if (!JsonHelper::Member_ToJson(json, flags, allocator, "down_sustain", data.down_sustain)) return false;
2793  if (!JsonHelper::Member_ToJson(json, flags, allocator, "down_min", data.down_min)) return false;
2794  if (!JsonHelper::Member_ToJson(json, flags, allocator, "up_thres", data.up_thres)) return false;
2795  if ((flags & JSON_CVT_WITHDEV) &&
2796  !JsonHelper::Member_ToJson(json, flags, allocator, "up_ratio", data.up_ratio)) return false;
2797  if (!JsonHelper::Member_ToJson(json, flags, allocator, "up_attack", data.up_attack)) return false;
2798  if (!JsonHelper::Member_ToJson(json, flags, allocator, "up_release", data.up_release)) return false;
2799  if (!JsonHelper::Member_ToJson(json, flags, allocator, "up_sustain_on", data.up_sustain_on)) return false;
2800  if (!JsonHelper::Member_ToJson(json, flags, allocator, "up_sustain", data.up_sustain)) return false;
2801  if (!JsonHelper::Member_ToJson(json, flags, allocator, "up_max", data.up_max)) return false;
2802  if (json.MemberCount()==0) json.SetNull();
2803  return true;
2804  }
2805 
2806  static bool DiffToJson(JSON_Value &json, const json_bandexp& data [[maybe_unused]], json_bandexp& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2807  if (sizeof(json_bandexp)==0) return true; // quick empty struct
2808  if (json.IsNull ()) {
2809  json.SetObject ();
2810  flags &= ~JSON_CVT_ONLYREQ; // children get all
2811  } else if (!json.IsObject()) {
2812  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2813  return false;
2814  }
2815  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "on", data.on, ref.on)) return false;
2816  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "down_on", data.down_on, ref.down_on)) return false;
2817  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "matrix_on", data.matrix_on, ref.matrix_on)) return false;
2818  if ((flags & JSON_CVT_WITHDEV) &&
2819  !JsonHelper::Member_DiffToJson(json, flags, allocator, "stereo_link", data.stereo_link, ref.stereo_link)) return false;
2820  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "up_on", data.up_on, ref.up_on)) return false;
2821  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "drive_on", data.drive_on, ref.drive_on)) return false;
2822  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "drive", data.drive, ref.drive)) return false;
2823  if ((flags & JSON_CVT_WITHDEV) &&
2824  !JsonHelper::Member_DiffToJson(json, flags, allocator, "postgain", data.postgain, ref.postgain)) return false;
2825  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "down_thres", data.down_thres, ref.down_thres)) return false;
2826  if ((flags & JSON_CVT_WITHDEV) &&
2827  !JsonHelper::Member_DiffToJson(json, flags, allocator, "down_ratio", data.down_ratio, ref.down_ratio)) return false;
2828  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "down_attack", data.down_attack, ref.down_attack)) return false;
2829  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "down_release", data.down_release, ref.down_release)) return false;
2830  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "down_sustain_on", data.down_sustain_on, ref.down_sustain_on)) return false;
2831  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "down_sustain", data.down_sustain, ref.down_sustain)) return false;
2832  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "down_min", data.down_min, ref.down_min)) return false;
2833  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "up_thres", data.up_thres, ref.up_thres)) return false;
2834  if ((flags & JSON_CVT_WITHDEV) &&
2835  !JsonHelper::Member_DiffToJson(json, flags, allocator, "up_ratio", data.up_ratio, ref.up_ratio)) return false;
2836  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "up_attack", data.up_attack, ref.up_attack)) return false;
2837  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "up_release", data.up_release, ref.up_release)) return false;
2838  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "up_sustain_on", data.up_sustain_on, ref.up_sustain_on)) return false;
2839  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "up_sustain", data.up_sustain, ref.up_sustain)) return false;
2840  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "up_max", data.up_max, ref.up_max)) return false;
2841  if (json.MemberCount()==0) json.SetNull();
2842  return true;
2843  }
2844 
2845  static void ForceChange(const json_bandexp& data [[maybe_unused]], json_bandexp& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2846  JsonHelper::Member_ForceChange(allocator, "on", data.on, ref.on);
2847  JsonHelper::Member_ForceChange(allocator, "down_on", data.down_on, ref.down_on);
2848  JsonHelper::Member_ForceChange(allocator, "matrix_on", data.matrix_on, ref.matrix_on);
2849  JsonHelper::Member_ForceChange(allocator, "stereo_link", data.stereo_link, ref.stereo_link);
2850  JsonHelper::Member_ForceChange(allocator, "up_on", data.up_on, ref.up_on);
2851  JsonHelper::Member_ForceChange(allocator, "drive_on", data.drive_on, ref.drive_on);
2852  JsonHelper::Member_ForceChange(allocator, "drive", data.drive, ref.drive);
2853  JsonHelper::Member_ForceChange(allocator, "postgain", data.postgain, ref.postgain);
2854  JsonHelper::Member_ForceChange(allocator, "down_thres", data.down_thres, ref.down_thres);
2855  JsonHelper::Member_ForceChange(allocator, "down_ratio", data.down_ratio, ref.down_ratio);
2856  JsonHelper::Member_ForceChange(allocator, "down_attack", data.down_attack, ref.down_attack);
2857  JsonHelper::Member_ForceChange(allocator, "down_release", data.down_release, ref.down_release);
2858  JsonHelper::Member_ForceChange(allocator, "down_sustain_on", data.down_sustain_on, ref.down_sustain_on);
2859  JsonHelper::Member_ForceChange(allocator, "down_sustain", data.down_sustain, ref.down_sustain);
2860  JsonHelper::Member_ForceChange(allocator, "down_min", data.down_min, ref.down_min);
2861  JsonHelper::Member_ForceChange(allocator, "up_thres", data.up_thres, ref.up_thres);
2862  JsonHelper::Member_ForceChange(allocator, "up_ratio", data.up_ratio, ref.up_ratio);
2863  JsonHelper::Member_ForceChange(allocator, "up_attack", data.up_attack, ref.up_attack);
2864  JsonHelper::Member_ForceChange(allocator, "up_release", data.up_release, ref.up_release);
2865  JsonHelper::Member_ForceChange(allocator, "up_sustain_on", data.up_sustain_on, ref.up_sustain_on);
2866  JsonHelper::Member_ForceChange(allocator, "up_sustain", data.up_sustain, ref.up_sustain);
2867  JsonHelper::Member_ForceChange(allocator, "up_max", data.up_max, ref.up_max);
2868  }
2869 
2870  };
2871  // === VU ===
2872  template <>
2873  struct JsonConvert<jsonvu_bandexp> {
2874 
2875  /* VU have no FromJson */
2876 
2877  static bool ToJson(JSON_Value &json, const jsonvu_bandexp& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2878  if (sizeof(jsonvu_bandexp)==0) return true; // quick empty struct
2879  if (json.IsNull ()) {
2880  json.SetObject ();
2881  flags &= ~JSON_CVT_ONLYREQ; // children get all
2882  } else if (!json.IsObject()) {
2883  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2884  return false;
2885  }
2886  if (!JsonHelper::Member_ToJson(json, flags, allocator, "down", data.down)) return false;
2887  if (!JsonHelper::Member_ToJson(json, flags, allocator, "up", data.up)) return false;
2888  if ((flags & JSON_CVT_WITHDEV) &&
2889  !JsonHelper::Member_ToJson(json, flags, allocator, "mes_in", data.mes_in)) return false;
2890  if (json.MemberCount()==0) json.SetNull();
2891  return true;
2892  }
2893 
2894  static bool DiffToJson(JSON_Value &json, const jsonvu_bandexp& data [[maybe_unused]], jsonvu_bandexp& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2895  if (sizeof(jsonvu_bandexp)==0) return true; // quick empty struct
2896  if (json.IsNull ()) {
2897  json.SetObject ();
2898  flags &= ~JSON_CVT_ONLYREQ; // children get all
2899  } else if (!json.IsObject()) {
2900  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2901  return false;
2902  }
2903  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "down", data.down, ref.down)) return false;
2904  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "up", data.up, ref.up)) return false;
2905  if ((flags & JSON_CVT_WITHDEV) &&
2906  !JsonHelper::Member_DiffToJson(json, flags, allocator, "mes_in", data.mes_in, ref.mes_in)) return false;
2907  if (json.MemberCount()==0) json.SetNull();
2908  return true;
2909  }
2910 
2911  static void ForceChange(const jsonvu_bandexp& data [[maybe_unused]], jsonvu_bandexp& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2912  JsonHelper::Member_ForceChange(allocator, "down", data.down, ref.down);
2913  JsonHelper::Member_ForceChange(allocator, "up", data.up, ref.up);
2914  JsonHelper::Member_ForceChange(allocator, "mes_in", data.mes_in, ref.mes_in);
2915  }
2916 
2917  };
2918 // === object bandprocess ===
2919  // === Preset ===
2920  template <>
2921  struct JsonConvert<json_bandprocess> {
2922 
2923  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>()) {
2924  if (sizeof(json_bandprocess)==0) return true; // quick empty struct
2925  if (json.IsNull()) { return true; }
2926  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
2927  if ( !JsonHelper::Member_FromJson(json, flags, "on", data.on, allocator)) return false;
2928  if ( !JsonHelper::Member_FromJson(json, flags, "freq", data.freq, allocator, JsonConstraint<S4Float>(20,20000))) return false;
2929  if ( !JsonHelper::Member_FromJson(json, flags, "gate_on", data.gate_on, allocator)) return false;
2930  if ((flags & JSON_CVT_WITHDEV) &&
2931  !JsonHelper::Member_FromJson(json, flags, "gate_to_avg", data.gate_to_avg, allocator)) return false;
2932  if ( !JsonHelper::Member_FromJson(json, flags, "gate", data.gate, allocator, JsonConstraint<S4Float>(-100,0))) return false;
2933  if ( !JsonHelper::Member_FromJson(json, flags, "fidelity_on", data.fidelity_on, allocator)) return false;
2934  if ((flags & JSON_CVT_WITHDEV) &&
2935  !JsonHelper::Member_FromJson(json, flags, "fidelity_speed", data.fidelity_speed, allocator, JsonConstraint<S4Float>(0.1,60))) return false;
2936  if ( !JsonHelper::Member_FromJson(json, flags, "fidelity", data.fidelity, allocator, JsonConstraint<S4Float>(0,100))) return false;
2937  if ( !JsonHelper::Member_FromJson(json, flags, "peak_mode", data.peak_mode, allocator)) return false;
2938  if ( !JsonHelper::Member_FromJson(json, flags, "drive_on", data.drive_on, allocator)) return false;
2939  if ( !JsonHelper::Member_FromJson(json, flags, "drive", data.drive, allocator, JsonConstraint<S4Float>(-30,30))) return false;
2940  if ( !JsonHelper::Member_FromJson(json, flags, "threshold_on", data.threshold_on, allocator)) return false;
2941  if ( !JsonHelper::Member_FromJson(json, flags, "threshold", data.threshold, allocator, JsonConstraint<S4Float>(-6,6))) return false;
2942  if ((flags & JSON_CVT_WITHDEV) &&
2943  !JsonHelper::Member_FromJson(json, flags, "base_thres", data.base_thres, allocator, JsonConstraint<S4Float>(-140,10))) return false;
2944  if ((flags & JSON_CVT_WITHDEV) &&
2945  !JsonHelper::Member_FromJson(json, flags, "postgain", data.postgain, allocator, JsonConstraint<S4Float>(0,40))) return false;
2946  if ( !JsonHelper::Member_FromJson(json, flags, "ratio", data.ratio, allocator, JsonConstraint<S4Float>(0,100))) return false;
2947  if ( !JsonHelper::Member_FromJson(json, flags, "attack", data.attack, allocator, JsonConstraint<S4Float>(1,5000))) return false;
2948  if ( !JsonHelper::Member_FromJson(json, flags, "release", data.release, allocator, JsonConstraint<S4Float>(0.5,400))) return false;
2949  if ( !JsonHelper::Member_FromJson(json, flags, "releasesustain", data.releasesustain, allocator, JsonConstraint<S4Float>(0.1,200))) return false;
2950  if ( !JsonHelper::Member_FromJson(json, flags, "sustain_on", data.sustain_on, allocator)) return false;
2951  if ( !JsonHelper::Member_FromJson(json, flags, "sustain", data.sustain, allocator, JsonConstraint<S4Float>(0,200))) return false;
2952  if ((flags & JSON_CVT_WITHDEV) &&
2953  !JsonHelper::Member_FromJson(json, flags, "nbperiod", data.nbperiod, allocator, JsonConstraint<int>(1,BANDPROC_MAX_PERIOD))) return false;
2954  if ((flags & JSON_CVT_WITHDEV) &&
2955  !JsonHelper::Member_FromJson(json, flags, "smooth_band", data.smooth_band, allocator, JsonConstraint<int>(1,BANDPROC_MAX_PERIOD))) return false;
2956  if ( !JsonHelper::Member_FromJson(json, flags, "impact_on", data.impact_on, allocator)) return false;
2957  if ( !JsonHelper::Member_FromJson(json, flags, "impact", data.impact, allocator, JsonConstraint<S4Float>(0,10))) return false;
2958  if ( !JsonHelper::Member_FromJson(json, flags, "mix_on", data.mix_on, allocator)) return false;
2959  if ( !JsonHelper::Member_FromJson(json, flags, "mix", data.mix, allocator, JsonConstraint<S4Float>(-16,+16))) return false;
2960  if ((flags & JSON_CVT_WITHDEV) &&
2961  !JsonHelper::Member_FromJson(json, flags, "avg_speed_gain", data.avg_speed_gain, allocator, JsonConstraint<S4Float>(0.1,300))) return false;
2962  if ( !JsonHelper::Member_FromJson(json, flags, "voicethres", data.voicethres, allocator, JsonConstraint<S4Float>(-10,10))) return false;
2963  if ( !JsonHelper::Member_FromJson(json, flags, "voiceattack_on", data.voiceattack_on, allocator)) return false;
2964  if ( !JsonHelper::Member_FromJson(json, flags, "voiceattack", data.voiceattack, allocator, JsonConstraint<S4Float>(5,5000))) return false;
2965  if ( !JsonHelper::Member_FromJson(json, flags, "voicemix", data.voicemix, allocator, JsonConstraint<S4Float>(-10,+10))) return false;
2966  if ((flags & JSON_CVT_WITHDEV) &&
2967  !JsonHelper::Member_FromJson(json, flags, "attack_min", data.attack_min, allocator, JsonConstraint<S4Float>(1,5000))) return false;
2968  if ((flags & JSON_CVT_WITHDEV) &&
2969  !JsonHelper::Member_FromJson(json, flags, "attack_max", data.attack_max, allocator, JsonConstraint<S4Float>(1,5000))) return false;
2970  if ((flags & JSON_CVT_WITHDEV) &&
2971  !JsonHelper::Member_FromJson(json, flags, "release_min", data.release_min, allocator, JsonConstraint<S4Float>(1,400))) return false;
2972  if ((flags & JSON_CVT_WITHDEV) &&
2973  !JsonHelper::Member_FromJson(json, flags, "release_max", data.release_max, allocator, JsonConstraint<S4Float>(1,400))) return false;
2974  if ((flags & JSON_CVT_WITHDEV) &&
2975  !JsonHelper::Member_FromJson(json, flags, "listen", data.listen, allocator, JsonConstraint<int>(0,NB_BAND_PROC))) return false;
2976  return true;
2977  }
2978 
2979  static bool ToJson(JSON_Value &json, const json_bandprocess& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
2980  if (sizeof(json_bandprocess)==0) return true; // quick empty struct
2981  if (json.IsNull ()) {
2982  json.SetObject ();
2983  flags &= ~JSON_CVT_ONLYREQ; // children get all
2984  } else if (!json.IsObject()) {
2985  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
2986  return false;
2987  }
2988  if (!JsonHelper::Member_ToJson(json, flags, allocator, "on", data.on)) return false;
2989  if (!JsonHelper::Member_ToJson(json, flags, allocator, "freq", data.freq)) return false;
2990  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gate_on", data.gate_on)) return false;
2991  if ((flags & JSON_CVT_WITHDEV) &&
2992  !JsonHelper::Member_ToJson(json, flags, allocator, "gate_to_avg", data.gate_to_avg)) return false;
2993  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gate", data.gate)) return false;
2994  if (!JsonHelper::Member_ToJson(json, flags, allocator, "fidelity_on", data.fidelity_on)) return false;
2995  if ((flags & JSON_CVT_WITHDEV) &&
2996  !JsonHelper::Member_ToJson(json, flags, allocator, "fidelity_speed", data.fidelity_speed)) return false;
2997  if (!JsonHelper::Member_ToJson(json, flags, allocator, "fidelity", data.fidelity)) return false;
2998  if (!JsonHelper::Member_ToJson(json, flags, allocator, "peak_mode", data.peak_mode)) return false;
2999  if (!JsonHelper::Member_ToJson(json, flags, allocator, "drive_on", data.drive_on)) return false;
3000  if (!JsonHelper::Member_ToJson(json, flags, allocator, "drive", data.drive)) return false;
3001  if (!JsonHelper::Member_ToJson(json, flags, allocator, "threshold_on", data.threshold_on)) return false;
3002  if (!JsonHelper::Member_ToJson(json, flags, allocator, "threshold", data.threshold)) return false;
3003  if ((flags & JSON_CVT_WITHDEV) &&
3004  !JsonHelper::Member_ToJson(json, flags, allocator, "base_thres", data.base_thres)) return false;
3005  if ((flags & JSON_CVT_WITHDEV) &&
3006  !JsonHelper::Member_ToJson(json, flags, allocator, "postgain", data.postgain)) return false;
3007  if (!JsonHelper::Member_ToJson(json, flags, allocator, "ratio", data.ratio)) return false;
3008  if (!JsonHelper::Member_ToJson(json, flags, allocator, "attack", data.attack)) return false;
3009  if (!JsonHelper::Member_ToJson(json, flags, allocator, "release", data.release)) return false;
3010  if (!JsonHelper::Member_ToJson(json, flags, allocator, "releasesustain", data.releasesustain)) return false;
3011  if (!JsonHelper::Member_ToJson(json, flags, allocator, "sustain_on", data.sustain_on)) return false;
3012  if (!JsonHelper::Member_ToJson(json, flags, allocator, "sustain", data.sustain)) return false;
3013  if ((flags & JSON_CVT_WITHDEV) &&
3014  !JsonHelper::Member_ToJson(json, flags, allocator, "nbperiod", data.nbperiod)) return false;
3015  if ((flags & JSON_CVT_WITHDEV) &&
3016  !JsonHelper::Member_ToJson(json, flags, allocator, "smooth_band", data.smooth_band)) return false;
3017  if (!JsonHelper::Member_ToJson(json, flags, allocator, "impact_on", data.impact_on)) return false;
3018  if (!JsonHelper::Member_ToJson(json, flags, allocator, "impact", data.impact)) return false;
3019  if (!JsonHelper::Member_ToJson(json, flags, allocator, "mix_on", data.mix_on)) return false;
3020  if (!JsonHelper::Member_ToJson(json, flags, allocator, "mix", data.mix)) return false;
3021  if ((flags & JSON_CVT_WITHDEV) &&
3022  !JsonHelper::Member_ToJson(json, flags, allocator, "avg_speed_gain", data.avg_speed_gain)) return false;
3023  if (!JsonHelper::Member_ToJson(json, flags, allocator, "voicethres", data.voicethres)) return false;
3024  if (!JsonHelper::Member_ToJson(json, flags, allocator, "voiceattack_on", data.voiceattack_on)) return false;
3025  if (!JsonHelper::Member_ToJson(json, flags, allocator, "voiceattack", data.voiceattack)) return false;
3026  if (!JsonHelper::Member_ToJson(json, flags, allocator, "voicemix", data.voicemix)) return false;
3027  if ((flags & JSON_CVT_WITHDEV) &&
3028  !JsonHelper::Member_ToJson(json, flags, allocator, "attack_min", data.attack_min)) return false;
3029  if ((flags & JSON_CVT_WITHDEV) &&
3030  !JsonHelper::Member_ToJson(json, flags, allocator, "attack_max", data.attack_max)) return false;
3031  if ((flags & JSON_CVT_WITHDEV) &&
3032  !JsonHelper::Member_ToJson(json, flags, allocator, "release_min", data.release_min)) return false;
3033  if ((flags & JSON_CVT_WITHDEV) &&
3034  !JsonHelper::Member_ToJson(json, flags, allocator, "release_max", data.release_max)) return false;
3035  if ((flags & JSON_CVT_WITHDEV) &&
3036  !JsonHelper::Member_ToJson(json, flags, allocator, "listen", data.listen)) return false;
3037  if (json.MemberCount()==0) json.SetNull();
3038  return true;
3039  }
3040 
3041  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]]) {
3042  if (sizeof(json_bandprocess)==0) return true; // quick empty struct
3043  if (json.IsNull ()) {
3044  json.SetObject ();
3045  flags &= ~JSON_CVT_ONLYREQ; // children get all
3046  } else if (!json.IsObject()) {
3047  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
3048  return false;
3049  }
3050  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "on", data.on, ref.on)) return false;
3051  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "freq", data.freq, ref.freq)) return false;
3052  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gate_on", data.gate_on, ref.gate_on)) return false;
3053  if ((flags & JSON_CVT_WITHDEV) &&
3054  !JsonHelper::Member_DiffToJson(json, flags, allocator, "gate_to_avg", data.gate_to_avg, ref.gate_to_avg)) return false;
3055  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gate", data.gate, ref.gate)) return false;
3056  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "fidelity_on", data.fidelity_on, ref.fidelity_on)) return false;
3057  if ((flags & JSON_CVT_WITHDEV) &&
3058  !JsonHelper::Member_DiffToJson(json, flags, allocator, "fidelity_speed", data.fidelity_speed, ref.fidelity_speed)) return false;
3059  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "fidelity", data.fidelity, ref.fidelity)) return false;
3060  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "peak_mode", data.peak_mode, ref.peak_mode)) return false;
3061  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "drive_on", data.drive_on, ref.drive_on)) return false;
3062  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "drive", data.drive, ref.drive)) return false;
3063  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "threshold_on", data.threshold_on, ref.threshold_on)) return false;
3064  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "threshold", data.threshold, ref.threshold)) return false;
3065  if ((flags & JSON_CVT_WITHDEV) &&
3066  !JsonHelper::Member_DiffToJson(json, flags, allocator, "base_thres", data.base_thres, ref.base_thres)) return false;
3067  if ((flags & JSON_CVT_WITHDEV) &&
3068  !JsonHelper::Member_DiffToJson(json, flags, allocator, "postgain", data.postgain, ref.postgain)) return false;
3069  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "ratio", data.ratio, ref.ratio)) return false;
3070  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "attack", data.attack, ref.attack)) return false;
3071  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "release", data.release, ref.release)) return false;
3072  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "releasesustain", data.releasesustain, ref.releasesustain)) return false;
3073  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "sustain_on", data.sustain_on, ref.sustain_on)) return false;
3074  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "sustain", data.sustain, ref.sustain)) return false;
3075  if ((flags & JSON_CVT_WITHDEV) &&
3076  !JsonHelper::Member_DiffToJson(json, flags, allocator, "nbperiod", data.nbperiod, ref.nbperiod)) return false;
3077  if ((flags & JSON_CVT_WITHDEV) &&
3078  !JsonHelper::Member_DiffToJson(json, flags, allocator, "smooth_band", data.smooth_band, ref.smooth_band)) return false;
3079  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "impact_on", data.impact_on, ref.impact_on)) return false;
3080  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "impact", data.impact, ref.impact)) return false;
3081  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "mix_on", data.mix_on, ref.mix_on)) return false;
3082  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "mix", data.mix, ref.mix)) return false;
3083  if ((flags & JSON_CVT_WITHDEV) &&
3084  !JsonHelper::Member_DiffToJson(json, flags, allocator, "avg_speed_gain", data.avg_speed_gain, ref.avg_speed_gain)) return false;
3085  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "voicethres", data.voicethres, ref.voicethres)) return false;
3086  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "voiceattack_on", data.voiceattack_on, ref.voiceattack_on)) return false;
3087  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "voiceattack", data.voiceattack, ref.voiceattack)) return false;
3088  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "voicemix", data.voicemix, ref.voicemix)) return false;
3089  if ((flags & JSON_CVT_WITHDEV) &&
3090  !JsonHelper::Member_DiffToJson(json, flags, allocator, "attack_min", data.attack_min, ref.attack_min)) return false;
3091  if ((flags & JSON_CVT_WITHDEV) &&
3092  !JsonHelper::Member_DiffToJson(json, flags, allocator, "attack_max", data.attack_max, ref.attack_max)) return false;
3093  if ((flags & JSON_CVT_WITHDEV) &&
3094  !JsonHelper::Member_DiffToJson(json, flags, allocator, "release_min", data.release_min, ref.release_min)) return false;
3095  if ((flags & JSON_CVT_WITHDEV) &&
3096  !JsonHelper::Member_DiffToJson(json, flags, allocator, "release_max", data.release_max, ref.release_max)) return false;
3097  if ((flags & JSON_CVT_WITHDEV) &&
3098  !JsonHelper::Member_DiffToJson(json, flags, allocator, "listen", data.listen, ref.listen)) return false;
3099  if (json.MemberCount()==0) json.SetNull();
3100  return true;
3101  }
3102 
3103  static void ForceChange(const json_bandprocess& data [[maybe_unused]], json_bandprocess& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
3104  JsonHelper::Member_ForceChange(allocator, "on", data.on, ref.on);
3105  JsonHelper::Member_ForceChange(allocator, "freq", data.freq, ref.freq);
3106  JsonHelper::Member_ForceChange(allocator, "gate_on", data.gate_on, ref.gate_on);
3107  JsonHelper::Member_ForceChange(allocator, "gate_to_avg", data.gate_to_avg, ref.gate_to_avg);
3108  JsonHelper::Member_ForceChange(allocator, "gate", data.gate, ref.gate);
3109  JsonHelper::Member_ForceChange(allocator, "fidelity_on", data.fidelity_on, ref.fidelity_on);
3110  JsonHelper::Member_ForceChange(allocator, "fidelity_speed", data.fidelity_speed, ref.fidelity_speed);
3111  JsonHelper::Member_ForceChange(allocator, "fidelity", data.fidelity, ref.fidelity);
3112  JsonHelper::Member_ForceChange(allocator, "peak_mode", data.peak_mode, ref.peak_mode);
3113  JsonHelper::Member_ForceChange(allocator, "drive_on", data.drive_on, ref.drive_on);
3114  JsonHelper::Member_ForceChange(allocator, "drive", data.drive, ref.drive);
3115  JsonHelper::Member_ForceChange(allocator, "threshold_on", data.threshold_on, ref.threshold_on);
3116  JsonHelper::Member_ForceChange(allocator, "threshold", data.threshold, ref.threshold);
3117  JsonHelper::Member_ForceChange(allocator, "base_thres", data.base_thres, ref.base_thres);
3118  JsonHelper::Member_ForceChange(allocator, "postgain", data.postgain, ref.postgain);
3119  JsonHelper::Member_ForceChange(allocator, "ratio", data.ratio, ref.ratio);
3120  JsonHelper::Member_ForceChange(allocator, "attack", data.attack, ref.attack);
3121  JsonHelper::Member_ForceChange(allocator, "release", data.release, ref.release);
3122  JsonHelper::Member_ForceChange(allocator, "releasesustain", data.releasesustain, ref.releasesustain);
3123  JsonHelper::Member_ForceChange(allocator, "sustain_on", data.sustain_on, ref.sustain_on);
3124  JsonHelper::Member_ForceChange(allocator, "sustain", data.sustain, ref.sustain);
3125  JsonHelper::Member_ForceChange(allocator, "nbperiod", data.nbperiod, ref.nbperiod);
3126  JsonHelper::Member_ForceChange(allocator, "smooth_band", data.smooth_band, ref.smooth_band);
3127  JsonHelper::Member_ForceChange(allocator, "impact_on", data.impact_on, ref.impact_on);
3128  JsonHelper::Member_ForceChange(allocator, "impact", data.impact, ref.impact);
3129  JsonHelper::Member_ForceChange(allocator, "mix_on", data.mix_on, ref.mix_on);
3130  JsonHelper::Member_ForceChange(allocator, "mix", data.mix, ref.mix);
3131  JsonHelper::Member_ForceChange(allocator, "avg_speed_gain", data.avg_speed_gain, ref.avg_speed_gain);
3132  JsonHelper::Member_ForceChange(allocator, "voicethres", data.voicethres, ref.voicethres);
3133  JsonHelper::Member_ForceChange(allocator, "voiceattack_on", data.voiceattack_on, ref.voiceattack_on);
3134  JsonHelper::Member_ForceChange(allocator, "voiceattack", data.voiceattack, ref.voiceattack);
3135  JsonHelper::Member_ForceChange(allocator, "voicemix", data.voicemix, ref.voicemix);
3136  JsonHelper::Member_ForceChange(allocator, "attack_min", data.attack_min, ref.attack_min);
3137  JsonHelper::Member_ForceChange(allocator, "attack_max", data.attack_max, ref.attack_max);
3138  JsonHelper::Member_ForceChange(allocator, "release_min", data.release_min, ref.release_min);
3139  JsonHelper::Member_ForceChange(allocator, "release_max", data.release_max, ref.release_max);
3140  JsonHelper::Member_ForceChange(allocator, "listen", data.listen, ref.listen);
3141  }
3142 
3143  };
3144  // === VU ===
3145  template <>
3146  struct JsonConvert<jsonvu_bandprocess> {
3147 
3148  /* VU have no FromJson */
3149 
3150  static bool ToJson(JSON_Value &json, const jsonvu_bandprocess& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
3151  if (sizeof(jsonvu_bandprocess)==0) return true; // quick empty struct
3152  if (json.IsNull ()) {
3153  json.SetObject ();
3154  flags &= ~JSON_CVT_ONLYREQ; // children get all
3155  } else if (!json.IsObject()) {
3156  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
3157  return false;
3158  }
3159  if (!JsonHelper::Member_ToJson(json, flags, allocator, "splitin", data.splitin)) return false;
3160  if ((flags & JSON_CVT_WITHDEV) &&
3161  !JsonHelper::Member_ToJson(json, flags, allocator, "fidel", data.fidel)) return false;
3162  if (!JsonHelper::Member_ToJson(json, flags, allocator, "splitout", data.splitout)) return false;
3163  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gated", data.gated)) return false;
3164  if (!JsonHelper::Member_ToJson(json, flags, allocator, "in", data.in)) return false;
3165  if ((flags & JSON_CVT_WITHDEV) &&
3166  !JsonHelper::Member_ToJson(json, flags, allocator, "gain_avg", data.gain_avg)) return false;
3167  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gain", data.gain)) return false;
3168  if (!JsonHelper::Member_ToJson(json, flags, allocator, "attack_min_vu", data.attack_min_vu)) return false;
3169  if (!JsonHelper::Member_ToJson(json, flags, allocator, "attack_max_vu", data.attack_max_vu)) return false;
3170  if (!JsonHelper::Member_ToJson(json, flags, allocator, "release_min_vu", data.release_min_vu)) return false;
3171  if (!JsonHelper::Member_ToJson(json, flags, allocator, "release_max_vu", data.release_max_vu)) return false;
3172  if (!JsonHelper::Member_ToJson(json, flags, allocator, "vu_on", data.vu_on)) return false;
3173  if (!JsonHelper::Member_ToJson(json, flags, allocator, "vu_freq", data.vu_freq)) return false;
3174  if (json.MemberCount()==0) json.SetNull();
3175  return true;
3176  }
3177 
3178  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]]) {
3179  if (sizeof(jsonvu_bandprocess)==0) return true; // quick empty struct
3180  if (json.IsNull ()) {
3181  json.SetObject ();
3182  flags &= ~JSON_CVT_ONLYREQ; // children get all
3183  } else if (!json.IsObject()) {
3184  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
3185  return false;
3186  }
3187  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "splitin", data.splitin, ref.splitin)) return false;
3188  if ((flags & JSON_CVT_WITHDEV) &&
3189  !JsonHelper::Member_DiffToJson(json, flags, allocator, "fidel", data.fidel, ref.fidel)) return false;
3190  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "splitout", data.splitout, ref.splitout)) return false;
3191  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gated", data.gated, ref.gated)) return false;
3192  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "in", data.in, ref.in)) return false;
3193  if ((flags & JSON_CVT_WITHDEV) &&
3194  !JsonHelper::Member_DiffToJson(json, flags, allocator, "gain_avg", data.gain_avg, ref.gain_avg)) return false;
3195  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gain", data.gain, ref.gain)) return false;
3196  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "attack_min_vu", data.attack_min_vu, ref.attack_min_vu)) return false;
3197  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "attack_max_vu", data.attack_max_vu, ref.attack_max_vu)) return false;
3198  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "release_min_vu", data.release_min_vu, ref.release_min_vu)) return false;
3199  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "release_max_vu", data.release_max_vu, ref.release_max_vu)) return false;
3200  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "vu_on", data.vu_on, ref.vu_on)) return false;
3201  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "vu_freq", data.vu_freq, ref.vu_freq)) return false;
3202  if (json.MemberCount()==0) json.SetNull();
3203  return true;
3204  }
3205 
3206  static void ForceChange(const jsonvu_bandprocess& data [[maybe_unused]], jsonvu_bandprocess& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
3207  JsonHelper::Member_ForceChange(allocator, "splitin", data.splitin, ref.splitin);
3208  JsonHelper::Member_ForceChange(allocator, "fidel", data.fidel, ref.fidel);
3209  JsonHelper::Member_ForceChange(allocator, "splitout", data.splitout, ref.splitout);
3210  JsonHelper::Member_ForceChange(allocator, "gated", data.gated, ref.gated);
3211  JsonHelper::Member_ForceChange(allocator, "in", data.in, ref.in);
3212  JsonHelper::Member_ForceChange(allocator, "gain_avg", data.gain_avg, ref.gain_avg);
3213  JsonHelper::Member_ForceChange(allocator, "gain", data.gain, ref.gain);
3214  JsonHelper::Member_ForceChange(allocator, "attack_min_vu", data.attack_min_vu, ref.attack_min_vu);
3215  JsonHelper::Member_ForceChange(allocator, "attack_max_vu", data.attack_max_vu, ref.attack_max_vu);
3216  JsonHelper::Member_ForceChange(allocator, "release_min_vu", data.release_min_vu, ref.release_min_vu);
3217  JsonHelper::Member_ForceChange(allocator, "release_max_vu", data.release_max_vu, ref.release_max_vu);
3218  JsonHelper::Member_ForceChange(allocator, "vu_on", data.vu_on, ref.vu_on);
3219  JsonHelper::Member_ForceChange(allocator, "vu_freq", data.vu_freq, ref.vu_freq);
3220  }
3221 
3222  };
3223 // === object bandlook ===
3224  // === Preset ===
3225  template <>
3226  struct JsonConvert<json_bandlook> {
3227 
3228  static bool FromJson(const JSON_Value& json, json_bandlook& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_bandlook> &constraints = JsonConstraint<json_bandlook>()) {
3229  if (sizeof(json_bandlook)==0) return true; // quick empty struct
3230  if (json.IsNull()) { return true; }
3231  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
3232  if ( !JsonHelper::Member_FromJson(json, flags, "on", data.on, allocator)) return false;
3233  if ( !JsonHelper::Member_FromJson(json, flags, "drive", data.drive, allocator, JsonConstraint<S4Float>(-20,20))) return false;
3234  if ((flags & JSON_CVT_WITHDEV) &&
3235  !JsonHelper::Member_FromJson(json, flags, "base_drive", data.base_drive, allocator, JsonConstraint<S4Float>(-20,20))) return false;
3236  if ( !JsonHelper::Member_FromJson(json, flags, "threshold", data.threshold, allocator, JsonConstraint<S4Float>(-20,20))) return false;
3237  if ((flags & JSON_CVT_WITHDEV) &&
3238  !JsonHelper::Member_FromJson(json, flags, "base_thres", data.base_thres, allocator, JsonConstraint<S4Float>(-20,20))) return false;
3239  if ((flags & JSON_CVT_WITHDEV) &&
3240  !JsonHelper::Member_FromJson(json, flags, "latency", data.latency, allocator, JsonConstraint<S4Float>(0.5,30))) return false;
3241  if ((flags & JSON_CVT_WITHDEV) &&
3242  !JsonHelper::Member_FromJson(json, flags, "attack", data.attack, allocator, JsonConstraint<S4Float>(1,32000))) return false;
3243  if ((flags & JSON_CVT_WITHDEV) &&
3244  !JsonHelper::Member_FromJson(json, flags, "release", data.release, allocator, JsonConstraint<S4Float>(0,32000))) return false;
3245  if ( !JsonHelper::Member_FromJson(json, flags, "mix", data.mix, allocator, JsonConstraint<S4Float>(-20,20))) return false;
3246  if ((flags & JSON_CVT_WITHDEV) &&
3247  !JsonHelper::Member_FromJson(json, flags, "factor", data.factor, allocator, JsonConstraint<S4Float>(1.0,8.0))) return false;
3248  if ( !JsonHelper::Member_FromJson(json, flags, "fidelity_on", data.fidelity_on, allocator)) return false;
3249  if ( !JsonHelper::Member_FromJson(json, flags, "fidelity", data.fidelity, allocator, JsonConstraint<S4Float>(0,100))) return false;
3250  if ((flags & JSON_CVT_WITHDEV) &&
3251  !JsonHelper::Member_FromJson(json, flags, "attack_min", data.attack_min, allocator, JsonConstraint<S4Float>(1,32000))) return false;
3252  if ((flags & JSON_CVT_WITHDEV) &&
3253  !JsonHelper::Member_FromJson(json, flags, "attack_max", data.attack_max, allocator, JsonConstraint<S4Float>(1,32000))) return false;
3254  if ((flags & JSON_CVT_WITHDEV) &&
3255  !JsonHelper::Member_FromJson(json, flags, "release_min", data.release_min, allocator, JsonConstraint<S4Float>(1,32000))) return false;
3256  if ((flags & JSON_CVT_WITHDEV) &&
3257  !JsonHelper::Member_FromJson(json, flags, "release_max", data.release_max, allocator, JsonConstraint<S4Float>(1,32000))) return false;
3258  return true;
3259  }
3260 
3261  static bool ToJson(JSON_Value &json, const json_bandlook& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
3262  if (sizeof(json_bandlook)==0) return true; // quick empty struct
3263  if (json.IsNull ()) {
3264  json.SetObject ();
3265  flags &= ~JSON_CVT_ONLYREQ; // children get all
3266  } else if (!json.IsObject()) {
3267  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
3268  return false;
3269  }
3270  if (!JsonHelper::Member_ToJson(json, flags, allocator, "on", data.on)) return false;
3271  if (!JsonHelper::Member_ToJson(json, flags, allocator, "drive", data.drive)) return false;
3272  if ((flags & JSON_CVT_WITHDEV) &&
3273  !JsonHelper::Member_ToJson(json, flags, allocator, "base_drive", data.base_drive)) return false;
3274  if (!JsonHelper::Member_ToJson(json, flags, allocator, "threshold", data.threshold)) return false;
3275  if ((flags & JSON_CVT_WITHDEV) &&
3276  !JsonHelper::Member_ToJson(json, flags, allocator, "base_thres", data.base_thres)) return false;
3277  if ((flags & JSON_CVT_WITHDEV) &&
3278  !JsonHelper::Member_ToJson(json, flags, allocator, "latency", data.latency)) return false;
3279  if ((flags & JSON_CVT_WITHDEV) &&
3280  !JsonHelper::Member_ToJson(json, flags, allocator, "attack", data.attack)) return false;
3281  if ((flags & JSON_CVT_WITHDEV) &&
3282  !JsonHelper::Member_ToJson(json, flags, allocator, "release", data.release)) return false;
3283  if (!JsonHelper::Member_ToJson(json, flags, allocator, "mix", data.mix)) return false;
3284  if ((flags & JSON_CVT_WITHDEV) &&
3285  !JsonHelper::Member_ToJson(json, flags, allocator, "factor", data.factor)) return false;
3286  if (!JsonHelper::Member_ToJson(json, flags, allocator, "fidelity_on", data.fidelity_on)) return false;
3287  if (!JsonHelper::Member_ToJson(json, flags, allocator, "fidelity", data.fidelity)) return false;
3288  if ((flags & JSON_CVT_WITHDEV) &&
3289  !JsonHelper::Member_ToJson(json, flags, allocator, "attack_min", data.attack_min)) return false;
3290  if ((flags & JSON_CVT_WITHDEV) &&
3291  !JsonHelper::Member_ToJson(json, flags, allocator, "attack_max", data.attack_max)) return false;
3292  if ((flags & JSON_CVT_WITHDEV) &&
3293  !JsonHelper::Member_ToJson(json, flags, allocator, "release_min", data.release_min)) return false;
3294  if ((flags & JSON_CVT_WITHDEV) &&
3295  !JsonHelper::Member_ToJson(json, flags, allocator, "release_max", data.release_max)) return false;
3296  if (json.MemberCount()==0) json.SetNull();
3297  return true;
3298  }
3299 
3300  static bool DiffToJson(JSON_Value &json, const json_bandlook& data [[maybe_unused]], json_bandlook& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
3301  if (sizeof(json_bandlook)==0) return true; // quick empty struct
3302  if (json.IsNull ()) {
3303  json.SetObject ();
3304  flags &= ~JSON_CVT_ONLYREQ; // children get all
3305  } else if (!json.IsObject()) {
3306  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
3307  return false;
3308  }
3309  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "on", data.on, ref.on)) return false;
3310  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "drive", data.drive, ref.drive)) return false;
3311  if ((flags & JSON_CVT_WITHDEV) &&
3312  !JsonHelper::Member_DiffToJson(json, flags, allocator, "base_drive", data.base_drive, ref.base_drive)) return false;
3313  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "threshold", data.threshold, ref.threshold)) return false;
3314  if ((flags & JSON_CVT_WITHDEV) &&
3315  !JsonHelper::Member_DiffToJson(json, flags, allocator, "base_thres", data.base_thres, ref.base_thres)) return false;
3316  if ((flags & JSON_CVT_WITHDEV) &&
3317  !JsonHelper::Member_DiffToJson(json, flags, allocator, "latency", data.latency, ref.latency)) return false;
3318  if ((flags & JSON_CVT_WITHDEV) &&
3319  !JsonHelper::Member_DiffToJson(json, flags, allocator, "attack", data.attack, ref.attack)) return false;
3320  if ((flags & JSON_CVT_WITHDEV) &&
3321  !JsonHelper::Member_DiffToJson(json, flags, allocator, "release", data.release, ref.release)) return false;
3322  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "mix", data.mix, ref.mix)) return false;
3323  if ((flags & JSON_CVT_WITHDEV) &&
3324  !JsonHelper::Member_DiffToJson(json, flags, allocator, "factor", data.factor, ref.factor)) return false;
3325  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "fidelity_on", data.fidelity_on, ref.fidelity_on)) return false;
3326  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "fidelity", data.fidelity, ref.fidelity)) return false;
3327  if ((flags & JSON_CVT_WITHDEV) &&
3328  !JsonHelper::Member_DiffToJson(json, flags, allocator, "attack_min", data.attack_min, ref.attack_min)) return false;
3329  if ((flags & JSON_CVT_WITHDEV) &&
3330  !JsonHelper::Member_DiffToJson(json, flags, allocator, "attack_max", data.attack_max, ref.attack_max)) return false;
3331  if ((flags & JSON_CVT_WITHDEV) &&
3332  !JsonHelper::Member_DiffToJson(json, flags, allocator, "release_min", data.release_min, ref.release_min)) return false;
3333  if ((flags & JSON_CVT_WITHDEV) &&
3334  !JsonHelper::Member_DiffToJson(json, flags, allocator, "release_max", data.release_max, ref.release_max)) return false;
3335  if (json.MemberCount()==0) json.SetNull();
3336  return true;
3337  }
3338 
3339  static void ForceChange(const json_bandlook& data [[maybe_unused]], json_bandlook& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
3340  JsonHelper::Member_ForceChange(allocator, "on", data.on, ref.on);
3341  JsonHelper::Member_ForceChange(allocator, "drive", data.drive, ref.drive);
3342  JsonHelper::Member_ForceChange(allocator, "base_drive", data.base_drive, ref.base_drive);
3343  JsonHelper::Member_ForceChange(allocator, "threshold", data.threshold, ref.threshold);
3344  JsonHelper::Member_ForceChange(allocator, "base_thres", data.base_thres, ref.base_thres);
3345  JsonHelper::Member_ForceChange(allocator, "latency", data.latency, ref.latency);
3346  JsonHelper::Member_ForceChange(allocator, "attack", data.attack, ref.attack);
3347  JsonHelper::Member_ForceChange(allocator, "release", data.release, ref.release);
3348  JsonHelper::Member_ForceChange(allocator, "mix", data.mix, ref.mix);
3349  JsonHelper::Member_ForceChange(allocator, "factor", data.factor, ref.factor);
3350  JsonHelper::Member_ForceChange(allocator, "fidelity_on", data.fidelity_on, ref.fidelity_on);
3351  JsonHelper::Member_ForceChange(allocator, "fidelity", data.fidelity, ref.fidelity);
3352  JsonHelper::Member_ForceChange(allocator, "attack_min", data.attack_min, ref.attack_min);
3353  JsonHelper::Member_ForceChange(allocator, "attack_max", data.attack_max, ref.attack_max);
3354  JsonHelper::Member_ForceChange(allocator, "release_min", data.release_min, ref.release_min);
3355  JsonHelper::Member_ForceChange(allocator, "release_max", data.release_max, ref.release_max);
3356  }
3357 
3358  };
3359  // === VU ===
3360  template <>
3361  struct JsonConvert<jsonvu_bandlook> {
3362 
3363  /* VU have no FromJson */
3364 
3365  static bool ToJson(JSON_Value &json, const jsonvu_bandlook& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
3366  if (sizeof(jsonvu_bandlook)==0) return true; // quick empty struct
3367  if (json.IsNull ()) {
3368  json.SetObject ();
3369  flags &= ~JSON_CVT_ONLYREQ; // children get all
3370  } else if (!json.IsObject()) {
3371  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
3372  return false;
3373  }
3374  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gain", data.gain)) return false;
3375  if ((flags & JSON_CVT_WITHDEV) &&
3376  !JsonHelper::Member_ToJson(json, flags, allocator, "fidel", data.fidel)) return false;
3377  if (!JsonHelper::Member_ToJson(json, flags, allocator, "attack_min_vu", data.attack_min_vu)) return false;
3378  if (!JsonHelper::Member_ToJson(json, flags, allocator, "attack_max_vu", data.attack_max_vu)) return false;
3379  if (!JsonHelper::Member_ToJson(json, flags, allocator, "release_min_vu", data.release_min_vu)) return false;
3380  if (!JsonHelper::Member_ToJson(json, flags, allocator, "release_max_vu", data.release_max_vu)) return false;
3381  if (json.MemberCount()==0) json.SetNull();
3382  return true;
3383  }
3384 
3385  static bool DiffToJson(JSON_Value &json, const jsonvu_bandlook& data [[maybe_unused]], jsonvu_bandlook& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
3386  if (sizeof(jsonvu_bandlook)==0) return true; // quick empty struct
3387  if (json.IsNull ()) {
3388  json.SetObject ();
3389  flags &= ~JSON_CVT_ONLYREQ; // children get all
3390  } else if (!json.IsObject()) {
3391  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
3392  return false;
3393  }
3394  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gain", data.gain, ref.gain)) return false;
3395  if ((flags & JSON_CVT_WITHDEV) &&
3396  !JsonHelper::Member_DiffToJson(json, flags, allocator, "fidel", data.fidel, ref.fidel)) return false;
3397  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "attack_min_vu", data.attack_min_vu, ref.attack_min_vu)) return false;
3398  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "attack_max_vu", data.attack_max_vu, ref.attack_max_vu)) return false;
3399  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "release_min_vu", data.release_min_vu, ref.release_min_vu)) return false;
3400  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "release_max_vu", data.release_max_vu, ref.release_max_vu)) return false;
3401  if (json.MemberCount()==0) json.SetNull();
3402  return true;
3403  }
3404 
3405  static void ForceChange(const jsonvu_bandlook& data [[maybe_unused]], jsonvu_bandlook& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
3406  JsonHelper::Member_ForceChange(allocator, "gain", data.gain, ref.gain);
3407  JsonHelper::Member_ForceChange(allocator, "fidel", data.fidel, ref.fidel);
3408  JsonHelper::Member_ForceChange(allocator, "attack_min_vu", data.attack_min_vu, ref.attack_min_vu);
3409  JsonHelper::Member_ForceChange(allocator, "attack_max_vu", data.attack_max_vu, ref.attack_max_vu);
3410  JsonHelper::Member_ForceChange(allocator, "release_min_vu", data.release_min_vu, ref.release_min_vu);
3411  JsonHelper::Member_ForceChange(allocator, "release_max_vu", data.release_max_vu, ref.release_max_vu);
3412  }
3413 
3414  };
3415 // === object bandlim ===
3416  // === Preset ===
3417  template <>
3418  struct JsonConvert<json_bandlim> {
3419 
3420  static bool FromJson(const JSON_Value& json, json_bandlim& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_bandlim> &constraints = JsonConstraint<json_bandlim>()) {
3421  if (sizeof(json_bandlim)==0) return true; // quick empty struct
3422  if (json.IsNull()) { return true; }
3423  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
3424  if ( !JsonHelper::Member_FromJson(json, flags, "on", data.on, allocator)) return false;
3425  if ( !JsonHelper::Member_FromJson(json, flags, "freq", data.freq, allocator, JsonConstraint<S4Float>(20,20000))) return false;
3426  if ( !JsonHelper::Member_FromJson(json, flags, "drive_on", data.drive_on, allocator)) return false;
3427  if ( !JsonHelper::Member_FromJson(json, flags, "drive", data.drive, allocator, JsonConstraint<S4Float>(-30,30))) return false;
3428  if ( !JsonHelper::Member_FromJson(json, flags, "threshold_on", data.threshold_on, allocator)) return false;
3429  if ( !JsonHelper::Member_FromJson(json, flags, "threshold", data.threshold, allocator, JsonConstraint<S4Float>(-6,6))) return false;
3430  if ((flags & JSON_CVT_WITHDEV) &&
3431  !JsonHelper::Member_FromJson(json, flags, "base_thres", data.base_thres, allocator, JsonConstraint<S4Float>(-30,30))) return false;
3432  if ((flags & JSON_CVT_WITHDEV) &&
3433  !JsonHelper::Member_FromJson(json, flags, "postgain", data.postgain, allocator, JsonConstraint<S4Float>(-30,30))) return false;
3434  if ( !JsonHelper::Member_FromJson(json, flags, "mix_on", data.mix_on, allocator)) return false;
3435  if ( !JsonHelper::Member_FromJson(json, flags, "mix", data.mix, allocator, JsonConstraint<S4Float>(-6,+6))) return false;
3436  if ( !JsonHelper::Member_FromJson(json, flags, "fidelity_on", data.fidelity_on, allocator)) return false;
3437  if ((flags & JSON_CVT_WITHDEV) &&
3438  !JsonHelper::Member_FromJson(json, flags, "fidelity_speed", data.fidelity_speed, allocator, JsonConstraint<S4Float>(0.1,60))) return false;
3439  if ( !JsonHelper::Member_FromJson(json, flags, "fidelity", data.fidelity, allocator, JsonConstraint<S4Float>(0,100))) return false;
3440  if ((flags & JSON_CVT_WITHDEV) &&
3441  !JsonHelper::Member_FromJson(json, flags, "listen", data.listen, allocator, JsonConstraint<int>(0,NB_BAND_LIM))) return false;
3442  return true;
3443  }
3444 
3445  static bool ToJson(JSON_Value &json, const json_bandlim& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
3446  if (sizeof(json_bandlim)==0) return true; // quick empty struct
3447  if (json.IsNull ()) {
3448  json.SetObject ();
3449  flags &= ~JSON_CVT_ONLYREQ; // children get all
3450  } else if (!json.IsObject()) {
3451  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
3452  return false;
3453  }
3454  if (!JsonHelper::Member_ToJson(json, flags, allocator, "on", data.on)) return false;
3455  if (!JsonHelper::Member_ToJson(json, flags, allocator, "freq", data.freq)) return false;
3456  if (!JsonHelper::Member_ToJson(json, flags, allocator, "drive_on", data.drive_on)) return false;
3457  if (!JsonHelper::Member_ToJson(json, flags, allocator, "drive", data.drive)) return false;
3458  if (!JsonHelper::Member_ToJson(json, flags, allocator, "threshold_on", data.threshold_on)) return false;
3459  if (!JsonHelper::Member_ToJson(json, flags, allocator, "threshold", data.threshold)) return false;
3460  if ((flags & JSON_CVT_WITHDEV) &&
3461  !JsonHelper::Member_ToJson(json, flags, allocator, "base_thres", data.base_thres)) return false;
3462  if ((flags & JSON_CVT_WITHDEV) &&
3463  !JsonHelper::Member_ToJson(json, flags, allocator, "postgain", data.postgain)) return false;
3464  if (!JsonHelper::Member_ToJson(json, flags, allocator, "mix_on", data.mix_on)) return false;
3465  if (!JsonHelper::Member_ToJson(json, flags, allocator, "mix", data.mix)) return false;
3466  if (!JsonHelper::Member_ToJson(json, flags, allocator, "fidelity_on", data.fidelity_on)) return false;
3467  if ((flags & JSON_CVT_WITHDEV) &&
3468  !JsonHelper::Member_ToJson(json, flags, allocator, "fidelity_speed", data.fidelity_speed)) return false;
3469  if (!JsonHelper::Member_ToJson(json, flags, allocator, "fidelity", data.fidelity)) return false;
3470  if ((flags & JSON_CVT_WITHDEV) &&
3471  !JsonHelper::Member_ToJson(json, flags, allocator, "listen", data.listen)) return false;
3472  if (json.MemberCount()==0) json.SetNull();
3473  return true;
3474  }
3475 
3476  static bool DiffToJson(JSON_Value &json, const json_bandlim& data [[maybe_unused]], json_bandlim& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
3477  if (sizeof(json_bandlim)==0) return true; // quick empty struct
3478  if (json.IsNull ()) {
3479  json.SetObject ();
3480  flags &= ~JSON_CVT_ONLYREQ; // children get all
3481  } else if (!json.IsObject()) {
3482  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
3483  return false;
3484  }
3485  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "on", data.on, ref.on)) return false;
3486  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "freq", data.freq, ref.freq)) return false;
3487  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "drive_on", data.drive_on, ref.drive_on)) return false;
3488  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "drive", data.drive, ref.drive)) return false;
3489  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "threshold_on", data.threshold_on, ref.threshold_on)) return false;
3490  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "threshold", data.threshold, ref.threshold)) return false;
3491  if ((flags & JSON_CVT_WITHDEV) &&
3492  !JsonHelper::Member_DiffToJson(json, flags, allocator, "base_thres", data.base_thres, ref.base_thres)) return false;
3493  if ((flags & JSON_CVT_WITHDEV) &&
3494  !JsonHelper::Member_DiffToJson(json, flags, allocator, "postgain", data.postgain, ref.postgain)) return false;
3495  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "mix_on", data.mix_on, ref.mix_on)) return false;
3496  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "mix", data.mix, ref.mix)) return false;
3497  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "fidelity_on", data.fidelity_on, ref.fidelity_on)) return false;
3498  if ((flags & JSON_CVT_WITHDEV) &&
3499  !JsonHelper::Member_DiffToJson(json, flags, allocator, "fidelity_speed", data.fidelity_speed, ref.fidelity_speed)) return false;
3500  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "fidelity", data.fidelity, ref.fidelity)) return false;
3501  if ((flags & JSON_CVT_WITHDEV) &&
3502  !JsonHelper::Member_DiffToJson(json, flags, allocator, "listen", data.listen, ref.listen)) return false;
3503  if (json.MemberCount()==0) json.SetNull();
3504  return true;
3505  }
3506 
3507  static void ForceChange(const json_bandlim& data [[maybe_unused]], json_bandlim& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
3508  JsonHelper::Member_ForceChange(allocator, "on", data.on, ref.on);
3509  JsonHelper::Member_ForceChange(allocator, "freq", data.freq, ref.freq);
3510  JsonHelper::Member_ForceChange(allocator, "drive_on", data.drive_on, ref.drive_on);
3511  JsonHelper::Member_ForceChange(allocator, "drive", data.drive, ref.drive);
3512  JsonHelper::Member_ForceChange(allocator, "threshold_on", data.threshold_on, ref.threshold_on);
3513  JsonHelper::Member_ForceChange(allocator, "threshold", data.threshold, ref.threshold);
3514  JsonHelper::Member_ForceChange(allocator, "base_thres", data.base_thres, ref.base_thres);
3515  JsonHelper::Member_ForceChange(allocator, "postgain", data.postgain, ref.postgain);
3516  JsonHelper::Member_ForceChange(allocator, "mix_on", data.mix_on, ref.mix_on);
3517  JsonHelper::Member_ForceChange(allocator, "mix", data.mix, ref.mix);
3518  JsonHelper::Member_ForceChange(allocator, "fidelity_on", data.fidelity_on, ref.fidelity_on);
3519  JsonHelper::Member_ForceChange(allocator, "fidelity_speed", data.fidelity_speed, ref.fidelity_speed);
3520  JsonHelper::Member_ForceChange(allocator, "fidelity", data.fidelity, ref.fidelity);
3521  JsonHelper::Member_ForceChange(allocator, "listen", data.listen, ref.listen);
3522  }
3523 
3524  };
3525  // === VU ===
3526  template <>
3527  struct JsonConvert<jsonvu_bandlim> {
3528 
3529  /* VU have no FromJson */
3530 
3531  static bool ToJson(JSON_Value &json, const jsonvu_bandlim& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
3532  if (sizeof(jsonvu_bandlim)==0) return true; // quick empty struct
3533  if (json.IsNull ()) {
3534  json.SetObject ();
3535  flags &= ~JSON_CVT_ONLYREQ; // children get all
3536  } else if (!json.IsObject()) {
3537  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
3538  return false;
3539  }
3540  if (!JsonHelper::Member_ToJson(json, flags, allocator, "splitin", data.splitin)) return false;
3541  if (!JsonHelper::Member_ToJson(json, flags, allocator, "splitout", data.splitout)) return false;
3542  if ((flags & JSON_CVT_WITHDEV) &&
3543  !JsonHelper::Member_ToJson(json, flags, allocator, "in", data.in)) return false;
3544  if ((flags & JSON_CVT_WITHDEV) &&
3545  !JsonHelper::Member_ToJson(json, flags, allocator, "fidel", data.fidel)) return false;
3546  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gain", data.gain)) return false;
3547  if (json.MemberCount()==0) json.SetNull();
3548  return true;
3549  }
3550 
3551  static bool DiffToJson(JSON_Value &json, const jsonvu_bandlim& data [[maybe_unused]], jsonvu_bandlim& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
3552  if (sizeof(jsonvu_bandlim)==0) return true; // quick empty struct
3553  if (json.IsNull ()) {
3554  json.SetObject ();
3555  flags &= ~JSON_CVT_ONLYREQ; // children get all
3556  } else if (!json.IsObject()) {
3557  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
3558  return false;
3559  }
3560  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "splitin", data.splitin, ref.splitin)) return false;
3561  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "splitout", data.splitout, ref.splitout)) return false;
3562  if ((flags & JSON_CVT_WITHDEV) &&
3563  !JsonHelper::Member_DiffToJson(json, flags, allocator, "in", data.in, ref.in)) return false;
3564  if ((flags & JSON_CVT_WITHDEV) &&
3565  !JsonHelper::Member_DiffToJson(json, flags, allocator, "fidel", data.fidel, ref.fidel)) return false;
3566  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gain", data.gain, ref.gain)) return false;
3567  if (json.MemberCount()==0) json.SetNull();
3568  return true;
3569  }
3570 
3571  static void ForceChange(const jsonvu_bandlim& data [[maybe_unused]], jsonvu_bandlim& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
3572  JsonHelper::Member_ForceChange(allocator, "splitin", data.splitin, ref.splitin);
3573  JsonHelper::Member_ForceChange(allocator, "splitout", data.splitout, ref.splitout);
3574  JsonHelper::Member_ForceChange(allocator, "in", data.in, ref.in);
3575  JsonHelper::Member_ForceChange(allocator, "fidel", data.fidel, ref.fidel);
3576  JsonHelper::Member_ForceChange(allocator, "gain", data.gain, ref.gain);
3577  }
3578 
3579  };
3580 // === object parameq ===
3581  // === Preset ===
3582  template <>
3583  struct JsonConvert<json_parameq> {
3584 
3585  static bool FromJson(const JSON_Value& json, json_parameq& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_parameq> &constraints = JsonConstraint<json_parameq>()) {
3586  if (sizeof(json_parameq)==0) return true; // quick empty struct
3587  if (json.IsNull()) { return true; }
3588  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
3589  if ( !JsonHelper::Member_FromJson(json, flags, "on", data.on, allocator)) return false;
3590  if ( !JsonHelper::Member_FromJson(json, flags, "eq_on", data.eq_on, allocator)) return false;
3591  if ( !JsonHelper::Member_FromJson(json, flags, "eq_freq", data.eq_freq, allocator, JsonConstraint<S4Float>(20,22000))) return false;
3592  if ( !JsonHelper::Member_FromJson(json, flags, "eq_Q", data.eq_Q, allocator, JsonConstraint<S4Float>(0.01,60.))) return false;
3593  if ( !JsonHelper::Member_FromJson(json, flags, "eq_gain", data.eq_gain, allocator, JsonConstraint<S4Float>(-12,12))) return false;
3594  return true;
3595  }
3596 
3597  static bool ToJson(JSON_Value &json, const json_parameq& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
3598  if (sizeof(json_parameq)==0) return true; // quick empty struct
3599  if (json.IsNull ()) {
3600  json.SetObject ();
3601  flags &= ~JSON_CVT_ONLYREQ; // children get all
3602  } else if (!json.IsObject()) {
3603  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
3604  return false;
3605  }
3606  if (!JsonHelper::Member_ToJson(json, flags, allocator, "on", data.on)) return false;
3607  if (!JsonHelper::Member_ToJson(json, flags, allocator, "eq_on", data.eq_on)) return false;
3608  if (!JsonHelper::Member_ToJson(json, flags, allocator, "eq_freq", data.eq_freq)) return false;
3609  if (!JsonHelper::Member_ToJson(json, flags, allocator, "eq_Q", data.eq_Q)) return false;
3610  if (!JsonHelper::Member_ToJson(json, flags, allocator, "eq_gain", data.eq_gain)) return false;
3611  if (json.MemberCount()==0) json.SetNull();
3612  return true;
3613  }
3614 
3615  static bool DiffToJson(JSON_Value &json, const json_parameq& data [[maybe_unused]], json_parameq& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
3616  if (sizeof(json_parameq)==0) return true; // quick empty struct
3617  if (json.IsNull ()) {
3618  json.SetObject ();
3619  flags &= ~JSON_CVT_ONLYREQ; // children get all
3620  } else if (!json.IsObject()) {
3621  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
3622  return false;
3623  }
3624  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "on", data.on, ref.on)) return false;
3625  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "eq_on", data.eq_on, ref.eq_on)) return false;
3626  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "eq_freq", data.eq_freq, ref.eq_freq)) return false;
3627  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "eq_Q", data.eq_Q, ref.eq_Q)) return false;
3628  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "eq_gain", data.eq_gain, ref.eq_gain)) return false;
3629  if (json.MemberCount()==0) json.SetNull();
3630  return true;
3631  }
3632 
3633  static void ForceChange(const json_parameq& data [[maybe_unused]], json_parameq& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
3634  JsonHelper::Member_ForceChange(allocator, "on", data.on, ref.on);
3635  JsonHelper::Member_ForceChange(allocator, "eq_on", data.eq_on, ref.eq_on);
3636  JsonHelper::Member_ForceChange(allocator, "eq_freq", data.eq_freq, ref.eq_freq);
3637  JsonHelper::Member_ForceChange(allocator, "eq_Q", data.eq_Q, ref.eq_Q);
3638  JsonHelper::Member_ForceChange(allocator, "eq_gain", data.eq_gain, ref.eq_gain);
3639  }
3640 
3641  };
3642  // === VU ===
3643  template <>
3644  struct JsonConvert<jsonvu_parameq> {
3645 
3646  /* VU have no FromJson */
3647 
3648  static bool ToJson(JSON_Value &json, const jsonvu_parameq& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
3649  if (sizeof(jsonvu_parameq)==0) return true; // quick empty struct
3650  if (json.IsNull ()) {
3651  json.SetObject ();
3652  flags &= ~JSON_CVT_ONLYREQ; // children get all
3653  } else if (!json.IsObject()) {
3654  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
3655  return false;
3656  }
3657  if (json.MemberCount()==0) json.SetNull();
3658  return true;
3659  }
3660 
3661  static bool DiffToJson(JSON_Value &json, const jsonvu_parameq& data [[maybe_unused]], jsonvu_parameq& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
3662  if (sizeof(jsonvu_parameq)==0) return true; // quick empty struct
3663  if (json.IsNull ()) {
3664  json.SetObject ();
3665  flags &= ~JSON_CVT_ONLYREQ; // children get all
3666  } else if (!json.IsObject()) {
3667  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
3668  return false;
3669  }
3670  if (json.MemberCount()==0) json.SetNull();
3671  return true;
3672  }
3673 
3674  static void ForceChange(const jsonvu_parameq& data [[maybe_unused]], jsonvu_parameq& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
3675  }
3676 
3677  };
3678 // === object bassclip ===
3679  // === Preset ===
3680  template <>
3681  struct JsonConvert<json_bassclip> {
3682 
3683  static bool FromJson(const JSON_Value& json, json_bassclip& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_bassclip> &constraints = JsonConstraint<json_bassclip>()) {
3684  if (sizeof(json_bassclip)==0) return true; // quick empty struct
3685  if (json.IsNull()) { return true; }
3686  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
3687  if ( !JsonHelper::Member_FromJson(json, flags, "on", data.on, allocator)) return false;
3688  if ((flags & JSON_CVT_WITHDEV) &&
3689  !JsonHelper::Member_FromJson(json, flags, "freq", data.freq, allocator, JsonConstraint<S4Float>(20,22000))) return false;
3690  if ( !JsonHelper::Member_FromJson(json, flags, "drive", data.drive, allocator, JsonConstraint<S4Float>(-10,10))) return false;
3691  if ((flags & JSON_CVT_WITHDEV) &&
3692  !JsonHelper::Member_FromJson(json, flags, "base_drive", data.base_drive, allocator, JsonConstraint<S4Float>(-50,10))) return false;
3693  if ( !JsonHelper::Member_FromJson(json, flags, "threshold", data.threshold, allocator, JsonConstraint<S4Float>(-8,8))) return false;
3694  if ((flags & JSON_CVT_WITHDEV) &&
3695  !JsonHelper::Member_FromJson(json, flags, "base_thres", data.base_thres, allocator, JsonConstraint<S4Float>(-20,20))) return false;
3696  if ((flags & JSON_CVT_WITHDEV) &&
3697  !JsonHelper::Member_FromJson(json, flags, "postgain", data.postgain, allocator, JsonConstraint<S4Float>(-30,30))) return false;
3698  return true;
3699  }
3700 
3701  static bool ToJson(JSON_Value &json, const json_bassclip& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
3702  if (sizeof(json_bassclip)==0) return true; // quick empty struct
3703  if (json.IsNull ()) {
3704  json.SetObject ();
3705  flags &= ~JSON_CVT_ONLYREQ; // children get all
3706  } else if (!json.IsObject()) {
3707  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
3708  return false;
3709  }
3710  if (!JsonHelper::Member_ToJson(json, flags, allocator, "on", data.on)) return false;
3711  if ((flags & JSON_CVT_WITHDEV) &&
3712  !JsonHelper::Member_ToJson(json, flags, allocator, "freq", data.freq)) return false;
3713  if (!JsonHelper::Member_ToJson(json, flags, allocator, "drive", data.drive)) return false;
3714  if ((flags & JSON_CVT_WITHDEV) &&
3715  !JsonHelper::Member_ToJson(json, flags, allocator, "base_drive", data.base_drive)) return false;
3716  if (!JsonHelper::Member_ToJson(json, flags, allocator, "threshold", data.threshold)) return false;
3717  if ((flags & JSON_CVT_WITHDEV) &&
3718  !JsonHelper::Member_ToJson(json, flags, allocator, "base_thres", data.base_thres)) return false;
3719  if ((flags & JSON_CVT_WITHDEV) &&
3720  !JsonHelper::Member_ToJson(json, flags, allocator, "postgain", data.postgain)) return false;
3721  if (json.MemberCount()==0) json.SetNull();
3722  return true;
3723  }
3724 
3725  static bool DiffToJson(JSON_Value &json, const json_bassclip& data [[maybe_unused]], json_bassclip& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
3726  if (sizeof(json_bassclip)==0) return true; // quick empty struct
3727  if (json.IsNull ()) {
3728  json.SetObject ();
3729  flags &= ~JSON_CVT_ONLYREQ; // children get all
3730  } else if (!json.IsObject()) {
3731  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
3732  return false;
3733  }
3734  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "on", data.on, ref.on)) return false;
3735  if ((flags & JSON_CVT_WITHDEV) &&
3736  !JsonHelper::Member_DiffToJson(json, flags, allocator, "freq", data.freq, ref.freq)) return false;
3737  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "drive", data.drive, ref.drive)) return false;
3738  if ((flags & JSON_CVT_WITHDEV) &&
3739  !JsonHelper::Member_DiffToJson(json, flags, allocator, "base_drive", data.base_drive, ref.base_drive)) return false;
3740  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "threshold", data.threshold, ref.threshold)) return false;
3741  if ((flags & JSON_CVT_WITHDEV) &&
3742  !JsonHelper::Member_DiffToJson(json, flags, allocator, "base_thres", data.base_thres, ref.base_thres)) return false;
3743  if ((flags & JSON_CVT_WITHDEV) &&
3744  !JsonHelper::Member_DiffToJson(json, flags, allocator, "postgain", data.postgain, ref.postgain)) return false;
3745  if (json.MemberCount()==0) json.SetNull();
3746  return true;
3747  }
3748 
3749  static void ForceChange(const json_bassclip& data [[maybe_unused]], json_bassclip& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
3750  JsonHelper::Member_ForceChange(allocator, "on", data.on, ref.on);
3751  JsonHelper::Member_ForceChange(allocator, "freq", data.freq, ref.freq);
3752  JsonHelper::Member_ForceChange(allocator, "drive", data.drive, ref.drive);
3753  JsonHelper::Member_ForceChange(allocator, "base_drive", data.base_drive, ref.base_drive);
3754  JsonHelper::Member_ForceChange(allocator, "threshold", data.threshold, ref.threshold);
3755  JsonHelper::Member_ForceChange(allocator, "base_thres", data.base_thres, ref.base_thres);
3756  JsonHelper::Member_ForceChange(allocator, "postgain", data.postgain, ref.postgain);
3757  }
3758 
3759  };
3760  // === VU ===
3761  template <>
3762  struct JsonConvert<jsonvu_bassclip> {
3763 
3764  /* VU have no FromJson */
3765 
3766  static bool ToJson(JSON_Value &json, const jsonvu_bassclip& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
3767  if (sizeof(jsonvu_bassclip)==0) return true; // quick empty struct
3768  if (json.IsNull ()) {
3769  json.SetObject ();
3770  flags &= ~JSON_CVT_ONLYREQ; // children get all
3771  } else if (!json.IsObject()) {
3772  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
3773  return false;
3774  }
3775  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gain", data.gain)) return false;
3776  if (json.MemberCount()==0) json.SetNull();
3777  return true;
3778  }
3779 
3780  static bool DiffToJson(JSON_Value &json, const jsonvu_bassclip& data [[maybe_unused]], jsonvu_bassclip& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
3781  if (sizeof(jsonvu_bassclip)==0) return true; // quick empty struct
3782  if (json.IsNull ()) {
3783  json.SetObject ();
3784  flags &= ~JSON_CVT_ONLYREQ; // children get all
3785  } else if (!json.IsObject()) {
3786  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
3787  return false;
3788  }
3789  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gain", data.gain, ref.gain)) return false;
3790  if (json.MemberCount()==0) json.SetNull();
3791  return true;
3792  }
3793 
3794  static void ForceChange(const jsonvu_bassclip& data [[maybe_unused]], jsonvu_bassclip& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
3795  JsonHelper::Member_ForceChange(allocator, "gain", data.gain, ref.gain);
3796  }
3797 
3798  };
3799 // === object limiter ===
3800  // === Preset ===
3801  template <>
3802  struct JsonConvert<json_limiter> {
3803 
3804  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>()) {
3805  if (sizeof(json_limiter)==0) return true; // quick empty struct
3806  if (json.IsNull()) { return true; }
3807  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
3808  if ( !JsonHelper::Member_FromJson(json, flags, "drive_on", data.drive_on, allocator)) return false;
3809  if ( !JsonHelper::Member_FromJson(json, flags, "drive", data.drive, allocator, JsonConstraint<S4Float>(-20,20))) return false;
3810  if ((flags & JSON_CVT_WITHDEV) &&
3811  !JsonHelper::Member_FromJson(json, flags, "base_drive", data.base_drive, allocator, JsonConstraint<S4Float>(-20,20))) return false;
3812  if ( !JsonHelper::Member_FromJson(json, flags, "threshold", data.threshold, allocator, JsonConstraint<S4Float>(-20,20))) return false;
3813  if ((flags & JSON_CVT_WITHDEV) &&
3814  !JsonHelper::Member_FromJson(json, flags, "base_thres", data.base_thres, allocator, JsonConstraint<S4Float>(-20,20))) return false;
3815  if ( !JsonHelper::Member_FromJson(json, flags, "latency", data.latency, allocator, JsonConstraint<S4Float>(0.5,10))) return false;
3816  if ((flags & JSON_CVT_WITHDEV) &&
3817  !JsonHelper::Member_FromJson(json, flags, "attack", data.attack, allocator, JsonConstraint<S4Float>(1,32000))) return false;
3818  if ( !JsonHelper::Member_FromJson(json, flags, "release", data.release, allocator)) return false;
3819  if ( !JsonHelper::Member_FromJson(json, flags, "overdrive_on", data.overdrive_on, allocator)) return false;
3820  if ( !JsonHelper::Member_FromJson(json, flags, "overdrive", data.overdrive, allocator, JsonConstraint<S4Float>(0,4))) return false;
3821  if ((flags & JSON_CVT_WITHDEV) &&
3822  !JsonHelper::Member_FromJson(json, flags, "factor", data.factor, allocator, JsonConstraint<S4Float>(1.0,8.0))) return false;
3823  if ((flags & JSON_CVT_WITHDEV) &&
3824  !JsonHelper::Member_FromJson(json, flags, "rel_tab", data.rel_tab, allocator, JsonConstraint<S4Float>(1,32000))) return false;
3825  if ( !JsonHelper::Member_FromJson(json, flags, "driveless_on", data.driveless_on, allocator)) return false;
3826  if ( !JsonHelper::Member_FromJson(json, flags, "driveless", data.driveless, allocator, JsonConstraint<S4Float>(-4,0))) return false;
3827  if ((flags & JSON_CVT_WITHDEV) &&
3828  !JsonHelper::Member_FromJson(json, flags, "post_on", data.post_on, allocator)) return false;
3829  if ((flags & JSON_CVT_WITHDEV) &&
3830  !JsonHelper::Member_FromJson(json, flags, "post_thres", data.post_thres, allocator, JsonConstraint<S4Float>(-30,30))) return false;
3831  if ((flags & JSON_CVT_WITHDEV) &&
3832  !JsonHelper::Member_FromJson(json, flags, "post_filter", data.post_filter, allocator)) return false;
3833  if ((flags & JSON_CVT_WITHDEV) &&
3834  !JsonHelper::Member_FromJson(json, flags, "post_window", data.post_window, allocator)) return false;
3835  if ((flags & JSON_CVT_WITHDEV) &&
3836  !JsonHelper::Member_FromJson(json, flags, "post_param_s", data.post_param_s, allocator, JsonConstraint<S4Float>(0.1,20.0))) return false;
3837  if ((flags & JSON_CVT_WITHDEV) &&
3838  !JsonHelper::Member_FromJson(json, flags, "post_param_k", data.post_param_k, allocator, JsonConstraint<S4Float>(0.1,10.0))) return false;
3839  if ((flags & JSON_CVT_WITHDEV) &&
3840  !JsonHelper::Member_FromJson(json, flags, "clip_on", data.clip_on, allocator)) return false;
3841  if ((flags & JSON_CVT_WITHDEV) &&
3842  !JsonHelper::Member_FromJson(json, flags, "cliplow_on", data.cliplow_on, allocator)) return false;
3843  return true;
3844  }
3845 
3846  static bool ToJson(JSON_Value &json, const json_limiter& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
3847  if (sizeof(json_limiter)==0) return true; // quick empty struct
3848  if (json.IsNull ()) {
3849  json.SetObject ();
3850  flags &= ~JSON_CVT_ONLYREQ; // children get all
3851  } else if (!json.IsObject()) {
3852  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
3853  return false;
3854  }
3855  if (!JsonHelper::Member_ToJson(json, flags, allocator, "drive_on", data.drive_on)) return false;
3856  if (!JsonHelper::Member_ToJson(json, flags, allocator, "drive", data.drive)) return false;
3857  if ((flags & JSON_CVT_WITHDEV) &&
3858  !JsonHelper::Member_ToJson(json, flags, allocator, "base_drive", data.base_drive)) return false;
3859  if (!JsonHelper::Member_ToJson(json, flags, allocator, "threshold", data.threshold)) return false;
3860  if ((flags & JSON_CVT_WITHDEV) &&
3861  !JsonHelper::Member_ToJson(json, flags, allocator, "base_thres", data.base_thres)) return false;
3862  if (!JsonHelper::Member_ToJson(json, flags, allocator, "latency", data.latency)) return false;
3863  if ((flags & JSON_CVT_WITHDEV) &&
3864  !JsonHelper::Member_ToJson(json, flags, allocator, "attack", data.attack)) return false;
3865  if (!JsonHelper::Member_ToJson(json, flags, allocator, "release", data.release)) return false;
3866  if (!JsonHelper::Member_ToJson(json, flags, allocator, "overdrive_on", data.overdrive_on)) return false;
3867  if (!JsonHelper::Member_ToJson(json, flags, allocator, "overdrive", data.overdrive)) return false;
3868  if ((flags & JSON_CVT_WITHDEV) &&
3869  !JsonHelper::Member_ToJson(json, flags, allocator, "factor", data.factor)) return false;
3870  if ((flags & JSON_CVT_WITHDEV) &&
3871  !JsonHelper::Member_ToJson(json, flags, allocator, "rel_tab", data.rel_tab)) return false;
3872  if (!JsonHelper::Member_ToJson(json, flags, allocator, "driveless_on", data.driveless_on)) return false;
3873  if (!JsonHelper::Member_ToJson(json, flags, allocator, "driveless", data.driveless)) return false;
3874  if ((flags & JSON_CVT_WITHDEV) &&
3875  !JsonHelper::Member_ToJson(json, flags, allocator, "post_on", data.post_on)) return false;
3876  if ((flags & JSON_CVT_WITHDEV) &&
3877  !JsonHelper::Member_ToJson(json, flags, allocator, "post_thres", data.post_thres)) return false;
3878  if ((flags & JSON_CVT_WITHDEV) &&
3879  !JsonHelper::Member_ToJson(json, flags, allocator, "post_filter", data.post_filter)) return false;
3880  if ((flags & JSON_CVT_WITHDEV) &&
3881  !JsonHelper::Member_ToJson(json, flags, allocator, "post_window", data.post_window)) return false;
3882  if ((flags & JSON_CVT_WITHDEV) &&
3883  !JsonHelper::Member_ToJson(json, flags, allocator, "post_param_s", data.post_param_s)) return false;
3884  if ((flags & JSON_CVT_WITHDEV) &&
3885  !JsonHelper::Member_ToJson(json, flags, allocator, "post_param_k", data.post_param_k)) return false;
3886  if ((flags & JSON_CVT_WITHDEV) &&
3887  !JsonHelper::Member_ToJson(json, flags, allocator, "clip_on", data.clip_on)) return false;
3888  if ((flags & JSON_CVT_WITHDEV) &&
3889  !JsonHelper::Member_ToJson(json, flags, allocator, "cliplow_on", data.cliplow_on)) return false;
3890  if (json.MemberCount()==0) json.SetNull();
3891  return true;
3892  }
3893 
3894  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]]) {
3895  if (sizeof(json_limiter)==0) return true; // quick empty struct
3896  if (json.IsNull ()) {
3897  json.SetObject ();
3898  flags &= ~JSON_CVT_ONLYREQ; // children get all
3899  } else if (!json.IsObject()) {
3900  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
3901  return false;
3902  }
3903  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "drive_on", data.drive_on, ref.drive_on)) return false;
3904  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "drive", data.drive, ref.drive)) return false;
3905  if ((flags & JSON_CVT_WITHDEV) &&
3906  !JsonHelper::Member_DiffToJson(json, flags, allocator, "base_drive", data.base_drive, ref.base_drive)) return false;
3907  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "threshold", data.threshold, ref.threshold)) return false;
3908  if ((flags & JSON_CVT_WITHDEV) &&
3909  !JsonHelper::Member_DiffToJson(json, flags, allocator, "base_thres", data.base_thres, ref.base_thres)) return false;
3910  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "latency", data.latency, ref.latency)) return false;
3911  if ((flags & JSON_CVT_WITHDEV) &&
3912  !JsonHelper::Member_DiffToJson(json, flags, allocator, "attack", data.attack, ref.attack)) return false;
3913  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "release", data.release, ref.release)) return false;
3914  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "overdrive_on", data.overdrive_on, ref.overdrive_on)) return false;
3915  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "overdrive", data.overdrive, ref.overdrive)) return false;
3916  if ((flags & JSON_CVT_WITHDEV) &&
3917  !JsonHelper::Member_DiffToJson(json, flags, allocator, "factor", data.factor, ref.factor)) return false;
3918  if ((flags & JSON_CVT_WITHDEV) &&
3919  !JsonHelper::Member_DiffToJson(json, flags, allocator, "rel_tab", data.rel_tab, ref.rel_tab)) return false;
3920  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "driveless_on", data.driveless_on, ref.driveless_on)) return false;
3921  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "driveless", data.driveless, ref.driveless)) return false;
3922  if ((flags & JSON_CVT_WITHDEV) &&
3923  !JsonHelper::Member_DiffToJson(json, flags, allocator, "post_on", data.post_on, ref.post_on)) return false;
3924  if ((flags & JSON_CVT_WITHDEV) &&
3925  !JsonHelper::Member_DiffToJson(json, flags, allocator, "post_thres", data.post_thres, ref.post_thres)) return false;
3926  if ((flags & JSON_CVT_WITHDEV) &&
3927  !JsonHelper::Member_DiffToJson(json, flags, allocator, "post_filter", data.post_filter, ref.post_filter)) return false;
3928  if ((flags & JSON_CVT_WITHDEV) &&
3929  !JsonHelper::Member_DiffToJson(json, flags, allocator, "post_window", data.post_window, ref.post_window)) return false;
3930  if ((flags & JSON_CVT_WITHDEV) &&
3931  !JsonHelper::Member_DiffToJson(json, flags, allocator, "post_param_s", data.post_param_s, ref.post_param_s)) return false;
3932  if ((flags & JSON_CVT_WITHDEV) &&
3933  !JsonHelper::Member_DiffToJson(json, flags, allocator, "post_param_k", data.post_param_k, ref.post_param_k)) return false;
3934  if ((flags & JSON_CVT_WITHDEV) &&
3935  !JsonHelper::Member_DiffToJson(json, flags, allocator, "clip_on", data.clip_on, ref.clip_on)) return false;
3936  if ((flags & JSON_CVT_WITHDEV) &&
3937  !JsonHelper::Member_DiffToJson(json, flags, allocator, "cliplow_on", data.cliplow_on, ref.cliplow_on)) return false;
3938  if (json.MemberCount()==0) json.SetNull();
3939  return true;
3940  }
3941 
3942  static void ForceChange(const json_limiter& data [[maybe_unused]], json_limiter& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
3943  JsonHelper::Member_ForceChange(allocator, "drive_on", data.drive_on, ref.drive_on);
3944  JsonHelper::Member_ForceChange(allocator, "drive", data.drive, ref.drive);
3945  JsonHelper::Member_ForceChange(allocator, "base_drive", data.base_drive, ref.base_drive);
3946  JsonHelper::Member_ForceChange(allocator, "threshold", data.threshold, ref.threshold);
3947  JsonHelper::Member_ForceChange(allocator, "base_thres", data.base_thres, ref.base_thres);
3948  JsonHelper::Member_ForceChange(allocator, "latency", data.latency, ref.latency);
3949  JsonHelper::Member_ForceChange(allocator, "attack", data.attack, ref.attack);
3950  JsonHelper::Member_ForceChange(allocator, "release", data.release, ref.release);
3951  JsonHelper::Member_ForceChange(allocator, "overdrive_on", data.overdrive_on, ref.overdrive_on);
3952  JsonHelper::Member_ForceChange(allocator, "overdrive", data.overdrive, ref.overdrive);
3953  JsonHelper::Member_ForceChange(allocator, "factor", data.factor, ref.factor);
3954  JsonHelper::Member_ForceChange(allocator, "rel_tab", data.rel_tab, ref.rel_tab);
3955  JsonHelper::Member_ForceChange(allocator, "driveless_on", data.driveless_on, ref.driveless_on);
3956  JsonHelper::Member_ForceChange(allocator, "driveless", data.driveless, ref.driveless);
3957  JsonHelper::Member_ForceChange(allocator, "post_on", data.post_on, ref.post_on);
3958  JsonHelper::Member_ForceChange(allocator, "post_thres", data.post_thres, ref.post_thres);
3959  JsonHelper::Member_ForceChange(allocator, "post_filter", data.post_filter, ref.post_filter);
3960  JsonHelper::Member_ForceChange(allocator, "post_window", data.post_window, ref.post_window);
3961  JsonHelper::Member_ForceChange(allocator, "post_param_s", data.post_param_s, ref.post_param_s);
3962  JsonHelper::Member_ForceChange(allocator, "post_param_k", data.post_param_k, ref.post_param_k);
3963  JsonHelper::Member_ForceChange(allocator, "clip_on", data.clip_on, ref.clip_on);
3964  JsonHelper::Member_ForceChange(allocator, "cliplow_on", data.cliplow_on, ref.cliplow_on);
3965  }
3966 
3967  };
3968  // === VU ===
3969  template <>
3970  struct JsonConvert<jsonvu_limiter> {
3971 
3972  /* VU have no FromJson */
3973 
3974  static bool ToJson(JSON_Value &json, const jsonvu_limiter& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
3975  if (sizeof(jsonvu_limiter)==0) return true; // quick empty struct
3976  if (json.IsNull ()) {
3977  json.SetObject ();
3978  flags &= ~JSON_CVT_ONLYREQ; // children get all
3979  } else if (!json.IsObject()) {
3980  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
3981  return false;
3982  }
3983  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gain", data.gain)) return false;
3984  if ((flags & JSON_CVT_WITHDEV) &&
3985  !JsonHelper::Member_ToJson(json, flags, allocator, "lkatt", data.lkatt)) return false;
3986  if ((flags & JSON_CVT_WITHDEV) &&
3987  !JsonHelper::Member_ToJson(json, flags, allocator, "post", data.post)) return false;
3988  if ((flags & JSON_CVT_WITHDEV) &&
3989  !JsonHelper::Member_ToJson(json, flags, allocator, "over", data.over)) return false;
3990  if (json.MemberCount()==0) json.SetNull();
3991  return true;
3992  }
3993 
3994  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]]) {
3995  if (sizeof(jsonvu_limiter)==0) return true; // quick empty struct
3996  if (json.IsNull ()) {
3997  json.SetObject ();
3998  flags &= ~JSON_CVT_ONLYREQ; // children get all
3999  } else if (!json.IsObject()) {
4000  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4001  return false;
4002  }
4003  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gain", data.gain, ref.gain)) return false;
4004  if ((flags & JSON_CVT_WITHDEV) &&
4005  !JsonHelper::Member_DiffToJson(json, flags, allocator, "lkatt", data.lkatt, ref.lkatt)) return false;
4006  if ((flags & JSON_CVT_WITHDEV) &&
4007  !JsonHelper::Member_DiffToJson(json, flags, allocator, "post", data.post, ref.post)) return false;
4008  if ((flags & JSON_CVT_WITHDEV) &&
4009  !JsonHelper::Member_DiffToJson(json, flags, allocator, "over", data.over, ref.over)) return false;
4010  if (json.MemberCount()==0) json.SetNull();
4011  return true;
4012  }
4013 
4014  static void ForceChange(const jsonvu_limiter& data [[maybe_unused]], jsonvu_limiter& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4015  JsonHelper::Member_ForceChange(allocator, "gain", data.gain, ref.gain);
4016  JsonHelper::Member_ForceChange(allocator, "lkatt", data.lkatt, ref.lkatt);
4017  JsonHelper::Member_ForceChange(allocator, "post", data.post, ref.post);
4018  JsonHelper::Member_ForceChange(allocator, "over", data.over, ref.over);
4019  }
4020 
4021  };
4022 // === object output ===
4023  // === Preset ===
4024  template <>
4025  struct JsonConvert<json_output> {
4026 
4027  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>()) {
4028  if (sizeof(json_output)==0) return true; // quick empty struct
4029  if (json.IsNull()) { return true; }
4030  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
4031  return true;
4032  }
4033 
4034  static bool ToJson(JSON_Value &json, const json_output& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4035  if (sizeof(json_output)==0) return true; // quick empty struct
4036  if (json.IsNull ()) {
4037  json.SetObject ();
4038  flags &= ~JSON_CVT_ONLYREQ; // children get all
4039  } else if (!json.IsObject()) {
4040  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4041  return false;
4042  }
4043  if (json.MemberCount()==0) json.SetNull();
4044  return true;
4045  }
4046 
4047  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]]) {
4048  if (sizeof(json_output)==0) return true; // quick empty struct
4049  if (json.IsNull ()) {
4050  json.SetObject ();
4051  flags &= ~JSON_CVT_ONLYREQ; // children get all
4052  } else if (!json.IsObject()) {
4053  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4054  return false;
4055  }
4056  if (json.MemberCount()==0) json.SetNull();
4057  return true;
4058  }
4059 
4060  static void ForceChange(const json_output& data [[maybe_unused]], json_output& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4061  }
4062 
4063  };
4064  // === VU ===
4065  template <>
4066  struct JsonConvert<jsonvu_output> {
4067 
4068  /* VU have no FromJson */
4069 
4070  static bool ToJson(JSON_Value &json, const jsonvu_output& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4071  if (sizeof(jsonvu_output)==0) return true; // quick empty struct
4072  if (json.IsNull ()) {
4073  json.SetObject ();
4074  flags &= ~JSON_CVT_ONLYREQ; // children get all
4075  } else if (!json.IsObject()) {
4076  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4077  return false;
4078  }
4079  if (!JsonHelper::Member_ToJson(json, flags, allocator, "vu", data.vu)) return false;
4080  if (json.MemberCount()==0) json.SetNull();
4081  return true;
4082  }
4083 
4084  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]]) {
4085  if (sizeof(jsonvu_output)==0) return true; // quick empty struct
4086  if (json.IsNull ()) {
4087  json.SetObject ();
4088  flags &= ~JSON_CVT_ONLYREQ; // children get all
4089  } else if (!json.IsObject()) {
4090  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4091  return false;
4092  }
4093  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "vu", data.vu, ref.vu)) return false;
4094  if (json.MemberCount()==0) json.SetNull();
4095  return true;
4096  }
4097 
4098  static void ForceChange(const jsonvu_output& data [[maybe_unused]], jsonvu_output& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4099  JsonHelper::Member_ForceChange(allocator, "vu", data.vu, ref.vu);
4100  }
4101 
4102  };
4103 // === object r128 ===
4104  // === Preset ===
4105  template <>
4106  struct JsonConvert<json_r128> {
4107 
4108  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>()) {
4109  if (sizeof(json_r128)==0) return true; // quick empty struct
4110  if (json.IsNull()) { return true; }
4111  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
4112  if ( !JsonHelper::Member_FromJson(json, flags, "on", data.on, allocator)) return false;
4113  if ( !JsonHelper::Member_FromJson(json, flags, "target", data.target, allocator, JsonConstraint<S4Float>(-36,0))) return false;
4114  if ((flags & JSON_CVT_WITHDEV) &&
4115  !JsonHelper::Member_FromJson(json, flags, "attack", data.attack, allocator, JsonConstraint<S4Float>(0.01,10))) return false;
4116  if ((flags & JSON_CVT_WITHDEV) &&
4117  !JsonHelper::Member_FromJson(json, flags, "release", data.release, allocator, JsonConstraint<S4Float>(0.01,10))) return false;
4118  return true;
4119  }
4120 
4121  static bool ToJson(JSON_Value &json, const json_r128& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4122  if (sizeof(json_r128)==0) return true; // quick empty struct
4123  if (json.IsNull ()) {
4124  json.SetObject ();
4125  flags &= ~JSON_CVT_ONLYREQ; // children get all
4126  } else if (!json.IsObject()) {
4127  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4128  return false;
4129  }
4130  if (!JsonHelper::Member_ToJson(json, flags, allocator, "on", data.on)) return false;
4131  if (!JsonHelper::Member_ToJson(json, flags, allocator, "target", data.target)) return false;
4132  if ((flags & JSON_CVT_WITHDEV) &&
4133  !JsonHelper::Member_ToJson(json, flags, allocator, "attack", data.attack)) return false;
4134  if ((flags & JSON_CVT_WITHDEV) &&
4135  !JsonHelper::Member_ToJson(json, flags, allocator, "release", data.release)) return false;
4136  if (json.MemberCount()==0) json.SetNull();
4137  return true;
4138  }
4139 
4140  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]]) {
4141  if (sizeof(json_r128)==0) return true; // quick empty struct
4142  if (json.IsNull ()) {
4143  json.SetObject ();
4144  flags &= ~JSON_CVT_ONLYREQ; // children get all
4145  } else if (!json.IsObject()) {
4146  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4147  return false;
4148  }
4149  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "on", data.on, ref.on)) return false;
4150  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "target", data.target, ref.target)) return false;
4151  if ((flags & JSON_CVT_WITHDEV) &&
4152  !JsonHelper::Member_DiffToJson(json, flags, allocator, "attack", data.attack, ref.attack)) return false;
4153  if ((flags & JSON_CVT_WITHDEV) &&
4154  !JsonHelper::Member_DiffToJson(json, flags, allocator, "release", data.release, ref.release)) return false;
4155  if (json.MemberCount()==0) json.SetNull();
4156  return true;
4157  }
4158 
4159  static void ForceChange(const json_r128& data [[maybe_unused]], json_r128& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4160  JsonHelper::Member_ForceChange(allocator, "on", data.on, ref.on);
4161  JsonHelper::Member_ForceChange(allocator, "target", data.target, ref.target);
4162  JsonHelper::Member_ForceChange(allocator, "attack", data.attack, ref.attack);
4163  JsonHelper::Member_ForceChange(allocator, "release", data.release, ref.release);
4164  }
4165 
4166  };
4167  // === VU ===
4168  template <>
4169  struct JsonConvert<jsonvu_r128> {
4170 
4171  /* VU have no FromJson */
4172 
4173  static bool ToJson(JSON_Value &json, const jsonvu_r128& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4174  if (sizeof(jsonvu_r128)==0) return true; // quick empty struct
4175  if (json.IsNull ()) {
4176  json.SetObject ();
4177  flags &= ~JSON_CVT_ONLYREQ; // children get all
4178  } else if (!json.IsObject()) {
4179  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4180  return false;
4181  }
4182  if (!JsonHelper::Member_ToJson(json, flags, allocator, "vu_on", data.vu_on)) return false;
4183  if (!JsonHelper::Member_ToJson(json, flags, allocator, "vu_target", data.vu_target)) return false;
4184  if ((flags & JSON_CVT_WITHDEV) &&
4185  !JsonHelper::Member_ToJson(json, flags, allocator, "bs_moment", data.bs_moment)) return false;
4186  if ((flags & JSON_CVT_WITHDEV) &&
4187  !JsonHelper::Member_ToJson(json, flags, allocator, "bs_short", data.bs_short)) return false;
4188  if (!JsonHelper::Member_ToJson(json, flags, allocator, "bs_long", data.bs_long)) return false;
4189  if (!JsonHelper::Member_ToJson(json, flags, allocator, "bs_user", data.bs_user)) return false;
4190  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gain", data.gain)) return false;
4191  if ((flags & JSON_CVT_WITHDEV) &&
4192  !JsonHelper::Member_ToJson(json, flags, allocator, "bs_psr", data.bs_psr)) return false;
4193  if ((flags & JSON_CVT_WITHDEV) &&
4194  !JsonHelper::Member_ToJson(json, flags, allocator, "bs_plr", data.bs_plr)) return false;
4195  if ((flags & JSON_CVT_WITHDEV) &&
4196  !JsonHelper::Member_ToJson(json, flags, allocator, "bs_moment_pk", data.bs_moment_pk)) return false;
4197  if ((flags & JSON_CVT_WITHDEV) &&
4198  !JsonHelper::Member_ToJson(json, flags, allocator, "bs_short_pk", data.bs_short_pk)) return false;
4199  if ((flags & JSON_CVT_WITHDEV) &&
4200  !JsonHelper::Member_ToJson(json, flags, allocator, "bs_long_pk", data.bs_long_pk)) return false;
4201  if (!JsonHelper::Member_ToJson(json, flags, allocator, "bs_user_pk", data.bs_user_pk)) return false;
4202  if (json.MemberCount()==0) json.SetNull();
4203  return true;
4204  }
4205 
4206  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]]) {
4207  if (sizeof(jsonvu_r128)==0) return true; // quick empty struct
4208  if (json.IsNull ()) {
4209  json.SetObject ();
4210  flags &= ~JSON_CVT_ONLYREQ; // children get all
4211  } else if (!json.IsObject()) {
4212  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4213  return false;
4214  }
4215  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "vu_on", data.vu_on, ref.vu_on)) return false;
4216  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "vu_target", data.vu_target, ref.vu_target)) return false;
4217  if ((flags & JSON_CVT_WITHDEV) &&
4218  !JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_moment", data.bs_moment, ref.bs_moment)) return false;
4219  if ((flags & JSON_CVT_WITHDEV) &&
4220  !JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_short", data.bs_short, ref.bs_short)) return false;
4221  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_long", data.bs_long, ref.bs_long)) return false;
4222  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_user", data.bs_user, ref.bs_user)) return false;
4223  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gain", data.gain, ref.gain)) return false;
4224  if ((flags & JSON_CVT_WITHDEV) &&
4225  !JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_psr", data.bs_psr, ref.bs_psr)) return false;
4226  if ((flags & JSON_CVT_WITHDEV) &&
4227  !JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_plr", data.bs_plr, ref.bs_plr)) return false;
4228  if ((flags & JSON_CVT_WITHDEV) &&
4229  !JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_moment_pk", data.bs_moment_pk, ref.bs_moment_pk)) return false;
4230  if ((flags & JSON_CVT_WITHDEV) &&
4231  !JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_short_pk", data.bs_short_pk, ref.bs_short_pk)) return false;
4232  if ((flags & JSON_CVT_WITHDEV) &&
4233  !JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_long_pk", data.bs_long_pk, ref.bs_long_pk)) return false;
4234  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "bs_user_pk", data.bs_user_pk, ref.bs_user_pk)) return false;
4235  if (json.MemberCount()==0) json.SetNull();
4236  return true;
4237  }
4238 
4239  static void ForceChange(const jsonvu_r128& data [[maybe_unused]], jsonvu_r128& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4240  JsonHelper::Member_ForceChange(allocator, "vu_on", data.vu_on, ref.vu_on);
4241  JsonHelper::Member_ForceChange(allocator, "vu_target", data.vu_target, ref.vu_target);
4242  JsonHelper::Member_ForceChange(allocator, "bs_moment", data.bs_moment, ref.bs_moment);
4243  JsonHelper::Member_ForceChange(allocator, "bs_short", data.bs_short, ref.bs_short);
4244  JsonHelper::Member_ForceChange(allocator, "bs_long", data.bs_long, ref.bs_long);
4245  JsonHelper::Member_ForceChange(allocator, "bs_user", data.bs_user, ref.bs_user);
4246  JsonHelper::Member_ForceChange(allocator, "gain", data.gain, ref.gain);
4247  JsonHelper::Member_ForceChange(allocator, "bs_psr", data.bs_psr, ref.bs_psr);
4248  JsonHelper::Member_ForceChange(allocator, "bs_plr", data.bs_plr, ref.bs_plr);
4249  JsonHelper::Member_ForceChange(allocator, "bs_moment_pk", data.bs_moment_pk, ref.bs_moment_pk);
4250  JsonHelper::Member_ForceChange(allocator, "bs_short_pk", data.bs_short_pk, ref.bs_short_pk);
4251  JsonHelper::Member_ForceChange(allocator, "bs_long_pk", data.bs_long_pk, ref.bs_long_pk);
4252  JsonHelper::Member_ForceChange(allocator, "bs_user_pk", data.bs_user_pk, ref.bs_user_pk);
4253  }
4254 
4255  };
4256 // === object settings_gain ===
4257  // === Preset ===
4258  template <>
4259  struct JsonConvert<json_settings_gain> {
4260 
4261  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>()) {
4262  if (sizeof(json_settings_gain)==0) return true; // quick empty struct
4263  if (json.IsNull()) { return true; }
4264  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
4265  if ( !JsonHelper::Member_FromJson(json, flags, "in", data.in, allocator, JsonConstraint<S4Float>(-30,30))) return false;
4266  if ( !JsonHelper::Member_FromJson(json, flags, "out", data.out, allocator, JsonConstraint<S4Float>(-30,30))) return false;
4267  return true;
4268  }
4269 
4270  static bool ToJson(JSON_Value &json, const json_settings_gain& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4271  if (sizeof(json_settings_gain)==0) return true; // quick empty struct
4272  if (json.IsNull ()) {
4273  json.SetObject ();
4274  flags &= ~JSON_CVT_ONLYREQ; // children get all
4275  } else if (!json.IsObject()) {
4276  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4277  return false;
4278  }
4279  if (!JsonHelper::Member_ToJson(json, flags, allocator, "in", data.in)) return false;
4280  if (!JsonHelper::Member_ToJson(json, flags, allocator, "out", data.out)) return false;
4281  if (json.MemberCount()==0) json.SetNull();
4282  return true;
4283  }
4284 
4285  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]]) {
4286  if (sizeof(json_settings_gain)==0) return true; // quick empty struct
4287  if (json.IsNull ()) {
4288  json.SetObject ();
4289  flags &= ~JSON_CVT_ONLYREQ; // children get all
4290  } else if (!json.IsObject()) {
4291  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4292  return false;
4293  }
4294  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "in", data.in, ref.in)) return false;
4295  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "out", data.out, ref.out)) return false;
4296  if (json.MemberCount()==0) json.SetNull();
4297  return true;
4298  }
4299 
4300  static void ForceChange(const json_settings_gain& data [[maybe_unused]], json_settings_gain& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4301  JsonHelper::Member_ForceChange(allocator, "in", data.in, ref.in);
4302  JsonHelper::Member_ForceChange(allocator, "out", data.out, ref.out);
4303  }
4304 
4305  };
4306  // === VU ===
4307  template <>
4308  struct JsonConvert<jsonvu_settings_gain> {
4309 
4310  /* VU have no FromJson */
4311 
4312  static bool ToJson(JSON_Value &json, const jsonvu_settings_gain& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4313  if (sizeof(jsonvu_settings_gain)==0) return true; // quick empty struct
4314  if (json.IsNull ()) {
4315  json.SetObject ();
4316  flags &= ~JSON_CVT_ONLYREQ; // children get all
4317  } else if (!json.IsObject()) {
4318  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4319  return false;
4320  }
4321  if (json.MemberCount()==0) json.SetNull();
4322  return true;
4323  }
4324 
4325  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]]) {
4326  if (sizeof(jsonvu_settings_gain)==0) return true; // quick empty struct
4327  if (json.IsNull ()) {
4328  json.SetObject ();
4329  flags &= ~JSON_CVT_ONLYREQ; // children get all
4330  } else if (!json.IsObject()) {
4331  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4332  return false;
4333  }
4334  if (json.MemberCount()==0) json.SetNull();
4335  return true;
4336  }
4337 
4338  static void ForceChange(const jsonvu_settings_gain& data [[maybe_unused]], jsonvu_settings_gain& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4339  }
4340 
4341  };
4342 // === object monodetect ===
4343  // === Preset ===
4344  template <>
4345  struct JsonConvert<json_monodetect> {
4346 
4347  static bool FromJson(const JSON_Value& json, json_monodetect& data [[maybe_unused]], int flags [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]], const JsonConstraint<json_monodetect> &constraints = JsonConstraint<json_monodetect>()) {
4348  if (sizeof(json_monodetect)==0) return true; // quick empty struct
4349  if (json.IsNull()) { return true; }
4350  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
4351  if ( !JsonHelper::Member_FromJson(json, flags, "avgpan_max", data.avgpan_max, allocator, JsonConstraint<S4Float>(0,15))) return false;
4352  if ( !JsonHelper::Member_FromJson(json, flags, "count", data.count, allocator, JsonConstraint<int>(5,30))) return false;
4353  if ((flags & JSON_CVT_WITHDEV) &&
4354  !JsonHelper::Member_FromJson(json, flags, "panmax", data.panmax, allocator, JsonConstraint<S4Float>(0,15))) return false;
4355  if ((flags & JSON_CVT_WITHDEV) &&
4356  !JsonHelper::Member_FromJson(json, flags, "threshold_m", data.threshold_m, allocator, JsonConstraint<S4Float>(0,15))) return false;
4357  if ((flags & JSON_CVT_WITHDEV) &&
4358  !JsonHelper::Member_FromJson(json, flags, "threshold_s", data.threshold_s, allocator, JsonConstraint<S4Float>(0,15))) return false;
4359  if ( !JsonHelper::Member_FromJson(json, flags, "forcemono", data.forcemono, allocator)) return false;
4360  return true;
4361  }
4362 
4363  static bool ToJson(JSON_Value &json, const json_monodetect& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4364  if (sizeof(json_monodetect)==0) return true; // quick empty struct
4365  if (json.IsNull ()) {
4366  json.SetObject ();
4367  flags &= ~JSON_CVT_ONLYREQ; // children get all
4368  } else if (!json.IsObject()) {
4369  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4370  return false;
4371  }
4372  if (!JsonHelper::Member_ToJson(json, flags, allocator, "avgpan_max", data.avgpan_max)) return false;
4373  if (!JsonHelper::Member_ToJson(json, flags, allocator, "count", data.count)) return false;
4374  if ((flags & JSON_CVT_WITHDEV) &&
4375  !JsonHelper::Member_ToJson(json, flags, allocator, "panmax", data.panmax)) return false;
4376  if ((flags & JSON_CVT_WITHDEV) &&
4377  !JsonHelper::Member_ToJson(json, flags, allocator, "threshold_m", data.threshold_m)) return false;
4378  if ((flags & JSON_CVT_WITHDEV) &&
4379  !JsonHelper::Member_ToJson(json, flags, allocator, "threshold_s", data.threshold_s)) return false;
4380  if (!JsonHelper::Member_ToJson(json, flags, allocator, "forcemono", data.forcemono)) return false;
4381  if (json.MemberCount()==0) json.SetNull();
4382  return true;
4383  }
4384 
4385  static bool DiffToJson(JSON_Value &json, const json_monodetect& data [[maybe_unused]], json_monodetect& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4386  if (sizeof(json_monodetect)==0) return true; // quick empty struct
4387  if (json.IsNull ()) {
4388  json.SetObject ();
4389  flags &= ~JSON_CVT_ONLYREQ; // children get all
4390  } else if (!json.IsObject()) {
4391  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4392  return false;
4393  }
4394  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "avgpan_max", data.avgpan_max, ref.avgpan_max)) return false;
4395  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "count", data.count, ref.count)) return false;
4396  if ((flags & JSON_CVT_WITHDEV) &&
4397  !JsonHelper::Member_DiffToJson(json, flags, allocator, "panmax", data.panmax, ref.panmax)) return false;
4398  if ((flags & JSON_CVT_WITHDEV) &&
4399  !JsonHelper::Member_DiffToJson(json, flags, allocator, "threshold_m", data.threshold_m, ref.threshold_m)) return false;
4400  if ((flags & JSON_CVT_WITHDEV) &&
4401  !JsonHelper::Member_DiffToJson(json, flags, allocator, "threshold_s", data.threshold_s, ref.threshold_s)) return false;
4402  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "forcemono", data.forcemono, ref.forcemono)) return false;
4403  if (json.MemberCount()==0) json.SetNull();
4404  return true;
4405  }
4406 
4407  static void ForceChange(const json_monodetect& data [[maybe_unused]], json_monodetect& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4408  JsonHelper::Member_ForceChange(allocator, "avgpan_max", data.avgpan_max, ref.avgpan_max);
4409  JsonHelper::Member_ForceChange(allocator, "count", data.count, ref.count);
4410  JsonHelper::Member_ForceChange(allocator, "panmax", data.panmax, ref.panmax);
4411  JsonHelper::Member_ForceChange(allocator, "threshold_m", data.threshold_m, ref.threshold_m);
4412  JsonHelper::Member_ForceChange(allocator, "threshold_s", data.threshold_s, ref.threshold_s);
4413  JsonHelper::Member_ForceChange(allocator, "forcemono", data.forcemono, ref.forcemono);
4414  }
4415 
4416  };
4417  // === VU ===
4418  template <>
4419  struct JsonConvert<jsonvu_monodetect> {
4420 
4421  /* VU have no FromJson */
4422 
4423  static bool ToJson(JSON_Value &json, const jsonvu_monodetect& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4424  if (sizeof(jsonvu_monodetect)==0) return true; // quick empty struct
4425  if (json.IsNull ()) {
4426  json.SetObject ();
4427  flags &= ~JSON_CVT_ONLYREQ; // children get all
4428  } else if (!json.IsObject()) {
4429  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4430  return false;
4431  }
4432  if (!JsonHelper::Member_ToJson(json, flags, allocator, "active", data.active)) return false;
4433  if (!JsonHelper::Member_ToJson(json, flags, allocator, "avgpan", data.avgpan)) return false;
4434  if (!JsonHelper::Member_ToJson(json, flags, allocator, "vucount", data.vucount)) return false;
4435  if ((flags & JSON_CVT_WITHDEV) &&
4436  !JsonHelper::Member_ToJson(json, flags, allocator, "pan", data.pan)) return false;
4437  if ((flags & JSON_CVT_WITHDEV) &&
4438  !JsonHelper::Member_ToJson(json, flags, allocator, "dev", data.dev)) return false;
4439  if (json.MemberCount()==0) json.SetNull();
4440  return true;
4441  }
4442 
4443  static bool DiffToJson(JSON_Value &json, const jsonvu_monodetect& data [[maybe_unused]], jsonvu_monodetect& ref [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4444  if (sizeof(jsonvu_monodetect)==0) return true; // quick empty struct
4445  if (json.IsNull ()) {
4446  json.SetObject ();
4447  flags &= ~JSON_CVT_ONLYREQ; // children get all
4448  } else if (!json.IsObject()) {
4449  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4450  return false;
4451  }
4452  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "active", data.active, ref.active)) return false;
4453  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "avgpan", data.avgpan, ref.avgpan)) return false;
4454  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "vucount", data.vucount, ref.vucount)) return false;
4455  if ((flags & JSON_CVT_WITHDEV) &&
4456  !JsonHelper::Member_DiffToJson(json, flags, allocator, "pan", data.pan, ref.pan)) return false;
4457  if ((flags & JSON_CVT_WITHDEV) &&
4458  !JsonHelper::Member_DiffToJson(json, flags, allocator, "dev", data.dev, ref.dev)) return false;
4459  if (json.MemberCount()==0) json.SetNull();
4460  return true;
4461  }
4462 
4463  static void ForceChange(const jsonvu_monodetect& data [[maybe_unused]], jsonvu_monodetect& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4464  JsonHelper::Member_ForceChange(allocator, "active", data.active, ref.active);
4465  JsonHelper::Member_ForceChange(allocator, "avgpan", data.avgpan, ref.avgpan);
4466  JsonHelper::Member_ForceChange(allocator, "vucount", data.vucount, ref.vucount);
4467  JsonHelper::Member_ForceChange(allocator, "pan", data.pan, ref.pan);
4468  JsonHelper::Member_ForceChange(allocator, "dev", data.dev, ref.dev);
4469  }
4470 
4471  };
4472 // === object r128_settings ===
4473  // === Preset ===
4474  template <>
4475  struct JsonConvert<json_r128_settings> {
4476 
4477  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>()) {
4478  if (sizeof(json_r128_settings)==0) return true; // quick empty struct
4479  if (json.IsNull()) { return true; }
4480  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
4481  if ( !JsonHelper::Member_FromJson(json, flags, "longterm_time", data.longterm_time, allocator, JsonConstraint<S4Float>(4,120))) return false;
4482  if ( !JsonHelper::Member_FromJson(json, flags, "vutype", data.vutype, allocator)) return false;
4483  if ( !JsonHelper::Member_FromJson(json, flags, "on", data.on, allocator)) return false;
4484  if ( !JsonHelper::Member_FromJson(json, flags, "truepeak_protect", data.truepeak_protect, allocator)) return false;
4485  if ( !JsonHelper::Member_FromJson(json, flags, "target", data.target, allocator, JsonConstraint<S4Float>(-36,0))) return false;
4486  return true;
4487  }
4488 
4489  static bool ToJson(JSON_Value &json, const json_r128_settings& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4490  if (sizeof(json_r128_settings)==0) return true; // quick empty struct
4491  if (json.IsNull ()) {
4492  json.SetObject ();
4493  flags &= ~JSON_CVT_ONLYREQ; // children get all
4494  } else if (!json.IsObject()) {
4495  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4496  return false;
4497  }
4498  if (!JsonHelper::Member_ToJson(json, flags, allocator, "longterm_time", data.longterm_time)) return false;
4499  if (!JsonHelper::Member_ToJson(json, flags, allocator, "vutype", data.vutype)) return false;
4500  if (!JsonHelper::Member_ToJson(json, flags, allocator, "on", data.on)) return false;
4501  if (!JsonHelper::Member_ToJson(json, flags, allocator, "truepeak_protect", data.truepeak_protect)) return false;
4502  if (!JsonHelper::Member_ToJson(json, flags, allocator, "target", data.target)) return false;
4503  if (json.MemberCount()==0) json.SetNull();
4504  return true;
4505  }
4506 
4507  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]]) {
4508  if (sizeof(json_r128_settings)==0) return true; // quick empty struct
4509  if (json.IsNull ()) {
4510  json.SetObject ();
4511  flags &= ~JSON_CVT_ONLYREQ; // children get all
4512  } else if (!json.IsObject()) {
4513  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4514  return false;
4515  }
4516  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "longterm_time", data.longterm_time, ref.longterm_time)) return false;
4517  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "vutype", data.vutype, ref.vutype)) return false;
4518  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "on", data.on, ref.on)) return false;
4519  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "truepeak_protect", data.truepeak_protect, ref.truepeak_protect)) return false;
4520  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "target", data.target, ref.target)) return false;
4521  if (json.MemberCount()==0) json.SetNull();
4522  return true;
4523  }
4524 
4525  static void ForceChange(const json_r128_settings& data [[maybe_unused]], json_r128_settings& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4526  JsonHelper::Member_ForceChange(allocator, "longterm_time", data.longterm_time, ref.longterm_time);
4527  JsonHelper::Member_ForceChange(allocator, "vutype", data.vutype, ref.vutype);
4528  JsonHelper::Member_ForceChange(allocator, "on", data.on, ref.on);
4529  JsonHelper::Member_ForceChange(allocator, "truepeak_protect", data.truepeak_protect, ref.truepeak_protect);
4530  JsonHelper::Member_ForceChange(allocator, "target", data.target, ref.target);
4531  }
4532 
4533  };
4534  // === VU ===
4535  template <>
4536  struct JsonConvert<jsonvu_r128_settings> {
4537 
4538  /* VU have no FromJson */
4539 
4540  static bool ToJson(JSON_Value &json, const jsonvu_r128_settings& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4541  if (sizeof(jsonvu_r128_settings)==0) return true; // quick empty struct
4542  if (json.IsNull ()) {
4543  json.SetObject ();
4544  flags &= ~JSON_CVT_ONLYREQ; // children get all
4545  } else if (!json.IsObject()) {
4546  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4547  return false;
4548  }
4549  if (json.MemberCount()==0) json.SetNull();
4550  return true;
4551  }
4552 
4553  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]]) {
4554  if (sizeof(jsonvu_r128_settings)==0) return true; // quick empty struct
4555  if (json.IsNull ()) {
4556  json.SetObject ();
4557  flags &= ~JSON_CVT_ONLYREQ; // children get all
4558  } else if (!json.IsObject()) {
4559  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4560  return false;
4561  }
4562  if (json.MemberCount()==0) json.SetNull();
4563  return true;
4564  }
4565 
4566  static void ForceChange(const jsonvu_r128_settings& data [[maybe_unused]], jsonvu_r128_settings& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4567  }
4568 
4569  };
4570 // === object settings_general ===
4571  // === Preset ===
4572  template <>
4573  struct JsonConvert<json_settings_general> {
4574 
4575  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>()) {
4576  if (sizeof(json_settings_general)==0) return true; // quick empty struct
4577  if (json.IsNull()) { return true; }
4578  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
4579  if ( !JsonHelper::Member_FromJson(json, flags, "operate", data.operate, allocator)) return false;
4580  if ( !JsonHelper::Member_FromJson(json, flags, "history_unit", data.history_unit, allocator)) return false;
4581  return true;
4582  }
4583 
4584  static bool ToJson(JSON_Value &json, const json_settings_general& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4585  if (sizeof(json_settings_general)==0) return true; // quick empty struct
4586  if (json.IsNull ()) {
4587  json.SetObject ();
4588  flags &= ~JSON_CVT_ONLYREQ; // children get all
4589  } else if (!json.IsObject()) {
4590  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4591  return false;
4592  }
4593  if (!JsonHelper::Member_ToJson(json, flags, allocator, "operate", data.operate)) return false;
4594  if (!JsonHelper::Member_ToJson(json, flags, allocator, "history_unit", data.history_unit)) return false;
4595  if (json.MemberCount()==0) json.SetNull();
4596  return true;
4597  }
4598 
4599  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]]) {
4600  if (sizeof(json_settings_general)==0) return true; // quick empty struct
4601  if (json.IsNull ()) {
4602  json.SetObject ();
4603  flags &= ~JSON_CVT_ONLYREQ; // children get all
4604  } else if (!json.IsObject()) {
4605  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4606  return false;
4607  }
4608  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "operate", data.operate, ref.operate)) return false;
4609  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "history_unit", data.history_unit, ref.history_unit)) return false;
4610  if (json.MemberCount()==0) json.SetNull();
4611  return true;
4612  }
4613 
4614  static void ForceChange(const json_settings_general& data [[maybe_unused]], json_settings_general& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4615  JsonHelper::Member_ForceChange(allocator, "operate", data.operate, ref.operate);
4616  JsonHelper::Member_ForceChange(allocator, "history_unit", data.history_unit, ref.history_unit);
4617  }
4618 
4619  };
4620  // === VU ===
4621  template <>
4622  struct JsonConvert<jsonvu_settings_general> {
4623 
4624  /* VU have no FromJson */
4625 
4626  static bool ToJson(JSON_Value &json, const jsonvu_settings_general& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4627  if (sizeof(jsonvu_settings_general)==0) return true; // quick empty struct
4628  if (json.IsNull ()) {
4629  json.SetObject ();
4630  flags &= ~JSON_CVT_ONLYREQ; // children get all
4631  } else if (!json.IsObject()) {
4632  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4633  return false;
4634  }
4635  if (json.MemberCount()==0) json.SetNull();
4636  return true;
4637  }
4638 
4639  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]]) {
4640  if (sizeof(jsonvu_settings_general)==0) return true; // quick empty struct
4641  if (json.IsNull ()) {
4642  json.SetObject ();
4643  flags &= ~JSON_CVT_ONLYREQ; // children get all
4644  } else if (!json.IsObject()) {
4645  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4646  return false;
4647  }
4648  if (json.MemberCount()==0) json.SetNull();
4649  return true;
4650  }
4651 
4652  static void ForceChange(const jsonvu_settings_general& data [[maybe_unused]], jsonvu_settings_general& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4653  }
4654 
4655  };
4656 
4657 // =============================
4658 // =========== settings ========
4659 // =============================
4660  template <>
4661  struct JsonConvert<json_settings> {
4662 
4663  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>()) {
4664  if (sizeof(json_settings)==0) return true; // quick empty struct
4665  if (json.IsNull()) { return true; }
4666  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
4667  if ( !JsonHelper::Member_FromJson(json, flags, "general", data.general, allocator)) return false;
4668  if ( !JsonHelper::Member_FromJson(json, flags, "gain", data.gain, allocator)) return false;
4669  if ( !JsonHelper::Member_FromJson(json, flags, "monodetect", data.monodetect, allocator)) return false;
4670  if ( !JsonHelper::Member_FromJson(json, flags, "r128", data.r128, allocator)) return false;
4671  return true;
4672  }
4673 
4674  static bool ToJson(JSON_Value &json, const json_settings& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4675  if (sizeof(json_settings)==0) return true; // quick empty struct
4676  if (json.IsNull ()) {
4677  json.SetObject ();
4678  flags &= ~JSON_CVT_ONLYREQ; // children get all
4679  } else if (!json.IsObject()) {
4680  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4681  return false;
4682  }
4683  if (!JsonHelper::Member_ToJson(json, flags, allocator, "general", data.general)) return false;
4684  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gain", data.gain)) return false;
4685  if (!JsonHelper::Member_ToJson(json, flags, allocator, "monodetect", data.monodetect)) return false;
4686  if (!JsonHelper::Member_ToJson(json, flags, allocator, "r128", data.r128)) return false;
4687  if (json.MemberCount()==0) json.SetNull();
4688  return true;
4689  }
4690 
4691  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]]) {
4692  if (sizeof(json_settings)==0) return true; // quick empty struct
4693  if (json.IsNull ()) {
4694  json.SetObject ();
4695  flags &= ~JSON_CVT_ONLYREQ; // children get all
4696  } else if (!json.IsObject()) {
4697  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4698  return false;
4699  }
4700  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "general", data.general, ref.general)) return false;
4701  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gain", data.gain, ref.gain)) return false;
4702  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "monodetect", data.monodetect, ref.monodetect)) return false;
4703  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "r128", data.r128, ref.r128)) return false;
4704  if (json.MemberCount()==0) json.SetNull();
4705  return true;
4706  }
4707 
4708  static void ForceChange(const json_settings& data [[maybe_unused]], json_settings& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4709  JsonHelper::Member_ForceChange(allocator, "general", data.general, ref.general);
4710  JsonHelper::Member_ForceChange(allocator, "gain", data.gain, ref.gain);
4711  JsonHelper::Member_ForceChange(allocator, "monodetect", data.monodetect, ref.monodetect);
4712  JsonHelper::Member_ForceChange(allocator, "r128", data.r128, ref.r128);
4713  }
4714 
4715  };
4716 // =============================
4717 // ========= Settings VU =======
4718 // =============================
4719  template <>
4720  struct JsonConvert<jsonvu_settings> {
4721 
4722  /* VU have no FromJson */
4723 
4724  static bool ToJson(JSON_Value &json, const jsonvu_settings& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4725  if (sizeof(jsonvu_settings)==0) return true; // quick empty struct
4726  if (json.IsNull ()) {
4727  json.SetObject ();
4728  flags &= ~JSON_CVT_ONLYREQ; // children get all
4729  } else if (!json.IsObject()) {
4730  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4731  return false;
4732  }
4733  if (!JsonHelper::Member_ToJson(json, flags, allocator, "general", data.general)) return false;
4734  if (!JsonHelper::Member_ToJson(json, flags, allocator, "gain", data.gain)) return false;
4735  if (!JsonHelper::Member_ToJson(json, flags, allocator, "monodetect", data.monodetect)) return false;
4736  if (!JsonHelper::Member_ToJson(json, flags, allocator, "r128", data.r128)) return false;
4737  if (json.MemberCount()==0) json.SetNull();
4738  return true;
4739  }
4740 
4741  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]]) {
4742  if (sizeof(jsonvu_settings)==0) return true; // quick empty struct
4743  if (json.IsNull ()) {
4744  json.SetObject ();
4745  flags &= ~JSON_CVT_ONLYREQ; // children get all
4746  } else if (!json.IsObject()) {
4747  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4748  return false;
4749  }
4750  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "general", data.general, ref.general)) return false;
4751  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "gain", data.gain, ref.gain)) return false;
4752  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "monodetect", data.monodetect, ref.monodetect)) return false;
4753  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "r128", data.r128, ref.r128)) return false;
4754  if (json.MemberCount()==0) json.SetNull();
4755  return true;
4756  }
4757 
4758  static void ForceChange(const jsonvu_settings& data [[maybe_unused]], jsonvu_settings& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4759  JsonHelper::Member_ForceChange(allocator, "general", data.general, ref.general);
4760  JsonHelper::Member_ForceChange(allocator, "gain", data.gain, ref.gain);
4761  JsonHelper::Member_ForceChange(allocator, "monodetect", data.monodetect, ref.monodetect);
4762  JsonHelper::Member_ForceChange(allocator, "r128", data.r128, ref.r128);
4763  }
4764 
4765  };
4766 // =============================
4767 // ========== preset ==========
4768 // =============================
4769  template <>
4770  struct JsonConvert<json_preset> {
4771 
4772  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>()) {
4773  if (sizeof(json_preset)==0) return true; // quick empty struct
4774  if (json.IsNull()) { return true; }
4775  if (!json.IsObject()) { PLOG_WARNING << " JSON is not an object but "<<GetJSTypeDetails(json); return false; }
4776  if ( !JsonHelper::Member_FromJson(json, flags, "setup", data.setup, allocator)) return false;
4777  if ( !JsonHelper::Member_FromJson(json, flags, "in", data.in, allocator)) return false;
4778  if ( !JsonHelper::Member_FromJson(json, flags, "agc", data.agc, allocator)) return false;
4779  if ( !JsonHelper::Member_FromJson(json, flags, "agcwide", data.agcwide, allocator)) return false;
4780  if ( !JsonHelper::Member_FromJson(json, flags, "tonefx", data.tonefx, allocator)) return false;
4781  if ( !JsonHelper::Member_FromJson(json, flags, "stereofx", data.stereofx, allocator)) return false;
4782  if ( !JsonHelper::Member_FromJson(json, flags, "bandexp", data.bandexp, allocator)) return false;
4783  if ( !JsonHelper::Member_FromJson(json, flags, "bandprocess", data.bandprocess, allocator)) return false;
4784  if ( !JsonHelper::Member_FromJson(json, flags, "bandlook", data.bandlook, allocator)) return false;
4785  if ( !JsonHelper::Member_FromJson(json, flags, "bandlim", data.bandlim, allocator)) return false;
4786  if ( !JsonHelper::Member_FromJson(json, flags, "parameq", data.parameq, allocator)) return false;
4787  if ( !JsonHelper::Member_FromJson(json, flags, "bassclip", data.bassclip, allocator)) return false;
4788  if ( !JsonHelper::Member_FromJson(json, flags, "limiter", data.limiter, allocator)) return false;
4789  if ( !JsonHelper::Member_FromJson(json, flags, "out", data.out, allocator)) return false;
4790  if ( !JsonHelper::Member_FromJson(json, flags, "r128", data.r128, allocator)) return false;
4791  return true;
4792  }
4793 
4794  static bool ToJson(JSON_Value &json, const json_preset& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4795  if (sizeof(json_preset)==0) return true; // quick empty struct
4796  if (json.IsNull ()) {
4797  json.SetObject ();
4798  flags &= ~JSON_CVT_ONLYREQ; // children get all
4799  } else if (!json.IsObject()) {
4800  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4801  return false;
4802  }
4803  if (!JsonHelper::Member_ToJson(json, flags, allocator, "setup", data.setup)) return false;
4804  if (!JsonHelper::Member_ToJson(json, flags, allocator, "in", data.in)) return false;
4805  if (!JsonHelper::Member_ToJson(json, flags, allocator, "agc", data.agc)) return false;
4806  if (!JsonHelper::Member_ToJson(json, flags, allocator, "agcwide", data.agcwide)) return false;
4807  if (!JsonHelper::Member_ToJson(json, flags, allocator, "tonefx", data.tonefx)) return false;
4808  if (!JsonHelper::Member_ToJson(json, flags, allocator, "stereofx", data.stereofx)) return false;
4809  if (!JsonHelper::Member_ToJson(json, flags, allocator, "bandexp", data.bandexp)) return false;
4810  if (!JsonHelper::Member_ToJson(json, flags, allocator, "bandprocess", data.bandprocess)) return false;
4811  if (!JsonHelper::Member_ToJson(json, flags, allocator, "bandlook", data.bandlook)) return false;
4812  if (!JsonHelper::Member_ToJson(json, flags, allocator, "bandlim", data.bandlim)) return false;
4813  if (!JsonHelper::Member_ToJson(json, flags, allocator, "parameq", data.parameq)) return false;
4814  if (!JsonHelper::Member_ToJson(json, flags, allocator, "bassclip", data.bassclip)) return false;
4815  if (!JsonHelper::Member_ToJson(json, flags, allocator, "limiter", data.limiter)) return false;
4816  if (!JsonHelper::Member_ToJson(json, flags, allocator, "out", data.out)) return false;
4817  if (!JsonHelper::Member_ToJson(json, flags, allocator, "r128", data.r128)) return false;
4818  if (json.MemberCount()==0) json.SetNull();
4819  return true;
4820  }
4821 
4822  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]]) {
4823  if (sizeof(json_preset)==0) return true; // quick empty struct
4824  if (json.IsNull ()) {
4825  json.SetObject ();
4826  flags &= ~JSON_CVT_ONLYREQ; // children get all
4827  } else if (!json.IsObject()) {
4828  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4829  return false;
4830  }
4831  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "setup", data.setup, ref.setup)) return false;
4832  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "in", data.in, ref.in)) return false;
4833  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "agc", data.agc, ref.agc)) return false;
4834  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "agcwide", data.agcwide, ref.agcwide)) return false;
4835  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "tonefx", data.tonefx, ref.tonefx)) return false;
4836  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "stereofx", data.stereofx, ref.stereofx)) return false;
4837  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "bandexp", data.bandexp, ref.bandexp)) return false;
4838  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "bandprocess", data.bandprocess, ref.bandprocess)) return false;
4839  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "bandlook", data.bandlook, ref.bandlook)) return false;
4840  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "bandlim", data.bandlim, ref.bandlim)) return false;
4841  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "parameq", data.parameq, ref.parameq)) return false;
4842  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "bassclip", data.bassclip, ref.bassclip)) return false;
4843  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "limiter", data.limiter, ref.limiter)) return false;
4844  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "out", data.out, ref.out)) return false;
4845  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "r128", data.r128, ref.r128)) return false;
4846  if (json.MemberCount()==0) json.SetNull();
4847  return true;
4848  }
4849 
4850  static void ForceChange(const json_preset& data [[maybe_unused]], json_preset& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4851  JsonHelper::Member_ForceChange(allocator, "setup", data.setup, ref.setup);
4852  JsonHelper::Member_ForceChange(allocator, "in", data.in, ref.in);
4853  JsonHelper::Member_ForceChange(allocator, "agc", data.agc, ref.agc);
4854  JsonHelper::Member_ForceChange(allocator, "agcwide", data.agcwide, ref.agcwide);
4855  JsonHelper::Member_ForceChange(allocator, "tonefx", data.tonefx, ref.tonefx);
4856  JsonHelper::Member_ForceChange(allocator, "stereofx", data.stereofx, ref.stereofx);
4857  JsonHelper::Member_ForceChange(allocator, "bandexp", data.bandexp, ref.bandexp);
4858  JsonHelper::Member_ForceChange(allocator, "bandprocess", data.bandprocess, ref.bandprocess);
4859  JsonHelper::Member_ForceChange(allocator, "bandlook", data.bandlook, ref.bandlook);
4860  JsonHelper::Member_ForceChange(allocator, "bandlim", data.bandlim, ref.bandlim);
4861  JsonHelper::Member_ForceChange(allocator, "parameq", data.parameq, ref.parameq);
4862  JsonHelper::Member_ForceChange(allocator, "bassclip", data.bassclip, ref.bassclip);
4863  JsonHelper::Member_ForceChange(allocator, "limiter", data.limiter, ref.limiter);
4864  JsonHelper::Member_ForceChange(allocator, "out", data.out, ref.out);
4865  JsonHelper::Member_ForceChange(allocator, "r128", data.r128, ref.r128);
4866  }
4867 
4868  };
4869 // =============================
4870 // ========= All VU =========
4871 // =============================
4872  template <>
4873  struct JsonConvert<json_vu> {
4874 
4875  /* VU have no FromJson */
4876 
4877  static bool ToJson(JSON_Value &json, const json_vu& data [[maybe_unused]], int flags, JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4878  if (sizeof(json_vu)==0) return true; // quick empty struct
4879  if (json.IsNull ()) {
4880  json.SetObject ();
4881  flags &= ~JSON_CVT_ONLYREQ; // children get all
4882  } else if (!json.IsObject()) {
4883  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4884  return false;
4885  }
4886  if (!JsonHelper::Member_ToJson(json, flags, allocator, "setup", data.setup)) return false;
4887  if (!JsonHelper::Member_ToJson(json, flags, allocator, "in", data.in)) return false;
4888  if (!JsonHelper::Member_ToJson(json, flags, allocator, "agc", data.agc)) return false;
4889  if (!JsonHelper::Member_ToJson(json, flags, allocator, "agcwide", data.agcwide)) return false;
4890  if (!JsonHelper::Member_ToJson(json, flags, allocator, "tonefx", data.tonefx)) return false;
4891  if (!JsonHelper::Member_ToJson(json, flags, allocator, "stereofx", data.stereofx)) return false;
4892  if (!JsonHelper::Member_ToJson(json, flags, allocator, "bandexp", data.bandexp)) return false;
4893  if (!JsonHelper::Member_ToJson(json, flags, allocator, "bandprocess", data.bandprocess)) return false;
4894  if (!JsonHelper::Member_ToJson(json, flags, allocator, "bandlook", data.bandlook)) return false;
4895  if (!JsonHelper::Member_ToJson(json, flags, allocator, "bandlim", data.bandlim)) return false;
4896  if (!JsonHelper::Member_ToJson(json, flags, allocator, "parameq", data.parameq)) return false;
4897  if (!JsonHelper::Member_ToJson(json, flags, allocator, "bassclip", data.bassclip)) return false;
4898  if (!JsonHelper::Member_ToJson(json, flags, allocator, "limiter", data.limiter)) return false;
4899  if (!JsonHelper::Member_ToJson(json, flags, allocator, "out", data.out)) return false;
4900  if (!JsonHelper::Member_ToJson(json, flags, allocator, "r128", data.r128)) return false;
4901  // From settings
4902  if (!JsonHelper::Member_ToJson(json, flags, allocator, "settings", data.settings)) return false;
4903  if (json.MemberCount()==0) json.SetNull();
4904  return true;
4905  }
4906 
4907  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]]) {
4908  if (sizeof(json_vu)==0) return true; // quick empty struct
4909  if (json.IsNull ()) {
4910  json.SetObject ();
4911  flags &= ~JSON_CVT_ONLYREQ; // children get all
4912  } else if (!json.IsObject()) {
4913  PLOG_WARNING << "Invalid JSON syntax: waiting for an object but has "<<GetJSTypeDetails(json);
4914  return false;
4915  }
4916  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "setup", data.setup, ref.setup)) return false;
4917  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "in", data.in, ref.in)) return false;
4918  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "agc", data.agc, ref.agc)) return false;
4919  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "agcwide", data.agcwide, ref.agcwide)) return false;
4920  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "tonefx", data.tonefx, ref.tonefx)) return false;
4921  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "stereofx", data.stereofx, ref.stereofx)) return false;
4922  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "bandexp", data.bandexp, ref.bandexp)) return false;
4923  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "bandprocess", data.bandprocess, ref.bandprocess)) return false;
4924  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "bandlook", data.bandlook, ref.bandlook)) return false;
4925  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "bandlim", data.bandlim, ref.bandlim)) return false;
4926  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "parameq", data.parameq, ref.parameq)) return false;
4927  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "bassclip", data.bassclip, ref.bassclip)) return false;
4928  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "limiter", data.limiter, ref.limiter)) return false;
4929  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "out", data.out, ref.out)) return false;
4930  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "r128", data.r128, ref.r128)) return false;
4931  // From settings
4932  if (!JsonHelper::Member_DiffToJson(json, flags, allocator, "settings", data.settings, ref.settings)) return false;
4933  if (json.MemberCount()==0) json.SetNull();
4934  return true;
4935  }
4936 
4937  static void ForceChange(const json_vu& data [[maybe_unused]], json_vu& ref [[maybe_unused]], JSON_Document::AllocatorType& allocator [[maybe_unused]]) {
4938  JsonHelper::Member_ForceChange(allocator, "setup", data.setup, ref.setup);
4939  JsonHelper::Member_ForceChange(allocator, "in", data.in, ref.in);
4940  JsonHelper::Member_ForceChange(allocator, "agc", data.agc, ref.agc);
4941  JsonHelper::Member_ForceChange(allocator, "agcwide", data.agcwide, ref.agcwide);
4942  JsonHelper::Member_ForceChange(allocator, "tonefx", data.tonefx, ref.tonefx);
4943  JsonHelper::Member_ForceChange(allocator, "stereofx", data.stereofx, ref.stereofx);
4944  JsonHelper::Member_ForceChange(allocator, "bandexp", data.bandexp, ref.bandexp);
4945  JsonHelper::Member_ForceChange(allocator, "bandprocess", data.bandprocess, ref.bandprocess);
4946  JsonHelper::Member_ForceChange(allocator, "bandlook", data.bandlook, ref.bandlook);
4947  JsonHelper::Member_ForceChange(allocator, "bandlim", data.bandlim, ref.bandlim);
4948  JsonHelper::Member_ForceChange(allocator, "parameq", data.parameq, ref.parameq);
4949  JsonHelper::Member_ForceChange(allocator, "bassclip", data.bassclip, ref.bassclip);
4950  JsonHelper::Member_ForceChange(allocator, "limiter", data.limiter, ref.limiter);
4951  JsonHelper::Member_ForceChange(allocator, "out", data.out, ref.out);
4952  JsonHelper::Member_ForceChange(allocator, "r128", data.r128, ref.r128);
4953 // From settings
4954  JsonHelper::Member_ForceChange(allocator, "settings", data.settings, ref.settings);
4955  }
4956 
4957  };
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 void ForceChange(const json_agc_peakhold &data[[maybe_unused]], json_agc_peakhold &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const json_agc_peakhold &data[[maybe_unused]], json_agc_peakhold &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_agc_peakhold &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_agc_peakhold > &constraints=JsonConstraint< json_agc_peakhold >())
static bool ToJson(JSON_Value &json, const json_agc_peakhold &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const json_agc_stereo_peakhold &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const json_agc_stereo_peakhold &data[[maybe_unused]], json_agc_stereo_peakhold &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const json_agc_stereo_peakhold &data[[maybe_unused]], json_agc_stereo_peakhold &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_agc_stereo_peakhold &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_agc_stereo_peakhold > &constraints=JsonConstraint< json_agc_stereo_peakhold >())
static bool DiffToJson(JSON_Value &json, const json_agcwide &data[[maybe_unused]], json_agcwide &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const json_agcwide &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const json_agcwide &data[[maybe_unused]], json_agcwide &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_agcwide &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_agcwide > &constraints=JsonConstraint< json_agcwide >())
static bool DiffToJson(JSON_Value &json, const json_band_peak_percent &data[[maybe_unused]], json_band_peak_percent &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const json_band_peak_percent &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const json_band_peak_percent &data[[maybe_unused]], json_band_peak_percent &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_band_peak_percent &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_band_peak_percent > &constraints=JsonConstraint< json_band_peak_percent >())
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 void ForceChange(const json_band_stereo_peakhold &data[[maybe_unused]], json_band_stereo_peakhold &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const json_band_stereo_peakhold &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_band_stereo_peakhold &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_band_stereo_peakhold > &constraints=JsonConstraint< json_band_stereo_peakhold >())
static bool DiffToJson(JSON_Value &json, const json_band_stereo_peakhold &data[[maybe_unused]], json_band_stereo_peakhold &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const json_bandexp &data[[maybe_unused]], json_bandexp &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_bandexp &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_bandexp > &constraints=JsonConstraint< json_bandexp >())
static bool ToJson(JSON_Value &json, const json_bandexp &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const json_bandexp &data[[maybe_unused]], json_bandexp &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const json_bandlim &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_bandlim &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_bandlim > &constraints=JsonConstraint< json_bandlim >())
static bool DiffToJson(JSON_Value &json, const json_bandlim &data[[maybe_unused]], json_bandlim &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const json_bandlim &data[[maybe_unused]], json_bandlim &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const json_bandlim_peak_percent &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const json_bandlim_peak_percent &data[[maybe_unused]], json_bandlim_peak_percent &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const json_bandlim_peak_percent &data[[maybe_unused]], json_bandlim_peak_percent &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_bandlim_peak_percent &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_bandlim_peak_percent > &constraints=JsonConstraint< json_bandlim_peak_percent >())
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 bool DiffToJson(JSON_Value &json, const json_bandlim_stereo_peakhold &data[[maybe_unused]], json_bandlim_stereo_peakhold &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const json_bandlim_stereo_peakhold &data[[maybe_unused]], json_bandlim_stereo_peakhold &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const json_bandlim_stereo_peakhold &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_bandlim_stereo_peakhold &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_bandlim_stereo_peakhold > &constraints=JsonConstraint< json_bandlim_stereo_peakhold >())
static bool DiffToJson(JSON_Value &json, const json_bandlook &data[[maybe_unused]], json_bandlook &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_bandlook &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_bandlook > &constraints=JsonConstraint< json_bandlook >())
static bool ToJson(JSON_Value &json, const json_bandlook &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const json_bandlook &data[[maybe_unused]], json_bandlook &ref[[maybe_unused]], 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 DiffToJson(JSON_Value &json, const json_bassclip &data[[maybe_unused]], json_bassclip &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const json_bassclip &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_bassclip &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_bassclip > &constraints=JsonConstraint< json_bassclip >())
static void ForceChange(const json_bassclip &data[[maybe_unused]], json_bassclip &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_monodetect &data[[maybe_unused]], json_monodetect &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_monodetect &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_monodetect > &constraints=JsonConstraint< json_monodetect >())
static bool ToJson(JSON_Value &json, const json_monodetect &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const json_monodetect &data[[maybe_unused]], json_monodetect &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 ToJson(JSON_Value &json, const json_parameq &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const json_parameq &data[[maybe_unused]], json_parameq &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const json_parameq &data[[maybe_unused]], json_parameq &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool FromJson(const JSON_Value &json, json_parameq &data[[maybe_unused]], int flags[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]], const JsonConstraint< json_parameq > &constraints=JsonConstraint< json_parameq >())
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_agcwide &data[[maybe_unused]], jsonvu_agcwide &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const jsonvu_agcwide &data[[maybe_unused]], jsonvu_agcwide &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const jsonvu_agcwide &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const jsonvu_bandexp &data[[maybe_unused]], jsonvu_bandexp &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const jsonvu_bandexp &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const jsonvu_bandexp &data[[maybe_unused]], jsonvu_bandexp &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const jsonvu_bandlim &data[[maybe_unused]], jsonvu_bandlim &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const jsonvu_bandlim &data[[maybe_unused]], jsonvu_bandlim &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const jsonvu_bandlim &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const jsonvu_bandlook &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const jsonvu_bandlook &data[[maybe_unused]], jsonvu_bandlook &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const jsonvu_bandlook &data[[maybe_unused]], jsonvu_bandlook &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 void ForceChange(const jsonvu_bassclip &data[[maybe_unused]], jsonvu_bassclip &ref[[maybe_unused]], JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const jsonvu_bassclip &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool DiffToJson(JSON_Value &json, const jsonvu_bassclip &data[[maybe_unused]], jsonvu_bassclip &ref[[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 DiffToJson(JSON_Value &json, const jsonvu_monodetect &data[[maybe_unused]], jsonvu_monodetect &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const jsonvu_monodetect &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const jsonvu_monodetect &data[[maybe_unused]], jsonvu_monodetect &ref[[maybe_unused]], 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_parameq &data[[maybe_unused]], jsonvu_parameq &ref[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static bool ToJson(JSON_Value &json, const jsonvu_parameq &data[[maybe_unused]], int flags, JSON_Document::AllocatorType &allocator[[maybe_unused]])
static void ForceChange(const jsonvu_parameq &data[[maybe_unused]], jsonvu_parameq &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]])
#define AGC2B_MAX_PERIOD
Definition: vars_process.h:18
e_autoatt_mode
Definition: vars_process.h:92
@ e_autoatt_mode_input
Definition: vars_process.h:95
@ e_autoatt_mode_off
Definition: vars_process.h:93
@ e_autoatt_mode_gain
Definition: vars_process.h:94
e_bs1770_vutype
Definition: vars_process.h:34
@ e_bs1770_vutype_LongTerm
Definition: vars_process.h:37
@ e_bs1770_vutype_ShortTerm
Definition: vars_process.h:36
@ e_bs1770_vutype_Momentary
Definition: vars_process.h:35
#define BANDPROC_MAX_PERIOD
Definition: vars_process.h:19
e_history_var
Definition: vars_process.h:64
@ e_history_var_in_bs_long
Definition: vars_process.h:65
@ e_history_var_out_bs_long
Definition: vars_process.h:66
e_history_unit
Definition: vars_process.h:56
@ e_history_unit_Hour
Definition: vars_process.h:59
@ e_history_unit_Day
Definition: vars_process.h:60
@ e_history_unit_Second
Definition: vars_process.h:57
@ e_history_unit_Minute
Definition: vars_process.h:58
e_lim_hilbert_filter
Definition: vars_process.h:70
@ e_lim_hilbert_filter_hilb_501
Definition: vars_process.h:73
@ e_lim_hilbert_filter_hilb_1001
Definition: vars_process.h:75
@ e_lim_hilbert_filter_hilb_377
Definition: vars_process.h:72
@ e_lim_hilbert_filter_hilb_253
Definition: vars_process.h:71
@ e_lim_hilbert_filter_hilb_749
Definition: vars_process.h:74
@ e_lim_hilbert_filter_hilb_4001
Definition: vars_process.h:77
@ e_lim_hilbert_filter_hilb_2001
Definition: vars_process.h:76
@ e_lim_hilbert_filter_hilb_8001
Definition: vars_process.h:78
e_lk_mode
Definition: vars_process.h:41
@ e_lk_mode_Independant
Definition: vars_process.h:43
@ e_lk_mode_Stereo_Link
Definition: vars_process.h:42
@ e_lk_mode_Mixed_Channel
Definition: vars_process.h:44
#define NB_BAND_LIM
Definition: vars_process.h:17
#define NB_BAND_PROC
Definition: vars_process.h:16
e_hilbert_window
Definition: vars_process.h:82
@ e_hilbert_window_sinc
Definition: vars_process.h:84
@ e_hilbert_window_kaiser
Definition: vars_process.h:85
@ e_hilbert_window_hann
Definition: vars_process.h:86
@ e_hilbert_window_hamming
Definition: vars_process.h:87
@ e_hilbert_window_blackman
Definition: vars_process.h:88
@ e_hilbert_window_rect
Definition: vars_process.h:83
e_preset_mode
Definition: vars_process.h:48
@ e_preset_mode_hg1
Definition: vars_process.h:50
@ e_preset_mode_pure
Definition: vars_process.h:49
@ e_preset_mode_hg2
Definition: vars_process.h:51
@ e_preset_mode_hg3
Definition: vars_process.h:52
e_lim_release
Definition: vars_process.h:25
@ e_lim_release_Medium_Slow
Definition: vars_process.h:27
@ e_lim_release_Medium_Fast
Definition: vars_process.h:28
@ e_lim_release_Fast
Definition: vars_process.h:30
@ e_lim_release_Slow
Definition: vars_process.h:26
@ e_lim_release_FastLow
Definition: vars_process.h:29
JsonConvert_ENUM(e_lim_release)