This commit is contained in:
cuu 2018-07-25 15:46:29 +08:00
parent 0316326819
commit bbb9cbba64
2 changed files with 18 additions and 6 deletions

View File

@ -122,12 +122,20 @@ class SoundPage(Page):
self._MySlider.Init()
m = alsaaudio.Mixer()
self._MySlider.SetValue(m.getvolume()[0])
try:
m = alsaaudio.Mixer()
self._MySlider.SetValue(m.getvolume()[0])
except Exception,e:
print(str(e))
self._MySlider.SetValue(0)
def OnLoadCb(self):
m = alsaaudio.Mixer()
self._MySlider.SetValue(m.getvolume()[0])
try:
m = alsaaudio.Mixer()
self._MySlider.SetValue(m.getvolume()[0])
except Exception,e:
print(str(e))
def WhenSliderDrag(self,value): ##value 0-100
if value < 0 or value > 100:

View File

@ -95,8 +95,12 @@ class TitleBar:
return ge
def SyncSoundVolume(self):
m = alsaaudio.Mixer()
vol = m.getvolume()[0]
try:
m = alsaaudio.Mixer()
vol = m.getvolume()[0]
except Exception,e:
print(str(e))
vol = 0
snd_segs = [ [0,10],[10,30],[30,70],[70,100] ]