Changeset 1367 for branches/libffado-2.0/support/mixer-qt4/mixer_motu.py
- Timestamp:
- 10/21/08 10:46:28 (15 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/libffado-2.0/support/mixer-qt4/mixer_motu.py
r1365 r1367 25 25 from PyQt4.QtGui import QWidget 26 26 from mixer_motuui import * 27 28 import logging 29 log = logging.getLogger('motu') 27 30 28 31 # Model defines. These must agree with what is used in motu_avdevice.h. … … 514 517 sender = self.sender() 515 518 vol = 128-a0 516 print"setting %s for mix %d channel %d to %d" % (self.ChannelFaders[sender][0],517 self.ChannelFaders[sender][1], self.ChannelFaders[sender][2], vol) 519 log.debug("setting %s for mix %d channel %d to %d" % (self.ChannelFaders[sender][0], 520 self.ChannelFaders[sender][1], self.ChannelFaders[sender][2], vol)) 518 521 self.hw.setMatrixMixerValue(self.ChannelFaders[sender][0], 519 522 self.ChannelFaders[sender][1], self.ChannelFaders[sender][2], vol) … … 523 526 sender = self.sender() 524 527 val = a0 525 print"setting %s for mix %d channel %d to %d" % (self.ChannelControls[sender][0],526 self.ChannelControls[sender][1], self.ChannelControls[sender][2], val) 528 log.debug("setting %s for mix %d channel %d to %d" % (self.ChannelControls[sender][0], 529 self.ChannelControls[sender][1], self.ChannelControls[sender][2], val)) 527 530 self.hw.setMatrixMixerValue(self.ChannelControls[sender][0], 528 531 self.ChannelControls[sender][1], self.ChannelControls[sender][2], val) … … 532 535 sender = self.sender() 533 536 val = a0 534 print "setting %s control to %d" % (self.Controls[sender][0], val)537 log.debug("setting %s control to %d" % (self.Controls[sender][0], val)) 535 538 self.hw.setDiscrete(self.Controls[sender][0], val) 536 539 … … 539 542 sender = self.sender() 540 543 val=a0 541 print"setting %s for mix %d channel %d switch to %d" % (self.ChannelBinarySwitches[sender][0],542 self.ChannelBinarySwitches[sender][1], self.ChannelBinarySwitches[sender][2], val) 544 log.debug("setting %s for mix %d channel %d switch to %d" % (self.ChannelBinarySwitches[sender][0], 545 self.ChannelBinarySwitches[sender][1], self.ChannelBinarySwitches[sender][2], val)) 543 546 self.hw.setMatrixMixerValue(self.ChannelBinarySwitches[sender][0], 544 547 self.ChannelBinarySwitches[sender][1], self.ChannelBinarySwitches[sender][2], val) … … 548 551 sender = self.sender() 549 552 val=a0 550 print "setting %s switch to %d" % (self.BinarySwitches[sender][0], val)553 log.debug("setting %s switch to %d" % (self.BinarySwitches[sender][0], val)) 551 554 self.hw.setDiscrete(self.BinarySwitches[sender][0], val) 552 555 … … 555 558 sender = self.sender() 556 559 vol = 128-a0 557 print "setting %s mix fader to %d" % (self.Faders[sender][0], vol)560 log.debug("setting %s mix fader to %d" % (self.Faders[sender][0], vol)) 558 561 self.hw.setDiscrete(self.Faders[sender][0], vol) 559 562 … … 562 565 sender = self.sender() 563 566 dest=a0 564 print "setting %s mix destination to %d" % (self.MixDests[sender][0], dest)567 log.debug("setting %s mix destination to %d" % (self.MixDests[sender][0], dest)) 565 568 self.hw.setDiscrete(self.MixDests[sender][0], dest) 566 569 … … 572 575 name=a0 573 576 state = a1 574 print "setting %s state to %d" % (name, state)577 log.debug("setting %s state to %d" % (name, state)) 575 578 self.hw.setDiscrete(self.SelectorControls[name][0], state) 576 579 … … 583 586 # Is the device streaming? 584 587 self.is_streaming = self.hw.getDiscrete('/Mixer/Info/IsStreaming') 585 print "device streaming flag: %d" % (self.is_streaming)588 log.debug("device streaming flag: %d" % (self.is_streaming)) 586 589 587 590 # Retrieve other device settings as needed 588 591 self.model = self.hw.getDiscrete('/Mixer/Info/Model') 589 print "device model identifier: %d" % (self.model)592 log.debug("device model identifier: %d" % (self.model)) 590 593 self.sample_rate = self.hw.getDiscrete('/Mixer/Info/SampleRate') 591 print "device sample rate: %d" % (self.sample_rate)594 log.debug("device sample rate: %d" % (self.sample_rate)) 592 595 self.has_mic_inputs = self.hw.getDiscrete('/Mixer/Info/HasMicInputs') 593 print "device has mic inputs: %d" % (self.has_mic_inputs)596 log.debug("device has mic inputs: %d" % (self.has_mic_inputs)) 594 597 self.has_aesebu_inputs = self.hw.getDiscrete('/Mixer/Info/HasAESEBUInputs') 595 print "device has AES/EBU inputs: %d" % (self.has_aesebu_inputs)598 log.debug("device has AES/EBU inputs: %d" % (self.has_aesebu_inputs)) 596 599 self.has_spdif_inputs = self.hw.getDiscrete('/Mixer/Info/HasSPDIFInputs') 597 print "device has SPDIF inputs: %d" % (self.has_spdif_inputs)600 log.debug("device has SPDIF inputs: %d" % (self.has_spdif_inputs)) 598 601 self.has_optical_spdif = self.hw.getDiscrete('/Mixer/Info/HasOpticalSPDIF') 599 print "device has optical SPDIF: %d" % (self.has_optical_spdif)602 log.debug("device has optical SPDIF: %d" % (self.has_optical_spdif)) 600 603 601 604 # Customise the UI based on device options retrieved … … 662 665 # Some controls must be disabled if the device is streaming 663 666 if (self.is_streaming): 664 print "Disabling controls which require inactive streaming"667 log.debug("Disabling controls which require inactive streaming") 665 668 self.optical_in_mode.setEnabled(False) 666 669 self.optical_out_mode.setEnabled(False) … … 668 671 # Some channels aren't available at higher sampling rates 669 672 if (self.sample_rate > 96000): 670 print "Disabling controls not present above 96 kHz"673 log.debug("Disabling controls not present above 96 kHz") 671 674 self.mix1_tab.setTabEnabled(3, False) # ADAT 672 675 self.mix1_tab.setTabEnabled(2, False) # SPDIF … … 682 685 self.mix4_tab.setTabEnabled(1, False) # AES/EBU 683 686 if (self.sample_rate > 48000): 684 print "Disabling controls not present above 48 kHz"687 log.debug("Disabling controls not present above 48 kHz") 685 688 self.mix1_adat5.setEnabled(False) 686 689 self.mix1_adat6.setEnabled(False) … … 754 757 continue 755 758 vol = 128-self.hw.getMatrixMixerValue(info[0], info[1], info[2]) 756 print "%s for mix %d channel %d is %d" % (info[0], info[1], info[2], vol)759 log.debug("%s for mix %d channel %d is %d" % (info[0], info[1], info[2], vol)) 757 760 ctrl.setValue(vol) 758 761 QObject.connect(ctrl, SIGNAL('valueChanged(int)'), self.updateChannelFader) … … 762 765 continue 763 766 vol = 128-self.hw.getDiscrete(info[0]) 764 print "%s mix fader is %d" % (info[0] , vol)767 log.debug("%s mix fader is %d" % (info[0] , vol)) 765 768 ctrl.setValue(vol) 766 769 QObject.connect(ctrl, SIGNAL('valueChanged(int)'), self.updateFader) … … 770 773 continue 771 774 pan = self.hw.getMatrixMixerValue(info[0], info[1], info[2]) 772 print "%s for mix %d channel %d is %d" % (info[0], info[1], info[2], pan)775 log.debug("%s for mix %d channel %d is %d" % (info[0], info[1], info[2], pan)) 773 776 ctrl.setValue(pan) 774 777 QObject.connect(ctrl, SIGNAL('valueChanged(int)'), self.updateChannelControl) … … 778 781 continue 779 782 pan = self.hw.getDiscrete(info[0]) 780 print "%s control is %d" % (info[0] , pan)783 log.debug("%s control is %d" % (info[0] , pan)) 781 784 ctrl.setValue(pan) 782 785 QObject.connect(ctrl, SIGNAL('valueChanged(int)'), self.updateControl) … … 784 787 # Disable the channel pair controls since they aren't yet implemented 785 788 for ctrl, info in self.PairSwitches.iteritems(): 786 print "%s control is not implemented yet: disabling" % (info[0])789 log.debug("%s control is not implemented yet: disabling" % (info[0])) 787 790 ctrl.setEnabled(False) 788 791 … … 791 794 continue 792 795 val = self.hw.getMatrixMixerValue(info[0], info[1], info[2]) 793 print "%s for mix %d channel %d is %d" % (info[0] , info[1], info[2], val)796 log.debug("%s for mix %d channel %d is %d" % (info[0] , info[1], info[2], val)) 794 797 if val: 795 798 ctrl.setChecked(True) … … 802 805 continue 803 806 val = self.hw.getDiscrete(info[0]) 804 print "%s switch is %d" % (info[0] , val)807 log.debug("%s switch is %d" % (info[0] , val)) 805 808 if val: 806 809 ctrl.setChecked(True) … … 813 816 continue 814 817 dest = self.hw.getDiscrete(info[0]) 815 print "%s mix destination is %d" % (info[0] , dest)818 log.debug("%s mix destination is %d" % (info[0] , dest)) 816 819 ctrl.setCurrentIndex(dest) 817 820 QObject.connect(ctrl, SIGNAL('activated(int)'), self.updateMixDest) … … 819 822 for name, ctrl in self.SelectorControls.iteritems(): 820 823 state = self.hw.getDiscrete(ctrl[0]) 821 print "%s state is %d" % (name , state)822 ctrl[1].setCurrentIndex(state) 824 log.debug("%s state is %d" % (name , state)) 825 ctrl[1].setCurrentIndex(state) 823 826 824 827 # FIXME: If optical mode is not ADAT, disable ADAT controls here.