def get_stream_formats(self): fmts = dict.fromkeys(("capture", "playback"), []) addr = BcoPlugInfo.get_unit_addr("output", "isoc", 0) fmts["capture"] = BcoStreamFormatInfo.get_entry_list(self.fcp, addr) addr = BcoPlugInfo.get_unit_addr("input", "isoc", 0) fmts["playback"] = BcoStreamFormatInfo.get_entry_list(self.fcp, addr) return fmts
def _parse_stream_formats(self): hoge = {} for type, dir_plugs in self.unit_plugs.items(): if type == 'async': continue hoge[type] = {} for dir, plugs in dir_plugs.items(): hoge[type][dir] = [] for i, plug in plugs.items(): addr = BcoPlugInfo.get_unit_addr(dir, type, i) try: fmts = BcoStreamFormatInfo.get_entry_list(self.fcp, addr) hoge[type][dir].append(fmts) except: continue return hoge