1 __name__
="oggStreams - class of streams in OGG files"
2 __author__
="Maxim Litvinov (aka DarakuTenshi) otaky<at>ukr.net"
11 Class for work with OGG.
13 def __init__(self
, fileName
):
15 Constructor of oggStreams class.
16 @param[IN] fileName - name of OGG file.
18 #Run ogminfo util on given file.
19 OGMINFO
=os
.popen("ogminfo -v \"" + fileName
+ "\"", "r")
20 if(OGMINFO
==None): return NULL
21 STAT
=OGMINFO
.readlines() #Output data from ogminfo to the list of strings.
27 regSTAT
=re
.compile("\(ogminfo.c\) [(](\w)(\d)[/](\S+) (\d)[)] (\S+)")
28 mathSTAT
=regSTAT
.match(i
)
30 HASH
=mathSTAT
.group(1)+mathSTAT
.group(2)
31 self
.streams
[HASH
]=oggStream
.oggStream(mathSTAT
.group(4), mathSTAT
.group(1), fileName
)
33 regSTAT
=re
.compile("\(ogminfo.c\) (\S+)[:](\s+)(\S+)[=]([\S\s]+)[\n]")
34 mathSTAT
=regSTAT
.match(i
)
36 OGGStream
=self
.streams
[mathSTAT
.group(1)]
37 OGGStream
.addAttr(mathSTAT
.group(3), mathSTAT
.group(4))
39 #==============================================================================
42 This function return a list of streams.
44 return self
.streams
.values()
45 #==============================================================================