Debian Codegraph @

fvwm/scripts/AmixerCurrentdBVolume

raw
1 #!/bin/bash
2 # Support for amixer controls
3 # Written by: Dominique Michel <[email protected]>
4 #
5 # Usage:
6 # PipeRead "AmixerControl $[infostore.SoundCard] $[infostore.SoundDevice]
7
8 # The hardware current volume step:
9 CurrentVol=`amixer -c $1 cget numid="$2"|grep ": values"|sed -e "s:.*values=::" -e "s:,.*::"`
10 # The minimum level of the volume:
11 CVolMin=`amixer -c $1 cget numid="$2"|grep dBscale|sed -e "s:.*dBscale-min=::" -e "s:dB.*::"`
12 # The hardware step level:
13 CStepLevel=`amixer -c $1 cget numid="$2"|grep dBscale|sed -e "s:.*step=::" -e "s:dB.*::"`
14 # 14 13 7
15
16 ndB=`echo "${CVolMin} + ( ${CurrentVol} * ${CStepLevel} )"|bc -l|awk '{printf "%.2f\n", $0}'`
17 echo "InfoStoreAdd CurrentdBVolume ${ndB}"