Example #1
0
 def get_output_source(self, target):
     index = self._refer_out_data(target)
     fb = self.__output_sources[index]
     value = AvcAudio.get_selector_state(self.unit.fcp, 0, 'current', fb)
     if value == 1 and self.__aux_output:
         return 'aux-1/2'
     return self.labels['mixers'][index]
Example #2
0
 def get_headphone_source(self, target):
     index = self._refer_hp_data(target)
     fb = self.__hp_sources[index][0]
     value = AvcAudio.get_selector_state(self.unit.fcp, 0, 'current', fb)
     ch = self.__hp_sources[index][1][value]
     if ch < len(self.labels['mixers']):
         return self.labels['mixers'][ch]
     return 'aux-1/2'
Example #3
0
 def get_output_source(self, target):
     if target not in self.__output_labels:
         raise ValueError('Invalid argumetn for output')
     fb = self.__output_labels[target]
     idx = AvcAudio.get_selector_state(self.fcp, 0, 'current', fb)
     for key, val in self.__OUTPUT_SOURCES.items():
         if val == idx:
             return key
     else:
         raise ValueError('Unexpected value for output source.')
    def get_headphone_source(self, target):
        if target not in self.get_headphone_labels():
            raise ValueError('Invalid argument for headphone')

        state = AvcAudio.get_selector_state(self.unit.fcp, 0, 'current',
                                            self.__SELECTOR_FB)
        if state == 0x01:
            return 'aux-1/2'
        elif state == 0x00:
            for i, elems in enumerate(self.mixers):
                in_ch = elems[1][0]
                data = AvcAudio.get_processing_mixer_state(
                    self.unit.fcp, 0, 'current', self.__PROCESSING_OUT_FB,
                    self.__PROCESSING_IN_FB, in_ch, self.__PROCESSING_OUT_CH)
                if data[0] == 0x00 and data[1] == 0x00:
                    return self.labels['mixers'][i]

        # No sources are set. For convenience, set 'mixer-1/2'.
        self.set_headphone_source('headphone-1/2', 'mixer-1/2')
        return 'mixer-1/2'
Example #5
0
 def get_clock_source(self):
     state = AvcAudio.get_selector_state(self.fcp, 0, 'current', 4)
     return self.__SUPPORTED_CLOCK_SOURCES[state]