def on_touch_up(self, touch): released = super(myVolSlider, self).on_touch_up(touch) if released: #change volume and play ping foo = str(self.value) foo = foo[:-2] #print foo num = int(foo) new = fn.changeRange(num, 0, 100, 85, 100) print 'num in range is: ' + str(new) if (num == 0): volstr = "amixer sset 'PCM' 0%" else: volstr = "amixer sset 'PCM' " + str(new) + "%" os.system(volstr) os.system('mpg123 /home/pi/newGUIwI2C/bell.mp3 &') return released
def on_enter(self, *args): self.sent_active_panel = False self.footNum = 0 self.current_panel = 0 #set the volume for the current user foo = str(self.vol_val) foo = foo[:-2] num = int(foo) new = fn.changeRange(num, 0, 100, 85, 100) print 'num in range is: ' + str(new) if (num == 0): volstr = "amixer sset 'PCM' 0%" else: volstr = "amixer sset 'PCM' " + str(new) + "%" os.system(volstr) #also edit brightness value to send over I2C temp = str(self.bright_val) temp = temp[:-2] self.bright_send = int(temp)