Skip to content

Commit

Permalink
fixed volume selection from pactl output
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBigW committed Apr 24, 2015
1 parent 580e77d commit 530a6d1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions ParametricEQ.py
Expand Up @@ -67,16 +67,14 @@ def alsaVolumeCheckTimer( paramEQPluginInst ):

@staticmethod
def pulseVolumeCheckTimer( paramEQPluginInst ):
#alsa get volume:
#mainVolume = check_output(strParams )
p = subprocess.Popen(["pactl", "list", "sinks"], stdout=subprocess.PIPE)
out, err = p.communicate()
pattern = re.compile(': 0:\s*(\d*)%', re.MULTILINE)
strOutPut = str(out)
#print( "pactl says: ", strOutPut )
allVolumes = pattern.findall( strOutPut )
#print("all volumes : ", allVolumes)
pulseVolume = int(allVolumes[1])
pulseVolume = int(allVolumes[-1])
if paramEQPluginInst.mainVolumePercentage != pulseVolume:
paramEQPluginInst.mainVolumePercentage = pulseVolume
print("main volume changed : ", pulseVolume)
Expand Down

0 comments on commit 530a6d1

Please sign in to comment.