Clean up array sizes in the SBR + PS part of libfaad. Add MAX_NTSRPS (=38), use MAX_N...
[kugel-rb.git] / utils / themeeditor / buildtargetdb.php
bloba5ae650426abd77c7e449b2c63d8348a8de2dde9
1 #!/usr/bin/php -q
2 <?php
3 /***************************************************************************
4 * __________ __ ___.
5 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
6 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
7 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
8 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
9 * \/ \/ \/ \/ \/
10 * $Id$
12 * Copyright (C) 2010 Robert Bieber
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 * KIND, either express or implied.
22 ****************************************************************************/
24 // Printing the do-not-modify warning
25 echo "# ----------------------------------------------------------- #\n";
26 echo "# ----------------------------------------------------------- #\n";
27 echo "# --- This file automatically generated, do not modify! --- #\n";
28 echo "# ----------------------------------------------------------- #\n";
29 echo "# ----------------------------------------------------------- #\n\n";
31 // Importing the target array
32 system('./includetargets.pl');
33 require('./targets.php');
34 unlink('./targets.php');
36 // Looping through all the targets
37 foreach($targets as $target => $plaintext)
39 // Opening a cpp process
40 $configfile = '../../firmware/export/config/' . $target . '.h';
41 if(!file_exists($configfile))
42 continue;
43 $descriptor = array( 0 => array("pipe", "r"), //stdin
44 1 => array("pipe", "w") //stdout
47 $proc = proc_open('cpp', $descriptor, $pipes);
49 if($proc == false)
50 die("Failed to open process");
52 // Feeding the input to cpp
53 $input = "#include \"$configfile\"\n";
54 $input .= <<<STR
55 lcd
56 LCD_WIDTH
57 LCD_HEIGHT
58 LCD_DEPTH
59 remote
60 #ifdef HAVE_REMOTE_LCD
61 LCD_REMOTE_WIDTH
62 LCD_REMOTE_HEIGHT
63 LCD_REMOTE_DEPTH
64 #endif
65 tuner
66 #ifdef CONFIG_TUNER
67 yes
68 #endif
69 recording
70 #ifdef HAVE_RECORDING
71 yes
72 #endif
73 unused
74 STR;
76 fwrite($pipes[0], $input);
77 fclose($pipes[0]);
79 $results = stream_get_contents($pipes[1]);
80 fclose($pipes[1]);
81 $results = explode("\n", $results);
83 $base = 0;
84 while($results[$base] != 'lcd')
85 $base++;
87 // Header for the target
88 echo $target . "\n{\n";
89 echo ' name : ' . $plaintext . "\n";
91 // Writing the LCD dimensions
92 echo ' screen : ' . $results[$base + 1] . ' x ' . $results[$base + 2] . ' @ ';
93 if($results[$base + 3] == 1)
94 echo 'mono';
95 else if($results[$base + 3] == 2)
96 echo 'grey';
97 else
98 echo 'rgb';
99 echo "\n";
101 // Writing the remote dimensions if necessary
102 echo ' remote : ';
103 if($results[$base + 6] == 0)
105 echo 'no';
107 else
109 echo $results[$base + 6] . ' x ' .$results[$base + 7] . ' @ ';
110 if($results[$base + 8] == 1)
111 echo 'mono';
112 else if($results[$base + 8] == 2)
113 echo 'grey';
114 else
115 echo 'rgb';
117 echo "\n";
119 // Writing FM capability
120 echo ' fm : ';
121 if($results[$base + 12] == 'yes')
122 echo 'yes';
123 else
124 echo 'no';
125 echo "\n";
127 // Writing record capability
128 echo ' record : ';
129 if($results[$base + 16] == 'yes')
130 echo 'yes';
131 else
132 echo 'no';
133 echo "\n";
135 // Closing the target
136 echo "}\n\n";
138 proc_close($proc);