File: AmixerCurrentdBVolume

package info (click to toggle)
fvwm-crystal 3.4.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 21,700 kB
  • ctags: 1,494
  • sloc: sh: 3,265; cs: 1,335; python: 875; makefile: 214
file content (17 lines) | stat: -rwxr-xr-x 724 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
# Support for amixer controls
# Written by: Dominique Michel <dominique_libre@sourceforge.net>
#
# Usage:
# PipeRead "AmixerControl $[infostore.SoundCard] $[infostore.SoundDevice]

# The hardware current volume step:
CurrentVol=`amixer -c $1 cget numid="$2"|grep ": values"|sed -e "s:.*values=::" -e "s:,.*::"`
# The minimum level of the volume:
CVolMin=`amixer -c $1 cget numid="$2"|grep dBscale|sed -e "s:.*dBscale-min=::" -e "s:dB.*::"`
# The hardware step level:
CStepLevel=`amixer -c $1 cget numid="$2"|grep dBscale|sed -e "s:.*step=::" -e "s:dB.*::"`
#				  14		13		7

ndB=`echo "${CVolMin} + ( ${CurrentVol} * ${CStepLevel} )"|bc -l|awk '{printf "%.2f\n", $0}'`
echo "InfoStoreAdd CurrentdBVolume ${ndB}"