From 89e897a84ae988dfc8210683955fba0cfba50f89 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 27 Jan 2023 15:07:27 -0700 Subject: [PATCH] tweak emitted code for preference metadata --- tools/process-metadata | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/process-metadata b/tools/process-metadata index 9c94dedfe4..3c90a40999 100755 --- a/tools/process-metadata +++ b/tools/process-metadata @@ -6,16 +6,23 @@ $section = ""; $heading = ""; $accumulated = ""; +print " +void +UIConfiguration::build_metadata () +{ + +#define VAR_META(name,...) { char const * _x[] { __VA_ARGS__ }; all_metadata.insert (std::make_pair ((name), PBD::upcase (_x))); }\n\n"; + while (<>) { if (/\[SECTION:/) { chop; s/\[SECTION://; s/\]//; $section = $_; - print $section, "\n"; $in_section = 1; $in_heading = 0; $heading = ""; + $accumulated = ""; next; } @@ -29,7 +36,7 @@ while (<>) { if ($accumulated ne "") { @arr = split (/\s+/, $accumulated); - print "VAR_META (X_(\"$heading\"), "; + print "\tVAR_META (X_(\"$heading\"), "; for my $word (@arr) { if ($word ne "") { print "_(\"$word\"), "; @@ -52,3 +59,5 @@ while (<>) { $accumulated .= $_; } + +print "\n}\n";