From: <dom...@us...> - 2011-01-29 20:59:45
|
Revision: 69 http://fvwm-crystal.svn.sourceforge.net/fvwm-crystal/?rev=69&view=rev Author: dominique_libre Date: 2011-01-29 20:59:38 +0000 (Sat, 29 Jan 2011) Log Message: ----------- Mixer: cleanup Modified Paths: -------------- ChangeLog fvwm/components/functions/Mixer Modified: ChangeLog =================================================================== --- ChangeLog 2011-01-29 20:53:37 UTC (rev 68) +++ ChangeLog 2011-01-29 20:59:38 UTC (rev 69) @@ -15,6 +15,7 @@ when some partition is not avaible. * Icon-Mwm: support for font preference * Added functions to make panels and buttons + * Mixer: cleanup Samedi 1 janvier 2011 Dominique Michel * Wimdow-Raise-Move-Lover witll focus on a non overlapped window Modified: fvwm/components/functions/Mixer =================================================================== --- fvwm/components/functions/Mixer 2011-01-29 20:53:37 UTC (rev 68) +++ fvwm/components/functions/Mixer 2011-01-29 20:59:38 UTC (rev 69) @@ -1,8 +1,8 @@ # Support for mixer controls -# Written by: Dominique Michel -# All the previously supported mixers are supported now by this file. -# New mixers will be added here. +# Written by: Dominique Michel <dom...@so...> # +# This file contain code for all the mixers. +# # The original mixers are ALSA mixer (alsamixer, alsamixergui and # alsamixerguis (a script part of bmpdj)), # audacious, aumix, cdcd, cmus, mpd, quodlibet, xmms and xmms2. @@ -15,33 +15,25 @@ # # Only alsamixer do have direct dB control. It will be approximated for the other mixers. # -# TODO: Put alsamixerguis with fvwm-crystal -# Move the mixer preferences into the mixer menu (left todo: remove it from the normal pref menu) -# Change the default Mixer preference to amixer into the preferences directory. +# TODO: Change the default Mixer preference to amixer into the preferences directory. # Test for Master control for all the mixers when possible. -# Make a pref setting with the Mixer-Volume-Up(Down) step. +# Make a pref setting with the Volume step. # Internationalisation. # # WARNINGS: At that time and for what I know, only amixer do have a native dB support. # I considere this like a must have feature for a professional mixer control. -# -# A good sound card is also a must if you want a good sound experience with your box. -# The value for the Mixer-Volume-Up(Down) and for the % volume scale in dB -# was setup with amixer and an audiophile 192 for 3 and 6dB steps. -# Those values can match or not your sound card (read than they can or not be -# of 3 and 6 dB with your card). -# The low values of the sound level can also work or not with your card (Mine is -# a 24 bits sound card, its dynamic is better than with a 16 bits card.). If they -# are not working, the sound will be muted. -# Other mixers than amixer will also give you different steps values (the steps -# will not have the same value than with amixer). Well, the usual sound related mess. -# The good news is that amixer look like to be the only professional mixer here... -# So, if you are not sure but want to know what you are doing, use amixer. +################################################################################ -# Value for 3dB steps when no native dB control is used or found. Modify it here +# If there is no selected mixer, load the default +CheckPreferences DefaultMixer "SetEnv Mixer amixer" + +# Value for volume steps when no native dB control is used or found. Modify it here # if you want or need another value. Used here and for the multimedia keys binding. -SetEnv 3dB_Step "4.5" +# 3 dB step (determined with an audiphile 192 24 bits sound card): +#SetEnv Vol_Step "4.5" +# 1.5 dB step: +SetEnv Vol_Step "2" ## The following part is for amixer only # Test with amixer if a Master mixer exist, fallback to PCM @@ -77,6 +69,7 @@ DestroyFunc Mixer-Volume-Up AddToFunc Mixer-Volume-Up + I Test (EnvMatch Mixer amixer) Exec exec amixer set '$[VolControl]' $0%+ > /dev/null ++ I Test (EnvMatch Mixer amixer) PipeRead 'tmpval=`amixer get $[VolControl]`; tmpval2=`echo $tmpval|sed -e "s:\\(.*\\)\\(\\[.*dB]\\):\\2:"`; echo "SetEnv CurrentVolume $tmpval2"' + I Test (EnvMatch Mixer audacious) Exec exec audtool set-volume +$0 + I Test (EnvMatch Mixer aumix) Exec exec aumix -'$[VolControl]' +$0 + I Test (EnvMatch Mixer cdcd) Nop @@ -89,6 +82,7 @@ DestroyFunc Mixer-Volume-Down AddToFunc Mixer-Volume-Down + I Test (EnvMatch Mixer amixer) Exec exec amixer set '$[VolControl]' $0%- > /dev/null ++ I Test (EnvMatch Mixer amixer) PipeRead 'tmpval=`amixer get $[VolControl]`; tmpval2=`echo $tmpval|sed -e "s:\\(.*\\)\\(\\[.*dB]\\):\\2:"`; echo "SetEnv CurrentVolume $tmpval2"' + I Test (EnvMatch Mixer audacious) Exec exec audtool set-volume -$0 + I Test (EnvMatch Mixer aumix) Exec exec aumix -'$[VolControl]' -$0 + I Test (EnvMatch Mixer cdcd) Nop @@ -101,6 +95,7 @@ DestroyFunc Mixer-Volume-dB AddToFunc Mixer-Volume-dB + I Exec exec amixer -c 0 -- set '$[VolControl]' $0 > /dev/null ++ I PipeRead 'tmpval=`amixer get $[VolControl]`; tmpval2=`echo $tmpval|sed -e "s:\\(.*\\)\\(\\[.*dB]\\):\\2:"`; echo "SetEnv CurrentVolume $tmpval2"' DestroyFunc Mixer-GUI AddToFunc Mixer-GUI @@ -119,44 +114,91 @@ Test (EnvMatch Mixer xmms2) + I Nop ## Mixer menu +#DestroyMenu /Mixer +#AddToMenu /Mixer +#+ '$[gt.Show main mixer]' Mixer-GUI +#+ '%22x22/fvwm-crystal/multimedia-volume-control.png%$[gt.Audio mixer]' Popup /Preferences/Mixer +#+ "" Nop +#Test (!EnvMatch SnddB 0) + " 0 dB" Mixer-Volume-dB 0dB +#Test (!EnvMatch SnddB 0) + " -3 dB" Mixer-Volume-dB "-3dB" +#Test (!EnvMatch SnddB 0) + " -6 dB" Mixer-Volume-dB "-6dB" +#Test (!EnvMatch SnddB 0) + " -9 dB" Mixer-Volume-dB "-9dB" +#Test (!EnvMatch SnddB 0) + "-12 dB" Mixer-Volume-dB "-12dB" +#Test (!EnvMatch SnddB 0) + "-15 dB" Mixer-Volume-dB "-15dB" +#Test (!EnvMatch SnddB 0) + "-18 dB" Mixer-Volume-dB "-18dB" +#Test (!EnvMatch SnddB 0) + "-24 dB" Mixer-Volume-dB "-24dB" +#Test (!EnvMatch SnddB 0) + "-30 dB" Mixer-Volume-dB "-30dB" +#Test (!EnvMatch SnddB 0) + "-36 dB" Mixer-Volume-dB "-36dB" +#Test (!EnvMatch SnddB 0) + "-42 dB" Mixer-Volume-dB "-42dB" +#Test (!EnvMatch SnddB 0) + "-48 dB" Mixer-Volume-dB "-48dB" +#Test (!EnvMatch SnddB 0) + "-54 dB" Mixer-Volume-dB "-54dB" +#Test (!EnvMatch SnddB 0) + "-60 dB" Mixer-Volume-dB "-60dB" +#Test (EnvMatch SnddB 0) + " 0 dB" Mixer-Volume 100 +#Test (EnvMatch SnddB 0) + " -3 dB" Mixer-Volume 95 +#Test (EnvMatch SnddB 0) + " -6 dB" Mixer-Volume 91 +#Test (EnvMatch SnddB 0) + " -9 dB" Mixer-Volume 86 +#Test (EnvMatch SnddB 0) + "-12 dB" Mixer-Volume 81 +#Test (EnvMatch SnddB 0) + "-15 dB" Mixer-Volume 76 +#Test (EnvMatch SnddB 0) + "-18 dB" Mixer-Volume 72 +#Test (EnvMatch SnddB 0) + "-24 dB" Mixer-Volume 62 +#Test (EnvMatch SnddB 0) + "-30 dB" Mixer-Volume 53 +#Test (EnvMatch SnddB 0) + "-36 dB" Mixer-Volume 43 +#Test (EnvMatch SnddB 0) + "-42 dB" Mixer-Volume 34 +#Test (EnvMatch SnddB 0) + "-48 dB" Mixer-Volume 24 +#Test (EnvMatch SnddB 0) + "-54 dB" Mixer-Volume 15 +#Test (EnvMatch SnddB 0) + "-60 dB" Mixer-Volume 6 +#+ " 0" Mixer-Volume 0 +##Test (EnvMatch Mixer amixer) PipeRead 'tmpval=`amixer get $[VolControl]`; tmpval2=`echo $tmpval|sed -e "s:\\(.*\\)\\(\\[.*dB]\\):\\2:"`; echo "+ \'$[gt.Current volume $tmpval2]\' Nop"' +#Test (!EnvMatch SnddB 0) + "" Nop +#Test (!EnvMatch SnddB 0) + " +6 dB" Mixer-Volume-dB "6dB+" +#Test (!EnvMatch SnddB 0) + " +3 dB" Mixer-Volume-dB "3dB+" +#Test (!EnvMatch SnddB 0) + " -3 dB" Mixer-Volume-dB "3dB-" +#Test (!EnvMatch SnddB 0) + " -6 dB" Mixer-Volume-dB "6dB-" + +DestroyFunc /Mixer-generator +AddToFunc /Mixer-generator ++ I DestroyMenu recreate /Mixer ++ I AddToMenu /Mixer '$[gt.Show main mixer]' Mixer-GUI ++ I AddToMenu /Mixer '%22x22/fvwm-crystal/multimedia-volume-control.png%$[gt.Audio mixer]' Popup /Preferences/Mixer +Test (!EnvMatch SnddB 0) + I AddToMenu /Mixer "" Nop +Test (!EnvMatch SnddB 0) + I AddToMenu /Mixer " 0 dB" Mixer-Volume-dB 0dB +Test (!EnvMatch SnddB 0) + I AddToMenu /Mixer " -3 dB" Mixer-Volume-dB "-3dB" +Test (!EnvMatch SnddB 0) + I AddToMenu /Mixer " -6 dB" Mixer-Volume-dB "-6dB" +Test (!EnvMatch SnddB 0) + I AddToMenu /Mixer " -9 dB" Mixer-Volume-dB "-9dB" +Test (!EnvMatch SnddB 0) + I AddToMenu /Mixer "-12 dB" Mixer-Volume-dB "-12dB" +Test (!EnvMatch SnddB 0) + I AddToMenu /Mixer "-15 dB" Mixer-Volume-dB "-15dB" +Test (!EnvMatch SnddB 0) + I AddToMenu /Mixer "-18 dB" Mixer-Volume-dB "-18dB" +Test (!EnvMatch SnddB 0) + I AddToMenu /Mixer "-24 dB" Mixer-Volume-dB "-24dB" +Test (!EnvMatch SnddB 0) + I AddToMenu /Mixer "-30 dB" Mixer-Volume-dB "-30dB" +Test (!EnvMatch SnddB 0) + I AddToMenu /Mixer "-36 dB" Mixer-Volume-dB "-36dB" +Test (!EnvMatch SnddB 0) + I AddToMenu /Mixer "-42 dB" Mixer-Volume-dB "-42dB" +Test (!EnvMatch SnddB 0) + I AddToMenu /Mixer "-48 dB" Mixer-Volume-dB "-48dB" +Test (!EnvMatch SnddB 0) + I AddToMenu /Mixer "-54 dB" Mixer-Volume-dB "-54dB" +Test (!EnvMatch SnddB 0) + I AddToMenu /Mixer "-60 dB" Mixer-Volume-dB "-60dB" +Test (EnvMatch SnddB 0) + I AddToMenu /Mixer " 0 dB" Mixer-Volume 100 +Test (EnvMatch SnddB 0) + I AddToMenu /Mixer " -3 dB" Mixer-Volume 95 +Test (EnvMatch SnddB 0) + I AddToMenu /Mixer " -6 dB" Mixer-Volume 91 +Test (EnvMatch SnddB 0) + I AddToMenu /Mixer " -9 dB" Mixer-Volume 86 +Test (EnvMatch SnddB 0) + I AddToMenu /Mixer "-12 dB" Mixer-Volume 81 +Test (EnvMatch SnddB 0) + I AddToMenu /Mixer "-15 dB" Mixer-Volume 76 +Test (EnvMatch SnddB 0) + I AddToMenu /Mixer "-18 dB" Mixer-Volume 72 +Test (EnvMatch SnddB 0) + I AddToMenu /Mixer "-24 dB" Mixer-Volume 62 +Test (EnvMatch SnddB 0) + I AddToMenu /Mixer "-30 dB" Mixer-Volume 53 +Test (EnvMatch SnddB 0) + I AddToMenu /Mixer "-36 dB" Mixer-Volume 43 +Test (EnvMatch SnddB 0) + I AddToMenu /Mixer "-42 dB" Mixer-Volume 34 +Test (EnvMatch SnddB 0) + I AddToMenu /Mixer "-48 dB" Mixer-Volume 24 +Test (EnvMatch SnddB 0) + I AddToMenu /Mixer "-54 dB" Mixer-Volume 15 +Test (EnvMatch SnddB 0) + I AddToMenu /Mixer "-60 dB" Mixer-Volume 6 ++ I AddToMenu /Mixer " 0" Mixer-Volume 0 +#+ I AddToMenu /Mixer '$[gt.Currrent volume] $[CurrentVolume]' Nop +Test (!EnvMatch SnddB 0) + I AddToMenu /Mixer "" Nop +Test (!EnvMatch SnddB 0) + I AddToMenu /Mixer " +6 dB" Mixer-Volume-dB "6dB+" +Test (!EnvMatch SnddB 0) + I AddToMenu /Mixer " +3 dB" Mixer-Volume-dB "3dB+" +Test (!EnvMatch SnddB 0) + I AddToMenu /Mixer " -3 dB" Mixer-Volume-dB "3dB-" +Test (!EnvMatch SnddB 0) + I AddToMenu /Mixer " -6 dB" Mixer-Volume-dB "6dB-" + DestroyMenu /Mixer AddToMenu /Mixer -+ '$[gt.Show main mixer]' Mixer-GUI -+ '%22x22/fvwm-crystal/multimedia-volume-control.png%$[gt.Audio mixer]' Popup /Preferences/Mixer -+ "" Nop -Test (!EnvMatch SnddB 0) + " 0 dB" Mixer-Volume-dB 0dB -Test (!EnvMatch SnddB 0) + " -3 dB" Mixer-Volume-dB "-3dB" -Test (!EnvMatch SnddB 0) + " -6 dB" Mixer-Volume-dB "-6dB" -Test (!EnvMatch SnddB 0) + " -9 dB" Mixer-Volume-dB "-9dB" -Test (!EnvMatch SnddB 0) + "-12 dB" Mixer-Volume-dB "-12dB" -Test (!EnvMatch SnddB 0) + "-15 dB" Mixer-Volume-dB "-15dB" -Test (!EnvMatch SnddB 0) + "-18 dB" Mixer-Volume-dB "-18dB" -Test (!EnvMatch SnddB 0) + "-24 dB" Mixer-Volume-dB "-24dB" -Test (!EnvMatch SnddB 0) + "-30 dB" Mixer-Volume-dB "-30dB" -Test (!EnvMatch SnddB 0) + "-36 dB" Mixer-Volume-dB "-36dB" -Test (!EnvMatch SnddB 0) + "-42 dB" Mixer-Volume-dB "-42dB" -Test (!EnvMatch SnddB 0) + "-48 dB" Mixer-Volume-dB "-48dB" -Test (!EnvMatch SnddB 0) + "-54 dB" Mixer-Volume-dB "-54dB" -Test (!EnvMatch SnddB 0) + "-60 dB" Mixer-Volume-dB "-60dB" -Test (EnvMatch SnddB 0) + " 0 dB" Mixer-Volume 100 -Test (EnvMatch SnddB 0) + " -3 dB" Mixer-Volume 95 -Test (EnvMatch SnddB 0) + " -6 dB" Mixer-Volume 91 -Test (EnvMatch SnddB 0) + " -9 dB" Mixer-Volume 86 -Test (EnvMatch SnddB 0) + "-12 dB" Mixer-Volume 81 -Test (EnvMatch SnddB 0) + "-15 dB" Mixer-Volume 76 -Test (EnvMatch SnddB 0) + "-18 dB" Mixer-Volume 72 -Test (EnvMatch SnddB 0) + "-24 dB" Mixer-Volume 62 -Test (EnvMatch SnddB 0) + "-30 dB" Mixer-Volume 53 -Test (EnvMatch SnddB 0) + "-36 dB" Mixer-Volume 43 -Test (EnvMatch SnddB 0) + "-42 dB" Mixer-Volume 34 -Test (EnvMatch SnddB 0) + "-48 dB" Mixer-Volume 24 -Test (EnvMatch SnddB 0) + "-54 dB" Mixer-Volume 15 -Test (EnvMatch SnddB 0) + "-60 dB" Mixer-Volume 6 -+ " 0" Mixer-Volume 0 -Test (!EnvMatch SnddB 0) + "" Nop -Test (!EnvMatch SnddB 0) + " +6 dB" Mixer-Volume-dB "6dB+" -Test (!EnvMatch SnddB 0) + " +3 dB" Mixer-Volume-dB "3dB+" -Test (!EnvMatch SnddB 0) + " -3 dB" Mixer-Volume-dB "3dB-" -Test (!EnvMatch SnddB 0) + " -6 dB" Mixer-Volume-dB "6dB-" ++ DynamicPopupAction Function /Mixer-generator # vim:ft=fvwm This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |