示例#1
0
 def _seek_snd_unit_from_guid(guid):
     for fullpath in Path('/dev/snd').glob('hw*'):
         fullpath = str(fullpath)
         try:
             unit = Hinawa.SndUnit()
             unit.open(fullpath)
             if unit.get_property('guid') == guid:
                 return fullpath
         except Exception as e:
             pass
         finally:
             del unit
     return None
示例#2
0
文件: qt5.py 项目: EMATech/libhinawa
        snd_unit = Hinawa.SndDice()
        snd_unit.open(fullpath)
    except:
        del snd_unit
        try:
            snd_unit = Hinawa.SndEfw()
            snd_unit.open(fullpath)
        except:
            del snd_unit
            try:
                snd_unit = Hinawa.SndDg00x()
                snd_unit.open(fullpath)
            except:
                del snd_unit
                try:
                    snd_unit = Hinawa.SndUnit()
                    snd_unit.open(fullpath)
                except:
                    del snd_unit
                    continue
    break

if 'snd_unit' not in locals():
    print('No sound FireWire devices found.')
    sys.exit()

# create sound unit
def handle_lock_status(snd_unit, status):
    if status:
        print("streaming is locked.");
    else: