Prepare to audio output config.

This commit is contained in:
Pecusx
2016-11-15 22:23:47 +01:00
committed by GitHub
parent a91ba2ac59
commit 571d2b1325
+53 -9
View File
@@ -11,16 +11,54 @@
<hr>
Audio device config<br>
<form action="changeconf.php?file=audio" method="post">
<pre>
<input type="radio" name="output" value="internal" checked> internal audio
<input type="radio" name="output" value="USB"> USB audio card<br>
<button type="submit" name="submit">Save audio device config</button>
</pre>
<b><pre>
<?php
$hqa = file_get_contents( "/boot/config.txt" );
preg_match('/\n *audio_pwm_mode *=.*/', $hqa, $matches);
$hqa_v = preg_replace("/\n *audio_pwm_mode *= */", "", $matches[0]);
$audio = file_get_contents( "/lib/modprobe.d/aliases.conf" );
preg_match('/\n# USB audio card as first device/', $audio, $matches);
$audio_usb = isset($matches[0]);
preg_match('/\n# Internal audio card as first device/', $audio, $matches);
$audio_int = isset($matches[0]);
echo ' <input type="radio" name="output" value="internal" ';
if ( $audio_int ) {
echo 'checked';
}
echo '> internal audio (<input type="checkbox" name="hda" value="hdaudio" ';
if ( $hqa_v == 2 ) {
echo 'checked>';
} else {
echo '>';
}
echo ' - high quality output)'."\n";
echo ' <input type="radio" name="output" value="usb" ';
if ( $audio_usb ) {
echo 'checked';
}
echo '> USB audio card<br>'."\n";
echo '<input type="hidden" name="output_old" value="';
if ( $audio_int ) {
echo 'internal';
} elseif ( $audio_usb ) {
echo "usb";
} else {
echo "none";
}
echo '">';
echo '<input type="hidden" name="hda_old" value="';
if ( $hqa_v == 2 ) {
echo 'hdaudio';
}
echo '">';
?>
<button type="submit" name="submit">Save audio device config</button>
</pre></b>
</form>
<hr>
Remote config<br>
<form action="changeconf.php?file=remote" method="post">
<pre>
<b><pre>
<?php
$remote = file_get_contents( "/etc/lirc/lircd.conf" );
preg_match('/\n# *brand: *.*/', $remote, $matches);
@@ -37,12 +75,17 @@ for ($i = 0; $i < count($remoteconfigs); $i++) {
if ($remotename==$currentremotename) {
echo ' checked';
}
echo "> ".$remotename."\n";
echo "> ".$remotename;
if ($i < count($remoteconfigs)-1) {
echo "\n";
} else {
echo "<br>\n";
}
}
}
?>
<br><button type="submit" name="submit">Save remote config and reboot</button>
</pre>
<button type="submit" name="submit">Save remote config and reboot</button>
</pre></b>
</form>
<hr>
Update to last build from github
@@ -51,3 +94,4 @@ Update to last build from github
<a href="changeconf.php?file=restart"><button>PiRadio restart</button></a>
<a href="changeconf.php?file=reboot"><button>System reboot</button></a>
</body>
</html>