mirror of
https://github.com/pkali/piradio-mini.git
synced 2026-05-20 22:34:22 +02:00
Prepare to audio output config.
This commit is contained in:
+53
-9
@@ -11,16 +11,54 @@
|
|||||||
<hr>
|
<hr>
|
||||||
Audio device config<br>
|
Audio device config<br>
|
||||||
<form action="changeconf.php?file=audio" method="post">
|
<form action="changeconf.php?file=audio" method="post">
|
||||||
<pre>
|
<b><pre>
|
||||||
<input type="radio" name="output" value="internal" checked> internal audio
|
<?php
|
||||||
<input type="radio" name="output" value="USB"> USB audio card<br>
|
$hqa = file_get_contents( "/boot/config.txt" );
|
||||||
<button type="submit" name="submit">Save audio device config</button>
|
preg_match('/\n *audio_pwm_mode *=.*/', $hqa, $matches);
|
||||||
</pre>
|
$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>
|
</form>
|
||||||
<hr>
|
<hr>
|
||||||
Remote config<br>
|
Remote config<br>
|
||||||
<form action="changeconf.php?file=remote" method="post">
|
<form action="changeconf.php?file=remote" method="post">
|
||||||
<pre>
|
<b><pre>
|
||||||
<?php
|
<?php
|
||||||
$remote = file_get_contents( "/etc/lirc/lircd.conf" );
|
$remote = file_get_contents( "/etc/lirc/lircd.conf" );
|
||||||
preg_match('/\n# *brand: *.*/', $remote, $matches);
|
preg_match('/\n# *brand: *.*/', $remote, $matches);
|
||||||
@@ -37,12 +75,17 @@ for ($i = 0; $i < count($remoteconfigs); $i++) {
|
|||||||
if ($remotename==$currentremotename) {
|
if ($remotename==$currentremotename) {
|
||||||
echo ' checked';
|
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>
|
<button type="submit" name="submit">Save remote config and reboot</button>
|
||||||
</pre>
|
</pre></b>
|
||||||
</form>
|
</form>
|
||||||
<hr>
|
<hr>
|
||||||
Update to last build from github
|
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=restart"><button>PiRadio restart</button></a>
|
||||||
<a href="changeconf.php?file=reboot"><button>System reboot</button></a>
|
<a href="changeconf.php?file=reboot"><button>System reboot</button></a>
|
||||||
</body>
|
</body>
|
||||||
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user