|
|
|
@ -33,13 +33,12 @@ class VariableOsAudioData(ReadonlyTableVariable):
|
|
|
|
|
'os_audio_name']
|
|
|
|
|
|
|
|
|
|
def get(self,hr=False):
|
|
|
|
|
alsaInfo = getProgPath('/usr/bin/alsa-info')
|
|
|
|
|
if not alsaInfo:
|
|
|
|
|
data = readFile('/proc/asound/cards')
|
|
|
|
|
cards = re.findall('^\s*(\d+).*\n\s+(\S.*) at .*$',data,re.M)
|
|
|
|
|
if cards:
|
|
|
|
|
return map(list, cards)
|
|
|
|
|
else:
|
|
|
|
|
return [[]]
|
|
|
|
|
entry = re.compile('^Card hw:(\d+)\s*[^/]+/\'(.*?) at .*$')
|
|
|
|
|
return tuple(map(lambda x:x.groups(),
|
|
|
|
|
filter(None,map(entry.search,
|
|
|
|
|
process(alsaInfo,'--stdout',envdict=os.environ)))))
|
|
|
|
|
|
|
|
|
|
setValue = Variable.setValue
|
|
|
|
|
|
|
|
|
|