A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd
at master 141 lines 3.8 kB view raw
1#!/usr/bin/php -q 2<?php 3/*************************************************************************** 4 * __________ __ ___. 5 * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 6 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 7 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 8 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 9 * \/ \/ \/ \/ \/ 10 * $Id$ 11 * 12 * Copyright (C) 2010 Robert Bieber 13 * 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. 18 * 19 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 20 * KIND, either express or implied. 21 * 22 ****************************************************************************/ 23 24// Printing the do-not-modify warning 25echo "# ----------------------------------------------------------- #\n"; 26echo "# ----------------------------------------------------------- #\n"; 27echo "# --- This file automatically generated, do not modify! --- #\n"; 28echo "# ----------------------------------------------------------- #\n"; 29echo "# ----------------------------------------------------------- #\n\n"; 30 31// Importing the target array 32system('./includetargets.pl'); 33require('./targets.php'); 34unlink('./targets.php'); 35 36// Looping through all the targets 37foreach($targets as $target => $plaintext) 38{ 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 45 ); 46 47 $proc = proc_open('cpp', $descriptor, $pipes); 48 49 if($proc == false) 50 die("Failed to open process"); 51 52 // Feeding the input to cpp 53 $input = "#include \"$configfile\"\n"; 54 $input .= <<<STR 55lcd 56LCD_WIDTH 57LCD_HEIGHT 58LCD_DEPTH 59remote 60#ifdef HAVE_REMOTE_LCD 61LCD_REMOTE_WIDTH 62LCD_REMOTE_HEIGHT 63LCD_REMOTE_DEPTH 64#endif 65tuner 66#ifdef CONFIG_TUNER 67yes 68#endif 69recording 70#ifdef HAVE_RECORDING 71yes 72#endif 73unused 74STR; 75 76 fwrite($pipes[0], $input); 77 fclose($pipes[0]); 78 79 $results = stream_get_contents($pipes[1]); 80 fclose($pipes[1]); 81 $results = explode("\n", $results); 82 83 $base = 0; 84 while($results[$base] != 'lcd') 85 $base++; 86 87 // Header for the target 88 echo $target . "\n{\n"; 89 echo ' name : ' . $plaintext . "\n"; 90 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"; 100 101 // Writing the remote dimensions if necessary 102 echo ' remote : '; 103 if($results[$base + 6] == 0) 104 { 105 echo 'no'; 106 } 107 else 108 { 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'; 116 } 117 echo "\n"; 118 119 // Writing FM capability 120 echo ' fm : '; 121 if($results[$base + 12] == 'yes') 122 echo 'yes'; 123 else 124 echo 'no'; 125 echo "\n"; 126 127 // Writing record capability 128 echo ' record : '; 129 if($results[$base + 16] == 'yes') 130 echo 'yes'; 131 else 132 echo 'no'; 133 echo "\n"; 134 135 // Closing the target 136 echo "}\n\n"; 137 138 proc_close($proc); 139} 140 141?>