mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
new files for preference metadata handling
This commit is contained in:
parent
7a3b42948d
commit
125421f686
2 changed files with 361 additions and 0 deletions
54
tools/process-metadata
Executable file
54
tools/process-metadata
Executable file
|
|
@ -0,0 +1,54 @@
|
|||
#!/bin/perl
|
||||
|
||||
$in_section = 0;
|
||||
$in_heading = 0;
|
||||
$section = "";
|
||||
$heading = "";
|
||||
$accumulated = "";
|
||||
|
||||
while (<>) {
|
||||
if (/\[SECTION:/) {
|
||||
chop;
|
||||
s/\[SECTION://;
|
||||
s/\]//;
|
||||
$section = $_;
|
||||
print $section, "\n";
|
||||
$in_section = 1;
|
||||
$in_heading = 0;
|
||||
$heading = "";
|
||||
next;
|
||||
}
|
||||
|
||||
if (!$in_section) {
|
||||
print "NIS\n";
|
||||
next;
|
||||
}
|
||||
|
||||
if (/\[[a-z0-9_-]+\]/) {
|
||||
|
||||
if ($accumulated ne "") {
|
||||
@arr = split (/\s+/, $accumulated);
|
||||
|
||||
print "VAR_META (X_(\"$heading\"), ";
|
||||
for my $word (@arr) {
|
||||
if ($word ne "") {
|
||||
print "_(\"$word\"), ";
|
||||
}
|
||||
}
|
||||
print " NULL);\n";
|
||||
$accumulated = "";
|
||||
}
|
||||
|
||||
chop;
|
||||
chop;
|
||||
$heading = substr ($_, 1);
|
||||
$in_heading = 1;
|
||||
next;
|
||||
}
|
||||
|
||||
if (!$in_heading) {
|
||||
next;
|
||||
}
|
||||
|
||||
$accumulated .= $_;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue