def cmd_get_limit(self): vol = self.dsptk.get_limit() if vol is not None: print("Limit: {:.4f} / {:.0f}% / {:.0f}db".format( vol, amplification2percent(vol), amplification2decibel(vol))) else: print("Profile doesn't support volume limit") sys.exit(1)
def cmd_set_limit(self): if len(self.args.parameters) > 0: vol = self.string_to_volume(self.args.parameters[0]) else: print("Volume parameter missing") sys.exit(1) if vol is not None: if self.dsptk.set_limit(vol): print("Limit set to {}dB".format(amplification2decibel(vol))) else: print("Profile doesn't support volume control") sys.exit(1)
def cmd_adjust_volume(self): if len(self.args.parameters) > 0: adjustment = self.string_to_volume(self.args.parameters[0]) else: print("Volume adjustment parameter missing") sys.exit(1) if adjustment is not None: if self.dsptk.adjust_volume(adjustment): print("Volume changed by {}dB".format( amplification2decibel(adjustment))) else: print("Profile doesn't support volume control") sys.exit(1)