summaryrefslogtreecommitdiff
path: root/utils/themeeditor/buildtargetdb.php
diff options
context:
space:
mode:
Diffstat (limited to 'utils/themeeditor/buildtargetdb.php')
-rwxr-xr-xutils/themeeditor/buildtargetdb.php76
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 @@
25echo "# ----------------------------------------------------------- #\n"; 25echo "# ----------------------------------------------------------- #\n";
26echo "# ----------------------------------------------------------- #\n"; 26echo "# ----------------------------------------------------------- #\n";
27echo "# --- This file automatically generated, do not modify! --- #\n"; 27echo "# --- This file automatically generated, do not modify! --- #\n";
28echo "# --- To add a target to the targetdb, add it to the --- #\n";
29echo "# --- \$targets array in buildtargetdb.php and run that --- #\n";
30echo "# --- script, ensuring that your current directory is --- #\n";
31echo "# --- utils/themeeditor, and pipe the output into --- #\n";
32echo "# --- utils/themeeditor/resources/targetdb --- #\n";
33echo "# ----------------------------------------------------------- #\n"; 28echo "# ----------------------------------------------------------- #\n";
34echo "# ----------------------------------------------------------- #\n\n"; 29echo "# ----------------------------------------------------------- #\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 32system('./includetargets.pl');
38$targets = array( 'archosfmrecorder' => 'Archos FM Recorder', 33require('./targets.php');
39 'archosondiofm' => 'Archos Ondio FM', 34unlink('./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
81foreach($targets as $target => $plaintext) 37foreach($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';