diff --git a/home/pi/saveconfigs.sh b/home/pi/saveconfigs.sh index 5451558..0f65722 100755 --- a/home/pi/saveconfigs.sh +++ b/home/pi/saveconfigs.sh @@ -8,5 +8,7 @@ rsync -avH --delete /home/pi/.config/ /home/pi/config rsync -avH --delete /home/pi/.fldigi/ /home/pi/fldigi rsync -avH --delete /home/pi/.flrig/ /home/pi/flrig +sudo alsactl store + echo "Reboot to make filesystem read-only again." diff --git a/var/www/html/audio.php b/var/www/html/audio.php new file mode 100755 index 0000000..91105d8 --- /dev/null +++ b/var/www/html/audio.php @@ -0,0 +1,138 @@ + + +

Audio Setup

+ + +
+ +"; + +// Create the Playback sliders +echo "

Playback

"; +foreach ($scontrols[0] as $scontrol) { + $name = substr($scontrol, 1, -1); + + // Get the current control settings and capabilties + $output = shell_exec("sudo amixer get $scontrol"); + + $checked = 0; + foreach(preg_split("/((\r?\n)|(\r\n?))/", $output) as $line) { + if(preg_match('/Playback [0-9]+ \[[0-9]+%\] \[-*[0-9]+\.[0-9]+dB\] \[on\]/', $line, $matches)) + $checked = 1; + } + + if (preg_match_all('/Capabilities:.*pvolume/', $output)) { + //$level = $level_match[1]; + + // Grab the first level. Not supporting stereo. + preg_match_all('/Playback [0-9]+ \[([0-9]+)%\]/', $output, $levels); + $level = $levels[1][0]; + + echo ""; + echo "$name"; + // mmmmm sliders + echo "$level"; + if (preg_match_all('/Capabilities:.*pswitch/', $output)) { + echo ""; + } + echo ""; + } + elseif (preg_match_all('/Capabilities:.*pswitch/', $output)) { + $checked = preg_match_all('/Playback.*\[on\]/', $output); + echo ""; + echo "$name"; + echo ""; + echo ""; + } +} + +// Create the Capture sliders +echo "

Capture

"; + +foreach ($scontrols[0] as $scontrol) { + $name = substr($scontrol, 1, -1); + + // Get the current control settings and capabilties + $output = shell_exec("sudo amixer get $scontrol"); + + $checked = 0; + foreach(preg_split("/((\r?\n)|(\r\n?))/", $output) as $line) { + if(preg_match('/Capture [0-9]+ \[[0-9]+%\] \[-*[0-9]+\.[0-9]+dB\] \[on\]/', $line, $matches)) + $checked = 1; + } + + if (preg_match_all('/Capabilities:.*cvolume/', $output)) { + //$level = $level_match[1]; + + // Grab the first level. Not supporting stereo. + preg_match_all('/Capture [0-9]+ \[([0-9]+)%\]/', $output, $levels); + $level = $levels[1][0]; + + echo ""; + echo "$name"; + // mmmmm sliders + echo "$level"; + if (preg_match_all('/Capabilities:.*cswitch/', $output)) { + echo ""; + } + echo ""; + } + elseif (preg_match_all('/Capabilities:.*cswitch/', $output)) { + $checked = preg_match_all('/Playback.*\[on\]/', $output); + echo ""; + echo "$name"; + echo ""; + echo ""; + } +} +echo ""; + + +?> +
+         +
+ + + diff --git a/var/www/html/index.php b/var/www/html/index.php index ce5e870..c56ef59 100755 --- a/var/www/html/index.php +++ b/var/www/html/index.php @@ -640,6 +640,11 @@ Webchat + + + Audio + +