diff options
Diffstat (limited to 'utils/themeeditor/buildtargetdb.php')
-rwxr-xr-x | utils/themeeditor/buildtargetdb.php | 76 |
1 files changed, 19 insertions, 57 deletions
diff --git a/utils/themeeditor/buildtargetdb.php b/utils/themeeditor/buildtargetdb.php index 26b6f119c2..a5ae650426 100755 --- a/utils/themeeditor/buildtargetdb.php +++ b/utils/themeeditor/buildtargetdb.php | |||
@@ -25,63 +25,21 @@ | |||
25 | echo "# ----------------------------------------------------------- #\n"; | 25 | echo "# ----------------------------------------------------------- #\n"; |
26 | echo "# ----------------------------------------------------------- #\n"; | 26 | echo "# ----------------------------------------------------------- #\n"; |
27 | echo "# --- This file automatically generated, do not modify! --- #\n"; | 27 | echo "# --- This file automatically generated, do not modify! --- #\n"; |
28 | echo "# --- To add a target to the targetdb, add it to the --- #\n"; | ||
29 | echo "# --- \$targets array in buildtargetdb.php and run that --- #\n"; | ||
30 | echo "# --- script, ensuring that your current directory is --- #\n"; | ||
31 | echo "# --- utils/themeeditor, and pipe the output into --- #\n"; | ||
32 | echo "# --- utils/themeeditor/resources/targetdb --- #\n"; | ||
33 | echo "# ----------------------------------------------------------- #\n"; | 28 | echo "# ----------------------------------------------------------- #\n"; |
34 | echo "# ----------------------------------------------------------- #\n\n"; | 29 | echo "# ----------------------------------------------------------- #\n\n"; |
35 | 30 | ||
36 | // This is the array of targets, with the target id as the key and the | 31 | // Importing the target array |
37 | // plaintext name of the target as the value | 32 | system('./includetargets.pl'); |
38 | $targets = array( 'archosfmrecorder' => 'Archos FM Recorder', | 33 | require('./targets.php'); |
39 | 'archosondiofm' => 'Archos Ondio FM', | 34 | unlink('./targets.php'); |
40 | 'archosondiosp' => 'Archos Ondio SP', | ||
41 | 'archosplayer' => 'Archos Player/Studio', | ||
42 | 'archosrecorder' => 'Archos Recorder v1', | ||
43 | 'archosrecorderv2' => 'Archos Recorder v2', | ||
44 | 'cowond2' => 'Cowon D2', | ||
45 | 'iaudiom3' => 'iAudio M3', | ||
46 | 'iaudiom5' => 'iAudio M5', | ||
47 | 'iaudiox5' => 'iAudio X5', | ||
48 | 'ipod1g2g' => 'iPod 1st and 2nd gen', | ||
49 | 'ipod3g' => 'iPod 3rd gen', | ||
50 | 'ipod4g' => 'iPod 4th gen Grayscale', | ||
51 | 'ipodcolor' => 'iPod Color/Photo', | ||
52 | 'ipodmini1g' => 'iPod Mini 1st gen', | ||
53 | 'ipodmini2g' => 'iPod Mini 2nd gen', | ||
54 | 'ipodnano1g' => 'iPod Nano 1st gen', | ||
55 | 'ipodnano2g' => 'iPod Nano 2nd gen', | ||
56 | 'ipodvideo' => 'iPod Video', | ||
57 | 'iriverh10' => 'iriver H10 20GB', | ||
58 | 'iriverh10_5gb' => 'iriver H10 5GB', | ||
59 | 'iriverh100' => 'iriver H100/115', | ||
60 | 'iriverh120' => 'iriver H120/140', | ||
61 | 'iriverh300' => 'iriver H320/340', | ||
62 | 'mrobe100' => 'Olympus M-Robe 100', | ||
63 | 'mrobe500' => 'Olympus M-Robe 500', | ||
64 | 'vibe500' => 'Packard Bell Vibe 500', | ||
65 | 'samsungyh820' => 'Samsung YH-820', | ||
66 | 'samsungyh920' => 'Samsung YH-920', | ||
67 | 'samsungyh925' => 'Samsung YH-925', | ||
68 | 'sansac200' => 'SanDisk Sansa c200', | ||
69 | 'sansaclip' => 'SanDisk Sansa Clip v1', | ||
70 | 'sansaclipv2' => 'SanDisk Sansa Clip v2', | ||
71 | 'sansaclipplus' => 'SanDisk Sansa Clip+', | ||
72 | 'sansae200' => 'SanDisk Sansa e200', | ||
73 | 'sansae200v2' => 'SanDisk Sansa e200 v2', | ||
74 | 'sansafuze' => 'SanDisk Sansa Fuze', | ||
75 | 'sansafuzev2' => 'SanDisk Sansa Fuze v2', | ||
76 | 'gigabeatfx' => 'Toshiba Gigabeat F/X', | ||
77 | 'gigabeats' => 'Toshiba Gigabeat S' | ||
78 | ); | ||
79 | 35 | ||
80 | // Looping through all the targets | 36 | // Looping through all the targets |
81 | foreach($targets as $target => $plaintext) | 37 | foreach($targets as $target => $plaintext) |
82 | { | 38 | { |
83 | // Opening a cpp process | 39 | // Opening a cpp process |
84 | $configfile = '../../firmware/export/config/' . $target . '.h'; | 40 | $configfile = '../../firmware/export/config/' . $target . '.h'; |
41 | if(!file_exists($configfile)) | ||
42 | continue; | ||
85 | $descriptor = array( 0 => array("pipe", "r"), //stdin | 43 | $descriptor = array( 0 => array("pipe", "r"), //stdin |
86 | 1 => array("pipe", "w") //stdout | 44 | 1 => array("pipe", "w") //stdout |
87 | ); | 45 | ); |
@@ -122,15 +80,19 @@ STR; | |||
122 | fclose($pipes[1]); | 80 | fclose($pipes[1]); |
123 | $results = explode("\n", $results); | 81 | $results = explode("\n", $results); |
124 | 82 | ||
83 | $base = 0; | ||
84 | while($results[$base] != 'lcd') | ||
85 | $base++; | ||
86 | |||
125 | // Header for the target | 87 | // Header for the target |
126 | echo $target . "\n{\n"; | 88 | echo $target . "\n{\n"; |
127 | echo ' name : ' . $plaintext . "\n"; | 89 | echo ' name : ' . $plaintext . "\n"; |
128 | 90 | ||
129 | // Writing the LCD dimensions | 91 | // Writing the LCD dimensions |
130 | echo ' screen : ' . $results[7] . ' x ' . $results[8] . ' @ '; | 92 | echo ' screen : ' . $results[$base + 1] . ' x ' . $results[$base + 2] . ' @ '; |
131 | if($results[9] == 1) | 93 | if($results[$base + 3] == 1) |
132 | echo 'mono'; | 94 | echo 'mono'; |
133 | else if($results[10] == 2) | 95 | else if($results[$base + 3] == 2) |
134 | echo 'grey'; | 96 | echo 'grey'; |
135 | else | 97 | else |
136 | echo 'rgb'; | 98 | echo 'rgb'; |
@@ -138,16 +100,16 @@ STR; | |||
138 | 100 | ||
139 | // Writing the remote dimensions if necessary | 101 | // Writing the remote dimensions if necessary |
140 | echo ' remote : '; | 102 | echo ' remote : '; |
141 | if($results[12] == 0) | 103 | if($results[$base + 6] == 0) |
142 | { | 104 | { |
143 | echo 'no'; | 105 | echo 'no'; |
144 | } | 106 | } |
145 | else | 107 | else |
146 | { | 108 | { |
147 | echo $results[12] . ' x ' .$results[13] . ' @ '; | 109 | echo $results[$base + 6] . ' x ' .$results[$base + 7] . ' @ '; |
148 | if($results[14] == 1) | 110 | if($results[$base + 8] == 1) |
149 | echo 'mono'; | 111 | echo 'mono'; |
150 | else if($results[14] == 2) | 112 | else if($results[$base + 8] == 2) |
151 | echo 'grey'; | 113 | echo 'grey'; |
152 | else | 114 | else |
153 | echo 'rgb'; | 115 | echo 'rgb'; |
@@ -156,7 +118,7 @@ STR; | |||
156 | 118 | ||
157 | // Writing FM capability | 119 | // Writing FM capability |
158 | echo ' fm : '; | 120 | echo ' fm : '; |
159 | if($results[18] == 'yes') | 121 | if($results[$base + 12] == 'yes') |
160 | echo 'yes'; | 122 | echo 'yes'; |
161 | else | 123 | else |
162 | echo 'no'; | 124 | echo 'no'; |
@@ -164,7 +126,7 @@ STR; | |||
164 | 126 | ||
165 | // Writing record capability | 127 | // Writing record capability |
166 | echo ' record : '; | 128 | echo ' record : '; |
167 | if($results[22] == 'yes') | 129 | if($results[$base + 16] == 'yes') |
168 | echo 'yes'; | 130 | echo 'yes'; |
169 | else | 131 | else |
170 | echo 'no'; | 132 | echo 'no'; |